/** * Options pane — the agent asking the USER for a decision before it acts. * * Standing on its own it takes the prompt editor's place, so it wears the * prompt's frame (`InputFrame`), named "input needed" in the top border, with * the step's key hints on the first row inside. Embedded in the `--team` attach * panel it draws no frame of its own: that panel is already a framed surface, * and a second frame inside it is two boxes one column apart. * * One decision per step: * - tui.select.up / down move between options (wraps) * - app.options.next (→) confirm the highlighted option and advance; on the * last step it submits every answer * - app.options.back (←) step back to the previous decision * - 1-9 quick-pick an option * - drop onto the custom row and type a free-form answer when none fit; there * the arrows move the text cursor first and only act on the step at its * ends, so enter is the key that always commits * - tui.select.cancel (esc) skips the whole sequence * * Answered steps stay on screen as a deterministic breadcrumb so you always * see what you've already committed to. */ import { type Component, type Focusable } from "@kolisachint/hoocode-tui"; import type { AskQuestion } from "../../../core/extensions/types.js"; export interface AskOptionsOptions { /** * Draw the prompt's frame around the pane. False for a pane embedded in a * surface that already frames it (the team attach panel). */ framed?: boolean; } export declare class AskOptionsComponent implements Component, Focusable { private questions; private step; private index; private answers; private customInput; private onSubmitCallback; private onCancelCallback; private _focused; get focused(): boolean; set focused(value: boolean); /** Undefined when the pane is embedded and its host draws the frame. */ private frame; constructor(questions: AskQuestion[], onSubmit: (answers: string[]) => void, onCancel: () => void, options?: AskOptionsOptions); invalidate(): void; private rowCount; private isOnCustomRow; /** * How the arrow keys divide between the step and the text on the custom row. * * The step arrows and the text cursor want the same two keys, and they are * only ever in conflict on the free-text row with something typed in it. * There the text gets first refusal and the step takes what is left over at * the ends: `→` at the end of the answer commits it (with nothing typed the * end is also the start, which is why the plain custom row still advances), * and `←` never leaves the step while there is an answer to lose — stepping * back clears the field, which is not what a cursor key should do. */ private customArrows; private spread; private renderHints; render(width: number): string[]; /** * The pane's rows. `labelled` prints the "INPUT NEEDED" name on the hint * row; a framed pane has that name in its border already. */ private renderBody; private confirm; private back; handleInput(data: string): void; } //# sourceMappingURL=ask-options.d.ts.map