agent-comms 8.8.0 → 8.9.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 (72) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +7 -1
  4. package/dist/core/election-sessions.d.ts +2 -0
  5. package/dist/core/election-sessions.d.ts.map +1 -1
  6. package/dist/core/election-sessions.js +4 -0
  7. package/dist/core/election-sessions.js.map +1 -1
  8. package/dist/core/gossip-directory.d.ts +3 -0
  9. package/dist/core/gossip-directory.d.ts.map +1 -1
  10. package/dist/core/gossip-directory.js +11 -2
  11. package/dist/core/gossip-directory.js.map +1 -1
  12. package/dist/core/gossip-extensions.d.ts +3 -0
  13. package/dist/core/gossip-extensions.d.ts.map +1 -1
  14. package/dist/core/gossip-extensions.js +17 -0
  15. package/dist/core/gossip-extensions.js.map +1 -1
  16. package/dist/core/hub-link.d.ts +13 -5
  17. package/dist/core/hub-link.d.ts.map +1 -1
  18. package/dist/core/hub-link.js +28 -6
  19. package/dist/core/hub-link.js.map +1 -1
  20. package/dist/core/hub-session.d.ts +11 -0
  21. package/dist/core/hub-session.d.ts.map +1 -1
  22. package/dist/core/hub-session.js +28 -1
  23. package/dist/core/hub-session.js.map +1 -1
  24. package/dist/core/mesh-store.d.ts +1 -1
  25. package/dist/core/mesh-store.d.ts.map +1 -1
  26. package/dist/core/mesh-store.js +4 -14
  27. package/dist/core/mesh-store.js.map +1 -1
  28. package/dist/core/relay-role.d.ts +61 -0
  29. package/dist/core/relay-role.d.ts.map +1 -0
  30. package/dist/core/relay-role.js +147 -0
  31. package/dist/core/relay-role.js.map +1 -0
  32. package/dist/core/relay-selection.d.ts +35 -0
  33. package/dist/core/relay-selection.d.ts.map +1 -0
  34. package/dist/core/relay-selection.js +80 -0
  35. package/dist/core/relay-selection.js.map +1 -0
  36. package/dist/core/relay-server.d.ts +48 -0
  37. package/dist/core/relay-server.d.ts.map +1 -0
  38. package/dist/core/relay-server.js +181 -0
  39. package/dist/core/relay-server.js.map +1 -0
  40. package/dist/core/relay-uplink.d.ts +22 -0
  41. package/dist/core/relay-uplink.d.ts.map +1 -0
  42. package/dist/core/relay-uplink.js +62 -0
  43. package/dist/core/relay-uplink.js.map +1 -0
  44. package/dist/core/transport.d.ts +4 -0
  45. package/dist/core/transport.d.ts.map +1 -1
  46. package/dist/core/wire-mesh-transport-options.d.ts +2 -0
  47. package/dist/core/wire-mesh-transport-options.d.ts.map +1 -1
  48. package/dist/core/wire-mesh-transport-options.js.map +1 -1
  49. package/dist/core/wire-mesh-transport.d.ts +3 -2
  50. package/dist/core/wire-mesh-transport.d.ts.map +1 -1
  51. package/dist/core/wire-mesh-transport.js +23 -20
  52. package/dist/core/wire-mesh-transport.js.map +1 -1
  53. package/dist/core/ws-dial.d.ts +3 -0
  54. package/dist/core/ws-dial.d.ts.map +1 -1
  55. package/dist/core/ws-dial.js +3 -2
  56. package/dist/core/ws-dial.js.map +1 -1
  57. package/dist/test/gossip-directory.unit.test.js +14 -0
  58. package/dist/test/gossip-directory.unit.test.js.map +1 -1
  59. package/dist/test/hub-link.unit.test.js +53 -7
  60. package/dist/test/hub-link.unit.test.js.map +1 -1
  61. package/dist/test/relay-role.integration.test.d.ts +5 -0
  62. package/dist/test/relay-role.integration.test.d.ts.map +1 -0
  63. package/dist/test/relay-role.integration.test.js +134 -0
  64. package/dist/test/relay-role.integration.test.js.map +1 -0
  65. package/dist/test/relay-selection.unit.test.d.ts +5 -0
  66. package/dist/test/relay-selection.unit.test.d.ts.map +1 -0
  67. package/dist/test/relay-selection.unit.test.js +103 -0
  68. package/dist/test/relay-selection.unit.test.js.map +1 -0
  69. package/dist/test/test-transport.d.ts.map +1 -1
  70. package/dist/test/test-transport.js +2 -0
  71. package/dist/test/test-transport.js.map +1 -1
  72. package/package.json +2 -2
@@ -15,7 +15,7 @@
15
15
  "source": "url",
16
16
  "url": "https://github.com/ExaDev/agent-comms.git"
17
17
  },
18
- "version": "8.8.0"
18
+ "version": "8.9.0"
19
19
  }
20
20
  ]
21
21
  }
@@ -18,5 +18,5 @@
18
18
  },
19
19
  "name": "agent-comms",
20
20
  "repository": "https://github.com/ExaDev/agent-comms",
