/** * Shell spawn whose timeout kills the WHOLE process tree (#211). * * `spawnSync(cmd, { shell: true, timeout })` kills only the shell on timeout: * the runner the shell spawned (the grandchild — the process actually doing * the work) survives as an orphan until it exits naturally. On Windows that * orphan can also hold the working directory open and EBUSY a temp-dir * teardown. Here the child is spawned as its own process-group leader on * POSIX (`detached: true`, killed via the negative pid) and on Windows the * timeout runs `taskkill /PID /T /F`, which walks the tree. * * The result mirrors spawnSync's surface — `{ status, stdout, stderr, * error }` with `error.code === 'ETIMEDOUT'` on timeout — so judgement code * written against spawnSync keeps its shape. One deliberate difference: * output beyond `maxBuffer` is truncated rather than turned into an ENOBUFS * error, because every caller reads a small prefix for diagnostics. */ export interface TreeSpawnResult { status: number | null; stdout: string; stderr: string; error?: NodeJS.ErrnoException; } export interface TreeSpawnOptions { cwd: string; timeoutMs: number; env?: NodeJS.ProcessEnv; maxBuffer?: number; } export declare function spawnTree(command: string, options: TreeSpawnOptions): Promise; //# sourceMappingURL=tree-spawn.d.ts.map