import type { Database } from "bun:sqlite";
import { type LocalAuditLedgerCheckpointConfig } from "./config.js";
export declare const LOCAL_AUDIT_LEDGER_SCHEMA_VERSION = 1;
export declare const LOCAL_AUDIT_LEDGER_HASH_ALGORITHM = "sha256";
export declare const LOCAL_AUDIT_LEDGER_INITIAL_HASH: string;
export type LocalAuditLedgerSource = "task_history" | "task_verification" | "run_event" | "run_command" | "run_artifact" | "approval_gate" | "handoff";
export interface LocalAuditLedgerScope {
    project_id?: string;
    task_id?: string;
    run_id?: string;
}
export interface LocalAuditLedgerInput extends LocalAuditLedgerScope {
    include_entries?: boolean;
}
export interface SealLocalAuditLedgerInput extends LocalAuditLedgerScope {
    name: string;
    agent_id?: string;
    note?: string;
}
export interface LocalAuditLedgerEntry {
    index: number;
    source: LocalAuditLedgerSource;
    source_id: string;
    task_id: string | null;
    run_id: string | null;
    project_id: string | null;
    created_at: string;
    payload_hash: string;
    previous_hash: string;
    chain_hash: string;
    payload: Record<string, unknown>;
}
export interface LocalAuditLedger {
    schema_version: typeof LOCAL_AUDIT_LEDGER_SCHEMA_VERSION;
    local_only: true;
    hash_algorithm: typeof LOCAL_AUDIT_LEDGER_HASH_ALGORITHM;
    project_id: string | null;
    task_id: string | null;
    run_id: string | null;
    entry_count: number;
    root_hash: string;
    first_entry_hash: string | null;
    last_entry_hash: string | null;
    source_counts: Record<string, number>;
    generated_at: string;
    entries?: LocalAuditLedgerEntry[];
}
export interface LocalAuditLedgerVerifyResult {
    ok: boolean;
    checkpoint: LocalAuditLedgerCheckpointConfig | null;
    current: Omit<LocalAuditLedger, "entries">;
    issues: string[];
}
export declare function getLocalAuditLedger(input?: LocalAuditLedgerInput, db?: Database): LocalAuditLedger;
export declare function sealLocalAuditLedger(input: SealLocalAuditLedgerInput, db?: Database): LocalAuditLedgerCheckpointConfig;
export declare function listLocalAuditLedgerCheckpoints(): LocalAuditLedgerCheckpointConfig[];
export declare function verifyLocalAuditLedger(checkpointIdOrName: string, db?: Database): LocalAuditLedgerVerifyResult;
export declare function renderLocalAuditLedgerMarkdown(ledger: LocalAuditLedger | LocalAuditLedgerVerifyResult): string;
//# sourceMappingURL=audit-ledger.d.ts.map