wire-mesh-core 1.46.0 → 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.
Files changed (91) hide show
  1. package/dist/adapters/frame-codec.d.cts +1 -1
  2. package/dist/adapters/frame-codec.d.mts +1 -1
  3. package/dist/adapters/node-fs-storage.cjs +3 -24
  4. package/dist/adapters/node-identity.d.cts +2 -2
  5. package/dist/adapters/node-identity.d.mts +2 -2
  6. package/dist/adapters/tcp-transport.d.cts +1 -1
  7. package/dist/adapters/tcp-transport.d.mts +1 -1
  8. package/dist/adapters/threshold-identity.cjs +42 -0
  9. package/dist/adapters/threshold-identity.d.cts +33 -0
  10. package/dist/adapters/threshold-identity.d.mts +33 -0
  11. package/dist/adapters/threshold-identity.mjs +41 -0
  12. package/dist/adapters/threshold-wasm.cjs +139 -0
  13. package/dist/adapters/threshold-wasm.d.cts +63 -0
  14. package/dist/adapters/threshold-wasm.d.mts +63 -0
  15. package/dist/adapters/threshold-wasm.mjs +123 -0
  16. package/dist/adapters/tls-transport.d.cts +1 -1
  17. package/dist/adapters/tls-transport.d.mts +1 -1
  18. package/dist/domain/bulk.d.cts +2 -2
  19. package/dist/domain/bulk.d.mts +2 -2
  20. package/dist/domain/capability-grant.cjs +1 -1
  21. package/dist/domain/capability-grant.d.cts +3 -3
  22. package/dist/domain/capability-grant.d.mts +3 -3
  23. package/dist/domain/capability-grant.mjs +1 -1
  24. package/dist/domain/capability-request.cjs +1 -1
  25. package/dist/domain/capability-request.d.cts +2 -2
  26. package/dist/domain/capability-request.d.mts +2 -2
  27. package/dist/domain/capability-request.mjs +1 -1
  28. package/dist/domain/data-sync.d.cts +2 -2
  29. package/dist/domain/data-sync.d.mts +2 -2
  30. package/dist/domain/device-id.d.cts +1 -1
  31. package/dist/domain/device-id.d.mts +1 -1
  32. package/dist/domain/grant-candidates.d.cts +1 -1
  33. package/dist/domain/grant-candidates.d.mts +1 -1
  34. package/dist/domain/handshake.d.cts +1 -1
  35. package/dist/domain/handshake.d.mts +1 -1
  36. package/dist/domain/mesh-session.d.cts +3 -3
  37. package/dist/domain/mesh-session.d.mts +3 -3
  38. package/dist/domain/notice-board.d.cts +3 -3
  39. package/dist/domain/notice-board.d.mts +3 -3
  40. package/dist/domain/relay-hub.d.cts +2 -2
  41. package/dist/domain/relay-hub.d.mts +2 -2
  42. package/dist/domain/relay-use-gate.d.cts +2 -2
  43. package/dist/domain/relay-use-gate.d.mts +2 -2
  44. package/dist/domain/revocation-view.cjs +1 -1
  45. package/dist/domain/revocation-view.d.cts +2 -2
  46. package/dist/domain/revocation-view.d.mts +2 -2
  47. package/dist/domain/revocation-view.mjs +1 -1
  48. package/dist/domain/room-rekey.d.cts +3 -3
  49. package/dist/domain/room-rekey.d.mts +3 -3
  50. package/dist/domain/room-token-verification.cjs +1 -1
  51. package/dist/domain/room-token-verification.d.cts +1 -1
  52. package/dist/domain/room-token-verification.d.mts +1 -1
  53. package/dist/domain/room-token-verification.mjs +1 -1
  54. package/dist/domain/room.d.cts +4 -4
  55. package/dist/domain/room.d.mts +4 -4
  56. package/dist/domain/shard-manifest.d.cts +1 -1
  57. package/dist/domain/shard-manifest.d.mts +1 -1
  58. package/dist/domain/threshold-subject.cjs +35 -0
  59. package/dist/domain/threshold-subject.d.cts +33 -0
  60. package/dist/domain/threshold-subject.d.mts +33 -0
  61. package/dist/domain/threshold-subject.mjs +32 -0
  62. package/dist/domain/tokens.cjs +2 -1
  63. package/dist/domain/tokens.d.cts +2 -2
  64. package/dist/domain/tokens.d.mts +2 -2
  65. package/dist/domain/tokens.mjs +2 -2
  66. package/dist/domain/webrtc-signaling.cjs +1 -1
  67. package/dist/domain/webrtc-signaling.d.cts +2 -2
  68. package/dist/domain/webrtc-signaling.d.mts +2 -2
  69. package/dist/domain/webrtc-signaling.mjs +1 -1
  70. package/dist/generated/protocol.cjs +83 -0
  71. package/dist/generated/protocol.d.cts +2 -2
  72. package/dist/generated/protocol.d.mts +2 -2
  73. package/dist/generated/protocol.mjs +73 -1
  74. package/dist/{identity-DHf0J6IA.d.cts → identity-9TmmK7vP.d.mts} +1 -1
  75. package/dist/{identity-Oelt3uEn.d.mts → identity-CUkDHCRK.d.cts} +1 -1
  76. package/dist/ports/identity.d.cts +1 -1
  77. package/dist/ports/identity.d.mts +1 -1
  78. package/dist/ports/transport.d.cts +1 -1
  79. package/dist/ports/transport.d.mts +1 -1
  80. package/dist/{protocol-D8CU6s2_.d.cts → protocol-CNFRVx9w.d.cts} +277 -1
  81. package/dist/{protocol-D8CU6s2_.d.mts → protocol-CNFRVx9w.d.mts} +277 -1
  82. package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
  83. package/dist/{room-token-verification-BQhqt1Rm.d.mts → room-token-verification-BdtM1rQ4.d.mts} +2 -2
  84. package/dist/{room-token-verification-DQGdYNg4.d.cts → room-token-verification-DpOfZOdl.d.cts} +2 -2
  85. package/dist/{tokens-CdQwzCyJ.mjs → tokens-B0dpTLhS.mjs} +2 -2
  86. package/dist/{tokens-Bh82oidM.d.mts → tokens-CVyPoJ6l.d.mts} +5 -3
  87. package/dist/{tokens-B1-MAIST.d.cts → tokens-Cl8sQo7o.d.cts} +5 -3
  88. package/dist/{tokens-DxGVURpB.cjs → tokens-Dh6mG6p_.cjs} +7 -1
  89. package/dist/{transport-BNeF6kDe.d.mts → transport-C7KVkhgb.d.mts} +1 -1
  90. package/dist/{transport-BbSGNRFZ.d.cts → transport-De0zHlaA.d.cts} +1 -1
  91. package/package.json +15 -2
