Skip to content

Commit d3e1748

Browse files
committed
Add example flags quick pick to agent configuration form and consolidate unset translations
- on agents, place optional key 'example_flags'. it's an array of strings. if set, where you typically set 'unset', place text button: 'examples'. Upon click, open a quick pick with the examples. Upon selection, update 'flags' field value - use lower case [Fragment] - once something is typed in the field, instead of 'examples', show 'unset' button. 'eamples' should only be shown when the field is empty - ERROR in ./src/views/shared/actions/agent/pick-example-flags.ts:9:22 TS2339: Property 'example_flags' does not exist on type '{ docs_url: string; homepage_url: string; flags_placeholder: string; example_flags: string[]; } | { docs_url: string; homepage_url: string; flags_placeholder: string; example_flags: string[]; } | { ...; } | { ...; } | { ...; } | { ...; }'. Property 'example_flags' does not exist on type '{ docs_url: string; homepage_url: string; flags_placeholder: string; }'. 7 | }): Promise<string | undefined> => { 8 | const agent_config = AGENTS[params.agent as keyof typeof AGENTS] > 9 | if (!agent_config?.example_flags?.length) { | ^^^^^^^^^^^^^ 10 | return undefined 11 | } 12 | ERROR in ./src/views/shared/actions/agent/pick-example-flags.ts:13:54 TS2339: Property 'example_flags' does not exist on type '{ docs_url: string; homepage_url: string; flags_placeholder: string; example_flags: string[]; } | { docs_url:... - to avoid [Pasted text], make example flags required property and provide empty array if necessary - 'unset' should be in common - lowercase unset translations ├── apps │ ├── browser │ │ └── package.json │ ├── editor │ │ ├── package.json │ │ ├── src │ │ │ ├── constants │ │ │ │ └── agents.ts │ │ │ ├── i18n │ │ │ │ ├── index.ts │ │ │ │ └── translations │ │ │ │ └── views │ │ │ │ ├── index.ts │ │ │ │ └── shared │ │ │ │ ├── actions │ │ │ │ │ ├── agent │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── pick-agent.ts │ │ │ │ │ │ └── pick-example-flags.ts │ │ │ │ │ └── index.ts │ │ │ │ └── index.ts │ │ │ ├── services │ │ │ │ └── providers-manager.ts │ │ │ ├── types │ │ │ │ ├── cli-configuration.ts │ │ │ │ └── web-configuration.ts │ │ │ ├── utils │ │ │ │ ├── agentic-cli-invocation │ │ │ │ │ ├── agents │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── invoke-agentic-cli.ts │ │ │ │ ├── apply-reasoning-effort.ts │ │ │ │ ├── cli-configuration-format-converters.ts │ │ │ │ └── web-configuration-format-converters.ts │ │ │ └── views │ │ │ ├── prompt │ │ │ │ ├── backend │ │ │ │ │ ├── message-handlers │ │ │ │ │ │ ├── configurations │ │ │ │ │ │ │ ├── handle-pick-api-reasoning-effort.ts │ │ │ │ │ │ │ ├── handle-pick-reasoning-effort.ts │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ ├── handle-invoke-agentic-cli.ts │ │ │ │ │ │ ├── handle-pick-agent.ts │ │ │ │ │ │ ├── handle-pick-example-flags.ts │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── prompt-view-provider.ts │ │ │ │ ├── frontend │ │ │ │ │ ├── Prompt.tsx │ │ │ │ │ └── hooks │ │ │ │ │ └── use-cli-configuration-editing.ts │ │ │ │ └── types │ │ │ │ └── messages.ts │ │ │ ├── settings │ │ │ │ ├── backend │ │ │ │ │ ├── message-handlers │ │ │ │ │ │ ├── handle-pick-agent.ts │ │ │ │ │ │ ├── handle-pick-api-reasoning-effort.ts │ │ │ │ │ │ ├── handle-pick-example-flags.ts │ │ │ │ │ │ ├── handle-pick-reasoning-effort.ts │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── settings-view-provider.ts │ │ │ │ ├── frontend │ │ │ │ │ ├── Settings.tsx │ │ │ │ │ └── hooks │ │ │ │ │ └── use-cli-configuration-editing.ts │ │ │ │ └── types │ │ │ │ └── messages.ts │ │ │ └── shared │ │ │ ├── actions │ │ │ │ ├── agent │ │ │ │ │ ├── create.ts │ │ │ │ │ ├── pick-agent.ts │ │ │ │ │ ├── pick-example-flags.ts │ │ │ │ │ └── update.ts │ │ │ │ ├── api │ │ │ │ │ ├── create │ │ │ │ │ │ └── interactions │ │ │ │ │ │ └── verify-reasoning-effort.ts │ │ │ │ │ ├── pick-reasoning-effort.ts │ │ │ │ │ └── update │ │ │ │ │ ├── interactions │ │ │ │ │ │ ├── edit-reasoning-effort-for-api-config.ts │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── update.ts │ │ │ │ └── web │ │ │ │ └── update.ts │ │ │ ├── forms │ │ │ │ ├── EditApiConfigurationForm │ │ │ │ │ └── EditApiConfigurationForm.tsx │ │ │ │ ├── EditCliConfigurationForm │ │ │ │ │ └── EditCliConfigurationForm.tsx │ │ │ │ └── EditWebConfigurationForm │ │ │ │ └── EditWebConfigurationForm.tsx │ │ │ ├── hooks │ │ │ │ └── use-translation.tsx │ │ │ └── i18n │ │ │ ├── translations │ │ │ │ ├── common.ts │ │ │ │ ├── edit-api-configuration-form.ts │ │ │ │ ├── edit-cli-configuration-form.ts │ │ │ │ ├── edit-web-configuration-form.ts │ │ │ │ └── index.ts │ │ │ └── use-translation.tsx │ │ ├── tsconfig.json │ │ └── webpack.config.ts │ └── web │ └── package.json ├── package.json └── packages ├── shared │ ├── package.json │ └── src │ └── constants │ └── chatbots.ts └── ui ├── package.json └── src └── components └── editor └── common ├── Field │ ├── Field.module.scss │ └── Field.tsx ├── QuickPickButton │ └── QuickPickButton.tsx └── TextButton └── TextButton.tsx
1 parent 055bbba commit d3e1748

21 files changed

Lines changed: 237 additions & 47 deletions

File tree

‎apps/editor/src/constants/agents.ts‎

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,66 @@ type Agents = {
33
docs_url?: string
44
homepage_url?: string
55
flags_placeholder: string
6+
example_flags: string[]
67
}
78
}
89

