agent-comms 8.9.4 → 8.10.1

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 (64) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +2 -2
  4. package/dist/bridges/claude-code/channel.d.ts +2 -1
  5. package/dist/bridges/claude-code/channel.d.ts.map +1 -1
  6. package/dist/bridges/claude-code/channel.js +3 -3
  7. package/dist/bridges/claude-code/channel.js.map +1 -1
  8. package/dist/bridges/mcp/server.d.ts +2 -10
  9. package/dist/bridges/mcp/server.d.ts.map +1 -1
  10. package/dist/bridges/mcp/server.js.map +1 -1
  11. package/dist/bridges/registry.d.ts +3 -1
  12. package/dist/bridges/registry.d.ts.map +1 -1
  13. package/dist/bridges/registry.js.map +1 -1
  14. package/dist/cli-main.d.ts +37 -0
  15. package/dist/cli-main.d.ts.map +1 -0
  16. package/dist/cli-main.js +511 -0
  17. package/dist/cli-main.js.map +1 -0
  18. package/dist/cli.d.ts +1 -22
  19. package/dist/cli.d.ts.map +1 -1
  20. package/dist/cli.js +6 -506
  21. package/dist/cli.js.map +1 -1
  22. package/dist/core/bridge-mesh.d.ts +7 -0
  23. package/dist/core/bridge-mesh.d.ts.map +1 -1
  24. package/dist/core/bridge-mesh.js.map +1 -1
  25. package/dist/core/data-frame-routing.d.ts +28 -2
  26. package/dist/core/data-frame-routing.d.ts.map +1 -1
  27. package/dist/core/data-frame-routing.js +75 -4
  28. package/dist/core/data-frame-routing.js.map +1 -1
  29. package/dist/core/hub-session.d.ts +7 -1
  30. package/dist/core/hub-session.d.ts.map +1 -1
  31. package/dist/core/hub-session.js +25 -0
  32. package/dist/core/hub-session.js.map +1 -1
  33. package/dist/core/index.d.ts +1 -1
  34. package/dist/core/index.d.ts.map +1 -1
  35. package/dist/core/index.js.map +1 -1
  36. package/dist/core/wire-mesh-transport.d.ts +0 -1
  37. package/dist/core/wire-mesh-transport.d.ts.map +1 -1
  38. package/dist/core/wire-mesh-transport.js +3 -2
  39. package/dist/core/wire-mesh-transport.js.map +1 -1
  40. package/dist/test/account-ledger-helpers.d.ts +35 -0
  41. package/dist/test/account-ledger-helpers.d.ts.map +1 -0
  42. package/dist/test/account-ledger-helpers.js +81 -0
  43. package/dist/test/account-ledger-helpers.js.map +1 -0
  44. package/dist/test/account-ledger-hub-replication.integration.test.d.ts +5 -0
  45. package/dist/test/account-ledger-hub-replication.integration.test.d.ts.map +1 -0
  46. package/dist/test/account-ledger-hub-replication.integration.test.js +100 -0
  47. package/dist/test/account-ledger-hub-replication.integration.test.js.map +1 -0
  48. package/dist/test/account-ledger-replication.integration.test.js +4 -66
  49. package/dist/test/account-ledger-replication.integration.test.js.map +1 -1
  50. package/dist/test/bridge-stdout.runner.d.ts +5 -0
  51. package/dist/test/bridge-stdout.runner.d.ts.map +1 -0
  52. package/dist/test/bridge-stdout.runner.js +49 -0
  53. package/dist/test/bridge-stdout.runner.js.map +1 -0
  54. package/dist/test/data-frame-routing.unit.test.d.ts +5 -0
  55. package/dist/test/data-frame-routing.unit.test.d.ts.map +1 -0
  56. package/dist/test/data-frame-routing.unit.test.js +79 -0
  57. package/dist/test/data-frame-routing.unit.test.js.map +1 -0
  58. package/dist/test/mcp-stdout-channel.integration.test.js +9 -3
  59. package/dist/test/mcp-stdout-channel.integration.test.js.map +1 -1
  60. package/package.json +1 -1
  61. package/dist/test/mcp-bridge.runner.d.ts +0 -5
  62. package/dist/test/mcp-bridge.runner.d.ts.map +0 -1
  63. package/dist/test/mcp-bridge.runner.js +0 -25
  64. package/dist/test/mcp-bridge.runner.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * WireMeshTransport's own core/data frame dispatch (data-have, data-request, data-entries), split out under the repo's max-lines cap the same way gossip-directory.ts and hub-forwarding.ts were each split from the same owning file.
3
3
  */
4
+ import type { DataDomainFrame } from "wire-mesh-core/domain/mesh-session";
4
5
  import type { DataHaveFrame, DataRequestFrame, Frame } from "wire-mesh-core/generated/protocol";
