export type BeaconSocketRole = "client"; export type BeaconHelloMessage = { type: "hello"; role: BeaconSocketRole; peerId: string; peerType?: string; }; export type BeaconHelloAckMessage = { type: "hello-ack"; peerId: string; }; export type BeaconBroadcastMessage = { type: "broadcast"; channel: string; broadcastParams: Record>; body: ReturnType; originPeerId?: string; }; export type BeaconSocketMessage = BeaconHelloMessage | BeaconHelloAckMessage | BeaconBroadcastMessage; /** * Wire-message typedefs for the Beacon broadcast bus. * * Beacon is Velocious's cross-process pub/sub bus. The daemon * (`velocious beacon`) accepts JsonSocket connections from any number * of peer processes (HTTP server, background-jobs main, background-jobs * worker, etc.) and fans every `broadcast` message out to every * connected peer — including the sender, so each process can deliver * to its local websocket subscribers via a single code path. */ /** * @typedef {"client"} BeaconSocketRole * * Beacon currently only has one role. The role field is kept on the * `hello` handshake so future roles (e.g. an admin/inspector role) can * be added without bumping the wire format. */ /** * @typedef {{type: "hello", role: BeaconSocketRole, peerId: string, peerType?: string}} BeaconHelloMessage * * `peerId` uniquely identifies the connecting process for echo * suppression and logging. `peerType` is an optional human-readable * label such as `"server"`, `"background-jobs-worker"` — informational * only. */ /** * @typedef {{type: "hello-ack", peerId: string}} BeaconHelloAckMessage * * Sent by the daemon after it has registered the peer. Clients can use * this as a deterministic readiness boundary before publishing events * that must not fall back to local-only delivery. */ /** * @typedef {{type: "broadcast", channel: string, broadcastParams: Record>, body: ReturnType, originPeerId?: string}} BeaconBroadcastMessage * * `channel`, `broadcastParams`, and `body` mirror the * `configuration.broadcastToChannel(channel, broadcastParams, body)` * arguments. `originPeerId` is stamped by the publishing client and * preserved through the daemon so receivers can choose to skip echoes * of their own broadcasts (the default Configuration integration does * not skip — synapse-style fan-out always returns to sender so every * peer follows the same delivery path). */ /** * @typedef {BeaconHelloMessage | BeaconHelloAckMessage | BeaconBroadcastMessage} BeaconSocketMessage */ export declare const nothing: {}; //# sourceMappingURL=types.d.ts.map