mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-02-24 09:37:38 +00:00
feature: Ask User Question implementation for Claude Code & upgrade claude agent sdk to 0.1.71 to support the tool
This commit is contained in:
@@ -24,7 +24,7 @@ export interface ToolDisplayConfig {
|
||||
// Collapsible config
|
||||
title?: string | ((input: any) => string);
|
||||
defaultOpen?: boolean;
|
||||
contentType?: 'diff' | 'markdown' | 'file-list' | 'todo-list' | 'text' | 'task';
|
||||
contentType?: 'diff' | 'markdown' | 'file-list' | 'todo-list' | 'text' | 'task' | 'question-answer';
|
||||
getContentProps?: (input: any, helpers?: any) => any;
|
||||
actionButton?: 'file-button' | 'none';
|
||||
};
|
||||
@@ -35,7 +35,7 @@ export interface ToolDisplayConfig {
|
||||
title?: string | ((result: any) => string);
|
||||
defaultOpen?: boolean;
|
||||
// Special result handlers
|
||||
contentType?: 'markdown' | 'file-list' | 'todo-list' | 'text' | 'success-message' | 'task';
|
||||
contentType?: 'markdown' | 'file-list' | 'todo-list' | 'text' | 'success-message' | 'task' | 'question-answer';
|
||||
getMessage?: (result: any) => string;
|
||||
getContentProps?: (result: any) => any;
|
||||
};
|
||||
@@ -453,6 +453,34 @@ export const TOOL_CONFIGS: Record<string, ToolDisplayConfig> = {
|
||||
}
|
||||
},
|
||||
|
||||
// ============================================================================
|
||||
// INTERACTIVE TOOLS
|
||||
// ============================================================================
|
||||
|
||||
AskUserQuestion: {
|
||||
input: {
|
||||
type: 'collapsible',
|
||||
title: (input: any) => {
|
||||
const count = input.questions?.length || 0;
|
||||
const hasAnswers = input.answers && Object.keys(input.answers).length > 0;
|
||||
if (count === 1) {
|
||||
const header = input.questions[0]?.header || 'Question';
|
||||
return hasAnswers ? `${header} — answered` : header;
|
||||
}
|
||||
return hasAnswers ? `${count} questions — answered` : `${count} questions`;
|
||||
},
|
||||
defaultOpen: true,
|
||||
contentType: 'question-answer',
|
||||
getContentProps: (input: any) => ({
|
||||
questions: input.questions || [],
|
||||
answers: input.answers || {}
|
||||
}),
|
||||
},
|
||||
result: {
|
||||
hideOnSuccess: true
|
||||
}
|
||||
},
|
||||
|
||||
// ============================================================================
|
||||
// PLAN TOOLS
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user