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>; } export declare class KnowledgeScheduleService { private readonly context; private readonly jobs; private readonly scheduleTimers; private schedulesInitialized; /** * Set by dispose(). Schedule arming is an async path started fire-and-forget * from the constructor, so it can still be mid-`await` when a host tears the * graph down; without this flag it re-armed bootstrap timers AFTER dispose() * had cleared the map, leaving three pending every time a short-lived process * composed a graph, answered one question and disposed. */ private disposed; 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 | undefined; }): Promise; deleteSchedule(id: string): Promise; setScheduleEnabled(id: string, enabled: boolean): Promise; 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; dispose(): void; private initializeSchedules; private ensureBootstrapSchedule; private clearScheduleTimer; private reconcileSchedules; private runScheduledJob; private executeJobRun; } //# sourceMappingURL=scheduling.d.ts.map