/** * The single external-process seam for the whole harness. PowerShell, nvidia-smi, * curl, gitleaks, docker — every subprocess goes through a {@link Runner}. Tests * inject a fake so no unit test ever spawns a real process or touches the network. */ export interface RunResult { /** Process exit code; null when terminated by signal. */ code: number | null; stdout: string; stderr: string; /** True when the executable could not be found / spawned (ENOENT, timeout). */ spawnError?: boolean; /** True when captured output exceeded the configured bound and is incomplete. */ truncated?: boolean; } export interface RunOptions { input?: string; cwd?: string; env?: NodeJS.ProcessEnv; timeoutMs?: number; /** Abort the child without requiring callers to own process handles. */ signal?: AbortSignal; /** Optional bounded-output seam for callers and focused tests. */ maxBufferBytes?: number; } export type Runner = (argv: string[], opts?: RunOptions) => Promise; /** * Default runner backed by `child_process.execFile`. Never rejects on non-zero * exit — it resolves a {@link RunResult} so callers branch on `code`/`spawnError` * instead of try/catch. `argv[0]` is the executable; remaining items are args * (no shell, so no quoting/injection surface). */ export declare const defaultRunner: Runner; /** * Build a fake runner for tests. The handler maps an argv to a partial result; * returning `undefined` yields a clean exit-0 with empty output. */ export declare function fakeRunner(handler: (argv: string[], opts?: RunOptions) => Partial | undefined): Runner; /** A runner that fails as if no executable exists — for "tool absent" test paths. */ export declare const missingToolRunner: Runner;