import { type McpSdkServerConfigWithInstance } from "@anthropic-ai/claude-agent-sdk"; /** * 单个问题选项 */ export interface QuestionOption { label: string; description: string; } /** * 单个问题 * * 注意:`multiSelect` 非 optional —— zod schema 用 `.default(false)`,handler 收到 * 的值始终是 boolean。下游 wire 协议(OutputEvent.ask_question)也要求 boolean。 */ export interface QuestionInput { question: string; header: string; multiSelect: boolean; options: QuestionOption[]; } /** * Questions backend: provides the actual transport for asking + waiting. * * - Headless 模式: backend 内部 emit `ask_question` 事件到 stdout,等 stdin 的 * `answer_question` 消息把 Promise resolve(保留与前端 QuestionCard 兼容的 wire 协议) * - Stream 模式: backend 内部直接调终端 `showQuestionsAndWait` * * `askQuestions` 必须返回**按 question 索引("0", "1", ...)键化的答案**,这是 * 前端 wire 协议的固定格式。多选答案是逗号分隔的 label 字符串。 */ export interface QuestionsBackend { askQuestions(questions: QuestionInput[]): Promise>; } /** * 创建 Questions MCP Server * * 暴露 `mcp__optima-questions__ask_user_question` 给 LLM。 * * 取代 SDK 内置的 `AskUserQuestion` 工具——内置版本在 headless 模式下无法把用户 * 答案塞回 tool_result(SDK 的 canUseTool `updatedInput.answers` 不被工具实现读取), * 导致 LLM 永远看到空答案。 */ export declare function createQuestionsMcpServer(backend: QuestionsBackend): McpSdkServerConfigWithInstance; //# sourceMappingURL=questions.d.ts.map