agent-comms 9.1.0 → 9.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/dist/bridges/user/web/request-handling.d.ts +26 -0
- package/dist/bridges/user/web/request-handling.d.ts.map +1 -0
- package/dist/bridges/user/web/request-handling.js +92 -0
- package/dist/bridges/user/web/request-handling.js.map +1 -0
- package/dist/bridges/user/web/server.d.ts +4 -0
- package/dist/bridges/user/web/server.d.ts.map +1 -1
- package/dist/bridges/user/web/server.js +88 -53
- package/dist/bridges/user/web/server.js.map +1 -1
- package/dist/bridges/user/web/web-access.d.ts.map +1 -1
- package/dist/bridges/user/web/web-access.js +14 -1
- package/dist/bridges/user/web/web-access.js.map +1 -1
- package/dist/bridges/user/web/web-assets.d.ts +2 -1
- package/dist/bridges/user/web/web-assets.d.ts.map +1 -1
- package/dist/bridges/user/web/web-assets.js +2 -2
- package/dist/bridges/user/web/web-assets.js.map +1 -1
- package/dist/bridges/user/web/web-console-static.d.ts.map +1 -1
- package/dist/bridges/user/web/web-console-static.js +34 -22
- package/dist/bridges/user/web/web-console-static.js.map +1 -1
- package/dist/core/coordinator-role.d.ts +15 -2
- package/dist/core/coordinator-role.d.ts.map +1 -1
- package/dist/core/coordinator-role.js +109 -11
- package/dist/core/coordinator-role.js.map +1 -1
- package/dist/core/detached-work.d.ts +14 -0
- package/dist/core/detached-work.d.ts.map +1 -0
- package/dist/core/detached-work.js +40 -0
- package/dist/core/detached-work.js.map +1 -0
- package/dist/core/election-sessions.d.ts.map +1 -1
- package/dist/core/election-sessions.js +6 -6
- package/dist/core/election-sessions.js.map +1 -1
- package/dist/core/hub-session.d.ts +10 -1
- package/dist/core/hub-session.d.ts.map +1 -1
- package/dist/core/hub-session.js +34 -32
- package/dist/core/hub-session.js.map +1 -1
- package/dist/core/message-limits.d.ts +14 -0
- package/dist/core/message-limits.d.ts.map +1 -0
- package/dist/core/message-limits.js +22 -0
- package/dist/core/message-limits.js.map +1 -0
- package/dist/core/peer-lifecycle.d.ts +2 -0
- package/dist/core/peer-lifecycle.d.ts.map +1 -1
- package/dist/core/peer-lifecycle.js +9 -4
- package/dist/core/peer-lifecycle.js.map +1 -1
- package/dist/core/pending-connection.d.ts +20 -1
- package/dist/core/pending-connection.d.ts.map +1 -1
- package/dist/core/pending-connection.js +27 -0
- package/dist/core/pending-connection.js.map +1 -1
- package/dist/core/relay-server.d.ts +15 -1
- package/dist/core/relay-server.d.ts.map +1 -1
- package/dist/core/relay-server.js +70 -16
- package/dist/core/relay-server.js.map +1 -1
- package/dist/core/room-router.d.ts.map +1 -1
- package/dist/core/room-router.js +31 -10
- package/dist/core/room-router.js.map +1 -1
- package/dist/core/tool.d.ts.map +1 -1
- package/dist/core/tool.js +3 -0
- package/dist/core/tool.js.map +1 -1
- package/dist/core/transport-events.d.ts.map +1 -1
- package/dist/core/transport-events.js +9 -5
- package/dist/core/transport-events.js.map +1 -1
- package/dist/core/wire-mesh-transport.d.ts +2 -2
- package/dist/core/wire-mesh-transport.d.ts.map +1 -1
- package/dist/core/wire-mesh-transport.js +96 -115
- package/dist/core/wire-mesh-transport.js.map +1 -1
- package/package.json +1 -1
- package/src/bridges/user/web/request-handling.ts +118 -0
- package/src/bridges/user/web/server.ts +109 -54
- package/src/bridges/user/web/web-access.ts +14 -1
- package/src/bridges/user/web/web-assets.ts +7 -3
- package/src/bridges/user/web/web-console-static.ts +34 -26
- package/src/core/coordinator-role.ts +126 -7
- package/src/core/detached-work.ts +55 -0
- package/src/core/election-sessions.ts +8 -4
- package/src/core/hub-session.ts +63 -41
- package/src/core/message-limits.ts +29 -0
- package/src/core/peer-lifecycle.ts +10 -4
- package/src/core/pending-connection.ts +48 -1
- package/src/core/relay-server.ts +110 -23
- package/src/core/room-router.ts +36 -9
- package/src/core/tool.ts +3 -0
- package/src/core/transport-events.ts +9 -5
- package/src/core/wire-mesh-transport.ts +58 -63
|
@@ -79,7 +79,7 @@ export declare class HubSession {
|
|
|
79
79
|
* Every trusted remote entry is surfaced via onDirectory, so the transport can merge it into its own mesh-wide knownDevices (agent-comms#155's remote-directory-merge leg). Filtered to admitEntries (agent-comms#156, widened by agent-comms#187's principal allowlist per agent-comms#192 and by #266's membership proofs) before either hubPeersKnown tracking or onDirectory sees it: an untrusted device's gossiped presence is not merely withheld from listAgents, it is never even recorded as "known" here, so nothing downstream can act on it via any path this class exposes.
|
|
80
80
|
*/
|
|
81
81
|
private consumeEvents;
|
|
82
|
-
/** Consumes one hub session's inbound relayed manage-requests until it ends, dispatching each in arrival order to dispatchHubRequest
|
|
82
|
+
/** Consumes one hub session's inbound relayed manage-requests until it ends, dispatching each in arrival order to dispatchHubRequest, and reporting a request whose dispatch fails without ending the loop, so one request cannot stop every later one on the session, 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. */
|
|
83
83
|
private consume;
|
|
84
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
85
|
private consumeDataFrames;
|
|
@@ -90,6 +90,15 @@ export declare class HubSession {
|
|
|
90
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. */
|
|
91
91
|
tracePath(peerDeviceHex: string, timeoutMs?: number): Promise<MeshTraceResult>;
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Dispatches each inbound relayed manage-request in arrival order until the stream ends. A request whose dispatch throws is reported through the transport's error handler and the next is still read, and a transport that is shutting down makes the loop skip the rest. Never rejects. Exported so the loop is tested without a live hub session.
|
|
95
|
+
*/
|
|
96
|
+
export declare function drainHubRequests(options: {
|
|
97
|
+
requests: AsyncIterable<IncomingManageRequest>;
|
|
98
|
+
deps: Readonly<HubRequestDispatchDeps & Pick<HubSessionDeps, "events" | "isShuttingDown">>;
|
|
99
|
+
onKnownPeer: (deviceHex: string) => void;
|
|
100
|
+
hubAddress?: string | undefined;
|
|
101
|
+
}): Promise<void>;
|
|
93
102
|
/** The slice of HubSessionDeps dispatchHubRequest actually needs. Named so its own tests, and consume()'s call site, don't repeat the same Pick inline. */
|
|
94
103
|
export type HubRequestDispatchDeps = Pick<HubSessionDeps, "isTrusted" | "handleRoomRequest">;
|
|
95
104
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub-session.d.ts","sourceRoot":"","sources":["../../src/core/hub-session.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"hub-session.d.ts","sourceRoot":"","sources":["../../src/core/hub-session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,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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AAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhB"}
|
package/dist/core/hub-session.js
CHANGED
|
@@ -1,6 +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 { consumeEach } from "./detached-work.js";
|
|
4
5
|
import { acceptMeshSession, } from "wire-mesh-core/domain/mesh-session";
|
|
5
6
|
import { deviceIdToHex } from "wire-mesh-core/domain/device-id";
|
|
6
7
|
import { tracePath as coreTracePath } from "wire-mesh-core/domain/path-trace";
|
|
@@ -122,56 +123,45 @@ export class HubSession {
|
|
|
122
123
|
*/
|
|
123
124
|
async consumeEvents(session, ownHex) {
|
|
124
125
|
try {
|
|
125
|
-
|
|
126
|
+
// An event that cannot be handled (the directory filter rejecting, say) is reported and the next is still read: ending the loop here would clear a session that is still live.
|
|
127
|
+
await consumeEach(session.events, async (event) => {
|
|
126
128
|
if (this.deps.isShuttingDown())
|
|
127
|
-
|
|
129
|
+
return "stop";
|
|
128
130
|
const remoteEntries = await this.deps.admitEntries(event.directory.filter((entry) => deviceIdToHex(entry.device) !== ownHex));
|
|
129
131
|
for (const entry of remoteEntries) {
|
|
130
132
|
this.hubPeersKnown.add(deviceIdToHex(entry.device));
|
|
131
133
|
}
|
|
132
134
|
if (remoteEntries.length > 0)
|
|
133
135
|
this.deps.onDirectory(remoteEntries);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
136
|
+
return event.state.status === "closed" ? "stop" : "continue";
|
|
137
|
+
}, () => this.deps.events.onError);
|
|
137
138
|
}
|
|
138
139
|
finally {
|
|
139
140
|
if (this.session === session)
|
|
140
141
|
this.clearSession();
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
|
-
/** Consumes one hub session's inbound relayed manage-requests until it ends, dispatching each in arrival order to dispatchHubRequest
|
|
144
|
+
/** Consumes one hub session's inbound relayed manage-requests until it ends, dispatching each in arrival order to dispatchHubRequest, and reporting a request whose dispatch fails without ending the loop, so one request cannot stop every later one on the session, 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. */
|
|
144
145
|
consume(session) {
|
|
145
|
-
void (
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
this.hubPeersKnown.add(hex);
|
|
154
|
-
},
|
|
155
|
-
hubAddress: this.url,
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
})();
|
|
146
|
+
void drainHubRequests({
|
|
147
|
+
requests: session.incomingManageRequests,
|
|
148
|
+
deps: this.deps,
|
|
149
|
+
onKnownPeer: (hex) => {
|
|
150
|
+
this.hubPeersKnown.add(hex);
|
|
151
|
+
},
|
|
152
|
+
hubAddress: this.url,
|
|
153
|
+
});
|
|
159
154
|
}
|
|
160
155
|
/** 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
156
|
consumeDataFrames(session) {
|
|
162
|
-
void (async () => {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
});
|
|
157
|
+
void consumeEach(session.incomingDataFrames, async (incoming) => {
|
|
158
|
+
if (this.deps.isShuttingDown())
|
|
159
|
+
return "stop";
|
|
160
|
+
if (incoming.fromDevice !== undefined) {
|
|
161
|
+
await this.deps.onRelayedDataFrame(deviceIdToHex(incoming.fromDevice), incoming.frame);
|
|
173
162
|
}
|
|
174
|
-
|
|
163
|
+
return "continue";
|
|
164
|
+
}, () => this.deps.events.onError);
|
|
175
165
|
}
|
|
176
166
|
/** 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
167
|
async sendDataFrame(peerDeviceHex, frame) {
|
|
@@ -215,6 +205,18 @@ function hexToBytes(hex) {
|
|
|
215
205
|
}
|
|
216
206
|
return bytes;
|
|
217
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* Dispatches each inbound relayed manage-request in arrival order until the stream ends. A request whose dispatch throws is reported through the transport's error handler and the next is still read, and a transport that is shutting down makes the loop skip the rest. Never rejects. Exported so the loop is tested without a live hub session.
|
|
210
|
+
*/
|
|
211
|
+
export async function drainHubRequests(options) {
|
|
212
|
+
const { requests, deps, onKnownPeer, hubAddress } = options;
|
|
213
|
+
await consumeEach(requests, async (request) => {
|
|
214
|
+
if (deps.isShuttingDown())
|
|
215
|
+
return "stop";
|
|
216
|
+
await dispatchHubRequest({ request, deps, onKnownPeer, hubAddress });
|
|
217
|
+
return "continue";
|
|
218
|
+
}, () => deps.events.onError);
|
|
219
|
+
}
|
|
218
220
|
/**
|
|
219
221
|
* Decides what to do with one inbound relayed manage-request, keeping every downstream consumer's handle keyed by the SENDING device (request.fromDevice names it on relay-routed requests) rather than by the hub.
|
|
220
222
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub-session.js","sourceRoot":"","sources":["../../src/core/hub-session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,GAMlB,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;AA4C9D,MAAM,OAAO,UAAU;IAYQ;IAXrB,OAAO,CAAkC;IACjD,yGAAyG;IACjG,UAAU,CAAmC;IACrD,2IAA2I;IACnI,MAAM,CAAyB;IACvC,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,C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AAC,EAAE,CAChE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The size limit shared by every path that takes message text from outside this process: the web bridge's HTTP bodies and WebSocket messages, and the `content` of a message sent through the MCP tool.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The most bytes the bridge reads from one HTTP request body, accepts in one dashboard WebSocket message, and accepts as the content of one message sent through the tool.
|
|
6
|
+
*
|
|
7
|
+
* The largest legitimate input is a chat message a person typed or pasted. One mebibyte holds a pasted document of several hundred thousand characters, even with every character escaped in a JSON action, which is well beyond anything a conversation carries, while keeping what one request can make the bridge hold in memory small. Every other request the dashboard sends (room, agent and read calls) is a few hundred bytes.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MAX_MESSAGE_BYTES: number;
|
|
10
|
+
/** The `code` of the error raised for message content over MAX_MESSAGE_BYTES. */
|
|
11
|
+
export declare const MESSAGE_TOO_LARGE = "MESSAGE_TOO_LARGE";
|
|
12
|
+
/** Throws a CommsError, before anything is sent, when `content` is longer than MAX_MESSAGE_BYTES in UTF-8. The text of the error states the limit and the size, never the content. */
|
|
13
|
+
export declare function requireMessageWithinLimit(content: string): void;
|
|
14
|
+
//# sourceMappingURL=message-limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-limits.d.ts","sourceRoot":"","sources":["../../src/core/message-limits.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAA8B,CAAC;AAE7D,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,sLAAsL;AACtL,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAQ/D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The size limit shared by every path that takes message text from outside this process: the web bridge's HTTP bodies and WebSocket messages, and the `content` of a message sent through the MCP tool.
|
|
3
|
+
*/
|
|
4
|
+
import { CommsError } from "./store.js";
|
|
5
|
+
const BYTES_PER_KIB = 1024;
|
|
6
|
+
const KIB_PER_MIB = 1024;
|
|
7
|
+
/**
|
|
8
|
+
* The most bytes the bridge reads from one HTTP request body, accepts in one dashboard WebSocket message, and accepts as the content of one message sent through the tool.
|
|
9
|
+
*
|
|
10
|
+
* The largest legitimate input is a chat message a person typed or pasted. One mebibyte holds a pasted document of several hundred thousand characters, even with every character escaped in a JSON action, which is well beyond anything a conversation carries, while keeping what one request can make the bridge hold in memory small. Every other request the dashboard sends (room, agent and read calls) is a few hundred bytes.
|
|
11
|
+
*/
|
|
12
|
+
export const MAX_MESSAGE_BYTES = KIB_PER_MIB * BYTES_PER_KIB;
|
|
13
|
+
/** The `code` of the error raised for message content over MAX_MESSAGE_BYTES. */
|
|
14
|
+
export const MESSAGE_TOO_LARGE = "MESSAGE_TOO_LARGE";
|
|
15
|
+
/** Throws a CommsError, before anything is sent, when `content` is longer than MAX_MESSAGE_BYTES in UTF-8. The text of the error states the limit and the size, never the content. */
|
|
16
|
+
export function requireMessageWithinLimit(content) {
|
|
17
|
+
const bytes = Buffer.byteLength(content, "utf-8");
|
|
18
|
+
if (bytes > MAX_MESSAGE_BYTES) {
|
|
19
|
+
throw new CommsError(`The message is ${String(bytes)} bytes and the limit is ${String(MAX_MESSAGE_BYTES)} bytes; nothing was sent. Send it in shorter parts.`, MESSAGE_TOO_LARGE);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=message-limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-limits.js","sourceRoot":"","sources":["../../src/core/message-limits.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,MAAM,WAAW,GAAG,IAAI,CAAC;AAEzB;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,GAAG,aAAa,CAAC;AAE7D,iFAAiF;AACjF,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAErD,sLAAsL;AACtL,MAAM,UAAU,yBAAyB,CAAC,OAAe;IACvD,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAClD,IAAI,KAAK,GAAG,iBAAiB,EAAE,CAAC;QAC9B,MAAM,IAAI,UAAU,CAClB,kBAAkB,MAAM,CAAC,KAAK,CAAC,2BAA2B,MAAM,CAAC,iBAAiB,CAAC,qDAAqD,EACxI,iBAAiB,CAClB,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -61,6 +61,8 @@ export declare class PeerLifecycle {
|
|
|
61
61
|
handleDataMessage(handle: Readonly<ConnectionHandle>, msg: MeshMessage): Promise<void>;
|
|
62
62
|
/** Takes over the well-known port listener (a fresh bind in init, a graceful handover, or winning the crash race) and dials the peers named. Holding the port no longer carries the coordinator duties; the one link left is that a port holder which knows of no elected incumbent claims the role, since it is then the first on its machine as far as it can tell. */
|
|
63
63
|
handleBecomeCoordinator(peerList: readonly PeerInfo[]): Promise<void>;
|
|
64
|
+
/** Work started for a peer and not awaited: a failure is reported through onError (or stderr), never left as an unhandled rejection. */
|
|
65
|
+
private detach;
|
|
64
66
|
handlePeerDisconnected(handle: Readonly<ConnectionHandle>): void;
|
|
65
67
|
/** The awaitable form of handlePeerDisconnected, which TransportEvents forces to be synchronous. A departing peer leaves the peer list. When it held the elected coordinator role, the role is recovered first (the lowest surviving device-id claims at a raised term), so the new holder is already in place by the time the departed peer's agent record is retired; when it held the well-known port this side dialled, the vacated port is contested too. */
|
|
66
68
|
handlePeerDeparture(peerId: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer-lifecycle.d.ts","sourceRoot":"","sources":["../../src/core/peer-lifecycle.ts"],"names":[],"mappings":"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IAAI,CAAC;IAQhB,yWAAyW;IACnW,uBAAuB,CAAC,QAAQ,EAAE,SAAS,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB3E,wIAAwI;IACxI,OAAO,CAAC,MAAM;IAId,sBAAsB,CAAC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAIhE,kcAAkc;IAC5b,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWxD,mzBAAmzB;YACryB,sBAAsB;IA6CpC,y1BAAy1B;YAC30B,yBAAyB;IAyBvC,+jBAA+jB;YACjjB,mBAAmB;IAejC,miCAAmiC;IAC7hC,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;CA2B/C"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Two roles are kept apart here (agent-comms#341). The well-known port listener is only the compatibility first-contact address and introduction path, and is still passed on by graceful handover and recovered by the bind race. The coordinator duties (the stale-agent probe, single-authority departure announcements, the default cc-peer front) follow the elected CoordinatorRole instead, whose holder need not be the peer that bound the port.
|
|
5
5
|
*/
|
|
6
|
+
import { reportRejection } from "./detached-work.js";
|
|
6
7
|
import { normaliseWireState } from "./wire-protocol.js";
|
|
7
8
|
import { parseIsoTimestampMs } from "./iso-timestamp.js";
|
|
8
9
|
import { BECOME_COORDINATOR_BIND_RETRIES, BECOME_COORDINATOR_BIND_RETRY_DELAY_MS, isAddrInUse, isConnectionRefused, } from "./bind-retry.js";
|
|
@@ -91,7 +92,7 @@ export class PeerLifecycle {
|
|
|
91
92
|
// The list always includes this store's own entry — dialling yourself is a wasted connection attempt (and, on some platforms, an immediate self-inflicted ECONNRESET) that never needs to happen.
|
|
92
93
|
if (peer.id === peerId)
|
|
93
94
|
continue;
|
|
94
|
-
|
|
95
|
+
this.detach(this.deps.requireTransport().connectToPeer(peer, peerId));
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
handlePeerJoined(peer) {
|
|
@@ -99,7 +100,7 @@ export class PeerLifecycle {
|
|
|
99
100
|
const peerId = this.deps.getPeerId();
|
|
100
101
|
if (peer.id === peerId)
|
|
101
102
|
return;
|
|
102
|
-
|
|
103
|
+
this.detach(this.deps.requireTransport().connectToPeer(peer, peerId));
|
|
103
104
|
}
|
|
104
105
|
async handleIntroduction(handle, msg) {
|
|
105
106
|
const newPeer = {
|
|
@@ -161,12 +162,16 @@ export class PeerLifecycle {
|
|
|
161
162
|
this.deps.peerInfo.set(peerId, self);
|
|
162
163
|
for (const peer of peerList) {
|
|
163
164
|
this.deps.peerInfo.set(peer.id, peer);
|
|
164
|
-
|
|
165
|
+
this.detach(this.deps.requireTransport().connectToPeer(peer, peerId));
|
|
165
166
|
}
|
|
166
167
|
await this.claimWhileAlone();
|
|
167
168
|
}
|
|
169
|
+
/** Work started for a peer and not awaited: a failure is reported through onError (or stderr), never left as an unhandled rejection. */
|
|
170
|
+
detach(work) {
|
|
171
|
+
reportRejection(work, () => this.deps.onError);
|
|
172
|
+
}
|
|
168
173
|
handlePeerDisconnected(handle) {
|
|
169
|
-
|
|
174
|
+
this.detach(this.handlePeerDeparture(handle.id));
|
|
170
175
|
}
|
|
171
176
|
/** The awaitable form of handlePeerDisconnected, which TransportEvents forces to be synchronous. A departing peer leaves the peer list. When it held the elected coordinator role, the role is recovered first (the lowest surviving device-id claims at a raised term), so the new holder is already in place by the time the departed peer's agent record is retired; when it held the well-known port this side dialled, the vacated port is contested too. */
|
|
172
177
|
async handlePeerDeparture(peerId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer-lifecycle.js","sourceRoot":"","sources":["../../src/core/peer-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAMzD,OAAO,EACL,+BAA+B,EAC/B,sCAAs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AAS,EAAE,CAAC;QACrC,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAC5D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAC7B,CAAC;QACF,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAExC,8LAA8L;QAC9L,MAAM,WAAW,GAAG,CAAC,IAAwB,EAAU,EAAE,CACvD,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC,iBAAiB,CAAC;QAClE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAC3B,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YAC7B,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,SAAS,EAAE,GAAG,WAAW,CAAC,GAAG,cAAc,CAAC;QACnD,iKAAiK;QACjK,IAAI,SAAS,KAAK,SAAS;YAAE,OAAO;QAEpC,MAAM,SAAS,CAAC,IAAI,CAClB,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,EACpB,EAAE,MAAM,EAAE,oBAAoB,EAAE,QAAQ,EAAE,WAAW,EAAE,CACxD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A connect_request held open awaiting a human decision, how long it may wait, and what happens when it waits too long: WireMeshTransport's pending-connection bookkeeping, split out of wire-mesh-transport.ts to keep it under the repo's max-lines cap.
|
|
3
3
|
*/
|
|
4
4
|
import type { AcceptedMeshSession, IncomingManageRequest } from "wire-mesh-core/domain/mesh-session";
|
|
5
|
-
import type { ListenerPolicy } from "./transport.js";
|
|
5
|
+
import type { ConnectionHandle, ListenerPolicy, TransportEvents } from "./transport.js";
|
|
6
6
|
export declare const DEFAULT_PENDING_CONNECTION_TIMEOUT_MS: number;
|
|
7
7
|
/** A human decision on a connect_request: "accept" resumes the still-blocked consumeQuarantined loop as a fully trusted session; "reject" (also used when the requester disconnects before a decision is made) unblocks it to close instead. */
|
|
8
8
|
export type ConnectionDecision = "accept" | "reject";
|
|
@@ -21,4 +21,23 @@ export interface PendingConnection {
|
|
|
21
21
|
}
|
|
22
22
|
/** Auto-rejects a connect_request that has sat unanswered past WireMeshTransport's pendingConnectionTimeoutMs: the same respond-then-resolve shape rejectConnection uses (a real error response, not a silent hang), since unlike watchForDisconnect's own cleanup path the requester's session is still very much alive and waiting to hear back. A no-op if the request was already settled by acceptConnection/rejectConnection/disconnect before this timer fired, since entries are deleted exactly once, by whichever path settles first. */
|
|
23
23
|
export declare function expirePendingConnection(pendingConnections: Map<string, PendingConnection>, id: string): void;
|
|
24
|
+
/** What holdConnectRequest needs: where pending requests are kept, how long one may wait, and where the request is announced. */
|
|
25
|
+
export interface HoldConnectRequestOptions {
|
|
26
|
+
pendingConnections: Map<string, PendingConnection>;
|
|
27
|
+
timeoutMs: number;
|
|
28
|
+
events: Pick<TransportEvents, "onConnectionRequest">;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Holds a connect_request open until a human decides, and settles with that decision. The request is announced through `onConnectionRequest` and answered later by acceptConnection or rejectConnection, or by expirePendingConnection if neither happens within the timeout. The timer is unref()'d so a stray pending connection, whose timer failed to be cleared through some path, can never by itself keep the process alive for up to the timeout after everything else is done.
|
|
32
|
+
*/
|
|
33
|
+
export declare function holdConnectRequest(options: Readonly<HoldConnectRequestOptions>, held: Readonly<{
|
|
34
|
+
request: IncomingManageRequest;
|
|
35
|
+
message: {
|
|
36
|
+
dataPort: number;
|
|
37
|
+
name: string;
|
|
38
|
+
fingerprint: string;
|
|
39
|
+
};
|
|
40
|
+
handle: Readonly<ConnectionHandle>;
|
|
41
|
+
session: AcceptedMeshSession;
|
|
42
|
+
}>): Promise<ConnectionDecision>;
|
|
24
43
|
//# sourceMappingURL=pending-connection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-connection.d.ts","sourceRoot":"","sources":["../../src/core/pending-connection.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"pending-connection.d.ts","sourceRoot":"","sources":["../../src/core/pending-connection.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAMxB,eAAO,MAAM,qCAAqC,QACuB,CAAC;AAE1E,gPAAgP;AAChP,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;IACnC,obAAob;IACpb,OAAO,EAAE,mBAAmB,CAAC;IAC7B,4UAA4U;IAC5U,OAAO,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAChD,kaAAka;IACla,aAAa,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;CAC9C;AAED,mhBAAmhB;AACnhB,wBAAgB,uBAAuB,CACrC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAClD,EAAE,EAAE,MAAM,GACT,IAAI,CAcN;AAED,iIAAiI;AACjI,MAAM,WAAW,yBAAyB;IACxC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;CACtD;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,QAAQ,CAAC,yBAAyB,CAAC,EAC5C,IAAI,EAAE,QAAQ,CAAC;IACb,OAAO,EAAE,qBAAqB,CAAC;IAC/B,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACnC,OAAO,EAAE,mBAAmB,CAAC;CAC9B,CAAC,GACD,OAAO,CAAC,kBAAkB,CAAC,CAuB7B"}
|
|
@@ -22,4 +22,31 @@ export function expirePendingConnection(pendingConnections, id) {
|
|
|
22
22
|
.catch(() => undefined);
|
|
23
23
|
pending.resolve("reject");
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Holds a connect_request open until a human decides, and settles with that decision. The request is announced through `onConnectionRequest` and answered later by acceptConnection or rejectConnection, or by expirePendingConnection if neither happens within the timeout. The timer is unref()'d so a stray pending connection, whose timer failed to be cleared through some path, can never by itself keep the process alive for up to the timeout after everything else is done.
|
|
27
|
+
*/
|
|
28
|
+
export async function holdConnectRequest(options, held) {
|
|
29
|
+
const { pendingConnections, timeoutMs, events } = options;
|
|
30
|
+
const { request, message, handle, session } = held;
|
|
31
|
+
return new Promise((resolve) => {
|
|
32
|
+
pendingConnections.set(handle.id, {
|
|
33
|
+
respond: request.respond,
|
|
34
|
+
dataPort: message.dataPort,
|
|
35
|
+
name: message.name,
|
|
36
|
+
fingerprint: message.fingerprint,
|
|
37
|
+
policy: handle.policy,
|
|
38
|
+
session,
|
|
39
|
+
resolve,
|
|
40
|
+
timeoutHandle: setTimeout(() => {
|
|
41
|
+
expirePendingConnection(pendingConnections, handle.id);
|
|
42
|
+
}, timeoutMs).unref(),
|
|
43
|
+
});
|
|
44
|
+
events.onConnectionRequest(handle, {
|
|
45
|
+
peerId: handle.id,
|
|
46
|
+
dataPort: message.dataPort,
|
|
47
|
+
name: message.name,
|
|
48
|
+
fingerprint: message.fingerprint,
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
25
52
|
//# sourceMappingURL=pending-connection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-connection.js","sourceRoot":"","sources":["../../src/core/pending-connection.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"pending-connection.js","sourceRoot":"","sources":["../../src/core/pending-connection.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,oaAAoa;AACpa,MAAM,kCAAkC,GAAG,CAAC,CAAC;AAC7C,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,MAAM,CAAC,MAAM,qCAAqC,GAChD,kCAAkC,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAmB1E,mhBAAmhB;AACnhB,MAAM,UAAU,uBAAuB,CACrC,kBAAkD,EAClD,EAAU;IAEV,MAAM,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IACD,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC9B,KAAK,OAAO;SACT,OAAO,CAAC;QACP,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,yDAAyD;KACnE,CAAC;SACD,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC1B,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,CAAC;AASD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAA4C,EAC5C,IAKE;IAEF,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC1D,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACnD,OAAO,IAAI,OAAO,CAAqB,CAAC,OAAO,EAAE,EAAE;QACjD,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE;YAChC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO;YACP,OAAO;YACP,aAAa,EAAE,UAAU,CAAC,GAAG,EAAE;gBAC7B,uBAAuB,CAAC,kBAAkB,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;YACzD,CAAC,EAAE,SAAS,CAAC,CAAC,KAAK,EAAE;SACtB,CAAC,CAAC;QACH,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE;YACjC,MAAM,EAAE,MAAM,CAAC,EAAE;YACjB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -7,6 +7,14 @@ import type { Connection } from "wire-mesh-core/ports/transport";
|
|
|
7
7
|
import { type UplinkFeed } from "./relay-uplink.js";
|
|
8
8
|
/** The wildcard IPv4 address: listening on it serves every interface, loopback and the local network alike. */
|
|
9
9
|
export declare const ALL_INTERFACES_HOST = "0.0.0.0";
|
|
10
|
+
/**
|
|
11
|
+
* The most bytes one WebSocket message may carry to the relay: 16 MiB. It is above the largest frame a legitimate client sends (a full reply of account ledger entries, about 12.6 MiB), equal to the receive cap of the Rust stream transport, and below the 32 MiB the hosted hub accepts, so no frame a conforming peer sends is refused and the relay holds no more of one connection's message than the hub would. The WebSocket server enforces it on the length a frame declares, before its payload is read: a message over it closes that connection with 1009 and nothing else.
|
|
12
|
+
*/
|
|
13
|
+
export declare const MAX_RELAY_FRAME_BYTES: number;
|
|
14
|
+
/** How long a client of the relay has to send its request headers and to complete a request: ample for any real client on a local network, and short because every such client is unauthenticated until it has gossiped an admitted device. */
|
|
15
|
+
export declare const RELAY_REQUEST_TIMEOUT_MS = 10000;
|
|
16
|
+
/** How long a WebSocket client of the relay has, from connecting, to gossip an advert for an admitted device. A connection that has not is closed: it can neither be named by a relay-connect nor relay anything, so holding it open serves no one. */
|
|
17
|
+
export declare const RELAY_ADMISSION_TIMEOUT_MS = 30000;
|
|
10
18
|
export interface RelayServerOptions {
|
|
11
19
|
/** The interface to listen on: ALL_INTERFACES_HOST to serve the local network, or a single address (a test serves loopback only). */
|
|
12
20
|
host: string;
|
|
@@ -14,6 +22,12 @@ export interface RelayServerOptions {
|
|
|
14
22
|
isAdmitted: (deviceHex: string) => boolean;
|
|
15
23
|
/** Reports a failure of the uplink, which is otherwise detached from any caller. */
|
|
16
24
|
onError: (error: Error) => void;
|
|
25
|
+
/** Overrides RELAY_REQUEST_TIMEOUT_MS, the time a client has to send its headers and complete a request. A test sets it small. */
|
|
26
|
+
requestTimeoutMs?: number | undefined;
|
|
27
|
+
/** Overrides RELAY_ADMISSION_TIMEOUT_MS, the time a WebSocket client has to gossip an admitted device. A test sets it small. */
|
|
28
|
+
admissionTimeoutMs?: number | undefined;
|
|
29
|
+
/** Overrides how often Node checks connections against the request timeouts (its default is thirty seconds, which makes a timeout take effect up to that much late). A test sets it small. */
|
|
30
|
+
connectionsCheckingIntervalMs?: number | undefined;
|
|
17
31
|
}
|
|
18
32
|
export declare class RelayServer {
|
|
19
33
|
private readonly options;
|
|
@@ -38,7 +52,7 @@ export declare class RelayServer {
|
|
|
38
52
|
routableClientCount(): number;
|
|
39
53
|
/** Closes every client and the listener. */
|
|
40
54
|
stop(): Promise<void>;
|
|
41
|
-
/** Drives one connection: filters its gossip to admitted devices, registers it with the hub on its first admitted advert, and hands the hub every frame from then on. */
|
|
55
|
+
/** Drives one connection: filters its gossip to admitted devices, registers it with the hub on its first admitted advert and calls `onVerified` once the hub has accepted an advert of it, and hands the hub every frame from then on. A frame that cannot be handled is reported and the next is still read, so one bad frame never ends a connection's service; the loop ends when the connection's own stream does. */
|
|
42
56
|
private serve;
|
|
43
57
|
/** The frame from upstream without the adverts of devices a client of this relay has registered, or undefined when nothing is left of it. An advert that came back round through the upstream hub would otherwise displace the client's own registration whenever it was the fresher, and a relay-connect naming the client would then find no route to it. */
|
|
44
58
|
private withoutClientDevices;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relay-server.d.ts","sourceRoot":"","sources":["../../src/core/relay-server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"relay-server.d.ts","sourceRoot":"","sources":["../../src/core/relay-server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAElE,+GAA+G;AAC/G,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAM7C;;GAEG;AACH,eAAO,MAAM,qBAAqB,QACa,CAAC;AAEhD,+OAA+O;AAC/O,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C,uPAAuP;AACvP,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAQjD,MAAM,WAAW,kBAAkB;IACj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