wire-mesh-core 2.0.2 → 3.0.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/README.md +1 -0
- 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/adapters/tcp-transport.d.cts +1 -1
- package/dist/adapters/tcp-transport.d.mts +1 -1
- package/dist/adapters/threshold-identity.d.cts +2 -2
- package/dist/adapters/threshold-identity.d.mts +2 -2
- package/dist/adapters/threshold-wasm.d.cts +1 -1
- package/dist/adapters/threshold-wasm.d.mts +1 -1
- package/dist/adapters/tls-transport.d.cts +1 -1
- package/dist/adapters/tls-transport.d.mts +1 -1
- package/dist/domain/advert-extension-policy.cjs +20 -0
- package/dist/domain/advert-extension-policy.d.cts +21 -0
- package/dist/domain/advert-extension-policy.d.mts +21 -0
- package/dist/domain/advert-extension-policy.mjs +19 -0
- package/dist/domain/bulk.d.cts +2 -2
- package/dist/domain/bulk.d.mts +2 -2
- package/dist/domain/capability-grant.d.cts +3 -3
- package/dist/domain/capability-grant.d.mts +3 -3
- package/dist/domain/capability-request.d.cts +2 -2
- package/dist/domain/capability-request.d.mts +2 -2
- package/dist/domain/data-sync.d.cts +2 -2
- package/dist/domain/data-sync.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/direct-manage-request.d.cts +2 -2
- package/dist/domain/direct-manage-request.d.mts +2 -2
- package/dist/domain/gossip-expansion.d.cts +1 -1
- package/dist/domain/gossip-expansion.d.mts +1 -1
- package/dist/domain/gossip-extensions.cjs +2 -1
- package/dist/domain/gossip-extensions.d.cts +2 -0
- package/dist/domain/gossip-extensions.d.mts +2 -0
- package/dist/domain/gossip-extensions.mjs +2 -2
- package/dist/domain/grant-candidates.d.cts +1 -1
- package/dist/domain/grant-candidates.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 +327 -25
- package/dist/domain/mesh-session.d.cts +4 -4
- package/dist/domain/mesh-session.d.mts +4 -4
- package/dist/domain/mesh-session.mjs +328 -26
- package/dist/domain/notice-board.d.cts +3 -3
- package/dist/domain/notice-board.d.mts +3 -3
- package/dist/domain/path-trace.d.cts +1 -1
- package/dist/domain/path-trace.d.mts +1 -1
- package/dist/domain/peer-advert.d.cts +2 -2
- package/dist/domain/peer-advert.d.mts +2 -2
- package/dist/domain/relay-hub.cjs +11 -0
- package/dist/domain/relay-hub.d.cts +15 -2
- package/dist/domain/relay-hub.d.mts +15 -2
- package/dist/domain/relay-hub.mjs +11 -0
- package/dist/domain/relay-use-gate.d.cts +2 -2
- package/dist/domain/relay-use-gate.d.mts +2 -2
- package/dist/domain/revocation-view.d.cts +2 -2
- package/dist/domain/revocation-view.d.mts +2 -2
- package/dist/domain/room-rekey.d.cts +3 -3
- package/dist/domain/room-rekey.d.mts +3 -3
- package/dist/domain/room-token-verification.d.cts +1 -1
- package/dist/domain/room-token-verification.d.mts +1 -1
- package/dist/domain/room.d.cts +4 -4
- package/dist/domain/room.d.mts +4 -4
- package/dist/domain/shard-manifest.d.cts +1 -1
- package/dist/domain/shard-manifest.d.mts +1 -1
- package/dist/domain/tokens.d.cts +1 -1
- package/dist/domain/tokens.d.mts +1 -1
- package/dist/domain/topology-snapshot.d.cts +1 -1
- package/dist/domain/topology-snapshot.d.mts +1 -1
- package/dist/domain/topology.cjs +1 -1
- package/dist/domain/topology.d.cts +1 -1
- package/dist/domain/topology.d.mts +1 -1
- package/dist/domain/topology.mjs +1 -1
- package/dist/domain/webrtc-signaling.d.cts +2 -2
- package/dist/domain/webrtc-signaling.d.mts +2 -2
- package/dist/generated/protocol.cjs +18 -1
- package/dist/generated/protocol.d.cts +2 -2
- package/dist/generated/protocol.d.mts +2 -2
- package/dist/generated/protocol.mjs +17 -2
- package/dist/{gossip-extensions-BNiI44sU.mjs → gossip-extensions-B6WJjkAr.mjs} +1 -1
- package/dist/{gossip-extensions-DRVTHKnR.cjs → gossip-extensions-BBYgMZ2N.cjs} +6 -0
- package/dist/{identity-DImeXZcq.d.cts → identity-DVCNuFLG.d.cts} +1 -1
- package/dist/{identity-Dc4xmwp3.d.mts → identity-DcaYgjXT.d.mts} +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-Bi2fzBCc.d.cts → protocol-DCDae3z4.d.cts} +47 -1
- package/dist/{protocol-Bi2fzBCc.d.mts → protocol-DCDae3z4.d.mts} +47 -1
- package/dist/{room-token-verification-CnHNaA8J.d.mts → room-token-verification-CkGnFuQc.d.mts} +2 -2
- package/dist/{room-token-verification-CDXkm_Tg.d.cts → room-token-verification-PSv4eQ1x.d.cts} +2 -2
- package/dist/{tokens-0r9ipK1r.d.mts → tokens-CBiSYuzp.d.mts} +2 -2
- package/dist/{tokens-BDVxEvl2.d.cts → tokens-DqFu7iMX.d.cts} +2 -2
- package/dist/{transport-Cq_odHy3.d.cts → transport-CfW7fsGK.d.cts} +1 -1
- package/dist/{transport-GcJ4LYVE.d.mts → transport-iLBxIkRS.d.mts} +1 -1
- package/package.json +5 -1
- package/wasm-dist/wire_mesh_threshold_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ The TypeScript implementation of wire-mesh's protocol, built ports/adapters: dom
|
|
|
14
14
|
- **Handshake negotiation** (`src/domain/handshake.ts`) -- protocol-version and capability-domain negotiation between two peers, the mechanism agent-comms issue #31 is fixed by.
|
|
15
15
|
- **Capability-token verification** (`src/domain/tokens.ts`) -- the full chain tokens.cddl documents: COSE_Sign1 signature verification, the self-certifying issuer-key check (`sha256(issuer-key.public-key) == issuer`), expiry/not-before, issuer-matched revocation (only a token's own issuer's signed revocation-entry counts, checked across every ancestor in the delegation chain, not just the leaf), and recursive delegation-chain narrowing across all three axes of authority: a delegated token's issuer must be its parent's bearer (the chain is unbroken), its expiry must not exceed its parent's, and its scope must narrow its parent's (identical kind, equal-or-descendant path when the parent carries one) with an identical capability verb (the verb grammar has no sub-verb relation, so a different verb is different authority, not narrower). Also exports `verifyRevocationEntry` for ingesting gossiped revocation-announce frames: each entry is itself a signed, self-certifying COSE_Sign1 over revocation-claims, verified before it may enter the revocation view.
|
|
16
16
|
- **Peer-advert verification** (`src/domain/peer-advert.ts`): the two checks transport.cddl states for a gossiped advert, applied by the relay hub before it registers or forwards one and by every session before one reaches its directory: the embedded identity-key self-certifies (`sha256(identity-key.public-key) == device`), and the signature verifies under that same key over the domain-separated canonical encoding of the advert with its signature removed, which covers the open extension tail as well. Deliberately not tokens.cddl's COSE Sig_structure: an advert's open tail lets an attacker craft one whose encoding also satisfies token-claims, so the prefixed construction keeps the two byte strings disjoint. Reaches a verdict for every input rather than throwing, since an advert's algorithm and key bytes are attacker-chosen.
|
|
17
|
+
- **Secure channel** (`src/domain/secure-channel.ts`, `src/domain/relay-channels.ts`): the end-to-end channel spec/secure-channel.cddl defines between two devices that reach each other through a relay. A session opens one with each peer it addresses through a relay pairing, seals every manage-request and manage-response in it, drops any that arrives as plain relay-data, and attributes a request to the identity the peer's handshake proved rather than to the `from-device` a hub stamps. There is no plaintext fallback, so a peer that does not speak it cannot be reached through a relay.
|
|
17
18
|
|
|
18
19
|
## Deliberately deferred
|
|
19
20
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, N as Frame, ht as RelayDataFrame } from "../protocol-
|
|
1
|
+
import { D as DeviceId, N as Frame, ht as RelayDataFrame } from "../protocol-DCDae3z4.cjs";
|
|
2
2
|
//#region src/adapters/frame-codec.d.ts
|
|
3
3
|
export declare function messageFromFrame(frame: Frame): Uint8Array<ArrayBuffer>;
|
|
4
4
|
/** Wraps frame as a relay-data-frame's own opaque payload, stamping to-device when the caller knows which established pairing to address it to (wire-mesh#30) -- the outbound counterpart to tryDecodeFrame's own doc comment below, which describes the inbound side of the same relay-data envelope. Omitting toDevice leaves the frame unaddressed, which the receiving hub then routes via its own most-recently-established-pairing fallback. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, N as Frame, ht as RelayDataFrame } from "../protocol-
|
|
1
|
+
import { D as DeviceId, N as Frame, ht as RelayDataFrame } from "../protocol-DCDae3z4.mjs";
|
|
2
2
|
//#region src/adapters/frame-codec.d.ts
|
|
3
3
|
export declare function messageFromFrame(frame: Frame): Uint8Array<ArrayBuffer>;
|
|
4
4
|
/** Wraps frame as a relay-data-frame's own opaque payload, stamping to-device when the caller knows which established pairing to address it to (wire-mesh#30) -- the outbound counterpart to tryDecodeFrame's own doc comment below, which describes the inbound side of the same relay-data envelope. Omitting toDevice leaves the frame unaddressed, which the receiving hub then routes via its own most-recently-established-pairing fallback. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as IdentityKey, D as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { B as IdentityKey, D as DeviceId } from "../protocol-DCDae3z4.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DVCNuFLG.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 { B as IdentityKey, D as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { B as IdentityKey, D as DeviceId } from "../protocol-DCDae3z4.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DcaYgjXT.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 { r as Transport } from "../transport-
|
|
1
|
+
import { r as Transport } from "../transport-CfW7fsGK.cjs";
|
|
2
2
|
//#region src/adapters/tcp-transport.d.ts
|
|
3
3
|
/** A Node net.Socket-based Transport: length-prefixed, CBOR-encoded frames over plain TCP -- matching Cascade's own transport shape, since interop with Cascade nodes is wire-mesh's stated goal. Framing (not TLS) is this adapter's own concern; a TLS-terminated variant is a separate adapter behind the same Transport contract. */
|
|
4
4
|
export declare function createTcpTransport(): Transport;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as Transport } from "../transport-
|
|
1
|
+
import { r as Transport } from "../transport-iLBxIkRS.mjs";
|
|
2
2
|
//#region src/adapters/tcp-transport.d.ts
|
|
3
3
|
/** A Node net.Socket-based Transport: length-prefixed, CBOR-encoded frames over plain TCP -- matching Cascade's own transport shape, since interop with Cascade nodes is wire-mesh's stated goal. Framing (not TLS) is this adapter's own concern; a TLS-terminated variant is a separate adapter behind the same Transport contract. */
|
|
4
4
|
export declare function createTcpTransport(): Transport;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId } from "../protocol-DCDae3z4.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DVCNuFLG.cjs";
|
|
3
3
|
import { DeviceKeyed } from "./threshold-wasm.cjs";
|
|
4
4
|
import { ThresholdSubject } from "../domain/threshold-subject.cjs";
|
|
5
5
|
//#region src/adapters/threshold-identity.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId } from "../protocol-DCDae3z4.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DcaYgjXT.mjs";
|
|
3
3
|
import { DeviceKeyed } from "./threshold-wasm.mjs";
|
|
4
4
|
import { ThresholdSubject } from "../domain/threshold-subject.mjs";
|
|
5
5
|
//#region src/adapters/threshold-identity.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId } from "../protocol-
|
|
1
|
+
import { D as DeviceId } from "../protocol-DCDae3z4.cjs";
|
|
2
2
|
//#region src/adapters/threshold-wasm.d.ts
|
|
3
3
|
/** One `(deviceId, bytes)` pair -- the wasm boundary's own encoding of a map keyed by participant, since wasm-bindgen has no built-in `Map<Uint8Array, Uint8Array>` marshalling. */
|
|
4
4
|
export interface DeviceKeyed<T extends Uint8Array = Uint8Array<ArrayBuffer>> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId } from "../protocol-
|
|
1
|
+
import { D as DeviceId } from "../protocol-DCDae3z4.mjs";
|
|
2
2
|
//#region src/adapters/threshold-wasm.d.ts
|
|
3
3
|
/** One `(deviceId, bytes)` pair -- the wasm boundary's own encoding of a map keyed by participant, since wasm-bindgen has no built-in `Map<Uint8Array, Uint8Array>` marshalling. */
|
|
4
4
|
export interface DeviceKeyed<T extends Uint8Array = Uint8Array<ArrayBuffer>> {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_gossip_extensions = require("../gossip-extensions-BBYgMZ2N.cjs");
|
|
3
|
+
//#region src/domain/advert-extension-policy.ts
|
|
4
|
+
/** The extension keys wire-mesh-core itself writes on every self-advert, which a policy never has to list. */
|
|
5
|
+
const CORE_EXTENSION_KEYS = /* @__PURE__ */ new Set([require_gossip_extensions.TOPOLOGY_PEERS_GOSSIP_KEY, require_gossip_extensions.CORE_VERSION_GOSSIP_KEY]);
|
|
6
|
+
/**
|
|
7
|
+
* Checks every extension entry of an advert against a policy. Refuses on the first entry that is not allowed and names its key, so the host can say why.
|
|
8
|
+
*/
|
|
9
|
+
function checkAdvertExtensions(advert, policy) {
|
|
10
|
+
for (const [key, value] of Object.entries(advert)) {
|
|
11
|
+
if (require_gossip_extensions.RESERVED_PEER_ADVERT_KEYS.has(key) || CORE_EXTENSION_KEYS.has(key)) continue;
|
|
12
|
+
if ((Object.hasOwn(policy.allowed, key) ? policy.allowed[key] : void 0)?.(value) !== true) return {
|
|
13
|
+
ok: false,
|
|
14
|
+
key
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return { ok: true };
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.checkAdvertExtensions = checkAdvertExtensions;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { et as PeerAdvert } from "../protocol-DCDae3z4.cjs";
|
|
2
|
+
//#region src/domain/advert-extension-policy.d.ts
|
|
3
|
+
/** Whether one extension entry's value is one the hub will carry. Must be strict: a value with a field the validator did not expect is refused, since the point is that nothing unexpected is published. */
|
|
4
|
+
export type ExtensionValidator = (value: unknown) => boolean;
|
|
5
|
+
export interface AdvertExtensionPolicy {
|
|
6
|
+
/**
|
|
7
|
+
* The application extensions the hub carries, each with the validator its value must pass. An advert holding any extension key not listed here, or a listed key whose value fails its validator, is refused whole. wire-mesh-core's own extensions (topology and version) are always carried and need no entry.
|
|
8
|
+
*/
|
|
9
|
+
readonly allowed: Readonly<Record<string, ExtensionValidator>>;
|
|
10
|
+
}
|
|
11
|
+
export type AdvertExtensionVerdict = {
|
|
12
|
+
readonly ok: true;
|
|
13
|
+
} | {
|
|
14
|
+
readonly ok: false;
|
|
15
|
+
readonly key: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Checks every extension entry of an advert against a policy. Refuses on the first entry that is not allowed and names its key, so the host can say why.
|
|
19
|
+
*/
|
|
20
|
+
export declare function checkAdvertExtensions(advert: Readonly<PeerAdvert>, policy: Readonly<AdvertExtensionPolicy>): AdvertExtensionVerdict;
|
|
21
|
+
//#endregion
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { et as PeerAdvert } from "../protocol-DCDae3z4.mjs";
|
|
2
|
+
//#region src/domain/advert-extension-policy.d.ts
|
|
3
|
+
/** Whether one extension entry's value is one the hub will carry. Must be strict: a value with a field the validator did not expect is refused, since the point is that nothing unexpected is published. */
|
|
4
|
+
export type ExtensionValidator = (value: unknown) => boolean;
|
|
5
|
+
export interface AdvertExtensionPolicy {
|
|
6
|
+
/**
|
|
7
|
+
* The application extensions the hub carries, each with the validator its value must pass. An advert holding any extension key not listed here, or a listed key whose value fails its validator, is refused whole. wire-mesh-core's own extensions (topology and version) are always carried and need no entry.
|
|
8
|
+
*/
|
|
9
|
+
readonly allowed: Readonly<Record<string, ExtensionValidator>>;
|
|
10
|
+
}
|
|
11
|
+
export type AdvertExtensionVerdict = {
|
|
12
|
+
readonly ok: true;
|
|
13
|
+
} | {
|
|
14
|
+
readonly ok: false;
|
|
15
|
+
readonly key: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Checks every extension entry of an advert against a policy. Refuses on the first entry that is not allowed and names its key, so the host can say why.
|
|
19
|
+
*/
|
|
20
|
+
export declare function checkAdvertExtensions(advert: Readonly<PeerAdvert>, policy: Readonly<AdvertExtensionPolicy>): AdvertExtensionVerdict;
|
|
21
|
+
//#endregion
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { i as CORE_VERSION_GOSSIP_KEY, n as TOPOLOGY_PEERS_GOSSIP_KEY, t as RESERVED_PEER_ADVERT_KEYS } from "../gossip-extensions-B6WJjkAr.mjs";
|
|
2
|
+
//#region src/domain/advert-extension-policy.ts
|
|
3
|
+
/** The extension keys wire-mesh-core itself writes on every self-advert, which a policy never has to list. */
|
|
4
|
+
const CORE_EXTENSION_KEYS = /* @__PURE__ */ new Set([TOPOLOGY_PEERS_GOSSIP_KEY, CORE_VERSION_GOSSIP_KEY]);
|
|
5
|
+
/**
|
|
6
|
+
* Checks every extension entry of an advert against a policy. Refuses on the first entry that is not allowed and names its key, so the host can say why.
|
|
7
|
+
*/
|
|
8
|
+
function checkAdvertExtensions(advert, policy) {
|
|
9
|
+
for (const [key, value] of Object.entries(advert)) {
|
|
10
|
+
if (RESERVED_PEER_ADVERT_KEYS.has(key) || CORE_EXTENSION_KEYS.has(key)) continue;
|
|
11
|
+
if ((Object.hasOwn(policy.allowed, key) ? policy.allowed[key] : void 0)?.(value) !== true) return {
|
|
12
|
+
ok: false,
|
|
13
|
+
key
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return { ok: true };
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { checkAdvertExtensions };
|
package/dist/domain/bulk.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DeviceId, N as Frame, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-
|
|
1
|
+
import { D as DeviceId, N as Frame, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DCDae3z4.cjs";
|
|
2
2
|
import { KeyValueStorage } from "../ports/storage.cjs";
|
|
3
|
-
import { t as Connection } from "../transport-
|
|
3
|
+
import { t as Connection } from "../transport-CfW7fsGK.cjs";
|
|
4
4
|
import { IncomingManageRequest, MeshSession } from "./mesh-session.cjs";
|
|
5
5
|
//#region src/domain/bulk.d.ts
|
|
6
6
|
/** The two capabilities matching the direction each manage-command actually flows (spec/bulk.cddl): the sender proves write authority to open a transfer, the receiver proves read authority to ask for one to continue. */
|
package/dist/domain/bulk.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DeviceId, N as Frame, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-
|
|
1
|
+
import { D as DeviceId, N as Frame, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DCDae3z4.mjs";
|
|
2
2
|
import { KeyValueStorage } from "../ports/storage.mjs";
|
|
3
|
-
import { t as Connection } from "../transport-
|
|
3
|
+
import { t as Connection } from "../transport-iLBxIkRS.mjs";
|
|
4
4
|
import { IncomingManageRequest, MeshSession } from "./mesh-session.mjs";
|
|
5
5
|
//#region src/domain/bulk.d.ts
|
|
6
6
|
/** The two capabilities matching the direction each manage-command actually flows (spec/bulk.cddl): the sender proves write authority to open a transfer, the receiver proves read authority to ask for one to continue. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DCDae3z4.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DVCNuFLG.cjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
4
4
|
import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.cjs";
|
|
5
|
-
import { a as RevocationCheck } from "../tokens-
|
|
5
|
+
import { a as RevocationCheck } from "../tokens-DqFu7iMX.cjs";
|
|
6
6
|
//#region src/domain/capability-grant.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* Builds a capability-grant command per management.cddl. The outer `manage-command.verb` is the capability string itself, the identical convention capability-request.ts's own buildCapabilityRequestCommand already establishes -- a receiver's per-capability handler is how it knows which grant this push is even for. `params.verb` is the fixed "capability.grant" marker. No scope or invitee field: manage-request-frame's own top-level scope already carries the former, and the request's own destination already carries the latter -- naming either a second time inside params could only ever disagree with the fact it duplicates.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DCDae3z4.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DcaYgjXT.mjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
4
4
|
import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.mjs";
|
|
5
|
-
import { a as RevocationCheck } from "../tokens-
|
|
5
|
+
import { a as RevocationCheck } from "../tokens-CBiSYuzp.mjs";
|
|
6
6
|
//#region src/domain/capability-grant.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* Builds a capability-grant command per management.cddl. The outer `manage-command.verb` is the capability string itself, the identical convention capability-request.ts's own buildCapabilityRequestCommand already establishes -- a receiver's per-capability handler is how it knows which grant this push is even for. `params.verb` is the fixed "capability.grant" marker. No scope or invitee field: manage-request-frame's own top-level scope already carries the former, and the request's own destination already carries the latter -- naming either a second time inside params could only ever disagree with the fact it duplicates.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, u as CapabilityGrantOk } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, u as CapabilityGrantOk } from "../protocol-DCDae3z4.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DVCNuFLG.cjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
4
4
|
import { IncomingManageRequest, MeshSession } from "./mesh-session.cjs";
|
|
5
5
|
//#region src/domain/capability-request.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, u as CapabilityGrantOk } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, u as CapabilityGrantOk } from "../protocol-DCDae3z4.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DcaYgjXT.mjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
4
4
|
import { IncomingManageRequest, MeshSession } from "./mesh-session.mjs";
|
|
5
5
|
//#region src/domain/capability-request.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DeviceId, E as DataRequestFrame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-
|
|
1
|
+
import { D as DeviceId, E as DataRequestFrame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-DCDae3z4.cjs";
|
|
2
2
|
import { KeyValueStorage } from "../ports/storage.cjs";
|
|
3
|
-
import { t as IdentityPort } from "../identity-
|
|
3
|
+
import { t as IdentityPort } from "../identity-DVCNuFLG.cjs";
|
|
4
4
|
//#region src/domain/data-sync.d.ts
|
|
5
5
|
export interface DataSyncOptions {
|
|
6
6
|
identity: IdentityPort;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DeviceId, E as DataRequestFrame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-
|
|
1
|
+
import { D as DeviceId, E as DataRequestFrame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-DCDae3z4.mjs";
|
|
2
2
|
import { KeyValueStorage } from "../ports/storage.mjs";
|
|
3
|
-
import { t as IdentityPort } from "../identity-
|
|
3
|
+
import { t as IdentityPort } from "../identity-DcaYgjXT.mjs";
|
|
4
4
|
//#region src/domain/data-sync.d.ts
|
|
5
5
|
export interface DataSyncOptions {
|
|
6
6
|
identity: IdentityPort;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId } from "../protocol-
|
|
1
|
+
import { D as DeviceId } from "../protocol-DCDae3z4.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 { D as DeviceId } from "../protocol-
|
|
1
|
+
import { D as DeviceId } from "../protocol-DCDae3z4.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,5 +1,5 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-
|
|
2
|
-
import { r as Transport, t as Connection } from "../transport-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DCDae3z4.cjs";
|
|
2
|
+
import { r as Transport, t as Connection } from "../transport-CfW7fsGK.cjs";
|
|
3
3
|
import { IncomingManageRequest, ManageOutcome } from "./mesh-session.cjs";
|
|
4
4
|
//#region src/domain/direct-manage-request.d.ts
|
|
5
5
|
/** Reads exactly one frame off a freshly-accepted, bare connection and, if it's a manage-request, returns an IncomingManageRequest ready to hand to the same application-level dispatch logic session.incomingManageRequests already feeds elsewhere -- no handshake or gossip is ever read or sent on this connection (wire-mesh#38: the manage-request/manage-response exchange has no dependency on handshake state at the dispatch layer, confirmed against mesh-session.ts's own applyManageRequest/applyFrame). respond() sends the manage-response directly and closes the connection, since a one-off request/response is this connection's entire purpose -- unlike a real MeshSession, there is nothing further to do with it afterwards. Resolves null, without closing the connection (that's the caller's call), for any other first frame or if the connection ends before one arrives: interpreting either case is a Transport.listen() caller's own business, e.g. peeking the first frame to route between this path and acceptMeshSession's own handshake path. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-
|
|
2
|
-
import { r as Transport, t as Connection } from "../transport-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DCDae3z4.mjs";
|
|
2
|
+
import { r as Transport, t as Connection } from "../transport-iLBxIkRS.mjs";
|
|
3
3
|
import { IncomingManageRequest, ManageOutcome } from "./mesh-session.mjs";
|
|
4
4
|
//#region src/domain/direct-manage-request.d.ts
|
|
5
5
|
/** Reads exactly one frame off a freshly-accepted, bare connection and, if it's a manage-request, returns an IncomingManageRequest ready to hand to the same application-level dispatch logic session.incomingManageRequests already feeds elsewhere -- no handshake or gossip is ever read or sent on this connection (wire-mesh#38: the manage-request/manage-response exchange has no dependency on handshake state at the dispatch layer, confirmed against mesh-session.ts's own applyManageRequest/applyFrame). respond() sends the manage-response directly and closes the connection, since a one-off request/response is this connection's entire purpose -- unlike a real MeshSession, there is nothing further to do with it afterwards. Resolves null, without closing the connection (that's the caller's call), for any other first frame or if the connection ends before one arrives: interpreting either case is a Transport.listen() caller's own business, e.g. peeking the first frame to route between this path and acceptMeshSession's own handshake path. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, et as PeerAdvert } from "../protocol-
|
|
1
|
+
import { D as DeviceId, et as PeerAdvert } from "../protocol-DCDae3z4.cjs";
|
|
2
2
|
import { MeshSession } from "./mesh-session.cjs";
|
|
3
3
|
//#region src/domain/gossip-expansion.d.ts
|
|
4
4
|
/** One not-yet-considered device this session's gossip directory has surfaced, carrying only what a dial/trust decision needs: the device-id to decide identity, and the "host:port" addresses its own peer-advert claims are directly reachable at, in the order it advertised them. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, et as PeerAdvert } from "../protocol-
|
|
1
|
+
import { D as DeviceId, et as PeerAdvert } from "../protocol-DCDae3z4.mjs";
|
|
2
2
|
import { MeshSession } from "./mesh-session.mjs";
|
|
3
3
|
//#region src/domain/gossip-expansion.d.ts
|
|
4
4
|
/** One not-yet-considered device this session's gossip directory has surfaced, carrying only what a dial/trust decision needs: the device-id to decide identity, and the "host:port" addresses its own peer-advert claims are directly reachable at, in the order it advertised them. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_gossip_extensions = require("../gossip-extensions-
|
|
2
|
+
const require_gossip_extensions = require("../gossip-extensions-BBYgMZ2N.cjs");
|
|
3
|
+
exports.RESERVED_PEER_ADVERT_KEYS = require_gossip_extensions.RESERVED_PEER_ADVERT_KEYS;
|
|
3
4
|
exports.TOPOLOGY_PEERS_GOSSIP_KEY = require_gossip_extensions.TOPOLOGY_PEERS_GOSSIP_KEY;
|
|
4
5
|
exports.validateGossipExtensions = require_gossip_extensions.validateGossipExtensions;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
//#region src/domain/gossip-extensions.d.ts
|
|
2
|
+
/** peer-advert's own typed fields, reserved so a `sendGossipUpdate` caller can never override the session's own device-id, address list, freshness timestamp, self-certifying key, or signature by supplying an extension of the same name. The last two matter most: an extension able to shadow them would let a caller replace the very fields wire-mesh#225's authentication rests on. */
|
|
3
|
+
export declare const RESERVED_PEER_ADVERT_KEYS: ReadonlySet<string>;
|
|
2
4
|
/** The gossip extension key topology self-advertisement (wire-mesh#180) is carried under -- session-managed, computed fresh from this session's own connection/relayPairings state on every self-advert, never a caller-supplied fact. */
|
|
3
5
|
export declare const TOPOLOGY_PEERS_GOSSIP_KEY = "topology/peers";
|
|
4
6
|
/** Rejects a `sendGossipUpdate` extension bag that would shadow one of peer-advert's own mandatory fields, shadow topology/peers (a field the session itself already computes and injects automatically, wire-mesh#180), use the key wire-mesh-core itself reserves for its own self-reported version (wire-mesh#179), or use a bare, non-domain-qualified key -- all are caller bugs that must fail loudly at the call site, not silently corrupt or ambiguously merge into the wire frame. */
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
//#region src/domain/gossip-extensions.d.ts
|
|
2
|
+
/** peer-advert's own typed fields, reserved so a `sendGossipUpdate` caller can never override the session's own device-id, address list, freshness timestamp, self-certifying key, or signature by supplying an extension of the same name. The last two matter most: an extension able to shadow them would let a caller replace the very fields wire-mesh#225's authentication rests on. */
|
|
3
|
+
export declare const RESERVED_PEER_ADVERT_KEYS: ReadonlySet<string>;
|
|
2
4
|
/** The gossip extension key topology self-advertisement (wire-mesh#180) is carried under -- session-managed, computed fresh from this session's own connection/relayPairings state on every self-advert, never a caller-supplied fact. */
|
|
3
5
|
export declare const TOPOLOGY_PEERS_GOSSIP_KEY = "topology/peers";
|
|
4
6
|
/** Rejects a `sendGossipUpdate` extension bag that would shadow one of peer-advert's own mandatory fields, shadow topology/peers (a field the session itself already computes and injects automatically, wire-mesh#180), use the key wire-mesh-core itself reserves for its own self-reported version (wire-mesh#179), or use a bare, non-domain-qualified key -- all are caller bugs that must fail loudly at the call site, not silently corrupt or ambiguously merge into the wire frame. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as validateGossipExtensions, t as
|
|
2
|
-
export { TOPOLOGY_PEERS_GOSSIP_KEY, validateGossipExtensions };
|
|
1
|
+
import { n as TOPOLOGY_PEERS_GOSSIP_KEY, r as validateGossipExtensions, t as RESERVED_PEER_ADVERT_KEYS } from "../gossip-extensions-B6WJjkAr.mjs";
|
|
2
|
+
export { RESERVED_PEER_ADVERT_KEYS, TOPOLOGY_PEERS_GOSSIP_KEY, validateGossipExtensions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, f as CapabilityScope } from "../protocol-
|
|
1
|
+
import { D as DeviceId, f as CapabilityScope } from "../protocol-DCDae3z4.cjs";
|
|
2
2
|
import { DirectoryEntry, MeshSession } from "./mesh-session.cjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/domain/grant-candidates.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, f as CapabilityScope } from "../protocol-
|
|
1
|
+
import { D as DeviceId, f as CapabilityScope } from "../protocol-DCDae3z4.mjs";
|
|
2
2
|
import { DirectoryEntry, MeshSession } from "./mesh-session.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/domain/grant-candidates.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-
|
|
1
|
+
import { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-DCDae3z4.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 { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-
|
|
1
|
+
import { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-DCDae3z4.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;
|