import type { DaemonComponents } from '../boot/daemon-lifecycle.js';
export declare function bootstrapQueueTaskCountsAsHandled(task: {
    status: string;
    targetNodeId?: string | null;
    autoLaunch?: {
        status: string;
        updatedAt: string;
    } | null;
}, bootstrapNodeId: string, nowMs: number): boolean;
export declare function recoverMeshIdByCoordinatorAndNode(coordinatorDaemonId: string, nodeId: string): string;
export declare function resolveForwardEventMeshId(components: DaemonComponents, payload: Record<string, unknown>): string;
export declare function __resetMeshWorkspaceCacheForTests(): void;
export declare function buildRelayMetadataEvent(payload: Record<string, unknown>): Record<string, unknown>;
export declare function handleMeshForwardEvent(components: DaemonComponents, payload: Record<string, unknown>): {
    [extra: string]: unknown;
    success: true;
    forwarded: 0;
    suppressed: true;
} | {
    success: boolean;
    forwarded: number;
    suppressed: boolean;
    autoApprovingWorkerApproval: boolean;
    staleDispatchRejected?: undefined;
    error?: undefined;
} | {
    success: boolean;
    forwarded: number;
    suppressed: boolean;
    staleDispatchRejected: boolean;
    autoApprovingWorkerApproval?: undefined;
    error?: undefined;
} | {
    success: boolean;
    forwarded: number;
    suppressed?: undefined;
    autoApprovingWorkerApproval?: undefined;
    staleDispatchRejected?: undefined;
    error?: undefined;
} | {
    success: boolean;
    error: string;
};
/**
 * NOTIF-HELD-DRAIN (Fix 2): event-driven coordinator drain. The reconcile loop delivers a
 * worker's queued completion to an IDLE local coordinator only on its periodic poll. When a
 * coordinator is sitting idle awaiting exactly that completion, waiting up to a full poll
 * interval is the avoidable delivery latency the RCA flags — and combined with the (now-fixed)
 * modal-park false-positive it stretched into the multi-minute notification stall. So the
 * MOMENT a worker delegate event is persisted for a mesh, attempt the same idle-coordinator
 * drain immediately, mirroring the event-driven worker-claim path (agent:ready /
 * agent:generating_completed → triggerMeshQueue).
 *
 * Safety:
 *  - drainPendingMeshCoordinatorEvents marks rows drained=1 atomically, so this races the
 *    reconcile poll and the coordinator's own idle auto-flush harmlessly — exactly one consumes
 *    each row.
 *  - Only IDLE, non-modal-parked coordinators are delivery targets (never a generating /
 *    consent-modal PTY).
 *  - Strict session routing is honoured: an event naming an originating coordinator session is
 *    delivered only to that live idle session; anything not currently deliverable here
 *    (wrong/absent session, or a message-less lifecycle event) is RE-QUEUED — never dropped —
 *    so the reconcile loop's strict hold/expire path remains the single authority for it.
 */
export declare function flushPendingForMeshIdleCoordinators(components: DaemonComponents, meshId: string): void;
export declare function setupMeshEventForwarding(components: DaemonComponents): void;
