import { type Database } from "./database.js"; export type QuiescenceReceiptWakeRepairCursor = { workspaceId: string; sessionId: string; }; /** * How long after its attempt closed a recovering session becomes a repair * candidate. The woken workflow can prove a dead activity gone only once * Temporal's server-owned `runAgentTurn` heartbeat lease (two minutes after * the last heartbeat, which precedes the close) has expired, so an earlier * wake would only be paced away. Must be at least that heartbeat timeout. * Migration 1260's inventory uses the same interval. */ export declare const QUIESCENCE_REPAIR_CLOSE_GRACE_SECONDS = 120; /** * How long the session's latest wake must have been delivered before the * reaper wakes it again: one repair wake per window while it stays stranded. * A wake delivered after the activity lease expired already ran the exact * reconciliation, so the stranding wake is never later than the close grace * and a repair lands within close grace + this window (plus one dispatcher * period). `OpenGeniSessionRecoveryBacklogStale` must clearly outlast that, so * a self-repair within the designed time never pages; apps/worker's * recovery-repair alert test holds the two together. * Migration 1260's inventory uses the same interval. */ export declare const QUIESCENCE_REPAIR_WAKE_QUIET_SECONDS = 120; /** The root's peekSessionWork, injected so this module never imports the root * barrel that re-exports it. */ export type QuiescenceRepairWorkPeek = (db: Database, workspaceId: string, sessionId: string) => Promise<{ kind: string; }>; /** A keyset cursor lets busy candidates coexist with later eligible sessions. * It is inventory progress only; every target is rechecked and a restart * safely begins another idempotent lap. */ export declare function repairMissingQuiescenceReceiptWakesWith(peekSessionWork: QuiescenceRepairWorkPeek, db: Database, limit?: number, after?: QuiescenceReceiptWakeRepairCursor | null): Promise<{ examined: number; registered: number; failed: number; cursor: QuiescenceReceiptWakeRepairCursor | null; }>;