910
export const AGENTS = {
1011
Antigravity: {
1112
docs_url: 'https://antigravity.google/docs/cli/headless/',
1213
homepage_url: 'https://antigravity.google/product/antigravity-cli/',
13-
flags_placeholder: "--model 'Gemini 3.8 Flash (High)'"
14+
flags_placeholder: "--model 'Gemini 3.8 Flash (High)'",
15+
example_flags: [
16+
"--model 'Gemini 4 Argon (High)'",
17+
"--model 'Gemini 4 Argon (Medium)'",
18+
"--model 'Gemini 4 Argon (Low)'",
19+
"--model 'Gemini 3.8 Flash (High)'",
20+
"--model 'Gemini 3.8 Flash (Medium)'",
21+
"--model 'Gemini 3.8 Flash (Low)'"
22+
]
1423
},
1524
'Claude Code': {
1625
docs_url: 'https://code.claude.com/docs/en/headless',
1726
homepage_url: 'https://code.claude.com/docs/en/quickstart',
18-
flags_placeholder: '--model claude-sonnet-5-5 --effort high'
27+
flags_placeholder: '--model claude-sonnet-5-5 --effort high',
28+
example_flags: [
29+
'--model claude-opus-5-5 --effort high',
30+
'--model claude-opus-5-5 --effort medium',
31+
'--model claude-opus-5-5 --effort low',
32+
'--model claude-sonnet-5-5 --effort high',
33+
'--model claude-sonnet-5-5 --effort medium',
34+
'--model claude-sonnet-5-5 --effort low'
35+
]
1936
},
2037
Codex: {
2138
docs_url: 'https://learn.chatgpt.com/docs/non-interactive-mode',
2239
homepage_url: 'https://learn.chatgpt.com/docs/codex/cli',
23-
flags_placeholder: '--model gpt-6.1-sol -c model_reasoning_effort=high'
40+
flags_placeholder: '--model gpt-6.1-sol -c model_reasoning_effort=high',
41+
example_flags: [
42+
'--model gpt-6.1-sol -c model_reasoning_effort=high',
43+
'--model gpt-6.1-sol -c model_reasoning_effort=medium',
44+
'--model gpt-6.1-sol -c model_reasoning_effort=low',
45+
'--model gpt-6-luna -c model_reasoning_effort=high',
46+
'--model gpt-6-luna -c model_reasoning_effort=medium',
47+
'--model gpt-6-luna -c model_reasoning_effort=low'
48+
]
2449
},
2550
Cursor: {
2651
docs_url: 'https://cursor.com/docs/cli/reference/parameters',
2752
homepage_url: 'https://cursor.com/cli',
28-
flags_placeholder: ''
53+
flags_placeholder: '',
54+
example_flags: []
2955
},
3056
'Grok Build': {
3157
docs_url: 'https://docs.x.ai/build/cli/headless-scripting',
3258
homepage_url: 'https://x.ai/build',
33-
flags_placeholder: ''
59+
flags_placeholder: '',
60+
example_flags: []
3461
},
3562
OpenCode: {
3663
docs_url: 'https://opencode.ai/docs/cli/',
3764
homepage_url: 'https://opencode.ai/',
38-
flags_placeholder: ''
65+
flags_placeholder: '',
66+
example_flags: []
3967
}
4068
} satisfies Agents
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { translations as create } from './create'
22
import { translations as delete_translations } from './delete'
33
import { translations as pick_agent } from './pick-agent'
4+
import { translations as pick_example_flags } from './pick-example-flags'
45

