export interface CliProcessRunnerOptions { command: string; args?: string[]; cwd?: string; env?: Record; timeoutMs?: number; killGracePeriodMs?: number; } export type SpawnErrorCode = 'ENOENT' | 'EACCES' | 'EMFILE' | 'UNKNOWN'; export interface CliOutput { stdout: string; stderr: string; exitCode: number | null; timedOut: boolean; durationMs: number; /** * Explicit spawn error type. Set when proc.on('error') is called with * ENOENT (binary not found), EACCES (permission denied), EMFILE (too many open files), * or other errors. Use this instead of parsing stderr for error detection. */ spawnError?: SpawnErrorCode; } /** * Run a CLI process with timeout, graceful tree kill, and env merge. * * @param opts.command - Non-empty path to the binary to run (validated) * @param opts.args - Array of string arguments (no shell injection, shell: false) * @param opts.cwd - Working directory for the child process * @param opts.env - Environment variables (merged with parent process.env) * @param opts.timeoutMs - Optional timeout in ms; if exceeded the process tree is killed * @param opts.killGracePeriodMs - Grace period between SIGTERM and SIGKILL (default 3000ms) * @returns CliOutput with captured stdout, stderr, exitCode, timedOut flag, and durationMs */ export declare function runCliProcess(opts: CliProcessRunnerOptions): Promise; //# sourceMappingURL=cli-process-runner.d.ts.map