21
- "version": "8.8.0"
21
+ "version": "8.9.0"
22
22
  }
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-8.8.0-blue)](https://github.com/ExaDev/agent-comms/releases/tag/v8.8.0)
5
+ [![version](https://img.shields.io/badge/version-8.9.0-blue)](https://github.com/ExaDev/agent-comms/releases/tag/v8.9.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.
@@ -453,6 +453,12 @@ Every bridge answers SIGTERM, SIGINT and SIGHUP by marking its own agent offline
453
453
 
454
454
  Every store holds its own session on the relay hub (`wss://mesh.exadev.io/` by default), each Claude Code session the default cc-peer front handles included, and dials it again with a growing delay whenever the hub drops it. Being reachable from another machine therefore does not depend on which store holds the local coordinator role, and a coordinator handover leaves every other store's hub session alone. A store holds a session only while it has an agent that is not a ghost and its machine trusts at least one remote device, principal or machine, so before that nothing of it reaches the hub, not even its device id. A visible agent advertises itself, its presence and its hosted rooms; a hidden agent advertises only its device id, which is what lets it be reached by that id.
455
455
 
456
+ The hub is a set rather than one address. A store holds its one hub session over the relay it ranks highest: a relay served on its own machine, then a relay on the local network offered by a trusted device, then any trusted device offering relay service, then the configured hub as the fallback. A direct connection to a device always beats every relay, since a request to a directly connected device never touches the hub session at all. A relay whose dial fails, or which drops the session, is passed over for about a minute before it is tried again.
457
+
458
+ The store holding its machine's elected coordinator role serves the relay role while its own session is held to the configured hub: it runs the same relay logic the public hub runs behind a WebSocket listener on every interface, and offers it in its gossiped advert (the `wire-mesh/relay-offer` extension), which reaches its peers and, through the hub, trusted devices elsewhere. A relay admits only its own machine's mesh members and devices this machine trusts, by device or by principal, and it forwards between its own directly connected clients. Relay payloads are end-to-end encrypted between the two devices using the relay, so trusting a relay is a decision about availability and metadata (who talks to whom, and the relay's own addresses), never content.
459
+
460
+ The relay takes the connection of its own hub session as its uplink and fronts its clients over it, so a store behind its machine's relay stays reachable by devices that reach it only through the configured hub, and can reach them, each end seen under its own device-id rather than the relay's. An advert for one of the relay's own clients that comes back round through the hub never displaces the client's registration, and a device that has only just moved onto the relay is routable once its first advert has been accepted, which can take until its next gossip.
461
+
456
462
  A device known only through the hub, not directly connected to this mesh, is reported at whatever presence its last gossiped advert carried. Nothing tells the rest of the mesh when such a device disconnects, so `list_agents` stops trusting a stale advert and reports the device offline once it has gone unrefreshed for a few re-advertise intervals, rather than showing it active indefinitely.
457
463
 
458
464
  Two devices on different machines can only relay traffic through each other's hub once each side explicitly trusts the other's device-id — a deny-by-default, pin-the-key model with no directory lookup, deliberately mirroring how an ordinary peer connection is already pinned.
@@ -20,6 +20,8 @@ export declare class ElectionSessions {
20
20
  /** Forgets a closed session. A no-op for one never enrolled. */
21
21
  delete(session: AcceptedMeshSession): void;
22
22
  clear(): void;
23
+ /** Whether this store holds a live machine-local session with the device (hex): a full member of its local mesh on this same machine. */
24
+ hasPeer(deviceHex: string): boolean;
23
25
  /** The device-ids of every peer this side has at least one enrolled session to: the peers that take part in the election with it. */
24
26
  peerIds(): ReadonlySet<string>;
25
27
  /** Gossips a claim over every enrolled session. A send fails only on a connection that is already closing, and each failure is reported; the peer is told the incumbent again when its next session is enrolled. */
@@ -1 +1 @@
1
- {"version":3,"file":"election-sessions.d.ts","sourceRoot":"","sources":["../../src/core/election-sessions.ts"],"names":[],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O,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAExE,qBAAa,gBAAgB;IAQzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAPzB,4EAA4E;IAC5E,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAGrB;gBAGe,MAAM,EAAE,QAAQ,CAC/B,IAAI,CACF,eAAe,EACf,oBAAoB,GAAG,2BAA2B,GAAG,SAAS,CAC/D,CACF;IAGH,+QAA+Q;IAC/Q,KAAK,CACH,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GACjC,IAAI;IAUP,mNAAmN;IACnN,KAAK,CACH,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GACjC,IAAI;IAKP,gEAAgE;IAChE,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI;IAI1C,KAAK,IAAI,IAAI;IAIb,yIAAyI;IACzI,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAInC,qIAAqI;IACrI,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC;IAI9B,oNAAoN;IAC9M,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjE,iNAAiN;IAC3M,MAAM,CACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC;YAUF,QAAQ;CAavB"}
@@ -34,6 +34,10 @@ export class ElectionSessions {
34
34
  clear() {
35
35
  this.enrolled.clear();
36
36
  }
37
+ /** Whether this store holds a live machine-local session with the device (hex): a full member of its local mesh on this same machine. */
38
+ hasPeer(deviceHex) {
39
+ return this.peerIds().has(deviceHex);
40
+ }
37
41
  /** The device-ids of every peer this side has at least one enrolled session to: the peers that take part in the election with it. */
38
42
  peerIds() {
39
43
  return new Set([...this.enrolled.values()].map((handle) => handle.id));
@@ -1 +1 @@
1
- {"version":3,"file":"election-sessions.js","sourceRoot":"","sources":["../../src/core/election-sessions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,OAAO,gBAAgB;IAQR;IAPnB,4EAA4E;IAC3D,QAAQ,GAAG,IAAI,GAAG,EAGhC,CAAC;IAEJ,YACmB,MAKhB;QALgB,WAAM,GAAN,MAAM,CAKtB;IACA,CAAC;IAEJ,+QAA+Q;IAC/Q,KAAK,CACH,OAA4B,EAC5B,MAAkC;QAElC,KAAK,CAAC,KAAK,IAAI,EAAE;YACf,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;gBACpD,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC/B,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;gBAChD,CAAC;YACH,CAAC;QACH,CAAC,CAAC,EAAE,CAAC;IACP,CAAC;IAED,mNAAmN;IACnN,KAAK,CACH,OAA4B,EAC5B,MAAkC;QAElC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAED,gEAAgE;IAChE,MAAM,CAAC,OAA4B;QACjC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED,qIAAqI;IACrI,OAAO;QACL,OAAO,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,GA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SelfAgentAdvert: (() => AgentSelfAdvert | undefined) | undefined;
62
62
  /** Reads this side's own currently-running cc-peer version, when this process is fronting/bridging one -- folded into the same AGENT_COMMS_VERSION_GOSSIP_KEY advert as this side's own always-known agent-comms package version (agent-comms#198). Unlike presence/hostedRooms/selfAgentAdvert, agent-comms' own version is never genuinely absent (getOwnPackageVersion() always answers), so the versions extension is built and included unconditionally whenever this function runs at all -- there is no "no version to report" case the way there is for the other three optional facts. */
63
63
  getCcPeerVersion: (() => string | undefined) | undefined;
64
+ /** The addresses this side serves a relay at (agent-comms#342), undefined while it serves none. */
65
+ getRelayOffer: () => readonly string[] | undefined;
64
66
  }): void;
65
67
  /** Arms readvertiseGossip's own periodic tick, or does nothing at all when neither presence, hosted-rooms, nor self-agent-identity has a source -- WireMeshTransport's own constructor logic, split out here purely to keep that file under the repo's max-lines cap, the same reason mergeKnownDevices/findPresenceAdvert/readvertiseGossip above already live here rather than there. getCcPeerVersion never gates whether the interval starts at all (unlike the other three): it is only ever wired alongside getSelfAgentAdvert in real use (bridge-mesh.ts always supplies that one), so a construction site relying on getCcPeerVersion alone to start ticking isn't a real scenario worth its own branch. Unref'd immediately, matching every other timer this transport owns, so it never keeps the process alive on its own. */
66
68
  export declare function startGossipInterval(options: {
@@ -72,6 +74,7 @@ export declare function startGossipInterval(options: {
72
74
  getHostedRooms: (() => readonly HostedRoomAdvert[]) | undefined;
73
75
  getSelfAgentAdvert: (() => AgentSelfAdvert | undefined) | undefined;
74
76
  getCcPeerVersion: (() => string | undefined) | undefined;
77
+ getRelayOffer: () => readonly string[] | undefined;
75
78
  intervalMs: number;
76
79
  }): ReturnType<typeof setInterval> | undefined;
77
80
  //# 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;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;A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AAG,SAAS,CAAC,GAAG,SAAS,CAAC;IAChE,cAAc,EAAE,CAAC,MAAM,SAAS,gBAAgB,EAAE,CAAC,GAAG,SAAS,CAAC;IAChE,kBAAkB,EAAE,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACpE,mkBAAmkB;IACnkB,gBAAgB,EAAE,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACzD,mGAAmG;IACnG,aAAa,EAAE,MAAM,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CACpD,GAAG,IAAI,CAsDP;AAED,0yBAA0yB;AAC1yB,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IACxC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;IAC/C,oBAAoB,EAAE,MAAM,OAAO,CAAC;IACpC,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9C,kBAAkB,EAAE,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IAChE,cAAc,EAAE,CAAC,MAAM,SAAS,gBAAgB,EAAE,CAAC,GAAG,SAAS,CAAC;IAChE,kBAAkB,EAAE,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACpE,gBAAgB,EAAE,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACzD,aAAa,EAAE,MAAM,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IACnD,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,GAAG,SAAS,CAmC7C"}
@@ -2,6 +2,7 @@
2
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 { buildRelayOfferExtension } from "wire-mesh-core/domain/relay-advert";
5
6
  import { AgentStatus } from "./types.js";
6
7
  import { getOwnPackageVersion } from "./package-version.js";
7
8
  import { AGENT_SELF_GOSSIP_KEY, HOSTED_ROOMS_GOSSIP_KEY, PRESENCE_GOSSIP_KEY, summariseAgentSelfAdvert, summariseHostedRooms, } from "./gossip-extensions.js";
@@ -97,7 +98,7 @@ export function readNameClaim(advert, field) {
97
98
  }
98
99
  /** Re-sends this side's own current presence status, currently-hosted rooms, self-agent identity, and package versions, together, onto every live session's gossip self-advert -- one gossip frame per tick carrying whichever facts are actually known, rather than a separate frame per fact. Split out of wire-mesh-transport.ts's own WireMeshTransport class purely to keep that file under the repo's max-lines cap, the same reason mergeKnownDevices/findPresenceAdvert above already live here rather than there. A session that fails to send (mid-disconnect, most likely -- watchForDisconnect will independently notice and clean it up) is reported via onError and skipped, not allowed to stop the tick from reaching the rest of allSessions: a periodic broadcast to N peers is N independent operations, not one atomic unit. Unlike presence/hostedRooms/selfAgentAdvert, the versions extension is never actually absent (this side's own agent-comms package version is always known), so every tick this function is called for sends at least that one fact -- there is no "nothing to report" case left to short-circuit on. The hub's own session (agent-comms#156) is gated separately from every ordinary local-peer session in allSessions: local mesh trust is a different layer (connect_request/introduce approval already gated it before it ever joined allSessions), but the hub session is a broadcast to every connected hub peer, trusted or not, and would otherwise leak this side's own presence/hosted-rooms/self-agent/versions advert onto the hub regardless of GatewayTrust -- so this side's own advert waits on the same hasAny gate. It also waits for a visible agent (selfAgentAdvert is only ever defined for one): presence, hosted rooms and versions describe the agent and its process, so a hidden or unregistered store puts none of them on the hub, and a hidden agent is left with only the device advert every session opens with, which is what lets it be reached by device id. What the hub session does carry is reduced to what is safe to hand to strangers (presence, the agent's name, harness and membership proof, the public rooms it hosts by path and name, and the package versions): the hub relays it to every client that connects, so the working directory, process id, tags and rooms go only to peers this side is connected to directly (agent-comms#322). */
99
100
  export function readvertiseGossip(options) {
100
- const { allSessions, hub, hasAnyTrustedGateway, onError, getCurrentPresence, getHostedRooms, getSelfAgentAdvert, getCcPeerVersion, } = options;
101
+ const { allSessions, hub, hasAnyTrustedGateway, onError, getCurrentPresence, getHostedRooms, getSelfAgentAdvert, getCcPeerVersion, getRelayOffer, } = options;
101
102
  const status = getCurrentPresence?.();
102
103
  const selfAgentAdvert = getSelfAgentAdvert?.();
103
104
  const ccPeerVersion = getCcPeerVersion?.();
@@ -116,6 +117,13 @@ export function readvertiseGossip(options) {
116
117
  const hostedRooms = getHostedRooms?.();
117
118
  if (hostedRooms !== undefined)
118
119
  hubExtensions[HOSTED_ROOMS_GOSSIP_KEY] = summariseHostedRooms(hostedRooms);
120
+ // Offered to hub clients as well as peers, since a trusted device on another machine learns the offer through the hub; that exposes the relay's addresses to every hub client, part of the metadata a relay's operator accepts in serving one.
121
+ const relayOffer = getRelayOffer();
122
+ if (relayOffer !== undefined) {
123
+ for (const [key, value] of Object.entries(buildRelayOfferExtension(relayOffer))) {
124
+ hubExtensions[key] = value;
125
+ }
126
+ }
119
127
  const peerExtensions = { ...hubExtensions };
120
128
  if (hostedRooms !== undefined)
121
129
  peerExtensions[HOSTED_ROOMS_GOSSIP_KEY] = hostedRooms;
@@ -135,7 +143,7 @@ export function readvertiseGossip(options) {
135
143
  }
136
144
  /** Arms readvertiseGossip's own periodic tick, or does nothing at all when neither presence, hosted-rooms, nor self-agent-identity has a source -- WireMeshTransport's own constructor logic, split out here purely to keep that file under the repo's max-lines cap, the same reason mergeKnownDevices/findPresenceAdvert/readvertiseGossip above already live here rather than there. getCcPeerVersion never gates whether the interval starts at all (unlike the other three): it is only ever wired alongside getSelfAgentAdvert in real use (bridge-mesh.ts always supplies that one), so a construction site relying on getCcPeerVersion alone to start ticking isn't a real scenario worth its own branch. Unref'd immediately, matching every other timer this transport owns, so it never keeps the process alive on its own. */
137
145
  export function startGossipInterval(options) {
138
- const { allSessions, hub, hasAnyTrustedGateway, onError, getCurrentPresence, getHostedRooms, getSelfAgentAdvert, getCcPeerVersion, intervalMs, } = options;
146
+ const { allSessions, hub, hasAnyTrustedGateway, onError, getCurrentPresence, getHostedRooms, getSelfAgentAdvert, getCcPeerVersion, getRelayOffer, intervalMs, } = options;
139
147
  if (getCurrentPresence === undefined &&
140
148
  getHostedRooms === undefined &&
141
149
  getSelfAgentAdvert === undefined) {
@@ -151,6 +159,7 @@ export function startGossipInterval(options) {
151
159
  getHostedRooms,
152
160
  getSelfAgentAdvert,
153
161
  getCcPeerVersion,
162
+ getRelayOffer,
154
163
  });
155
164
  }, intervalMs);
156
165
  interval.unref();
@@ -1 +1 @@
1
- {"version":3,"file":"gossip-directory.js","sourceRoot":"","sources":["../../src/core/gossip-directory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAMhE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,GAGrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,8BAA8B,GAE/B,MAAM,oBAAoB,CAAC;AAG5B,8nBAA8nB;AAC9nB,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;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AAC,OAUnC;IACC,MAAM,EACJ,WAAW,EACX,GAAG,EACH,oBAAoB,EACpB,OAAO,EACP,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,GACX,GAAG,OAAO,CAAC;IACZ,IACE,kBAAkB,KAAK,SAAS;QAChC,cAAc,KAAK,SAAS;QAC5B,kBAAkB,KAAK,SAAS,EAChC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;QAChC,iBAAiB,CAAC;YAChB,WAAW;YACX,GAAG;YACH,oBAAoB;YACpB,OAAO;YACP,kBAAkB;YAClB,cAAc;YACd,kBAAkB;YAClB,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC,EAAE,UAAU,CAAC,CAAC;IACf,QAAQ,CAAC,KAAK,EAAE,CAAC;IACjB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
1
+ {"version":3,"file":"gossip-directory.js","sourceRoot":"","sources":["../../src/core/gossip-directory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAMhE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,GAGrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,8BAA8B,GAE/B,MAAM,oBAAoB,CAAC;AAG5B,8nBAA8nB;AAC9nB,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,CAA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,CAAC,EAAE,CAAC;YACzE,SAAS;QACX,CAAC;QACD,OAAO;aACJ,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC;aACzD,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YACxB,OAAO,EAAE,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACP,CAAC;AACH,CAAC;AAED,0yBAA0yB;AAC1yB,MAAM,UAAU,mBAAmB,CAAC,OAWnC;IACC,MAAM,EACJ,WAAW,EACX,GAAG,EACH,oBAAoB,EACpB,OAAO,EACP,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,UAAU,GACX,GAAG,OAAO,CAAC;IACZ,IACE,kBAAkB,KAAK,SAAS;QAChC,cAAc,KAAK,SAAS;QAC5B,kBAAkB,KAAK,SAAS,EAChC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;QAChC,iBAAiB,CAAC;YAChB,WAAW;YACX,GAAG;YACH,oBAAoB;YACpB,OAAO;YACP,kBAAkB;YAClB,cAAc;YACd,kBAAkB;YAClB,gBAAgB;YAChB,aAAa;SACd,CAAC,CAAC;IACL,CAAC,EAAE,UAAU,CAAC,CAAC;IACf,QAAQ,CAAC,KAAK,EAAE,CAAC;IACjB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * The domain-qualified gossip extension keys this package reads and writes on a peer's own gossiped advert, and the gossip-safe shapes two of them carry -- split out of wire-mesh-transport.ts (which writes them) so gossip-directory.ts, agent-registry.ts, room-lifecycle.ts, mesh-store.ts and hub-forwarding.ts (which read or merge them) no longer import their own vocabulary from the transport that depends on them, and to keep that file under the repo's max-lines cap. Also the shared home for the re-advertise cadence itself and the staleness window agent-registry.ts derives from it (agent-comms#301): both sides of "how fresh must a gossiped fact be to trust it" belong together, not split across the file that writes the cadence and the file that judges freshness against it.
3
3
  */
4
+ import type { Room } from "./types.js";
4
5
  export declare const PRESENCE_READVERTISE_INTERVAL_MS: number;
5
6
  /** Default staleness window agent-comms#301's own check uses: agent-registry.ts's caller may override it (MeshStoreOptions.presenceStaleAfterMs), but every real construction site gets this unless it deliberately asks for something else. */
6
7
  export declare const DEFAULT_PRESENCE_STALE_AFTER_MS: number;
@@ -15,6 +16,8 @@ export interface HostedRoomAdvert {
15
16
  type: "public" | "private";
16
17
  description: string;
17
18
  }
19
+ /** The rooms ownerId itself owns that are worth advertising, in the shape HostedRoomAdvert gives them: only its own public and private rooms. */
20
+ export declare function hostedRoomAdverts(rooms: ReadonlyMap<string, Room>, ownerId: string): HostedRoomAdvert[];
18
21
  /** What a hub is told about a room: where it is and what it is called, for a public room only. The description is left out because a project room's default one names the directory it was made for. */
19
22
  export type HostedRoomSummary = Pick<HostedRoomAdvert, "path" | "name" | "type">;
20
23
  /** A hosted-room advert as read off the wire: the summary always, the description only when the sender shared it. */
@@ -1 +1 @@
1
- {"version":3,"file":"gossip-extensions.d.ts","sourceRoot":"","sources":["../../src/core/gossip-extensions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,eAAO,MAAM,gCAAgC,QACU,CAAC;AAIxD,gPAAgP;AAChP,eAAO,MAAM,+BAA+B,QACoB,CAAC;AAEjE,8QAA8Q;AAC9Q,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD,mSAAmS;AACnS,eAAO,MAAM,uBAAuB,gBAAgB,CAAC;AAErD,+cAA+c;AAC/c,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC3B,WAAW,EAAE,M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X,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mRAAmR;IACnR,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0RAA0R;IAC1R,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wMAAwM;AACxM,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,gkBAAgkB;AAChkB,MAAM,WAAW,eAAgB,SAAQ,gBAAgB,EAAE,gBAAgB;CAAG;AAE9E,sHAAsH;AACtH,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,GACpD,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAE5B,mEAAmE;AACnE,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,GAChC,gBAAgB,CAelB"}
@@ -13,6 +13,23 @@ export const DEFAULT_PRESENCE_STALE_AFTER_MS = PRESENCE_READVERTISE_INTERVAL_MS
13
13
  export const PRESENCE_GOSSIP_KEY = "presence/status";
14
14
  /** The domain-qualified gossip extension key this transport writes this side's own currently-hosted public/private rooms under -- the write half of P3.8's room-discovery replacement for createRoom's own broadcastPatch (agent-comms#48). Same namespacing convention as PRESENCE_GOSSIP_KEY. */
15
15
  export const HOSTED_ROOMS_GOSSIP_KEY = "room/hosted";
16
+ /** The rooms ownerId itself owns that are worth advertising, in the shape HostedRoomAdvert gives them: only its own public and private rooms. */
17
+ export function hostedRoomAdverts(rooms, ownerId) {
18
+ const result = [];
19
+ for (const room of rooms.values()) {
20
+ if (room.owner !== ownerId)
21
+ continue;
22
+ if (room.type !== "public" && room.type !== "private")
23
+ continue;
24
+ result.push({
25
+ path: room.id,
26
+ name: room.name,
27
+ type: room.type,
28
+ description: room.description,
29
+ });
30
+ }
31
+ return result;
32
+ }
16
33
  /** The rooms that may be advertised through a hub: public ones, reduced to their summary. */
17
34
  export function summariseHostedRooms(rooms) {
18
35
  return rooms
@@ -1 +1 @@
1
- {"version":3,"file":"gossip-extensions.js","sourceRoot":"","sources":["../../src/core/gossip-extensions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B,mZAAmZ;AACnZ,MAAM,qCAAqC,GAAG,EAAE,CAAC;AACjD,MAAM,CAAC,MAAM,gCAAgC,GAC3C,qCAAqC,GAAG,aAAa,CAAC;AAExD,0zBAA0zB;AAC1zB,MAAM,2BAA2B,GAAG,CAAC,CAAC;AACtC,gPAAgP;AAChP,MAAM,CAAC,MAAM,+BAA+B,GAC1C,gCAAgC,GAAG,2BAA2B,CAAC;AAEjE,8QAA8Q;AAC9Q,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAErD,mSAAmS;AACnS,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAoBrD,6FAA6F;AAC7F,MAAM,UAAU,oBAAoB,CAClC,KAAkC;IAElC,OAAO,KAAK;SACT,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC;SACxC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,6RAA6R;AAC7R,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAgClD,mEAAmE;AACnE,MAAM,UAAU,wBAAwB,CACtC,MAAiC;IAEjC,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,GAAG,CAAC,MAAM,CAAC,UAAU,KAAK,SAAS;YACjC,CAAC,CAAC,EAAE,UAAU,EA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,MAAM,CAAC,WAAW,EAAE;YACrC,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,MAAM,CAAC,aAAa,KAAK,SAAS;YACpC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE;YACzC,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * The store decides through shouldConnect whether it wants a session at all, and a change of mind, made in this process or by another one editing the shared trust file, is picked up within a poll interval, or at once through reconsider(). A store with nothing to say to another machine (nothing trusted, no agent, or a ghost agent) holds no session, so it puts nothing on the hub, not even its device id.
5
5
  *
6
+ * Which hub is dialled is chosen afresh before every dial (agent-comms#342): the hub is a set of relays, ranked by relay-selection.ts, with the configured public hub as the fallback. A dial that fails, or a session the relay drops, excludes that URL from selection for the redial ceiling (the cadence an unreachable hub is retried at anyway), so a relay that has gone falls through to the next choice instead of being redialled on every pass; and a session held over one relay is moved as soon as selection prefers another.
7
+ *
6
8
  * The dial never blocks the caller: a bridge starting up offline must not wait out a connect timeout before it can serve its tools, and a hub that is down or restarting is an ordinary, recoverable state. Failures reach onError and the loop carries on.
7
9
  */
8
10
  import type { HubSession } from "./hub-session.js";
@@ -16,12 +18,14 @@ export declare const HUB_LINK_POLL_INTERVAL_MS = 5000;
16
18
  export type HubLinkSession = Pick<HubSession, "connect" | "disconnect" | "isConnected" | "whenDisconnected">;
17
19
  export interface HubLinkOptions {
18
20
  hub: Readonly<HubLinkSession>;
19
- /** The hub to hold a session on. */
20
- url: string;
21
+ /** The hub to hold a session on next, given the URLs whose last dial or session failed. Read before every dial and every poll interval while connected. */
22
+ selectUrl: (excluded: ReadonlySet<string>) => string;
21
23
  /** Whether the store wants a hub session right now. Read every poll interval and on reconsider(); a session held when this turns false is dropped, and none is dialled while it is false. */
22
24
  shouldConnect: () => boolean;
23
- /** Called each time a session is established, after the dial resolves. WireMeshTransport uses it to advertise this store's presence at once instead of waiting for the next presence tick. */
24
- onConnected: () => void;
25
+ /** Called each time a session is established, after the dial resolves, with the URL it was established to. WireMeshTransport uses it to advertise this store's presence at once instead of waiting for the next presence tick, and to know whether it holds an uplink to the public hub. */
26
+ onConnected: (url: string) => void;
27
+ /** Called each time an established session ends, whoever ended it. */
28
+ onDisconnected: () => void;
25
29
  /** Reports a failed dial. Never called for anything else. */
26
30
  onError: (error: Error) => void;
27
31
  /** Overrides HUB_RECONNECT_INITIAL_DELAY_MS, for a test that must not wait a second per redial. */
@@ -40,6 +44,8 @@ export declare class HubLink {
40
44
  private running;
41
45
  /** Cancels the wait between dials, so stop() does not sit out a delay. */
42
46
  private wake;
47
+ /** When each URL's last dial failed or its session was dropped by the far end (epoch ms); a successful dial to a URL clears its entry. */
48
+ private readonly failedAt;
43
49
  constructor(options: Readonly<HubLinkOptions>);
44
50
  /** Begins running in the background and returns at once. A second call while running does nothing. */
45
51
  start(): void;
@@ -50,8 +56,10 @@ export declare class HubLink {
50
56
  /** A method call rather than a direct property read, so TypeScript's control-flow narrowing does not treat the flag as staying false across the awaits in run(), during which stop() can set it. */
51
57
  private isStopped;
52
58
  private run;
53
- /** Holds the live session until the hub ends it, resolving true, or until the store stops wanting it, when it drops the session itself and resolves false. */
59
+ /** Holds the live session to url until the hub ends it, resolving true, or until the store stops wanting it or selection prefers another hub, when it drops the session itself and resolves false. */
54
60
  private holdWhileWanted;
61
+ /** The URLs that failed within the last redial ceiling. */
62
+ private excludedUrls;
55
63
  /** Waits ms, or until reconsider() or stop() cuts it short. Each wait clears the wake handle only if it is still its own, since holdWhileWanted leaves a losing wait pending and its late end must not wipe the handle of the wait that replaced it. */
56
64
  private sleep;
57
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"hub-link.d.ts","sourceRoot":"","sources":["../../src/core/hub-link.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,2EAA2E;AAC3E,eAAO,MAAM,8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AQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAA4B;IAC3C,0EAA0E;IAC1E,OAAO,CAAC,IAAI,CAA2B;IACvC,0IAA0I;IAC1I,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;gBAEzB,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC;IAO9D,sGAAsG;IACtG,KAAK,IAAI,IAAI;IAKb,wLAAwL;IACxL,UAAU,IAAI,IAAI;IAIlB,2EAA2E;IACrE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAO3B,oMAAoM;IACpM,OAAO,CAAC,SAAS;YAIH,GAAG;IAmCjB,sMAAsM;YACxL,eAAe;IAsB7B,2DAA2D;IAC3D,OAAO,CAAC,YAAY;IAUpB,wPAAwP;YAC1O,KAAK;CAapB"}
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * The store decides through shouldConnect whether it wants a session at all, and a change of mind, made in this process or by another one editing the shared trust file, is picked up within a poll interval, or at once through reconsider(). A store with nothing to say to another machine (nothing trusted, no agent, or a ghost agent) holds no session, so it puts nothing on the hub, not even its device id.
5
5
  *
6
+ * Which hub is dialled is chosen afresh before every dial (agent-comms#342): the hub is a set of relays, ranked by relay-selection.ts, with the configured public hub as the fallback. A dial that fails, or a session the relay drops, excludes that URL from selection for the redial ceiling (the cadence an unreachable hub is retried at anyway), so a relay that has gone falls through to the next choice instead of being redialled on every pass; and a session held over one relay is moved as soon as selection prefers another.
7
+ *
6
8
  * The dial never blocks the caller: a bridge starting up offline must not wait out a connect timeout before it can serve its tools, and a hub that is down or restarting is an ordinary, recoverable state. Failures reach onError and the loop carries on.
7
9
  */
8
10
  /** Delay before the first redial after a failed dial or a lost session. */
@@ -22,6 +24,8 @@ export class HubLink {
22
24
  running;
23
25
  /** Cancels the wait between dials, so stop() does not sit out a delay. */
24
26
  wake;
27
+ /** When each URL's last dial failed or its session was dropped by the far end (epoch ms); a successful dial to a URL clears its entry. */
28
+ failedAt = new Map();
25
29
  constructor(options) {
26
30
  this.options = options;
27
31
  this.initialDelayMs =
@@ -58,18 +62,23 @@ export class HubLink {
58
62
  continue;
59
63
  }
60
64
  let sessionEnded = false;
65
+ const url = this.options.selectUrl(this.excludedUrls());
61
66
  try {
62
- await this.options.hub.connect(this.options.url);
67
+ await this.options.hub.connect(url);
63
68
  if (this.options.hub.isConnected) {
64
69
  delayMs = this.initialDelayMs;
65
- this.options.onConnected();
66
- sessionEnded = await this.holdWhileWanted();
70
+ this.failedAt.delete(url);
71
+ this.options.onConnected(url);
72
+ sessionEnded = await this.holdWhileWanted(url);
73
+ this.options.onDisconnected();
67
74
  }
68
75
  }
69
76
  catch (error) {
70
77
  this.options.onError(error instanceof Error ? error : new Error(String(error)));
71
78
  sessionEnded = true;
72
79
  }
80
+ if (sessionEnded)
81
+ this.failedAt.set(url, Date.now());
73
82
  if (this.isStopped())
74
83
  return;
75
84
  if (!sessionEnded)
@@ -78,8 +87,8 @@ export class HubLink {
78
87
  delayMs = Math.min(delayMs * RECONNECT_DELAY_GROWTH_FACTOR, this.maxDelayMs);
79
88
  }
80
89
  }
81
- /** Holds the live session until the hub ends it, resolving true, or until the store stops wanting it, when it drops the session itself and resolves false. */
82
- async holdWhileWanted() {
90
+ /** Holds the live session to url until the hub ends it, resolving true, or until the store stops wanting it or selection prefers another hub, when it drops the session itself and resolves false. */
91
+ async holdWhileWanted(url) {
83
92
  const hubEnded = this.options.hub
84
93
  .whenDisconnected()
85
94
  .then(() => "ended");
@@ -92,13 +101,26 @@ export class HubLink {
92
101
  return true;
93
102
  if (this.isStopped())
94
103
  return false;
95
- if (!this.options.shouldConnect()) {
104
+ if (!this.options.shouldConnect() ||
105
+ this.options.selectUrl(this.excludedUrls()) !== url) {
96
106
  await this.options.hub.disconnect();
97
107
  return false;
98
108
  }
99
109
  }
100
110
  return false;
101
111
  }
112
+ /** The URLs that failed within the last redial ceiling. */
113
+ excludedUrls() {
114
+ const cutoff = Date.now() - this.maxDelayMs;
115
+ const excluded = new Set();
116
+ for (const [url, at] of this.failedAt) {
117
+ if (at > cutoff)
118
+ excluded.add(url);
119
+ else
120
+ this.failedAt.delete(url);
121
+ }
122
+ return excluded;
123
+ }
102
124
  /** Waits ms, or until reconsider() or stop() cuts it short. Each wait clears the wake handle only if it is still its own, since holdWhileWanted leaves a losing wait pending and its late end must not wipe the handle of the wait that replaced it. */
103
125
  async sleep(ms) {
104
126
  let wakeThis;
@@ -1 +1 @@
1
- {"version":3,"file":"hub-link.js","sourceRoot":"","sources":["../../src/core/hub-link.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,CAAC;AAEnD,iKAAiK;AACjK,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEjD,2TAA2T;AAC3T,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAE9C,+DAA+D;AAC/D,MAAM,6BAA6B,GAAG,CAAC,CAAC;AA0BxC,MAAM,OAAO,OAAO;IASW;IARZ,cAAc,CAAS;IACvB,UAAU,CAAS;IACnB,cAAc,CAAS;IAChC,OAAO,GAAG,KAAK,CAAC;IAChB,OAAO,CAA4B;IAC3C,0EAA0E;IAClE,IAAI,CAA2B;IAEvC,YAA6B,OAAiC;QAAjC,YAAO,GAAP,OAAO,CAA0B;QAC5D,IAAI,CAAC,cAAc;YACjB,OAAO,CAAC,cAAc,IAAI,8BAA8B,CAAC;QAC3D,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,0BAA0B,CAAC;QACnE,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,yBAAyB,CAAC;IAC5E,CAAC;IAED,sGAAsG;IACtG,KAAK;QACH,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO;YAA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AAC;gBACpB,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC;YACF,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACvB,CAAC,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;YAAE,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IACpD,CAAC;CACF"}
@@ -7,6 +7,7 @@ import type { IdentityPort } from "wire-mesh-core/ports/identity";
7
7
  import type { Connection } from "wire-mesh-core/ports/transport";
8
8
  import type { ConnectionHandle, MeshTraceResult, TransportEvents } from "./transport.js";
9
9
  import type { RoomRequestOrigin } from "./room-router.js";
10
+ import type { UplinkFeed } from "./relay-uplink.js";
10
11
  /** How long a room-domain request routed through the hub's relay-connect/relay-data pairing waits for a response before giving up. Unlike an ordinary local peer session, a relay-connect naming an unknown target-device is silently dropped by the hub (spec/relay-hub's own documented behaviour -- no error frame exists for "no such device"), so a request to a device that turns out not to be reachable via any gateway would otherwise hang forever rather than surfacing as a normal "not reachable" outcome. */
11
12
  export interface HubSessionDeps {
12
13
  /** How long a room.join sent through this session may await a human decision at the receiving end -- see manageRequestTimeoutMs. */
@@ -36,6 +37,10 @@ export interface HubSessionDeps {
36
37
  export declare class HubSession {
37
38
  private readonly deps;
38
39
  private session;
40
+ /** The connection the held session runs over, which a relay served by this store takes as its uplink. */
41
+ private connection;
42
+ /** Where the frames read from the hub are also fed while a relay served by this store has taken the session's connection as its uplink. */
43
+ private uplink;
39
44
  /** The URL this side itself dialled to reach the hub -- tracePath's own local.hubAddress (agent-comms#199), the equivalent of wire-mesh-core's own TracePathOptions.localHubAddress. */
40
45
  private url;
41
46
  private readonly hubPeersKnown;
@@ -52,6 +57,12 @@ export declare class HubSession {
52
57
  whenDisconnected(): Promise<void>;
53
58
  /** Forgets the held session and releases everyone waiting in whenDisconnected(). */
54
59
  private clearSession;
60
+ /** Lets a relay this store serves take the held session's connection as its uplink: attach receives the connection and returns the feed this session then hands every frame it reads from the hub, so the relay carries its clients over the same connection the session uses. Returns whether a session was held to attach to. The uplink ends with the session, or when detachUplink is called. */
61
+ attachUplink(attach: (connection: Readonly<Connection>) => UplinkFeed): boolean;
62
+ /** Whether a relay currently has this session's connection as its uplink. */
63
+ get hasUplink(): boolean;
64
+ /** Ends the uplink taken from this session, if any. The session itself is untouched. */
65
+ detachUplink(): void;
55
66
  /** Drops the held hub connection. A no-op if none is live (connect() was never called, disconnect() already ran, or the hub itself already closed the session). */
56
67
  disconnect(): Promise<void>;
57
68
  /** The device ids (hex) of peers discovered through the hub's gossiped directory. */
@@ -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,EACxB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EACnB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,KAAK,EACL,aAAa,EACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAI1D,2fAA2f;AAE3f,MAAM,WAAW,cAAc;IAC7B,oIAAoI;IACpI,yBAAyB,EAAE,MAAM,CAAC;IAClC,yDAAyD;IACzD,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAClC,yHAAyH;IACzH,cAAc,EAAE,MAAM,OAAO,CAAC;IAC9B,wEAAwE;IACxE,mBAAmB,EAAE,SAAS,MAAM,EAAE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I,SAAS,IAAI,OAAO,CAEvB;IAED,wFAAwF;IACxF,YAAY,IAAI,IAAI;IAKpB,mKAAmK;IAC7J,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOjC,qFAAqF;IACrF,KAAK,IAAI,SAAS,MAAM,EAAE;IAI1B,wGAAwG;IAClG,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCzC;;;;;;OAMG;YACW,aAAa;IAuB3B,msBAAmsB;IACnsB,OAAO,CAAC,OAAO;IAgBf,6iBAA6iB;IACviB,eAAe,CACnB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC,EAChC,KAAK,CAAC,EAAE,eAAe,GACtB,OAAO,CAAC,aAAa,CAAC;IAczB,0kBAA0kB;IACpkB,SAAS,CACb,aAAa,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,eAAe,CAAC;CAiB5B;AAUD,2JAA2J;AAC3J,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,cAAc,EACd,WAAW,GAAG,mBAAmB,CAClC,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE;IAChD,OAAO,EAAE,qBAAqB,CAAC;IAC/B,IAAI,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IACvC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhB"}
@@ -10,6 +10,10 @@ import { DOMAIN, FRAME_VERB } from "./wire-mesh-transport.js";
10
10
  export class HubSession {
11
11
  deps;
12
12
  session;
13
+ /** The connection the held session runs over, which a relay served by this store takes as its uplink. */
14
+ connection;
15
+ /** Where the frames read from the hub are also fed while a relay served by this store has taken the session's connection as its uplink. */
16
+ uplink;
13
17
  /** The URL this side itself dialled to reach the hub -- tracePath's own local.hubAddress (agent-comms#199), the equivalent of wire-mesh-core's own TracePathOptions.localHubAddress. */
14
18
  url;
15
19
  hubPeersKnown = new Set();
@@ -43,11 +47,30 @@ export class HubSession {
43
47
  clearSession() {
44
48
  if (this.session !== undefined)
45
49
  this.deps.untrack(this.session);
50
+ this.detachUplink();
46
51
  this.session = undefined;
52
+ this.connection = undefined;
47
53
  this.url = undefined;
48
54
  for (const resolve of this.disconnectWaiters.splice(0))
49
55
  resolve();
50
56
  }
57
+ /** Lets a relay this store serves take the held session's connection as its uplink: attach receives the connection and returns the feed this session then hands every frame it reads from the hub, so the relay carries its clients over the same connection the session uses. Returns whether a session was held to attach to. The uplink ends with the session, or when detachUplink is called. */
58
+ attachUplink(attach) {
59
+ if (this.connection === undefined)
60
+ return false;
61
+ this.detachUplink();
62
+ this.uplink = attach(this.connection);
63
+ return true;
64
+ }
65
+ /** Whether a relay currently has this session's connection as its uplink. */
66
+ get hasUplink() {
67
+ return this.uplink !== undefined;
68
+ }
69
+ /** Ends the uplink taken from this session, if any. The session itself is untouched. */
70
+ detachUplink() {
71
+ this.uplink?.end();
72
+ this.uplink = undefined;
73
+ }
51
74
  /** Drops the held hub connection. A no-op if none is live (connect() was never called, disconnect() already ran, or the hub itself already closed the session). */
52
75
  async disconnect() {
53
76
  const session = this.session;
@@ -69,7 +92,10 @@ export class HubSession {
69
92
  }
70
93
  const identity = await this.deps.identityReady;
71
94
  const session = await acceptMeshSession(connection, identity, [DOMAIN], {
72
- onFrame: async (conn, frame) => this.deps.onFrame(conn, frame),
95
+ onFrame: async (conn, frame) => {
96
+ this.uplink?.feed(frame);
97
+ await this.deps.onFrame(conn, frame);
98
+ },
73
99
  addresses: [...this.deps.advertisedAddresses],
74
100
  });
75
101
  if (this.deps.isShuttingDown()) {
@@ -77,6 +103,7 @@ export class HubSession {
77
103
  return;
78
104
  }
79
105
  this.session = session;
106
+ this.connection = connection;
80
107
  this.url = url;
81
108
  this.deps.trackForShutdown(session);
82
109
  void this.consumeEvents(session, deviceIdToHex(identity.deviceId)).catch((error) => {
@@ -1 +1 @@
1
- {"version":3,"file":"hub-session.js","sourceRoot":"","sources":["../../src/core/hub-session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,GAKlB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAc9E,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAuC9D,MAAM,OAAO,UAAU;IAQQ;IAPrB,OAAO,CAAkC;IACjD,wLAAwL;IAChL,GAAG,CAAqB;IACf,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;IACnD,4FAA4F;IAC3E,iBAAiB,GAAmB,EAAE,CAAC;IAExD,YAA6B,IAA8B;QAA9B,SAAI,GAAJ,IAAI,CAA0B;IAAG,CAAC;IAE/D,wFAAwF;IACxF,KAAK,CAAC,YAAY;QAChB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;QAC/C,OAAO,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,kOAAkO;IAClO,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC;IACpC,CAAC;IAED,kVAAkV;IAClV,WAAW,CAAC,OAAyB;QACnC,OAAO,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC;IAClC,CAAC;IAED,+MAA+M;IAC/M,KAAK,CAAC,gBAAgB;QACpB,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS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;QAC1B,OAAO;IACT,CAAC;IAED,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACrC,MAAM,OAAO;aACV,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;aAClD,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,MAAM,SAAS,GAAG,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACpD,MAAM,MAAM,GAA+B,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;IAE7D,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;QAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAEtD,MAAM,IAAI,CAAC,iBAAiB,CAC1B,OAAO,EACP,MAAM,EACN,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAChE,CAAC;AACJ,CAAC"}
@@ -19,7 +19,7 @@ import type { DeviceId } from "wire-mesh-core/generated/protocol";
19
19
  import { type AccountLedgerReplica } from "./account-ledger.js";
20
20
  import { type CoordinatorClaimView } from "./coordinator-role.js";
21
21
  import type { RoomVerbHandler } from "./room-router.js";
22
- import type { AgentSelfAdvert, HostedRoomAdvert } from "./gossip-extensions.js";
22
+ import { type AgentSelfAdvert, type HostedRoomAdvert } from "./gossip-extensions.js";
23
23
  import { AccountJoin } from "./account-join.js";
24
24
  import type { MeshStatePatch, SerialisedState } from "./wire-protocol.js";
25
25
  import type { ListenerInfo, MeshGraph, MeshTraceResult, MeshTransport, TransportEvents } from "./transport.js";