Skip to content

Commit f516fae

Browse files
committed
Implement agent configurations management for CLI mode
- simplify to ['WEB', 'API', 'CLI'] as const` - similarly to chatbots, allow managing agents (CLI target). Each item can hold properties: name (string) agent (string), flags (string) and 'isPinned' (boolean). - menu is broken, CLI should have only Agents item - in panel, in CLI target, place Configurations with agents, just like you do with WEB->Chatbots - should allow editing agents in 'prompt' pane, just like chatbots which can be configured in settings and in prompt pane - on cli target, 'no models configured yet', should be set as 'no agents configured yet' - in `apps/editor/src/utils/agentic-cli-invocation/agents` agent name, docs url should be taken from `apps/editor/src/constants/agents.ts` - in the quick pick of agentic cli invocation, list agents defined in codeWebChat.agents and remove 'cli flags...' - remove doc button - when editing agent, below flags field add text "[Learn more]() about available flags in [agent name]" - docs link (learn more) opens twice - add missing translations - add missing translationssort alphabetically - remember last used cli configuration (agent), on prompt field allow separate buttons 'send'/'send with...' and highlight last used item in Configurations (Main View) (get inspired by web/api configurations) - [Pasted text] ``` ├── apps │ └── editor │ ├── package.json │ └── src │ ├── constants │ │ ├── agents.ts │ │ └── state-keys.ts │ ├── features │ │ └── agentic-search │ │ └── agentic-search.ts │ ├── i18n │ │ └── translations │ │ ├── common.ts │ │ ├── utils │ │ │ └── agentic-cli-invocation.ts │ │ └── views │ │ └── shared │ │ └── actions │ │ ├── agent │ │ │ ├── create.ts │ │ │ ├── delete.ts │ │ │ ├── index.ts │ │ │ └── pick-agent.ts │ │ ├── api │ │ │ └── index.ts │ │ ├── index.ts │ │ └── web │ │ ├── create.ts │ │ ├── delete.ts │ │ ├── index.ts │ │ ├── pick-chatbot.ts │ │ ├── pick-model.ts │ │ └── update.ts │ ├── services │ │ └── websocket-manager.ts │ ├── utils │ │ ├── agent-configuration-format-converters.ts │ │ ├── agentic-cli-invocation │ │ │ ├── agents │ │ │ │ ├── antigravity.ts │ │ │ │ ├── claude.ts │ │ │ │ ├── codex.ts │ │ │ │ ├── cursor.ts │ │ │ │ ├── grok.ts │ │ │ │ ├── index.ts │ │ │ │ ├── muse.ts │ │ │ │ └── opencode.ts │ │ │ ├── index.ts │ │ │ ├── invoke-agentic-cli.ts │ │ │ ├── types.ts │ │ │ └── utils │ │ │ ├── check-command-exists.ts │ │ │ ├── format-duration.ts │ │ │ └── get-progress-dots.ts │ │ ├── show-configurations-quick-pick.ts │ │ └── web-configuration-format-converters.ts │ └── views │ ├── prompt │ │ ├── backend │ │ │ ├── message-handlers │ │ │ │ ├── handle-autofill.ts │ │ │ │ ├── handle-create-agent-configuration.ts │ │ │ │ ├── handle-create-web-configuration.ts │ │ │ │ ├── handle-delete-agent-configuration.ts │ │ │ │ ├── handle-delete-web-configuration.ts │ │ │ │ ├── handle-invoke-agentic-cli.ts │ │ │ │ ├── handle-make-api-call.ts │ │ │ │ ├── handle-pick-agent.ts │ │ │ │ ├── handle-pick-chatbot.ts │ │ │ │ ├── handle-pick-model.ts │ │ │ │ ├── handle-pick-reasoning-effort.ts │ │ │ │ ├── handle-preview-web-configuration.ts │ │ │ │ ├── handle-reorder-agent-configurations.ts │ │ │ │ ├── handle-reorder-web-configurations.ts │ │ │ │ ├── handle-toggle-pinned-agent-configuration.ts │ │ │ │ ├── handle-toggle-pinned-web-configuration.ts │ │ │ │ ├── handle-update-agent-configuration.ts │ │ │ │ ├── handle-update-last-used-web-configuration.ts │ │ │ │ ├── handle-update-web-configuration.ts │ │ │ │ └── index.ts │ │ │ └── prompt-view-provider.ts │ │ ├── frontend │ │ │ ├── Main │ │ │ │ ├── Main.tsx │ │ │ │ └── MainView │ │ │ │ ├── MainView.module.scss │ │ │ │ ├── MainView.tsx │ │ │ │ └── hooks │ │ │ │ └── use-last-choice-tooltip.ts │ │ │ ├── Prompt.tsx │ │ │ ├── hooks │ │ │ │ ├── use-agent-configuration-editing.ts │ │ │ │ └── use-web-configuration-editing.ts │ │ │ └── i18n │ │ │ └── translations │ │ │ ├── configurations.ts │ │ │ ├── index.ts │ │ │ └── prompt-field.ts │ │ └── types │ │ └── messages.ts │ ├── settings │ │ ├── backend │ │ │ ├── message-handlers │ │ │ │ ├── handle-create-agent-configuration.ts │ │ │ │ ├── handle-create-web-configuration.ts │ │ │ │ ├── handle-delete-agent-configuration.ts │ │ │ │ ├── handle-delete-web-configuration.ts │ │ │ │ ├── handle-pick-agent.ts │ │ │ │ ├── handle-pick-chatbot.ts │ │ │ │ ├── handle-pick-model.ts │ │ │ │ ├── handle-pick-reasoning-effort.ts │ │ │ │ ├── handle-reorder-agent-configurations.ts │ │ │ │ ├── handle-reorder-web-configurations.ts │ │ │ │ ├── handle-update-agent-configuration.ts │ │ │ │ ├── handle-update-web-configuration.ts │ │ │ │ └── index.ts │ │ │ └── settings-view-provider.ts │ │ ├── frontend │ │ │ ├── App.tsx │ │ │ ├── Home │ │ │ │ ├── Home.tsx │ │ │ │ ├── hooks │ │ │ │ │ └── use-scroll-to.ts │ │ │ │ ├── index.ts │ │ │ │ └── sections │ │ │ │ ├── ApiSection.tsx │ │ │ │ ├── CliSection.tsx │ │ │ │ ├── GeneralSection.tsx │ │ │ │ └── WebSection.tsx │ │ │ ├── Settings.tsx │ │ │ ├── forms │ │ │ │ ├── EditProviderForm │ │ │ │ │ ├── EditProviderForm.module.scss │ │ │ │ │ ├── EditProviderForm.tsx │ │ │ │ │ └── index.ts │ │ │ │ └── EditTemplateForm │ │ │ │ ├── EditTemplateForm.module.scss │ │ │ │ ├── EditTemplateForm.tsx │ │ │ │ └── index.ts │ │ │ ├── hooks │ │ │ │ ├── use-agent-configuration-editing.ts │ │ │ │ ├── use-api-configuration-editing.ts │ │ │ │ ├── use-provider-editing.ts │ │ │ │ ├── use-settings.ts │ │ │ │ └── use-web-configuration-editing.ts │ │ │ ├── i18n │ │ │ │ └── translations │ │ │ │ ├── agent.ts │ │ │ │ ├── index.ts │ │ │ │ └── web.ts │ │ │ └── utils │ │ │ └── post-message.ts │ │ ├── helpers │ │ │ └── open-settings.ts │ │ └── types │ │ └── messages.ts │ └── shared │ ├── actions │ │ ├── agent │ │ │ ├── create.ts │ │ │ ├── delete.ts │ │ │ ├── pick-agent.ts │ │ │ ├── reorder.ts │ │ │ ├── toggle-pinned.ts │ │ │ └── update.ts │ │ └── web │ │ ├── create.ts │ │ ├── delete.ts │ │ ├── pick-chatbot.ts │ │ ├── pick-model.ts │ │ ├── reorder.ts │ │ ├── toggle-pinned.ts │ │ └── update.ts │ ├── forms │ │ ├── EditAgentConfigurationForm │ │ │ ├── EditAgentConfigurationForm.module.scss │ │ │ ├── EditAgentConfigurationForm.tsx │ │ │ └── index.ts │ │ └── EditWebConfigurationForm │ │ ├── EditWebConfigurationForm.module.scss │ │ ├── EditWebConfigurationForm.tsx │ │ └── index.ts │ ├── hooks │ │ └── use-translation.tsx │ ├── i18n │ │ ├── translations │ │ │ ├── common.ts │ │ │ ├── edit-agent-configuration-form.ts │ │ │ ├── edit-web-configuration-form.ts │ │ │ └── index.ts │ │ └── use-translation.tsx │ └── utils │ └── generate-unique-name.ts └── packages ├── shared │ └── src │ ├── constants │ │ └── chatbots.ts │ └── types │ ├── agent-configuration.ts │ ├── target.ts │ └── web-configuration.ts └── ui └── src └── components └── editor ├── common │ └── prompts │ └── PromptField │ ├── PromptField.module.scss │ ├── PromptField.tsx │ └── hooks │ ├── use-dropdown.ts │ └── use-handlers │ ├── handle-key-down.ts │ └── handle-submit.ts └── prompt └── Configurations ├── Configurations.module.scss └── Configurations.tsx ```
1 parent 2b2fe2a commit f516fae

64 files changed

Lines changed: 2521 additions & 433 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/editor/package.json‎

Lines changed: 29 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,60 +1007,42 @@
10071007
"scope": "resource",
10081008
"default": "In the project, find the complete set of primary and structural files relevant to the query."
10091009
},
1010-
"codeWebChat.cliFlagsAntigravity": {
1011-
"type": "array",
1012-
"scope": "resource",
1013-
"items": {
1014-
"type": "string"
1015-
}
1016-
},
1017-
"codeWebChat.cliFlagsClaude": {
1018-
"type": "array",
1019-
"scope": "resource",
1020-
"items": {
1021-
"type": "string"
1022-
}
1023-
},
1024-
"codeWebChat.cliFlagsCodex": {
1025-
"type": "array",
1026-
"scope": "resource",
1027-
"items": {
1028-
"type": "string"
1029-
}
1030-
},
1031-
"codeWebChat.cliFlagsCursor": {
1032-
"type": "array",
1033-
"scope": "resource",
1034-
"items": {
1035-
"type": "string"
1036-
}
1037-
},
1038-
"codeWebChat.cliFlagsGrok": {
1039-
"type": "array",
1040-
"scope": "resource",
1041-
"items": {
1042-
"type": "string"
1043-
}
1044-
},
1045-
"codeWebChat.cliFlagsMuse": {
1046-
"type": "array",
1010+
"codeWebChat.editFilesSystemInstructions": {
1011+
"type": "string",
10471012
"scope": "resource",
1048-
"items": {
1049-
"type": "string"
1050-
}
1013+
"default": "You're a helpful coding assistant."
10511014
},
1052-
"codeWebChat.cliFlagsOpencode": {
1015+
"codeWebChat.agents": {
10531016
"type": "array",
10541017
"scope": "resource",
1018+
"default": [
1019+
{
1020+
"name": "(1)",
1021+
"agent": "Codex"
1022+
},
1023+
{
1024+
"name": "(2)",
1025+
"agent": "Claude Code"
1026+
}
1027+
],
10551028
"items": {
1056-
"type": "string"
1029+
"type": "object",
1030+
"properties": {
1031+
"name": {
1032+
"type": "string"
1033+
},
1034+
"agent": {
1035+
"type": "string"
1036+
},
1037+
"flags": {
1038+
"type": "string"
1039+
},
1040+
"isPinned": {
1041+
"type": "boolean"
1042+
}
1043+
}
10571044
}
10581045
},
1059-
"codeWebChat.editFilesSystemInstructions": {
1060-
"type": "string",
1061-
"scope": "resource",
1062-
"default": "You're a helpful coding assistant."
1063-
},
10641046
"codeWebChat.chatbots": {
10651047
"type": "array",
10661048
"scope": "resource",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
type Agents = {
2+
[name: string]: {
3+
docs_url?: string
4+
}
5+
}
6+
7+
export const AGENTS = {
8+
Antigravity: {
9+
docs_url: 'https://antigravity.google/docs/cli/headless/'
10+
},
11+
'Claude Code': { docs_url: 'https://code.claude.com/docs/en/headless' },
12+
Codex: {
13+
docs_url: 'https://learn.chatgpt.com/docs/non-interactive-mode'
14+
},
15+
Cursor: { docs_url: 'https://cursor.com/docs/cli/headless' },
16+
'Grok Build': { docs_url: 'https://docs.x.ai/build/cli/headless-scripting' },
17+
'Muse Code': { docs_url: 'https://dev.meta.ai/docs/muse-code/extending#headless' },
18+
OpenCode: { docs_url: 'https://opencode.ai/docs/cli/' }
19+
} satisfies Agents

‎apps/editor/src/constants/state-keys.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ export const LAST_USED_VOICE_INPUT_CONFIG_ID_STATE_KEY =
6262
export const get_last_used_web_configuration_key = (web_prompt_type: string) =>
6363
`last-used-web-configuration-${web_prompt_type}`
6464

65+
export const get_last_used_agent_configuration_key = (prompt_type: string) =>
66+
`last-used-agent-configuration-${prompt_type}`
67+
6568
export const get_last_used_template_key = (prompt_type: string) =>
6669
`last-used-template-${prompt_type}`
6770

‎apps/editor/src/features/agentic-search/agentic-search.ts‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,32 @@ export const agentic_search = async (params: {
6262
}
6363
)
6464

65+
const last_used_agent_config_name =
66+
params.extension_context.workspaceState.get<string>(
67+
LAST_USED_AGENTIC_SEARCH_AGENT_STATE_KEY
68+
) ??
69+
params.extension_context.globalState.get<string>(
70+
LAST_USED_AGENTIC_SEARCH_AGENT_STATE_KEY
71+
)
72+
6573
const result = await invoke_agentic_cli({
6674
workspace_provider: params.workspace_provider,
6775
extension_context: params.extension_context,
6876
title: t('common.title.agentic-search'),
6977
waiting_message: t(
7078
'utils.agentic-cli-invocation.agent.waiting-for-agent'
7179
),
72-
last_used_agent_state_key: LAST_USED_AGENTIC_SEARCH_AGENT_STATE_KEY,
80+
last_used_agent_config_name,
81+
on_agent_selected: (name: string) => {
82+
params.extension_context.workspaceState.update(
83+
LAST_USED_AGENTIC_SEARCH_AGENT_STATE_KEY,
84+
name
85+
)
86+
params.extension_context.globalState.update(
87+
LAST_USED_AGENTIC_SEARCH_AGENT_STATE_KEY,
88+
name
89+
)
90+
},
7391
last_selected_workspace_state_key:
7492
LAST_SELECTED_WORKSPACE_IN_AGENTIC_SEARCH_STATE_KEY,
7593
show_back_button: true,

‎apps/editor/src/i18n/translations/common.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,24 @@ export const translations = {
611611
hu: 'Chatbotok',
612612
bg: 'Чатботове'
613613
},
614+
'common.title.agents': {
615+
en: 'Agents',
616+
pl: 'Agenci',
617+
'zh-cn': '智能体',
618+
ja: 'エージェント',
619+
'zh-tw': '智能體',
620+
de: 'Agenten',
621+
es: 'Agentes',
622+
fr: 'Agents',
623+
'pt-br': 'Agentes',
624+
ru: 'Агенты',
625+
ko: '에이전트',
626+
it: 'Agenti',
627+
tr: 'Aracılar',
628+
cs: 'Agenti',
629+
hu: 'Ügynökök',
630+
bg: 'Агенти'
631+
},
614632
'common.select-parent-folder': {
615633
en: 'Select Parent Folder...',
616634
pl: 'Wybierz folder nadrzędny...',

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

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -71,41 +71,41 @@ export const translations = {
7171
hu: 'Jelzők törlése',
7272
bg: 'Изтриване на флагове'
7373
},
74-
'utils.agentic-cli-invocation.agent.installed-coding-agents': {
75-
en: 'Installed Coding Agents',
76-
pl: 'Zainstalowani agenci programistyczni',
77-
'zh-cn': '已安装的编程智能体',
78-
ja: 'インストール済みのコーディングエージェント',
79-
'zh-tw': '已安裝的編程智能體',
80-
de: 'Installierte Coding-Agenten',
81-
es: 'Agentes de programación instalados',
82-
fr: 'Agents de codage installés',
83-
'pt-br': 'Agentes de codificação instalados',
84-
ru: 'Установленные агенты программирования',
85-
ko: '설치된 코딩 에이전트',
86-
it: 'Agenti di programmazione installati',
87-
tr: 'Yüklü Kodlama Aracıları',
88-
cs: 'Nainstalovaní programovací agenti',
89-
hu: 'Telepített kódoló ügynökök',
90-
bg: 'Инсталирани агенти за програмиране'
74+
'utils.agentic-cli-invocation.agent.agents': {
75+
en: 'Agents',
76+
pl: 'Agenci',
77+
'zh-cn': '智能体',
78+
ja: 'エージェント',
79+
'zh-tw': '智能體',
80+
de: 'Agenten',
81+
es: 'Agentes',
82+
fr: 'Agents',
83+
'pt-br': 'Agentes',
84+
ru: 'Агенты',
85+
ko: '에이전트',
86+
it: 'Agenti',
87+
tr: 'Aracılar',
88+
cs: 'Agenti',
89+
hu: 'Ügynökök',
90+
bg: 'Агенти'
9191
},
92-
'utils.agentic-cli-invocation.agent.installed-coding-agents-placeholder': {
93-
en: 'Select an agent to perform the search',
94-
pl: 'Wybierz agenta, aby wykonać wyszukiwanie',
95-
'zh-cn': '选择一个智能体来执行搜索',
96-
ja: '検索を実行するエージェントを選択します',
97-
'zh-tw': '選擇一個智能體來執行搜尋',
98-
de: 'Wählen Sie einen Agenten, um die Suche durchzuführen',
99-
es: 'Seleccione un agente para realizar la búsqueda',
100-
fr: 'Sélectionnez un agent pour effectuer la recherche',
101-
'pt-br': 'Selecione um agente para realizar a pesquisa',
102-
ru: 'Выберите агента для выполнения поиска',
103-
ko: '검색을 수행할 에이전트를 선택하세요',
104-
it: 'Seleziona un agente per eseguire la ricerca',
105-
tr: 'Arama yapmak için bir aracı seçin',
106-
cs: 'Vyberte agenta pro provedení hledání',
107-
hu: 'Válasszon ügynököt a keresés végrehajtásához',
108-
bg: 'Изберете агент, който да извърши търсенето'
92+
'utils.agentic-cli-invocation.agent.agents-placeholder': {
93+
en: 'Select an agent',
94+
pl: 'Wybierz agenta',
95+
'zh-cn': '选择智能体',
96+
ja: 'エージェントを選択',
97+
'zh-tw': '選擇智能體',
98+
de: 'Wählen Sie einen Agenten aus',
99+
es: 'Seleccione un agente',
100+
fr: 'Sélectionner un agent',
101+
'pt-br': 'Selecione um agente',
102+
ru: 'Выберите агента',
103+
ko: '에이전트 선택',
104+
it: 'Seleziona un agente',
105+
tr: 'Bir aracı seçin',
106+
cs: 'Vybrat agenta',
107+
hu: 'Válasszon ki egy ügynököt',
108+
bg: 'Изберете агент'
109109
},
110110
'utils.agentic-cli-invocation.agent.edit-flags-prompt': {
111111
en: 'Enter custom CLI flags for the agent',
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export const translations = {
2+
'views.shared.actions.agent.create.agents.placeholder': {
3+
en: 'Choose an agent from the supported list',
4+
pl: 'Wybierz agenta z obsługiwanej listy',
5+
'zh-cn': '从支持的列表中选择一个智能体',
6+
ja: 'サポートされているリストからエージェントを選択してください',
7+
'zh-tw': '從支援的清單中選擇一個智能體',
8+
de: 'Wählen Sie einen Agenten aus der unterstützten Liste',
9+
es: 'Elija un agente de la lista admitida',
10+
fr: 'Choisissez un agent dans la liste prise en charge',
11+
'pt-br': 'Escolha um agente da lista suportada',
12+
ru: 'Выберите агента из поддерживаемого списка',
13+
ko: '지원되는 목록에서 에이전트를 선택하세요',
14+
it: "Scegli un agente dall'elenco supportato",
15+
tr: 'Desteklenen listeden bir aracı seçin',
16+
cs: 'Vyberte agenta z podporovaného seznamu',
17+
hu: 'Válasszon egy ügynököt a támogatott listáról',
18+
bg: 'Изберете агент от поддържания списък'
19+
}
20+
} as const
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export const translations = {
2+
'views.shared.actions.agent.delete.unnamed': {
3+
en: 'Unnamed',
4+
pl: 'Nienazwany',
5+
'zh-cn': '未命名',
6+
ja: '無名',
7+
'zh-tw': '未命名',
8+
de: 'Unbenannt',
9+
es: 'Sin nombre',
10+
fr: 'Sans nom',
11+
'pt-br': 'Sem nome',
12+
ru: 'Без имени',
13+
ko: '이름 없음',
14+
it: 'Senza nome',
15+
tr: 'İsimsiz',
16+
cs: 'Nepojmenovaný',
17+
hu: 'Névtelen',
18+
bg: 'Без име'
19+
}
20+
} as const
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { translations as create } from './create'
2+
import { translations as delete_translations } from './delete'
3+
import { translations as pick_agent } from './pick-agent'
4+
5+
export const translations = {
6+
...create,
7+
...delete_translations,
8+
...pick_agent
9+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export const translations = {
2+
'views.shared.actions.agent.pick-agent.placeholder': {
3+
en: 'Choose an agent',
4+
pl: 'Wybierz agenta',
5+
'zh-cn': '选择一个智能体',
6+
ja: 'エージェントを選択',
7+
'zh-tw': '選擇一個智能體',
8+
de: 'Wählen Sie einen Agenten',
9+
es: 'Elige un agente',
10+
fr: 'Choisissez un agent',
11+
'pt-br': 'Escolha um agente',
12+
ru: 'Выберите агента',
13+
ko: '에이전트를 선택하세요',
14+
it: 'Scegli un agente',
15+
tr: 'Bir aracı seçin',
16+
cs: 'Vyberte agenta',
17+
hu: 'Válasszon ügynököt',
18+
bg: 'Изберете агент'
19+
}
20+
} as const

0 commit comments

Comments
 (0)