/** * The expanded tool-card inspector overlay. * * A compact card elides rows that are already committed into scrollback and so * cannot be recovered — a completed result's, or a still-pending call's own * presented content. This overlay renders the SAME semantic presentation the * card used, but at full detail, inside the live region — it is dismissed and * disappears, leaving the committed transcript untouched and native scrollback * intact. * @module dshline/tool-output */ import type { TuiOverlay } from './slots.ts'; /** Everything the inspector needs to render and dismiss itself. */ export interface ToolOutputSpec { /** The box title, describing what is being inspected. */ readonly title: string; /** * The title for the card currently on screen, when it can differ from * {@link title} by card. Read fresh on every render, exactly like * {@link position} — a history that mixes shapes (e.g. a still-pending * call's own content beside a completed result) needs the label to follow * whichever one is showing rather than freezing at whatever was true when * the overlay opened. Omit when every card in the owner's history shares * one title. * @returns the title for the card on screen right now. */ label?(): string; /** * Produce the expanded presentation at the current width, plus whether the * hard budget cut further source material. * * A PURE function of `columns`: the inspected card — a completed result's * presentation, or a still-pending call's own — cannot change while the * overlay is up, so the same width always yields the same rows. The overlay * relies on that to render once per width rather than once per keystroke. * @param columns - the terminal's current width. */ render(columns: number): { rows: string[]; truncated: boolean; }; /** * Step to the next older retained card, if there is one. * * The overlay owns input while it is mounted, so the gesture that reaches an * older card has to be handled here — the runner never sees a keystroke while * this is on screen. * @returns whether it moved. */ older?(): boolean; /** * Step to the next newer retained card, if there is one. * @returns whether it moved. */ newer?(): boolean; /** Where the card on screen sits in the retained history, for the title. */ position?(): { position: number; total: number; } | undefined; /** Called once when the user closes the overlay. */ close(): void; /** Asks the runner to redraw after scrolling or on resize. */ invalidate(): void; } /** * Build the tool-card inspector overlay. * @param spec - what to render and how to dismiss. * @returns the overlay to push onto the slot registry. */ export declare function createToolOutputOverlay(spec: ToolOutputSpec): TuiOverlay; //# sourceMappingURL=tool-output.d.ts.map