/** * In-app memory ritual scheduler for the `bujo` tier. * * Schedules lightweight `store.consolidate()` on its configured cron cadence * (default: every two hours). Cron validation and next-run calculation use the * same parser contract as the cron adapter. Memory consolidation has no * timezone setting, so its historical UTC cadence remains explicit here. * * Design guarantees: * - Only schedules for `store.tier() === "bujo"` (needs the LLM tier). * - Consolidation defaults enabled; set `enabled: false` to opt out. * - Skip-overlap: never starts a run while the previous is in flight. * - Never-throws: errors are caught and logged via `logger.warn`; the * scheduler reschedules after every run (success or failure). * - Injectable `now` / `setTimer` / `clearTimer` for deterministic testing. */ export interface MemoryRitualSchedule { readonly enabled?: boolean; readonly cron?: string; } export interface StartMemoryRitualsInput { readonly store: { tier(): string; consolidate(): Promise; }; /** From config.memory.consolidation */ readonly consolidation?: MemoryRitualSchedule; readonly logger?: { info(m: string): void; warn(m: string): void; }; /** Injectable clock for tests. Defaults to `() => new Date()`. */ readonly now?: () => Date; /** * Injectable timer factory for tests. * Defaults to a `setTimeout` wrapper returning the timeout handle. */ readonly setTimer?: (cb: () => void, ms: number) => { unref?: () => void; }; /** Injectable timer canceller. Defaults to `clearTimeout`. */ readonly clearTimer?: (handle: unknown) => void; } export interface RunningRituals { stop(): void; } export declare function startMemoryRituals(input: StartMemoryRitualsInput): RunningRituals; //# sourceMappingURL=memory-rituals.d.ts.map