@unagents/messenger-protocol 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -81,6 +81,12 @@ declare const PROTOCOL_NAME_PATTERN: RegExp;
81
81
  */
82
82
  declare const PROTOCOL_ERROR_CODES: readonly ["REPO_UNREACHABLE", "UNSUPPORTED_REPO", "VERSION_NOT_FOUND", "INVALID_DEFINITION", "VERSION_MISMATCH", "TOO_LARGE", "HASH_MISMATCH", "PROTOCOL_CONFLICT", "LIMIT", "PROTOCOL_NOT_FOUND", "BROKER_UNSUPPORTED", "INVALID_META"];
83
83
  type ProtocolErrorCode = (typeof PROTOCOL_ERROR_CODES)[number];
84
+ /** Discovery send targets (`host:port`, comma separated). When set, probes / announces go there instead of broadcast. */
85
+ declare const DISCOVERY_TARGETS_ENV = "AGENT_MESSENGER_DISCOVERY_TARGETS";
86
+ /** Client state file with the saved broker (default `~/.agent-messenger/client.json`). */
87
+ declare const CLIENT_STATE_ENV = "AGENT_MESSENGER_CLIENT_STATE";
88
+ /** Mesh announce interval in ms (default 10000). */
89
+ declare const MESH_ANNOUNCE_ENV = "AGENT_MESSENGER_MESH_ANNOUNCE_MS";
84
90
 
85
91
  /**
86
92
  * Broker HTTP API — request / response JSON shapes.
@@ -210,6 +216,8 @@ interface HealthResponse {
210
216
  peers: number;
211
217
  /** Present (`true`) only when the broker was started as a local fallback (`AGENT_MESSENGER_FALLBACK=1`). */
212
218
  fallback?: true;
219
+ /** Present (`true`) only when the broker takes part in the mesh (0.11.0). */
220
+ mesh?: true;
213
221
  }
