import { type AutomationScheduleDefinition } from '@pellux/goodvibes-sdk/platform/automation/schedules';
import type { KnowledgeStore } from '@pellux/goodvibes-sdk/platform/knowledge/store';
import type { KnowledgeJobMode, KnowledgeJobRecord, KnowledgeJobRunRecord, KnowledgeScheduleRecord } from '@pellux/goodvibes-sdk/platform/knowledge/types';
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[];
        readonly limit?: number;
    }) => 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;
        readonly jobId: string;
        readonly label?: string;
        readonly enabled?: boolean;
        readonly schedule: AutomationScheduleDefinition;
        readonly metadata?: Record<string, unknown>;
    }): 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;
        readonly sourceIds?: readonly string[];
        readonly limit?: number;
    }): Promise<KnowledgeJobRunRecord>;
    dispose(): void;
    private initializeSchedules;
    private clearScheduleTimer;
    private reconcileSchedules;
    private runScheduledJob;
    private executeJobRun;
}
//# sourceMappingURL=scheduling.d.ts.map