/** * Generic process-spawn helpers shared by harnery commands. Callers pass * `cwd` explicitly or fall back to `process.cwd()`. * * Built on `node:child_process` so it runs identically under Bun and Node. * harnery's published package targets Node ≥ 20, and Bun implements the same * module, so there's one implementation, not a runtime fork. */ export interface ExecResult { stdout: string; stderr: string; exitCode: number; /** True when this process killed the child for exceeding `opts.timeout`. A * child that handles the signal cleanly still exits 0, so the exit code alone * cannot distinguish a kill from an ordinary finish. */ timedOut?: boolean; /** The `code` from a spawn-level failure (`proc` "error" event), e.g. * "ENOENT" when the binary is absent. Absent for an ordinary process exit. * We collapse such failures to exitCode 127 so callers' exit-code branches * still fire, but a shell can legitimately exit 127 too; only this field * distinguishes "the binary was never there" from "the process ran and exited * 127". The process that knows reports it (as ADR 0044 did for `timedOut`). */ spawnErrno?: string; } export interface ExecOpts { cwd?: string; timeout?: number; env?: Record; trim?: boolean; } /** * Run a shell command and return stdout/stderr/exitCode. * * `trim` defaults to true. Pass * `trim: false` when the consumer depends on leading whitespace. `git status * --porcelain` is the canonical case: the first line of ` M PATH` output gets * its leading space stripped by .trim(), shifting the X/Y status columns and * breaking any positional parser. Trailing newline still gets dropped. */ export declare function exec(cmd: string[], opts?: ExecOpts): Promise; /** Run a shell command via /bin/sh -c (for pipes, redirects, etc.) */ export declare function sh(command: string, opts?: Omit): Promise; //# sourceMappingURL=exec.d.ts.map