214
222
  interface RegisterRequest {
215
223
  pid: number;
@@ -497,9 +505,13 @@ declare const DISCOVERY_KEY: "agent-messenger";
497
505
  declare const DISCOVERY_PROBE_VALUE: "probe";
498
506
  /** Value of `DISCOVERY_KEY` in a broker reply. */
499
507
  declare const DISCOVERY_REPLY_VALUE: "broker";
508
+ /** Value of `DISCOVERY_KEY` in a mesh broker's self-announcement (0.11.0). */
509
+ declare const DISCOVERY_ANNOUNCE_VALUE: "announce";
500
510
  /** Client → broadcast: `{"agent-messenger":"probe"}` */
501
511
  interface DiscoveryProbe {
502
512
  [DISCOVERY_KEY]: typeof DISCOVERY_PROBE_VALUE;
513
+ /** Mesh brokers add a 16 byte random hex nonce; the reply's `mac` is bound to it. Clients send none. */
514
+ n?: string;
503
515
  }
504
516
  /** Broker → client: `{"agent-messenger":"broker","id":..,"port":..,"version":..}` */
505
517
  interface DiscoveryReply {
@@ -512,7 +524,25 @@ interface DiscoveryReply {
512
524
  version: string;
513
525
  /** Present (`true`) only when the broker is a local fallback; clients prefer other brokers, fallbacks never relay to each other. */
514
526
  fallback?: true;
515
- }
527
+ /** Present (`true`) only when the broker takes part in the mesh (`AGENT_MESSENGER_MESH=on`). */
528
+ mesh?: true;
529
+ /** Mesh broker only, and only when the probe carried `n`: `meshMac(token, n, id, port)`. */
530
+ mac?: string;
531
+ }
532
+ /** Mesh broker → broadcast, every `AGENT_MESSENGER_MESH_ANNOUNCE_MS`: `{"agent-messenger":"announce",id,port,version,mesh:true,ts,mac}` */
533
+ interface DiscoveryAnnounce {
534
+ [DISCOVERY_KEY]: typeof DISCOVERY_ANNOUNCE_VALUE;
535
+ id: string;
536
+ port: number;
537
+ version: string;
538
+ mesh: true;
539
+ /** Send time (ms since epoch); also the MAC nonce (decimal string). Receivers accept `|now - ts| <= MESH_ANNOUNCE_MAX_SKEW_MS`. */
540
+ ts: number;
541
+ /** `meshMac(token, String(ts), id, port)` */
542
+ mac: string;
543
+ }
544
+ /** Announces older (or newer) than this are ignored. */
545
+ declare const MESH_ANNOUNCE_MAX_SKEW_MS = 60000;
516
546
  /** The exact probe object sent by the client. */
517
547
  declare const DISCOVERY_PROBE: DiscoveryProbe;
518
548
  /** Default probe target when `AGENT_MESSENGER_DISCOVERY_ADDR` is unset (plus per-interface directed broadcast). */
@@ -557,5 +587,14 @@ type SessionSocketLine = SessionAuthLine | SessionUserLine;
557
587
  */
558
588
  declare function canonicalJSON(value: unknown): string;
559
589
 
560
- export { BROKER_POST_ROUTES, DEFAULT_BIND, DEFAULT_DISCOVERY_PORT, DEFAULT_DISCOVERY_TIMEOUT_MS, DEFAULT_HTTP_PORT, DISCOVERY_BROADCAST_ADDR, DISCOVERY_KEY, DISCOVERY_PROBE, DISCOVERY_PROBE_VALUE, DISCOVERY_REPLY_VALUE, ENV, HEALTH_ROUTE, HEARTBEAT_INTERVAL_MS, HEARTBEAT_TIMEOUT_MS, LOCAL_HOSTS, MESH_SYNC_ROUTE, POLL_INTERVAL_MS, PROTOCOL_DOC_MAX_BYTES, PROTOCOL_ERROR_CODES, PROTOCOL_MANIFEST_MAX_BYTES, PROTOCOL_MAX_STORED, PROTOCOL_META_MAX_LENGTH, PROTOCOL_NAME_PATTERN, PROTOCOL_ROUTES, PROTOCOL_TOTAL_MAX_BYTES, RELAY_ROUTE, SESSION_SOCKET_ENV, SESSION_TOKEN_ENV, canonicalJSON };
561
- export type { AcknowledgeMessagesRequest, AcknowledgeMessagesResponse, BrokerErrorResponse, BrokerPostRoute, BrokerRequest, BrokerResponse, BrokerRouteMap, DiscoveryProbe, DiscoveryReply, EnvName, GetBufferedMessagesRequest, GetBufferedMessagesResponse, GetProtocolRequest, GetProtocolResponse, HealthResponse, HeartbeatRequest, HeartbeatResponse, ListPeersRequest, ListPeersResponse, MeshSyncRequest, MeshSyncResponse, Message, MessageMeta, MessageMode, OkResult, Peer, PeerScope, PollMessagesRequest, PollMessagesResponse, ProtocolDecl, ProtocolDefinition, ProtocolErrorCode, ProtocolErrorResponse, ProtocolRoute, ProtocolRouteMap, RegisterRequest, RegisterResponse, RelayMessagesRequest, RelayMessagesResponse, RelayedMessage, SendMessageRequest, SendMessageResponse, SessionAuthLine, SessionSocketLine, SessionUserLine, SetNameRequest, SetNameResponse, SetProtocolRequest, SetProtocolResponse, SetSummaryRequest, SetSummaryResponse, StoredProtocol, UnregisterRequest, UnregisterResponse, UnsetProtocolRequest, UnsetProtocolResponse };
590
+ /**
591
+ * Mesh membership proof (0.11.0): `hex(HMAC-SHA256(key = token, "am-mesh/1|" + nonce + "|" + id + "|" + port))`
592
+ * cut to 32 hex characters (128 bit). The token itself never goes on the wire. `nonce` is the probe's `n`
593
+ * (reply) or the announce `ts` as a decimal string (announce).
594
+ */
595
+ declare function meshMac(token: string, nonce: string, id: string, port: number): string;
596
+ /** Constant-time check of a received `mac` against the one computed with our token. */
597
+ declare function meshMacEqual(expected: string, received: unknown): boolean;
598
+
599
+ export { BROKER_POST_ROUTES, CLIENT_STATE_ENV, DEFAULT_BIND, DEFAULT_DISCOVERY_PORT, DEFAULT_DISCOVERY_TIMEOUT_MS, DEFAULT_HTTP_PORT, DISCOVERY_ANNOUNCE_VALUE, DISCOVERY_BROADCAST_ADDR, DISCOVERY_KEY, DISCOVERY_PROBE, DISCOVERY_PROBE_VALUE, DISCOVERY_REPLY_VALUE, DISCOVERY_TARGETS_ENV, ENV, HEALTH_ROUTE, HEARTBEAT_INTERVAL_MS, HEARTBEAT_TIMEOUT_MS, LOCAL_HOSTS, MESH_ANNOUNCE_ENV, MESH_ANNOUNCE_MAX_SKEW_MS, MESH_SYNC_ROUTE, POLL_INTERVAL_MS, PROTOCOL_DOC_MAX_BYTES, PROTOCOL_ERROR_CODES, PROTOCOL_MANIFEST_MAX_BYTES, PROTOCOL_MAX_STORED, PROTOCOL_META_MAX_LENGTH, PROTOCOL_NAME_PATTERN, PROTOCOL_ROUTES, PROTOCOL_TOTAL_MAX_BYTES, RELAY_ROUTE, SESSION_SOCKET_ENV, SESSION_TOKEN_ENV, canonicalJSON, meshMac, meshMacEqual };
600
+ export type { AcknowledgeMessagesRequest, AcknowledgeMessagesResponse, BrokerErrorResponse, BrokerPostRoute, BrokerRequest, BrokerResponse, BrokerRouteMap, DiscoveryAnnounce, DiscoveryProbe, DiscoveryReply, EnvName, GetBufferedMessagesRequest, GetBufferedMessagesResponse, GetProtocolRequest, GetProtocolResponse, HealthResponse, HeartbeatRequest, HeartbeatResponse, ListPeersRequest, ListPeersResponse, MeshSyncRequest, MeshSyncResponse, Message, MessageMeta, MessageMode, OkResult, Peer, PeerScope, PollMessagesRequest, PollMessagesResponse, ProtocolDecl, ProtocolDefinition, ProtocolErrorCode, ProtocolErrorResponse, ProtocolRoute, ProtocolRouteMap, RegisterRequest, RegisterResponse, RelayMessagesRequest, RelayMessagesResponse, RelayedMessage, SendMessageRequest, SendMessageResponse, SessionAuthLine, SessionSocketLine, SessionUserLine, SetNameRequest, SetNameResponse, SetProtocolRequest, SetProtocolResponse, SetSummaryRequest, SetSummaryResponse, StoredProtocol, UnregisterRequest, UnregisterResponse, UnsetProtocolRequest, UnsetProtocolResponse };
package/dist/index.d.ts CHANGED
@@ -81,6 +81,12 @@ declare const PROTOCOL_NAME_PATTERN: RegExp;
81
81
  */
82
82
  declare const PROTOCOL_ERROR_CODES: readonly ["REPO_UNREACHABLE", "UNSUPPORTED_REPO", "VERSION_NOT_FOUND", "INVALID_DEFINITION", "VERSION_MISMATCH", "TOO_LARGE", "HASH_MISMATCH", "PROTOCOL_CONFLICT", "LIMIT", "PROTOCOL_NOT_FOUND", "BROKER_UNSUPPORTED", "INVALID_META"];
83
83
  type ProtocolErrorCode = (typeof PROTOCOL_ERROR_CODES)[number];
84
+ /** Discovery send targets (`host:port`, comma separated). When set, probes / announces go there instead of broadcast. */
85
+ declare const DISCOVERY_TARGETS_ENV = "AGENT_MESSENGER_DISCOVERY_TARGETS";
86
+ /** Client state file with the saved broker (default `~/.agent-messenger/client.json`). */
87
+ declare const CLIENT_STATE_ENV = "AGENT_MESSENGER_CLIENT_STATE";
88
+ /** Mesh announce interval in ms (default 10000). */
89
+ declare const MESH_ANNOUNCE_ENV = "AGENT_MESSENGER_MESH_ANNOUNCE_MS";
84
90
 
85
91
  /**
86
92
  * Broker HTTP API — request / response JSON shapes.
@@ -210,6 +216,8 @@ interface HealthResponse {
210
216
  peers: number;
211
217
  /** Present (`true`) only when the broker was started as a local fallback (`AGENT_MESSENGER_FALLBACK=1`). */
212
218
  fallback?: true;
219
+ /** Present (`true`) only when the broker takes part in the mesh (0.11.0). */
220
+ mesh?: true;
213
221
  }
