/**
 * First-class local run records — objectives, commands, logs, files, replay.
 * All data stored locally; stdout/stderr redacted before persistence.
 */
import type { Database } from "bun:sqlite";
export declare const RUN_RECORD_SCHEMA = "todos.run_record.v1";
export declare const RUN_RECORD_STATUSES: readonly ["active", "completed", "failed", "archived"];
export type RunRecordStatus = (typeof RUN_RECORD_STATUSES)[number];
export interface RunCommandEntry {
    command: string;
    exit_code?: number;
    at: string;
    duration_ms?: number;
}
export interface RunStatusTransition {
    from: RunRecordStatus | null;
    to: RunRecordStatus;
    at: string;
    note?: string;
}
export interface RunVerificationRef {
    record_id: string;
    provider: string;
    status: string;
    at: string;
}
export interface RunRecord {
    schema_version: typeof RUN_RECORD_SCHEMA;
    id: string;
    agent_run_id: string | null;
    agent_id: string | null;
    objective: string | null;
    plan_id: string | null;
    claimed_task_ids: string[];
    commands: RunCommandEntry[];
    stdout_summary: string | null;
    stderr_summary: string | null;
    files_touched: string[];
    verification_results: RunVerificationRef[];
    artifact_ids: string[];
    status_transitions: RunStatusTransition[];
    status: RunRecordStatus;
    replay_bundle: string | null;
    metadata: Record<string, unknown>;
    started_at: string;
    completed_at: string | null;
    created_at: string;
    updated_at: string;
}
export interface CreateRunRecordInput {
    agent_run_id?: string;
    agent_id?: string;
    objective?: string;
    plan_id?: string;
    claimed_task_ids?: string[];
    metadata?: Record<string, unknown>;
}
export interface ListRunRecordsFilter {
    agent_run_id?: string;
    agent_id?: string;
    plan_id?: string;
    status?: RunRecordStatus;
    limit?: number;
    offset?: number;
}
export interface RunReplayBundle {
    schema_version: typeof RUN_RECORD_SCHEMA;
    exported_at: string;
    record: RunRecord;
}
export declare function createRunRecord(input?: CreateRunRecordInput, db?: Database): RunRecord;
export declare function getRunRecord(id: string, db?: Database): RunRecord | null;
export declare function listRunRecords(filter?: ListRunRecordsFilter, db?: Database): RunRecord[];
export declare function appendRunCommand(id: string, command: string, options?: {
    exit_code?: number;
    duration_ms?: number;
    stdout?: string;
    stderr?: string;
}, db?: Database): RunRecord;
export declare function recordFilesTouched(id: string, paths: string[], db?: Database): RunRecord;
export declare function linkRunVerification(id: string, ref: Omit<RunVerificationRef, "at"> & {
    at?: string;
}, db?: Database): RunRecord;
export declare function linkRunArtifact(id: string, artifactId: string, db?: Database): RunRecord;
export declare function completeRunRecord(id: string, note?: string, db?: Database): RunRecord;
export declare function failRunRecord(id: string, error: string, db?: Database): RunRecord;
export declare function buildRunReplayBundle(id: string, db?: Database): RunReplayBundle;
export declare function exportRunReplay(id: string, outputPath?: string, db?: Database): {
    path: string;
    bundle: RunReplayBundle;
};
export declare function formatRunRecordMarkdown(record: RunRecord): string;
export declare function getDefaultReplayDir(): string;
//# sourceMappingURL=run-records.d.ts.map