/**
 * Tier-1 dispatch wrapper for the `oat-reviewer` subagent's structured-output
 * mode (see design.md → Component Design → `oat-project-review-provide-remote`
 * and `.agents/agents/oat-reviewer.md` → Structured-Output Mode).
 *
 * The project-rail provide-remote skill's Tier 1 dispatch hands the reviewer a
 * payload carrying the project context, the posted-review-body schema
 * reference, the resolved re-review narrowing range, and the
 * `oat_output_mode: structured` flag. In that mode the reviewer returns a
 * `StructuredFindings` object in-memory rather than writing a review artifact;
 * this wrapper validates that object and hands it back to the skill, which is
 * then responsible for building the posted body and posting to GitHub.
 *
 * Responsibilities are deliberately narrow:
 *
 * - Build the dispatch payload with the structured-output flag p03 wired.
 * - Forward it to an injected {@link Dispatcher} (real provider dispatch in the
 *   skill; stubs in tests).
 * - Surface dispatcher errors to the caller WITHOUT retry — the Tier 2/3
 *   fallback decision belongs to the skill, not this wrapper.
 * - Validate the returned `StructuredFindings` shape with a hand-rolled
 *   validator (matching the zero-dependency style of the other review-remote
 *   helpers) and raise a typed {@link StructuredFindingsError} on malformed
 *   output.
 */
import type { NarrowingResult } from './narrowing.js';
/**
 * The dispatch-payload key that selects structured-output mode on the
 * `oat-reviewer` agent. Mirrors the flag p03 added (verified against
 * `.agents/agents/oat-reviewer.md`); parallels the existing
 * `oat_review_invocation` dispatch-payload naming.
 */
export declare const STRUCTURED_OUTPUT_MODE_FLAG: "oat_output_mode";
/** The single accepted value of {@link STRUCTURED_OUTPUT_MODE_FLAG}. */
export declare const STRUCTURED_OUTPUT_MODE_VALUE: "structured";
export type FindingSeverity = 'critical' | 'important' | 'medium' | 'minor';
/** A single structured finding (see design.md → Data Models). */
export interface StructuredFinding {
    /** Stable per-dispatch ID with a C/I/M/m prefix. */
    id: string;
    severity: FindingSeverity;
    title: string;
    /** Repo-relative path; both `file` and `line` are set or both `null`. */
    file: string | null;
    /** 1-based line in the post-image; paired with `file`. */
    line: number | null;
    body: string;
    fix_guidance: string | null;
}
/** Typed return shape from `oat-reviewer` in structured-output mode. */
export interface StructuredFindings {
    summary: string;
    findings: StructuredFinding[];
    verification_commands: string[];
}
/**
 * Raw response envelope from a provider dispatch. The reviewer's structured
 * return lands on `findings`; the wrapper validates it before returning.
 */
export interface RawAgentResponse {
    findings: unknown;
}
/**
 * Narrow dispatcher interface. The skill provides the real provider dispatch
 * (Claude Code Task / Cursor invocation / Codex spawn); tests pass stubs.
 */
export interface Dispatcher {
    spawn(payload: Record<string, unknown>): Promise<RawAgentResponse>;
}
/** Context the wrapper needs to build the structured-output dispatch payload. */
export interface ReviewDispatchContext {
    /** Resolved OAT project directory path. */
    projectPath: string;
    /** Current scope token (`pNN`, `final`, …). */
    scope: string;
    /** Full 40-char PR HEAD SHA being reviewed. */
    headSha: string;
    /** The Review Scope metadata block the reviewer consumes as its prompt. */
    reviewScopeMetadata: string;
    /** Pointer to the posted-review-body schema the skill will build against. */
    postedBodySchemaRef: string;
    /** Resolved re-review narrowing decision from {@link pickNarrowingTarget}. */
    narrowing: NarrowingResult;
}
/** Typed error raised when the reviewer returns a malformed structured shape. */
export declare class StructuredFindingsError extends Error {
    constructor(message: string);
}
/**
 * Build the dispatch payload for a structured-output reviewer run. The
 * structured-mode flag is always set; the narrowing range is included only when
 * the guard actually produced one (`narrow-range`), otherwise it is `null`.
 */
export declare function buildDispatchPayload(context: ReviewDispatchContext): Record<string, unknown>;
/**
 * Validate an unknown value against the `StructuredFindings` contract. Throws a
 * {@link StructuredFindingsError} on the first violation; returns the typed
 * object otherwise.
 */
export declare function validateStructuredFindings(value: unknown): StructuredFindings;
/**
 * Run a Tier-1 structured-output review: build the payload, dispatch once, and
 * validate the returned findings. Dispatcher errors propagate unchanged (no
 * retry) so the skill can decide on a Tier 2/3 fallback. Malformed reviewer
 * output raises {@link StructuredFindingsError}.
 */
export declare function dispatchStructuredReview(context: ReviewDispatchContext, dispatcher: Dispatcher): Promise<StructuredFindings>;
//# sourceMappingURL=reviewer-dispatch.d.ts.map