/**
 * withStructuredOutput<T>() — Zod schema-enforced LLM output with auto-retry.
 *
 * Sprint-562: A5 — Structured Output
 *
 * Zod validation failures are injected into the messages[] thread so the LLM
 * sees its mistake and corrects it on the next attempt. TInput is NEVER mutated
 * (new messages are appended to a copy).
 *
 * Each retry produces a TraceStep with type='llm_call' and output.zodError
 * so auditors can see the correction path.
 */
import type { ZodSchema, ZodError } from "zod";
import type { OODAContext } from "./types.js";
export interface StructuredOutputOptions<T> {
    /** Zod schema to validate against. */
    schema: ZodSchema<T>;
    /** LLM call function that returns a raw string. */
    fn: (input: {
        messages: Array<{
            role: string;
            content: string;
        }>;
    }, ctx: OODAContext) => Promise<string>;
    /** Max Zod retries before throwing (default 2). */
    maxRetries?: number;
}
export interface StructuredOutputResult<T> {
    parsed: T;
    rawMessages: Array<{
        role: string;
        content: string;
    }>;
    retries: number;
}
export declare class StructuredOutputError extends Error {
    readonly zodError: ZodError;
    constructor(message: string, zodError: ZodError);
}
/**
 * Calls an LLM with Zod schema enforcement. On Zod failure, injects the
 * error into the messages thread and retries. TInput messages are never
 * mutated — each retry appends to a copy.
 */
export declare function withStructuredOutput<T>(opts: StructuredOutputOptions<T>): Promise<StructuredOutputResult<T>>;
//# sourceMappingURL=structured-output.d.ts.map