@@ -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 };
@@ -1,4 +1,4 @@
1
- import { r as Transport } from "../transport-BbSGNRFZ.cjs";
1
+ import { r as Transport } from "../transport-De0zHlaA.cjs";
2
2
  //#region src/adapters/tls-transport.d.ts
3
3
  export interface TlsIdentity {
4
4
  certificatePem: string;
@@ -1,4 +1,4 @@
1
- import { r as Transport } from "../transport-BNeF6kDe.mjs";
1
+ import { r as Transport } from "../transport-C7KVkhgb.mjs";
2
2
  //#region src/adapters/tls-transport.d.ts
3
3
  export interface TlsIdentity {
4
4
  certificatePem: string;
@@ -1,6 +1,6 @@
1
- import { D as DeviceId, N as Frame, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-D8CU6s2_.cjs";
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-BbSGNRFZ.cjs";
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. */
@@ -1,6 +1,6 @@
1
- import { D as DeviceId, N as Frame, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-D8CU6s2_.mjs";
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-BNeF6kDe.mjs";
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. */
@@ -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-DxGVURpB.cjs");
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-D8CU6s2_.cjs";
2
- import { t as IdentityPort } from "../identity-DHf0J6IA.cjs";
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-B1-MAIST.cjs";
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-D8CU6s2_.mjs";
2
- import { t as IdentityPort } from "../identity-Oelt3uEn.mjs";
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-Bh82oidM.mjs";
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 { i as verifyCapabilityToken } from "../tokens-CdQwzCyJ.mjs";
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-DxGVURpB.cjs");
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-D8CU6s2_.cjs";
2
- import { t as IdentityPort } from "../identity-DHf0J6IA.cjs";
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-D8CU6s2_.mjs";
2
- import { t as IdentityPort } from "../identity-Oelt3uEn.mjs";
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-CdQwzCyJ.mjs";
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-D8CU6s2_.cjs";
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-DHf0J6IA.cjs";
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-D8CU6s2_.mjs";
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-Oelt3uEn.mjs";
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-D8CU6s2_.cjs";
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-D8CU6s2_.mjs";
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-D8CU6s2_.cjs";
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-D8CU6s2_.mjs";
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-D8CU6s2_.cjs";
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-D8CU6s2_.mjs";
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-D8CU6s2_.cjs";
2
- import { t as IdentityPort } from "../identity-DHf0J6IA.cjs";
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-BbSGNRFZ.cjs";
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-D8CU6s2_.mjs";
2
- import { t as IdentityPort } from "../identity-Oelt3uEn.mjs";
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-BNeF6kDe.mjs";
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-D8CU6s2_.cjs";
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-DHf0J6IA.cjs";
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-B1-MAIST.cjs";
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-D8CU6s2_.mjs";
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-Oelt3uEn.mjs";
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-Bh82oidM.mjs";
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-D8CU6s2_.cjs";
2
- import { t as Connection } from "../transport-BbSGNRFZ.cjs";
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-D8CU6s2_.mjs";
2
- import { t as Connection } from "../transport-BNeF6kDe.mjs";
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-D8CU6s2_.cjs";
2
- import { t as Connection } from "../transport-BbSGNRFZ.cjs";
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-D8CU6s2_.mjs";
2
- import { t as Connection } from "../transport-BNeF6kDe.mjs";
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-DxGVURpB.cjs");
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-D8CU6s2_.cjs";
2
- import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-B1-MAIST.cjs";
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-D8CU6s2_.mjs";
2
- import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-Bh82oidM.mjs";
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 { a as verifyRevocationEntry } from "../tokens-CdQwzCyJ.mjs";
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-D8CU6s2_.cjs";
2
- import { t as IdentityPort } from "../identity-DHf0J6IA.cjs";
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-B1-MAIST.cjs";
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-D8CU6s2_.mjs";
2
- import { t as IdentityPort } from "../identity-Oelt3uEn.mjs";
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-Bh82oidM.mjs";
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-DxGVURpB.cjs");
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-DQGdYNg4.cjs";
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-BQhqt1Rm.mjs";
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 };
@@ -1,5 +1,5 @@
1
1
  import { deviceIdToHex } from "./device-id.mjs";
2
- import { i as verifyCapabilityToken } from "../tokens-CdQwzCyJ.mjs";
2
+ import { a as verifyCapabilityToken } from "../tokens-B0dpTLhS.mjs";
3
3
  import { parseRoomPath } from "./room-path.mjs";
4
4
  //#region src/domain/room-token-verification.ts
5
5
  /**
@@ -1,8 +1,8 @@
1
- import { Dt as RoomPath, Et as RoomNoticeClaims, Tt as RoomNotice, p as CapabilityToken, q as MessageRef } from "../protocol-D8CU6s2_.cjs";
2
- import { t as IdentityPort } from "../identity-DHf0J6IA.cjs";
1
+ import { Dt as RoomPath, Et as RoomNoticeClaims, Tt as RoomNotice, p as CapabilityToken, q as MessageRef } 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 { a as RevocationCheck } from "../tokens-B1-MAIST.cjs";
5
- import { r as RoomTokenVerdictReason } from "../room-token-verification-DQGdYNg4.cjs";
4
+ import { a as RevocationCheck } from "../tokens-Cl8sQo7o.cjs";
5
+ import { r as RoomTokenVerdictReason } from "../room-token-verification-DpOfZOdl.cjs";
6
6
  //#region src/domain/room.d.ts
7
7
  export type RoomNoticeVerdictReason = "malformed" | "wrong_room" | "bad_signature" | "wrong_poster" | "content_expired" | "key_epoch_mismatch" | RoomTokenVerdictReason;
8
8
  export type RoomNoticeVerdict = {
@@ -1,8 +1,8 @@
1
- import { Dt as RoomPath, Et as RoomNoticeClaims, Tt as RoomNotice, p as CapabilityToken, q as MessageRef } from "../protocol-D8CU6s2_.mjs";
2
- import { t as IdentityPort } from "../identity-Oelt3uEn.mjs";
1
+ import { Dt as RoomPath, Et as RoomNoticeClaims, Tt as RoomNotice, p as CapabilityToken, q as MessageRef } 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 { a as RevocationCheck } from "../tokens-Bh82oidM.mjs";
5
- import { r as RoomTokenVerdictReason } from "../room-token-verification-BQhqt1Rm.mjs";
4
+ import { a as RevocationCheck } from "../tokens-CVyPoJ6l.mjs";
5
+ import { r as RoomTokenVerdictReason } from "../room-token-verification-BdtM1rQ4.mjs";
6
6
  //#region src/domain/room.d.ts
7
7
  export type RoomNoticeVerdictReason = "malformed" | "wrong_room" | "bad_signature" | "wrong_poster" | "content_expired" | "key_epoch_mismatch" | RoomTokenVerdictReason;
8
8
  export type RoomNoticeVerdict = {
@@ -1,4 +1,4 @@
1
- import { D as DeviceId } from "../protocol-D8CU6s2_.cjs";
1
+ import { D as DeviceId } from "../protocol-CNFRVx9w.cjs";
2
2
  import { PresentedShard, ShardConfig } from "./erasure-coding.cjs";
3
3
  //#region src/domain/shard-manifest.d.ts
4
4
  /** The content-type a core/data entry carrying a shard manifest declares. */
@@ -1,4 +1,4 @@
1
- import { D as DeviceId } from "../protocol-D8CU6s2_.mjs";
1
+ import { D as DeviceId } from "../protocol-CNFRVx9w.mjs";
2
2
  import { PresentedShard, ShardConfig } from "./erasure-coding.mjs";
3
3
  //#region src/domain/shard-manifest.d.ts
4
4
  /** The content-type a core/data entry carrying a shard manifest declares. */
@@ -0,0 +1,35 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_tokens = require("../tokens-Dh6mG6p_.cjs");
3
+ //#region src/domain/threshold-subject.ts
4
+ /**
5
+ * `threshold-subject` -- what a signing session actually asks a group to sign, and the single most important design decision in the whole protocol: it carries the FULL decoded content, never a bare hash. A participant that commits to an opaque digest is a blind signer, and the entire security value of T-of-N is that each participant independently reviews and authorises the content -- returning a round-1 commitment IS that act of authorisation. This module builds exactly the bytes a participant signs its round-1 commitment over: the RFC 9052 §4.4 `Sig_structure`, reusing `tokens.ts`'s own `sig1ToBeSigned` rather than a second hand-rolled construction, and NEVER accepting a pre-assembled to-be-signed blob from a coordinator. Mirrors `wire_mesh_threshold::subject` on the Rust side exactly.
6
+ */
7
+ /**
8
+ * The kinds this participant recognises out of the box -- `capability-token`, `revocation-entry`, `handle-record`, and `room-notice` are the self-certifying payload shapes this codebase already defines. A caller extending recognised kinds (e.g. an application-defined one) supplies its own recogniser rather than this module growing a closed list.
9
+ */
10
+ const KNOWN_KINDS = [
11
+ "capability-token",
12
+ "revocation-entry",
13
+ "handle-record",
14
+ "room-notice"
15
+ ];
16
+ /**
17
+ * The verifier obligation `spec/threshold.cddl` states directly: an unrecognised `kind` MUST be refused, never signed blindly. This is the fail-closed default every content policy is checked against BEFORE any kind-specific review runs; a caller's own policy closure only ever gets a chance to run for a kind it (or `KNOWN_KINDS`) actually recognises.
18
+ */
19
+ function refuseUnrecognisedKind(subject, known = KNOWN_KINDS) {
20
+ if (known.includes(subject.kind)) return;
21
+ return {
22
+ authorise: false,
23
+ reason: `unrecognised threshold-subject.kind ${JSON.stringify(subject.kind)} -- refusing to sign`
24
+ };
25
+ }
26
+ /**
27
+ * Reconstructs the exact bytes this participant signs its round-1 commitment (and, transitively, its round-2 share) over -- the Sig_structure built from THIS participant's own decoding of `protected`/`payload`, never a coordinator-supplied to-be-signed blob.
28
+ */
29
+ function toBeSigned(subject) {
30
+ return Uint8Array.from(require_tokens.sig1ToBeSigned(subject.protected, subject.payload));
31
+ }
32
+ //#endregion
33
+ exports.KNOWN_KINDS = KNOWN_KINDS;
34
+ exports.refuseUnrecognisedKind = refuseUnrecognisedKind;
35
+ exports.toBeSigned = toBeSigned;