wire-mesh-core 1.12.1 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/frame-codec.d.cts +1 -1
- package/dist/adapters/frame-codec.d.mts +1 -1
- package/dist/adapters/node-identity.d.cts +2 -2
- package/dist/adapters/node-identity.d.mts +2 -2
- package/dist/domain/device-id.d.cts +1 -1
- package/dist/domain/device-id.d.mts +1 -1
- package/dist/domain/handshake.d.cts +1 -1
- package/dist/domain/handshake.d.mts +1 -1
- package/dist/domain/mesh-session.cjs +39 -8
- package/dist/domain/mesh-session.d.cts +4 -2
- package/dist/domain/mesh-session.d.mts +4 -2
- package/dist/domain/mesh-session.mjs +39 -8
- package/dist/domain/revocation-view.d.cts +1 -1
- package/dist/domain/revocation-view.d.mts +1 -1
- package/dist/domain/room-token-verification.d.cts +1 -1
- package/dist/domain/room-token-verification.d.mts +1 -1
- package/dist/domain/tokens.d.cts +2 -2
- package/dist/domain/tokens.d.mts +2 -2
- package/dist/generated/protocol.cjs +1 -1
- package/dist/generated/protocol.d.cts +1 -1
- package/dist/generated/protocol.d.mts +1 -1
- package/dist/generated/protocol.mjs +1 -1
- package/dist/{identity-B9KsQUyZ.d.cts → identity-DvBEkcS9.d.mts} +1 -1
- package/dist/{identity-C65L-kBf.d.mts → identity-ijL0IsUT.d.cts} +1 -1
- package/dist/ports/identity.d.cts +1 -1
- package/dist/ports/identity.d.mts +1 -1
- package/dist/ports/transport.d.cts +1 -1
- package/dist/ports/transport.d.mts +1 -1
- package/dist/{protocol-CfYGYN0o.d.cts → protocol-BwFGx9cg.d.cts} +4 -4
- package/dist/{protocol-CfYGYN0o.d.mts → protocol-BwFGx9cg.d.mts} +4 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Frame } from "../protocol-
|
|
1
|
+
import { E as Frame } from "../protocol-BwFGx9cg.cjs";
|
|
2
2
|
//#region src/adapters/frame-codec.d.ts
|
|
3
3
|
export declare function messageFromFrame(frame: Frame): Uint8Array<ArrayBuffer>;
|
|
4
4
|
/** A frame that fails schema validation, caught separately from a decode failure so it can be dropped without disconnecting. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Frame } from "../protocol-
|
|
1
|
+
import { E as Frame } from "../protocol-BwFGx9cg.mjs";
|
|
2
2
|
//#region src/adapters/frame-codec.d.ts
|
|
3
3
|
export declare function messageFromFrame(frame: Frame): Uint8Array<ArrayBuffer>;
|
|
4
4
|
/** A frame that fails schema validation, caught separately from a decode failure so it can be dropped without disconnecting. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as IdentityKey, b as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { N as IdentityKey, b as DeviceId } from "../protocol-BwFGx9cg.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-ijL0IsUT.cjs";
|
|
3
3
|
import { webcrypto } from "node:crypto";
|
|
4
4
|
//#region src/adapters/node-identity.d.ts
|
|
5
5
|
export declare function deriveDeviceId(publicKey: Uint8Array): Promise<DeviceId>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as IdentityKey, b as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { N as IdentityKey, b as DeviceId } from "../protocol-BwFGx9cg.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DvBEkcS9.mjs";
|
|
3
3
|
import { webcrypto } from "node:crypto";
|
|
4
4
|
//#region src/adapters/node-identity.d.ts
|
|
5
5
|
export declare function deriveDeviceId(publicKey: Uint8Array): Promise<DeviceId>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as DeviceId } from "../protocol-
|
|
1
|
+
import { b as DeviceId } from "../protocol-BwFGx9cg.cjs";
|
|
2
2
|
//#region src/domain/device-id.d.ts
|
|
3
3
|
/** Lowercase, byte-exact hex for an arbitrary-length byte string -- the same encoding convention deviceIdToHex uses for the fixed-length device-id case, extracted so any other byte string needing a stable, displayable, map-keyable text form (e.g. a token-id, which tokens.cddl defines as an arbitrary-length bstr rather than a 32-byte device-id) can use the identical convention without going through a device-id-shaped function. */
|
|
4
4
|
export declare function bytesToHex(bytes: Uint8Array): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as DeviceId } from "../protocol-
|
|
1
|
+
import { b as DeviceId } from "../protocol-BwFGx9cg.mjs";
|
|
2
2
|
//#region src/domain/device-id.d.ts
|
|
3
3
|
/** Lowercase, byte-exact hex for an arbitrary-length byte string -- the same encoding convention deviceIdToHex uses for the fixed-length device-id case, extracted so any other byte string needing a stable, displayable, map-keyable text form (e.g. a token-id, which tokens.cddl defines as an arbitrary-length bstr rather than a 32-byte device-id) can use the identical convention without going through a device-id-shaped function. */
|
|
4
4
|
export declare function bytesToHex(bytes: Uint8Array): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as ProtocolVersion, C as DomainId, j as HandshakeFrame } from "../protocol-
|
|
1
|
+
import { $ as ProtocolVersion, C as DomainId, j as HandshakeFrame } from "../protocol-BwFGx9cg.cjs";
|
|
2
2
|
//#region src/domain/handshake.d.ts
|
|
3
3
|
/** The highest protocol version this build of core understands. */
|
|
4
4
|
export declare const SUPPORTED_PROTOCOL_VERSION: ProtocolVersion;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as ProtocolVersion, C as DomainId, j as HandshakeFrame } from "../protocol-
|
|
1
|
+
import { $ as ProtocolVersion, C as DomainId, j as HandshakeFrame } from "../protocol-BwFGx9cg.mjs";
|
|
2
2
|
//#region src/domain/handshake.d.ts
|
|
3
3
|
/** The highest protocol version this build of core understands. */
|
|
4
4
|
export declare const SUPPORTED_PROTOCOL_VERSION: ProtocolVersion;
|
|
@@ -4,6 +4,21 @@ const require_domain_handshake = require("./handshake.cjs");
|
|
|
4
4
|
const require_adapters_frame_codec = require("../adapters/frame-codec.cjs");
|
|
5
5
|
//#region src/domain/mesh-session.ts
|
|
6
6
|
const MS_PER_SECOND = 1e3;
|
|
7
|
+
/** peer-advert's own three typed fields -- reserved so a `sendGossipUpdate` caller can never override the session's own device-id, address list, or freshness timestamp by supplying an extension of the same name. */
|
|
8
|
+
const RESERVED_PEER_ADVERT_KEYS = /* @__PURE__ */ new Set([
|
|
9
|
+
"device",
|
|
10
|
+
"addresses",
|
|
11
|
+
"snapshot-seconds"
|
|
12
|
+
]);
|
|
13
|
+
/** A gossip extension key must be domain-qualified as `<domain>/<field>` (lowercase kebab-case each side), per `spec/CONVENTIONS.md`'s gossip-extension-namespacing convention -- this is what stops two independent applications sharing one gossip tail from silently colliding on a bare name like "status". */
|
|
14
|
+
const GOSSIP_EXTENSION_KEY_PATTERN = /^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/;
|
|
15
|
+
/** Rejects a `sendGossipUpdate` extension bag that would either shadow one of peer-advert's own mandatory fields or use a bare, non-domain-qualified key -- both are caller bugs that must fail loudly at the call site, not silently corrupt or ambiguously merge into the wire frame. */
|
|
16
|
+
function validateGossipExtensions(extensions) {
|
|
17
|
+
for (const key of Object.keys(extensions)) {
|
|
18
|
+
if (RESERVED_PEER_ADVERT_KEYS.has(key)) throw new Error(`sendGossipUpdate extension key "${key}" collides with a mandatory peer-advert field`);
|
|
19
|
+
if (!GOSSIP_EXTENSION_KEY_PATTERN.test(key)) throw new Error(`sendGossipUpdate extension key "${key}" must be domain-qualified as "<domain>/<field>" (e.g. "presence/status")`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
7
22
|
/** How long to wait for the node's handshake before calling it unanswered. A relay-only node never sends one; that is a state to display, not an error. */
|
|
8
23
|
const HANDSHAKE_TIMEOUT_MS = 3e3;
|
|
9
24
|
function localHandshake(domains) {
|
|
@@ -228,6 +243,19 @@ function createSessionCore(identity, clock, reconnect, dial, onPeerAdvert, addre
|
|
|
228
243
|
}
|
|
229
244
|
if (state.status === "connected") handleDisconnect("node closed the connection", address, localDomains);
|
|
230
245
|
}
|
|
246
|
+
/** Builds this side's own self-advert: this node's own directly-reachable addresses (wire-mesh#38), or none for a caller with nothing to offer (a browser client, which cannot accept inbound connections) -- either is an honest advert, not a stopgap. extensions merge onto peer-advert's own open `* tstr => any` tail -- the mechanism sendGossipUpdate uses to keep a gossiped fact (presence status, an accept/refuse policy, or any future domain's own) live over the connection's lifetime. Extensions are spread before the three mandatory fields (never after) so a caller-supplied key of the same name can never shadow them on the wire -- validateGossipExtensions already rejects that case loudly, but the field order is kept safe in its own right rather than relying solely on the guard staying in sync. */
|
|
247
|
+
function buildSelfAdvert(extensions) {
|
|
248
|
+
if (extensions !== void 0) validateGossipExtensions(extensions);
|
|
249
|
+
return {
|
|
250
|
+
type: "gossip",
|
|
251
|
+
peers: [{
|
|
252
|
+
...extensions,
|
|
253
|
+
device: identity.deviceId,
|
|
254
|
+
addresses: [...addresses],
|
|
255
|
+
"snapshot-seconds": Math.floor(clock.now() / MS_PER_SECOND)
|
|
256
|
+
}]
|
|
257
|
+
};
|
|
258
|
+
}
|
|
231
259
|
/** Everything a connection needs once it exists, regardless of whether it was dialled (createMeshSession's own doConnect, below) or handed over already established (acceptMeshSession): send this side's handshake and self-advert, arm the handshake timeout, and start consuming frames. The two entry points differ only in how link itself came to exist and what address means for it -- a real dial target for one, a caller-chosen label for the other, since the Connection/Transport ports expose no remote-address concept of their own for an accepted connection. */
|
|
232
260
|
async function wireUpConnection(link, address, localDomains) {
|
|
233
261
|
connection = link;
|
|
@@ -244,14 +272,7 @@ function createSessionCore(identity, clock, reconnect, dial, onPeerAdvert, addre
|
|
|
244
272
|
});
|
|
245
273
|
await connection.send(localHandshakeSent);
|
|
246
274
|
emit();
|
|
247
|
-
const selfAdvert =
|
|
248
|
-
type: "gossip",
|
|
249
|
-
peers: [{
|
|
250
|
-
device: identity.deviceId,
|
|
251
|
-
addresses: [...addresses],
|
|
252
|
-
"snapshot-seconds": Math.floor(clock.now() / MS_PER_SECOND)
|
|
253
|
-
}]
|
|
254
|
-
};
|
|
275
|
+
const selfAdvert = buildSelfAdvert();
|
|
255
276
|
frameLog.push({
|
|
256
277
|
direction: "sent",
|
|
257
278
|
frame: selfAdvert
|
|
@@ -397,6 +418,16 @@ function createSessionCore(identity, clock, reconnect, dial, onPeerAdvert, addre
|
|
|
397
418
|
await transmit(frame, false);
|
|
398
419
|
emit();
|
|
399
420
|
},
|
|
421
|
+
async sendGossipUpdate(extensions) {
|
|
422
|
+
if (connection === null || state.status !== "connected") throw new Error("not connected");
|
|
423
|
+
const frame = buildSelfAdvert(extensions);
|
|
424
|
+
frameLog.push({
|
|
425
|
+
direction: "sent",
|
|
426
|
+
frame
|
|
427
|
+
});
|
|
428
|
+
await transmit(frame, false);
|
|
429
|
+
emit();
|
|
430
|
+
},
|
|
400
431
|
async close() {
|
|
401
432
|
feedCancelled = true;
|
|
402
433
|
if (handshakeTimer !== null) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as ProtocolVersion, E as Frame, G as PeerAdvert, I as ManageError, L as ManageOk, P as ManageCommand, a as CapabilityScope, b as DeviceId, o as CapabilityToken, ut as RevocationEntry } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { $ as ProtocolVersion, E as Frame, G as PeerAdvert, I as ManageError, L as ManageOk, P as ManageCommand, a as CapabilityScope, b as DeviceId, o as CapabilityToken, ut as RevocationEntry } from "../protocol-BwFGx9cg.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-ijL0IsUT.cjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
4
4
|
import { Connection, Transport } from "../ports/transport.cjs";
|
|
5
5
|
//#region src/domain/mesh-session.d.ts
|
|
@@ -81,6 +81,8 @@ export interface MeshSession {
|
|
|
81
81
|
setToken: (token: CapabilityToken) => void;
|
|
82
82
|
/** Announces one or more already-minted revocation-entries to the peer. Sent directly over the connection, never relay-wrapped -- revocation-announce is a gossiped broadcast, not a request addressed to a specific peer, so it has no targetDevice/token parameters the way sendManageRequest does. */
|
|
83
83
|
sendRevocationAnnounce: (entries: readonly RevocationEntry[]) => Promise<void>;
|
|
84
|
+
/** Re-sends this side's own self-advert with a fresh snapshot-seconds and, when given, extensions merged onto peer-advert's own open `* tstr => any` tail -- the mechanism a caller uses to keep gossiped presence status (or any other advertised fact) live over a connection's lifetime, since the initial self-advert wireUpConnection sends at connect time is otherwise never repeated. Callers own their own re-advertisement cadence (there is no timer inside MeshSession itself, matching its own DOM-free, fully unit-testable design); a caller not calling this again after connecting is exactly today's existing gossip-once-on-connect behaviour. */
|
|
85
|
+
sendGossipUpdate: (extensions?: Record<string, unknown>) => Promise<void>;
|
|
84
86
|
/** Sends a manage-request and resolves with the matching manage-response's outcome, correlated by request-id. When targetDevice is given, the request is routed to that specific peer via an established relay-connect pairing (wrapped as relay-data) rather than sent directly over this session's own Connection -- relay-hub deliberately drops manage-request/manage-response frames sent to it directly, since routing between two connected peers is not the relay role's business, so a specific peer reachable only through a relay hub can only be addressed this way. Absent, this sends directly over the Connection exactly as before. When token is given, it is attached to this one request instead of whatever setToken last set -- a single session routinely needs a different token per request when its peer shares more than one scope with this side (e.g. several core/room memberships over one connection), and a session-global token can only ever be correct for one of them. Absent, this request carries setToken's own session-global token exactly as before. When timeoutMs is given, the returned promise resolves with `{ result: "error", code: "timeout" }` rather than hanging forever if no manage-response arrives in time -- a held-open request (a human approval, a not-yet-online peer) otherwise has no way for the caller to give up on it. Absent, this request waits exactly as before, with no time limit of its own. */
|
|
85
87
|
sendManageRequest: (command: ManageCommand, scope: Readonly<CapabilityScope>, targetDevice?: DeviceId, token?: CapabilityToken, timeoutMs?: number) => Promise<ManageOutcome>;
|
|
86
88
|
close: () => Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as ProtocolVersion, E as Frame, G as PeerAdvert, I as ManageError, L as ManageOk, P as ManageCommand, a as CapabilityScope, b as DeviceId, o as CapabilityToken, ut as RevocationEntry } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { $ as ProtocolVersion, E as Frame, G as PeerAdvert, I as ManageError, L as ManageOk, P as ManageCommand, a as CapabilityScope, b as DeviceId, o as CapabilityToken, ut as RevocationEntry } from "../protocol-BwFGx9cg.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DvBEkcS9.mjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
4
4
|
import { Connection, Transport } from "../ports/transport.mjs";
|
|
5
5
|
//#region src/domain/mesh-session.d.ts
|
|
@@ -81,6 +81,8 @@ export interface MeshSession {
|
|
|
81
81
|
setToken: (token: CapabilityToken) => void;
|
|
82
82
|
/** Announces one or more already-minted revocation-entries to the peer. Sent directly over the connection, never relay-wrapped -- revocation-announce is a gossiped broadcast, not a request addressed to a specific peer, so it has no targetDevice/token parameters the way sendManageRequest does. */
|
|
83
83
|
sendRevocationAnnounce: (entries: readonly RevocationEntry[]) => Promise<void>;
|
|
84
|
+
/** Re-sends this side's own self-advert with a fresh snapshot-seconds and, when given, extensions merged onto peer-advert's own open `* tstr => any` tail -- the mechanism a caller uses to keep gossiped presence status (or any other advertised fact) live over a connection's lifetime, since the initial self-advert wireUpConnection sends at connect time is otherwise never repeated. Callers own their own re-advertisement cadence (there is no timer inside MeshSession itself, matching its own DOM-free, fully unit-testable design); a caller not calling this again after connecting is exactly today's existing gossip-once-on-connect behaviour. */
|
|
85
|
+
sendGossipUpdate: (extensions?: Record<string, unknown>) => Promise<void>;
|
|
84
86
|
/** Sends a manage-request and resolves with the matching manage-response's outcome, correlated by request-id. When targetDevice is given, the request is routed to that specific peer via an established relay-connect pairing (wrapped as relay-data) rather than sent directly over this session's own Connection -- relay-hub deliberately drops manage-request/manage-response frames sent to it directly, since routing between two connected peers is not the relay role's business, so a specific peer reachable only through a relay hub can only be addressed this way. Absent, this sends directly over the Connection exactly as before. When token is given, it is attached to this one request instead of whatever setToken last set -- a single session routinely needs a different token per request when its peer shares more than one scope with this side (e.g. several core/room memberships over one connection), and a session-global token can only ever be correct for one of them. Absent, this request carries setToken's own session-global token exactly as before. When timeoutMs is given, the returned promise resolves with `{ result: "error", code: "timeout" }` rather than hanging forever if no manage-response arrives in time -- a held-open request (a human approval, a not-yet-online peer) otherwise has no way for the caller to give up on it. Absent, this request waits exactly as before, with no time limit of its own. */
|
|
85
87
|
sendManageRequest: (command: ManageCommand, scope: Readonly<CapabilityScope>, targetDevice?: DeviceId, token?: CapabilityToken, timeoutMs?: number) => Promise<ManageOutcome>;
|
|
86
88
|
close: () => Promise<void>;
|
|
@@ -3,6 +3,21 @@ import { negotiate } from "./handshake.mjs";
|
|
|
3
3
|
import { messageFromFrame, tryDecodeFrame } from "../adapters/frame-codec.mjs";
|
|
4
4
|
//#region src/domain/mesh-session.ts
|
|
5
5
|
const MS_PER_SECOND = 1e3;
|
|
6
|
+
/** peer-advert's own three typed fields -- reserved so a `sendGossipUpdate` caller can never override the session's own device-id, address list, or freshness timestamp by supplying an extension of the same name. */
|
|
7
|
+
const RESERVED_PEER_ADVERT_KEYS = /* @__PURE__ */ new Set([
|
|
8
|
+
"device",
|
|
9
|
+
"addresses",
|
|
10
|
+
"snapshot-seconds"
|
|
11
|
+
]);
|
|
12
|
+
/** A gossip extension key must be domain-qualified as `<domain>/<field>` (lowercase kebab-case each side), per `spec/CONVENTIONS.md`'s gossip-extension-namespacing convention -- this is what stops two independent applications sharing one gossip tail from silently colliding on a bare name like "status". */
|
|
13
|
+
const GOSSIP_EXTENSION_KEY_PATTERN = /^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/;
|
|
14
|
+
/** Rejects a `sendGossipUpdate` extension bag that would either shadow one of peer-advert's own mandatory fields or use a bare, non-domain-qualified key -- both are caller bugs that must fail loudly at the call site, not silently corrupt or ambiguously merge into the wire frame. */
|
|
15
|
+
function validateGossipExtensions(extensions) {
|
|
16
|
+
for (const key of Object.keys(extensions)) {
|
|
17
|
+
if (RESERVED_PEER_ADVERT_KEYS.has(key)) throw new Error(`sendGossipUpdate extension key "${key}" collides with a mandatory peer-advert field`);
|
|
18
|
+
if (!GOSSIP_EXTENSION_KEY_PATTERN.test(key)) throw new Error(`sendGossipUpdate extension key "${key}" must be domain-qualified as "<domain>/<field>" (e.g. "presence/status")`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
6
21
|
/** How long to wait for the node's handshake before calling it unanswered. A relay-only node never sends one; that is a state to display, not an error. */
|
|
7
22
|
const HANDSHAKE_TIMEOUT_MS = 3e3;
|
|
8
23
|
function localHandshake(domains) {
|
|
@@ -227,6 +242,19 @@ function createSessionCore(identity, clock, reconnect, dial, onPeerAdvert, addre
|
|
|
227
242
|
}
|
|
228
243
|
if (state.status === "connected") handleDisconnect("node closed the connection", address, localDomains);
|
|
229
244
|
}
|
|
245
|
+
/** Builds this side's own self-advert: this node's own directly-reachable addresses (wire-mesh#38), or none for a caller with nothing to offer (a browser client, which cannot accept inbound connections) -- either is an honest advert, not a stopgap. extensions merge onto peer-advert's own open `* tstr => any` tail -- the mechanism sendGossipUpdate uses to keep a gossiped fact (presence status, an accept/refuse policy, or any future domain's own) live over the connection's lifetime. Extensions are spread before the three mandatory fields (never after) so a caller-supplied key of the same name can never shadow them on the wire -- validateGossipExtensions already rejects that case loudly, but the field order is kept safe in its own right rather than relying solely on the guard staying in sync. */
|
|
246
|
+
function buildSelfAdvert(extensions) {
|
|
247
|
+
if (extensions !== void 0) validateGossipExtensions(extensions);
|
|
248
|
+
return {
|
|
249
|
+
type: "gossip",
|
|
250
|
+
peers: [{
|
|
251
|
+
...extensions,
|
|
252
|
+
device: identity.deviceId,
|
|
253
|
+
addresses: [...addresses],
|
|
254
|
+
"snapshot-seconds": Math.floor(clock.now() / MS_PER_SECOND)
|
|
255
|
+
}]
|
|
256
|
+
};
|
|
257
|
+
}
|
|
230
258
|
/** Everything a connection needs once it exists, regardless of whether it was dialled (createMeshSession's own doConnect, below) or handed over already established (acceptMeshSession): send this side's handshake and self-advert, arm the handshake timeout, and start consuming frames. The two entry points differ only in how link itself came to exist and what address means for it -- a real dial target for one, a caller-chosen label for the other, since the Connection/Transport ports expose no remote-address concept of their own for an accepted connection. */
|
|
231
259
|
async function wireUpConnection(link, address, localDomains) {
|
|
232
260
|
connection = link;
|
|
@@ -243,14 +271,7 @@ function createSessionCore(identity, clock, reconnect, dial, onPeerAdvert, addre
|
|
|
243
271
|
});
|
|
244
272
|
await connection.send(localHandshakeSent);
|
|
245
273
|
emit();
|
|
246
|
-
const selfAdvert =
|
|
247
|
-
type: "gossip",
|
|
248
|
-
peers: [{
|
|
249
|
-
device: identity.deviceId,
|
|
250
|
-
addresses: [...addresses],
|
|
251
|
-
"snapshot-seconds": Math.floor(clock.now() / MS_PER_SECOND)
|
|
252
|
-
}]
|
|
253
|
-
};
|
|
274
|
+
const selfAdvert = buildSelfAdvert();
|
|
254
275
|
frameLog.push({
|
|
255
276
|
direction: "sent",
|
|
256
277
|
frame: selfAdvert
|
|
@@ -396,6 +417,16 @@ function createSessionCore(identity, clock, reconnect, dial, onPeerAdvert, addre
|
|
|
396
417
|
await transmit(frame, false);
|
|
397
418
|
emit();
|
|
398
419
|
},
|
|
420
|
+
async sendGossipUpdate(extensions) {
|
|
421
|
+
if (connection === null || state.status !== "connected") throw new Error("not connected");
|
|
422
|
+
const frame = buildSelfAdvert(extensions);
|
|
423
|
+
frameLog.push({
|
|
424
|
+
direction: "sent",
|
|
425
|
+
frame
|
|
426
|
+
});
|
|
427
|
+
await transmit(frame, false);
|
|
428
|
+
emit();
|
|
429
|
+
},
|
|
399
430
|
async close() {
|
|
400
431
|
feedCancelled = true;
|
|
401
432
|
if (handshakeTimer !== null) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ut as RevocationEntry } from "../protocol-
|
|
1
|
+
import { ut as RevocationEntry } from "../protocol-BwFGx9cg.cjs";
|
|
2
2
|
import { RevocationCheck, RevocationEntryVerdict, VerifyRevocationEntryOptions } from "./tokens.cjs";
|
|
3
3
|
//#region src/domain/revocation-view.d.ts
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ut as RevocationEntry } from "../protocol-
|
|
1
|
+
import { ut as RevocationEntry } from "../protocol-BwFGx9cg.mjs";
|
|
2
2
|
import { RevocationCheck, RevocationEntryVerdict, VerifyRevocationEntryOptions } from "./tokens.mjs";
|
|
3
3
|
//#region src/domain/revocation-view.d.ts
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ot as TokenClaims, b as DeviceId, o as CapabilityToken } from "../protocol-
|
|
1
|
+
import { Ot as TokenClaims, b as DeviceId, o as CapabilityToken } from "../protocol-BwFGx9cg.cjs";
|
|
2
2
|
import { TokenVerdictReason, VerifyCapabilityTokenOptions } from "./tokens.cjs";
|
|
3
3
|
//#region src/domain/room-token-verification.d.ts
|
|
4
4
|
/** The one capability every core/room verb (room.send/read/leave/members) is gated by, per spec/room.cddl -- room.join/room.invite are deliberately ungated instead and need no token check at all. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ot as TokenClaims, b as DeviceId, o as CapabilityToken } from "../protocol-
|
|
1
|
+
import { Ot as TokenClaims, b as DeviceId, o as CapabilityToken } from "../protocol-BwFGx9cg.mjs";
|
|
2
2
|
import { TokenVerdictReason, VerifyCapabilityTokenOptions } from "./tokens.mjs";
|
|
3
3
|
//#region src/domain/room-token-verification.d.ts
|
|
4
4
|
/** The one capability every core/room verb (room.send/read/leave/members) is gated by, per spec/room.cddl -- room.join/room.invite are deliberately ungated instead and need no token check at all. */
|
package/dist/domain/tokens.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Ot as TokenClaims, b as DeviceId, lt as RevocationClaims, o as CapabilityToken, ut as RevocationEntry } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { Ot as TokenClaims, b as DeviceId, lt as RevocationClaims, o as CapabilityToken, ut as RevocationEntry } from "../protocol-BwFGx9cg.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-ijL0IsUT.cjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
4
4
|
//#region src/domain/tokens.d.ts
|
|
5
5
|
/**
|
package/dist/domain/tokens.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Ot as TokenClaims, b as DeviceId, lt as RevocationClaims, o as CapabilityToken, ut as RevocationEntry } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { Ot as TokenClaims, b as DeviceId, lt as RevocationClaims, o as CapabilityToken, ut as RevocationEntry } from "../protocol-BwFGx9cg.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DvBEkcS9.mjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
4
4
|
//#region src/domain/tokens.d.ts
|
|
5
5
|
/**
|
|
@@ -316,7 +316,7 @@ const peerAdvertSchema = zod.z.lazy(() => zod.z.object({
|
|
|
316
316
|
"device": zod.z.lazy(() => deviceIdSchema),
|
|
317
317
|
"addresses": zod.z.array(zod.z.string()),
|
|
318
318
|
"snapshot-seconds": zod.z.number().int()
|
|
319
|
-
}));
|
|
319
|
+
}).catchall(zod.z.unknown()));
|
|
320
320
|
const gossipFrameSchema = zod.z.lazy(() => zod.z.object({
|
|
321
321
|
"type": zod.z.literal("gossip"),
|
|
322
322
|
"peers": zod.z.array(zod.z.lazy(() => peerAdvertSchema))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ProtocolVersion, $n as roomReadSchema, $t as deviceIdSchema, A as HandleRecord, An as procSpawnSchema, At as WebrtcIceCandidate, B as MessageRef, Bn as revocationAnnounceFrameSchema, Bt as closeFrameSchema, C as DomainId, Cn as peerAdvertSchema, Ct as StreamAckFrame, D as FrameVariant, Dn as privateUseDomainIdSchema, Dt as SyncPunchFrame, E as Frame, En as privateUseCapabilitySchema, Et as StreamSession, F as ManageCommandParams, Fn as ptyWriteSchema, Ft as capabilityGrantOkSchema, G as PeerAdvert, Gn as roomJoinSchema, Gt as coseHeaderKidSchema, H as NamespacedDomainId, Hn as revocationEntrySchema, Ht as coreCapabilitySchema, I as ManageError, In as relayConnectFrameSchema, It as capabilityRequestSchema, J as PrivateUseCapability, Jn as roomMembersOkSchema, Jt as coseTokenHeadersSchema, K as PeerIdentity, Kn as roomLeaveSchema, Kt as coseHeaderLabelSchema, L as ManageOk, Ln as relayDataFrameSchema, Lt as capabilityScopeSchema, M as IceCandidateInit, Mn as ptyKillSchema, Mt as WireCandidate, N as IdentityKey, Nn as ptyResizeSchema, Nt as candidateKindSchema, O as GossipFrame, On as procKillSchema, Ot as TokenClaims, P as ManageCommand, Pn as ptySpawnSchema, Pt as candidatesFrameSchema, Q as ProcSpawn, Qn as roomPathSchema, Qt as deviceIdHexSchema, R as ManageRequestFrame, Rn as relayInboundFrameSchema, Rt as capabilityTokenSchema, S as DmRoomPath, Sn as ownerNamedRoomPathSchema, St as RoomSend, T as ExecSessionInfo, Tn as pingFrameSchema, Tt as StreamEndFrame, U as ObservedAddressFrame, Un as roomInviteSchema, Ut as coreDomainNameSchema, V as NamespacedCapability, Vn as revocationClaimsSchema, Vt as coordinatorFrameSchema, W as OwnerNamedRoomPath, Wn as roomJoinOkSchema, Wt as coseHeaderAlgSchema, X as ProcKill, Xn as roomNoticeClaimsSchema, Xt as dataHaveFrameSchema, Y as PrivateUseDomainId, Yn as roomMembersSchema, Yt as dataEntriesFrameSchema, Z as ProcSignal, Zn as roomNoticeSchema, Zt as dataRequestFrameSchema, _ as DataEntriesFrame, _n as manageResponseFrameSchema, _t as RoomMembersOk, a as CapabilityScope, an as frameVariantSchema, ar as syncPunchFrameSchema, at as RelayDataFrame, b as DeviceId, bn as namespacedDomainIdSchema, bt as RoomPath, c as CloseFrame, cn as handleRecordSchema, cr as webrtcIceCandidateSchema, ct as RevocationAnnounceFrame, d as CoreDomainName, dn as identityKeySchema, dt as RoomInvite, en as dmRoomPathSchema, er as roomSendSchema, et as PtyKill, f as CoseHeaderAlg, fn as manageCommandParamsSchema, ft as RoomJoin, g as CoseTokenHeaders, gn as manageRequestFrameSchema, gt as RoomMembers, h as CoseSign1, hn as manageOkSchema, ht as RoomMember, i as CapabilityRequest, in as frameSchema, ir as streamSessionSchema, it as RelayConnectFrame, j as HandshakeFrame, jn as protocolVersionSchema, jt as WebrtcOffer, k as HandleClaims, kn as procSignalSchema, kt as WebrtcAnswer, l as CoordinatorFrame, ln as handshakeFrameSchema, lr as webrtcOfferSchema, lt as RevocationClaims, m as CoseHeaderLabel, mn as manageErrorSchema, mt as RoomLeave, n as CandidatesFrame, nn as execListSchema, nr as streamDataFrameSchema, nt as PtySpawn, o as CapabilityToken, on as gossipFrameSchema, or as tokenClaimsSchema, ot as RelayInboundFrame, p as CoseHeaderKid, pn as manageCommandSchema, pt as RoomJoinOk, q as PingFrame, qn as roomMemberSchema, qt as coseSign1Schema, r as CapabilityGrantOk, rn as execSessionInfoSchema, rr as streamEndFrameSchema, rt as PtyWrite, s as CapabilityVerb, sn as handleClaimsSchema, sr as webrtcAnswerSchema, st as RelayOfferFrame, t as CandidateKind, tn as domainIdSchema, tr as streamAckFrameSchema, tt as PtyResize, u as CoreCapability, un as iceCandidateInitSchema, ur as wireCandidateSchema, ut as RevocationEntry, v as DataHaveFrame, vn as messageRefSchema, vt as RoomNotice, w as ExecList, wn as peerIdentitySchema, wt as StreamDataFrame, x as DeviceIdHex, xn as observedAddressFrameSchema, xt as RoomRead, y as DataRequestFrame, yn as namespacedCapabilitySchema, yt as RoomNoticeClaims, z as ManageResponseFrame, zn as relayOfferFrameSchema, zt as capabilityVerbSchema } from "../protocol-
|
|
1
|
+
import { $ as ProtocolVersion, $n as roomReadSchema, $t as deviceIdSchema, A as HandleRecord, An as procSpawnSchema, At as WebrtcIceCandidate, B as MessageRef, Bn as revocationAnnounceFrameSchema, Bt as closeFrameSchema, C as DomainId, Cn as peerAdvertSchema, Ct as StreamAckFrame, D as FrameVariant, Dn as privateUseDomainIdSchema, Dt as SyncPunchFrame, E as Frame, En as privateUseCapabilitySchema, Et as StreamSession, F as ManageCommandParams, Fn as ptyWriteSchema, Ft as capabilityGrantOkSchema, G as PeerAdvert, Gn as roomJoinSchema, Gt as coseHeaderKidSchema, H as NamespacedDomainId, Hn as revocationEntrySchema, Ht as coreCapabilitySchema, I as ManageError, In as relayConnectFrameSchema, It as capabilityRequestSchema, J as PrivateUseCapability, Jn as roomMembersOkSchema, Jt as coseTokenHeadersSchema, K as PeerIdentity, Kn as roomLeaveSchema, Kt as coseHeaderLabelSchema, L as ManageOk, Ln as relayDataFrameSchema, Lt as capabilityScopeSchema, M as IceCandidateInit, Mn as ptyKillSchema, Mt as WireCandidate, N as IdentityKey, Nn as ptyResizeSchema, Nt as candidateKindSchema, O as GossipFrame, On as procKillSchema, Ot as TokenClaims, P as ManageCommand, Pn as ptySpawnSchema, Pt as candidatesFrameSchema, Q as ProcSpawn, Qn as roomPathSchema, Qt as deviceIdHexSchema, R as ManageRequestFrame, Rn as relayInboundFrameSchema, Rt as capabilityTokenSchema, S as DmRoomPath, Sn as ownerNamedRoomPathSchema, St as RoomSend, T as ExecSessionInfo, Tn as pingFrameSchema, Tt as StreamEndFrame, U as ObservedAddressFrame, Un as roomInviteSchema, Ut as coreDomainNameSchema, V as NamespacedCapability, Vn as revocationClaimsSchema, Vt as coordinatorFrameSchema, W as OwnerNamedRoomPath, Wn as roomJoinOkSchema, Wt as coseHeaderAlgSchema, X as ProcKill, Xn as roomNoticeClaimsSchema, Xt as dataHaveFrameSchema, Y as PrivateUseDomainId, Yn as roomMembersSchema, Yt as dataEntriesFrameSchema, Z as ProcSignal, Zn as roomNoticeSchema, Zt as dataRequestFrameSchema, _ as DataEntriesFrame, _n as manageResponseFrameSchema, _t as RoomMembersOk, a as CapabilityScope, an as frameVariantSchema, ar as syncPunchFrameSchema, at as RelayDataFrame, b as DeviceId, bn as namespacedDomainIdSchema, bt as RoomPath, c as CloseFrame, cn as handleRecordSchema, cr as webrtcIceCandidateSchema, ct as RevocationAnnounceFrame, d as CoreDomainName, dn as identityKeySchema, dt as RoomInvite, en as dmRoomPathSchema, er as roomSendSchema, et as PtyKill, f as CoseHeaderAlg, fn as manageCommandParamsSchema, ft as RoomJoin, g as CoseTokenHeaders, gn as manageRequestFrameSchema, gt as RoomMembers, h as CoseSign1, hn as manageOkSchema, ht as RoomMember, i as CapabilityRequest, in as frameSchema, ir as streamSessionSchema, it as RelayConnectFrame, j as HandshakeFrame, jn as protocolVersionSchema, jt as WebrtcOffer, k as HandleClaims, kn as procSignalSchema, kt as WebrtcAnswer, l as CoordinatorFrame, ln as handshakeFrameSchema, lr as webrtcOfferSchema, lt as RevocationClaims, m as CoseHeaderLabel, mn as manageErrorSchema, mt as RoomLeave, n as CandidatesFrame, nn as execListSchema, nr as streamDataFrameSchema, nt as PtySpawn, o as CapabilityToken, on as gossipFrameSchema, or as tokenClaimsSchema, ot as RelayInboundFrame, p as CoseHeaderKid, pn as manageCommandSchema, pt as RoomJoinOk, q as PingFrame, qn as roomMemberSchema, qt as coseSign1Schema, r as CapabilityGrantOk, rn as execSessionInfoSchema, rr as streamEndFrameSchema, rt as PtyWrite, s as CapabilityVerb, sn as handleClaimsSchema, sr as webrtcAnswerSchema, st as RelayOfferFrame, t as CandidateKind, tn as domainIdSchema, tr as streamAckFrameSchema, tt as PtyResize, u as CoreCapability, un as iceCandidateInitSchema, ur as wireCandidateSchema, ut as RevocationEntry, v as DataHaveFrame, vn as messageRefSchema, vt as RoomNotice, w as ExecList, wn as peerIdentitySchema, wt as StreamDataFrame, x as DeviceIdHex, xn as observedAddressFrameSchema, xt as RoomRead, y as DataRequestFrame, yn as namespacedCapabilitySchema, yt as RoomNoticeClaims, z as ManageResponseFrame, zn as relayOfferFrameSchema, zt as capabilityVerbSchema } from "../protocol-BwFGx9cg.cjs";
|
|
2
2
|
export { CandidateKind, CandidatesFrame, CapabilityGrantOk, CapabilityRequest, CapabilityScope, CapabilityToken, CapabilityVerb, CloseFrame, CoordinatorFrame, CoreCapability, CoreDomainName, CoseHeaderAlg, CoseHeaderKid, CoseHeaderLabel, CoseSign1, CoseTokenHeaders, DataEntriesFrame, DataHaveFrame, DataRequestFrame, DeviceId, DeviceIdHex, DmRoomPath, DomainId, ExecList, ExecSessionInfo, Frame, FrameVariant, GossipFrame, HandleClaims, HandleRecord, HandshakeFrame, IceCandidateInit, IdentityKey, ManageCommand, ManageCommandParams, ManageError, ManageOk, ManageRequestFrame, ManageResponseFrame, MessageRef, NamespacedCapability, NamespacedDomainId, ObservedAddressFrame, OwnerNamedRoomPath, PeerAdvert, PeerIdentity, PingFrame, PrivateUseCapability, PrivateUseDomainId, ProcKill, ProcSignal, ProcSpawn, ProtocolVersion, PtyKill, PtyResize, PtySpawn, PtyWrite, RelayConnectFrame, RelayDataFrame, RelayInboundFrame, RelayOfferFrame, RevocationAnnounceFrame, RevocationClaims, RevocationEntry, RoomInvite, RoomJoin, RoomJoinOk, RoomLeave, RoomMember, RoomMembers, RoomMembersOk, RoomNotice, RoomNoticeClaims, RoomPath, RoomRead, RoomSend, StreamAckFrame, StreamDataFrame, StreamEndFrame, StreamSession, SyncPunchFrame, TokenClaims, WebrtcAnswer, WebrtcIceCandidate, WebrtcOffer, WireCandidate, candidateKindSchema, candidatesFrameSchema, capabilityGrantOkSchema, capabilityRequestSchema, capabilityScopeSchema, capabilityTokenSchema, capabilityVerbSchema, closeFrameSchema, coordinatorFrameSchema, coreCapabilitySchema, coreDomainNameSchema, coseHeaderAlgSchema, coseHeaderKidSchema, coseHeaderLabelSchema, coseSign1Schema, coseTokenHeadersSchema, dataEntriesFrameSchema, dataHaveFrameSchema, dataRequestFrameSchema, deviceIdHexSchema, deviceIdSchema, dmRoomPathSchema, domainIdSchema, execListSchema, execSessionInfoSchema, frameSchema, frameVariantSchema, gossipFrameSchema, handleClaimsSchema, handleRecordSchema, handshakeFrameSchema, iceCandidateInitSchema, identityKeySchema, manageCommandParamsSchema, manageCommandSchema, manageErrorSchema, manageOkSchema, manageRequestFrameSchema, manageResponseFrameSchema, messageRefSchema, namespacedCapabilitySchema, namespacedDomainIdSchema, observedAddressFrameSchema, ownerNamedRoomPathSchema, peerAdvertSchema, peerIdentitySchema, pingFrameSchema, privateUseCapabilitySchema, privateUseDomainIdSchema, procKillSchema, procSignalSchema, procSpawnSchema, protocolVersionSchema, ptyKillSchema, ptyResizeSchema, ptySpawnSchema, ptyWriteSchema, relayConnectFrameSchema, relayDataFrameSchema, relayInboundFrameSchema, relayOfferFrameSchema, revocationAnnounceFrameSchema, revocationClaimsSchema, revocationEntrySchema, roomInviteSchema, roomJoinOkSchema, roomJoinSchema, roomLeaveSchema, roomMemberSchema, roomMembersOkSchema, roomMembersSchema, roomNoticeClaimsSchema, roomNoticeSchema, roomPathSchema, roomReadSchema, roomSendSchema, streamAckFrameSchema, streamDataFrameSchema, streamEndFrameSchema, streamSessionSchema, syncPunchFrameSchema, tokenClaimsSchema, webrtcAnswerSchema, webrtcIceCandidateSchema, webrtcOfferSchema, wireCandidateSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ProtocolVersion, $n as roomReadSchema, $t as deviceIdSchema, A as HandleRecord, An as procSpawnSchema, At as WebrtcIceCandidate, B as MessageRef, Bn as revocationAnnounceFrameSchema, Bt as closeFrameSchema, C as DomainId, Cn as peerAdvertSchema, Ct as StreamAckFrame, D as FrameVariant, Dn as privateUseDomainIdSchema, Dt as SyncPunchFrame, E as Frame, En as privateUseCapabilitySchema, Et as StreamSession, F as ManageCommandParams, Fn as ptyWriteSchema, Ft as capabilityGrantOkSchema, G as PeerAdvert, Gn as roomJoinSchema, Gt as coseHeaderKidSchema, H as NamespacedDomainId, Hn as revocationEntrySchema, Ht as coreCapabilitySchema, I as ManageError, In as relayConnectFrameSchema, It as capabilityRequestSchema, J as PrivateUseCapability, Jn as roomMembersOkSchema, Jt as coseTokenHeadersSchema, K as PeerIdentity, Kn as roomLeaveSchema, Kt as coseHeaderLabelSchema, L as ManageOk, Ln as relayDataFrameSchema, Lt as capabilityScopeSchema, M as IceCandidateInit, Mn as ptyKillSchema, Mt as WireCandidate, N as IdentityKey, Nn as ptyResizeSchema, Nt as candidateKindSchema, O as GossipFrame, On as procKillSchema, Ot as TokenClaims, P as ManageCommand, Pn as ptySpawnSchema, Pt as candidatesFrameSchema, Q as ProcSpawn, Qn as roomPathSchema, Qt as deviceIdHexSchema, R as ManageRequestFrame, Rn as relayInboundFrameSchema, Rt as capabilityTokenSchema, S as DmRoomPath, Sn as ownerNamedRoomPathSchema, St as RoomSend, T as ExecSessionInfo, Tn as pingFrameSchema, Tt as StreamEndFrame, U as ObservedAddressFrame, Un as roomInviteSchema, Ut as coreDomainNameSchema, V as NamespacedCapability, Vn as revocationClaimsSchema, Vt as coordinatorFrameSchema, W as OwnerNamedRoomPath, Wn as roomJoinOkSchema, Wt as coseHeaderAlgSchema, X as ProcKill, Xn as roomNoticeClaimsSchema, Xt as dataHaveFrameSchema, Y as PrivateUseDomainId, Yn as roomMembersSchema, Yt as dataEntriesFrameSchema, Z as ProcSignal, Zn as roomNoticeSchema, Zt as dataRequestFrameSchema, _ as DataEntriesFrame, _n as manageResponseFrameSchema, _t as RoomMembersOk, a as CapabilityScope, an as frameVariantSchema, ar as syncPunchFrameSchema, at as RelayDataFrame, b as DeviceId, bn as namespacedDomainIdSchema, bt as RoomPath, c as CloseFrame, cn as handleRecordSchema, cr as webrtcIceCandidateSchema, ct as RevocationAnnounceFrame, d as CoreDomainName, dn as identityKeySchema, dt as RoomInvite, en as dmRoomPathSchema, er as roomSendSchema, et as PtyKill, f as CoseHeaderAlg, fn as manageCommandParamsSchema, ft as RoomJoin, g as CoseTokenHeaders, gn as manageRequestFrameSchema, gt as RoomMembers, h as CoseSign1, hn as manageOkSchema, ht as RoomMember, i as CapabilityRequest, in as frameSchema, ir as streamSessionSchema, it as RelayConnectFrame, j as HandshakeFrame, jn as protocolVersionSchema, jt as WebrtcOffer, k as HandleClaims, kn as procSignalSchema, kt as WebrtcAnswer, l as CoordinatorFrame, ln as handshakeFrameSchema, lr as webrtcOfferSchema, lt as RevocationClaims, m as CoseHeaderLabel, mn as manageErrorSchema, mt as RoomLeave, n as CandidatesFrame, nn as execListSchema, nr as streamDataFrameSchema, nt as PtySpawn, o as CapabilityToken, on as gossipFrameSchema, or as tokenClaimsSchema, ot as RelayInboundFrame, p as CoseHeaderKid, pn as manageCommandSchema, pt as RoomJoinOk, q as PingFrame, qn as roomMemberSchema, qt as coseSign1Schema, r as CapabilityGrantOk, rn as execSessionInfoSchema, rr as streamEndFrameSchema, rt as PtyWrite, s as CapabilityVerb, sn as handleClaimsSchema, sr as webrtcAnswerSchema, st as RelayOfferFrame, t as CandidateKind, tn as domainIdSchema, tr as streamAckFrameSchema, tt as PtyResize, u as CoreCapability, un as iceCandidateInitSchema, ur as wireCandidateSchema, ut as RevocationEntry, v as DataHaveFrame, vn as messageRefSchema, vt as RoomNotice, w as ExecList, wn as peerIdentitySchema, wt as StreamDataFrame, x as DeviceIdHex, xn as observedAddressFrameSchema, xt as RoomRead, y as DataRequestFrame, yn as namespacedCapabilitySchema, yt as RoomNoticeClaims, z as ManageResponseFrame, zn as relayOfferFrameSchema, zt as capabilityVerbSchema } from "../protocol-
|
|
1
|
+
import { $ as ProtocolVersion, $n as roomReadSchema, $t as deviceIdSchema, A as HandleRecord, An as procSpawnSchema, At as WebrtcIceCandidate, B as MessageRef, Bn as revocationAnnounceFrameSchema, Bt as closeFrameSchema, C as DomainId, Cn as peerAdvertSchema, Ct as StreamAckFrame, D as FrameVariant, Dn as privateUseDomainIdSchema, Dt as SyncPunchFrame, E as Frame, En as privateUseCapabilitySchema, Et as StreamSession, F as ManageCommandParams, Fn as ptyWriteSchema, Ft as capabilityGrantOkSchema, G as PeerAdvert, Gn as roomJoinSchema, Gt as coseHeaderKidSchema, H as NamespacedDomainId, Hn as revocationEntrySchema, Ht as coreCapabilitySchema, I as ManageError, In as relayConnectFrameSchema, It as capabilityRequestSchema, J as PrivateUseCapability, Jn as roomMembersOkSchema, Jt as coseTokenHeadersSchema, K as PeerIdentity, Kn as roomLeaveSchema, Kt as coseHeaderLabelSchema, L as ManageOk, Ln as relayDataFrameSchema, Lt as capabilityScopeSchema, M as IceCandidateInit, Mn as ptyKillSchema, Mt as WireCandidate, N as IdentityKey, Nn as ptyResizeSchema, Nt as candidateKindSchema, O as GossipFrame, On as procKillSchema, Ot as TokenClaims, P as ManageCommand, Pn as ptySpawnSchema, Pt as candidatesFrameSchema, Q as ProcSpawn, Qn as roomPathSchema, Qt as deviceIdHexSchema, R as ManageRequestFrame, Rn as relayInboundFrameSchema, Rt as capabilityTokenSchema, S as DmRoomPath, Sn as ownerNamedRoomPathSchema, St as RoomSend, T as ExecSessionInfo, Tn as pingFrameSchema, Tt as StreamEndFrame, U as ObservedAddressFrame, Un as roomInviteSchema, Ut as coreDomainNameSchema, V as NamespacedCapability, Vn as revocationClaimsSchema, Vt as coordinatorFrameSchema, W as OwnerNamedRoomPath, Wn as roomJoinOkSchema, Wt as coseHeaderAlgSchema, X as ProcKill, Xn as roomNoticeClaimsSchema, Xt as dataHaveFrameSchema, Y as PrivateUseDomainId, Yn as roomMembersSchema, Yt as dataEntriesFrameSchema, Z as ProcSignal, Zn as roomNoticeSchema, Zt as dataRequestFrameSchema, _ as DataEntriesFrame, _n as manageResponseFrameSchema, _t as RoomMembersOk, a as CapabilityScope, an as frameVariantSchema, ar as syncPunchFrameSchema, at as RelayDataFrame, b as DeviceId, bn as namespacedDomainIdSchema, bt as RoomPath, c as CloseFrame, cn as handleRecordSchema, cr as webrtcIceCandidateSchema, ct as RevocationAnnounceFrame, d as CoreDomainName, dn as identityKeySchema, dt as RoomInvite, en as dmRoomPathSchema, er as roomSendSchema, et as PtyKill, f as CoseHeaderAlg, fn as manageCommandParamsSchema, ft as RoomJoin, g as CoseTokenHeaders, gn as manageRequestFrameSchema, gt as RoomMembers, h as CoseSign1, hn as manageOkSchema, ht as RoomMember, i as CapabilityRequest, in as frameSchema, ir as streamSessionSchema, it as RelayConnectFrame, j as HandshakeFrame, jn as protocolVersionSchema, jt as WebrtcOffer, k as HandleClaims, kn as procSignalSchema, kt as WebrtcAnswer, l as CoordinatorFrame, ln as handshakeFrameSchema, lr as webrtcOfferSchema, lt as RevocationClaims, m as CoseHeaderLabel, mn as manageErrorSchema, mt as RoomLeave, n as CandidatesFrame, nn as execListSchema, nr as streamDataFrameSchema, nt as PtySpawn, o as CapabilityToken, on as gossipFrameSchema, or as tokenClaimsSchema, ot as RelayInboundFrame, p as CoseHeaderKid, pn as manageCommandSchema, pt as RoomJoinOk, q as PingFrame, qn as roomMemberSchema, qt as coseSign1Schema, r as CapabilityGrantOk, rn as execSessionInfoSchema, rr as streamEndFrameSchema, rt as PtyWrite, s as CapabilityVerb, sn as handleClaimsSchema, sr as webrtcAnswerSchema, st as RelayOfferFrame, t as CandidateKind, tn as domainIdSchema, tr as streamAckFrameSchema, tt as PtyResize, u as CoreCapability, un as iceCandidateInitSchema, ur as wireCandidateSchema, ut as RevocationEntry, v as DataHaveFrame, vn as messageRefSchema, vt as RoomNotice, w as ExecList, wn as peerIdentitySchema, wt as StreamDataFrame, x as DeviceIdHex, xn as observedAddressFrameSchema, xt as RoomRead, y as DataRequestFrame, yn as namespacedCapabilitySchema, yt as RoomNoticeClaims, z as ManageResponseFrame, zn as relayOfferFrameSchema, zt as capabilityVerbSchema } from "../protocol-BwFGx9cg.mjs";
|
|
2
2
|
export { CandidateKind, CandidatesFrame, CapabilityGrantOk, CapabilityRequest, CapabilityScope, CapabilityToken, CapabilityVerb, CloseFrame, CoordinatorFrame, CoreCapability, CoreDomainName, CoseHeaderAlg, CoseHeaderKid, CoseHeaderLabel, CoseSign1, CoseTokenHeaders, DataEntriesFrame, DataHaveFrame, DataRequestFrame, DeviceId, DeviceIdHex, DmRoomPath, DomainId, ExecList, ExecSessionInfo, Frame, FrameVariant, GossipFrame, HandleClaims, HandleRecord, HandshakeFrame, IceCandidateInit, IdentityKey, ManageCommand, ManageCommandParams, ManageError, ManageOk, ManageRequestFrame, ManageResponseFrame, MessageRef, NamespacedCapability, NamespacedDomainId, ObservedAddressFrame, OwnerNamedRoomPath, PeerAdvert, PeerIdentity, PingFrame, PrivateUseCapability, PrivateUseDomainId, ProcKill, ProcSignal, ProcSpawn, ProtocolVersion, PtyKill, PtyResize, PtySpawn, PtyWrite, RelayConnectFrame, RelayDataFrame, RelayInboundFrame, RelayOfferFrame, RevocationAnnounceFrame, RevocationClaims, RevocationEntry, RoomInvite, RoomJoin, RoomJoinOk, RoomLeave, RoomMember, RoomMembers, RoomMembersOk, RoomNotice, RoomNoticeClaims, RoomPath, RoomRead, RoomSend, StreamAckFrame, StreamDataFrame, StreamEndFrame, StreamSession, SyncPunchFrame, TokenClaims, WebrtcAnswer, WebrtcIceCandidate, WebrtcOffer, WireCandidate, candidateKindSchema, candidatesFrameSchema, capabilityGrantOkSchema, capabilityRequestSchema, capabilityScopeSchema, capabilityTokenSchema, capabilityVerbSchema, closeFrameSchema, coordinatorFrameSchema, coreCapabilitySchema, coreDomainNameSchema, coseHeaderAlgSchema, coseHeaderKidSchema, coseHeaderLabelSchema, coseSign1Schema, coseTokenHeadersSchema, dataEntriesFrameSchema, dataHaveFrameSchema, dataRequestFrameSchema, deviceIdHexSchema, deviceIdSchema, dmRoomPathSchema, domainIdSchema, execListSchema, execSessionInfoSchema, frameSchema, frameVariantSchema, gossipFrameSchema, handleClaimsSchema, handleRecordSchema, handshakeFrameSchema, iceCandidateInitSchema, identityKeySchema, manageCommandParamsSchema, manageCommandSchema, manageErrorSchema, manageOkSchema, manageRequestFrameSchema, manageResponseFrameSchema, messageRefSchema, namespacedCapabilitySchema, namespacedDomainIdSchema, observedAddressFrameSchema, ownerNamedRoomPathSchema, peerAdvertSchema, peerIdentitySchema, pingFrameSchema, privateUseCapabilitySchema, privateUseDomainIdSchema, procKillSchema, procSignalSchema, procSpawnSchema, protocolVersionSchema, ptyKillSchema, ptyResizeSchema, ptySpawnSchema, ptyWriteSchema, relayConnectFrameSchema, relayDataFrameSchema, relayInboundFrameSchema, relayOfferFrameSchema, revocationAnnounceFrameSchema, revocationClaimsSchema, revocationEntrySchema, roomInviteSchema, roomJoinOkSchema, roomJoinSchema, roomLeaveSchema, roomMemberSchema, roomMembersOkSchema, roomMembersSchema, roomNoticeClaimsSchema, roomNoticeSchema, roomPathSchema, roomReadSchema, roomSendSchema, streamAckFrameSchema, streamDataFrameSchema, streamEndFrameSchema, streamSessionSchema, syncPunchFrameSchema, tokenClaimsSchema, webrtcAnswerSchema, webrtcIceCandidateSchema, webrtcOfferSchema, wireCandidateSchema };
|
|
@@ -315,7 +315,7 @@ const peerAdvertSchema = z.lazy(() => z.object({
|
|
|
315
315
|
"device": z.lazy(() => deviceIdSchema),
|
|
316
316
|
"addresses": z.array(z.string()),
|
|
317
317
|
"snapshot-seconds": z.number().int()
|
|
318
|
-
}));
|
|
318
|
+
}).catchall(z.unknown()));
|
|
319
319
|
const gossipFrameSchema = z.lazy(() => z.object({
|
|
320
320
|
"type": z.literal("gossip"),
|
|
321
321
|
"peers": z.array(z.lazy(() => peerAdvertSchema))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as IdentityKey, b as DeviceId } from "./protocol-
|
|
1
|
+
import { N as IdentityKey, b as DeviceId } from "./protocol-BwFGx9cg.mjs";
|
|
2
2
|
//#region src/ports/identity.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Wraps the local node's own identity plus the signing/verification primitives capability-token handling needs -- never hardcoded to one crypto library's own API shape (Node's webcrypto, a WASM implementation, a hardware key, etc. can all satisfy this same contract).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as IdentityKey, b as DeviceId } from "./protocol-
|
|
1
|
+
import { N as IdentityKey, b as DeviceId } from "./protocol-BwFGx9cg.cjs";
|
|
2
2
|
//#region src/ports/identity.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Wraps the local node's own identity plus the signing/verification primitives capability-token handling needs -- never hardcoded to one crypto library's own API shape (Node's webcrypto, a WASM implementation, a hardware key, etc. can all satisfy this same contract).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { t as IdentityPort } from "../identity-ijL0IsUT.cjs";
|
|
2
2
|
export { IdentityPort };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { t as IdentityPort } from "../identity-DvBEkcS9.mjs";
|
|
2
2
|
export { IdentityPort };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Frame, b as DeviceId } from "../protocol-
|
|
1
|
+
import { E as Frame, b as DeviceId } from "../protocol-BwFGx9cg.cjs";
|
|
2
2
|
//#region src/ports/transport.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* An async, serialisable-data contract for exchanging frame values over some connection -- deliberately without baking in any specific transport's own primitives (no raw socket types, no WebSocket-specific options), so a TCP adapter, a WebSocket adapter, or an in-memory adapter for tests can all satisfy it.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Frame, b as DeviceId } from "../protocol-
|
|
1
|
+
import { E as Frame, b as DeviceId } from "../protocol-BwFGx9cg.mjs";
|
|
2
2
|
//#region src/ports/transport.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* An async, serialisable-data contract for exchanging frame values over some connection -- deliberately without baking in any specific transport's own primitives (no raw socket types, no WebSocket-specific options), so a TCP adapter, a WebSocket adapter, or an in-memory adapter for tests can all satisfy it.
|
|
@@ -185,7 +185,7 @@ declare const frameVariantSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.Zod
|
|
|
185
185
|
device: z.ZodLazy<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
|
|
186
186
|
addresses: z.ZodArray<z.ZodString>;
|
|
187
187
|
"snapshot-seconds": z.ZodNumber;
|
|
188
|
-
}, z.core.$
|
|
188
|
+
}, z.core.$catchall<z.ZodUnknown>>>>>;
|
|
189
189
|
}, z.core.$strip>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
|
|
190
190
|
type: z.ZodLiteral<"candidates">;
|
|
191
191
|
candidates: z.ZodArray<z.ZodLazy<z.ZodLazy<z.ZodObject<{
|
|
@@ -379,7 +379,7 @@ declare const frameSchema: z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodUnion<readonly [z.
|
|
|
379
379
|
device: z.ZodLazy<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
|
|
380
380
|
addresses: z.ZodArray<z.ZodString>;
|
|
381
381
|
"snapshot-seconds": z.ZodNumber;
|
|
382
|
-
}, z.core.$
|
|
382
|
+
}, z.core.$catchall<z.ZodUnknown>>>>>;
|
|
383
383
|
}, z.core.$strip>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
|
|
384
384
|
type: z.ZodLiteral<"candidates">;
|
|
385
385
|
candidates: z.ZodArray<z.ZodLazy<z.ZodLazy<z.ZodObject<{
|
|
@@ -974,14 +974,14 @@ declare const peerAdvertSchema: z.ZodLazy<z.ZodObject<{
|
|
|
974
974
|
device: z.ZodLazy<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
|
|
975
975
|
addresses: z.ZodArray<z.ZodString>;
|
|
976
976
|
"snapshot-seconds": z.ZodNumber;
|
|
977
|
-
}, z.core.$
|
|
977
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
978
978
|
declare const gossipFrameSchema: z.ZodLazy<z.ZodObject<{
|
|
979
979
|
type: z.ZodLiteral<"gossip">;
|
|
980
980
|
peers: z.ZodArray<z.ZodLazy<z.ZodLazy<z.ZodObject<{
|
|
981
981
|
device: z.ZodLazy<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
|
|
982
982
|
addresses: z.ZodArray<z.ZodString>;
|
|
983
983
|
"snapshot-seconds": z.ZodNumber;
|
|
984
|
-
}, z.core.$
|
|
984
|
+
}, z.core.$catchall<z.ZodUnknown>>>>>;
|
|
985
985
|
}, z.core.$strip>>;
|
|
986
986
|
declare const candidateKindSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodLiteral<"host">, z.ZodLiteral<"server-reflexive">, z.ZodLiteral<"relayed">]>>;
|
|
987
987
|
declare const wireCandidateSchema: z.ZodLazy<z.ZodObject<{
|
|
@@ -185,7 +185,7 @@ declare const frameVariantSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.Zod
|
|
|
185
185
|
device: z.ZodLazy<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
|
|
186
186
|
addresses: z.ZodArray<z.ZodString>;
|
|
187
187
|
"snapshot-seconds": z.ZodNumber;
|
|
188
|
-
}, z.core.$
|
|
188
|
+
}, z.core.$catchall<z.ZodUnknown>>>>>;
|
|
189
189
|
}, z.core.$strip>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
|
|
190
190
|
type: z.ZodLiteral<"candidates">;
|
|
191
191
|
candidates: z.ZodArray<z.ZodLazy<z.ZodLazy<z.ZodObject<{
|
|
@@ -379,7 +379,7 @@ declare const frameSchema: z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodUnion<readonly [z.
|
|
|
379
379
|
device: z.ZodLazy<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
|
|
380
380
|
addresses: z.ZodArray<z.ZodString>;
|
|
381
381
|
"snapshot-seconds": z.ZodNumber;
|
|
382
|
-
}, z.core.$
|
|
382
|
+
}, z.core.$catchall<z.ZodUnknown>>>>>;
|
|
383
383
|
}, z.core.$strip>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
|
|
384
384
|
type: z.ZodLiteral<"candidates">;
|
|
385
385
|
candidates: z.ZodArray<z.ZodLazy<z.ZodLazy<z.ZodObject<{
|
|
@@ -974,14 +974,14 @@ declare const peerAdvertSchema: z.ZodLazy<z.ZodObject<{
|
|
|
974
974
|
device: z.ZodLazy<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
|
|
975
975
|
addresses: z.ZodArray<z.ZodString>;
|
|
976
976
|
"snapshot-seconds": z.ZodNumber;
|
|
977
|
-
}, z.core.$
|
|
977
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
978
978
|
declare const gossipFrameSchema: z.ZodLazy<z.ZodObject<{
|
|
979
979
|
type: z.ZodLiteral<"gossip">;
|
|
980
980
|
peers: z.ZodArray<z.ZodLazy<z.ZodLazy<z.ZodObject<{
|
|
981
981
|
device: z.ZodLazy<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
|
|
982
982
|
addresses: z.ZodArray<z.ZodString>;
|
|
983
983
|
"snapshot-seconds": z.ZodNumber;
|
|
984
|
-
}, z.core.$
|
|
984
|
+
}, z.core.$catchall<z.ZodUnknown>>>>>;
|
|
985
985
|
}, z.core.$strip>>;
|
|
986
986
|
declare const candidateKindSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodLiteral<"host">, z.ZodLiteral<"server-reflexive">, z.ZodLiteral<"relayed">]>>;
|
|
987
987
|
declare const wireCandidateSchema: z.ZodLazy<z.ZodObject<{
|