export const INITIAL_SYNC_PENDING_DEVICE_KEY = "peach_initial_sync_pending_device_id"; export interface InitialSyncDevice { deviceId: string; lastSyncedAt?: number; } /** * Pairing persists identity and vault-key material before the first entry sync. * A receiver is ready to reveal its vault only after the newly paired source * has completed a real sync round, recorded by its durable lastSyncedAt. */ export function hasCompletedInitialSync( devices: InitialSyncDevice[], pendingDeviceId: string, ): boolean { return devices.some( (device) => device.deviceId === pendingDeviceId && typeof device.lastSyncedAt === "number", ); }