初步支持AskUserQuestion交互

This commit is contained in:
xintaofei
2026-03-11 19:43:24 +08:00
parent 56100c6759
commit 79a22c8a03
16 changed files with 273 additions and 2 deletions

View File

@@ -51,6 +51,8 @@ const EXACT_TOOL_NAME_ALIASES: Record<string, string> = {
background_output: "task",
slashcommand: "skill",
question: "question",
ask_user_question: "question",
askuserquestion: "question",
lsp_diagnostics: "lsp",
lsp_document_symbols: "lsp",
lsp_goto_definition: "lsp",
@@ -97,6 +99,7 @@ function inferFromFreeformName(input: string): string | null {
if (/^taskcreate(?:\b|[_\s:-])/.test(normalized)) return "taskcreate"
if (/^tasklist(?:\b|[_\s:-])/.test(normalized)) return "tasklist"
if (/^task(?:\b|[_\s:-])/.test(normalized)) return "task"
if (/\bask\s*(?:user)?\s*question\b/.test(normalized)) return "question"
return null
}
@@ -181,6 +184,8 @@ function inferFromInput(
if (hasPattern) return hasGlob ? "glob" : "grep"
if (hasGlob) return "glob"
if (hasAnyKey(parsed, ["question"])) return "question"
if (hasAnyKey(parsed, ["subagent_type", "taskId", "task_id", "subject"])) {
return "task"
}