import type { ArkmeUnifiedTimelineEvent } from './unified-chat-timeline.js'; /** Public facts. Counts describe one frozen cohort, never read acknowledgements. */ export interface ArkmeMessageSyncProgress { accountKey: string; cycle: number; revision: number; phase: 'idle' | 'discovering' | 'syncing' | 'paused' | 'unsupported'; completed: number; total: number; pending: number; terminal: number; retryAtMillis?: number; reason?: 'network' | 'storage' | 'authentication' | 'upstream' | 'capacity'; } export type ChatSyncState = 'available' | 'removed' | 'restricted' | 'pending' | 'missing'; export interface ChatSyncWork { id: string; revision: number; version: number; state: ChatSyncState; sequence: number; unread: boolean; eventId?: string; itemKey?: string; event?: ArkmeUnifiedTimelineEvent; } export interface ChatSyncSession { uid: string; kind: number; membership: number; accessible: boolean; complete: boolean; position: Record; cacheRequired: boolean; work: ChatSyncWork[]; scope?: string; sourceKey?: string; } export interface ChatSyncPage { checkpoint: string; hasMore: boolean; retry: boolean; manifest: boolean; sessions: ChatSyncSession[]; /** Raw authorized bodies exist only between transport and Host projection. */ bodies: Map[]>; } export interface ChatSyncPlan { progress: ArkmeMessageSyncProgress; checkpoint: string; epoch: number; active: boolean; } export interface ChatSyncBatch { uid: string; kind: number; membership: number; work: ChatSyncWork[]; } export interface ChatSyncLocalPage { events: ArkmeUnifiedTimelineEvent[]; before?: number; revision: number; } export type ChatSyncCommand = { action: 'begin'; account: string; } | { action: 'status'; account: string; } | { action: 'ack'; account: string; sourceKey: string; through: number; } | { action: 'manifest' | 'commit'; account: string; epoch: number; expectedCheckpoint: string; page: Omit; ticket: number; now: number; } | { action: 'freeze' | 'finish'; account: string; epoch: number; } | { action: 'pending'; account: string; epoch: number; now: number; limit: number; } | { action: 'ranges'; account: string; epoch: number; } | { action: 'read'; scope: string; anchorId?: string; limit: number; before?: number; }; export declare function parseChatSyncPage(raw: unknown, manifest: boolean): ChatSyncPage; //# sourceMappingURL=chat-message-sync.d.ts.map