@@ -4,6 +4,7 @@ import { jsonObjectSchema } from '../../../types/json'
44import {
55 $getNativeToolCallExampleString ,
66 coerceToArray ,
7+ coerceToObject ,
78 jsonToolResultSchema ,
89} from '../utils'
910
@@ -27,70 +28,76 @@ const inputSchema = z
2728 agent_type : z . string ( ) . describe ( 'Agent to spawn' ) ,
2829 prompt : z . string ( ) . optional ( ) . describe ( 'Prompt to send to the agent' ) ,
2930 params : z
30- . object ( {
31- // Common agent fields (all optional hints — each agent validates its own required fields)
32- command : z
33- . string ( )
34- . optional ( )
35- . describe ( 'Terminal command to run (basher, tmux-cli)' ) ,
36- what_to_summarize : z
37- . string ( )
38- . optional ( )
39- . describe (
40- 'What information from the command output is desired (basher)' ,
41- ) ,
42- timeout_seconds : z
43- . number ( )
44- . optional ( )
45- . describe (
46- 'Timeout for command. Set to -1 for no timeout. Default 30 (basher)' ,
47- ) ,
48- searchQueries : z
49- . array (
50- z . object ( {
51- pattern : z . string ( ) . describe ( 'The pattern to search for' ) ,
52- flags : z
53- . string ( )
54- . optional ( )
55- . describe (
56- 'Optional ripgrep flags (e.g., "-i", "-g *.ts")' ,
57- ) ,
58- cwd : z
59- . string ( )
60- . optional ( )
61- . describe (
62- 'Optional working directory relative to project root' ,
63- ) ,
64- maxResults : z
65- . number ( )
66- . optional ( )
67- . describe ( 'Max results per file. Default 15' ) ,
68- } ) ,
69- )
70- . optional ( )
71- . describe ( 'Array of code search queries (code-searcher)' ) ,
72- filePaths : z
73- . array ( z . string ( ) )
74- . optional ( )
75- . describe (
76- 'Relevant file paths to read (opus-agent, gpt-5-agent)' ,
77- ) ,
78- directories : z
79- . array ( z . string ( ) )
80- . optional ( )
81- . describe ( 'Directories to search within (file-picker)' ) ,
82- url : z
83- . string ( )
84- . optional ( )
85- . describe ( 'Starting URL to navigate to (browser-use)' ) ,
86- prompts : z
87- . array ( z . string ( ) )
88- . optional ( )
89- . describe (
90- 'Array of strategy prompts (editor-multi-prompt, code-reviewer-multi-prompt)' ,
91- ) ,
92- } )
93- . catchall ( z . any ( ) )
31+ . preprocess (
32+ coerceToObject ,
33+ z
34+ . object ( {
35+ // Common agent fields (all optional hints — each agent validates its own required fields)
36+ command : z
37+ . string ( )
38+ . optional ( )
39+ . describe ( 'Terminal command to run (basher, tmux-cli)' ) ,
40+ what_to_summarize : z
41+ . string ( )
42+ . optional ( )
43+ . describe (
44+ 'What information from the command output is desired (basher)' ,
45+ ) ,
46+ timeout_seconds : z
47+ . number ( )
48+ . optional ( )
49+ . describe (
50+ 'Timeout for command. Set to -1 for no timeout. Default 30 (basher)' ,
51+ ) ,
52+ searchQueries : z
53+ . array (
54+ z . object ( {
55+ pattern : z
56+ . string ( )
57+ . describe ( 'The pattern to search for' ) ,
58+ flags : z
59+ . string ( )
60+ . optional ( )
61+ . describe (
62+ 'Optional ripgrep flags (e.g., "-i", "-g *.ts")' ,
63+ ) ,
64+ cwd : z
65+ . string ( )
66+ . optional ( )
67+ . describe (
68+ 'Optional working directory relative to project root' ,
69+ ) ,
70+ maxResults : z
71+ . number ( )
72+ . optional ( )
73+ . describe ( 'Max results per file. Default 15' ) ,
74+ } ) ,
75+ )
76+ . optional ( )
77+ . describe ( 'Array of code search queries (code-searcher)' ) ,
78+ filePaths : z
79+ . array ( z . string ( ) )
80+ . optional ( )
81+ . describe (
82+ 'Relevant file paths to read (opus-agent, gpt-5-agent)' ,
83+ ) ,
84+ directories : z
85+ . array ( z . string ( ) )
86+ . optional ( )
87+ . describe ( 'Directories to search within (file-picker)' ) ,
88+ url : z
89+ . string ( )
90+ . optional ( )
91+ . describe ( 'Starting URL to navigate to (browser-use)' ) ,
92+ prompts : z
93+ . array ( z . string ( ) )
94+ . optional ( )
95+ . describe (
96+ 'Array of strategy prompts (editor-multi-prompt, code-reviewer-multi-prompt)' ,
97+ ) ,
98+ } )
99+ . catchall ( z . any ( ) ) ,
100+ )
94101 . optional ( )
95102 . describe ( 'Parameters object for the agent' ) ,
96103 } )
0 commit comments