import type { AgentConfig, PipelineConfig } from "./pipeline-config.js"; export interface CommandResult { exitCode: number; output: string; /** Set when the prompt could not be fully delivered to the process stdin. */ inputError?: string; } export interface AgentInvocation { command: string; args: string[]; prompt: string; promptMode: "stdin" | "argument"; cwd: string; onOutput?: (chunk: string) => void; } export type AgentRunner = (invocation: AgentInvocation) => Promise; export type VerifyRunner = (command: string, cwd: string) => Promise; /** * Environment for spawned agents: the parent may itself be an agent session * (Claude Code, Cursor), and inherited session markers can make the child CLI * behave as if attached to that session instead of running as a clean * headless agent. */ export declare function sanitizedEnvironment(base?: NodeJS.ProcessEnv): NodeJS.ProcessEnv; export declare function runProcess(command: string, args: string[], options: { cwd: string; input?: string; shell: boolean; onOutput?: (chunk: string) => void; env?: NodeJS.ProcessEnv; }): Promise; export declare const defaultAgentRunner: AgentRunner; export declare const defaultVerifyRunner: VerifyRunner; export declare function tail(output: string, limit?: number): string; /** * The build agent: the `agent` block, or the environment fallback for hosts * that have no config file yet. */ export declare function resolveAgent(config: PipelineConfig): AgentConfig | undefined; export interface ResolvedRecoveryAgent { agent: AgentConfig; /** True when no dedicated recovery agent was configured. */ borrowedBuildAgent: boolean; } /** Recovery agent, falling back explicitly to the normal build agent. */ export declare function resolveRecoveryAgent(config: PipelineConfig): ResolvedRecoveryAgent | undefined; export interface ResolvedAuthorAgent { agent: AgentConfig; /** * True when no `authorAgent` was configured and the build agent was * borrowed. Callers must surface this: the build agent is frequently set to * a cheap model on purpose, and silently promoting it to spec critic puts * that model in charge of judging and rewriting specs a stronger model * authored. */ borrowedBuildAgent: boolean; } /** * The agent that reasons about specs in the convergence loop. Prefers the * dedicated `authorAgent` block and falls back to the build agent only as a * last resort, reporting that it did. */ export declare function resolveAuthorAgent(config: PipelineConfig): ResolvedAuthorAgent | undefined; /** * The validator agent for cross-provider critique. Unlike {@link resolveAgent} * this never falls back to the build agent: a validator that is the same * process as the author defeats the point of independent validation, so an * absent `validatorAgent` block is reported to the caller rather than * silently substituted. */ export declare function resolveValidatorAgent(config: PipelineConfig): AgentConfig | undefined; /** Headless planner for structural replans; never used for ordinary authoring. */ export declare function resolveReplannerAgent(config: PipelineConfig): AgentConfig | undefined; /** Human-readable form of a resolved agent, for plan and approval output. */ export declare function describeAgent(agent: AgentConfig): string; //# sourceMappingURL=agent-runner.d.ts.map