/** * I/O boundary helpers for the vclaw CLI. * * Three responsibilities: * 1. ExitCode taxonomy (0=success, 1=user error, 2=system error, 3=gate) * 2. writeOutput() — JSON when stdout is piped, human-readable when TTY * 3. progressLog() — progress chatter always goes to stderr * * No subcommand handler should call process.stdout.write or process.exit * directly; route through these helpers so agent-callers get a uniform * contract. */ export declare const ExitCode: { readonly SUCCESS: 0; readonly USER_ERROR: 1; readonly SYSTEM_ERROR: 2; readonly GATE: 3; }; export type ExitCode = typeof ExitCode[keyof typeof ExitCode]; /** * Maps an error to its CLI ExitCode. * * VclawError → uses the EXIT_CODES map from errors.ts (1/2/3). * Anything else (plain Error, throw 'string', etc.) → SYSTEM_ERROR. * * Delegates the mapping to Task 1's exitCodeFor() so there's a single * source of truth for code → exit code (kept in sync with the JSON * catalog by the cli-errors.test). */ export declare function exitCodeForError(err: unknown): ExitCode; export interface WriteOutputOptions { /** Force JSON regardless of TTY (useful for `--json` flags). */ json?: boolean; /** Override TTY detection (test hook). */ isTTY?: boolean; /** Override stream (test hook). */ stream?: NodeJS.WritableStream; } export declare function writeOutput(payload: unknown, options?: WriteOutputOptions): void; /** * Progress chatter. Always stderr — stdout stays pure JSON for agents. */ export declare function progressLog(message: string): void; /** * Top-level catch helper. Converts an unknown error into a JSON * ErrorResponse on stdout (so agents can parse it), human message on * stderr, and the appropriate process.exit code. * * Never returns; types as `never`. */ export declare function exitWith(err: unknown, options?: WriteOutputOptions): never; //# sourceMappingURL=cli-output.d.ts.map