import type { ConfigManager } from '../config/manager.js'; import type { AutomationJob } from './jobs.js'; import type { AutomationRun } from './runs.js'; import type { AutomationRunTrigger } from './types.js'; export interface AutomationHeartbeatWake { readonly jobId: string; readonly jobName: string; readonly trigger: AutomationRunTrigger; readonly dueRun: boolean; readonly attempt: number; readonly queuedAt: number; readonly reason: string; } interface AutomationSchedulingContext { readonly configManager: ConfigManager; readonly jobs: Map; readonly timers: Map>; readonly heartbeatWakes: Map; readonly running: () => boolean; readonly saveJobs: () => Promise; readonly activeRunCount: () => number; readonly maxConcurrentRuns: () => number; readonly executeJob: (job: AutomationJob, trigger: AutomationRunTrigger, dueRun: boolean, attempt?: number) => Promise; /** * Record that a scheduled occurrence was missed, the planned run time is now * further in the past than the catch-up window, so the run never fired (the * daemon was down, or the host was asleep). Optional so callers that only * (re)schedule live jobs need not wire it. When present it is invoked with the * planned-but-missed run time before the next occurrence is recomputed. */ readonly recordMissedRun?: ((job: AutomationJob, plannedRunAt: number) => void) | undefined; } export declare function scheduleAutomationJob(context: AutomationSchedulingContext, job: AutomationJob): void; export declare function cancelAutomationTimer(timers: Map>, jobId: string): void; export declare function queueDueHeartbeatAutomationJobs(jobs: Iterable, heartbeatWakes: Map, reason: string): void; export declare function queueHeartbeatWake(heartbeatWakes: Map, job: AutomationJob, trigger: AutomationRunTrigger, dueRun: boolean, attempt: number, reason: string): void; export declare function advanceScheduledHeartbeatAutomationJob(context: Pick, timers: Map>, jobId: string, reschedule: (job: AutomationJob) => void): void; export {}; //# sourceMappingURL=manager-runtime-scheduling.d.ts.map