5
6
  import type { Connection } from "wire-mesh-core/ports/transport";
6
7
  import type { KeyValueStorage } from "wire-mesh-core/ports/storage";
@@ -15,6 +16,18 @@ export interface AccountReplication {
15
16
  /** Whether the peer whose session authenticated it as `deviceHex` holds the same account. Only such a peer is offered the ledger or answered for it, so a device of another account never stores the ciphertext or follows its head. */
16
17
  isAccountPeer: (deviceHex: string) => Promise<boolean>;
17
18
  }
19
+ /** How core/data frames reach a device that this side meets only through the relay hub, over a relay pairing sealed end to end between the two devices: the hub carries ciphertext and never sees a frame. */
20
+ export interface HubDataChannel {
21
+ /** The devices (hex) the hub's gossiped directory has admitted, whether or not this side also has a direct session to them. */
22
+ peers: () => readonly string[];
23
+ /** Sends one frame to `deviceHex` through the hub. Rejects when no hub session is live. */
24
+ send: (deviceHex: string, frame: DataDomainFrame) => Promise<void>;
25
+ }
26
+ /** The hub data channel over whatever hub session `hub()` currently returns, read on each call because the router is built before the hub it talks through. */
27
+ export declare function hubDataChannel(hub: () => {
28
+ peers: () => readonly string[];
29
+ sendDataFrame: (deviceHex: string, frame: Readonly<DataDomainFrame>) => Promise<void>;
30
+ }): HubDataChannel;
18
31
  /** Builds the router's account replication from the transport option: a peer is an account peer when the membership proof in its gossiped advert (looked up through `advertOf`) verifies against this machine's own principal. Undefined when the transport has no account ledger. */
19
32
  export declare function accountReplicationFrom(options: Readonly<WireMeshTransportOptions>["accountReplication"], advertOf: (deviceHex: string) => Readonly<Record<string, unknown>> | undefined): AccountReplication | undefined;
20
33
  /** Routes one frame received on a raw data connection, tracking the connection against its peer's device-id along the way (connectionsByPeer, mutated in place) so a later data-have, data-request or data-entries send addressed to that same peer reuses it. Nothing further happens until the sender is a tracked peer session. A frame naming one of the account's writer logs goes to the account ledger when the sender holds the same account and is dropped otherwise, without reaching dataStorage either way; any other data frame goes to wire-mesh-core's own core/data handlers over dataStorage, and is dropped when this side has no dataStorage. Any handler error is reported via onError and swallowed, never thrown, since this runs inside the transport's own onFrame callback with no caller awaiting it directly. */
@@ -25,10 +38,17 @@ export declare function routeDataFrame(deps: Readonly<{
25
38
  peerSessions: ReadonlyMap<string, unknown>;
26
39
  onError: ((error: Error) => void) | undefined;
27
40
  }>, connection: Readonly<Connection>, frame: Frame): Promise<void>;
28
- /** Offers every account writer log this machine holds to every peer it has a live, trusted data connection with that holds the same account (agent-comms#344): such a peer that is behind asks for what it is missing, which is the data-domain fan-out that carries each machine's grants and revocations to every other. Called on the gossip cadence, so a machine that was away when an entry was written still catches up the next time it is connected. A send that fails is reported and the rest carry on; the next round retries it. */
41
+ /** Handles one core/data frame that arrived through a relay pairing, from the device the pairing's secure channel authenticated as `fromDeviceHex`. Only a frame naming one of the account's writer logs, from a device that holds the same account, is acted on, and any answer goes back through the same pairing; every other relayed data frame is dropped, since a device met only through the hub has no standing to read or write this side's other logs. Any handler error is reported via onError and swallowed, as in routeDataFrame. */
42
+ export declare function routeRelayedDataFrame(deps: Readonly<{
43
+ account: Readonly<AccountReplication> | undefined;
44
+ hub: Readonly<HubDataChannel> | undefined;
45
+ onError: ((error: Error) => void) | undefined;
46
+ }>, fromDeviceHex: string, frame: Readonly<DataDomainFrame>): Promise<void>;
47
+ /** Offers every account writer log this machine holds to every device that holds the same account and that this side can reach (agent-comms#344): over a live, trusted data connection, or, for a device it meets only through the relay hub, over a relay pairing. Such a device that is behind asks for what it is missing, which is the data-domain fan-out that carries each machine's grants and revocations to every other. A device reachable both ways is offered the logs once, directly. Called on the gossip cadence, so a machine that was away when an entry was written still catches up the next time it is reachable. A send that fails is reported and the rest carry on; the next round retries it. */
29
48
  export declare function announceAccountLedger(deps: Readonly<{
30
49
  connectionsByPeer: ReadonlyMap<string, Readonly<Connection>>;
31
50
  account: Readonly<AccountReplication>;
51
+ hub: Readonly<HubDataChannel> | undefined;
32
52
  peerSessions: ReadonlyMap<string, unknown>;
33
53
  onError: ((error: Error) => void) | undefined;
34
54
  }>): Promise<void>;
