Repository navigation
Commit 6932dbb
committed
Add Apply from Terminal command to apply CWC CLI sandbox changes via response preview with agent metadata support
- create command 'apply from terminal', what it does is checking if the active terminal session is in CWD: `[os temp dir]/cwc-cli-[hash]`, if it is, place comment `// handle applying` if it's not, show appropriate notification. Also make it disabled when there is an ongoing response in preview (just like history command).
- cretate translation file for `apps/editor/src/commands/apply-from-terminal-command/apply-from-terminal-command.ts` and place custom disabled translation there
- in `apps/editor/src/commands/apply-from-terminal-command/apply-from-terminal-command.ts`, compare files in the sandbox dir to the live workspace, construct response and apply it.
- prompt.md is never placed in sandbox dir. in `apps/editor/src/commands/apply-from-terminal-command/apply-from-terminal-command.ts`, don't use progress notification - the process is fast.
- agentic cli sandboxes for edit/ask should be suffixed with 'edit' 'ask': `cwc-cli-edit-[hash]` `cwc-cli-ask-[hash]`. `apps/editor/src/commands/apply-from-terminal-command/apply-from-terminal-command.ts` forks only for 'edit' sandboxes.
- in `apps/editor/src/commands/apply-response-command/apply-response-command.ts`, should improve cwd path checking by using startsWith and no tmp/temp words, just os.tmpdir and sandbox folder name
- is the logic of getting workspace files, sandbox files, comparing them - repeated? should not
- in the sandbox/.cwc folder store metadata file that holds agent name, used flags so `apps/editor/src/commands/apply-from-terminal-command/apply-from-terminal-command.ts` has access to it
├── apps
│ └── editor
│ ├── package.json
│ ├── package.nls.bg.json
│ ├── package.nls.cs.json
│ ├── package.nls.de.json
│ ├── package.nls.es.json
│ ├── package.nls.fr.json
│ ├── package.nls.hu.json
│ ├── package.nls.it.json
│ ├── package.nls.ja.json
│ ├── package.nls.json
│ ├── package.nls.ko.json
│ ├── package.nls.pl.json
│ ├── package.nls.pt-br.json
│ ├── package.nls.ru.json
│ ├── package.nls.tr.json
│ ├── package.nls.zh-cn.json
│ ├── package.nls.zh-tw.json
│ └── src
│ ├── commands
│ │ ├── apply-from-terminal-command
│ │ │ ├── apply-from-terminal-command.ts
│ │ │ └── index.ts
│ │ ├── apply-response-command
│ │ │ ├── apply-response-command.ts
│ │ │ └── utils
│ │ │ └── preview
│ │ │ └── vscode-ui.ts
│ │ ├── code-at-cursor-command
│ │ │ └── utils
│ │ │ └── perform-code-at-cursor.ts
│ │ ├── generate-commit-message-commands
│ │ │ └── actions
│ │ │ └── run-generate-action.ts
│ │ ├── history-command
│ │ │ └── history-command.ts
│ │ └── index.ts
│ ├── extension.ts
│ ├── features
│ │ ├── agentic-search
│ │ │ └── agentic-search.ts
│ │ └── search-files
│ │ └── search-modes
│ │ └── perform-intelligent-search-mode.ts
│ ├── i18n
│ │ └── translations
│ │ └── commands
│ │ ├── apply-from-terminal-command.ts
│ │ ├── history-command.ts
│ │ └── index.ts
│ ├── utils
│ │ └── agentic-cli-invocation
│ │ ├── agents
│ │ │ ├── antigravity.ts
│ │ │ ├── claude.ts
│ │ │ ├── codex.ts
│ │ │ ├── cursor.ts
│ │ │ ├── devin.ts
│ │ │ ├── grok.ts
│ │ │ ├── index.ts
│ │ │ └── opencode.ts
│ │ ├── index.ts
│ │ ├── invoke-agentic-cli.ts
│ │ ├── types.ts
│ │ └── utils
│ │ ├── check-command-exists.ts
│ │ ├── format-duration.ts
│ │ ├── generate-diff-markdown.ts
│ │ └── get-progress-dots.ts
│ └── views
│ └── prompt
│ └── backend
│ └── message-handlers
│ ├── handle-invoke-agentic-cli.ts
│ ├── handle-patch-repair.ts
│ └── handle-voice-input.ts
└── packages
└── shared
└── src
└── types
└── prompt-types.ts1 parent 29fe884 commit 6932dbb
26 files changed
Lines changed: 271 additions & 5 deletions
File tree
- apps/editor
- src
- commands
- apply-from-terminal-command
- history-command
- i18n/translations/commands
- utils/agentic-cli-invocation
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
428 | 434 | | |
429 | 435 | | |
430 | 436 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
0 commit comments