import type { HeartbeatRecoveryTrigger } from "@rudderhq/shared";
import { agents, heartbeatRuns } from "@rudderhq/db";
export { prioritizeProjectWorkspaceCandidatesForRun, type ResolvedWorkspaceForRun } from "../agent-run-context.js";
export declare function createHeartbeatRecoveryHandlers(context: any): {
    enqueueRecoveryRun: (run: typeof heartbeatRuns.$inferSelect, agent: typeof agents.$inferSelect, opts: {
        recoveryTrigger: HeartbeatRecoveryTrigger;
        source: NonNullable<WakeupOptions["source"]>;
        triggerDetail: NonNullable<WakeupOptions["triggerDetail"]>;
        wakeReason: string;
        requestedByActorType: WakeupOptions["requestedByActorType"];
        requestedByActorId: string | null;
        startImmediately?: boolean;
        now: Date;
    }) => Promise<any>;
    enqueueProcessLossRetry: (run: typeof heartbeatRuns.$inferSelect, agent: typeof agents.$inferSelect, now: Date) => Promise<any>;
    parseHeartbeatPolicy: (agent: typeof agents.$inferSelect) => {
        enabled: boolean;
        intervalSec: number;
        wakeOnDemand: boolean;
        preflightEnabled: boolean;
        maxConcurrentRuns: number;
    };
    markAgentHeartbeatChecked: (agent: typeof agents.$inferSelect, outcome: "skipped") => Promise<void>;
    evaluateTimerPreflight: (agent: typeof agents.$inferSelect) => Promise<TimerPreflightResult>;
    runHasIssueClosureComment: (tx: any, run: typeof heartbeatRuns.$inferSelect, issueId: string) => Promise<boolean>;
    runHasIssueReviewDecision: (tx: any, run: typeof heartbeatRuns.$inferSelect, issueId: string) => Promise<boolean>;
    issueHasDeferredWake: (tx: any, orgId: string, issueId: string) => Promise<boolean>;
    passiveFollowupAlreadyRecorded: (tx: any, runId: string) => Promise<boolean>;
    reviewerCloseoutAlreadyRecorded: (tx: any, runId: string) => Promise<boolean>;
    issueHasConfirmedBlockedReviewerHandoff: (tx: any, issue: PassiveFollowupIssueRow, reviewerAgentId: string) => Promise<boolean>;
    evaluatePassiveIssueClosureForLockedIssue: (input: {
        tx: any;
        run: typeof heartbeatRuns.$inferSelect;
        issue: PassiveFollowupIssueRow;
        now: Date;
    }) => Promise<PassiveIssueClosureOutcome>;
};
//# sourceMappingURL=heartbeat.recovery.d.ts.map