/** * @fileoverview Cron job registration for SessionJanitor nightly runs * * Registers a cron job that runs the SessionJanitor at 3 AM local time daily. */ import type { SessionJanitor } from "../orchestrator/janitor.js"; import type { CronJobCreate } from "./types.js"; export declare const JANITOR_JOB_ID = "session-janitor-nightly"; export declare const JANITOR_JOB_NAME = "Session Janitor - Nightly Context Reset"; /** * Default schedule for the janitor job: 3 AM local time daily */ export declare const JANITOR_DEFAULT_SCHEDULE: CronJobCreate["schedule"]; /** * Creates the janitor cron job configuration */ export declare function createJanitorCronJob(janitor: SessionJanitor, options?: { schedule?: CronJobCreate["schedule"]; enabled?: boolean; }): CronJobCreate; /** * Executes the janitor process. This is called by the cron service * when the janitor job fires. */ export declare function executeJanitorJob(janitor: SessionJanitor): Promise<{ status: "ok" | "error"; summary?: string; error?: string; }>; /** * Registers the janitor job with the cron service if it doesn't exist. * Updates the existing job if the schedule has changed. */ export declare function registerJanitorJob(cronService: { getJob(id: string): { id: string; schedule: CronJobCreate["schedule"]; } | undefined; add(job: CronJobCreate): Promise; update(id: string, patch: { schedule?: CronJobCreate["schedule"]; enabled?: boolean; }): Promise; }, janitor: SessionJanitor, options?: { schedule?: CronJobCreate["schedule"]; enabled?: boolean; }): Promise<{ registered: boolean; updated: boolean; jobId: string; }>; /** * Unregisters the janitor job from the cron service. */ export declare function unregisterJanitorJob(cronService: { remove(id: string): Promise; getJob(id: string): unknown; }): Promise<{ removed: boolean; }>;