/**
 * Ralph Prompt Utilities
 *
 * Prompts used by the Ralph plan → orchestrate → review → debug loop:
 *   - buildPlannerPrompt:           initial planning OR re-planning from a debugger report
 *   - buildOrchestratorPrompt:      spawn workers to execute the task list
 *   - buildInfraDiscoveryPrompts:   prompts for parallel sub-agent infrastructure discovery
 *   - buildReviewPrompt:            structured code review with injected changeset + discovery context
 *   - buildDebuggerReportPrompt:    diagnose review findings, produce a re-plan brief
 *
 * Plus Zod schemas for structured output, parsing helpers for the reviewer
 * JSON output, and the debugger markdown report.
 */
import { z } from "zod";
/** Zod schema for a single review finding. */
export declare const ReviewFindingSchema: z.ZodObject<{
    title: z.ZodString;
    body: z.ZodString;
    confidence_score: z.ZodOptional<z.ZodNumber>;
    priority: z.ZodOptional<z.ZodNumber>;
    code_location: z.ZodOptional<z.ZodObject<{
        file_path: z.ZodString;
        line_range: z.ZodObject<{
            start: z.ZodNumber;
            end: z.ZodNumber;
        }, z.core.$strip>;
    }, z.core.$strip>>;
}, z.core.$strip>;
/** Zod schema for the full structured review output. */
export declare const ReviewResultSchema: z.ZodObject<{
    findings: z.ZodArray<z.ZodObject<{
        title: z.ZodString;
        body: z.ZodString;
        confidence_score: z.ZodOptional<z.ZodNumber>;
        priority: z.ZodOptional<z.ZodNumber>;
        code_location: z.ZodOptional<z.ZodObject<{
            file_path: z.ZodString;
            line_range: z.ZodObject<{
                start: z.ZodNumber;
                end: z.ZodNumber;
            }, z.core.$strip>;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    overall_correctness: z.ZodString;
    overall_explanation: z.ZodString;
    overall_confidence_score: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
/** JSON Schema derived from the Zod schema — used by Claude and OpenCode SDKs. */
export declare const REVIEW_RESULT_JSON_SCHEMA: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
    findings: z.ZodArray<z.ZodObject<{
        title: z.ZodString;
        body: z.ZodString;
        confidence_score: z.ZodOptional<z.ZodNumber>;
        priority: z.ZodOptional<z.ZodNumber>;
        code_location: z.ZodOptional<z.ZodObject<{
            file_path: z.ZodString;
            line_range: z.ZodObject<{
                start: z.ZodNumber;
                end: z.ZodNumber;
            }, z.core.$strip>;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    overall_correctness: z.ZodString;
    overall_explanation: z.ZodString;
    overall_confidence_score: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
/** Result from a reviewer stage with structured output support. */
export interface StructuredReviewResult {
    /** Parsed and filtered review from SDK structured output, or null if unavailable */
    structured: ReviewResult | null;
    /** Raw text output for fallback parsing and debugger input */
    raw: string;
}
/**
 * Merge two parallel reviewer results into one.
 *
 * Two independent reviewers run the same prompt simultaneously. This function
 * unions their findings and picks the more conservative overall_correctness.
 * When either reviewer's structured output is unavailable, it falls back to
 * text parsing ({@link parseReviewResult}) before merging.
 */
export declare function mergeReviewResults(a: StructuredReviewResult, b: StructuredReviewResult): StructuredReviewResult;
export interface PlannerContext {
    /** 1-indexed loop iteration. Iteration 1 = initial plan; >1 = re-plan. */
    iteration: number;
    /** Markdown report from the previous iteration's debugger sub-agent. */
    debuggerReport?: string;
}
/**
 * Build the planner prompt. The first iteration authors an RFC from the
 * original spec; subsequent iterations revise the RFC using the debugger
 * report from the previous loop iteration.
 *
 * The planner's deliverable is a filled-in Technical Design Document / RFC
 * rendered as markdown text
 * consumes the RFC as design context
 */
export declare function buildPlannerPrompt(spec: string, context?: PlannerContext): string;
export interface OrchestratorContext {
    /**
     * The planner's final assistant message. Under the RFC-based Ralph flow,
     * this is the authoritative design input — either an absolute path to a
     * pre-existing spec file or an inline RFC markdown document. The
     * orchestrator decomposes it into the task list using its SDK-specific
     * task-persistence tool (`TaskCreate` / `sql` / `todowrite`).
     */
    plannerNotes?: string;
}
/**
 * Build the orchestrator prompt. The orchestrator decomposes the planner's
 * design output (a spec path or inline RFC) into a task list using its
 * SDK-specific task-persistence tool, validates the dependency graph, and
 * spawns parallel workers.
 *
 * @param spec - The user's original specification. Used as context/fallback
 *   when the planner output is missing or ambiguous.
 * @param context - Planner handoff (the spec path or RFC markdown).
 */
export declare function buildOrchestratorPrompt(spec: string, context?: OrchestratorContext): string;
/** Prompts for the three parallel infrastructure-discovery sub-agents. */
export interface InfraDiscoveryPrompts {
    /** Prompt for the codebase-locator sub-agent. */
    locator: string;
    /** Prompt for the codebase-analyzer sub-agent. */
    analyzer: string;
    /** Prompt for the codebase-pattern-finder sub-agent. */
    patternFinder: string;
}
/**
 * Build prompts for three parallel sub-agent stages that discover the
 * repository's build, test, lint, and CI infrastructure. Each sub-agent
 * explores the codebase dynamically — no hard-coded file lists or patterns.
 *
 * Inspired by the deep-research-codebase workflow which dispatches
 * codebase-locator, codebase-analyzer, and codebase-pattern-finder
 * sub-agents in parallel for exploratory research.
 */
export declare function buildInfraDiscoveryPrompts(): InfraDiscoveryPrompts;
/** A single finding from the reviewer sub-agent. */
export interface ReviewFinding {
    title: string;
    body: string;
    confidence_score?: number;
    priority?: number;
    code_location?: {
        file_path: string;
        line_range: {
            start: number;
            end: number;
        };
    };
}
/** Parsed reviewer JSON output. */
export interface ReviewResult {
    findings: ReviewFinding[];
    overall_correctness: string;
    overall_explanation: string;
    overall_confidence_score?: number;
}
export interface ReviewContext {
    /**
     * Full branch changeset captured by {@link captureBranchChangeset}.
     * Contains diff stat, name-status, and uncommitted changes relative to
     * the parent branch — giving the reviewer complete visibility into every
     * change this branch introduces.
     */
    changeset: {
        baseBranch: string;
        diffStat: string;
        uncommitted: string;
        nameStatus: string;
        errors: string[];
    };
    /** 1-indexed loop iteration, used in the prompt header. */
    iteration?: number;
    /**
     * When true, instructs the reviewer to call the `submit_review` tool
     * instead of outputting JSON directly. Used by the Copilot SDK which
     * achieves structured output through tool definitions.
     */
    useSubmitTool?: boolean;
    /**
     * Raw output from the parallel infrastructure-discovery sub-agents
     * (codebase-locator, codebase-analyzer, codebase-pattern-finder).
     * When present, the reviewer uses this to identify and run the
     * repository's build/test/lint commands as part of verification.
     */
    discoveryContext?: string;
}
/**
 * Build the reviewer prompt. Injects a deterministic branch-relative
 * changeset so the reviewer sees every file this branch has touched —
 * both committed and uncommitted — without expensive tool calls.
 */
export declare function buildReviewPrompt(spec: string, context: ReviewContext): string;
export interface DebuggerContext {
    /** 1-indexed loop iteration the debugger is investigating. */
    iteration: number;
    /**
     * Branch changeset captured immediately before the review. Provides the
     * debugger with the same file-level context as the reviewer.
     */
    changeset: {
        baseBranch: string;
        diffStat: string;
        uncommitted: string;
        nameStatus: string;
        errors: string[];
    };
}
/**
 * Build a prompt asking the debugger sub-agent to investigate a set of review
 * findings and produce a structured report. The debugger MUST NOT apply
 * fixes — its only deliverable is the report, which the next iteration's
 * planner consumes.
 */
export declare function buildDebuggerReportPrompt(review: ReviewResult | null, rawReview: string, context: DebuggerContext): string;
/**
 * Parse the reviewer's JSON output. Tries, in order:
 *   1. Direct JSON.parse on the entire content.
 *   2. The LAST fenced ```json (or unlabelled) code block.
 *   3. The LAST balanced object containing a "findings" key in surrounding prose.
 *
 * Filters out P3 (minor/style) findings — only P0/P1/P2 count as actionable.
 * Returns null when no parse strategy succeeds.
 */
export declare function parseReviewResult(content: string): ReviewResult | null;
export declare function filterActionable(parsed: {
    findings: ReviewFinding[];
    overall_correctness: string;
    overall_explanation?: string;
    overall_confidence_score?: number;
}): ReviewResult;
/**
 * Extract the LAST fenced ```markdown block from a piece of text. Used for
 * parsing the debugger's structured report out of a long Claude pane
 * scrollback or any other output that may include extra prose.
 *
 * Falls back to the trimmed full input when no fenced block is present, so
 * the planner still receives the debugger's content even if formatting drifts.
 */
export declare function extractMarkdownBlock(content: string): string;
//# sourceMappingURL=prompts.d.ts.map