Skip to content

Commit c930dcd

Browse files
committed
Include raw instructions in agentic CLI metadata and update footer UI and translations
- in CLI > Edit, metadata.json created in the temp directory should hold instructions, so they can be shown in Response Preview - when applying from terminal, show the metadata.json-stored instructions in the Response Preview view ├── apps │ └── editor │ └── src │ ├── commands │ │ └── apply-from-terminal-command.ts │ ├── features │ │ └── apply-response │ │ ├── apply-response.ts │ │ ├── response-processor │ │ │ └── response-processor.ts │ │ └── utils │ │ ├── preview │ │ │ └── preview.ts │ │ └── preview-handler.ts │ ├── utils │ │ └── agentic-cli-invocation │ │ └── invoke-agentic-cli.ts │ └── views │ └── prompt │ ├── backend │ │ ├── message-handlers │ │ │ ├── handle-invoke-agentic-cli.ts │ │ │ └── utils │ │ │ └── build-cli-prompt.ts │ │ └── prompt-view-provider.ts │ ├── frontend │ │ ├── Main │ │ │ ├── Main.tsx │ │ │ └── MainView │ │ │ └── components │ │ │ └── Header │ │ │ └── Header.tsx │ │ ├── Prompt.tsx │ │ └── hooks │ │ ├── use-preview-manager.ts │ │ └── use-prompt │ │ ├── hooks │ │ │ └── use-instructions.ts │ │ └── use-prompt.ts │ └── types │ └── messages.ts └── packages ├── shared │ └── src │ └── types │ └── response-history-item.ts └── ui └── src └── components └── editor └── prompt-view └── ResponsePreview ├── ResponsePreview.module.scss └── ResponsePreview.tsx
1 parent 50e2b73 commit c930dcd

6 files changed

Lines changed: 34 additions & 24 deletions

File tree

