agent-comms 3.9.0 → 3.10.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.
Files changed (123) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +1 -1
  4. package/dist/core/agent-registry.d.ts +3 -0
  5. package/dist/core/agent-registry.d.ts.map +1 -1
  6. package/dist/core/agent-registry.js +25 -14
  7. package/dist/core/agent-registry.js.map +1 -1
  8. package/dist/core/bind-retry.d.ts +10 -0
  9. package/dist/core/bind-retry.d.ts.map +1 -0
  10. package/dist/core/bind-retry.js +24 -0
  11. package/dist/core/bind-retry.js.map +1 -0
  12. package/dist/core/bridge-mesh.d.ts.map +1 -1
  13. package/dist/core/bridge-mesh.js +6 -0
  14. package/dist/core/bridge-mesh.js.map +1 -1
  15. package/dist/core/dm-token-verification.d.ts +28 -0
  16. package/dist/core/dm-token-verification.d.ts.map +1 -0
  17. package/dist/core/dm-token-verification.js +38 -0
  18. package/dist/core/dm-token-verification.js.map +1 -0
  19. package/dist/core/gossip-directory.d.ts +4 -1
  20. package/dist/core/gossip-directory.d.ts.map +1 -1
  21. package/dist/core/gossip-directory.js +11 -1
  22. package/dist/core/gossip-directory.js.map +1 -1
  23. package/dist/core/hub-forwarding.d.ts +13 -0
  24. package/dist/core/hub-forwarding.d.ts.map +1 -0
  25. package/dist/core/hub-forwarding.js +30 -0
  26. package/dist/core/hub-forwarding.js.map +1 -0
  27. package/dist/core/hub-session.d.ts +14 -4
  28. package/dist/core/hub-session.d.ts.map +1 -1
  29. package/dist/core/hub-session.js +44 -12
  30. package/dist/core/hub-session.js.map +1 -1
  31. package/dist/core/mesh-store-shared.d.ts +5 -1
  32. package/dist/core/mesh-store-shared.d.ts.map +1 -1
  33. package/dist/core/mesh-store-shared.js +7 -0
  34. package/dist/core/mesh-store-shared.js.map +1 -1
  35. package/dist/core/mesh-store.d.ts +7 -2
  36. package/dist/core/mesh-store.d.ts.map +1 -1
  37. package/dist/core/mesh-store.js +15 -4
  38. package/dist/core/mesh-store.js.map +1 -1
  39. package/dist/core/peer-lifecycle.d.ts +2 -0
  40. package/dist/core/peer-lifecycle.d.ts.map +1 -1
  41. package/dist/core/peer-lifecycle.js +17 -0
  42. package/dist/core/peer-lifecycle.js.map +1 -1
  43. package/dist/core/room-lifecycle.d.ts +12 -1
  44. package/dist/core/room-lifecycle.d.ts.map +1 -1
  45. package/dist/core/room-lifecycle.js +47 -3
  46. package/dist/core/room-lifecycle.js.map +1 -1
  47. package/dist/core/room-messaging.d.ts +2 -2
  48. package/dist/core/room-messaging.d.ts.map +1 -1
  49. package/dist/core/room-messaging.js +1 -1
  50. package/dist/core/room-messaging.js.map +1 -1
  51. package/dist/core/room-protocol.d.ts +1 -1
  52. package/dist/core/room-protocol.d.ts.map +1 -1
  53. package/dist/core/room-protocol.js +17 -1
  54. package/dist/core/room-protocol.js.map +1 -1
  55. package/dist/core/user-identity.d.ts +10 -0
  56. package/dist/core/user-identity.d.ts.map +1 -1
  57. package/dist/core/user-identity.js +47 -9
  58. package/dist/core/user-identity.js.map +1 -1
  59. package/dist/core/wire-mesh-transport.d.ts +5 -3
  60. package/dist/core/wire-mesh-transport.d.ts.map +1 -1
  61. package/dist/core/wire-mesh-transport.js +25 -24
  62. package/dist/core/wire-mesh-transport.js.map +1 -1
  63. package/dist/test/agent-registry.test.js +56 -0
  64. package/dist/test/agent-registry.test.js.map +1 -1
  65. package/dist/test/bind-retry.test.d.ts +2 -0
  66. package/dist/test/bind-retry.test.d.ts.map +1 -0
  67. package/dist/test/bind-retry.test.js +42 -0
  68. package/dist/test/bind-retry.test.js.map +1 -0
  69. package/dist/test/delivery-engine-delivery.test.js +2 -0
  70. package/dist/test/delivery-engine-delivery.test.js.map +1 -1
  71. package/dist/test/delivery-engine-directed-notify.test.js +2 -0
  72. package/dist/test/delivery-engine-directed-notify.test.js.map +1 -1
  73. package/dist/test/delivery-engine.test.js +2 -0
  74. package/dist/test/delivery-engine.test.js.map +1 -1
  75. package/dist/test/dm-send-capability-admission.integration.test.d.ts +5 -0
  76. package/dist/test/dm-send-capability-admission.integration.test.d.ts.map +1 -0
  77. package/dist/test/dm-send-capability-admission.integration.test.js +90 -0
  78. package/dist/test/dm-send-capability-admission.integration.test.js.map +1 -0
  79. package/dist/test/dm-token-verification.test.d.ts +5 -0
  80. package/dist/test/dm-token-verification.test.d.ts.map +1 -0
  81. package/dist/test/dm-token-verification.test.js +164 -0
  82. package/dist/test/dm-token-verification.test.js.map +1 -0
  83. package/dist/test/gateway-forwarding.integration.test.d.ts +7 -0
  84. package/dist/test/gateway-forwarding.integration.test.d.ts.map +1 -0
  85. package/dist/test/gateway-forwarding.integration.test.js +185 -0
  86. package/dist/test/gateway-forwarding.integration.test.js.map +1 -0
  87. package/dist/test/identity-restart.integration.test.js +6 -0
  88. package/dist/test/identity-restart.integration.test.js.map +1 -1
  89. package/dist/test/mesh-e2e.integration.test.js +7 -1
  90. package/dist/test/mesh-e2e.integration.test.js.map +1 -1
  91. package/dist/test/mesh-smoke.runner.js +4 -1
  92. package/dist/test/mesh-smoke.runner.js.map +1 -1
  93. package/dist/test/mesh-store-orchestration.test.js +46 -2
  94. package/dist/test/mesh-store-orchestration.test.js.map +1 -1
  95. package/dist/test/peer-lifecycle.test.js +49 -2
  96. package/dist/test/peer-lifecycle.test.js.map +1 -1
  97. package/dist/test/room-join-admission.test.js +6 -0
  98. package/dist/test/room-join-admission.test.js.map +1 -1
  99. package/dist/test/room-lifecycle-membership.test.js +2 -0
  100. package/dist/test/room-lifecycle-membership.test.js.map +1 -1
  101. package/dist/test/room-lifecycle-remote.test.js +2 -0
  102. package/dist/test/room-lifecycle-remote.test.js.map +1 -1
  103. package/dist/test/room-lifecycle.test.js +2 -0
  104. package/dist/test/room-lifecycle.test.js.map +1 -1
  105. package/dist/test/room-messaging-durable-send.test.js +3 -1
  106. package/dist/test/room-messaging-durable-send.test.js.map +1 -1
  107. package/dist/test/room-messaging.test.js +25 -6
  108. package/dist/test/room-messaging.test.js.map +1 -1
  109. package/dist/test/room-protocol-admission.test.js +2 -0
  110. package/dist/test/room-protocol-admission.test.js.map +1 -1
  111. package/dist/test/room-protocol-notify.test.js +2 -0
  112. package/dist/test/room-protocol-notify.test.js.map +1 -1
  113. package/dist/test/room-protocol.test.js +2 -0
  114. package/dist/test/room-protocol.test.js.map +1 -1
  115. package/dist/test/room-send-retry.integration.test.js +6 -0
  116. package/dist/test/room-send-retry.integration.test.js.map +1 -1
  117. package/dist/test/test-transport.d.ts +1 -1
  118. package/dist/test/test-transport.d.ts.map +1 -1
  119. package/dist/test/test-transport.js +10 -2
  120. package/dist/test/test-transport.js.map +1 -1
  121. package/dist/test/user-identity.test.js +62 -1
  122. package/dist/test/user-identity.test.js.map +1 -1
  123. package/package.json +1 -1
