/** * `guard_spawn` — defended spawn for streaming use cases. Returns * stdout/stderr SHA-256 hashes (not the bodies) so callers that just * want fingerprints don't have to keep large buffers. */ import { spawn } from "node:child_process"; import type { ReplayWindow } from "./replay.js"; import type { AllowlistRegistry } from "./allowlist.js"; import { type TrustTier } from "./tier.js"; export interface GuardSpawnInput { toolName: string; file: string; args: string[]; cwd?: string; env?: Record; fdBudget?: number; /** * Reject if `shell: true` was passed by mistake. Always rejected — * this option exists so callers can opt-in to a clearer error path. */ shell?: boolean; } export interface GuardSpawnOutput { pid: number | null; stdoutHash: string; stderrHash: string; exitCode: number; signal: NodeJS.Signals | null; durationMs: number; trustTier: TrustTier; canonicalHash: string; isReplay: boolean; fdBudget: number; } export interface GuardSpawnDeps { registry: AllowlistRegistry; replay: ReplayWindow; spawnImpl?: typeof spawn; now?: () => number; } export declare function guardSpawn(input: GuardSpawnInput, deps: GuardSpawnDeps): Promise; //# sourceMappingURL=spawn.d.ts.map