wire-mesh-core 1.45.2 → 1.47.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-fs-storage.cjs +3 -24
- 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.cjs +42 -0
- package/dist/adapters/threshold-identity.d.cts +33 -0
- package/dist/adapters/threshold-identity.d.mts +33 -0
- package/dist/adapters/threshold-identity.mjs +41 -0
- package/dist/adapters/threshold-wasm.cjs +139 -0
- package/dist/adapters/threshold-wasm.d.cts +63 -0
- package/dist/adapters/threshold-wasm.d.mts +63 -0
- package/dist/adapters/threshold-wasm.mjs +123 -0
- package/dist/adapters/tls-transport.d.cts +1 -1
- package/dist/adapters/tls-transport.d.mts +1 -1
- package/dist/domain/bulk.cjs +26 -0
- package/dist/domain/bulk.d.cts +10 -2
- package/dist/domain/bulk.d.mts +10 -2
- package/dist/domain/bulk.mjs +26 -1
- package/dist/domain/capability-grant.cjs +1 -1
- package/dist/domain/capability-grant.d.cts +3 -3
- package/dist/domain/capability-grant.d.mts +3 -3
- package/dist/domain/capability-grant.mjs +1 -1
- package/dist/domain/capability-request.cjs +1 -1
- package/dist/domain/capability-request.d.cts +2 -2
- package/dist/domain/capability-request.d.mts +2 -2
- package/dist/domain/capability-request.mjs +1 -1
- 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/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.d.cts +3 -3
- package/dist/domain/mesh-session.d.mts +3 -3
- package/dist/domain/notice-board.d.cts +3 -3
- package/dist/domain/notice-board.d.mts +3 -3
- package/dist/domain/relay-hub.d.cts +2 -2
- package/dist/domain/relay-hub.d.mts +2 -2
- 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.cjs +1 -1
- package/dist/domain/revocation-view.d.cts +2 -2
- package/dist/domain/revocation-view.d.mts +2 -2
- package/dist/domain/revocation-view.mjs +1 -1
- package/dist/domain/room-rekey.d.cts +3 -3
- package/dist/domain/room-rekey.d.mts +3 -3
- package/dist/domain/room-token-verification.cjs +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/room-token-verification.mjs +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/threshold-subject.cjs +35 -0
- package/dist/domain/threshold-subject.d.cts +33 -0
- package/dist/domain/threshold-subject.d.mts +33 -0
- package/dist/domain/threshold-subject.mjs +32 -0
- package/dist/domain/tokens.cjs +2 -1
- package/dist/domain/tokens.d.cts +2 -2
- package/dist/domain/tokens.d.mts +2 -2
- package/dist/domain/tokens.mjs +2 -2
- package/dist/domain/webrtc-signaling.cjs +107 -0
- package/dist/domain/webrtc-signaling.d.cts +38 -0
- package/dist/domain/webrtc-signaling.d.mts +38 -0
- package/dist/domain/webrtc-signaling.mjs +93 -0
- package/dist/generated/protocol.cjs +97 -1
- package/dist/generated/protocol.d.cts +2 -2
- package/dist/generated/protocol.d.mts +2 -2
- package/dist/generated/protocol.mjs +85 -2
- package/dist/{identity-B4XBWkqg.d.cts → identity-9TmmK7vP.d.mts} +1 -1
- package/dist/{identity-CIb9dGkJ.d.mts → identity-CUkDHCRK.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-gbXtNeOc.d.cts → protocol-CNFRVx9w.d.cts} +333 -1
- package/dist/{protocol-gbXtNeOc.d.mts → protocol-CNFRVx9w.d.mts} +333 -1
- package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
- package/dist/{room-token-verification-BggPfYr8.d.mts → room-token-verification-BdtM1rQ4.d.mts} +2 -2
- package/dist/{room-token-verification-CkQV0Iq7.d.cts → room-token-verification-DpOfZOdl.d.cts} +2 -2
- package/dist/{tokens-CdQwzCyJ.mjs → tokens-B0dpTLhS.mjs} +2 -2
- package/dist/{tokens-k172l0Iy.d.mts → tokens-CVyPoJ6l.d.mts} +5 -3
- package/dist/{tokens-C9Kwy0Gk.d.cts → tokens-Cl8sQo7o.d.cts} +5 -3
- package/dist/{tokens-DxGVURpB.cjs → tokens-Dh6mG6p_.cjs} +7 -1
- package/dist/{transport-DAsFqDDS.d.cts → transport-C7KVkhgb.d.mts} +1 -1
- package/dist/{transport-Dy4h2eNY.d.mts → transport-De0zHlaA.d.cts} +1 -1
- package/package.json +50 -34
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { deviceIdSchema } from "../generated/protocol.mjs";
|
|
2
|
+
import * as wasm from "../../wasm-dist/wire_mesh_threshold_wasm.js";
|
|
3
|
+
//#region src/adapters/threshold-wasm.ts
|
|
4
|
+
/**
|
|
5
|
+
* A typed TS wrapper over the WASM build of `wire-mesh-threshold` (the audited `frost-core`/`frost-ed25519` crates, ZcashFoundation, NCC-audited) -- wire-mesh#29's own chosen route for a TS FROST(Ed25519, SHA-512) participant, over a from-scratch reimplementation of the cryptography.
|
|
6
|
+
*
|
|
7
|
+
* Built by `scripts/build-threshold-wasm.sh` into `wasm-dist/` (gitignored, a genuine compiled build artifact like `dist/`, never committed) -- run it before importing this module, in dev and in CI alike. This module performs NO domain logic of its own, only re-typing the raw wasm bindings' `Uint8Array`/`Array<any>` surface against this package's own `DeviceId` type and Node-capable-device-only availability: FROST participation cannot use Web Crypto at all (raw scalar/point arithmetic is deliberately outside what Web Crypto exposes), so unlike `node-identity.ts`'s counterpart in `web-crypto-identity.ts`, this adapter has no browser-side equivalent in v1 -- per wire-mesh#29's own resolved design, a browser is a threshold-group BEARER only, never a SHAREHOLDER, in v1.
|
|
8
|
+
*/
|
|
9
|
+
function isUint8Array(value) {
|
|
10
|
+
return value instanceof Uint8Array;
|
|
11
|
+
}
|
|
12
|
+
/** Copies into a fresh, whole-buffer `Uint8Array<ArrayBuffer>` -- the wasm-bindgen-generated `.d.ts` declares its `Uint8Array` returns unparameterized (`Uint8Array<ArrayBufferLike>`), which callers such as `verifyWithPublicKey` (`node-identity.ts`) reject; this is the same normalisation that adapter's own `toBufferSource` already applies at its boundary. */
|
|
13
|
+
function toBufferSource(bytes) {
|
|
14
|
+
return Uint8Array.from(bytes);
|
|
15
|
+
}
|
|
16
|
+
function toParallelArrays(entries) {
|
|
17
|
+
return [entries.map((e) => e.deviceId), entries.map((e) => e.value)];
|
|
18
|
+
}
|
|
19
|
+
function fromParallelArrays(ids, values) {
|
|
20
|
+
if (ids.length !== values.length) throw new Error(`wasm returned mismatched parallel arrays: ${String(ids.length)} ids, ${String(values.length)} values`);
|
|
21
|
+
const result = [];
|
|
22
|
+
for (let i = 0; i < ids.length; i += 1) {
|
|
23
|
+
const id = ids[i];
|
|
24
|
+
const value = values[i];
|
|
25
|
+
if (!isUint8Array(value)) throw new Error("wasm returned a non-Uint8Array value in a parallel array");
|
|
26
|
+
result.push({
|
|
27
|
+
deviceId: deviceIdSchema.parse(id),
|
|
28
|
+
value: toBufferSource(value)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
/** Round 1: samples this participant's own polynomial and commits to it. See `wire_mesh_threshold::dkg::round1`'s own doc comment for the full design. */
|
|
34
|
+
function dkgRound1(ownDeviceId, maxSigners, minSigners) {
|
|
35
|
+
const out = wasm.dkg_round1(ownDeviceId, maxSigners, minSigners);
|
|
36
|
+
return {
|
|
37
|
+
secretPackage: toBufferSource(out.secretPackage),
|
|
38
|
+
package: toBufferSource(out.package)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/** Round 2: verifies every other participant's round-1 proof of knowledge and computes this participant's own pairwise sub-shares. `round1` MUST NOT include this participant's own package. */
|
|
42
|
+
function dkgRound2(ownSecretPackage, round1) {
|
|
43
|
+
const [ids, packages] = toParallelArrays(round1);
|
|
44
|
+
const out = wasm.dkg_round2(ownSecretPackage, ids, packages);
|
|
45
|
+
return {
|
|
46
|
+
secretPackage: toBufferSource(out.secretPackage),
|
|
47
|
+
outgoing: fromParallelArrays(out.recipientIds, out.packages)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** Round 3 (local, no wire traffic): verifies every received round-2 package and sums them into this participant's own long-term key package. `round1`/`round2` MUST NOT include this participant's own packages. */
|
|
51
|
+
function dkgRound3(ownSecretPackage, round1, round2) {
|
|
52
|
+
const [ids1, packages1] = toParallelArrays(round1);
|
|
53
|
+
const [ids2, packages2] = toParallelArrays(round2);
|
|
54
|
+
const out = wasm.dkg_round3(ownSecretPackage, ids1, packages1, ids2, packages2);
|
|
55
|
+
return {
|
|
56
|
+
keyPackage: toBufferSource(out.keyPackage),
|
|
57
|
+
publicKeyPackage: toBufferSource(out.publicKeyPackage),
|
|
58
|
+
groupVerifyingKey: toBufferSource(out.groupVerifyingKey)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** The echo-broadcast transcript digest this participant sends on `threshold-keygen-confirm` -- SHA-256 over the FULL ordered set of every round-1 package (including this participant's own), so two honest participants' digests are directly comparable. */
|
|
62
|
+
function dkgTranscriptDigest(allRound1, groupVerifyingKey) {
|
|
63
|
+
const [ids, packages] = toParallelArrays(allRound1);
|
|
64
|
+
return toBufferSource(wasm.dkg_transcript_digest(ids, packages, groupVerifyingKey));
|
|
65
|
+
}
|
|
66
|
+
/** Verifies this participant's own transcript digest/group key against what a peer reported. A mismatch means the ceremony MUST abort, never be repaired in place. */
|
|
67
|
+
function dkgConfirmMatches(ownDigest, ownGroupKey, peerDigest, peerGroupKey) {
|
|
68
|
+
return wasm.dkg_confirm_matches(ownDigest, ownGroupKey, peerDigest, peerGroupKey);
|
|
69
|
+
}
|
|
70
|
+
/** Extracts a key package's own signing-share bytes -- what `reshareRound1` needs as `ownOldSigningShare`. */
|
|
71
|
+
function keyPackageSigningShare(keyPackage) {
|
|
72
|
+
return toBufferSource(wasm.key_package_signing_share(keyPackage));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The pure-crypto half of round 1: generates a fresh nonce pair and its commitments. Persisting `nonces` durably before this participant's own round-1 response leaves the device is the CALLER's own obligation -- nonce reuse across two released signature shares discloses this participant's long-term key share outright. This function has no storage dependency and cannot enforce that obligation itself.
|
|
76
|
+
*/
|
|
77
|
+
function signingRound1Commit(ownKeyPackage) {
|
|
78
|
+
const out = wasm.signing_round1_commit(ownKeyPackage);
|
|
79
|
+
return {
|
|
80
|
+
nonces: toBufferSource(out.nonces),
|
|
81
|
+
commitments: toBufferSource(out.commitments)
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/** Coordinator-side: builds the signing-package bytes every participant's round 2 is computed against. */
|
|
85
|
+
function signingBuildPackage(commitments, message) {
|
|
86
|
+
const [ids, values] = toParallelArrays(commitments);
|
|
87
|
+
return toBufferSource(wasm.signing_build_package(ids, values, message));
|
|
88
|
+
}
|
|
89
|
+
/** Round 2: releases this participant's signature share. The CALLER MUST have already taken (one-shot) `nonces` from its own durable nonce store before calling this. */
|
|
90
|
+
function signingRound2Sign(nonces, signingPackage, ownKeyPackage) {
|
|
91
|
+
return toBufferSource(wasm.signing_round2_sign(nonces, signingPackage, ownKeyPackage));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Coordinator-side: sums and verifies the collected shares into the final aggregate signature -- an ordinary 64-byte Ed25519 signature. Throws if verification fails (a malformed or forged share); a caller MUST treat any thrown error here as "publish nothing".
|
|
95
|
+
*/
|
|
96
|
+
function signingAggregate(signingPackage, shares, publicKeyPackage) {
|
|
97
|
+
const [ids, values] = toParallelArrays(shares);
|
|
98
|
+
return toBufferSource(wasm.signing_aggregate(signingPackage, ids, values, publicKeyPackage));
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Survivor side: re-shares this device's own Lagrange-weighted sub-share of the group secret across a new (possibly different) participant set. See `wire_mesh_threshold::reshare`'s own module doc comment (Rust side) for the full design rationale -- deliberately not built on a zero-secret "refresh" delta, which cannot onboard a device with no prior share or safely change the threshold.
|
|
102
|
+
*/
|
|
103
|
+
function reshareRound1(ownDeviceId, ownOldSigningShare, survivorDeviceIds, newParticipantDeviceIds, newMinSigners) {
|
|
104
|
+
const out = wasm.reshare_round1(ownDeviceId, ownOldSigningShare, [...survivorDeviceIds], [...newParticipantDeviceIds], newMinSigners);
|
|
105
|
+
return {
|
|
106
|
+
commitment: toBufferSource(out.commitment),
|
|
107
|
+
outgoing: fromParallelArrays(out.recipientIds, out.shares)
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/** Sums T survivors' broadcast commitment vectors into the one combined VSS commitment `reshareDerivePublicKeyPackage` needs. */
|
|
111
|
+
function reshareCombineCommitments(commitments) {
|
|
112
|
+
return toBufferSource(wasm.reshare_combine_commitments([...commitments]));
|
|
113
|
+
}
|
|
114
|
+
/** The group's derived public key given the combined commitment and the new participant set -- reused directly by `threshold-keygen-confirm`'s own group-key check (MUST equal the group's `existing-group-key` for a reshare). */
|
|
115
|
+
function reshareDerivePublicKeyPackage(combinedCommitment, newParticipantDeviceIds) {
|
|
116
|
+
return toBufferSource(wasm.reshare_derive_public_key_package(combinedCommitment, [...newParticipantDeviceIds]));
|
|
117
|
+
}
|
|
118
|
+
/** New-participant side (local): verifies each received share against its own embedded commitment, sums the validated shares, and builds this participant's final key package. */
|
|
119
|
+
function reshareCombineReceivedShares(ownDeviceId, received, publicKeyPackage, newMinSigners) {
|
|
120
|
+
return toBufferSource(wasm.reshare_combine_received_shares(ownDeviceId, [...received], publicKeyPackage, newMinSigners));
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
export { dkgConfirmMatches, dkgRound1, dkgRound2, dkgRound3, dkgTranscriptDigest, keyPackageSigningShare, reshareCombineCommitments, reshareCombineReceivedShares, reshareDerivePublicKeyPackage, reshareRound1, signingAggregate, signingBuildPackage, signingRound1Commit, signingRound2Sign };
|
package/dist/domain/bulk.cjs
CHANGED
|
@@ -247,6 +247,31 @@ function decodeUint(bytes) {
|
|
|
247
247
|
return Number(new TextDecoder().decode(bytes));
|
|
248
248
|
}
|
|
249
249
|
/**
|
|
250
|
+
* Builds a CreateBulkSenderOptions.source reading back a transfer this same storage already durably received as a BulkReceiver -- the read-back half of the mailbox/holder re-serving role (wire-mesh#161): a holder that accepted a shard once via createBulkReceiver's own createOpenHandler can re-serve the identical bytes to a fresh requester by constructing an ordinary createBulkSender over this source, reusing the exact chunk/ack-seq storage keys createBulkReceiver already wrote for the same transfer-id. Chunks past whatever ack-seq this storage currently holds durably are simply not yielded yet -- calling this before the original receipt has finished durably persisting every chunk is a caller error the resulting short read surfaces downstream as a digest mismatch on the receiving end, not something this function detects itself. Satisfies source's own re-readability contract (callable more than once, from any previously-reached seq, identical bytes each time) by construction: every call re-reads storage fresh rather than caching anything.
|
|
251
|
+
*/
|
|
252
|
+
function storedTransferSource(options) {
|
|
253
|
+
const { storage, transferId } = options;
|
|
254
|
+
const idHex = transferIdHex(transferId);
|
|
255
|
+
return (fromSeq) => ({ [Symbol.asyncIterator]() {
|
|
256
|
+
let seq = fromSeq;
|
|
257
|
+
return { async next() {
|
|
258
|
+
const ackedBytes = await storage.get(ackSeqKey(idHex));
|
|
259
|
+
const ackedCount = ackedBytes === void 0 ? 0 : decodeUint(ackedBytes);
|
|
260
|
+
if (seq >= ackedCount) return {
|
|
261
|
+
value: void 0,
|
|
262
|
+
done: true
|
|
263
|
+
};
|
|
264
|
+
const chunk = await storage.get(chunkKey(idHex, seq));
|
|
265
|
+
if (chunk === void 0) throw new Error(`stored transfer ${idHex} is missing chunk ${String(seq)} though ack-seq claims ${String(ackedCount)} durable`);
|
|
266
|
+
seq += 1;
|
|
267
|
+
return {
|
|
268
|
+
value: chunk,
|
|
269
|
+
done: false
|
|
270
|
+
};
|
|
271
|
+
} };
|
|
272
|
+
} });
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
250
275
|
* Builds a receiver coordinator over one KeyValueStorage. Constructed once and shared across every connection this side accepts -- durable per-transfer state (which chunks are persisted, who opened it) and the in-memory registry of which connection currently owns each transfer must both outlive any one connection for resumption to mean anything at all.
|
|
251
276
|
*/
|
|
252
277
|
function createBulkReceiver(options) {
|
|
@@ -398,3 +423,4 @@ exports.buildBulkOpenCommand = buildBulkOpenCommand;
|
|
|
398
423
|
exports.buildBulkResumeCommand = buildBulkResumeCommand;
|
|
399
424
|
exports.createBulkReceiver = createBulkReceiver;
|
|
400
425
|
exports.createBulkSender = createBulkSender;
|
|
426
|
+
exports.storedTransferSource = storedTransferSource;
|
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-CNFRVx9w.cjs";
|
|
2
2
|
import { KeyValueStorage } from "../ports/storage.cjs";
|
|
3
|
-
import { t as Connection } from "../transport-
|
|
3
|
+
import { t as Connection } from "../transport-De0zHlaA.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. */
|
|
@@ -90,6 +90,14 @@ export interface BulkReceiver {
|
|
|
90
90
|
export interface CreateBulkReceiverOptions {
|
|
91
91
|
storage: KeyValueStorage;
|
|
92
92
|
}
|
|
93
|
+
export interface StoredTransferSourceOptions {
|
|
94
|
+
storage: KeyValueStorage;
|
|
95
|
+
transferId: Uint8Array<ArrayBuffer>;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Builds a CreateBulkSenderOptions.source reading back a transfer this same storage already durably received as a BulkReceiver -- the read-back half of the mailbox/holder re-serving role (wire-mesh#161): a holder that accepted a shard once via createBulkReceiver's own createOpenHandler can re-serve the identical bytes to a fresh requester by constructing an ordinary createBulkSender over this source, reusing the exact chunk/ack-seq storage keys createBulkReceiver already wrote for the same transfer-id. Chunks past whatever ack-seq this storage currently holds durably are simply not yielded yet -- calling this before the original receipt has finished durably persisting every chunk is a caller error the resulting short read surfaces downstream as a digest mismatch on the receiving end, not something this function detects itself. Satisfies source's own re-readability contract (callable more than once, from any previously-reached seq, identical bytes each time) by construction: every call re-reads storage fresh rather than caching anything.
|
|
99
|
+
*/
|
|
100
|
+
export declare function storedTransferSource(options: Readonly<StoredTransferSourceOptions>): (fromSeq: number) => AsyncIterable<Uint8Array<ArrayBuffer>>;
|
|
93
101
|
/**
|
|
94
102
|
* Builds a receiver coordinator over one KeyValueStorage. Constructed once and shared across every connection this side accepts -- durable per-transfer state (which chunks are persisted, who opened it) and the in-memory registry of which connection currently owns each transfer must both outlive any one connection for resumption to mean anything at all.
|
|
95
103
|
*/
|
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-CNFRVx9w.mjs";
|
|
2
2
|
import { KeyValueStorage } from "../ports/storage.mjs";
|
|
3
|
-
import { t as Connection } from "../transport-
|
|
3
|
+
import { t as Connection } from "../transport-C7KVkhgb.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. */
|
|
@@ -90,6 +90,14 @@ export interface BulkReceiver {
|
|
|
90
90
|
export interface CreateBulkReceiverOptions {
|
|
91
91
|
storage: KeyValueStorage;
|
|
92
92
|
}
|
|
93
|
+
export interface StoredTransferSourceOptions {
|
|
94
|
+
storage: KeyValueStorage;
|
|
95
|
+
transferId: Uint8Array<ArrayBuffer>;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Builds a CreateBulkSenderOptions.source reading back a transfer this same storage already durably received as a BulkReceiver -- the read-back half of the mailbox/holder re-serving role (wire-mesh#161): a holder that accepted a shard once via createBulkReceiver's own createOpenHandler can re-serve the identical bytes to a fresh requester by constructing an ordinary createBulkSender over this source, reusing the exact chunk/ack-seq storage keys createBulkReceiver already wrote for the same transfer-id. Chunks past whatever ack-seq this storage currently holds durably are simply not yielded yet -- calling this before the original receipt has finished durably persisting every chunk is a caller error the resulting short read surfaces downstream as a digest mismatch on the receiving end, not something this function detects itself. Satisfies source's own re-readability contract (callable more than once, from any previously-reached seq, identical bytes each time) by construction: every call re-reads storage fresh rather than caching anything.
|
|
99
|
+
*/
|
|
100
|
+
export declare function storedTransferSource(options: Readonly<StoredTransferSourceOptions>): (fromSeq: number) => AsyncIterable<Uint8Array<ArrayBuffer>>;
|
|
93
101
|
/**
|
|
94
102
|
* Builds a receiver coordinator over one KeyValueStorage. Constructed once and shared across every connection this side accepts -- durable per-transfer state (which chunks are persisted, who opened it) and the in-memory registry of which connection currently owns each transfer must both outlive any one connection for resumption to mean anything at all.
|
|
95
103
|
*/
|
package/dist/domain/bulk.mjs
CHANGED
|
@@ -246,6 +246,31 @@ function decodeUint(bytes) {
|
|
|
246
246
|
return Number(new TextDecoder().decode(bytes));
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
|
+
* Builds a CreateBulkSenderOptions.source reading back a transfer this same storage already durably received as a BulkReceiver -- the read-back half of the mailbox/holder re-serving role (wire-mesh#161): a holder that accepted a shard once via createBulkReceiver's own createOpenHandler can re-serve the identical bytes to a fresh requester by constructing an ordinary createBulkSender over this source, reusing the exact chunk/ack-seq storage keys createBulkReceiver already wrote for the same transfer-id. Chunks past whatever ack-seq this storage currently holds durably are simply not yielded yet -- calling this before the original receipt has finished durably persisting every chunk is a caller error the resulting short read surfaces downstream as a digest mismatch on the receiving end, not something this function detects itself. Satisfies source's own re-readability contract (callable more than once, from any previously-reached seq, identical bytes each time) by construction: every call re-reads storage fresh rather than caching anything.
|
|
250
|
+
*/
|
|
251
|
+
function storedTransferSource(options) {
|
|
252
|
+
const { storage, transferId } = options;
|
|
253
|
+
const idHex = transferIdHex(transferId);
|
|
254
|
+
return (fromSeq) => ({ [Symbol.asyncIterator]() {
|
|
255
|
+
let seq = fromSeq;
|
|
256
|
+
return { async next() {
|
|
257
|
+
const ackedBytes = await storage.get(ackSeqKey(idHex));
|
|
258
|
+
const ackedCount = ackedBytes === void 0 ? 0 : decodeUint(ackedBytes);
|
|
259
|
+
if (seq >= ackedCount) return {
|
|
260
|
+
value: void 0,
|
|
261
|
+
done: true
|
|
262
|
+
};
|
|
263
|
+
const chunk = await storage.get(chunkKey(idHex, seq));
|
|
264
|
+
if (chunk === void 0) throw new Error(`stored transfer ${idHex} is missing chunk ${String(seq)} though ack-seq claims ${String(ackedCount)} durable`);
|
|
265
|
+
seq += 1;
|
|
266
|
+
return {
|
|
267
|
+
value: chunk,
|
|
268
|
+
done: false
|
|
269
|
+
};
|
|
270
|
+
} };
|
|
271
|
+
} });
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
249
274
|
* Builds a receiver coordinator over one KeyValueStorage. Constructed once and shared across every connection this side accepts -- durable per-transfer state (which chunks are persisted, who opened it) and the in-memory registry of which connection currently owns each transfer must both outlive any one connection for resumption to mean anything at all.
|
|
250
275
|
*/
|
|
251
276
|
function createBulkReceiver(options) {
|
|
@@ -390,4 +415,4 @@ function createBulkReceiver(options) {
|
|
|
390
415
|
};
|
|
391
416
|
}
|
|
392
417
|
//#endregion
|
|
393
|
-
export { BULK_READ_CAPABILITY, BULK_WRITE_CAPABILITY, buildBulkCancelCommand, buildBulkOpenCommand, buildBulkResumeCommand, createBulkReceiver, createBulkSender };
|
|
418
|
+
export { BULK_READ_CAPABILITY, BULK_WRITE_CAPABILITY, buildBulkCancelCommand, buildBulkOpenCommand, buildBulkResumeCommand, createBulkReceiver, createBulkSender, storedTransferSource };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_generated_protocol = require("../generated/protocol.cjs");
|
|
3
3
|
const require_token_scope = require("../token-scope-CxHXTT3u.cjs");
|
|
4
|
-
const require_tokens = require("../tokens-
|
|
4
|
+
const require_tokens = require("../tokens-Dh6mG6p_.cjs");
|
|
5
5
|
//#region src/domain/capability-grant.ts
|
|
6
6
|
/**
|
|
7
7
|
* The generic, capability-agnostic capability-grant primitive (wire-mesh#117, spec/management.cddl) -- the unsolicited push counterpart to capability-request.ts's own ask/response primitive. Where capability-request lifts core/room's room.join shape (a pull: the requester asks, the owner mints and returns a grant on the same response) out of that one domain, capability-grant lifts room.invite's own shape (a push: the owner mints unprompted and delivers the grant in the request itself, since there is no approval round-trip to carry it back) the same way. core/room's own room-client.ts is the reference consumer: it builds sendRoomInvite as a thin wrapper over sendCapabilityGrant below, and wires createRoomRouter's dispatch onto createCapabilityGrantHandler for the receiving side.
|
|
@@ -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-CNFRVx9w.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-CUkDHCRK.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-Cl8sQo7o.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-CNFRVx9w.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-9TmmK7vP.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-CVyPoJ6l.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,6 +1,6 @@
|
|
|
1
1
|
import { capabilityGrantSchema } from "../generated/protocol.mjs";
|
|
2
2
|
import { n as scopeNarrows } from "../token-scope-Z4bmci4M.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { a as verifyCapabilityToken } from "../tokens-B0dpTLhS.mjs";
|
|
4
4
|
//#region src/domain/capability-grant.ts
|
|
5
5
|
/**
|
|
6
6
|
* The generic, capability-agnostic capability-grant primitive (wire-mesh#117, spec/management.cddl) -- the unsolicited push counterpart to capability-request.ts's own ask/response primitive. Where capability-request lifts core/room's room.join shape (a pull: the requester asks, the owner mints and returns a grant on the same response) out of that one domain, capability-grant lifts room.invite's own shape (a push: the owner mints unprompted and delivers the grant in the request itself, since there is no approval round-trip to carry it back) the same way. core/room's own room-client.ts is the reference consumer: it builds sendRoomInvite as a thin wrapper over sendCapabilityGrant below, and wires createRoomRouter's dispatch onto createCapabilityGrantHandler for the receiving side.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_generated_protocol = require("../generated/protocol.cjs");
|
|
3
|
-
const require_tokens = require("../tokens-
|
|
3
|
+
const require_tokens = require("../tokens-Dh6mG6p_.cjs");
|
|
4
4
|
//#region src/domain/capability-request.ts
|
|
5
5
|
/**
|
|
6
6
|
* The generic, capability-agnostic capability-request / capability-grant-ok primitive (wire-mesh#78, spec/management.cddl). Lifts core/room's own room.join shape -- an ungated ask, held open, a human (or any other domain-supplied decision) accepts or refuses, acceptance mints and returns a token on the same response -- out of that one domain so any capability can reuse it, not just room:member. core/room's own room-client.ts is the reference consumer: it rewires requestToJoin/createRoomRouter's room.join handling onto requestCapability/createCapabilityRequestHandler below, supplying room-specific extension fields (its member list) through this module's own extensions mechanism rather than this module knowing anything about rooms.
|
|
@@ -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-CNFRVx9w.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-CUkDHCRK.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-CNFRVx9w.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-9TmmK7vP.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,5 +1,5 @@
|
|
|
1
1
|
import { capabilityGrantOkSchema, capabilityRequestSchema } from "../generated/protocol.mjs";
|
|
2
|
-
import { n as mintCapabilityToken } from "../tokens-
|
|
2
|
+
import { n as mintCapabilityToken } from "../tokens-B0dpTLhS.mjs";
|
|
3
3
|
//#region src/domain/capability-request.ts
|
|
4
4
|
/**
|
|
5
5
|
* The generic, capability-agnostic capability-request / capability-grant-ok primitive (wire-mesh#78, spec/management.cddl). Lifts core/room's own room.join shape -- an ungated ask, held open, a human (or any other domain-supplied decision) accepts or refuses, acceptance mints and returns a token on the same response -- out of that one domain so any capability can reuse it, not just room:member. core/room's own room-client.ts is the reference consumer: it rewires requestToJoin/createRoomRouter's room.join handling onto requestCapability/createCapabilityRequestHandler below, supplying room-specific extension fields (its member list) through this module's own extensions mechanism rather than this module knowing anything about rooms.
|
|
@@ -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-CNFRVx9w.cjs";
|
|
2
2
|
import { KeyValueStorage } from "../ports/storage.cjs";
|
|
3
|
-
import { t as IdentityPort } from "../identity-
|
|
3
|
+
import { t as IdentityPort } from "../identity-CUkDHCRK.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-CNFRVx9w.mjs";
|
|
2
2
|
import { KeyValueStorage } from "../ports/storage.mjs";
|
|
3
|
-
import { t as IdentityPort } from "../identity-
|
|
3
|
+
import { t as IdentityPort } from "../identity-9TmmK7vP.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-CNFRVx9w.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-CNFRVx9w.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 { D as DeviceId, f as CapabilityScope } from "../protocol-
|
|
1
|
+
import { D as DeviceId, f as CapabilityScope } from "../protocol-CNFRVx9w.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-CNFRVx9w.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, ot as ProtocolVersion } from "../protocol-
|
|
1
|
+
import { A as DomainId, R as HandshakeFrame, ot as ProtocolVersion } from "../protocol-CNFRVx9w.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, ot as ProtocolVersion } from "../protocol-
|
|
1
|
+
import { A as DomainId, R as HandshakeFrame, ot as ProtocolVersion } from "../protocol-CNFRVx9w.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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as DeviceId, E as DataRequestFrame, N as Frame, Q as PeerAdvert, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, _t as RevocationEntry, f as CapabilityScope, ot as ProtocolVersion, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, E as DataRequestFrame, N as Frame, Q as PeerAdvert, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, _t as RevocationEntry, f as CapabilityScope, ot as ProtocolVersion, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-CNFRVx9w.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-CUkDHCRK.cjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
4
|
-
import { r as Transport, t as Connection } from "../transport-
|
|
4
|
+
import { r as Transport, t as Connection } from "../transport-De0zHlaA.cjs";
|
|
5
5
|
//#region src/domain/mesh-session.d.ts
|
|
6
6
|
/** 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
7
|
export declare const HANDSHAKE_TIMEOUT_MS = 3000;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as DeviceId, E as DataRequestFrame, N as Frame, Q as PeerAdvert, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, _t as RevocationEntry, f as CapabilityScope, ot as ProtocolVersion, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, E as DataRequestFrame, N as Frame, Q as PeerAdvert, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, _t as RevocationEntry, f as CapabilityScope, ot as ProtocolVersion, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-CNFRVx9w.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-9TmmK7vP.mjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
4
|
-
import { r as Transport, t as Connection } from "../transport-
|
|
4
|
+
import { r as Transport, t as Connection } from "../transport-C7KVkhgb.mjs";
|
|
5
5
|
//#region src/domain/mesh-session.d.ts
|
|
6
6
|
/** 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
7
|
export declare const HANDSHAKE_TIMEOUT_MS = 3000;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DeviceId, Et as RoomNoticeClaims, T as DataHaveFrame, Tt as RoomNotice, p as CapabilityToken } from "../protocol-
|
|
1
|
+
import { D as DeviceId, Et as RoomNoticeClaims, T as DataHaveFrame, Tt as RoomNotice, p as CapabilityToken } from "../protocol-CNFRVx9w.cjs";
|
|
2
2
|
import { KeyValueStorage } from "../ports/storage.cjs";
|
|
3
|
-
import { t as IdentityPort } from "../identity-
|
|
3
|
+
import { t as IdentityPort } from "../identity-CUkDHCRK.cjs";
|
|
4
4
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
5
|
-
import { a as RevocationCheck } from "../tokens-
|
|
5
|
+
import { a as RevocationCheck } from "../tokens-Cl8sQo7o.cjs";
|
|
6
6
|
import { RoomNoticeVerdictReason } from "./room.cjs";
|
|
7
7
|
//#region src/domain/notice-board.d.ts
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DeviceId, Et as RoomNoticeClaims, T as DataHaveFrame, Tt as RoomNotice, p as CapabilityToken } from "../protocol-
|
|
1
|
+
import { D as DeviceId, Et as RoomNoticeClaims, T as DataHaveFrame, Tt as RoomNotice, p as CapabilityToken } from "../protocol-CNFRVx9w.mjs";
|
|
2
2
|
import { KeyValueStorage } from "../ports/storage.mjs";
|
|
3
|
-
import { t as IdentityPort } from "../identity-
|
|
3
|
+
import { t as IdentityPort } from "../identity-9TmmK7vP.mjs";
|
|
4
4
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
5
|
-
import { a as RevocationCheck } from "../tokens-
|
|
5
|
+
import { a as RevocationCheck } from "../tokens-CVyPoJ6l.mjs";
|
|
6
6
|
import { RoomNoticeVerdictReason } from "./room.mjs";
|
|
7
7
|
//#region src/domain/notice-board.d.ts
|
|
8
8
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as Frame } from "../protocol-
|
|
2
|
-
import { t as Connection } from "../transport-
|
|
1
|
+
import { N as Frame } from "../protocol-CNFRVx9w.cjs";
|
|
2
|
+
import { t as Connection } from "../transport-De0zHlaA.cjs";
|
|
3
3
|
//#region src/domain/relay-hub.d.ts
|
|
4
4
|
export interface RelayHub {
|
|
5
5
|
/** Drives one accepted connection until it closes: registers gossip-advertised devices, re-broadcasts each gossip frame to every other connected client and replies to the gossiping connection with a catch-up frame of every other already-known device, answers relay-connect by pairing and notifying the target, and forwards relay-data within established pairings. Resolves when the connection's frame stream ends. Internally just registerConnection followed by a loop of onFrame calls and a final onDisconnect -- kept as its own method since a dedicated hub deployment (wire-mesh-node/cloudflare-hub) has nothing else driving the connection and wants the whole lifecycle in one call. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as Frame } from "../protocol-
|
|
2
|
-
import { t as Connection } from "../transport-
|
|
1
|
+
import { N as Frame } from "../protocol-CNFRVx9w.mjs";
|
|
2
|
+
import { t as Connection } from "../transport-C7KVkhgb.mjs";
|
|
3
3
|
//#region src/domain/relay-hub.d.ts
|
|
4
4
|
export interface RelayHub {
|
|
5
5
|
/** Drives one accepted connection until it closes: registers gossip-advertised devices, re-broadcasts each gossip frame to every other connected client and replies to the gossiping connection with a catch-up frame of every other already-known device, answers relay-connect by pairing and notifying the target, and forwards relay-data within established pairings. Resolves when the connection's frame stream ends. Internally just registerConnection followed by a loop of onFrame calls and a final onDisconnect -- kept as its own method since a dedicated hub deployment (wire-mesh-node/cloudflare-hub) has nothing else driving the connection and wants the whole lifecycle in one call. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as Frame } from "../protocol-
|
|
2
|
-
import { t as Connection } from "../transport-
|
|
1
|
+
import { N as Frame } from "../protocol-CNFRVx9w.cjs";
|
|
2
|
+
import { t as Connection } from "../transport-De0zHlaA.cjs";
|
|
3
3
|
//#region src/domain/relay-use-gate.d.ts
|
|
4
4
|
export interface RelayUseAuthorizationTracker {
|
|
5
5
|
/** True once authorize() has been called for this exact connection and revoke() has not been called since. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as Frame } from "../protocol-
|
|
2
|
-
import { t as Connection } from "../transport-
|
|
1
|
+
import { N as Frame } from "../protocol-CNFRVx9w.mjs";
|
|
2
|
+
import { t as Connection } from "../transport-C7KVkhgb.mjs";
|
|
3
3
|
//#region src/domain/relay-use-gate.d.ts
|
|
4
4
|
export interface RelayUseAuthorizationTracker {
|
|
5
5
|
/** True once authorize() has been called for this exact connection and revoke() has not been called since. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_domain_device_id = require("./device-id.cjs");
|
|
3
|
-
const require_tokens = require("../tokens-
|
|
3
|
+
const require_tokens = require("../tokens-Dh6mG6p_.cjs");
|
|
4
4
|
//#region src/domain/revocation-view.ts
|
|
5
5
|
function revocationKey(tokenId) {
|
|
6
6
|
return require_domain_device_id.bytesToHex(tokenId);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _t as RevocationEntry } from "../protocol-
|
|
2
|
-
import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-
|
|
1
|
+
import { _t as RevocationEntry } from "../protocol-CNFRVx9w.cjs";
|
|
2
|
+
import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-Cl8sQo7o.cjs";
|
|
3
3
|
//#region src/domain/revocation-view.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* An in-memory RevocationCheck fed by ingested revocation-announce frames. Keyed by token-id alone, per management.cddl's contract: a token-id can legitimately carry multiple recorded entries from different issuers (the token's own issuer, and/or any number of parties holding a delegated manage:revoke authorization over it) -- entriesFor returns every one of them unfiltered, since checking which actually apply (issuer-match, or a verified authorization) is verifyTokenChain's own obligation, not this store's.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _t as RevocationEntry } from "../protocol-
|
|
2
|
-
import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-
|
|
1
|
+
import { _t as RevocationEntry } from "../protocol-CNFRVx9w.mjs";
|
|
2
|
+
import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-CVyPoJ6l.mjs";
|
|
3
3
|
//#region src/domain/revocation-view.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* An in-memory RevocationCheck fed by ingested revocation-announce frames. Keyed by token-id alone, per management.cddl's contract: a token-id can legitimately carry multiple recorded entries from different issuers (the token's own issuer, and/or any number of parties holding a delegated manage:revoke authorization over it) -- entriesFor returns every one of them unfiltered, since checking which actually apply (issuer-match, or a verified authorization) is verifyTokenChain's own obligation, not this store's.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bytesToHex } from "./device-id.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { o as verifyRevocationEntry } from "../tokens-B0dpTLhS.mjs";
|
|
3
3
|
//#region src/domain/revocation-view.ts
|
|
4
4
|
function revocationKey(tokenId) {
|
|
5
5
|
return bytesToHex(tokenId);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, p as CapabilityToken } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, p as CapabilityToken } from "../protocol-CNFRVx9w.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-CUkDHCRK.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-Cl8sQo7o.cjs";
|
|
6
6
|
//#region src/domain/room-rekey.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* Builds a room.rekey command per room.cddl. The outer verb is room:member, the same "one resource, several inner verbs" pattern room.send/room.leave/room.members already establish -- not a new capability of its own.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, p as CapabilityToken } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, p as CapabilityToken } from "../protocol-CNFRVx9w.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-9TmmK7vP.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-CVyPoJ6l.mjs";
|
|
6
6
|
//#region src/domain/room-rekey.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* Builds a room.rekey command per room.cddl. The outer verb is room:member, the same "one resource, several inner verbs" pattern room.send/room.leave/room.members already establish -- not a new capability of its own.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_domain_device_id = require("./device-id.cjs");
|
|
3
|
-
const require_tokens = require("../tokens-
|
|
3
|
+
const require_tokens = require("../tokens-Dh6mG6p_.cjs");
|
|
4
4
|
const require_domain_room_path = require("./room-path.cjs");
|
|
5
5
|
//#region src/domain/room-token-verification.ts
|
|
6
6
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as verifyRoomToken, i as VerifyRoomTokenOptions, n as RoomTokenVerdict, r as RoomTokenVerdictReason, t as ROOM_MEMBER_CAPABILITY } from "../room-token-verification-
|
|
1
|
+
import { a as verifyRoomToken, i as VerifyRoomTokenOptions, n as RoomTokenVerdict, r as RoomTokenVerdictReason, t as ROOM_MEMBER_CAPABILITY } from "../room-token-verification-DpOfZOdl.cjs";
|
|
2
2
|
export { ROOM_MEMBER_CAPABILITY, RoomTokenVerdict, RoomTokenVerdictReason, VerifyRoomTokenOptions, verifyRoomToken };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as verifyRoomToken, i as VerifyRoomTokenOptions, n as RoomTokenVerdict, r as RoomTokenVerdictReason, t as ROOM_MEMBER_CAPABILITY } from "../room-token-verification-
|
|
1
|
+
import { a as verifyRoomToken, i as VerifyRoomTokenOptions, n as RoomTokenVerdict, r as RoomTokenVerdictReason, t as ROOM_MEMBER_CAPABILITY } from "../room-token-verification-BdtM1rQ4.mjs";
|
|
2
2
|
export { ROOM_MEMBER_CAPABILITY, RoomTokenVerdict, RoomTokenVerdictReason, VerifyRoomTokenOptions, verifyRoomToken };
|