@@ -39,10 +59,12 @@ export interface DataFrameRouterDeps {
39
59
  /** The transport's own trusted sessions, keyed by device-id hex: the gate every data frame and every announcement passes. */
40
60
  peerSessions: ReadonlyMap<string, unknown>;
41
61
  onError: ((error: Error) => void) | undefined;
62
+ /** Absent for a transport that never dials a relay hub. */
63
+ hub: Readonly<HubDataChannel> | undefined;
42
64
  /** How often the account ledger is offered to peers: the transport's own re-advertise cadence. */
43
65
  announceIntervalMs: number;
44
66
  }
45
- /** WireMeshTransport's core/data state and dispatch, split out under the repo's max-lines cap: the connection each peer's frames arrive on, routing of every data frame received, the mechanical send primitive, and the periodic offer of the account ledger's writer logs. */
67
+ /** WireMeshTransport's core/data state and dispatch, split out under the repo's max-lines cap: the connection each peer's frames arrive on, routing of every data frame received, the mechanical send primitive, and the periodic offer of the account ledger's writer logs, and the same exchange with a device met only through the relay hub. */
46
68
  export declare class DataFrameRouter {
47
69
  private readonly deps;
48
70
  /** Backs this side's own responder for an incoming data-have, data-request or data-entries frame about any log other than the account ledger's (agent-comms#50's P5 integration). When undefined, such frames are dropped; the account ledger's are routed either way. For those logs, deciding when to proactively call sendDataFrame at all (the catch-up policy: which peers' logs to track, when to send an initial data-have) stays the caller's business and this field only backs the mechanical parts (answering a have or request, storing entries); the account ledger's own offers are the router's, sent every announceIntervalMs. */
@@ -50,9 +72,13 @@ export declare class DataFrameRouter {
50
72
  /** Every peer this side has ever received a frame from, keyed by device-id hex, tracking the raw wire-mesh-core Connection each frame arrived on: what sendDataFrame needs, since neither AcceptedMeshSession nor MeshSession exposes a generic "send an arbitrary frame" method the way the raw Connection itself does. Registered eagerly on the very first frame from a connection (including one still in quarantine, e.g. before connect_request approval) so a later sendDataFrame call can reach it; routeDataFrame's own trust gate (peerSessions.has) is what actually decides whether to act on anything received this way, not this map. */
51
73
  private readonly connectionsByPeer;
52
74
  private announceInterval;
75
+ /** Whether an announcement round is still running, so a round slowed by an unreachable hub peer is not stacked on by the next tick. */
76
+ private announcing;
53
77
  constructor(deps: Readonly<DataFrameRouterDeps>);
54
78
  /** See routeDataFrame. */
55
79
  route(connection: Readonly<Connection>, frame: Frame): Promise<void>;
80
+ /** See routeRelayedDataFrame. An arrow property, so the transport can hand it to the hub session as a callback. */
81
+ readonly routeRelayed: (fromDeviceHex: string, frame: Readonly<DataDomainFrame>) => Promise<void>;
56
82
  /** Sends one frame on the connection peerDeviceHex's frames last arrived on. Throws if none has arrived from it yet. */
57
83
  send(peerDeviceHex: string, frame: Readonly<DataHaveFrame> | Readonly<DataRequestFrame>): Promise<void>;
58
84
  /** Stops offering the account ledger. A router that never started offering it has no timer to clear. */
@@ -1 +1 @@
1
- {"version":3,"file":"data-frame-routing.d.ts","sourceRoot":"","sources":["../../src/core/data-frame-routing.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,KAAK,EACN,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAEjF,iNAAiN;AACjN,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,uFAAuF;AACvF,MAAM,WAAW,kBAAkB;IACjC,wMAAwM;IACxM,MAAM,EAAE,MAAM,oBAAoB,GAAG,SAAS,CAAC;IAC/C,wOAAwO;IACxO,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxD;AAED,sRAAsR;AACtR,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAC,oBAAoB,CAAC,EACjE,QAAQ,EAAE,CACR,SAAS,EAAE,MAAM,KACd,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OA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ClD,6HAA6H;IAC7H,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9C,2DAA2D;IAC3D,GAAG,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAC1C,kGAAkG;IAClG,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,oVAAoV;AACpV,qBAAa,eAAe;IAYd,OAAO,CAAC,QAAQ,CAAC,IAAI;IAXjC,knBAAknB;IAClnB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;IAE1D,unBAAunB;IACvnB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAiC;IAEnE,OAAO,CAAC,gBAAgB,CAA6C;IAErE,uIAAuI;IACvI,OAAO,CAAC,UAAU,CAAS;gBAEE,IAAI,EAAE,QAAQ,CAAC,mBAAmB,CAAC;IA0BhE,0BAA0B;IACpB,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAc1E,mHAAmH;IACnH,QAAQ,CAAC,YAAY,GACnB,eAAe,MAAM,EACrB,OAAO,QAAQ,CAAC,eAAe,CAAC,KAC/B,OAAO,CAAC,IAAI,CAAC,CAUd;IAEF,wHAAwH;IAClH,IAAI,CACR,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,GAC1D,OAAO,CAAC,IAAI,CAAC;IAUhB,wGAAwG;IACxG,IAAI,IAAI,IAAI;CAKb"}
@@ -7,6 +7,13 @@ import { isDataFrame } from "wire-mesh-core/domain/hub-mailbox";
7
7
  import { readMembershipProof } from "./gossip-directory.js";
8
8
  /** The most entries one data-entries reply carries, for every log this side answers for, the account ledger's included: a longer log catches up over several rounds, so the bound only caps one frame's size. */
9
9
  export const DATA_ENTRIES_RESPONSE_LIMIT = 100;
10
+ /** The hub data channel over whatever hub session `hub()` currently returns, read on each call because the router is built before the hub it talks through. */
11
+ export function hubDataChannel(hub) {
12
+ return {
13
+ peers: () => hub().peers(),
14
+ send: async (deviceHex, frame) => hub().sendDataFrame(deviceHex, frame),
15
+ };
16
+ }
10
17
  /** Builds the router's account replication from the transport option: a peer is an account peer when the membership proof in its gossiped advert (looked up through `advertOf`) verifies against this machine's own principal. Undefined when the transport has no account ledger. */
11
18
  export function accountReplicationFrom(options, advertOf) {
12
19
  if (options === undefined)
@@ -66,7 +73,26 @@ export async function routeDataFrame(deps, connection, frame) {
66
73
  deps.onError?.(error instanceof Error ? error : new Error(String(error)));
67
74
  }
68
75
  }
69
- /** Offers every account writer log this machine holds to every peer it has a live, trusted data connection with that holds the same account (agent-comms#344): such a peer that is behind asks for what it is missing, which is the data-domain fan-out that carries each machine's grants and revocations to every other. Called on the gossip cadence, so a machine that was away when an entry was written still catches up the next time it is connected. A send that fails is reported and the rest carry on; the next round retries it. */
76
+ /** Handles one core/data frame that arrived through a relay pairing, from the device the pairing's secure channel authenticated as `fromDeviceHex`. Only a frame naming one of the account's writer logs, from a device that holds the same account, is acted on, and any answer goes back through the same pairing; every other relayed data frame is dropped, since a device met only through the hub has no standing to read or write this side's other logs. Any handler error is reported via onError and swallowed, as in routeDataFrame. */
77
+ export async function routeRelayedDataFrame(deps, fromDeviceHex, frame) {
78
+ const { account, hub } = deps;
79
+ if (account === undefined || hub === undefined)
80
+ return;
81
+ try {
82
+ const ledger = account.ledger();
83
+ if (ledger?.ownsLog(frame.peer) !== true)
84
+ return;
85
+ if (!(await account.isAccountPeer(fromDeviceHex)))
86
+ return;
87
+ const reply = await ledger.handleDataFrame(frame);
88
+ if (reply !== null)
89
+ await hub.send(fromDeviceHex, reply);
90
+ }
91
+ catch (error) {
92
+ deps.onError?.(error instanceof Error ? error : new Error(String(error)));
93
+ }
94
+ }
95
+ /** Offers every account writer log this machine holds to every device that holds the same account and that this side can reach (agent-comms#344): over a live, trusted data connection, or, for a device it meets only through the relay hub, over a relay pairing. Such a device that is behind asks for what it is missing, which is the data-domain fan-out that carries each machine's grants and revocations to every other. A device reachable both ways is offered the logs once, directly. Called on the gossip cadence, so a machine that was away when an entry was written still catches up the next time it is reachable. A send that fails is reported and the rest carry on; the next round retries it. */
70
96
  export async function announceAccountLedger(deps) {
71
97
  const ledger = deps.account.ledger();
72
98
  if (ledger === undefined)
@@ -74,22 +100,49 @@ export async function announceAccountLedger(deps) {
74
100
  const frames = await ledger.announcements();
75
101
  if (frames.length === 0)
76
102
  return;
103
+ const reportError = (error) => {
104
+ deps.onError?.(error instanceof Error ? error : new Error(String(error)));
105
+ };
106
+ const direct = new Set();
107
+ const offers = [];
77
108
  for (const [deviceHex, connection] of deps.connectionsByPeer) {
78
109
  if (!deps.peerSessions.has(deviceHex))
79
110
  continue;
80
111
  if (!(await deps.account.isAccountPeer(deviceHex)))
81
112
  continue;
113
+ direct.add(deviceHex);
82
114
  for (const frame of frames) {
83
115
  try {
84
116
  await connection.send(frame);
85
117
  }
86
118
  catch (error) {
87
- deps.onError?.(error instanceof Error ? error : new Error(String(error)));
119
+ reportError(error);
88
120
  }
89
121
  }
90
122
  }
123
+ const { hub } = deps;
124
+ if (hub === undefined)
125
+ return;
126
+ for (const deviceHex of hub.peers()) {
127
+ if (direct.has(deviceHex))
128
+ continue;
129
+ if (!(await deps.account.isAccountPeer(deviceHex)))
130
+ continue;
131
+ // Each device is offered concurrently: a pairing to a device that is not there waits out its own handshake, which must not hold up the others.
132
+ offers.push((async () => {
133
+ for (const frame of frames) {
134
+ try {
135
+ await hub.send(deviceHex, frame);
136
+ }
137
+ catch (error) {
138
+ reportError(error);
139
+ }
140
+ }
141
+ })());
142
+ }
143
+ await Promise.all(offers);
91
144
  }
92
- /** WireMeshTransport's core/data state and dispatch, split out under the repo's max-lines cap: the connection each peer's frames arrive on, routing of every data frame received, the mechanical send primitive, and the periodic offer of the account ledger's writer logs. */
145
+ /** WireMeshTransport's core/data state and dispatch, split out under the repo's max-lines cap: the connection each peer's frames arrive on, routing of every data frame received, the mechanical send primitive, and the periodic offer of the account ledger's writer logs, and the same exchange with a device met only through the relay hub. */
93
146
  export class DataFrameRouter {
94
147
  deps;
95
148
  /** Backs this side's own responder for an incoming data-have, data-request or data-entries frame about any log other than the account ledger's (agent-comms#50's P5 integration). When undefined, such frames are dropped; the account ledger's are routed either way. For those logs, deciding when to proactively call sendDataFrame at all (the catch-up policy: which peers' logs to track, when to send an initial data-have) stays the caller's business and this field only backs the mechanical parts (answering a have or request, storing entries); the account ledger's own offers are the router's, sent every announceIntervalMs. */
@@ -97,6 +150,8 @@ export class DataFrameRouter {
97
150
  /** Every peer this side has ever received a frame from, keyed by device-id hex, tracking the raw wire-mesh-core Connection each frame arrived on: what sendDataFrame needs, since neither AcceptedMeshSession nor MeshSession exposes a generic "send an arbitrary frame" method the way the raw Connection itself does. Registered eagerly on the very first frame from a connection (including one still in quarantine, e.g. before connect_request approval) so a later sendDataFrame call can reach it; routeDataFrame's own trust gate (peerSessions.has) is what actually decides whether to act on anything received this way, not this map. */
98
151
  connectionsByPeer = new Map();
99
152
  announceInterval;
153
+ /** Whether an announcement round is still running, so a round slowed by an unreachable hub peer is not stacked on by the next tick. */
154
+ announcing = false;
100
155
  constructor(deps) {
101
156
  this.deps = deps;
102
157
  this.dataStorage = deps.dataStorage;
@@ -104,13 +159,21 @@ export class DataFrameRouter {
104
159
  if (account === undefined)
105
160
  return;
106
161
  this.announceInterval = setInterval(() => {
162
+ if (this.announcing)
163
+ return;
164
+ this.announcing = true;
107
165
  announceAccountLedger({
108
166
  connectionsByPeer: this.connectionsByPeer,
109
167
  account,
168
+ hub: deps.hub,
110
169
  peerSessions: deps.peerSessions,
111
170
  onError: deps.onError,
112
- }).catch((error) => {
171
+ })
172
+ .catch((error) => {
113
173
  deps.onError?.(error instanceof Error ? error : new Error(String(error)));
174
+ })
175
+ .finally(() => {
176
+ this.announcing = false;
114
177
  });
115
178
  }, deps.announceIntervalMs);
116
179
  this.announceInterval.unref();
@@ -125,6 +188,14 @@ export class DataFrameRouter {
125
188
  onError: this.deps.onError,
126
189
  }, connection, frame);
127
190
  }
191
+ /** See routeRelayedDataFrame. An arrow property, so the transport can hand it to the hub session as a callback. */
192
+ routeRelayed = async (fromDeviceHex, frame) => {
193
+ await routeRelayedDataFrame({
194
+ account: this.deps.account,
195
+ hub: this.deps.hub,
196
+ onError: this.deps.onError,
197
+ }, fromDeviceHex, frame);
198
+ };
128
199
  /** Sends one frame on the connection peerDeviceHex's frames last arrived on. Throws if none has arrived from it yet. */
129
200
  async send(peerDeviceHex, frame) {
130
201
  const connection = this.connectionsByPeer.get(peerDeviceHex);
@@ -1 +1 @@
1
- {"version":3,"file":"data-frame-routing.js","sourceRoot":"","sources":["../../src/core/data-frame-routing.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAShE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,iNAAiN;AACjN,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAU/C,sRAAsR;AACtR,MAAM,UAAU,sBAAsB,CACpC,OAAiE,EACjE,QAEkD;IAElD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5C,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,SAAS;QACzB,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;YACjC,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;YACnC,MAAM,KAAK,GACT,MAAM,KAAK,SAAS;gBAClB,CAAC,CAAC,SAAS;gBAC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B,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO;SAC3B,EACD,aAAa,EACb,KAAK,CACN,CAAC;IACJ,CAAC,CAAC;IAEF,wHAAwH;IACxH,KAAK,CAAC,IAAI,CACR,aAAqB,EACrB,KAA2D;QAE3D,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC7D,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CACb,kDAAkD,aAAa,EAAE,CAClE,CAAC;QACJ,CAAC;QACD,MAAM,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,wGAAwG;IACxG,IAAI;QACF,IAAI,IAAI,CAAC,gBAAgB,KAAK,SAAS;YAAE,OAAO;QAChD,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACrC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;IACpC,CAAC;CACF"}
@@ -1,7 +1,7 @@
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, type DirectoryEntry, type IncomingManageRequest, type ManageOutcome } from "wire-mesh-core/domain/mesh-session";
4
+ import { type AcceptedMeshSession, type DataDomainFrame, type DirectoryEntry, type IncomingManageRequest, type ManageOutcome } from "wire-mesh-core/domain/mesh-session";
5
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";
@@ -21,6 +21,8 @@ export interface HubSessionDeps {
21
21
  advertisedAddresses: readonly string[];
22
22
  /** Registers a frame observer + dispatch for raw frames arriving on the hub connection (the transport's own handleDataFrame path). */
23
23
  onFrame: (connection: Readonly<Connection>, frame: Readonly<Frame>) => void | Promise<void>;
24
+ /** Receives each core/data frame that arrived through a relay pairing, with the device (hex) the pairing's secure channel authenticated as its sender, never the one the hub stamps. Frames that arrived directly on the hub connection are the hub mailbox's, not a device's, and never reach it. */
25
+ onRelayedDataFrame: (fromDeviceHex: string, frame: Readonly<DataDomainFrame>) => Promise<void>;
24
26
  /** Tracks the session for shutdown -- every session the transport ever creates, always. */
25
27
  trackForShutdown: (session: AcceptedMeshSession) => void;
26
28
  /** Stops tracking a session that has ended, so a store that redials the hub for as long as it runs does not accumulate dead sessions the transport would keep gossiping to. */
@@ -79,6 +81,10 @@ export declare class HubSession {
79
81
  private consumeEvents;
80
82
  /** Consumes one hub session's inbound relayed manage-requests until it ends, dispatching each in arrival order to dispatchHubRequest -- see that function's own doc for the actual per-request trust decision. Split out purely so the decision itself is directly unit-testable against fake requests/deps (hub-session-dispatch.test.ts), the same reason hub-forwarding.ts's own routeRoomRequestViaHub is a standalone function rather than a private method. Passes this.url through as dispatchHubRequest's own hubAddress -- this side's own dialled address for the hub every request on this specific session arrived over (agent-comms#216), the answering-side equivalent of tracePath's own local.hubAddress above. */
81
83
  private consume;
84
+ /** Consumes one hub session's inbound core/data frames until it ends, handing each one that came through a relay pairing to onRelayedDataFrame in arrival order. A failure in the handler is reported and the loop carries on, since one bad frame must not stop every later one. */
85
+ private consumeDataFrames;
86
+ /** Sends one core/data frame to a specific hub-reachable device through a relay pairing, sealed end to end with that device. Rejects when no hub session is live. */
87
+ sendDataFrame(peerDeviceHex: string, frame: Readonly<DataDomainFrame>): Promise<void>;
82
88
  /** 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. */
83
89
  sendRoomRequest(peerDeviceHex: string, command: ManageCommand, scope: Readonly<CapabilityScope>, token?: CapabilityToken): Promise<ManageOutcome>;
84
90
  /** Sends path.trace to a specific hub-reachable peer, through the hub's relay-connect/relay-data pairing -- WireMeshTransport.meshTrace's own hub-relayed fallback (agent-comms#199), mirroring sendRoomRequest's own not_connected contract and HUB_ROOM_REQUEST_TIMEOUT_MS default for the identical reason (an unreachable target-device is silently dropped by the hub, not answered with an error). Delegates the actual send/RTT-measurement/response-parsing to wire-mesh-core's own tracePath, reporting this.url (the address this side itself dialled to reach the hub) as local.hubAddress. */
@@ -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;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,2fAA2f;AAE3f,MAAM,WAAW,cAAc;IAC7B,oIAAoI;IACpI,y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;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"}
@@ -111,6 +111,7 @@ export class HubSession {
111
111
  this.deps.events.onError?.(error instanceof Error ? error : new Error(String(error)));
112
112
  });
113
113
  this.consume(session);
114
+ this.consumeDataFrames(session);
114
115
  }
115
116
  /**
116
117
  * The single consumer of one hub session's own event stream: merges the hub's directory (its catch-up arrives as the first event, and it is refreshed on every subsequent one) and, once the session ends, drops the held connection so isConnected answers honestly.
@@ -156,6 +157,30 @@ export class HubSession {
156
157
  }
157
158
  })();
158
159
  }
160
+ /** Consumes one hub session's inbound core/data frames until it ends, handing each one that came through a relay pairing to onRelayedDataFrame in arrival order. A failure in the handler is reported and the loop carries on, since one bad frame must not stop every later one. */
161
+ consumeDataFrames(session) {
162
+ void (async () => {
163
+ for await (const incoming of session.incomingDataFrames) {
164
+ if (this.deps.isShuttingDown())
165
+ break;
166
+ if (incoming.fromDevice === undefined)
167
+ continue;
168
+ await this.deps
169
+ .onRelayedDataFrame(deviceIdToHex(incoming.fromDevice), incoming.frame)
170
+ .catch((error) => {
171
+ this.deps.events.onError?.(error instanceof Error ? error : new Error(String(error)));
172
+ });
173
+ }
174
+ })();
175
+ }
176
+ /** Sends one core/data frame to a specific hub-reachable device through a relay pairing, sealed end to end with that device. Rejects when no hub session is live. */
177
+ async sendDataFrame(peerDeviceHex, frame) {
178
+ const session = this.session;
179
+ if (session === undefined) {
180
+ throw new Error("HubSession: no live hub session to send a data frame on");
181
+ }
182
+ await session.sendDataFrame(frame, hexToBytes(peerDeviceHex));
183
+ }
159
184
  /** 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. */
160
185
  async sendRoomRequest(peerDeviceHex, command, scope, token) {
161
186
  const session = this.session;
@@ -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;AAE5C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAuC9D,MAAM,OAAO,UAAU;IAYQ;IAXrB,OAAO,CAAkC;IACjD,yGAAyG;IACjG,UAAU,CAAmC;IACrD,2I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,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"}
@@ -11,7 +11,7 @@ export { CommsTool } from "./tool.js";
11
11
  export { createMeshErrorReporter, formatMeshError } from "./error-reporting.js";
12
12
  export { installShutdownSignalHandlers, type ShutdownDisposition, type ShutdownSignalOptions, } from "./shutdown-signals.js";
13
13
  export { createBridgeMesh, createBridgeMeshSync, createBridgeMeshFromIdentity, createBridgeMeshSyncFromIdentity, } from "./bridge-mesh.js";
14
- export type { BridgeMesh, BridgeMeshOptions, BridgeMeshSync, } from "./bridge-mesh.js";
14
+ export type { BridgeMesh, BridgeMeshOptions, BridgeMeshSync, BridgeRunOptions, } from "./bridge-mesh.js";
15
15
  export { loadIdentityForFront, probeSlotOwner, releaseIdentityLock, } from "./identity-store.js";
16
16
  export type { IdentitySlot } from "./identity-store.js";
17
17
  export type { CommsContext, CommsResult } from "./tool.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;A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;AACrE,cAAc,YAAY,CAAC"}
@@ -77,7 +77,6 @@ export declare class WireMeshTransport implements MeshTransport {
77
77
  private gossipOptions;
78
78
  /** Sends one data-have or data-request frame directly to an already-connected peer: the mechanical send primitive a future catch-up policy calls once it decides to (see DataFrameRouter's dataStorage doc comment). Throws if this side has never received any frame from that peer yet (there is no connection to send on), matching sendManageRequest's own "no reachable session" failure mode for an unknown peer. */
79
79
  sendDataFrame(peerDeviceHex: string, frame: Readonly<DataHaveFrame> | Readonly<DataRequestFrame>): Promise<void>;
80
- /** Registers (or refreshes) the raw connection a frame arrived on, then answers a data-have/data-request/data-entries frame in place, sending any resulting response frame back over the same connection -- every other frame type is ignored here (applyFrame's own dispatch already owns those). Trust-gated on peerSessions already tracking this device: a connection still in quarantine (pre-approval) gets its own frames observed here too (registration is unconditional, since a later approved sendDataFrame call still needs to find it), but never acted on until trackSession has actually run for it. A response or storage failure is reported via onError and otherwise dropped -- the peer's own next data-have/retry is what recovers, the same as any other best-effort gossip-driven exchange in this file. */
81
80
  /** Routes one core/data frame: see data-frame-routing.ts's own DataFrameRouter for the actual dispatch, kept out of this already-large file. */
82
81
  private handleDataFrame;
83
82
  get dataPort(): number;
@@ -1 +1 @@
1
- {"version":3,"file":"wire-mesh-transport.d.ts","sourceRoot":"","sources":["../../src/core/wire-mesh-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAyB9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,oCAAoC,CAAC;AAW5C,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAEhB,aAAa,EACb,UAAU,EACV,eAAe,EAChB,MAAM,mCAAmC,CAAC;AAM3C,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC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gB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBnE,gBAAgB,CACpB,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,EAClC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;IAoBV,WAAW,CACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,MAAM,CAAC;IAgBZ,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/C,aAAa,IAAI,YAAY,EAAE;IAI/B,6NAA6N;IAC7N,OAAO,KAAK,mBAAmB,GAE9B;IAMD,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,GAAG,IAAI;IAIxD,aAAa,IAAI,IAAI;IAIrB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAQnC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IA6C/B,KAAK,IAAI,IAAI;CAMd"}
@@ -25,7 +25,7 @@ import { DEFAULT_PENDING_CONNECTION_TIMEOUT_MS, expirePendingConnection, } from
25
25
  import { acceptMeshSession, } from "wire-mesh-core/domain/mesh-session";
26
26
  import { deviceIdToHex } from "wire-mesh-core/domain/device-id";
27
27
  import { computeMeshGraph, handlePathTraceRequest, traceMeshPath, } from "./mesh-graph.js";
28
- import { accountReplicationFrom, DataFrameRouter, } from "./data-frame-routing.js";
28
+ import { accountReplicationFrom, DataFrameRouter, hubDataChannel, } from "./data-frame-routing.js";
29
29
  import { toIdentityPort } from "./wire-mesh-identity.js";
30
30
  import { DATA_SERVER_ACCEPT, DEFAULT_LISTENER_ACCEPT, operatorListenerAccept, } from "./wire-mesh-transport-options.js";
31
31
  import { createRoomRouter, extractMessage, } from "./room-router.js";
@@ -152,6 +152,7 @@ export class WireMeshTransport {
152
152
  account: accountReplicationFrom(accountReplication, (deviceHex) => this.knownDevices.current().get(deviceHex)),
153
153
  peerSessions: this.peerSessions,
154
154
  onError: this.events.onError,
155
+ hub: hubDataChannel(() => this.hub),
155
156
  announceIntervalMs: presenceReadvertiseIntervalMs,
156
157
  });
157
158
  this.hub = new HubSession({
@@ -161,6 +162,7 @@ export class WireMeshTransport {
161
162
  isShuttingDown: this.isShuttingDown.bind(this),
162
163
  advertisedAddresses: this.advertisedAddresses,
163
164
  onFrame: async (conn, frame) => this.handleDataFrame(conn, frame),
165
+ onRelayedDataFrame: this.dataFrames.routeRelayed,
164
166
  trackForShutdown: (session) => {
165
167
  this.allSessions.add(session);
166
168
  },
@@ -201,7 +203,6 @@ export class WireMeshTransport {
201
203
  async sendDataFrame(peerDeviceHex, frame) {
202
204
  await this.dataFrames.send(peerDeviceHex, frame);
203
205
  }
204
- /** Registers (or refreshes) the raw connection a frame arrived on, then answers a data-have/data-request/data-entries frame in place, sending any resulting response frame back over the same connection -- every other frame type is ignored here (applyFrame's own dispatch already owns those). Trust-gated on peerSessions already tracking this device: a connection still in quarantine (pre-approval) gets its own frames observed here too (registration is unconditional, since a later approved sendDataFrame call still needs to find it), but never acted on until trackSession has actually run for it. A response or storage failure is reported via onError and otherwise dropped -- the peer's own next data-have/retry is what recovers, the same as any other best-effort gossip-driven exchange in this file. */
205
206
  /** Routes one core/data frame: see data-frame-routing.ts's own DataFrameRouter for the actual dispatch, kept out of this already-large file. */
206
207
  async handleDataFrame(connection, frame) {
207
208
  await this.dataFrames.route(connection, frame);