import type { MeshLedgerKind } from './mesh-ledger.js';
export declare function findRecentTerminalLedgerEvidence(args: {
    meshId: string;
    sessionId?: string;
    nodeId?: string;
}): {
    id: string;
    kind: MeshLedgerKind;
    payload: Record<string, unknown>;
    timestamp: string;
} | null;
export declare function hasDispatchAfterTerminal(meshId: string, sessionId: string, terminalId: string): boolean;
export declare function hasUnterminalDirectDispatchLedgerEntry(meshId: string, sessionId: string): boolean;
export declare function findTerminalLedgerEvidenceForTask(args: {
    meshId: string;
    taskId?: string;
    sessionId?: string;
    nodeId?: string;
    tail?: number;
}): {
    id: string;
    kind: Extract<MeshLedgerKind, 'task_completed' | 'task_failed' | 'task_stalled'>;
    payload: Record<string, unknown>;
    timestamp: string;
} | null;
export declare function reconcileDirectDispatchCompletionFromTranscript(args: {
    meshId: string;
    nodeId?: string;
    sessionId: string;
    providerType?: string;
    providerSessionId?: string;
    taskId: string;
    finalSummary: string;
    transcriptMessageAt?: string;
    completedAt?: string;
    targetCoordinatorDaemonId?: string;
    /**
     * NOTIF-DROP-SYNTH-NO-MESSAGE: the originating coordinator SESSION that dispatched this
     * task (the `coordinatorSessionId` stamped onto the task_dispatched ledger payload at
     * dispatch). Stamped onto the synthesized completion's targetCoordinatorSessionId so PHASE 2
     * STRICT routing matches the exact coordinator session — instead of relying on the
     * daemon-keyed fallback. When the caller does not pass it, it is recovered from the dispatch
     * ledger entry below; absent on legacy rows → daemon-level routing (unchanged).
     */
    targetCoordinatorSessionId?: string;
    source?: string;
}): {
    reconciled: boolean;
    kind?: MeshLedgerKind;
    alreadyTerminal?: boolean;
    workerResult?: unknown;
    ledgerEntryId?: string;
    reason?: string;
};
export declare function buildNoProgressCompletionReconciliation(args: {
    meshId: string;
    nodeId?: string;
    nodeLabel: string;
    metadataEvent: Record<string, unknown>;
    sourceInstanceId?: string;
}): Record<string, unknown> | null;
