export interface AnsiStripper { strip(text: string): string; flush(): string; } export declare function makeAnsiStripper(): AnsiStripper; export declare function utf8SafeTruncate(buf: Buffer, maxBytes: number): Buffer; export declare const DEFAULT_TIMEOUT_MS = 120000; export declare const DEFAULT_MAX_BYTES = 100000; export interface StartShellOptions { command: string; cwd?: string; abort: AbortSignal; timeoutMs?: number; maxBytes?: number; onChunk?: (chunk: Buffer, stream: 'stdout' | 'stderr') => void; env?: Record; } export type ShellErrorReason = 'timeout' | 'abort' | 'overflow' | 'spawn-failed' | 'nonzero-exit' | 'signal-killed'; export interface ShellResult { exitCode: number | null; durationMs: number; displayCaptured: string; modelCaptured: string; truncated: boolean; errorReason?: ShellErrorReason; errorMessage?: string; } export interface ShellHandle { readonly pid: number | undefined; readonly promise: Promise; kill(signal?: NodeJS.Signals): void; } export declare function startShell(opts: StartShellOptions): ShellHandle;