‎apps/editor/src/commands/apply-from-terminal-command.ts‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,23 @@ export const apply_from_terminal_command = (): vscode.Disposable => {
139139
let cli_configuration_details:
140140
| { agent: string; flags?: string }
141141
| undefined
142+
let raw_instructions: string | undefined
142143
try {
143144
const metadata_path = path.join(cwd_path, '.cwc', 'metadata.json')
144145
const metadata_content = await fs.promises.readFile(
145146
metadata_path,
146147
'utf-8'
147148
)
148149
const metadata = JSON.parse(metadata_content)
149-
if (metadata && metadata.agent) {
150-
cli_configuration_details = {
151-
agent: metadata.agent,
152-
flags: metadata.flags
150+
if (metadata) {
151+
if (metadata.agent) {
152+
cli_configuration_details = {
153+
agent: metadata.agent,
154+
flags: metadata.flags
155+
}
156+
}
157+
if (metadata.instructions) {
158+
raw_instructions = metadata.instructions
153159
}
154160
}
155161
} catch {
@@ -158,6 +164,7 @@ export const apply_from_terminal_command = (): vscode.Disposable => {
158164

159165
const accepted = await apply_response({
160166
response: diff_markdown,
167+
raw_instructions,
161168
is_from_agentic_cli: true,
162169
cli_configuration_details
163170
})

‎apps/editor/src/i18n/translations/commands/apply-from-terminal-command.ts‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,23 @@ export const translations = {
7373
bg: 'Не са намерени промени в пясъчника на терминала.'
7474
},
7575
'command.apply-from-terminal-command.info.agent-started-edits': {
76-
en: 'Agent started making edits in sandbox. Apply once finished.',
77-
pl: 'Agent rozpoczął wprowadzanie zmian w piaskownicy. Zastosuj po zakończeniu.',
78-
'zh-cn': '代理已开始在沙盒中进行编辑。完成后应用。',
79-
ja: 'エージェントがサンドボックスで編集を開始しました。完了したら適用してください。',
80-
'zh-tw': '代理已開始在沙盒中進行編輯。完成後套用。',
81-
de: 'Der Agent hat mit der Bearbeitung in der Sandbox begonnen. Nach Abschluss anwenden.',
82-
es: 'El agente comenzó a realizar ediciones en el sandbox. Aplicar una vez finalizado.',
83-
fr: "L'agent a commencé à effectuer des modifications dans la sandbox. Appliquez une fois terminé.",
76+
en: 'Agent started making edits in sandbox. Apply to the workspace once finished.',
77+
pl: 'Agent rozpoczął wprowadzanie zmian w piaskownicy. Zastosuj do obszaru roboczego po zakończeniu.',
78+
'zh-cn': '代理已开始在沙盒中进行编辑。完成后请应用到工作区。',
79+
ja: 'エージェントがサンドボックスで編集を開始しました。完了したらワークスペースに適用してください。',
80+
'zh-tw': '代理已開始在沙盒中進行編輯。完成後請套用到工作區。',
81+
de: 'Der Agent hat mit der Bearbeitung in der Sandbox begonnen. Nach Abschluss auf den Arbeitsbereich anwenden.',
82+
es: 'El agente comenzó a realizar ediciones en el sandbox. Aplícalo al espacio de trabajo una vez finalizado.',
83+
fr: "L'agent a commencé à effectuer des modifications dans la sandbox. Appliquez-les à l'espace de travail une fois terminé.",
8484
'pt-br':
85-
'O agente começou a fazer edições no sandbox. Aplique quando terminar.',
86-
ru: 'Агент начал вносить правки в песочнице. Примените по завершении.',
87-
ko: '에이전트가 샌드박스에서 편집을 시작했습니다. 완료되면 적용하세요.',
88-
it: "L'agente ha iniziato ad apportare modifiche nella sandbox. Applica una volta terminato.",
89-
tr: "Aracı sandbox'ta düzenlemeler yapmaya başladı. Tamamlandığında uygulayın.",
90-
cs: 'Agent začal provádět úpravy v sandboxu. Po dokončení použijte.',
91-
hu: 'Az ügynök megkezdte a szerkesztést a homokozóban. Ha végzett, alkalmazza.',
92-
bg: 'Агентът започна да прави редакции в пясъчника. Приложете след завършване.'
85+
'O agente começou a fazer edições no sandbox. Aplique ao espaço de trabalho quando terminar.',
86+
ru: 'Агент начал вносить изменения в песочнице. Примените их к рабочей области после завершения.',
87+
ko: '에이전트가 샌드박스에서 편집을 시작했습니다. 완료되면 작업 영역에 적용하세요.',
88+
it: "L'agente ha iniziato ad apportare modifiche nella sandbox. Applica all'area di lavoro una volta terminato.",
89+
tr: 'Ajan sandbox üzerinde düzenleme yapmaya başladı. Tamamlandığında çalışma alanına uygulayın.',
90+
cs: 'Agent začal provádět úpravy v sandboxu. Po dokončení je použijte na pracovní prostor.',
91+
hu: 'Az ügynök megkezdte a szerkesztést a homokozóban. Ha végzett, alkalmazza a munkaterületre.',
92+
bg: 'Агентът започна да прави редакции в пясъчника. Приложете към работното пространство, след като приключи.'
9393
},
9494
'command.apply-from-terminal-command.action.apply': {
9595
en: 'Apply',

‎apps/editor/src/utils/agentic-cli-invocation/invoke-agentic-cli.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export const invoke_agentic_cli = async (params: {
4848
invocation_count?: number
4949
allow_adding_invocations?: boolean
5050
target_folder?: string
51+
raw_instructions?: string
5152
}): Promise<
5253
| {
5354
agent_output: string
@@ -419,7 +420,8 @@ export const invoke_agentic_cli = async (params: {
419420
JSON.stringify({
420421
agent: selected_agent_info?.label,
421422
flags: flags_string,
422-
files: files_array
423+
files: files_array,
424+
instructions: params.raw_instructions
423425
}),
424426
'utf-8'
425427
)

‎apps/editor/src/views/prompt/backend/message-handlers/handle-invoke-agentic-cli.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const handle_invoke_agentic_cli = async (
4747
agent_state_key: last_used_key,
4848
last_selected_workspace_state_key:
4949
LAST_SELECTED_WORKSPACE_IN_AGENTIC_CLI_STATE_KEY,
50+
raw_instructions: current_instructions,
5051
isolate_in_temp_dir: true,
5152
copy_selected_files: prompt_type === 'edit',
5253
generate_diff_for_temp_dir: prompt_type === 'edit',

‎apps/editor/src/views/prompt/frontend/components/Layout/Footer/Footer.module.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
color 0.25s ease;
3434

3535
&:hover {
36-
filter: brightness(0.85);
36+
filter: brightness(0.9);
3737
}
3838

3939
&--discord {

‎apps/editor/src/views/prompt/frontend/components/Layout/Footer/Footer.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ export const Footer: React.FC<Props> = (props) => {
8787
is_compact={compact_step >= 3}
8888
on_click={on_commit_click}
8989
disabled={!has_changes_to_commit}
90-
codicon="git-commit"
90+
codicon="git-pull-request-comment"
9191
label={t('footer.action.commit')}
9292
/>
9393
<CompactableActionButton
9494
is_compact={compact_step >= 4}
9595
on_click={on_apply_click}
96-
codicon="clippy"
96+
codicon="sparkle"
9797
label={t('footer.action.apply')}
9898
/>
9999
</div>

0 commit comments

Comments
 (0)