Skip to content

Commit f70e143

Browse files
committed
Add support for get_integrated_terminal_prompt_args in coding agents
- agy should run like this [Pasted text] └── apps └── editor └── src └── 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
1 parent b2f676a commit f70e143

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as os from 'os'
12
import { CodingAgent } from '../types'
23
import { check_command_exists } from '../utils/check-command-exists'
34
import { get_progress_dots } from '../utils/get-progress-dots'
@@ -21,7 +22,12 @@ export const antigravity_agent: CodingAgent = {
2122
],
2223
get_integrated_terminal_edit_args: () => [],
2324
get_integrated_terminal_ask_args: () => [],
24-
get_post_integrated_terminal_args: () => ['--continue'],
25+
get_integrated_terminal_prompt_args: (temp_prompt_path: string) => {
26+
if (os.platform() === 'win32') {
27+
return `"--prompt-interactive" "$(Get-Content -Raw '${temp_prompt_path.replace(/'/g, "''")}')"`
28+
}
29+
return `'--prompt-interactive' "$(cat '${temp_prompt_path.replace(/'/g, "'\\''")}')"`
30+
},
2531
parse_stream_line: (parsed, report_progress) => {
2632
if (parsed.event === 'step_update' && parsed.step_update) {
2733
const step = parsed.step_update

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,11 @@ export const invoke_agentic_cli = async (params: {
605605
args = [...args, ...agent_info.get_prompt_file_args(temp_prompt_path)]
606606
const command_args = [executable, ...args.map(quote_arg)].join(' ')
607607
command = command_args
608+
} else if (agent_info.get_integrated_terminal_prompt_args) {
609+
const command_args = [executable, ...args.map(quote_arg)].join(' ')
610+
const prompt_args =
611+
agent_info.get_integrated_terminal_prompt_args(temp_prompt_path)
612+
command = `${command_args} ${prompt_args}`
608613
} else {
609614
const command_args = [executable, ...args.map(quote_arg)].join(' ')
610615
if (os.platform() === 'win32') {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export type CodingAgent = {
99
get_integrated_terminal_ask_args?: (params: { cwd: string }) => string[]
1010
get_post_integrated_terminal_args?: () => string[]
1111
get_prompt_file_args?: (temp_prompt_path: string) => string[]
12+
get_integrated_terminal_prompt_args?: (temp_prompt_path: string) => string
1213
parse_stream_line?: (
1314
parsed: any,
1415
report_progress: (msg: string) => void

0 commit comments

Comments
 (0)