import { spawnHeadlessClaude, type ParsedTranscript, type SpawnResult } from '@vibe-agent-toolkit/utils'; export interface RunExecutorInput { evalId: string; task: string; subjectStagedDir: string; /** `/` when the eval declares input `files`. */ workspaceDir?: string; pluginDirs: string[]; env: NodeJS.ProcessEnv; model?: string; maxTurns: number; maxBudgetUsd: number; timeoutMs: number; stallMs?: number; /** Injectable seam for tests; defaults to the real {@link spawnHeadlessClaude}. */ spawn?: typeof spawnHeadlessClaude; /** Called with each stdout chunk as it streams (for progress echo). */ onProgress?: (chunk: string) => void; } export interface ExecutorOutcome { /** Full captured stdout (stream-json), held IN MEMORY only — never written to disk. */ transcript: string; parsed: ParsedTranscript; spawnResult: SpawnResult; /** true = the executor exited non-zero WITHIN budget — a valid eval failure, not a harness break. */ cleanFailure: boolean; } /** * Run ONE eval's executor: a blind `claude -p` spawn that performs `task` * against the staged subject (issue #145). The executor's entire stream-json * stdout is accumulated in memory (never written to a skill-writable disk * path — the "stop discarding stdout" fix) and echoed to `onProgress` chunk * by chunk for visibility. * * Encodes the R1 exit bifurcation at the executor boundary: * - A spawn error (the promise rejects), or our own watchdog firing * (`timedOut`/`stalled`), is HARNESS breakage → thrown as * {@link InternalHarnessError} (exit 1). * - A mid-stream rate-limit that cuts the run off before it completes (status * !== 0) is NOT a harness failure but also not gradeable → thrown as * {@link RateLimitSignal} so the caller's pool can back off and retry this * eval. A rate-limit event that the run still completed past (status 0) is * kept and returned normally. * - Anything else — including a clean non-zero exit within budget — is a * valid eval OUTCOME, not a harness break: returned with `cleanFailure` * reflecting whether the executor exited non-zero. Never laundered into a * thrown error; the grader decides whether the transcript passes. */ export declare function runExecutorForEval(input: RunExecutorInput): Promise; //# sourceMappingURL=eval-executor.d.ts.map