import { type AutomationScheduleDefinition } from '../automation/schedules.js';
import type { KnowledgeStore } from './store.js';
import type { KnowledgeJobMode, KnowledgeJobRecord, KnowledgeJobRunRecord, KnowledgeScheduleRecord } from './types.js';
import type { RuntimeEventBus } from '../runtime/events/index.js';
export interface KnowledgeSchedulingContext {
    readonly store: KnowledgeStore;
    readonly emitIfReady: (fn: (bus: RuntimeEventBus, ctx: {
        readonly traceId: string;
        readonly sessionId: string;
        readonly source: string;
    }) => void, sessionId?: string) => void;
    readonly runJobByKind: (kind: KnowledgeJobRecord['kind'], input: {
        readonly sourceIds?: readonly string[] | undefined;
        readonly limit?: number | undefined;
    }) => Promise<Record<string, unknown>>;
}
export declare class KnowledgeScheduleService {
    private readonly context;
    private readonly jobs;
    private readonly scheduleTimers;
    private schedulesInitialized;
    constructor(context: KnowledgeSchedulingContext);
    listJobs(): readonly KnowledgeJobRecord[];
    getJob(id: string): KnowledgeJobRecord | null;
    saveSchedule(input: {
        readonly id?: string | undefined;
        readonly jobId: string;
        readonly label?: string | undefined;
        readonly enabled?: boolean | undefined;
        readonly schedule: AutomationScheduleDefinition;
        readonly metadata?: Record<string, unknown> | undefined;
    }): Promise<KnowledgeScheduleRecord>;
    deleteSchedule(id: string): Promise<boolean>;
    setScheduleEnabled(id: string, enabled: boolean): Promise<KnowledgeScheduleRecord | null>;
    listJobRuns(limit?: number, jobId?: string): readonly KnowledgeJobRunRecord[];
    runJob(id: string, input?: {
        readonly mode?: KnowledgeJobMode | undefined;
        readonly sourceIds?: readonly string[] | undefined;
        readonly limit?: number | undefined;
    }): Promise<KnowledgeJobRunRecord>;
    dispose(): void;
    private initializeSchedules;
    private ensureBootstrapSchedule;
    private clearScheduleTimer;
    private reconcileSchedules;
    private runScheduledJob;
    private executeJobRun;
}
//# sourceMappingURL=scheduling.d.ts.map