/** * Ink-based output backend for cagent. * * Renders all agent output inside an Ink (React) component tree. * Input is handled via Ink's useInput hook — no readline needed. */ import type { Section, SectionOptions } from "./output.js"; export type SectionWithId = Section & { id: number; }; export type Listener = () => void; export declare class OutputStore { sections: SectionWithId[]; thinking: boolean; exitRequested: boolean; nextId: number; /** Input state */ inputActive: boolean; inputPrompt: string; inputValue: string; inputCursor: number; inputResolve: ((value: string) => void) | null; historyLines: string[]; historyIndex: number; historySaved: string; /** Confirm state */ confirmActive: boolean; confirmQuestion: string; confirmResolve: ((value: boolean) => void) | null; /** Collapsed sections tracking */ collapsedSections: Set; private listeners; subscribe(fn: Listener): () => void; emit(): void; pushLine(text: string): void; /** Activate readline prompt */ startInput(prompt: string, resolve: (value: string) => void): void; finishInput(): void; updateInput(): void; startConfirm(question: string, resolve: (value: boolean) => void): void; finishConfirm(): void; toggleCollapse(sectionId: number): void; getLastToolResultId(): number | null; } export declare class InkOutput { private store; private inkInstance; constructor(store: OutputStore, inkInstance: { unmount: () => void; }); exit(): void; write(text: string): void; writeln(text?: string): void; error(text: string): void; warn(text: string): void; log(prefix: string, color: string, msg: string): void; confirm(question: string): Promise; readLine(prompt: string): Promise; open(sectionType: SectionWithId["type"], options?: SectionOptions): SectionWithId; close(): void; setThinking(thinking: boolean): void; } export declare function createInkOutput(): InkOutput; //# sourceMappingURL=inkoutput.d.ts.map