214
222
  interface RegisterRequest {
215
223
  pid: number;
@@ -497,9 +505,13 @@ declare const DISCOVERY_KEY: "agent-messenger";
497
505
  declare const DISCOVERY_PROBE_VALUE: "probe";
498
506
  /** Value of `DISCOVERY_KEY` in a broker reply. */
499
507
  declare const DISCOVERY_REPLY_VALUE: "broker";
508
+ /** Value of `DISCOVERY_KEY` in a mesh broker's self-announcement (0.11.0). */
509
+ declare const DISCOVERY_ANNOUNCE_VALUE: "announce";
500
510
  /** Client → broadcast: `{"agent-messenger":"probe"}` */
501
511
  interface DiscoveryProbe {
502
512
  [DISCOVERY_KEY]: typeof DISCOVERY_PROBE_VALUE;
513
+ /** Mesh brokers add a 16 byte random hex nonce; the reply's `mac` is bound to it. Clients send none. */
514
+ n?: string;
503
515
  }
504
516
  /** Broker → client: `{"agent-messenger":"broker","id":..,"port":..,"version":..}` */
505
517
  interface DiscoveryReply {
@@ -512,7 +524,25 @@ interface DiscoveryReply {
512
524
  version: string;
513
525
  /** Present (`true`) only when the broker is a local fallback; clients prefer other brokers, fallbacks never relay to each other. */
514
526
  fallback?: true;
515
- }
527
+ /** Present (`true`) only when the broker takes part in the mesh (`AGENT_MESSENGER_MESH=on`). */
528
+ mesh?: true;
529
+ /** Mesh broker only, and only when the probe carried `n`: `meshMac(token, n, id, port)`. */
530
+ mac?: string;
531
+ }
532
+ /** Mesh broker → broadcast, every `AGENT_MESSENGER_MESH_ANNOUNCE_MS`: `{"agent-messenger":"announce",id,port,version,mesh:true,ts,mac}` */
533
+ interface DiscoveryAnnounce {
534
+ [DISCOVERY_KEY]: typeof DISCOVERY_ANNOUNCE_VALUE;
535
+ id: string;
536
+ port: number;
537
+ version: string;
538
+ mesh: true;
539
+ /** Send time (ms since epoch); also the MAC nonce (decimal string). Receivers accept `|now - ts| <= MESH_ANNOUNCE_MAX_SKEW_MS`. */
540
+ ts: number;
541
+ /** `meshMac(token, String(ts), id, port)` */
542
+ mac: string;
543
+ }
544
+ /** Announces older (or newer) than this are ignored. */
545
+ declare const MESH_ANNOUNCE_MAX_SKEW_MS = 60000;
516
546
  /** The exact probe object sent by the client. */
517
547
  declare const DISCOVERY_PROBE: DiscoveryProbe;
518
548
  /** Default probe target when `AGENT_MESSENGER_DISCOVERY_ADDR` is unset (plus per-interface directed broadcast). */
@@ -557,5 +587,14 @@ type SessionSocketLine = SessionAuthLine | SessionUserLine;
557
587
  */
558
588
  declare function canonicalJSON(value: unknown): string;
559
589
 
560
- export { BROKER_POST_ROUTES, DEFAULT_BIND, DEFAULT_DISCOVERY_PORT, DEFAULT_DISCOVERY_TIMEOUT_MS, DEFAULT_HTTP_PORT, DISCOVERY_BROADCAST_ADDR, DISCOVERY_KEY, DISCOVERY_PROBE, DISCOVERY_PROBE_VALUE, DISCOVERY_REPLY_VALUE, ENV, HEALTH_ROUTE, HEARTBEAT_INTERVAL_MS, HEARTBEAT_TIMEOUT_MS, LOCAL_HOSTS, MESH_SYNC_ROUTE, POLL_INTERVAL_MS, PROTOCOL_DOC_MAX_BYTES, PROTOCOL_ERROR_CODES, PROTOCOL_MANIFEST_MAX_BYTES, PROTOCOL_MAX_STORED, PROTOCOL_META_MAX_LENGTH, PROTOCOL_NAME_PATTERN, PROTOCOL_ROUTES, PROTOCOL_TOTAL_MAX_BYTES, RELAY_ROUTE, SESSION_SOCKET_ENV, SESSION_TOKEN_ENV, canonicalJSON };
561
- export type { AcknowledgeMessagesRequest, AcknowledgeMessagesResponse, BrokerErrorResponse, BrokerPostRoute, BrokerRequest, BrokerResponse, BrokerRouteMap, DiscoveryProbe, DiscoveryReply, EnvName, GetBufferedMessagesRequest, GetBufferedMessagesResponse, GetProtocolRequest, GetProtocolResponse, HealthResponse, HeartbeatRequest, HeartbeatResponse, ListPeersRequest, ListPeersResponse, MeshSyncRequest, MeshSyncResponse, Message, MessageMeta, MessageMode, OkResult, Peer, PeerScope, PollMessagesRequest, PollMessagesResponse, ProtocolDecl, ProtocolDefinition, ProtocolErrorCode, ProtocolErrorResponse, ProtocolRoute, ProtocolRouteMap, RegisterRequest, RegisterResponse, RelayMessagesRequest, RelayMessagesResponse, RelayedMessage, SendMessageRequest, SendMessageResponse, SessionAuthLine, SessionSocketLine, SessionUserLine, SetNameRequest, SetNameResponse, SetProtocolRequest, SetProtocolResponse, SetSummaryRequest, SetSummaryResponse, StoredProtocol, UnregisterRequest, UnregisterResponse, UnsetProtocolRequest, UnsetProtocolResponse };
590
+ /**
591
+ * Mesh membership proof (0.11.0): `hex(HMAC-SHA256(key = token, "am-mesh/1|" + nonce + "|" + id + "|" + port))`
592
+ * cut to 32 hex characters (128 bit). The token itself never goes on the wire. `nonce` is the probe's `n`
593
+ * (reply) or the announce `ts` as a decimal string (announce).
594
+ */
595
+ declare function meshMac(token: string, nonce: string, id: string, port: number): string;
596
+ /** Constant-time check of a received `mac` against the one computed with our token. */
597
+ declare function meshMacEqual(expected: string, received: unknown): boolean;
598
+
599
+ export { BROKER_POST_ROUTES, CLIENT_STATE_ENV, DEFAULT_BIND, DEFAULT_DISCOVERY_PORT, DEFAULT_DISCOVERY_TIMEOUT_MS, DEFAULT_HTTP_PORT, DISCOVERY_ANNOUNCE_VALUE, DISCOVERY_BROADCAST_ADDR, DISCOVERY_KEY, DISCOVERY_PROBE, DISCOVERY_PROBE_VALUE, DISCOVERY_REPLY_VALUE, DISCOVERY_TARGETS_ENV, ENV, HEALTH_ROUTE, HEARTBEAT_INTERVAL_MS, HEARTBEAT_TIMEOUT_MS, LOCAL_HOSTS, MESH_ANNOUNCE_ENV, MESH_ANNOUNCE_MAX_SKEW_MS, MESH_SYNC_ROUTE, POLL_INTERVAL_MS, PROTOCOL_DOC_MAX_BYTES, PROTOCOL_ERROR_CODES, PROTOCOL_MANIFEST_MAX_BYTES, PROTOCOL_MAX_STORED, PROTOCOL_META_MAX_LENGTH, PROTOCOL_NAME_PATTERN, PROTOCOL_ROUTES, PROTOCOL_TOTAL_MAX_BYTES, RELAY_ROUTE, SESSION_SOCKET_ENV, SESSION_TOKEN_ENV, canonicalJSON, meshMac, meshMacEqual };
600
+ export type { AcknowledgeMessagesRequest, AcknowledgeMessagesResponse, BrokerErrorResponse, BrokerPostRoute, BrokerRequest, BrokerResponse, BrokerRouteMap, DiscoveryAnnounce, DiscoveryProbe, DiscoveryReply, EnvName, GetBufferedMessagesRequest, GetBufferedMessagesResponse, GetProtocolRequest, GetProtocolResponse, HealthResponse, HeartbeatRequest, HeartbeatResponse, ListPeersRequest, ListPeersResponse, MeshSyncRequest, MeshSyncResponse, Message, MessageMeta, MessageMode, OkResult, Peer, PeerScope, PollMessagesRequest, PollMessagesResponse, ProtocolDecl, ProtocolDefinition, ProtocolErrorCode, ProtocolErrorResponse, ProtocolRoute, ProtocolRouteMap, RegisterRequest, RegisterResponse, RelayMessagesRequest, RelayMessagesResponse, RelayedMessage, SendMessageRequest, SendMessageResponse, SessionAuthLine, SessionSocketLine, SessionUserLine, SetNameRequest, SetNameResponse, SetProtocolRequest, SetProtocolResponse, SetSummaryRequest, SetSummaryResponse, StoredProtocol, UnregisterRequest, UnregisterResponse, UnsetProtocolRequest, UnsetProtocolResponse };
package/dist/index.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import { createHmac, timingSafeEqual } from 'node:crypto';
2
+
1
3
  const DEFAULT_HTTP_PORT = 7901;
2
4
  const DEFAULT_BIND = "0.0.0.0";
3
5
  const DEFAULT_DISCOVERY_PORT = 7902;
@@ -57,6 +59,9 @@ const PROTOCOL_ERROR_CODES = [
57
59
  "BROKER_UNSUPPORTED",
58
60
  "INVALID_META"
59
61
  ];
62
+ const DISCOVERY_TARGETS_ENV = "AGENT_MESSENGER_DISCOVERY_TARGETS";
63
+ const CLIENT_STATE_ENV = "AGENT_MESSENGER_CLIENT_STATE";
64
+ const MESH_ANNOUNCE_ENV = "AGENT_MESSENGER_MESH_ANNOUNCE_MS";
60
65
 
61
66
  const RELAY_ROUTE = "/relay-messages";
62
67
  const HEALTH_ROUTE = "/health";
@@ -77,6 +82,8 @@ const MESH_SYNC_ROUTE = "/mesh/sync";
77
82
  const DISCOVERY_KEY = "agent-messenger";
78
83
  const DISCOVERY_PROBE_VALUE = "probe";
79
84
  const DISCOVERY_REPLY_VALUE = "broker";
85
+ const DISCOVERY_ANNOUNCE_VALUE = "announce";
86
+ const MESH_ANNOUNCE_MAX_SKEW_MS = 6e4;
80
87
  const DISCOVERY_PROBE = { [DISCOVERY_KEY]: DISCOVERY_PROBE_VALUE };
81
88
  const DISCOVERY_BROADCAST_ADDR = "255.255.255.255";
82
89
 
@@ -100,4 +107,14 @@ function canonicalJSON(value) {
100
107
  return `{${parts.join(",")}}`;
101
108
  }
102
109
 
103
- export { BROKER_POST_ROUTES, DEFAULT_BIND, DEFAULT_DISCOVERY_PORT, DEFAULT_DISCOVERY_TIMEOUT_MS, DEFAULT_HTTP_PORT, DISCOVERY_BROADCAST_ADDR, DISCOVERY_KEY, DISCOVERY_PROBE, DISCOVERY_PROBE_VALUE, DISCOVERY_REPLY_VALUE, ENV, HEALTH_ROUTE, HEARTBEAT_INTERVAL_MS, HEARTBEAT_TIMEOUT_MS, LOCAL_HOSTS, MESH_SYNC_ROUTE, POLL_INTERVAL_MS, PROTOCOL_DOC_MAX_BYTES, PROTOCOL_ERROR_CODES, PROTOCOL_MANIFEST_MAX_BYTES, PROTOCOL_MAX_STORED, PROTOCOL_META_MAX_LENGTH, PROTOCOL_NAME_PATTERN, PROTOCOL_ROUTES, PROTOCOL_TOTAL_MAX_BYTES, RELAY_ROUTE, SESSION_SOCKET_ENV, SESSION_TOKEN_ENV, canonicalJSON };
110
+ function meshMac(token, nonce, id, port) {
111
+ return createHmac("sha256", token).update(`am-mesh/1|${nonce}|${id}|${port}`).digest("hex").slice(0, 32);
112
+ }
113
+ function meshMacEqual(expected, received) {
114
+ if (typeof received !== "string") return false;
115
+ const a = Buffer.from(expected);
116
+ const b = Buffer.from(received);
117
+ return a.length === b.length && timingSafeEqual(a, b);
118
+ }
119
+
120
+ export { BROKER_POST_ROUTES, CLIENT_STATE_ENV, DEFAULT_BIND, DEFAULT_DISCOVERY_PORT, DEFAULT_DISCOVERY_TIMEOUT_MS, DEFAULT_HTTP_PORT, DISCOVERY_ANNOUNCE_VALUE, DISCOVERY_BROADCAST_ADDR, DISCOVERY_KEY, DISCOVERY_PROBE, DISCOVERY_PROBE_VALUE, DISCOVERY_REPLY_VALUE, DISCOVERY_TARGETS_ENV, ENV, HEALTH_ROUTE, HEARTBEAT_INTERVAL_MS, HEARTBEAT_TIMEOUT_MS, LOCAL_HOSTS, MESH_ANNOUNCE_ENV, MESH_ANNOUNCE_MAX_SKEW_MS, MESH_SYNC_ROUTE, POLL_INTERVAL_MS, PROTOCOL_DOC_MAX_BYTES, PROTOCOL_ERROR_CODES, PROTOCOL_MANIFEST_MAX_BYTES, PROTOCOL_MAX_STORED, PROTOCOL_META_MAX_LENGTH, PROTOCOL_NAME_PATTERN, PROTOCOL_ROUTES, PROTOCOL_TOTAL_MAX_BYTES, RELAY_ROUTE, SESSION_SOCKET_ENV, SESSION_TOKEN_ENV, canonicalJSON, meshMac, meshMacEqual };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unagents/messenger-protocol",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "agent-messenger protocol: types and constants shared by broker, client and CLI. No runtime logic.",
5
5
  "type": "module",
6
6
  "license": "MIT",