import type { Database } from "bun:sqlite";
export interface Checkpoint {
    id: string;
    task_id: string;
    agent_id: string | null;
    step: string;
    status: "pending" | "running" | "completed" | "failed" | "skipped";
    data: Record<string, unknown>;
    error: string | null;
    attempt: number;
    max_attempts: number;
    started_at: string | null;
    completed_at: string | null;
    created_at: string;
    updated_at: string;
}
export interface Heartbeat {
    id: string;
    task_id: string;
    agent_id: string | null;
    step: string | null;
    message: string | null;
    progress: number | null;
    meta: Record<string, unknown>;
    created_at: string;
}
export declare function upsertCheckpoint(task_id: string, step: string, updates: {
    agent_id?: string;
    status?: Checkpoint["status"];
    data?: Record<string, unknown>;
    error?: string | null;
    attempt?: number;
    max_attempts?: number;
    started_at?: string | null;
    completed_at?: string | null;
}, db?: Database): Checkpoint;
export declare function getCheckpoint(taskId: string, step: string, db?: Database): Checkpoint | null;
export declare function getTaskCheckpoints(taskId: string, db?: Database): Checkpoint[];
export declare function getTaskHeartbeats(taskId: string, limit?: number, db?: Database): Heartbeat[];
export declare function emitHeartbeat(task_id: string, opts?: {
    agent_id?: string;
    step?: string;
    message?: string;
    progress?: number;
    meta?: Record<string, unknown>;
}, db?: Database): Heartbeat;
export declare function getLastHeartbeat(taskId: string, db?: Database): Heartbeat | null;
export declare function getTaskProgress(taskId: string, db?: Database): {
    total_steps: number;
    completed_steps: number;
    failed_steps: number;
    pending_steps: number;
    last_heartbeat?: Heartbeat | null;
};
//# sourceMappingURL=checkpoints.d.ts.map