import { type ChildProcess, type SpawnOptions } from "node:child_process"; import type { CommandEvidence } from "../schema/workspec.js"; import { type VerifierExecutable } from "./executable.js"; import { type InheritedValuesSnapshot } from "./output.js"; import type { CommandExecutionProof, CriterionAttempt, TreeIdentity, TreeMonitoringProof, VerificationFailure } from "./results.js"; declare const DEFAULT_TIMEOUT_MS = 30000; declare const DEFAULT_MAX_OUTPUT_BYTES = 1048576; type Launcher = (file: string, args: readonly string[], options: SpawnOptions) => ChildProcess; type ExecutableResolver = (executable: VerifierExecutable) => Promise; export interface CommandRunnerOptions { timeoutMs?: number | undefined; maxOutputBytes?: number | undefined; launcher?: Launcher | undefined; /** Observation-only test seam; the authority always uses fixed-path resolution. */ resolveExecutable?: ExecutableResolver | undefined; } export interface CommandRunInput { evidence: CommandEvidence; tree: TreeIdentity; signal?: AbortSignal | undefined; untrackedPaths?: () => readonly string[]; drainObservation?: () => Promise; monitoring?: () => TreeMonitoringProof; gitPath?: string; /** Captured values from every criterion in this node. */ inherited?: InheritedValuesSnapshot; } export type CommandRunOutcome = { outcome: "passed"; proof: CommandExecutionProof; } | { outcome: "observed"; proof: CommandExecutionProof; } | { outcome: "failed"; attempt: CriterionAttempt; failures: VerificationFailure[]; }; /** Narrow W4 seam: replace this executor with pi-delegate #154 while retaining this result contract. */ export declare function runCommand(input: CommandRunInput, options?: CommandRunnerOptions): Promise; export { DEFAULT_MAX_OUTPUT_BYTES, DEFAULT_TIMEOUT_MS };