wire-mesh-core 1.58.1 → 1.58.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/domain/mesh-session.d.cts +1 -1
- package/dist/domain/mesh-session.d.mts +1 -1
- package/dist/domain/relay-hub.d.cts +1 -1
- package/dist/domain/relay-hub.d.mts +1 -1
- package/dist/domain/topology-snapshot.cjs +1 -1
- package/dist/domain/topology-snapshot.d.cts +1 -1
- package/dist/domain/topology-snapshot.d.mts +1 -1
- package/dist/domain/topology-snapshot.mjs +1 -1
- package/package.json +2 -7
|
@@ -111,7 +111,7 @@ export interface AcceptedMeshSessionOptions {
|
|
|
111
111
|
clock?: Readonly<Clock>;
|
|
112
112
|
/** This node's own directly-reachable "host:port" candidates (wire-mesh#38), advertised in this session's self-advert. Omit (or pass none) for a caller with nothing to offer. */
|
|
113
113
|
addresses?: readonly string[];
|
|
114
|
-
/** Observes every frame this session receives, alongside (never instead of) its own manage-request/gossip/handshake handling (wire-mesh#102) -- the integration point an "ordinary opted-in node relays for peers it's already talking to" uses: pass a shared RelayHub instance's own handleFrame, bound to this connection, and it sees the identical frame stream this session's own applyFrame already consumes, with no second for-await loop racing over the same connection.receive(). A dedicated wire-mesh
|
|
114
|
+
/** Observes every frame this session receives, alongside (never instead of) its own manage-request/gossip/handshake handling (wire-mesh#102) -- the integration point an "ordinary opted-in node relays for peers it's already talking to" uses: pass a shared RelayHub instance's own handleFrame, bound to this connection, and it sees the identical frame stream this session's own applyFrame already consumes, with no second for-await loop racing over the same connection.receive(). A dedicated wire-mesh/cloudflare-hub deployment, which never runs a MeshSession at all, is unaffected -- this is additive, opt-in, and irrelevant to that case. */
|
|
115
115
|
onFrame?: (connection: Readonly<Connection>, frame: Frame) => void | Promise<void>;
|
|
116
116
|
/** Fired once this session's own connection.receive() stream ends -- the counterpart a RelayHub's own forgetConnection needs, since its registry is keyed by this exact Connection and must be cleaned up when it specifically ends. */
|
|
117
117
|
onSessionEnd?: (connection: Readonly<Connection>) => void;
|
|
@@ -111,7 +111,7 @@ export interface AcceptedMeshSessionOptions {
|
|
|
111
111
|
clock?: Readonly<Clock>;
|
|
112
112
|
/** This node's own directly-reachable "host:port" candidates (wire-mesh#38), advertised in this session's self-advert. Omit (or pass none) for a caller with nothing to offer. */
|
|
113
113
|
addresses?: readonly string[];
|
|
114
|
-
/** Observes every frame this session receives, alongside (never instead of) its own manage-request/gossip/handshake handling (wire-mesh#102) -- the integration point an "ordinary opted-in node relays for peers it's already talking to" uses: pass a shared RelayHub instance's own handleFrame, bound to this connection, and it sees the identical frame stream this session's own applyFrame already consumes, with no second for-await loop racing over the same connection.receive(). A dedicated wire-mesh
|
|
114
|
+
/** Observes every frame this session receives, alongside (never instead of) its own manage-request/gossip/handshake handling (wire-mesh#102) -- the integration point an "ordinary opted-in node relays for peers it's already talking to" uses: pass a shared RelayHub instance's own handleFrame, bound to this connection, and it sees the identical frame stream this session's own applyFrame already consumes, with no second for-await loop racing over the same connection.receive(). A dedicated wire-mesh/cloudflare-hub deployment, which never runs a MeshSession at all, is unaffected -- this is additive, opt-in, and irrelevant to that case. */
|
|
115
115
|
onFrame?: (connection: Readonly<Connection>, frame: Frame) => void | Promise<void>;
|
|
116
116
|
/** Fired once this session's own connection.receive() stream ends -- the counterpart a RelayHub's own forgetConnection needs, since its registry is keyed by this exact Connection and must be cleaned up when it specifically ends. */
|
|
117
117
|
onSessionEnd?: (connection: Readonly<Connection>) => void;
|
|
@@ -2,7 +2,7 @@ import { N as Frame } from "../protocol-BnbpCk0Z.cjs";
|
|
|
2
2
|
import { t as Connection } from "../transport-Ca_ZyyZe.cjs";
|
|
3
3
|
//#region src/domain/relay-hub.d.ts
|
|
4
4
|
export interface RelayHub {
|
|
5
|
-
/** Drives one accepted connection until it closes: registers gossip-advertised devices, re-broadcasts each gossip frame to every other connected client and replies to the gossiping connection with a catch-up frame of every other already-known device, answers relay-connect by pairing and notifying the target, forwards relay-data within established pairings, and replies to a bare ping with a bare pong (wire-mesh#181) so a client can time its own sender-to-hub leg independent of anything being relayed. Resolves when the connection's frame stream ends. Internally just registerConnection followed by a loop of onFrame calls and a final onDisconnect -- kept as its own method since a dedicated hub deployment (wire-mesh
|
|
5
|
+
/** Drives one accepted connection until it closes: registers gossip-advertised devices, re-broadcasts each gossip frame to every other connected client and replies to the gossiping connection with a catch-up frame of every other already-known device, answers relay-connect by pairing and notifying the target, forwards relay-data within established pairings, and replies to a bare ping with a bare pong (wire-mesh#181) so a client can time its own sender-to-hub leg independent of anything being relayed. Resolves when the connection's frame stream ends. Internally just registerConnection followed by a loop of onFrame calls and a final onDisconnect -- kept as its own method since a dedicated hub deployment (wire-mesh/cloudflare-hub) has nothing else driving the connection and wants the whole lifecycle in one call. */
|
|
6
6
|
handleConnection: (connection: Readonly<Connection>) => Promise<void>;
|
|
7
7
|
/** Registers a connection with this hub without taking over its own frame-consumption loop (wire-mesh#102) -- the entry point an "ordinary opted-in node relays for peers it's already talking to" uses, alongside onFrame/onDisconnect below, to let a MeshSession's own single connection.receive() loop drive this hub rather than running a second, competing one. Must be called once, before the first onFrame call for this connection, so gossip fan-out (which forwards to every OTHER registered connection) already sees it. */
|
|
8
8
|
registerConnection: (connection: Readonly<Connection>) => void;
|
|
@@ -2,7 +2,7 @@ import { N as Frame } from "../protocol-BnbpCk0Z.mjs";
|
|
|
2
2
|
import { t as Connection } from "../transport-BH8kGWXt.mjs";
|
|
3
3
|
//#region src/domain/relay-hub.d.ts
|
|
4
4
|
export interface RelayHub {
|
|
5
|
-
/** Drives one accepted connection until it closes: registers gossip-advertised devices, re-broadcasts each gossip frame to every other connected client and replies to the gossiping connection with a catch-up frame of every other already-known device, answers relay-connect by pairing and notifying the target, forwards relay-data within established pairings, and replies to a bare ping with a bare pong (wire-mesh#181) so a client can time its own sender-to-hub leg independent of anything being relayed. Resolves when the connection's frame stream ends. Internally just registerConnection followed by a loop of onFrame calls and a final onDisconnect -- kept as its own method since a dedicated hub deployment (wire-mesh
|
|
5
|
+
/** Drives one accepted connection until it closes: registers gossip-advertised devices, re-broadcasts each gossip frame to every other connected client and replies to the gossiping connection with a catch-up frame of every other already-known device, answers relay-connect by pairing and notifying the target, forwards relay-data within established pairings, and replies to a bare ping with a bare pong (wire-mesh#181) so a client can time its own sender-to-hub leg independent of anything being relayed. Resolves when the connection's frame stream ends. Internally just registerConnection followed by a loop of onFrame calls and a final onDisconnect -- kept as its own method since a dedicated hub deployment (wire-mesh/cloudflare-hub) has nothing else driving the connection and wants the whole lifecycle in one call. */
|
|
6
6
|
handleConnection: (connection: Readonly<Connection>) => Promise<void>;
|
|
7
7
|
/** Registers a connection with this hub without taking over its own frame-consumption loop (wire-mesh#102) -- the entry point an "ordinary opted-in node relays for peers it's already talking to" uses, alongside onFrame/onDisconnect below, to let a MeshSession's own single connection.receive() loop drive this hub rather than running a second, competing one. Must be called once, before the first onFrame call for this connection, so gossip fan-out (which forwards to every OTHER registered connection) already sees it. */
|
|
8
8
|
registerConnection: (connection: Readonly<Connection>) => void;
|
|
@@ -5,7 +5,7 @@ function directPeerDevice(inputs) {
|
|
|
5
5
|
if (inputs.authenticatedPeer !== void 0) return inputs.authenticatedPeer;
|
|
6
6
|
return inputs.isAccepted ? inputs.firstAdvertisedPeer ?? void 0 : void 0;
|
|
7
7
|
}
|
|
8
|
-
/** This session's own current topology self-advertisement: the peer this connection is directly with, when known, and every device this connection currently holds a relay pairing with, each named alongside the hub it is reached via -- always this same direct peer, since a session has exactly one connection and a relay pairing on it can only ever have been established through that connection's own remote end. `via` is omitted, not guessed, when the hub itself has no known device-id (an anonymous relay-only hub, e.g. wire-mesh
|
|
8
|
+
/** This session's own current topology self-advertisement: the peer this connection is directly with, when known, and every device this connection currently holds a relay pairing with, each named alongside the hub it is reached via -- always this same direct peer, since a session has exactly one connection and a relay pairing on it can only ever have been established through that connection's own remote end. `via` is omitted, not guessed, when the hub itself has no known device-id (an anonymous relay-only hub, e.g. wire-mesh/cloudflare-hub's bare RelayHub, never gossips a self-advert of its own to learn one from). */
|
|
9
9
|
function computeTopologyPeers(inputs) {
|
|
10
10
|
const direct = directPeerDevice(inputs);
|
|
11
11
|
return {
|
|
@@ -10,7 +10,7 @@ export interface TopologyPeersInputs {
|
|
|
10
10
|
/** Every device this session's own connection currently holds a relay pairing with (relayPairings.list()). */
|
|
11
11
|
relayedDevices: readonly DeviceId[];
|
|
12
12
|
}
|
|
13
|
-
/** This session's own current topology self-advertisement: the peer this connection is directly with, when known, and every device this connection currently holds a relay pairing with, each named alongside the hub it is reached via -- always this same direct peer, since a session has exactly one connection and a relay pairing on it can only ever have been established through that connection's own remote end. `via` is omitted, not guessed, when the hub itself has no known device-id (an anonymous relay-only hub, e.g. wire-mesh
|
|
13
|
+
/** This session's own current topology self-advertisement: the peer this connection is directly with, when known, and every device this connection currently holds a relay pairing with, each named alongside the hub it is reached via -- always this same direct peer, since a session has exactly one connection and a relay pairing on it can only ever have been established through that connection's own remote end. `via` is omitted, not guessed, when the hub itself has no known device-id (an anonymous relay-only hub, e.g. wire-mesh/cloudflare-hub's bare RelayHub, never gossips a self-advert of its own to learn one from). */
|
|
14
14
|
export declare function computeTopologyPeers(inputs: Readonly<TopologyPeersInputs>): TopologyPeers;
|
|
15
15
|
export interface TopologySnapshotSources {
|
|
16
16
|
/** Reads connection?.peerDeviceId live at compute() time -- a closure rather than a plain value, since the connection itself can be replaced (reconnect) between one self-advert and the next. */
|
|
@@ -10,7 +10,7 @@ export interface TopologyPeersInputs {
|
|
|
10
10
|
/** Every device this session's own connection currently holds a relay pairing with (relayPairings.list()). */
|
|
11
11
|
relayedDevices: readonly DeviceId[];
|
|
12
12
|
}
|
|
13
|
-
/** This session's own current topology self-advertisement: the peer this connection is directly with, when known, and every device this connection currently holds a relay pairing with, each named alongside the hub it is reached via -- always this same direct peer, since a session has exactly one connection and a relay pairing on it can only ever have been established through that connection's own remote end. `via` is omitted, not guessed, when the hub itself has no known device-id (an anonymous relay-only hub, e.g. wire-mesh
|
|
13
|
+
/** This session's own current topology self-advertisement: the peer this connection is directly with, when known, and every device this connection currently holds a relay pairing with, each named alongside the hub it is reached via -- always this same direct peer, since a session has exactly one connection and a relay pairing on it can only ever have been established through that connection's own remote end. `via` is omitted, not guessed, when the hub itself has no known device-id (an anonymous relay-only hub, e.g. wire-mesh/cloudflare-hub's bare RelayHub, never gossips a self-advert of its own to learn one from). */
|
|
14
14
|
export declare function computeTopologyPeers(inputs: Readonly<TopologyPeersInputs>): TopologyPeers;
|
|
15
15
|
export interface TopologySnapshotSources {
|
|
16
16
|
/** Reads connection?.peerDeviceId live at compute() time -- a closure rather than a plain value, since the connection itself can be replaced (reconnect) between one self-advert and the next. */
|
|
@@ -4,7 +4,7 @@ function directPeerDevice(inputs) {
|
|
|
4
4
|
if (inputs.authenticatedPeer !== void 0) return inputs.authenticatedPeer;
|
|
5
5
|
return inputs.isAccepted ? inputs.firstAdvertisedPeer ?? void 0 : void 0;
|
|
6
6
|
}
|
|
7
|
-
/** This session's own current topology self-advertisement: the peer this connection is directly with, when known, and every device this connection currently holds a relay pairing with, each named alongside the hub it is reached via -- always this same direct peer, since a session has exactly one connection and a relay pairing on it can only ever have been established through that connection's own remote end. `via` is omitted, not guessed, when the hub itself has no known device-id (an anonymous relay-only hub, e.g. wire-mesh
|
|
7
|
+
/** This session's own current topology self-advertisement: the peer this connection is directly with, when known, and every device this connection currently holds a relay pairing with, each named alongside the hub it is reached via -- always this same direct peer, since a session has exactly one connection and a relay pairing on it can only ever have been established through that connection's own remote end. `via` is omitted, not guessed, when the hub itself has no known device-id (an anonymous relay-only hub, e.g. wire-mesh/cloudflare-hub's bare RelayHub, never gossips a self-advert of its own to learn one from). */
|
|
8
8
|
function computeTopologyPeers(inputs) {
|
|
9
9
|
const direct = directPeerDevice(inputs);
|
|
10
10
|
return {
|
package/package.json
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wire-mesh-core",
|
|
3
|
-
"version": "1.58.
|
|
3
|
+
"version": "1.58.3",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"cbor2": "2.3.0",
|
|
6
6
|
"cddl.js": "1.0.1",
|
|
7
|
-
"trilean": "1.6.
|
|
7
|
+
"trilean": "1.6.2",
|
|
8
8
|
"zod": "4.5.4"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@arethetypeswrong/cli": "0.18.5",
|
|
12
12
|
"@exadev/eslint-config": "2.18.0",
|
|
13
|
-
"@semantic-release/commit-analyzer": "13.0.1",
|
|
14
|
-
"@semantic-release/github": "12.0.9",
|
|
15
|
-
"@semantic-release/npm": "13.1.5",
|
|
16
|
-
"@semantic-release/release-notes-generator": "14.1.1",
|
|
17
13
|
"@stryker-mutator/api": "10.0.0",
|
|
18
14
|
"@stryker-mutator/core": "10.0.0",
|
|
19
15
|
"@stryker-mutator/typescript-checker": "10.0.0",
|
|
@@ -24,7 +20,6 @@
|
|
|
24
20
|
"globals": "17.12.0",
|
|
25
21
|
"jiti": "2.7.0",
|
|
26
22
|
"prettier": "3.9.6",
|
|
27
|
-
"semantic-release": "25.0.9",
|
|
28
23
|
"tsdown": "0.23.0",
|
|
29
24
|
"turbo": "2.10.12",
|
|
30
25
|
"typescript": "6.0.3",
|