import { z } from "zod"; import type { AgencyConfig } from "../config.js"; import type { Input } from "../eval/runTypes.js"; import type { OptimizeMutationDiagnostic } from "./sourceMutator.js"; import type { OptimizeTarget } from "./targets.js"; import type { MutationProposal } from "./types.js"; export declare const MutationProposalSchema: z.ZodObject<{ operations: z.ZodArray; op: z.ZodLiteral<"replaceInitializer">; value: z.ZodString; expected: z.ZodOptional; rationale: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ target: z.ZodString; kind: z.ZodLiteral<"type">; op: z.ZodLiteral<"replaceTypeDefinition">; value: z.ZodString; expected: z.ZodOptional; rationale: z.ZodOptional; }, z.core.$strip>], "kind">>; rationale: z.ZodString; }, z.core.$strip>; export type MutatorPromptInputs = { targets: OptimizeTarget[]; inputs: Input[]; history: string; /** Pre-rendered per-input feedback from the last run (expected answers + grader notes). */ feedback?: string; diagnostics?: OptimizeMutationDiagnostic[]; }; export type MutatorMessageSections = { targets: string; goals: string; feedback: string; history: string; diagnostics: string; }; export type MutatorModelCaller = (args: { sections: MutatorMessageSections; config: AgencyConfig; model: string; }) => Promise; export type ProposeMutationArgs = MutatorPromptInputs & { config: AgencyConfig; model?: string; callModel?: MutatorModelCaller; }; /** Render a list of optimize targets as the prompt's TARGETS section. Shared by greedy and GEPA. */ export declare function renderTargetsSection(targets: OptimizeTarget[]): string; export declare function buildMutatorSections(promptInputs: MutatorPromptInputs): MutatorMessageSections; /** * Asks the mutator model for declarative mutation operations against the * supplied optimize targets. The prompt itself lives in * `lib/agents/optimize/mutatePrompt.agency` — an Agency agent owns the LLM call, * the task instructions, and structured output; this module only renders * the deterministic data sections, exposes the `callModel` test seam, and * validates the response shape at the process boundary. Semantic * validation belongs to `OptimizeSourceMutator.preview()`, whose rejected * diagnostics come back in via `args.diagnostics` for a retry. */ export declare function proposeMutation(args: ProposeMutationArgs): Promise;