@@ -15,7 +15,7 @@
15
15
  "url": "https://github.com/ExaDev/agent-comms.git"
16
16
  },
17
17
  "description": "Cross-harness LLM agent communication mesh — rooms, DMs, and presence",
18
- "version": "3.9.0"
18
+ "version": "3.10.0"
19
19
  }
20
20
  ]
21
21
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-comms",
3
3
  "description": "Cross-harness LLM agent communication mesh — rooms, DMs, and presence",
4
- "version": "3.9.0",
4
+ "version": "3.10.0",
5
5
  "author": {
6
6
  "name": "ExaDev"
7
7
  },
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![GitHub](https://img.shields.io/badge/GitHub-181717?logo=github&logoColor=white)](https://github.com/ExaDev/agent-comms)
4
4
  [![npm](https://img.shields.io/badge/npm-CB3837?logo=npm&logoColor=white)](https://www.npmjs.com/package/agent-comms)
5
- [![version](https://img.shields.io/badge/version-3.9.0-blue)](https://github.com/ExaDev/agent-comms/releases/tag/v3.9.0)
5
+ [![version](https://img.shields.io/badge/version-3.10.0-blue)](https://github.com/ExaDev/agent-comms/releases/tag/v3.10.0)
6
6
  [![CI](https://img.shields.io/github/actions/workflow/status/ExaDev/agent-comms/ci.yml?branch=main)](https://github.com/ExaDev/agent-comms/actions)
7
7
 
8
8
  Cross-harness communication mesh for LLM agents: rooms, DMs, presence, and visibility over TCP with zero filesystem dependencies.
@@ -30,9 +30,12 @@ export declare class AgentRegistry {
30
30
  visibility: Visibility;
31
31
  tags: string[];
32
32
  }): Promise<AgentIdentity>;
33
+ /** Resolves an agent by id, falling back to a gossip-discovered device (see listDiscoverableAgents' own doc) not otherwise locally known -- the same merge listAgents already applies to its returned array, but for a single lookup rather than the whole list. This is what lets a caller resolve a remote, hub-learned agent (agent-comms#155) that will never appear in deps.agents at all, since nothing replicates full agent records cross-machine the way a local peer's agent_upsert broadcast does. */
33
34
  getAgent(id: string): Promise<AgentIdentity | undefined>;
34
35
  updateAgent(id: string, patch: Partial<Pick<AgentIdentity, "name" | "visibility" | "status" | "tags" | "pid">>): Promise<AgentIdentity>;
35
36
  listAgents(requesterId: string): Promise<AgentIdentity[]>;
37
+ /** Builds the placeholder-shaped AgentIdentity a gossip-discovered device (never locally registered) is represented as -- shared by listAgents' own array merge and getAgent's single-lookup fallback, so both resolve an identical shape for the identical discovered device. */
38
+ private static synthesiseDiscoveredAgent;
36
39
  /**
37
40
  * Every agent this store has heard gossiped by another device but never registered or otherwise locally recorded -- the read half of P3.8's eventual agent register/update/offline retirement (agent-comms#48), mirroring listRooms' own room-discovery merge (#138). Never merged into this.deps.agents: a gossip hint is not the same as a real registration, and this store has nothing else authoritative to report for it. Only ever an agent that gossiped itself as "visible" (MeshStore's own selfAgentAdvert getter never advertises a hidden or ghost agent this way), so no ghost-filtering is needed here the way listAgents' own local-agent check needs.
38
41
  */
@@ -1 +1 @@
1
- {"version":3,"file":"agent-registry.d.ts","sourceRoot":"","sources":["../../src/core/agent-registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,M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AAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAStE,aAAa,CAAC,IAAI,EAAE;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,UAAU,EAAE,UAAU,CAAC;QACvB,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,GAAG,OAAO,CAAC,aAAa,CAAC;IAoC1B,ifAAif;IAC3e,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAYxD,WAAW,CACf,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,OAAO,CACZ,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC,CACvE,GACA,OAAO,CAAC,aAAa,CAAC;IA8BnB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAc/D,kRAAkR;IAClR,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAoBxC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAyBxB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAmBjD"}
@@ -75,9 +75,16 @@ export class AgentRegistry {
75
75
  });
76
76
  return agent;
77
77
  }
78
+ /** Resolves an agent by id, falling back to a gossip-discovered device (see listDiscoverableAgents' own doc) not otherwise locally known -- the same merge listAgents already applies to its returned array, but for a single lookup rather than the whole list. This is what lets a caller resolve a remote, hub-learned agent (agent-comms#155) that will never appear in deps.agents at all, since nothing replicates full agent records cross-machine the way a local peer's agent_upsert broadcast does. */
78
79
  async getAgent(id) {
79
80
  await Promise.resolve();
80
- return this.deps.agents.get(id);
81
+ const known = this.deps.agents.get(id);
82
+ if (known !== undefined)
83
+ return known;
84
+ const discovered = this.listDiscoverableAgents().find((candidate) => candidate.deviceId === id);
85
+ return discovered === undefined
86
+ ? undefined
87
+ : AgentRegistry.synthesiseDiscoveredAgent(discovered);
81
88
  }
82
89
  async updateAgent(id, patch) {
83
90
  const agent = this.deps.agents.get(id);
@@ -111,22 +118,26 @@ export class AgentRegistry {
111
118
  for (const discovered of this.listDiscoverableAgents()) {
112
119
  if (this.deps.agents.has(discovered.deviceId))
113
120
  continue;
114
- result.push({
115
- id: discovered.deviceId,
116
- version: 0,
117
- name: discovered.advert.name,
118
- harness: discovered.advert.harness,
119
- cwd: discovered.advert.cwd,
120
- pid: discovered.advert.pid,
121
- startedAt: discovered.advert.startedAt,
122
- visibility: "visible",
123
- status: discovered.status ?? "active",
124
- tags: discovered.advert.tags,
125
- subscribedRooms: discovered.advert.subscribedRooms,
126
- });
121
+ result.push(AgentRegistry.synthesiseDiscoveredAgent(discovered));
127
122
  }
128
123
  return result;
129
124
  }
125
+ /** Builds the placeholder-shaped AgentIdentity a gossip-discovered device (never locally registered) is represented as -- shared by listAgents' own array merge and getAgent's single-lookup fallback, so both resolve an identical shape for the identical discovered device. */
126
+ static synthesiseDiscoveredAgent(discovered) {
127
+ return {
128
+ id: discovered.deviceId,
129
+ version: 0,
130
+ name: discovered.advert.name,
131
+ harness: discovered.advert.harness,
132
+ cwd: discovered.advert.cwd,
133
+ pid: discovered.advert.pid,
134
+ startedAt: discovered.advert.startedAt,
135
+ visibility: "visible",
136
+ status: discovered.status ?? "active",
137
+ tags: discovered.advert.tags,
138
+ subscribedRooms: discovered.advert.subscribedRooms,
139
+ };
140
+ }
130
141
  /**
131
142
  * Every agent this store has heard gossiped by another device but never registered or otherwise locally recorded -- the read half of P3.8's eventual agent register/update/offline retirement (agent-comms#48), mirroring listRooms' own room-discovery merge (#138). Never merged into this.deps.agents: a gossip hint is not the same as a real registration, and this store has nothing else authoritative to report for it. Only ever an agent that gossiped itself as "visible" (MeshStore's own selfAgentAdvert getter never advertises a hidden or ghost agent this way), so no ghost-filtering is needed here the way listAgents' own local-agent check needs.
132
143
  */
@@ -1 +1 @@
1
- {"version":3,"file":"agent-registry.js","sourceRoot":"","sources":["../../src/core/agent-registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAmBzC,8YAA8Y;AAC9Y,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACvE,IAAI,CAAC,CAAC,SAAS,IAAI,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC7E,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACrE,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACrE,IAAI,CAAC,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ;QAChE,OAAO,KAAK,CAAC;IACf,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACnE,IAAI,CAAC,CAAC,iBAAiB,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC;QACxE,OA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,CAAC,CAAC,CAAC,SAAS;aACpD,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAU;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,OAAO;QAEvC,0HAA0H;QAC1H,MAAM,OAAO,GAAG,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QAC7C,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAEhC,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;YAClE,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC;gBAC5C,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,EAAE;aACZ,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * retryOnAddrInUse — bind-retry backoff for WireMeshTransport.becomeCoordinator (agent-comms#170). Split out of wire-mesh-transport.ts to keep that file under the repo's max-lines cap, matching the same split-out-a-collaborator convention peer-lifecycle.ts and friends already use.
3
+ */
4
+ /** Number of extra attempts becomeCoordinator makes after an initial EADDRINUSE before giving up. Covers PeerLifecycle's own graceful coordinator handover: the outgoing coordinator's listening socket may not have finished releasing the coordinator port yet when the successor's own become_coordinator handler tries to rebind it moments later. Retrying a plain server bind carries none of the risk documented elsewhere against retrying a TLS connectToCoordinator (a Node TLS session-cache bug that can freeze the event loop) -- this is ordinary bind-after-close backoff, the same class of transient conflict any two processes racing to acquire the same port would need to tolerate. */
5
+ export declare const BECOME_COORDINATOR_BIND_RETRIES = 5;
6
+ /** Delay between each becomeCoordinator bind retry -- five retries at this interval gives ~150ms of tolerance, comparable to the crash-race path's own documented "~100ms recovery". */
7
+ export declare const BECOME_COORDINATOR_BIND_RETRY_DELAY_MS = 30;
8
+ /** Retries `attempt` while it keeps rejecting with an EADDRINUSE-shaped error, up to `retries` further attempts, waiting `delayMs` between each. Any other error, or exhausting the retry budget, rethrows immediately -- never silently swallowed. A pure, transport-agnostic helper (no socket knowledge of its own) so becomeCoordinator's bind-retry race is fast and deterministic to test directly. */
9
+ export declare function retryOnAddrInUse<T>(attempt: () => Promise<T>, retries: number, delayMs: number): Promise<T>;
10
+ //# sourceMappingURL=bind-retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bind-retry.d.ts","sourceRoot":"","sources":["../../src/core/bind-retry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,4qBAA4qB;AAC5qB,eAAO,MAAM,+BAA+B,IAAI,CAAC;AACjD,wLAAwL;AACxL,eAAO,MAAM,sCAAsC,KAAK,CAAC;AAEzD,6YAA6Y;AAC7Y,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,CAAC,CAAC,CAYZ"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * retryOnAddrInUse — bind-retry backoff for WireMeshTransport.becomeCoordinator (agent-comms#170). Split out of wire-mesh-transport.ts to keep that file under the repo's max-lines cap, matching the same split-out-a-collaborator convention peer-lifecycle.ts and friends already use.
3
+ */
4
+ /** Number of extra attempts becomeCoordinator makes after an initial EADDRINUSE before giving up. Covers PeerLifecycle's own graceful coordinator handover: the outgoing coordinator's listening socket may not have finished releasing the coordinator port yet when the successor's own become_coordinator handler tries to rebind it moments later. Retrying a plain server bind carries none of the risk documented elsewhere against retrying a TLS connectToCoordinator (a Node TLS session-cache bug that can freeze the event loop) -- this is ordinary bind-after-close backoff, the same class of transient conflict any two processes racing to acquire the same port would need to tolerate. */
5
+ export const BECOME_COORDINATOR_BIND_RETRIES = 5;
6
+ /** Delay between each becomeCoordinator bind retry -- five retries at this interval gives ~150ms of tolerance, comparable to the crash-race path's own documented "~100ms recovery". */
7
+ export const BECOME_COORDINATOR_BIND_RETRY_DELAY_MS = 30;
8
+ /** Retries `attempt` while it keeps rejecting with an EADDRINUSE-shaped error, up to `retries` further attempts, waiting `delayMs` between each. Any other error, or exhausting the retry budget, rethrows immediately -- never silently swallowed. A pure, transport-agnostic helper (no socket knowledge of its own) so becomeCoordinator's bind-retry race is fast and deterministic to test directly. */
9
+ export async function retryOnAddrInUse(attempt, retries, delayMs) {
10
+ for (let tryNumber = 0;; tryNumber++) {
11
+ try {
12
+ return await attempt();
13
+ }
14
+ catch (error) {
15
+ const message = error instanceof Error ? error.message : String(error);
16
+ if (!message.includes("EADDRINUSE") || tryNumber >= retries)
17
+ throw error;
18
+ await new Promise((resolve) => {
19
+ setTimeout(resolve, delayMs);
20
+ });
21
+ }
22
+ }
23
+ }
24
+ //# sourceMappingURL=bind-retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bind-retry.js","sourceRoot":"","sources":["../../src/core/bind-retry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,4qBAA4qB;AAC5qB,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC;AACjD,wLAAwL;AACxL,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,CAAC;AAEzD,6YAA6Y;AAC7Y,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAyB,EACzB,OAAe,EACf,OAAe;IAEf,KAAK,IAAI,SAAS,GAAG,CAAC,GAAI,SAAS,EAAE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AChD,iSAAiS;IACjS,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;AAED,sSAAsS;AACtS,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,eAAe,CAAC,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,MAAM,EACf,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GACrD,cAAc,CAQhB;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,eAAe,CAAC,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,MAAM,EACf,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GACrD,cAAc,CA6ChB;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,eAAe,CAAC,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,MAAM,EACf,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GACrD,OAAO,CAAC,UAAU,CAAC,CASrB;AAED,6JAA6J;AAC7J,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,eAAe,CAAC,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,MAAM,EACf,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GACrD,OAAO,CAAC,UAAU,CAAC,CAUrB"}
@@ -20,6 +20,7 @@ import { loadOrCreateIdentity, oplogDirFor } from "./identity-store.js";
20
20
  import { toIdentityPort } from "./wire-mesh-identity.js";
21
21
  import { VersionDriftChecker } from "./version-check.js";
22
22
  import { getOwnPackageVersion } from "./package-version.js";
23
+ import { loadOrCreateUserIdentity } from "./user-identity.js";
23
24
  /** The synchronous half of bridge construction: everything loadOrCreateIdentity's own synchronous key material makes possible. Use this directly only when the calling entry point cannot await inline (see this file's own header comment); every other caller should use createBridgeMesh below. */
24
25
  export function createBridgeMeshSync(slot, coordinatorPort, hubUrl, fetchLatestVersion) {
25
26
  return createBridgeMeshSyncFromIdentity(loadOrCreateIdentity(slot), slot, coordinatorPort, hubUrl, fetchLatestVersion);
@@ -28,6 +29,9 @@ export function createBridgeMeshSync(slot, coordinatorPort, hubUrl, fetchLatestV
28
29
  * The same synchronous construction as createBridgeMeshSync, but taking an already-loaded identity rather than calling loadOrCreateIdentity itself -- see this file's own header comment for who this is for. Every other caller should go through createBridgeMeshSync/createBridgeMesh above, which own the lock on the caller's behalf.
29
30
  */
30
31
  export function createBridgeMeshSyncFromIdentity(identity, slot, coordinatorPort, hubUrl, fetchLatestVersion) {
32
+ // The user-principal identity (agent-comms#160) is shared by every bridge on this machine account -- deliberately not scoped to slot, unlike identity above. userIdentityOptions is empty (the default ~/.agent-comms location); every real bridge shares it, and only tests need an override.
33
+ const userIdentityOptions = {};
34
+ const userIdentity = loadOrCreateUserIdentity(userIdentityOptions);
31
35
  const store = new MeshStore(coordinatorPort, hubUrl);
32
36
  store.peerId = deviceIdToHex(Uint8Array.from(identity.deviceId));
33
37
  // One shared dataStorage instance for both the transport's own data-domain frame responder and the store's own durable-send mint path (P5, agent-comms#50) -- oplogDirFor(slot) needs only the slot, not the async identity below, so this can be constructed synchronously right here.
@@ -50,6 +54,8 @@ export function createBridgeMeshSyncFromIdentity(identity, slot, coordinatorPort
50
54
  slot,
51
55
  revocation,
52
56
  dataStorage,
57
+ userIdentity: await toIdentityPort(userIdentity),
58
+ userIdentityOptions,
53
59
  });
54
60
  },
55
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"bridge-mesh.js","sourceRoot":"","sources":["../../src/core/bridge-mesh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,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,cAAc,CAAC,oBAAoB,EAAE,CACtC,CAAC;IACF,MAAM,UAAU,GAAG,oBAAoB,EAAE,CAAC;IAC1C,OAAO;QACL,KAAK;QACL,IAAI;QACJ,cAAc,EAAE,KAAK,IAAI,EAAE;YACzB,KAAK,CAAC,WAAW,CAAC;gBAChB,QAAQ,EAAE,MAAM,cAAc,CAAC,QAAQ,CAAC;gBACxC,KAAK,EAAE,iBAAiB,EAAE;gBAC1B,IAAI;gBACJ,UAAU;gBACV,WAAW;gBACX,YAAY,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC;gBAChD,mBAAmB;aACpB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAA4B,EAC5B,eAAwB,EACxB,MAAe,EACf,kBAAsD;IAEtD,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,oBAAoB,CAC1D,IAAI,EACJ,eAAe,EACf,MAAM,EACN,kBAAkB,CACnB,CAAC;IACF,MAAM,cAAc,EAAE,CAAC;IACvB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC;AAED,6JAA6J;AAC7J,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,QAAsB,EACtB,IAA4B,EAC5B,eAAwB,EACxB,MAAe,EACf,kBAAsD;IAEtD,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,gCAAgC,CACtE,QAAQ,EACR,IAAI,EACJ,eAAe,EACf,MAAM,EACN,kBAAkB,CACnB,CAAC;IACF,MAAM,cAAc,EAAE,CAAC;IACvB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Receiver-side verification of a `dm:send` capability token (agent-comms#162): the receiver-controlled admission list a user principal issues, parallel to room-token-verification.ts's own `room:member` obligations but rooted at the user principal's device-id (user-identity.ts) rather than a room's own owner -- a `dm:send` grant admits a bearer device into THIS user's communication scope across every bridge slot sharing that principal, not into one specific room path. Layered on verifyCapabilityToken the same way verifyRoomToken is: obligations 2/4/5 (bearer match, ordinary token-claims checks, delegations-remaining narrowing) live there already; this module adds the dm:send-specific obligations -- the presented token must actually carry the dm:send capability (not merely happen to share a scope shape), its scope must name this exact user principal, and its delegation chain must root at that same user principal (never at the bearer itself, or self-issued authority would let any sender simply mint its own admission).
3
+ */
4
+ import { type TokenVerdictReason, type VerifyCapabilityTokenOptions } from "wire-mesh-core/domain/tokens";
5
+ import type { CapabilityToken, DeviceId, TokenClaims } from "wire-mesh-core/generated/protocol";
6
+ /** The one capability a user principal issues to admit a device into its own DM-communication scope (agent-comms#162) -- checked receiver-side wherever an unsolicited DM contact is admitted, the way room-token-verification.ts's ROOM_MEMBER_CAPABILITY gates every ordinary room-membership verb. */
7
+ export declare const DM_SEND_CAPABILITY = "dm:send";
8
+ /** The scope kind a dm:send grant's own scope always carries -- the resource being granted is "communication with this user principal", named by that principal's own device-id, never a specific bridge slot's peer-id, since a dm:send grant admits a bearer into the user's whole communication scope rather than one particular device. */
9
+ export declare const DM_SEND_SCOPE_KIND = "user";
10
+ export type DmSendTokenVerdictReason = TokenVerdictReason | "wrong_capability" | "wrong_scope_kind" | "wrong_scope_path" | "wrong_chain_root";
11
+ export type DmSendTokenVerdict = {
12
+ ok: true;
13
+ claims: TokenClaims;
14
+ } | {
15
+ ok: false;
16
+ reason: DmSendTokenVerdictReason;
17
+ };
18
+ export interface VerifyDmSendTokenOptions extends Omit<VerifyCapabilityTokenOptions, "expectedBearer"> {
19
+ /** The peer identity actually authenticated on the arriving connection -- the requester presenting this token as its own authority to contact userPrincipalDeviceId, never a relay-asserted or gossip-derived value. Mandatory here, matching verifyRoomToken's own mandatory expectedBearer: every dm:send check gates a specific counterparty, unlike verifyCapabilityToken's own optional field for a caller presenting a token to authorise itself. */
20
+ expectedBearer: DeviceId;
21
+ /** This receiving node's own user-principal device-id (user-identity.ts's loadOrCreateUserIdentity), the only issuer a dm:send grant may validly root at. */
22
+ userPrincipalDeviceId: DeviceId;
23
+ }
24
+ /**
25
+ * Verifies a `dm:send` capability token against the receiver's own user-principal identity: the token must carry the dm:send capability, its scope must be kind "user" with path equal to userPrincipalDeviceId exactly, and its delegation chain must root at userPrincipalDeviceId itself -- a self-issued or third-party-issued token naming the right scope by coincidence still fails here, since rootIssuer is checked independently of scope.path.
26
+ */
27
+ export declare function verifyDmSendToken(token: CapabilityToken, options: Readonly<VerifyDmSendTokenOptions>): Promise<DmSendTokenVerdict>;
28
+ //# sourceMappingURL=dm-token-verification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dm-token-verification.d.ts","sourceRoot":"","sources":["../../src/core/dm-token-verification.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,4BAA4B,EAClC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EACV,eAAe,EACf,QAAQ,EACR,WAAW,EACZ,MAAM,mCAAmC,CAAC;AAE3C,ySAAyS;AACzS,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C,+UAA+U;AAC/U,eAAO,MAAM,kBAAkB,SAAS,CAAC;AAEzC,MAAM,MAAM,wBAAwB,GAChC,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,kBAAkB,GAC1B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GACjC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,wBAAwB,CAAA;CAAE,CAAC;AAEpD,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,4BAA4B,EAC5B,gBAAgB,CACjB;IACC,2bAA2b;IAC3b,cAAc,EAAE,QAAQ,CAAC;IACzB,6JAA6J;IAC7J,qBAAqB,EAAE,QAAQ,CAAC;CACjC;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,QAAQ,CAAC,wBAAwB,CAAC,GAC1C,OAAO,CAAC,kBAAkB,CAAC,CA0B7B"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Receiver-side verification of a `dm:send` capability token (agent-comms#162): the receiver-controlled admission list a user principal issues, parallel to room-token-verification.ts's own `room:member` obligations but rooted at the user principal's device-id (user-identity.ts) rather than a room's own owner -- a `dm:send` grant admits a bearer device into THIS user's communication scope across every bridge slot sharing that principal, not into one specific room path. Layered on verifyCapabilityToken the same way verifyRoomToken is: obligations 2/4/5 (bearer match, ordinary token-claims checks, delegations-remaining narrowing) live there already; this module adds the dm:send-specific obligations -- the presented token must actually carry the dm:send capability (not merely happen to share a scope shape), its scope must name this exact user principal, and its delegation chain must root at that same user principal (never at the bearer itself, or self-issued authority would let any sender simply mint its own admission).
3
+ */
4
+ import { verifyCapabilityToken, } from "wire-mesh-core/domain/tokens";
5
+ import { deviceIdToHex } from "wire-mesh-core/domain/device-id";
6
+ /** The one capability a user principal issues to admit a device into its own DM-communication scope (agent-comms#162) -- checked receiver-side wherever an unsolicited DM contact is admitted, the way room-token-verification.ts's ROOM_MEMBER_CAPABILITY gates every ordinary room-membership verb. */
7
+ export const DM_SEND_CAPABILITY = "dm:send";
8
+ /** The scope kind a dm:send grant's own scope always carries -- the resource being granted is "communication with this user principal", named by that principal's own device-id, never a specific bridge slot's peer-id, since a dm:send grant admits a bearer into the user's whole communication scope rather than one particular device. */
9
+ export const DM_SEND_SCOPE_KIND = "user";
10
+ /**
11
+ * Verifies a `dm:send` capability token against the receiver's own user-principal identity: the token must carry the dm:send capability, its scope must be kind "user" with path equal to userPrincipalDeviceId exactly, and its delegation chain must root at userPrincipalDeviceId itself -- a self-issued or third-party-issued token naming the right scope by coincidence still fails here, since rootIssuer is checked independently of scope.path.
12
+ */
13
+ export async function verifyDmSendToken(token, options) {
14
+ const verdict = await verifyCapabilityToken(token, {
15
+ identity: options.identity,
16
+ clock: options.clock,
17
+ revocation: options.revocation,
18
+ expectedBearer: options.expectedBearer,
19
+ });
20
+ if (!verdict.ok) {
21
+ return verdict;
22
+ }
23
+ if (verdict.claims.capability !== DM_SEND_CAPABILITY) {
24
+ return { ok: false, reason: "wrong_capability" };
25
+ }
26
+ if (verdict.claims.scope.kind !== DM_SEND_SCOPE_KIND) {
27
+ return { ok: false, reason: "wrong_scope_kind" };
28
+ }
29
+ const expectedPath = deviceIdToHex(options.userPrincipalDeviceId);
30
+ if (verdict.claims.scope.path !== expectedPath) {
31
+ return { ok: false, reason: "wrong_scope_path" };
32
+ }
33
+ if (deviceIdToHex(verdict.rootIssuer) !== expectedPath) {
34
+ return { ok: false, reason: "wrong_chain_root" };
35
+ }
36
+ return { ok: true, claims: verdict.claims };
37
+ }
38
+ //# sourceMappingURL=dm-token-verification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dm-token-verification.js","sourceRoot":"","sources":["../../src/core/dm-token-verification.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,qBAAqB,GAGtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAOhE,ySAAyS;AACzS,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAE5C,+UAA+U;AAC/U,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAuBzC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAAsB,EACtB,OAA2C;IAE3C,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,KAAK,EAAE;QACjD,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;QAChB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,KAAK,kBAAkB,EAAE,CAAC;QACrD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACnD,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;QACrD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACnD,CAAC;IACD,MAAM,YAAY,GAAG,aAAa,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAClE,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAC/C,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACnD,CAAC;IACD,IAAI,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,YAAY,EAAE,CAAC;QACvD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACnD,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AAC9C,CAAC"}
@@ -1,8 +1,11 @@
1
1
  /**
2
- * mergeKnownDevices — the mesh-wide gossip-directory aggregation WireMeshTransport's own listKnownDevices reads from. Split out purely to keep wire-mesh-transport.ts under the repo's max-lines cap, the same reason connection-approval.ts, room-router.ts, hub-session.ts, and peer-lifecycle.ts were each split from their own owning file.
2
+ * gossip-directory — the mesh-wide gossip-directory aggregation WireMeshTransport's own listKnownDevices reads from, plus per-event directory lookups (a specific peer's presence advert). Split out purely to keep wire-mesh-transport.ts under the repo's max-lines cap, the same reason connection-approval.ts, room-router.ts, hub-session.ts, and peer-lifecycle.ts were each split from their own owning file.
3
3
  */
4
4
  import type { DirectoryEntry } from "wire-mesh-core/domain/mesh-session";
5
5
  import type { PeerAdvert } from "wire-mesh-core/generated/protocol";
6
+ import { AgentStatus } from "./types.js";
6
7
  /** Merges one session event's own directory into the mesh-wide knownDevices view (mutated in place), keeping the newer advert (by snapshot-seconds) whenever a device-id is already known from an earlier event or a different session. */
7
8
  export declare function mergeKnownDevices(knownDevices: Map<string, PeerAdvert>, directory: readonly DirectoryEntry[]): void;
9
+ /** Reads a presence extension from one specific device's own gossiped self-advert, if this event's directory carries a fresh one for exactly that device-id -- never for any other device-id a multi-hop directory might mention, since only the session's own authenticated peer's advert is that session's business to report. Returns undefined for a missing presence/status key, or a value that isn't a recognised AgentStatus -- an advert simply not participating in this convention, not an error (the same verifier obligation peer-advert's own open extension tail is documented under). */
10
+ export declare function findPresenceAdvert(deviceIdHex: string, directory: readonly DirectoryEntry[]): AgentStatus | undefined;
8
11
  //# sourceMappingURL=gossip-directory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gossip-directory.d.ts","sourceRoot":"","sources":["../../src/core/gossip-directory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAEpE,2OAA2O;AAC3O,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACrC,SAAS,EAAE,SAAS,cAAc,EAAE,GACnC,IAAI,CAWN"}
1
+ {"version":3,"file":"gossip-directory.d.ts","sourceRoot":"","sources":["../../src/core/gossip-directory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,2OAA2O;AAC3O,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACrC,SAAS,EAAE,SAAS,cAAc,EAAE,GACnC,IAAI,CAWN;AAED,ykBAAykB;AACzkB,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,SAAS,cAAc,EAAE,GACnC,WAAW,GAAG,SAAS,CAOzB"}
@@ -1,7 +1,9 @@
1
1
  /**
2
- * mergeKnownDevices — the mesh-wide gossip-directory aggregation WireMeshTransport's own listKnownDevices reads from. Split out purely to keep wire-mesh-transport.ts under the repo's max-lines cap, the same reason connection-approval.ts, room-router.ts, hub-session.ts, and peer-lifecycle.ts were each split from their own owning file.
2
+ * gossip-directory — the mesh-wide gossip-directory aggregation WireMeshTransport's own listKnownDevices reads from, plus per-event directory lookups (a specific peer's presence advert). Split out purely to keep wire-mesh-transport.ts under the repo's max-lines cap, the same reason connection-approval.ts, room-router.ts, hub-session.ts, and peer-lifecycle.ts were each split from their own owning file.
3
3
  */
4
4
  import { deviceIdToHex } from "wire-mesh-core/domain/device-id";
5
+ import { AgentStatus } from "./types.js";
6
+ import { PRESENCE_GOSSIP_KEY } from "./wire-mesh-transport.js";
5
7
  /** Merges one session event's own directory into the mesh-wide knownDevices view (mutated in place), keeping the newer advert (by snapshot-seconds) whenever a device-id is already known from an earlier event or a different session. */
6
8
  export function mergeKnownDevices(knownDevices, directory) {
7
9
  for (const entry of directory) {
@@ -13,4 +15,12 @@ export function mergeKnownDevices(knownDevices, directory) {
13
15
  }
14
16
  }
15
17
  }
18
+ /** Reads a presence extension from one specific device's own gossiped self-advert, if this event's directory carries a fresh one for exactly that device-id -- never for any other device-id a multi-hop directory might mention, since only the session's own authenticated peer's advert is that session's business to report. Returns undefined for a missing presence/status key, or a value that isn't a recognised AgentStatus -- an advert simply not participating in this convention, not an error (the same verifier obligation peer-advert's own open extension tail is documented under). */
19
+ export function findPresenceAdvert(deviceIdHex, directory) {
20
+ const entry = directory.find((candidate) => deviceIdToHex(candidate.device) === deviceIdHex);
21
+ if (entry === undefined)
22
+ return undefined;
23
+ const status = entry.advert[PRESENCE_GOSSIP_KEY];
24
+ return AgentStatus.is(status) ? status : undefined;
25
+ }
16
26
  //# sourceMappingURL=gossip-directory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gossip-directory.js","sourceRoot":"","sources":["../../src/core/gossip-directory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAIhE,2OAA2O;AAC3O,MAAM,UAAU,iBAAiB,CAC/B,YAAqC,EACrC,SAAoC;IAEpC,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC/C,IACE,QAAQ,KAAK,SAAS;YACtB,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,QAAQ,CAAC,kBAAkB,CAAC,EAChE,CAAC;YACD,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"gossip-directory.js","sourceRoot":"","sources":["../../src/core/gossip-directory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGhE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,2OAA2O;AAC3O,MAAM,UAAU,iBAAiB,CAC/B,YAAqC,EACrC,SAAoC;IAEpC,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC/C,IACE,QAAQ,KAAK,SAAS;YACtB,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,QAAQ,CAAC,kBAAkB,CAAC,EAChE,CAAC;YACD,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;AACH,CAAC;AAED,ykBAAykB;AACzkB,MAAM,UAAU,kBAAkB,CAChC,WAAmB,EACnB,SAAoC;IAEpC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAC1B,CAAC,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,WAAW,CAC/D,CAAC;IACF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,MAAM,GAAY,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC1D,OAAO,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACrD,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * hub-forwarding -- agent-comms#155's gateway forwarding, split from wire-mesh-transport.ts under the repo's max-lines cap. Outbound: filters a directory of gossiped local devices down to the ones eligible for cross-machine advertisement (an agent/self-bearing entry, meaning only ever a "visible" agent -- see AGENT_SELF_GOSSIP_KEY's own doc for why no separate visibility check is needed here) and pushes them onto a connected HubSession, best-effort. Local-to-remote routing: falls a room-domain request back through the hub's own relay-connect/relay-data pairing when its target isn't a local peer session.
3
+ */
4
+ import type { CapabilityScope, CapabilityToken, ManageCommand, PeerAdvert } from "wire-mesh-core/generated/protocol";
5
+ import type { DirectoryEntry, ManageOutcome } from "wire-mesh-core/domain/mesh-session";
6
+ import type { HubSession } from "./hub-session.js";
7
+ /** Forwards every directory entry carrying an agent/self extension onto hub, if hub currently holds a live connection -- a no-op otherwise, which is every local peer except whichever one is currently the gateway. Called both from WireMeshTransport's own watchForDisconnect (as each local peer session's directory changes) and from connectHub's own initial catch-up push, so this side's already-known local devices reach the hub immediately on taking over the gateway role rather than waiting for their own next periodic gossip tick. Forwards unconditionally on every call (no caching or dedup against a previous call), mirroring relay-hub.ts's own "forward every gossip frame, as received" philosophy: an advert's own snapshot-seconds/addresses are meant to keep propagating as a liveness heartbeat, so suppressing a "duplicate" would silently stop legitimate freshness updates from reaching remote gateways. A forward that fails is reported via onError and swallowed, matching every other best-effort gossip send in this codebase. */
8
+ export declare function forwardAdvertsToHub(hub: Readonly<Pick<HubSession, "isConnected" | "advertiseDevices">>, directory: readonly DirectoryEntry[], onError: ((error: Error) => void) | undefined): void;
9
+ /** Catches the hub up with every local device already known at the moment this side becomes the gateway (connectHub's own trailing call, right after hub.connect resolves) -- without this, a device whose own last gossip arrived before this coordinator took over the gateway role would never be (re-)advertised until its own next periodic gossip tick (hub-side state is rebuilt from scratch on every takeover, per coordinator-gateway.ts's own class doc). Reuses forwardAdvertsToHub's own eligibility filter, so only ever a visible, agent/self-bearing device is pushed, exactly as an ordinary directory-change forward would. */
10
+ export declare function pushHubCatchUp(hub: Readonly<Pick<HubSession, "isConnected" | "advertiseDevices">>, knownDevices: ReadonlyMap<string, Readonly<PeerAdvert>>, onError: ((error: Error) => void) | undefined): void;
11
+ /** Routes a room-domain request through the hub's relay-connect/relay-data pairing when memberId isn't a local peer session -- WireMeshTransport.sendRoomRequest's own fallback, since the member may be a remote agent reachable only via this machine's gateway connection (agent-comms#155's local-to-remote leg). Resolves the same not_connected outcome sendRoomRequest already returned before the hub existed at all when this side isn't currently the gateway. */
12
+ export declare function routeRoomRequestViaHub(hub: Readonly<Pick<HubSession, "isConnected" | "sendRoomRequest">>, memberId: string, command: ManageCommand, scope: Readonly<CapabilityScope>, token?: CapabilityToken): Promise<ManageOutcome>;
13
+ //# sourceMappingURL=hub-forwarding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-forwarding.d.ts","sourceRoot":"","sources":["../../src/core/hub-forwarding.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,aAAa,EACb,UAAU,EACX,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,2gCAA2gC;AAC3gC,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,GAAG,kBAAkB,CAAC,CAAC,EACnE,SAAS,EAAE,SAAS,cAAc,EAAE,EACpC,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,GAC5C,IAAI,CASN;AAED,inBAAinB;AACjnB,wBAAgB,cAAc,CAC5B,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,GAAG,kBAAkB,CAAC,CAAC,EACnE,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EACvD,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,GAC5C,IAAI,CAMN;AAED,4cAA4c;AAC5c,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,GAAG,iBAAiB,CAAC,CAAC,EAClE,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC,EAChC,KAAK,CAAC,EAAE,eAAe,GACtB,OAAO,CAAC,aAAa,CAAC,CAGxB"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * hub-forwarding -- agent-comms#155's gateway forwarding, split from wire-mesh-transport.ts under the repo's max-lines cap. Outbound: filters a directory of gossiped local devices down to the ones eligible for cross-machine advertisement (an agent/self-bearing entry, meaning only ever a "visible" agent -- see AGENT_SELF_GOSSIP_KEY's own doc for why no separate visibility check is needed here) and pushes them onto a connected HubSession, best-effort. Local-to-remote routing: falls a room-domain request back through the hub's own relay-connect/relay-data pairing when its target isn't a local peer session.
3
+ */
4
+ import { AGENT_SELF_GOSSIP_KEY } from "./wire-mesh-transport.js";
5
+ /** Forwards every directory entry carrying an agent/self extension onto hub, if hub currently holds a live connection -- a no-op otherwise, which is every local peer except whichever one is currently the gateway. Called both from WireMeshTransport's own watchForDisconnect (as each local peer session's directory changes) and from connectHub's own initial catch-up push, so this side's already-known local devices reach the hub immediately on taking over the gateway role rather than waiting for their own next periodic gossip tick. Forwards unconditionally on every call (no caching or dedup against a previous call), mirroring relay-hub.ts's own "forward every gossip frame, as received" philosophy: an advert's own snapshot-seconds/addresses are meant to keep propagating as a liveness heartbeat, so suppressing a "duplicate" would silently stop legitimate freshness updates from reaching remote gateways. A forward that fails is reported via onError and swallowed, matching every other best-effort gossip send in this codebase. */
6
+ export function forwardAdvertsToHub(hub, directory, onError) {
7
+ if (!hub.isConnected)
8
+ return;
9
+ const eligible = directory.filter((entry) => entry.advert[AGENT_SELF_GOSSIP_KEY] !== undefined);
10
+ if (eligible.length === 0)
11
+ return;
12
+ hub.advertiseDevices(eligible).catch((error) => {
13
+ onError?.(error instanceof Error ? error : new Error(String(error)));
14
+ });
15
+ }
16
+ /** Catches the hub up with every local device already known at the moment this side becomes the gateway (connectHub's own trailing call, right after hub.connect resolves) -- without this, a device whose own last gossip arrived before this coordinator took over the gateway role would never be (re-)advertised until its own next periodic gossip tick (hub-side state is rebuilt from scratch on every takeover, per coordinator-gateway.ts's own class doc). Reuses forwardAdvertsToHub's own eligibility filter, so only ever a visible, agent/self-bearing device is pushed, exactly as an ordinary directory-change forward would. */
17
+ export function pushHubCatchUp(hub, knownDevices, onError) {
18
+ const catchUp = [...knownDevices.values()].map((advert) => ({
19
+ device: advert.device,
20
+ advert,
21
+ }));
22
+ forwardAdvertsToHub(hub, catchUp, onError);
23
+ }
24
+ /** Routes a room-domain request through the hub's relay-connect/relay-data pairing when memberId isn't a local peer session -- WireMeshTransport.sendRoomRequest's own fallback, since the member may be a remote agent reachable only via this machine's gateway connection (agent-comms#155's local-to-remote leg). Resolves the same not_connected outcome sendRoomRequest already returned before the hub existed at all when this side isn't currently the gateway. */
25
+ export async function routeRoomRequestViaHub(hub, memberId, command, scope, token) {
26
+ if (!hub.isConnected)
27
+ return { result: "error", code: "not_connected" };
28
+ return hub.sendRoomRequest(memberId, command, scope, token);
29
+ }
30
+ //# sourceMappingURL=hub-forwarding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-forwarding.js","sourceRoot":"","sources":["../../src/core/hub-forwarding.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,2gCAA2gC;AAC3gC,MAAM,UAAU,mBAAmB,CACjC,GAAmE,EACnE,SAAoC,EACpC,OAA6C;IAE7C,IAAI,CAAC,GAAG,CAAC,WAAW;QAAE,OAAO;IAC7B,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAC/B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,KAAK,SAAS,CAC7D,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAClC,GAAG,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACtD,OAAO,EAAE,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC;AAED,inBAAinB;AACjnB,MAAM,UAAU,cAAc,CAC5B,GAAmE,EACnE,YAAuD,EACvD,OAA6C;IAE7C,MAAM,OAAO,GAAG,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC1D,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM;KACP,CAAC,CAAC,CAAC;IACJ,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED,4cAA4c;AAC5c,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,GAAkE,EAClE,QAAgB,EAChB,OAAsB,EACtB,KAAgC,EAChC,KAAuB;IAEvB,IAAI,CAAC,GAAG,CAAC,WAAW;QAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;IACxE,OAAO,GAAG,CAAC,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAC9D,CAAC"}
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * HubSession -- the relay-hub connection mode (agent-comms#151), split from wire-mesh-transport.ts under the max-lines cap the same way connection-approval.ts and its siblings were. A hub connection (wss://mesh.exadev.io/) is a RELAY, not a coordinator: no connect_request/introduce approval applies. The session's own self-advert is forwarded by the hub to every other connected agent and the hub answers with a catch-up of everyone already there, so peers discover each other purely through gossip. Messages ride relay-connect pairings -- sendManageRequest's own targetDevice routing, which the session layer wraps as relay-data to exactly that device.
3
3
  */
4
- import { type AcceptedMeshSession } from "wire-mesh-core/domain/mesh-session";
5
- import type { Frame } from "wire-mesh-core/generated/protocol";
4
+ import { type AcceptedMeshSession, type DirectoryEntry, type IncomingManageRequest, type ManageOutcome } from "wire-mesh-core/domain/mesh-session";
5
+ import type { CapabilityScope, CapabilityToken, Frame, ManageCommand } from "wire-mesh-core/generated/protocol";
6
6
  import type { IdentityPort } from "wire-mesh-core/ports/identity";
7
7
  import type { Connection } from "wire-mesh-core/ports/transport";
8
- import type { TransportEvents } from "./transport.js";
8
+ import type { ConnectionHandle, TransportEvents } from "./transport.js";
9
9
  import type { MeshMessage } from "./wire-protocol.js";
10
10
  export interface HubSessionDeps {
11
11
  /** Resolves this node's own identity port once ready. */
@@ -19,10 +19,16 @@ export interface HubSessionDeps {
19
19
  onFrame: (connection: Readonly<Connection>, frame: Readonly<Frame>) => void | Promise<void>;
20
20
  /** Tracks the session for shutdown -- every session the transport ever creates, always. */
21
21
  trackForShutdown: (session: AcceptedMeshSession) => void;
22
+ /** Fires with every remote (non-self) directory entry the hub's own gossip/catch-up surfaces, every time the session's directory changes (agent-comms#155's own remote-directory-merge leg) -- the transport merges these into its own mesh-wide knownDevices the same way it already merges a local peer session's directory, so a hub-learned agent surfaces in listAgents/getAgent with no separate lookup path. */
23
+ onDirectory: (entries: readonly DirectoryEntry[]) => void;
24
+ /** Dispatches an already-received, non-legacy-frame request (a real core/room verb: room.send, room.notify, room.join, ...) to WireMeshTransport's own roomRouter, the identical dispatch a local peer session's own drainSession already uses -- the outbound half of agent-comms#155's "remote to local" routing leg. Deferred the same lazy-`this`-capture way DeliveryEngine's own sendRoomRequestToMember closure is, since roomRouter is constructed after this class's own instance in WireMeshTransport's constructor. */
25
+ handleRoomRequest: (request: IncomingManageRequest, handle: Readonly<ConnectionHandle>) => Promise<void>;
22
26
  }
23
27
  export declare class HubSession {
24
28
  private readonly deps;
25
29
  private session;
30
+ /** The raw connection underlying `session` -- MeshSession's own sendGossipUpdate only ever advertises this side's own single device, so advertising OTHER (local mesh) devices onto the hub (agent-comms#155's outbound leg) needs a raw gossip frame sent directly, bypassing that per-session single-self-advert limit. */
31
+ private connection;
26
32
  private readonly hubPeersKnown;
27
33
  constructor(deps: Readonly<HubSessionDeps>);
28
34
  /** This node's own device-id, hex-encoded -- the identifier hub peers address it by. */
@@ -35,10 +41,14 @@ export declare class HubSession {
35
41
  peers(): readonly string[];
36
42
  /** Dials the hub and participates as a peer (see the class doc for the discovery and routing model). */
37
43
  connect(url: string): Promise<void>;
38
- /** Dispatches inbound relayed manage-requests: each is handled with a handle keyed by the SENDING device (request.fromDevice names it on relay-routed requests), so onMessage and every downstream consumer see the true origin, never the hub. Replies ride respond()'s own relay routing back. A state_sync/state_update is dropped before ever reaching onMessage/applyPatch -- see isStateMutatingMessage's own doc for why: the hub has no per-peer admission control yet (that lands in agent-comms#156), so accepting one from an arbitrary hub peer would let it directly patch this side's mesh state (a security review finding on agent-comms#169, which is what first wired a hub connection into production's default coordinator path at all). */
44
+ /** Dispatches inbound relayed manage-requests: each is handled with a handle keyed by the SENDING device (request.fromDevice names it on relay-routed requests), so every downstream consumer sees the true origin, never the hub -- the same discipline extends to a real room-domain verb (agent-comms#155's "remote to local" leg) as it already applied to the legacy opaque-frame path. A legacy FRAME_VERB carrying state_sync/state_update is dropped before ever reaching onMessage/applyPatch -- see isStateMutatingMessage's own doc for why: the hub has no per-peer admission control yet (that lands in agent-comms#156), so accepting one from an arbitrary hub peer would let it directly patch this side's mesh state (a security review finding on agent-comms#169). A real room-domain verb (room.send, room.join, room.notify, ...) carries no equivalent risk -- it is independently gated by its own room:member capability token, verified regardless of which transport path it arrived over -- so it is dispatched to the same roomVerbHandlers a local peer session's own drainSession uses, via handleRoomRequest, against THIS side's own local mesh state. Known limitation, inherited from wire-mesh-core's own session layer rather than something agent-comms can fix here: a session tracks at most one active relay pairing per remote device (mesh-session.ts's own single relayPeerDevice slot), so a request relayed here is dispatched as "addressed to this gateway's own agent" unconditionally -- there is no target-device disambiguation available to route it on to a DIFFERENT local peer this gateway also advertises. Forwarding this gateway's own agent's traffic is therefore correct; a remote request genuinely meant for another local peer behind this same gateway is not yet distinguishable from one meant for this gateway's own agent. */
39
45
  private consume;
40
46
  private watchDisconnect;
41
47
  /** Sends one message to a hub-discovered peer through the hub's relay pairing. */
42
48
  sendToPeer(peerDeviceHex: string, message: MeshMessage): Promise<void>;
49
+ /** Gossips a raw `gossip` frame carrying every given entry's own advert onto the hub, over the raw connection rather than sendGossipUpdate (which can only ever advertise this side's own single device) -- the outbound leg of agent-comms#155's gateway forwarding. relay-hub.ts registers each advert's own `device` field against the CONNECTION it arrives on, so every entry passed here becomes reachable, cross-machine, as "via this gateway" -- callers are responsible for only ever passing entries that are actually meant to be advertised (WireMeshTransport filters to local, visible-agent-bearing entries before calling this). Throws if this side isn't currently connected to a hub, matching sendToPeer's own contract -- callers gate on isConnected first. */
50
+ advertiseDevices(entries: readonly DirectoryEntry[]): Promise<void>;
51
+ /** Sends a real core/room manage-request to a specific hub-reachable peer, through the hub's relay-connect/relay-data pairing -- the local-to-remote leg of agent-comms#155's routing, mirroring MeshTransport.sendRoomRequest's own not_connected/outcome contract so WireMeshTransport can fall back to this uniformly when memberId isn't a local peer session. Bounded by HUB_ROOM_REQUEST_TIMEOUT_MS (see its own doc) since an unreachable target-device is silently dropped by the hub with no error frame, unlike a local session's own connection-level failure. */
52
+ sendRoomRequest(peerDeviceHex: string, command: ManageCommand, scope: Readonly<CapabilityScope>, token?: CapabilityToken): Promise<ManageOutcome>;
43
53
  }
44
54
  //# sourceMappingURL=hub-session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hub-session.d.ts","sourceRoot":"","sources":["../../src/core/hub-session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,K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