/**
 * Reviewer primitives — prompt builder + default ReviewFn factory.
 *
 * `buildReviewerPrompt` is the pure, LLM-agnostic piece: takes
 * `ReviewerPromptInput` (user request, trace summary, verification
 * summary, memory, optional extra context) and emits the system +
 * user message pair. No LLM dependency — callers that want to drive
 * their own transport get full control.
 *
 * `createDefaultReviewer` is the convenience factory: wires the prompt
 * builder to `callLlmJson` with a default schema + soft-fail policy.
 * Returns a function that maps `ReviewerPromptInput` to `ReviewerOutput`.
 *
 * Same pattern as `runSemanticConceptJudge` / `createSemanticConceptJudge`:
 * low-level pure builder + high-level factory built on top.
 */
import { type LlmClientOptions } from './llm-client';
export interface ReviewerMemoryEntry {
    shot: number;
    ts?: string;
    observations?: string;
    diagnosis?: string;
    nextShotInstruction?: string;
    shouldContinue?: boolean;
    confidence?: number;
}
export interface ReviewerVerificationSummary {
    blendedScore: number;
    allPass: boolean;
    failCount: number;
    failingLayers?: string[];
}
export interface ReviewerPromptInput {
    shot: number;
    userRequest: string;
    /**
     * Compact trace summary — tool-call counts, errors, recent activity
     * lines. Built by the caller from whatever trace format they have;
     * agent-eval does not prescribe.
     */
    traceSummary: string;
    verification: ReviewerVerificationSummary;
    memory: ReviewerMemoryEntry[];
    /**
     * Optional extra context injected into the prompt between the trace
     * and the verification blocks. Use for workdir file-tree snapshots,
     * scaffold descriptions, or any environmental fact the reviewer
     * needs to direct the next shot accurately.
     */
    extraContext?: string;
    /**
     * Optional extra section appended at the end of the prompt (e.g.
     * leaf metadata, scenario id). Free-form — no agent-eval-shaped
     * schema.
     */
    trailingContext?: string;
}
export interface ReviewerOutput {
    shot: number;
    observations: string;
    diagnosis: string;
    nextShotInstruction: string;
    shouldContinue: boolean;
    /** 0..1 self-assessed confidence in the directive. */
    confidence: number;
    /** LLM cost in USD if the transport reports it, else null. */
    costUsd: number | null;
    durationMs: number;
    /** False when the LLM errored or returned malformed JSON; caller soft-fails to defaults. */
    available: boolean;
    error?: string;
}
export interface ReviewerSoftFailDefaults {
    observations?: string;
    diagnosis?: string;
    nextShotInstruction?: string;
    shouldContinue?: boolean;
    confidence?: number;
}
export interface CreateDefaultReviewerOptions {
    /** Model id to call. */
    model: string;
    /** Per-call timeout. Default 300s. */
    timeoutMs?: number;
    /** LlmClient transport config (baseUrl, apiKey, authHeader, etc.). */
    llm?: LlmClientOptions;
    /**
     * Override the prompt builder. Default: `buildReviewerPrompt`.
     * Consumers with different reviewer voices pass their own.
     */
    promptBuilder?: (input: ReviewerPromptInput) => {
        system: string;
        user: string;
    };
    /**
     * Soft-fail values when the LLM throws or returns unparseable JSON.
     * Matches VerticalBench's shipped policy: continue with generic
     * instruction at confidence 0.3 so the worker keeps trying.
     */
    softFailDefaults?: ReviewerSoftFailDefaults;
}
/**
 * Build the reviewer's system + user messages. Pure function, no LLM
 * call. Callers that want their own transport or a different structured
 * output can use this and skip `createDefaultReviewer` entirely.
 */
export declare function buildReviewerPrompt(input: ReviewerPromptInput): {
    system: string;
    user: string;
};
/**
 * Factory: returns a function that invokes the default reviewer against
 * an LLM and parses the structured output. Soft-fails to the provided
 * defaults on LLM throw or JSON-parse error so the shot loop keeps
 * moving rather than crashing.
 */
export declare function createDefaultReviewer(options: CreateDefaultReviewerOptions): (input: ReviewerPromptInput) => Promise<ReviewerOutput>;
//# sourceMappingURL=reviewer.d.ts.map