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<string, AutomationJob>;
    readonly timers: Map<string, ReturnType<typeof setTimeout>>;
    readonly heartbeatWakes: Map<string, AutomationHeartbeatWake>;
    readonly running: () => boolean;
    readonly saveJobs: () => Promise<void>;
    readonly activeRunCount: () => number;
    readonly maxConcurrentRuns: () => number;
    readonly executeJob: (job: AutomationJob, trigger: AutomationRunTrigger, dueRun: boolean, attempt?: number) => Promise<AutomationRun>;
}
export declare function scheduleAutomationJob(context: AutomationSchedulingContext, job: AutomationJob): void;
export declare function cancelAutomationTimer(timers: Map<string, ReturnType<typeof setTimeout>>, jobId: string): void;
export declare function queueDueHeartbeatAutomationJobs(jobs: Iterable<AutomationJob>, heartbeatWakes: Map<string, AutomationHeartbeatWake>, reason: string): void;
export declare function queueHeartbeatWake(heartbeatWakes: Map<string, AutomationHeartbeatWake>, job: AutomationJob, trigger: AutomationRunTrigger, dueRun: boolean, attempt: number, reason: string): void;
export declare function advanceScheduledHeartbeatAutomationJob(context: Pick<AutomationSchedulingContext, 'jobs' | 'saveJobs'>, timers: Map<string, ReturnType<typeof setTimeout>>, jobId: string, reschedule: (job: AutomationJob) => void): void;
export {};
//# sourceMappingURL=manager-runtime-scheduling.d.ts.map