/** * The real terminal behind `ConsoleIO` and the console's processes * (aidlc-console/AC-18, aidlc-console/AC-19, aidlc-console/AC-28, * aidlc-console/AC-29, aidlc-console/AC-32, aidlc-console/AC-33, * aidlc-console/AC-34). * * One reader owns stdin at a time. `read` opens a readline for one input and * closes it before returning, so a command's clack prompt, a shell line or an * agent turn never shares stdin with the console (design: raw-mode risk). * * @module */ import type { TurnProcess } from './conversation.js'; import type { ConsoleIO } from './session.js'; export declare const TICK_MS = 2000; /** Text without terminal escapes, for what the agent is shown. */ export declare function plain(text: string): string; export declare function terminalIO(): ConsoleIO; /** * One agent turn as a child process. The message goes on stdin (design D3). * Ctrl-C stops the turn and nothing else (aidlc-console/AC-29); a program that * cannot start reports `missing` (aidlc-console/AC-28). `stop()` does what Ctrl-C * does, for the dashboard, whose raw mode turns Ctrl-C into a key * (operator-console/AC-52). `onErr` gets the harness's own warnings; without it they * go to stderr as they come. */ export declare function spawnTurn(cwd: string, argv: string[], stdin: string, onLine: (line: string) => void, onErr?: (line: string) => void): TurnProcess; /** A `!` line in the user's shell, its output shown and collected (aidlc-console/AC-19). */ export declare function runShell(cwd: string, cmd: string): Promise<{ code: number | null; output: string; }>; /** An interactive shell in `cwd`; resolves when the user exits it. */ export declare function openShell(cwd: string): Promise; /** * Run `run` with stdout and stderr collected and not shown: the dashboard draws the * output itself, in an overlay or the drawer (operator-console/AC-43). The dashboard's * own drawing goes through the write it took at open, so this cannot swallow it. */ export declare function quietCapture(run: () => Promise): Promise<{ value: T; output: string; }>; /** * A `!` line from the dashboard's drawer: output collected, nothing shown, and no * stdin — an interactive program cannot share raw-mode keys with the dashboard * (design D-5). `o` opens a full shell for that. */ export declare function runShellQuiet(cwd: string, cmd: string, signal?: AbortSignal): Promise<{ code: number | null; output: string; }>; //# sourceMappingURL=terminal.d.ts.map