/** * Relay client transport for cross-machine presence (ADR 0016, phase 2c). * * The hooks are short-lived processes, so a live WebSocket needs a home: a * small per-repo-per-machine DAEMON that the hooks lazy-start * (`ensureRelayDaemon`) and that exits itself when the machine goes idle. * The daemon: * * - derives the room credentials from the repo identity (root-commit SHA + * origin URL + optional committed `.harnery/presence-salt`) * - holds the socket open with auto-reconnect + jittered backoff * - watches the active V3 ledger and publishes the encrypted presence blob on * change (debounced), plus a 60s keepalive so peers' staleness math works * - decrypts received peer frames and writes them to * `.harnery/presence/remote/.json`, where `readRemoteMachines` * merges them with the git-refs floor (freshest source per machine wins) * - exits after ~5 minutes with no live local sessions (hooks restart it * when sessions return), and exits if its pid file is superseded * * Everything fails silent; the git-refs transport is always the floor. * Requires a global WebSocket (Bun, Node >= 21, Workers) — on older Nodes the * daemon refuses to start and presence stays on git-refs. */ /** * Lazy-start the relay daemon for this repo if a relay is configured and no * live daemon already owns the pid file. Called from the hook path — must * return fast and never throw. */ export declare function ensureRelayDaemon(coordRoot: string): void; /** Foreground daemon loop (spawned detached by ensureRelayDaemon). */ export declare function runRelayDaemon(coordRoot: string): Promise; export declare function appendPresenceRelayDiagnostic(coordRoot: string, event: string, fields?: Record): "shared" | "legacy"; /** Daemon status for `presence peers`/doctor surfaces. */ export declare function relayDaemonStatus(coordRoot: string): { running: boolean; pid?: number; url?: string; started_at?: string; }; //# sourceMappingURL=relay-client.d.ts.map