import { type ReminderService } from '../reminders/reminder.service.js'; import type { Reminder } from '../../shared/reminder.js'; import { WakeQueueService } from './wake-queue.service.js'; /** Throttle repeated identical preflight-error attention to once per hour. */ export declare const PREFLIGHT_ERROR_ATTENTION_THROTTLE_MS: number; export declare function setPreflightAfterRecheckHookForTests(hook?: () => Promise): void; export declare class ReminderInboxSubscriber { private readonly queue; private readonly animaHome; private poll?; private readonly jobs; private readonly reminderService; private readonly runtimeEnv; private stopping; private timer?; constructor(queue: WakeQueueService, reminderService?: ReminderService, animaHome?: string, runtimeEnv?: Record); start(): void; stop(): Promise; private pollDueReminders; private fireDueReminders; /** * Durable outbox for staged reminder wakes: * - committed (firedCount >= fireIndex; commit wins over later cancel) → publish * - missing / deferred uncommitted → abandon without seen tombstone * - uncommitted and still due → leave for the normal stage→CAS→publish path */ private reconcileStagedReminderWakes; private startPreflightJob; private runPreflightJob; private commitSucceededPreflight; private commitDeclinedPreflight; private commitErroredPreflight; /** Classic path: stage wake, complete fire, then publish (cancel-safe). */ private enqueueAndComplete; private recordPreflightErrorAttention; private recordPreflightRecovery; } /** `reminder::fire:` → n */ export declare function reminderFireIndexFromEventId(eventId: string): number | undefined; export type StagedReminderWakeAction = 'publish' | 'abandon' | 'leave'; /** * Classify a staged reminder wake against durable reminder state. * Commit ordinal (`firedCount >= fireIndex`) is authoritative even if the * reminder was cancelled after CAS — publish that wake. */ export declare function stagedReminderWakeAction(input: { fireIndex: number; nowMs: number; reminder: Reminder | undefined; }): StagedReminderWakeAction; /** Cancel/snooze/config edits bump updatedAt and must void in-flight preflight results. */ export declare function isPreflightResultStillValid(snapshot: Reminder, live: Reminder | undefined): live is Reminder; export declare function shouldNotifyPreflightError(reminder: Reminder, attentionKey: string, now: Date): boolean; //# sourceMappingURL=reminder-subscriber.d.ts.map