56
export const translations = {
67
...create,
78
...delete_translations,
8-
...pick_agent
9+
...pick_agent,
10+
...pick_example_flags
911
}
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-example-flags.title': {
3+
en: 'Examples',
4+
pl: 'Przykłady',
5+
'zh-cn': '示例',
6+
ja: '例',
7+
'zh-tw': '範例',
8+
de: 'Beispiele',
9+
es: 'Ejemplos',
10+
fr: 'Exemples',
11+
'pt-br': 'Exemplos',
12+
ru: 'Примеры',
13+
ko: '예시',
14+
it: 'Esempi',
15+
tr: 'Örnekler',
16+
cs: 'Příklady',
17+
hu: 'Példák',
18+
bg: 'Примери'
19+
}
20+
} as const
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { PromptViewProvider } from '../prompt-view-provider'
2+
import { PickExampleFlagsMessage } from '../../types/messages'
3+
import { pick_example_flags } from '@/views/shared/actions/agent/pick-example-flags'
4+
5+
export const handle_pick_example_flags = async (
6+
prompt_view_provider: PromptViewProvider,
7+
message: PickExampleFlagsMessage
8+
): Promise<void> => {
9+
const result = await pick_example_flags({ agent: message.agent })
10+
if (result) {
11+
prompt_view_provider.send_message({
12+
command: 'NEWLY_PICKED_EXAMPLE_FLAG',
13+
flag: result
14+
})
15+
}
16+
}

‎apps/editor/src/views/prompt/backend/message-handlers/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export * from './handle-preview-skill-symbol'
6060
export * from './handle-preview-saved-context-symbol'
6161
export * from './configurations'
6262
export * from './handle-pick-agent'
63+
export * from './handle-pick-example-flags'
6364
export * from './handle-get-completed-tasks'
6465
export * from './handle-save-completed-tasks'
6566
export * from './handle-clear-completed-tasks'

