/** * Schema-cutover client registry. Each client keeps a * heartbeat doc at `_meta/schema-fence:client:` carrying its * liveness (`lastSeen`) and the fence generation it has quiesced for * (`quiescedAtVersion`). Plaintext envelope, like the fence doc. */ import type { NoydbStore } from '../../kernel/types.js'; export interface ClientDoc { readonly clientId: string; readonly lastSeen: number; readonly quiescedAtVersion: number | null; /** * Session that owns this writer (one user's writers across vaults). Additive * and optional so legacy client docs (written without it) keep parsing; * readers default it. */ readonly sessionId?: string; } export declare function writeClientDoc(store: NoydbStore, vault: string, clientId: string, doc: { lastSeen: number; quiescedAtVersion: number | null; sessionId?: string; }): Promise; export declare function listClientDocs(store: NoydbStore, vault: string): Promise; /** * True when every *active* client (lastSeen within staleMs of now) has * `quiescedAtVersion === generation`. Stale clients are ignored. An empty * active set is vacuously quiesced. */ export declare function activeQuiesced(store: NoydbStore, vault: string, opts: { generation: number; now: number; staleMs: number; excludeClientId?: string; }): Promise;