/** One unit of work that was interrupted by a rate limit and should be resumed * once the limit window resets. `direct` = an interactive conversation (resumed by * re-routing a message into the channel's pooled session); `thread` = a thread * pipeline (resumed via continueThread). */ export type ResumeEntry = { kind: 'direct'; channel: string; userMessage: string; recordedAt: number; } | { kind: 'thread'; threadId: string; channel: string; userMessage: string; recordedAt: number; }; export interface ResumePersistence { save: (entries: ResumeEntry[]) => Promise; load: () => Promise; } declare function initResumeRegistry(persistence: ResumePersistence): Promise; /** Record an interrupted session/thread for later resume. Idempotent per key * (direct→channel, thread→threadId): a newer record overwrites the older one. */ declare function recordResume(entry: ResumeEntry): void; /** Drain the registry: return all pending entries and clear (persists the empty list). * "take + clear" is atomic so each entry is dispatched at most once. */ declare function takeAllResumes(): ResumeEntry[]; declare function getResumeCount(): number; declare function _testReset(): void; export { initResumeRegistry, recordResume, takeAllResumes, getResumeCount, _testReset };