@@ -5,6 +5,7 @@ import { GenericToolCall } from "../tools/GenericToolCall";
55import { BashToolCall } from "../tools/BashToolCall" ;
66import { FileEditToolCall } from "../tools/FileEditToolCall" ;
77import { FileReadToolCall } from "../tools/FileReadToolCall" ;
8+ import { AskUserQuestionToolCall } from "../tools/AskUserQuestionToolCall" ;
89import { ProposePlanToolCall } from "../tools/ProposePlanToolCall" ;
910import { TodoToolCall } from "../tools/TodoToolCall" ;
1011import { StatusSetToolCall } from "../tools/StatusSetToolCall" ;
@@ -29,6 +30,8 @@ import type {
2930 FileEditReplaceStringToolResult ,
3031 FileEditReplaceLinesToolArgs ,
3132 FileEditReplaceLinesToolResult ,
33+ AskUserQuestionToolArgs ,
34+ AskUserQuestionToolResult ,
3235 ProposePlanToolArgs ,
3336 ProposePlanToolResult ,
3437 TodoWriteToolArgs ,
@@ -90,6 +93,11 @@ function isFileEditInsertTool(toolName: string, args: unknown): args is FileEdit
9093 return TOOL_DEFINITIONS . file_edit_insert . schema . safeParse ( args ) . success ;
9194}
9295
96+ function isAskUserQuestionTool ( toolName : string , args : unknown ) : args is AskUserQuestionToolArgs {
97+ if ( toolName !== "ask_user_question" ) return false ;
98+ return TOOL_DEFINITIONS . ask_user_question . schema . safeParse ( args ) . success ;
99+ }
100+
93101function isProposePlanTool ( toolName : string , args : unknown ) : args is ProposePlanToolArgs {
94102 if ( toolName !== "propose_plan" ) return false ;
95103 return TOOL_DEFINITIONS . propose_plan . schema . safeParse ( args ) . success ;
@@ -213,6 +221,20 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
213221 ) ;
214222 }
215223
224+ if ( isAskUserQuestionTool ( message . toolName , message . args ) ) {
225+ return (
226+ < div className = { className } >
227+ < AskUserQuestionToolCall
228+ args = { message . args }
229+ result = { ( message . result as AskUserQuestionToolResult | undefined ) ?? null }
230+ status = { message . status }
231+ toolCallId = { message . toolCallId }
232+ workspaceId = { workspaceId }
233+ />
234+ </ div >
235+ ) ;
236+ }
237+
216238 if ( isProposePlanTool ( message . toolName , message . args ) ) {
217239 return (
218240 < div className = { className } >
0 commit comments