/** * Claude Code's `AskUserQuestion` — a structured multiple-choice prompt. * * The native picker cannot run here: `allow-reads` classifies it as readonly, * so Claude Code starts it without asking us, then waits on a UI this session * does not have. The native tool is withheld for that reason, via session * `disallowedTools` — not a settings.json deny of the same name, which would * also disable this host replacement. This session implements the tool as a * host tool: the questions are shown in Ask's own picker, and the answers are * the tool result. * * The input schema has to name `questions`. The Claude Code bridge turns host * tool schemas into a Zod object shape; an empty shape strips every argument, * and the picker sees `{}`. */ import { jsonSchema } from "ai"; export declare const ASK_USER_QUESTION_TOOL_NAME = "AskUserQuestion"; export declare const ASK_USER_QUESTION_DENIED_REASON = "Nobody is at the terminal to answer. Ask in your reply text instead."; export declare const ASK_USER_QUESTION_MISSING_INPUT_REASON = "AskUserQuestion requires `questions`: an array of 1\u20134 items, each with `question`, `header`, `options` (each `{ label, description }`), and `multiSelect`. Call it again with those fields filled in."; type AskUserQuestionHostTool = { description: string; inputSchema: ReturnType; execute: (data: unknown) => Promise; }; export type AskUserQuestionAsk = (input: unknown) => Promise | undefined>; type BuiltinToolFiltering = { mode: "allow" | "deny"; toolNames: string[]; }; /** * Withhold Claude Code's native `AskUserQuestion` without dropping a host tool * of the same name. * * HarnessAgent `inactiveTools` cannot do this: it also filters the user tool * out of `toolSpecs`, so the replacement is never registered. A settings.json * deny of `AskUserQuestion` matches the host tool too. Merging a deny into the * session's builtin filtering becomes `disallowedTools` for the native tool * only; host `execute` still runs. */ export declare function denyNativeAskUserQuestion(existing: BuiltinToolFiltering | undefined): BuiltinToolFiltering; /** * Host-side `AskUserQuestion`. Same name as the builtin so the model keeps * calling it; HarnessAgent runs `execute` on the host instead of Claude Code. */ export declare function buildAskUserQuestionHostTool(getAsk: () => AskUserQuestionAsk | undefined): Record; export type AskUserQuestionOption = { label: string; description: string | undefined; }; export type AskUserQuestionItem = { question: string; header: string | undefined; options: AskUserQuestionOption[]; multiSelect: boolean; }; /** * Pull the questions out of a tool input, whether the bridge sent a JSON * string or the parsed object. */ export declare function readAskUserQuestions(toolInput: unknown): AskUserQuestionItem[] | undefined; /** First question, for the spinner — not the whole JSON payload. */ export declare function summarizeAskUserQuestion(toolInput: unknown): string | undefined; /** * Told to the model as the denial reason so it can continue with the answers * rather than asking again. */ export declare function formatAskUserQuestionAnswers(answers: Record): string; export {}; //# sourceMappingURL=askUserQuestion.d.ts.map