import type { AppendRemoteLedgerResult, MeshLedgerSummary } from './mesh-ledger.js';
/** Minimal ledger slice shape accepted by buildMeshLedgerReplicaEvidence. Covers both JSONL and SQLite slices. */
export interface AnyLedgerSlice {
    entries: Array<{
        id: string;
        meshId: string;
        timestamp: string;
        kind: string;
        nodeId?: string | null;
        sessionId?: string | null;
        providerType?: string | null;
        payload: unknown;
    }>;
    cursor: {
        afterId: string | null;
        nextAfterId: string | null;
        limit: number;
        hasMore: boolean;
    };
    summary?: MeshLedgerSummary;
}
export type MeshLedgerReplicaStatus = 'local' | 'queried' | 'imported' | 'failed';
export interface MeshLedgerReplicaEvidence {
    nodeId: string;
    daemonId?: string;
    status: MeshLedgerReplicaStatus;
    transport: 'local' | 'p2p_datachannel';
    protocol: 'adhdev.mesh.ledger.slice.v1';
    entriesReceived: number;
    entriesImported: number;
    skippedDuplicate: number;
    rejectedInvalid: number;
    hasMore: boolean;
    nextAfterId: string | null;
    lastTimestamp: string | null;
    summary?: MeshLedgerSummary;
    error?: string;
    noFallbackReason?: string;
}
export interface MeshLedgerReconciliationEvidence {
    protocol: 'adhdev.mesh.ledger.reconciliation.v1';
    meshId: string;
    generatedAt: string;
    sourceOfTruth: {
        kind: 'coordinator_local_sqlite';
        p2pOnly: true;
        notes: string;
    };
    replicas: MeshLedgerReplicaEvidence[];
    totals: {
        replicas: number;
        queried: number;
        failed: number;
        entriesReceived: number;
        entriesImported: number;
        skippedDuplicate: number;
        rejectedInvalid: number;
    };
    convergence: {
        complete: boolean;
        pendingNodes: string[];
        failedNodes: string[];
    };
}
export declare function buildMeshLedgerReplicaEvidence(args: {
    nodeId: string;
    daemonId?: string;
    transport: 'local' | 'p2p_datachannel';
    slice?: AnyLedgerSlice;
    importResult?: AppendRemoteLedgerResult;
    status?: MeshLedgerReplicaStatus;
    error?: string;
}): MeshLedgerReplicaEvidence;
export declare function buildMeshLedgerReconciliationEvidence(meshId: string, replicas: MeshLedgerReplicaEvidence[]): MeshLedgerReconciliationEvidence;
