/** * The question card: one question, its options, and two ways out. * * This is the pi implementation of the {@link AskUser} port. It owns the * terminal for the length of one question and gives it straight back - which is * why the interview can be driven from a slash command but never from a tool the * model calls: nobody can answer a question that is being asked inside a turn. * * Two entries are appended to the interview's card, exactly as Claude Code * does: **Other…** for a free answer, and **that's enough** to submit. The * second one is not a cancel - the answers already given still count, and the * brief is still written. `esc` means the same thing, so the reflex to escape * out of a dialog does not throw the conversation away - and for as long as a * card is up, `esc` means nothing else: the run's stop key is held, or the * interviewer who has to write the brief would be stopped by the same press. * * A flow's `ask` says more of its card, through {@link Asking}: a choice, a * yes or no or a free text, whether "enough" is offered and under which label, * and when it is not, `esc` is the run's stop, and the help line says so. */ import { type SelectItem } from "@earendil-works/pi-tui"; import type { Asking, AskUser, Question } from "../../src/index.ts"; import type { AskUi } from "../pi.ts"; /** * Sentinels for the two entries we add ourselves. * * A NUL prefix, not a plain string: the other values are labels a model wrote, * and an agent proposing the option "Other…" must not silently become the free * text box. */ declare const OTHER = "\0other"; declare const SUBMIT = "\0submit"; /** * Builds an `AskUser` backed by pi's TUI. * * Whether somebody is there is the caller's business: outside a terminal * there is nobody to ask, and an interview with no user is a submit on the * first question. */ export declare function createAskUi(ui: AskUi): AskUser; /** * The options, then what is always there: `Other…` unless the card is closed, * and "that's enough" unless `asking.enough` is `false`. */ export declare function items(question: Question, asking?: Asking): SelectItem[]; export { OTHER, SUBMIT }; //# sourceMappingURL=ask.d.ts.map