import type { OverlayOptions } from "@earendil-works/pi-tui"; import type { ToolDefinition } from "../../extensions/types.ts"; import type { ExtensionUIContext } from "../../extensions/ui-types.js"; import { buildQuestionnaireResponse, buildToolResult } from "./tool/response-envelope.ts"; import { type QuestionData, type QuestionnaireResult, type QuestionParams, QuestionParamsSchema } from "./tool/types.js"; import type { WrappingSelectItem } from "./view/components/wrapping-select.ts"; /** * Mount options for the blocking questionnaire (#2378). * * The dialog used to mount inline, inside the fullscreen dock, where it is a * flex sibling of the transcript `ScrollView`. A tall side-by-side dialog then * took the transcript's rows: on a 40-row terminal the transcript viewport * collapsed from 34 rows to 6, and pi-tui derives its page step from that * viewport (`viewportHeight - PAGE_SCROLL_OVERLAP`), so PageUp crawled two * lines at a time through a six-line window. * * A bottom-anchored overlay is composited over the bottom rows instead of being * measured into the layout, so the transcript keeps its full viewport height * and its full page step. `reserveTranscriptRows` is what makes those rows * observable rather than merely addressable: the host bounds this overlay so a * transcript strip always survives, and extends the transcript's scroll extent * by the rows the overlay still covers, so the newest output can be raised into * that strip. No `maxHeight` — the host's bound is tighter, and letting pi-tui * slice as well would make the measured overlay height wrong. */ export declare const QUESTIONNAIRE_OVERLAY_OPTIONS: OverlayOptions; export declare function buildItemsForQuestion(question: QuestionData): WrappingSelectItem[]; export declare const askUserQuestionToolSystemPromptContribution: Readonly<{ readonly snippet: "Ask all user questions through this tool, including clarifications and approvals; up to 4 questions with 2-4 options each"; readonly guidelines: readonly ["When ask_user_question or an equivalent question tool is available, all questions to the user must use that tool instead of plain text, including clarifications, preferences, confirmations, approvals, and permission to proceed. Prefer ask_user_question when available. In these sessions, do not end a progress update or final response with a prose-only question such as 'Proceed?'.", "Ask only when a decision is needed; do not seek approval again for already-authorized work. For a confirmation, put the concrete action and its scope in the question and offer explicit proceed and decline options. A cancelled or unanswered question is not approval.", "Each question MUST have 2-4 options. Every option requires a concise label (1-5 words) and a description explaining what the choice means or its trade-offs. The user can additionally type a custom answer (\"Type something.\" row is appended automatically to single-select questions) or pick \"Chat about this\" to abandon the questionnaire.", "Set multiSelect: true when multiple answers are valid; this suppresses the \"Type something.\" row. Provide an options[].preview markdown string when an option benefits from richer side-by-side context (mockups, code snippets, diagrams, configs) — single-select only. NOTE: any non-empty preview on a single-select question ALSO suppresses the \"Type something.\" row (no room in the side-by-side layout); \"Chat about this\" remains the escape hatch. If you recommend a specific option, make it the first option and append \"(Recommended)\" to its label.", "Do not stack multiple ask_user_question calls back-to-back — group all clarifying questions into one invocation.", "If ask_user_question is unavailable, use an equivalent available question tool with its supported schema. If no usable question tool is available, continue autonomously using best judgment and state evidence-backed assumptions. Tool unavailability alone is not a blocker; preserve safety and authorization constraints."]; }>; export declare function createAskUserQuestionToolDefinition(options?: { readonly chatAsOption?: boolean; }): ToolDefinition; /** Rendering adapter shared by the CLI bridge and legacy presentation hosts. */ export declare function presentQuestionnaire(ui: ExtensionUIContext, params: QuestionParams, signal?: AbortSignal, chatAsOption?: boolean): Promise; export { buildQuestionnaireResponse, buildToolResult }; //# sourceMappingURL=ask-user-question.d.ts.map