import type { Workflow, WorkflowState, WorkflowArtifact } from "./types.js";
/**
 * Manages execution of a single workflow within a session.
 */
export declare class WorkflowRunner {
    private workflow;
    private state;
    private onChange?;
    constructor(workflowId: string, sessionId: string, options?: {
        onChange?: (state: WorkflowState) => void;
    });
    /** Restore a runner from persisted state */
    static restore(sessionId: string, options?: {
        onChange?: (state: WorkflowState) => void;
    }): WorkflowRunner | null;
    getState(): WorkflowState;
    getWorkflow(): Workflow;
    getCurrentPhase(): import("./types.js").Phase;
    /** Get the instructions for the current phase */
    getCurrentInstructions(): string;
    /** Advance to the next phase. Completes the current phase. */
    advancePhase(): boolean;
    /** Reset to an earlier phase, marking intervening phases */
    resetToPhase(phaseId: string, context?: string): boolean;
    /** Collect an artifact (stores to disk) */
    collectArtifact(name: string, content: string | Buffer, mimeType?: string): WorkflowArtifact;
    /** Set a context value */
    setContext(key: string, value: string): void;
    /** Apply multiple collect_artifact and set_context operations with a single persist */
    batchOperations(ops: Array<{
        op: "collect_artifact";
        name: string;
        content: string | Buffer;
        mimeType?: string;
    } | {
        op: "set_context";
        key: string;
        value: string;
    }>): void;
    /** Mark workflow as failed */
    fail(reason?: string): void;
    /** Cancel the workflow */
    cancel(): void;
    /** Mark complete (called when advancing past the last phase) */
    complete(): void;
    /**
     * Server-side synthesis of code review findings.
     * Reads delegate output artifacts, merges/deduplicates/sorts findings,
     * stores the merged artifact, and sets all context values.
     * Returns the number of findings.
     *
     * Core logic lives in `synthesis.ts` — this method delegates to it
     * and applies the results to workflow state.
     */
    synthesiseFindings(): number;
    private generateAndStoreReport;
    private persist;
    /** Remove persisted state */
    static cleanup(sessionId: string): void;
}
//# sourceMappingURL=engine.d.ts.map