/**
 * Orchestration run store — lightweight SQLite persistence for async runs.
 *
 * Stores run records so nexus_run_status can show stage + progress even
 * after the MCP async-gate returned {queued:true, runId}.
 *
 * NOT a rewrite of orchestrator.ts. Additive only.
 * Used by: async-gate (stage updates), nexus_run_status (polling).
 */
export type OrchRunStatus = 'queued' | 'running' | 'completed' | 'failed';
export interface OrchSpan {
    spanId: string;
    runId: string;
    parentId: string | null;
    name: string;
    startedAt: number;
    endedAt: number | null;
    status: 'ok' | 'error';
    attrs: Record<string, unknown>;
}
export interface OrchRun {
    runId: string;
    goal: string;
    status: OrchRunStatus;
    stage: string;
    progress: number;
    client: string;
    startedAt: number;
    updatedAt: number;
    completedAt: number | null;
    error: string | null;
    resultSummary: string | null;
}
export declare function createRun(runId: string, goal: string, client?: string): OrchRun;
export declare function updateStage(runId: string, stage: string, progress: number): void;
export declare function completeRun(runId: string, summary: string): void;
export declare function failRun(runId: string, error: string): void;
export declare function getRun(runId: string): OrchRun | null;
export declare function listRecentRuns(limit?: number, client?: string): OrchRun[];
/** Prune completed runs older than retainDays (default 30). */
export declare function pruneOldRuns(retainDays?: number): number;
export declare function startSpan(runId: string, name: string, parentId?: string, attrs?: Record<string, unknown>): string;
export declare function endSpan(spanId: string, status?: 'ok' | 'error', attrs?: Record<string, unknown>): void;
export declare function getSpans(runId: string): OrchSpan[];
