import { type ChildProcess, type SpawnOptions } from "node:child_process";
export interface ErrorRow {
    id: string;
    project_id: string;
    fingerprint: string;
    status: string;
    type: string | null;
    message: string | null;
    stack: string | null;
    code_context: string | null;
    runtime: string | null;
    occurrences: number;
    recurrence_count: number;
    branch: string | null;
}
export type SpawnFn = (command: string, args: readonly string[], options: SpawnOptions) => ChildProcess;
export interface FixOptions {
    ingestUrl?: string;
    homeDir?: string;
    fetchFn?: typeof fetch;
    spawnFn?: SpawnFn;
    ezcoderBin?: string;
    inheritStdio?: boolean;
    maxTurns?: number;
}
export interface FixResult {
    errorId: string;
    projectName: string;
    branch: string;
    outcome: "awaiting_review" | "failed";
    reason: string;
}
export declare function fixError(errorId: string, opts?: FixOptions): Promise<FixResult>;
export interface QueueOptions extends FixOptions {
    onProgress?: (msg: string) => void;
}
export declare function runQueue(opts?: QueueOptions): Promise<{
    fixed: number;
    failed: number;
    total: number;
}>;
/**
 * In-Ink fix flow: prepares the fix (fetch, mark in_progress, build prompt) so
 * the caller can hand the prompt to its existing agent loop. Pair with
 * `finalizePixelFix` after the agent run completes.
 */
export interface PreparedPixelFix {
    errorId: string;
    projectId: string;
    projectName: string;
    projectPath: string;
    branch: string;
    prompt: string;
}
export interface PrepareOptions {
    ingestUrl?: string;
    homeDir?: string;
    fetchFn?: typeof fetch;
}
export declare function preparePixelFix(errorId: string, opts?: PrepareOptions): Promise<PreparedPixelFix>;
export interface FinalizeOptions extends PrepareOptions {
    spawnFn?: SpawnFn;
    agentExitedCleanly?: boolean;
}
export declare function finalizePixelFix(prep: PreparedPixelFix, opts?: FinalizeOptions): Promise<{
    outcome: "awaiting_review" | "failed";
    reason: string;
}>;
export declare function buildAgentPrompt(error: ErrorRow, branch: string, projectDir?: string): string;
//# sourceMappingURL=pixel-fix.d.ts.map