import type { ZodSchema } from "zod"; import type { AgencyConfig } from "../../config.js"; import type { JSON } from "./types.js"; /** Seam over runAgencyNode so callers/tests can inject a fake. */ export type NodeRunner = (args: { config: AgencyConfig; agencyFile: string; nodeName: string; hasArgs: boolean; argsString: string; scratchDir: string; quietCompile: boolean; preferCompiled?: boolean; }) => Promise<{ data: unknown; }>; /** * Runs .agency nodes for the optimizer: the agent under test (`run`) and * judge/proposer agents (`runStructured`, zod-validated). Wraps the general * `runAgencyNode` core; the `runNode` seam keeps it unit-testable. */ export declare class AgencyRunner { private readonly config; private readonly runNode; constructor(config: AgencyConfig, runNode?: NodeRunner); /** Run an agent node and return its raw value. `args` are positional, in node-parameter order. */ run(agencyFile: string, nodeName: string, args: JSON[]): Promise; /** Run a judge/proposer node and validate its structured return against a schema. */ runStructured(agencyFile: string, nodeName: string, args: JSON[], schema: ZodSchema): Promise; private exec; }