Skip to content

Commit 6c1933d

Browse files
committed
Add a tool renderer for spawn_agent_inline
1 parent 5f64a0f commit 6c1933d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

npm-app/src/utils/tool-renderers.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,29 @@ export const toolRenderers: Record<ToolName, ToolCallRenderer> = {
318318
}
319319
},
320320
},
321+
spawn_agent_inline: {
322+
onToolStart: (toolName) => {
323+
return '\n\n' + gray(`[${bold('Spawn Agent Inline')}]`) + '\n'
324+
},
325+
onParamEnd: (paramName, toolName, content) => {
326+
if (paramName === 'agent_type') {
327+
const client = Client.getInstance(false)
328+
const agentName =
329+
(client?.agentNames && client.agentNames[content]) || content
330+
return gray(`@${bold(agentName)}\n`)
331+
}
332+
if (paramName === 'prompt') {
333+
return gray(content + '\n')
334+
}
335+
return null
336+
},
337+
onToolEnd: () => {
338+
return () => {
339+
Spinner.get().start('Agent running inline...')
340+
return '\n'
341+
}
342+
},
343+
},
321344

322345
send_agent_message: {
323346
onToolStart: (toolName) => {

0 commit comments

Comments
 (0)