‎apps/editor/src/views/prompt/backend/prompt-view-provider.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ import {
9696
handle_select_edit_format_instructions,
9797
handle_update_last_used_web_configuration,
9898
handle_pick_agent,
99+
handle_pick_example_flags,
99100
handle_get_completed_tasks,
100101
handle_save_completed_tasks,
101102
handle_clear_completed_tasks
@@ -917,6 +918,8 @@ export class PromptViewProvider implements vscode.WebviewViewProvider {
917918
await handle_toggle_pinned_cli_configuration(message)
918919
} else if (message.command == 'PICK_AGENT') {
919920
await handle_pick_agent(this, message)
921+
} else if (message.command == 'PICK_EXAMPLE_FLAGS') {
922+
await handle_pick_example_flags(this, message)
920923
} else if (message.command == 'GET_COMPLETED_TASKS') {
921924
handle_get_completed_tasks(this)
922925
} else if (message.command == 'SAVE_COMPLETED_TASKS') {

‎apps/editor/src/views/prompt/frontend/Prompt.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,9 @@ export const Prompt = () => {
551551
pick_agent={(agent_id) => {
552552
post_message(vscode, { command: 'PICK_AGENT', agent_id })
553553
}}
554+
pick_example_flags={(agent) => {
555+
post_message(vscode, { command: 'PICK_EXAMPLE_FLAGS', agent })
556+
}}
554557
/>
555558
</UiPage>
556559
</div>

‎apps/editor/src/views/prompt/types/messages.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ export interface PickAgentMessage extends BaseMessage {
203203
agent_id?: string
204204
}
205205

206+
export interface PickExampleFlagsMessage extends BaseMessage {
207+
command: 'PICK_EXAMPLE_FLAGS'
208+
agent: string
209+
}
210+
206211
export interface ExecuteCommandMessage extends BaseMessage {
207212
command: 'EXECUTE_COMMAND'
208213
command_id: string
@@ -727,6 +732,7 @@ export type FrontendMessage =
727732
| UpdateAgentConfigurationMessage
728733
| DeleteAgentConfigurationMessage
729734
| PickAgentMessage
735+
| PickExampleFlagsMessage
730736
| GetCompletedTasksMessage
731737
| SaveCompletedTasksMessage
732738
| ClearCompletedTasksMessage
@@ -786,6 +792,11 @@ export interface NewlyPickedAgentMessage extends BaseMessage {
786792
agent_id: string
787793
}
788794

795+
export interface NewlyPickedExampleFlagMessage extends BaseMessage {
796+
command: 'NEWLY_PICKED_EXAMPLE_FLAG'
797+
flag: string
798+
}
799+
789800
export interface SelectedAgentConfigurationChangedMessage extends BaseMessage {
790801
command: 'SELECTED_CLI_CONFIGURATION_CHANGED'
791802
prompt_type: CliPromptType
@@ -1054,5 +1065,6 @@ export type BackendMessage =
10541065
| AgentConfigurationUpdatedMessage
10551066
| StartAgentConfigurationCreationMessage
10561067
| NewlyPickedAgentMessage
1068+
| NewlyPickedExampleFlagMessage
10571069
| SelectedAgentConfigurationChangedMessage
10581070
| CompletedTasksMessage
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { SettingsViewProvider } from '../settings-view-provider'
2+
import { PickExampleFlagsMessage } from '../../types/messages'
3+
import { pick_example_flags } from '@/views/shared/actions/agent/pick-example-flags'
4+
5+
export const handle_pick_example_flags = async (
6+
settings_provider: SettingsViewProvider,
7+
message: PickExampleFlagsMessage
8+
): Promise<void> => {
9+
const result = await pick_example_flags({ agent: message.agent })
10+
if (result) {
11+
settings_provider.postMessage({
12+
command: 'NEWLY_PICKED_EXAMPLE_FLAG',
13+
flag: result
14+
})
15+
}
16+
}

‎apps/editor/src/views/settings/backend/message-handlers/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export * from './handle-delete-cli-configuration'
5959
export * from './handle-update-cli-configuration'
6060
export * from './handle-reorder-cli-configurations'
6161
export * from './handle-pick-agent'
62+
export * from './handle-pick-example-flags'
6263
export * from './handle-get-web-configurations'
6364
export * from './handle-get-cli-configurations'
6465
export * from './handle-get-is-modern-ui'

0 commit comments

Comments
 (0)