import { execFile } from "child_process"; export declare const execFileAsync: typeof execFile.__promisify__; import { GraphNodeDefinition } from "../types.js"; import { AgencyConfig } from "../config/config.js"; import type { LLMMock, ScopedLLMMocks } from "../runtime/deterministicClient.js"; import type { FetchMock } from "../runtime/fetchMock.js"; import { type RootCarriers } from "./childEnv.js"; export declare function promptForTarget(): Promise<{ filename: string; nodeName: string; }>; export declare function pickANode(nodes: GraphNodeDefinition[]): Promise; export declare function promptForArgs(selectedNode: GraphNodeDefinition): Promise<{ hasArgs: boolean; argsString: string; }>; export type InterruptHandler = { action: "approve" | "reject" | "resolve"; resolvedValue?: any; expectedMessage?: string; }; /** * Resolve the compiled .js file for an .agency file from a distDir. * Throws if the compiled file doesn't exist. */ export declare function resolveCompiledFile(distDir: string, agencyFile: string): string; type ExecuteNodeArgs = { config: AgencyConfig; agencyFile: string; nodeName: string; hasArgs: boolean; argsString: string; interruptHandlers?: InterruptHandler[]; timeoutMs?: number; signal?: AbortSignal; llmMocks?: LLMMock[] | ScopedLLMMocks; sandboxAgentHome?: boolean; useTestLLMProvider?: boolean; fakeClock?: boolean; argv?: string[]; scratchDir?: string; maxBufferBytes?: number; quietCompile?: boolean; preferCompiled?: boolean; fetchMocks?: FetchMock[]; allowTestImports?: boolean; /** Extra env merged over process.env for the spawned subprocess. */ env?: Record; rootCarriers?: RootCarriers; }; export type RunAgencyNodeArgs = { config: AgencyConfig; agencyFile: string; nodeName: string; hasArgs: boolean; argsString: string; interruptHandlers?: InterruptHandler[]; timeoutMs?: number; signal?: AbortSignal; argv?: string[]; scratchDir?: string; maxBufferBytes?: number; quietCompile?: boolean; /** Extra env merged over process.env for the spawned subprocess. */ env?: Record; /** Root policy and budget for the child; see `withRootCarriers`. */ rootCarriers?: RootCarriers; /** * Reuse a precompiled `.js` sitting next to the `.agency` source instead of * recompiling, when one exists. Bundled agents (judges, proposers) ship such * a sibling in `dist`, so repeated invocations (e.g. per optimize iteration) * skip the redundant compile. No-op when running from uncompiled source. */ preferCompiled?: boolean; /** Test-harness only: honor `import test { … }` when compiling. Inert on * the distDir/preferCompiled branches (nothing is compiled there). */ allowTestImports?: boolean; }; /** * General-purpose runner: compile/resolve the agent, render the evaluate * script, spawn `node`, and parse the results. No test-LLM coupling — callers * pass any extra `env` (e.g. the deterministic-LLM mocks computed by * `executeNodeAsync`). */ export declare function runAgencyNode({ config, agencyFile, nodeName, hasArgs, argsString, interruptHandlers, timeoutMs, signal, argv, scratchDir, maxBufferBytes, quietCompile, env, rootCarriers, preferCompiled, allowTestImports, }: RunAgencyNodeArgs): Promise<{ data: any; stdout: string; stderr: string; costUsd?: number; }>; /** * Test/eval wrapper over {@link runAgencyNode}: activates the deterministic LLM * client by setting AGENCY_LLM_MOCKS whenever the suite-wide * AGENCY_USE_TEST_LLM_PROVIDER env var is set OR the per-call * `useTestLLMProvider` flag is true, then delegates. Existing callers keep * their behavior. Setting the env var to "[]" when no mocks are provided still * activates the deterministic client so any llm() call fails cleanly instead of * falling through to the real OpenAI client. */ export declare function executeNodeAsync({ llmMocks, useTestLLMProvider, fetchMocks, fakeClock, sandboxAgentHome, env: callerEnv, ...rest }: ExecuteNodeArgs): Promise<{ data: any; stdout: string; stderr: string; costUsd?: number; }>; export declare function safeUnlink(filePath: string): void; export declare function executeNode(args: ExecuteNodeArgs): { data: any; [key: string]: any; }; export { formatTypeHint, formatTypeHintTs, TS_PRIMITIVE_ALIASES } from "../utils/formatType.js"; type ExecuteJudgeArgs = { actualOutput: string; expectedOutput: string; judgePrompt: string; interruptHandlers?: InterruptHandler[]; }; export declare function executeJudgeAsync(agencyFileBaseName: string, { actualOutput, expectedOutput, judgePrompt, interruptHandlers }: ExecuteJudgeArgs): Promise<{ score: number; reasoning: string; stdout: string; stderr: string; }>; export declare function getImportsRecursively(filename: string, visited?: Set): string[];