Skip to content

Commit 6932dbb

Browse files
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.ts
1 parent 29fe884 commit 6932dbb

26 files changed

Lines changed: 271 additions & 5 deletions

‎apps/editor/package.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,12 @@
425425
"command": "codeWebChat.installSpecificVersion",
426426
"title": "%codeWebChat.installSpecificVersion.title%",
427427
"category": "%codeWebChat.category%"
428+
},
429+
{
430+
"command": "codeWebChat.applyFromTerminal",
431+
"title": "%codeWebChat.applyFromTerminal.title%",
432+
"category": "%codeWebChat.category%",
433+
"icon": "$(terminal)"
428434
}
429435
],
430436
"submenus": [

‎apps/editor/package.nls.bg.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
"codeWebChat.copyMergeCommitDetails.title": "Копиране на детайлите на обединените къмити",
6262
"codeWebChat.checkForUpdates.title": "Проверка за актуализации",
6363
"codeWebChat.installSpecificVersion.title": "Инсталирай специфична версия...",
64+
"codeWebChat.applyFromTerminal.title": "Приложи от терминала",
6465
"codeWebChat.category": "CWC"
6566
}

‎apps/editor/package.nls.cs.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
"codeWebChat.copyMergeCommitDetails.title": "Kopírovat podrobnosti sloučených commitů",
6262
"codeWebChat.checkForUpdates.title": "Zkontrolovat aktualizace",
6363
"codeWebChat.installSpecificVersion.title": "Nainstalovat konkrétní verzi...",
64+
"codeWebChat.applyFromTerminal.title": "Použít z terminálu",
6465
"codeWebChat.category": "CWC"
6566
}

‎apps/editor/package.nls.de.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
"codeWebChat.copyMergeCommitDetails.title": "Details der zusammengefassten Commits kopieren",
6262
"codeWebChat.checkForUpdates.title": "Nach Updates suchen",
6363
"codeWebChat.installSpecificVersion.title": "Bestimmte Version installieren...",
64+
"codeWebChat.applyFromTerminal.title": "Vom Terminal anwenden",
6465
"codeWebChat.category": "CWC"
6566
}

‎apps/editor/package.nls.es.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
"codeWebChat.copyMergeCommitDetails.title": "Copiar detalles de commits agrupados",
6262
"codeWebChat.checkForUpdates.title": "Buscar actualizaciones",
6363
"codeWebChat.installSpecificVersion.title": "Instalar versión específica...",
64+
"codeWebChat.applyFromTerminal.title": "Aplicar desde la terminal",
6465
"codeWebChat.category": "CWC"
6566
}

‎apps/editor/package.nls.fr.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
"codeWebChat.copyMergeCommitDetails.title": "Copier les détails des commits fusionnés",
6262
"codeWebChat.checkForUpdates.title": "Vérifier les mises à jour",
6363
"codeWebChat.installSpecificVersion.title": "Installer une version spécifique...",
64+
"codeWebChat.applyFromTerminal.title": "Appliquer depuis le terminal",
6465
"codeWebChat.category": "CWC"
6566
}

‎apps/editor/package.nls.hu.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
"codeWebChat.copyMergeCommitDetails.title": "Egyesített commit részletek másolása",
6262
"codeWebChat.checkForUpdates.title": "Frissítések keresése",
6363
"codeWebChat.installSpecificVersion.title": "Konkrét verzió telepítése...",
64+
"codeWebChat.applyFromTerminal.title": "Alkalmazás terminálból",
6465
"codeWebChat.category": "CWC"
6566
}

‎apps/editor/package.nls.it.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
"codeWebChat.copyMergeCommitDetails.title": "Copia i dettagli dei commit uniti",
6262
"codeWebChat.checkForUpdates.title": "Controlla aggiornamenti",
6363
"codeWebChat.installSpecificVersion.title": "Installa versione specifica...",
64+
"codeWebChat.applyFromTerminal.title": "Applica dal terminale",
6465
"codeWebChat.category": "CWC"
6566
}

‎apps/editor/package.nls.ja.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
"codeWebChat.copyMergeCommitDetails.title": "マージされたコミットの詳細をコピー",
6262
"codeWebChat.checkForUpdates.title": "更新を確認",
6363
"codeWebChat.installSpecificVersion.title": "特定のバージョンをインストール...",
64+
"codeWebChat.applyFromTerminal.title": "ターミナルから適用",
6465
"codeWebChat.category": "CWC"
6566
}

‎apps/editor/package.nls.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
"codeWebChat.copyMergeCommitDetails.title": "Copy Merge Commit Details",
6262
"codeWebChat.checkForUpdates.title": "Check for Updates",
6363
"codeWebChat.installSpecificVersion.title": "Install Specific Version...",
64+
"codeWebChat.applyFromTerminal.title": "Apply from Terminal",
6465
"codeWebChat.category": "CWC"
6566
}

0 commit comments

Comments
 (0)