wire-mesh-core 3.7.2 → 3.9.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 (121) hide show
  1. package/dist/adapters/byte-stream-connection.d.cts +2 -2
  2. package/dist/adapters/byte-stream-connection.d.mts +2 -2
  3. package/dist/adapters/frame-codec.d.cts +1 -1
  4. package/dist/adapters/frame-codec.d.mts +1 -1
  5. package/dist/adapters/node-identity.d.cts +2 -2
  6. package/dist/adapters/node-identity.d.mts +2 -2
  7. package/dist/adapters/tcp-transport.d.cts +1 -1
  8. package/dist/adapters/tcp-transport.d.mts +1 -1
  9. package/dist/adapters/threshold-identity.d.cts +2 -2
  10. package/dist/adapters/threshold-identity.d.mts +2 -2
  11. package/dist/adapters/threshold-wasm.d.cts +1 -1
  12. package/dist/adapters/threshold-wasm.d.mts +1 -1
  13. package/dist/adapters/tls-transport.d.cts +1 -1
  14. package/dist/adapters/tls-transport.d.mts +1 -1
  15. package/dist/domain/advert-extension-policy.d.cts +1 -1
  16. package/dist/domain/advert-extension-policy.d.mts +1 -1
  17. package/dist/domain/bulk.d.cts +2 -2
  18. package/dist/domain/bulk.d.mts +2 -2
  19. package/dist/domain/capability-grant.cjs +4 -4
  20. package/dist/domain/capability-grant.d.cts +3 -3
  21. package/dist/domain/capability-grant.d.mts +3 -3
  22. package/dist/domain/capability-grant.mjs +2 -2
  23. package/dist/domain/capability-request.cjs +66 -6
  24. package/dist/domain/capability-request.d.cts +21 -3
  25. package/dist/domain/capability-request.d.mts +21 -3
  26. package/dist/domain/capability-request.mjs +64 -6
  27. package/dist/domain/coordinator-election.d.cts +1 -1
  28. package/dist/domain/coordinator-election.d.mts +1 -1
  29. package/dist/domain/data-sync.d.cts +2 -2
  30. package/dist/domain/data-sync.d.mts +2 -2
  31. package/dist/domain/device-id.d.cts +1 -1
  32. package/dist/domain/device-id.d.mts +1 -1
  33. package/dist/domain/direct-manage-request.d.cts +2 -2
  34. package/dist/domain/direct-manage-request.d.mts +2 -2
  35. package/dist/domain/gossip-expansion.d.cts +1 -1
  36. package/dist/domain/gossip-expansion.d.mts +1 -1
  37. package/dist/domain/grant-candidates.cjs +2 -2
  38. package/dist/domain/grant-candidates.d.cts +1 -1
  39. package/dist/domain/grant-candidates.d.mts +1 -1
  40. package/dist/domain/grant-candidates.mjs +1 -1
  41. package/dist/domain/handshake.d.cts +1 -1
  42. package/dist/domain/handshake.d.mts +1 -1
  43. package/dist/domain/hub-mailbox.d.cts +1 -1
  44. package/dist/domain/hub-mailbox.d.mts +1 -1
  45. package/dist/domain/mesh-session.cjs +3 -3
  46. package/dist/domain/mesh-session.d.cts +3 -3
  47. package/dist/domain/mesh-session.d.mts +3 -3
  48. package/dist/domain/mesh-session.mjs +2 -2
  49. package/dist/domain/notice-board.d.cts +3 -3
  50. package/dist/domain/notice-board.d.mts +3 -3
  51. package/dist/domain/path-trace.d.cts +1 -1
  52. package/dist/domain/path-trace.d.mts +1 -1
  53. package/dist/domain/peer-advert.cjs +2 -2
  54. package/dist/domain/peer-advert.d.cts +2 -2
  55. package/dist/domain/peer-advert.d.mts +2 -2
  56. package/dist/domain/peer-advert.mjs +1 -1
  57. package/dist/domain/relay-advert.d.cts +1 -1
  58. package/dist/domain/relay-advert.d.mts +1 -1
  59. package/dist/domain/relay-hub.d.cts +2 -2
  60. package/dist/domain/relay-hub.d.mts +2 -2
  61. package/dist/domain/relay-use-gate.d.cts +2 -2
  62. package/dist/domain/relay-use-gate.d.mts +2 -2
  63. package/dist/domain/revocation-view.cjs +2 -2
  64. package/dist/domain/revocation-view.d.cts +2 -2
  65. package/dist/domain/revocation-view.d.mts +2 -2
  66. package/dist/domain/revocation-view.mjs +1 -1
  67. package/dist/domain/room-rekey.d.cts +3 -3
  68. package/dist/domain/room-rekey.d.mts +3 -3
  69. package/dist/domain/room-token-verification.cjs +2 -2
  70. package/dist/domain/room-token-verification.d.cts +1 -1
  71. package/dist/domain/room-token-verification.d.mts +1 -1
  72. package/dist/domain/room-token-verification.mjs +1 -1
  73. package/dist/domain/room.d.cts +4 -4
  74. package/dist/domain/room.d.mts +4 -4
  75. package/dist/domain/shard-manifest.d.cts +1 -1
  76. package/dist/domain/shard-manifest.d.mts +1 -1
  77. package/dist/domain/threshold-subject.cjs +2 -2
  78. package/dist/domain/threshold-subject.mjs +1 -1
  79. package/dist/domain/token-predicates.cjs +184 -0
  80. package/dist/domain/token-predicates.d.cts +2 -0
  81. package/dist/domain/token-predicates.d.mts +2 -0
  82. package/dist/domain/token-predicates.mjs +173 -0
  83. package/dist/{token-scope-CxHXTT3u.cjs → domain/token-scope.cjs} +3 -12
  84. package/dist/domain/token-scope.d.cts +11 -0
  85. package/dist/domain/token-scope.d.mts +11 -0
  86. package/dist/{token-scope-Z4bmci4M.mjs → domain/token-scope.mjs} +1 -1
  87. package/dist/domain/tokens.cjs +466 -7
  88. package/dist/domain/tokens.d.cts +131 -2
  89. package/dist/domain/tokens.d.mts +131 -2
  90. package/dist/domain/tokens.mjs +459 -2
  91. package/dist/domain/topology-snapshot.d.cts +1 -1
  92. package/dist/domain/topology-snapshot.d.mts +1 -1
  93. package/dist/domain/topology.d.cts +1 -1
  94. package/dist/domain/topology.d.mts +1 -1
  95. package/dist/domain/webrtc-signaling.cjs +2 -2
  96. package/dist/domain/webrtc-signaling.d.cts +2 -2
  97. package/dist/domain/webrtc-signaling.d.mts +2 -2
  98. package/dist/domain/webrtc-signaling.mjs +1 -1
  99. package/dist/generated/protocol.cjs +4 -1
  100. package/dist/generated/protocol.d.cts +1 -1
  101. package/dist/generated/protocol.d.mts +1 -1
  102. package/dist/generated/protocol.mjs +4 -1
  103. package/dist/{identity-DVCNuFLG.d.cts → identity-DJbr96J3.d.cts} +1 -1
  104. package/dist/{identity-DcaYgjXT.d.mts → identity-ViYdZrIU.d.mts} +1 -1
  105. package/dist/ports/identity.d.cts +1 -1
  106. package/dist/ports/identity.d.mts +1 -1
  107. package/dist/ports/transport.d.cts +1 -1
  108. package/dist/ports/transport.d.mts +1 -1
  109. package/dist/{protocol-DCDae3z4.d.cts → protocol-BgR1e_NI.d.cts} +3 -0
  110. package/dist/{protocol-DCDae3z4.d.mts → protocol-BgR1e_NI.d.mts} +3 -0
  111. package/dist/{room-token-verification-CkGnFuQc.d.mts → room-token-verification-BpQ6yJtj.d.cts} +2 -2
  112. package/dist/{room-token-verification-PSv4eQ1x.d.cts → room-token-verification-CTQSihUO.d.mts} +2 -2
  113. package/dist/token-predicates-C-aIe1DT.d.cts +72 -0
  114. package/dist/token-predicates-DqvyS7Y8.d.mts +72 -0
  115. package/dist/{transport-DIXjoQKn.d.cts → transport-DP3hdehk.d.cts} +1 -1
  116. package/dist/{transport-B0GywEzG.d.mts → transport-Dv_LTCsF.d.mts} +1 -1
  117. package/package.json +9 -1
  118. package/dist/tokens-CBiSYuzp.d.mts +0 -126
  119. package/dist/tokens-CMdWiRBb.mjs +0 -459
  120. package/dist/tokens-DSG3SDr8.cjs +0 -494
  121. package/dist/tokens-DqFu7iMX.d.cts +0 -126
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_tokens = require("../tokens-DSG3SDr8.cjs");
2
+ const require_domain_tokens = require("./tokens.cjs");
3
3
  //#region src/domain/webrtc-signaling.ts
4
4
  /** The one capability verb gating every core/webrtc message shape: an authority over this node's own signaling as a whole, not three separate resources, mirroring how core/exec's exec:pty gates all of its own inner verbs. webrtc.sfu-track-map is gated by this same verb (see spec/webrtc.cddl's own comment): an SFU able to shape a negotiation can already misreport whose media is on which mid, so a separate capability over the track-map itself would guard nothing a client doesn't already have to trust the SFU for. */
5
5
  const WEBRTC_SIGNAL_VERB = "webrtc:signal";
@@ -86,7 +86,7 @@ function createNegotiationIdAllocator() {
86
86
  /** True when an incoming offer's own token authorizes webrtc:signal against this node's scope: verifyCapabilityToken checks the token's own internal validity and delegation chain; the capability/scope match against what is actually being invoked here is this caller's own responsibility, same as any other domain's request handler. expectedBearer is deliberately not checked: neither a browser client's MeshSession nor an SFU's own connection handling exposes a way to learn a peer's device-id independently of the token itself, unlike a scope with a path that constrains a specific resource. */
87
87
  async function authorizeIncomingOffer(incoming, options) {
88
88
  if (incoming.token === void 0) return false;
89
- const verdict = await require_tokens.verifyCapabilityToken(incoming.token, options);
89
+ const verdict = await require_domain_tokens.verifyCapabilityToken(incoming.token, options);
90
90
  if (!verdict.ok) return false;
91
91
  return verdict.claims.capability === "webrtc:signal" && verdict.claims.scope.kind === WEBRTC_SIGNAL_SCOPE.kind;
92
92
  }
@@ -1,6 +1,6 @@
1
- import { H as ManageCommandParams, Lt as SfuTrackEntry, Rt as SfuTrackMap, V as ManageCommand, an as WebrtcAnswer, f as CapabilityScope, on as WebrtcIceCandidate, sn as WebrtcOffer, z as IceCandidateInit } from "../protocol-DCDae3z4.cjs";
1
+ import { H as ManageCommandParams, Lt as SfuTrackEntry, Rt as SfuTrackMap, V as ManageCommand, an as WebrtcAnswer, f as CapabilityScope, on as WebrtcIceCandidate, sn as WebrtcOffer, z as IceCandidateInit } from "../protocol-BgR1e_NI.cjs";
2
2
  import { IncomingManageRequest } from "./mesh-session.cjs";
3
- import { u as VerifyCapabilityTokenOptions } from "../tokens-DqFu7iMX.cjs";
3
+ import { VerifyCapabilityTokenOptions } from "./tokens.cjs";
4
4
  //#region src/domain/webrtc-signaling.d.ts
5
5
  /** The one capability verb gating every core/webrtc message shape: an authority over this node's own signaling as a whole, not three separate resources, mirroring how core/exec's exec:pty gates all of its own inner verbs. webrtc.sfu-track-map is gated by this same verb (see spec/webrtc.cddl's own comment): an SFU able to shape a negotiation can already misreport whose media is on which mid, so a separate capability over the track-map itself would guard nothing a client doesn't already have to trust the SFU for. */
6
6
  export declare const WEBRTC_SIGNAL_VERB = "webrtc:signal";
@@ -1,6 +1,6 @@
1
- import { H as ManageCommandParams, Lt as SfuTrackEntry, Rt as SfuTrackMap, V as ManageCommand, an as WebrtcAnswer, f as CapabilityScope, on as WebrtcIceCandidate, sn as WebrtcOffer, z as IceCandidateInit } from "../protocol-DCDae3z4.mjs";
1
+ import { H as ManageCommandParams, Lt as SfuTrackEntry, Rt as SfuTrackMap, V as ManageCommand, an as WebrtcAnswer, f as CapabilityScope, on as WebrtcIceCandidate, sn as WebrtcOffer, z as IceCandidateInit } from "../protocol-BgR1e_NI.mjs";
2
2
  import { IncomingManageRequest } from "./mesh-session.mjs";
3
- import { u as VerifyCapabilityTokenOptions } from "../tokens-CBiSYuzp.mjs";
3
+ import { VerifyCapabilityTokenOptions } from "./tokens.mjs";
4
4
  //#region src/domain/webrtc-signaling.d.ts
5
5
  /** The one capability verb gating every core/webrtc message shape: an authority over this node's own signaling as a whole, not three separate resources, mirroring how core/exec's exec:pty gates all of its own inner verbs. webrtc.sfu-track-map is gated by this same verb (see spec/webrtc.cddl's own comment): an SFU able to shape a negotiation can already misreport whose media is on which mid, so a separate capability over the track-map itself would guard nothing a client doesn't already have to trust the SFU for. */
6
6
  export declare const WEBRTC_SIGNAL_VERB = "webrtc:signal";
@@ -1,4 +1,4 @@
1
- import { a as verifyCapabilityToken } from "../tokens-CMdWiRBb.mjs";
1
+ import { verifyCapabilityToken } from "./tokens.mjs";
2
2
  //#region src/domain/webrtc-signaling.ts
3
3
  /** The one capability verb gating every core/webrtc message shape: an authority over this node's own signaling as a whole, not three separate resources, mirroring how core/exec's exec:pty gates all of its own inner verbs. webrtc.sfu-track-map is gated by this same verb (see spec/webrtc.cddl's own comment): an SFU able to shape a negotiation can already misreport whose media is on which mid, so a separate capability over the track-map itself would guard nothing a client doesn't already have to trust the SFU for. */
4
4
  const WEBRTC_SIGNAL_VERB = "webrtc:signal";
@@ -469,9 +469,12 @@ const tokenClaimsSchema = zod.z.lazy(() => zod.z.object({
469
469
  "expires": zod.z.number().int().nonnegative(),
470
470
  "not-before": zod.z.number().int().nonnegative().optional(),
471
471
  "parent": zod.z.instanceof(Uint8Array).optional(),
472
+ "authorised-by": zod.z.instanceof(Uint8Array).optional(),
472
473
  "delegations-remaining": zod.z.number().int().nonnegative().optional(),
473
474
  "valid-until": zod.z.number().int().nonnegative().optional(),
474
- "conditions": zod.z.instanceof(Uint8Array).optional()
475
+ "conditions": zod.z.instanceof(Uint8Array).optional(),
476
+ "grants-capability": zod.z.lazy(() => capabilityVerbSchema).optional(),
477
+ "requests-capability": zod.z.lazy(() => capabilityVerbSchema).optional()
475
478
  }).catchall(zod.z.unknown()));
476
479
  const pingFrameSchema = zod.z.lazy(() => zod.z.object({ "type": zod.z.literal("ping") }));
477
480
  const pongFrameSchema = zod.z.lazy(() => zod.z.object({ "type": zod.z.literal("pong") }));
@@ -1,2 +1,2 @@
1
- import { $ as PathTraceOk, $n as manageRequestFrameSchema, $r as thresholdCommitSchema, $t as ThresholdSubject, A as DomainId, An as coseSign1Schema, Ar as roomJoinOkSchema, At as RoomPath, B as IdentityKey, Bn as execSessionInfoSchema, Br as roomRekeySchema, Bt as StreamDataFrame, C as CoseTokenHeaders, Cn as closeFrameSchema, Cr as relayDataFrameSchema, Ct as RoomJoinOk, D as DeviceId, Dn as coseHeaderAlgSchema, Dr as revocationClaimsSchema, Dt as RoomMembersOk, E as DataRequestFrame, En as coreDomainNameSchema, Er as revocationAnnounceFrameSchema, Et as RoomMembers, F as GossipFrame, Fn as deviceIdHexSchema, Fr as roomMembersSchema, Ft as SecureHelloFrame, G as ManageRequestFrame, Gn as handleRecordSchema, Gr as sfuTrackEntrySchema, Gt as ThresholdCommit, H as ManageCommandParams, Hn as frameVariantSchema, Hr as secureDataFrameSchema, Ht as StreamSession, I as HandleClaims, In as deviceIdSchema, Ir as roomNoticeClaimsSchema, It as SessionId, J as NamespacedCapability, Jn as identityKeySchema, Jr as streamDataFrameSchema, Jt as ThresholdKeygenRound1, K as ManageResponseFrame, Kn as handshakeFrameSchema, Kr as sfuTrackMapSchema, Kt as ThresholdCommitment, L as HandleRecord, Ln as dmRoomPathSchema, Lr as roomNoticeSchema, Lt as SfuTrackEntry, M as ExecSessionInfo, Mn as dataEntriesFrameSchema, Mr as roomLeaveSchema, Mt as RoomRekey, N as Frame, Nn as dataHaveFrameSchema, Nr as roomMemberSchema, Nt as RoomSend, O as DeviceIdHex, On as coseHeaderKidSchema, Or as revocationEntrySchema, Ot as RoomNotice, P as FrameVariant, Pn as dataRequestFrameSchema, Pr as roomMembersOkSchema, Pt as SecureDataFrame, Q as PathTrace, Qn as manageOkSchema, Qr as thresholdAbortSchema, Qt as ThresholdSign, R as HandshakeFrame, Rn as domainIdSchema, Rr as roomPathSchema, Rt as SfuTrackMap, S as CoseSign1, Sn as capabilityVerbSchema, Sr as relayConnectFrameSchema, St as RoomJoin, T as DataHaveFrame, Tn as coreCapabilitySchema, Tr as relayOfferFrameSchema, Tt as RoomMember, U as ManageError, Un as gossipFrameSchema, Ur as secureHelloFrameSchema, Ut as SyncPunchFrame, V as ManageCommand, Vn as frameSchema, Vr as roomSendSchema, Vt as StreamEndFrame, W as ManageOk, Wn as handleClaimsSchema, Wr as sessionIdSchema, Wt as ThresholdAbort, X as ObservedAddressFrame, Xn as manageCommandSchema, Xr as streamSessionSchema, Xt as ThresholdShareClaims, Y as NamespacedDomainId, Yn as manageCommandParamsSchema, Yr as streamEndFrameSchema, Yt as ThresholdKeygenRound2, Z as OwnerNamedRoomPath, Zn as manageErrorSchema, Zr as syncPunchFrameSchema, Zt as ThresholdShareEnvelope, _ as CoreCapability, _n as capabilityGrantOkSchema, _r as protocolVersionSchema, _t as RelayOfferFrame, a as BulkOpen, ai as thresholdShareEnvelopeSchema, an as WebrtcAnswer, ar as ownerNamedRoomPathSchema, at as PrivateUseDomainId, b as CoseHeaderKid, bn as capabilityScopeSchema, br as ptySpawnSchema, bt as RevocationEntry, c as CandidatesFrame, ci as tokenClaimsSchema, cn as WireCandidate, cr as peerAdvertSchema, ct as ProcSpawn, d as CapabilityRequest, di as transferIdSchema, dn as bulkDataFrameSchema, dr as pongFrameSchema, dt as PtyResize, ei as thresholdCommitmentSchema, en as TokenClaims, er as manageResponseFrameSchema, et as PeerAdvert, f as CapabilityScope, fi as versionGetSchema, fn as bulkEndFrameSchema, fr as privateUseCapabilitySchema, ft as PtySpawn, g as CoordinatorFrame, gi as wireCandidateSchema, gn as candidatesFrameSchema, gr as procSpawnSchema, gt as RelayInboundFrame, h as CloseFrame, hi as webrtcOfferSchema, hn as candidateKindSchema, hr as procSignalSchema, ht as RelayDataFrame, i as BulkEndFrame, ii as thresholdShareClaimsSchema, in as VersionGet, ir as observedAddressFrameSchema, it as PrivateUseCapability, j as ExecList, jn as coseTokenHeadersSchema, jr as roomJoinSchema, jt as RoomRead, k as DmRoomPath, kn as coseHeaderLabelSchema, kr as roomInviteSchema, kt as RoomNoticeClaims, l as CapabilityGrant, li as topologyGetSchema, ln as bulkAckFrameSchema, lr as peerIdentitySchema, lt as ProtocolVersion, m as CapabilityVerb, mi as webrtcIceCandidateSchema, mn as bulkResumeSchema, mr as procKillSchema, mt as RelayConnectFrame, n as BulkCancel, ni as thresholdKeygenRound1Schema, nn as TopologyPeers, nr as namespacedCapabilitySchema, nt as PingFrame, o as BulkResume, oi as thresholdSignSchema, on as WebrtcIceCandidate, or as pathTraceOkSchema, ot as ProcKill, p as CapabilityToken, pi as webrtcAnswerSchema, pn as bulkOpenSchema, pr as privateUseDomainIdSchema, pt as PtyWrite, q as MessageRef, qn as iceCandidateInitSchema, qr as streamAckFrameSchema, qt as ThresholdKeygenConfirm, r as BulkDataFrame, ri as thresholdKeygenRound2Schema, rn as TransferId, rr as namespacedDomainIdSchema, rt as PongFrame, s as CandidateKind, si as thresholdSubjectSchema, sn as WebrtcOffer, sr as pathTraceSchema, st as ProcSignal, t as BulkAckFrame, ti as thresholdKeygenConfirmSchema, tn as TopologyGet, tr as messageRefSchema, tt as PeerIdentity, u as CapabilityGrantOk, ui as topologyPeersSchema, un as bulkCancelSchema, ur as pingFrameSchema, ut as PtyKill, v as CoreDomainName, vn as capabilityGrantSchema, vr as ptyKillSchema, vt as RevocationAnnounceFrame, w as DataEntriesFrame, wn as coordinatorFrameSchema, wr as relayInboundFrameSchema, wt as RoomLeave, x as CoseHeaderLabel, xn as capabilityTokenSchema, xr as ptyWriteSchema, xt as RoomInvite, y as CoseHeaderAlg, yn as capabilityRequestSchema, yr as ptyResizeSchema, yt as RevocationClaims, z as IceCandidateInit, zn as execListSchema, zr as roomReadSchema, zt as StreamAckFrame } from "../protocol-DCDae3z4.cjs";
1
+ import { $ as PathTraceOk, $n as manageRequestFrameSchema, $r as thresholdCommitSchema, $t as ThresholdSubject, A as DomainId, An as coseSign1Schema, Ar as roomJoinOkSchema, At as RoomPath, B as IdentityKey, Bn as execSessionInfoSchema, Br as roomRekeySchema, Bt as StreamDataFrame, C as CoseTokenHeaders, Cn as closeFrameSchema, Cr as relayDataFrameSchema, Ct as RoomJoinOk, D as DeviceId, Dn as coseHeaderAlgSchema, Dr as revocationClaimsSchema, Dt as RoomMembersOk, E as DataRequestFrame, En as coreDomainNameSchema, Er as revocationAnnounceFrameSchema, Et as RoomMembers, F as GossipFrame, Fn as deviceIdHexSchema, Fr as roomMembersSchema, Ft as SecureHelloFrame, G as ManageRequestFrame, Gn as handleRecordSchema, Gr as sfuTrackEntrySchema, Gt as ThresholdCommit, H as ManageCommandParams, Hn as frameVariantSchema, Hr as secureDataFrameSchema, Ht as StreamSession, I as HandleClaims, In as deviceIdSchema, Ir as roomNoticeClaimsSchema, It as SessionId, J as NamespacedCapability, Jn as identityKeySchema, Jr as streamDataFrameSchema, Jt as ThresholdKeygenRound1, K as ManageResponseFrame, Kn as handshakeFrameSchema, Kr as sfuTrackMapSchema, Kt as ThresholdCommitment, L as HandleRecord, Ln as dmRoomPathSchema, Lr as roomNoticeSchema, Lt as SfuTrackEntry, M as ExecSessionInfo, Mn as dataEntriesFrameSchema, Mr as roomLeaveSchema, Mt as RoomRekey, N as Frame, Nn as dataHaveFrameSchema, Nr as roomMemberSchema, Nt as RoomSend, O as DeviceIdHex, On as coseHeaderKidSchema, Or as revocationEntrySchema, Ot as RoomNotice, P as FrameVariant, Pn as dataRequestFrameSchema, Pr as roomMembersOkSchema, Pt as SecureDataFrame, Q as PathTrace, Qn as manageOkSchema, Qr as thresholdAbortSchema, Qt as ThresholdSign, R as HandshakeFrame, Rn as domainIdSchema, Rr as roomPathSchema, Rt as SfuTrackMap, S as CoseSign1, Sn as capabilityVerbSchema, Sr as relayConnectFrameSchema, St as RoomJoin, T as DataHaveFrame, Tn as coreCapabilitySchema, Tr as relayOfferFrameSchema, Tt as RoomMember, U as ManageError, Un as gossipFrameSchema, Ur as secureHelloFrameSchema, Ut as SyncPunchFrame, V as ManageCommand, Vn as frameSchema, Vr as roomSendSchema, Vt as StreamEndFrame, W as ManageOk, Wn as handleClaimsSchema, Wr as sessionIdSchema, Wt as ThresholdAbort, X as ObservedAddressFrame, Xn as manageCommandSchema, Xr as streamSessionSchema, Xt as ThresholdShareClaims, Y as NamespacedDomainId, Yn as manageCommandParamsSchema, Yr as streamEndFrameSchema, Yt as ThresholdKeygenRound2, Z as OwnerNamedRoomPath, Zn as manageErrorSchema, Zr as syncPunchFrameSchema, Zt as ThresholdShareEnvelope, _ as CoreCapability, _n as capabilityGrantOkSchema, _r as protocolVersionSchema, _t as RelayOfferFrame, a as BulkOpen, ai as thresholdShareEnvelopeSchema, an as WebrtcAnswer, ar as ownerNamedRoomPathSchema, at as PrivateUseDomainId, b as CoseHeaderKid, bn as capabilityScopeSchema, br as ptySpawnSchema, bt as RevocationEntry, c as CandidatesFrame, ci as tokenClaimsSchema, cn as WireCandidate, cr as peerAdvertSchema, ct as ProcSpawn, d as CapabilityRequest, di as transferIdSchema, dn as bulkDataFrameSchema, dr as pongFrameSchema, dt as PtyResize, ei as thresholdCommitmentSchema, en as TokenClaims, er as manageResponseFrameSchema, et as PeerAdvert, f as CapabilityScope, fi as versionGetSchema, fn as bulkEndFrameSchema, fr as privateUseCapabilitySchema, ft as PtySpawn, g as CoordinatorFrame, gi as wireCandidateSchema, gn as candidatesFrameSchema, gr as procSpawnSchema, gt as RelayInboundFrame, h as CloseFrame, hi as webrtcOfferSchema, hn as candidateKindSchema, hr as procSignalSchema, ht as RelayDataFrame, i as BulkEndFrame, ii as thresholdShareClaimsSchema, in as VersionGet, ir as observedAddressFrameSchema, it as PrivateUseCapability, j as ExecList, jn as coseTokenHeadersSchema, jr as roomJoinSchema, jt as RoomRead, k as DmRoomPath, kn as coseHeaderLabelSchema, kr as roomInviteSchema, kt as RoomNoticeClaims, l as CapabilityGrant, li as topologyGetSchema, ln as bulkAckFrameSchema, lr as peerIdentitySchema, lt as ProtocolVersion, m as CapabilityVerb, mi as webrtcIceCandidateSchema, mn as bulkResumeSchema, mr as procKillSchema, mt as RelayConnectFrame, n as BulkCancel, ni as thresholdKeygenRound1Schema, nn as TopologyPeers, nr as namespacedCapabilitySchema, nt as PingFrame, o as BulkResume, oi as thresholdSignSchema, on as WebrtcIceCandidate, or as pathTraceOkSchema, ot as ProcKill, p as CapabilityToken, pi as webrtcAnswerSchema, pn as bulkOpenSchema, pr as privateUseDomainIdSchema, pt as PtyWrite, q as MessageRef, qn as iceCandidateInitSchema, qr as streamAckFrameSchema, qt as ThresholdKeygenConfirm, r as BulkDataFrame, ri as thresholdKeygenRound2Schema, rn as TransferId, rr as namespacedDomainIdSchema, rt as PongFrame, s as CandidateKind, si as thresholdSubjectSchema, sn as WebrtcOffer, sr as pathTraceSchema, st as ProcSignal, t as BulkAckFrame, ti as thresholdKeygenConfirmSchema, tn as TopologyGet, tr as messageRefSchema, tt as PeerIdentity, u as CapabilityGrantOk, ui as topologyPeersSchema, un as bulkCancelSchema, ur as pingFrameSchema, ut as PtyKill, v as CoreDomainName, vn as capabilityGrantSchema, vr as ptyKillSchema, vt as RevocationAnnounceFrame, w as DataEntriesFrame, wn as coordinatorFrameSchema, wr as relayInboundFrameSchema, wt as RoomLeave, x as CoseHeaderLabel, xn as capabilityTokenSchema, xr as ptyWriteSchema, xt as RoomInvite, y as CoseHeaderAlg, yn as capabilityRequestSchema, yr as ptyResizeSchema, yt as RevocationClaims, z as IceCandidateInit, zn as execListSchema, zr as roomReadSchema, zt as StreamAckFrame } from "../protocol-BgR1e_NI.cjs";
2
2
  export { BulkAckFrame, BulkCancel, BulkDataFrame, BulkEndFrame, BulkOpen, BulkResume, CandidateKind, CandidatesFrame, CapabilityGrant, CapabilityGrantOk, CapabilityRequest, CapabilityScope, CapabilityToken, CapabilityVerb, CloseFrame, CoordinatorFrame, CoreCapability, CoreDomainName, CoseHeaderAlg, CoseHeaderKid, CoseHeaderLabel, CoseSign1, CoseTokenHeaders, DataEntriesFrame, DataHaveFrame, DataRequestFrame, DeviceId, DeviceIdHex, DmRoomPath, DomainId, ExecList, ExecSessionInfo, Frame, FrameVariant, GossipFrame, HandleClaims, HandleRecord, HandshakeFrame, IceCandidateInit, IdentityKey, ManageCommand, ManageCommandParams, ManageError, ManageOk, ManageRequestFrame, ManageResponseFrame, MessageRef, NamespacedCapability, NamespacedDomainId, ObservedAddressFrame, OwnerNamedRoomPath, PathTrace, PathTraceOk, PeerAdvert, PeerIdentity, PingFrame, PongFrame, PrivateUseCapability, PrivateUseDomainId, ProcKill, ProcSignal, ProcSpawn, ProtocolVersion, PtyKill, PtyResize, PtySpawn, PtyWrite, RelayConnectFrame, RelayDataFrame, RelayInboundFrame, RelayOfferFrame, RevocationAnnounceFrame, RevocationClaims, RevocationEntry, RoomInvite, RoomJoin, RoomJoinOk, RoomLeave, RoomMember, RoomMembers, RoomMembersOk, RoomNotice, RoomNoticeClaims, RoomPath, RoomRead, RoomRekey, RoomSend, SecureDataFrame, SecureHelloFrame, SessionId, SfuTrackEntry, SfuTrackMap, StreamAckFrame, StreamDataFrame, StreamEndFrame, StreamSession, SyncPunchFrame, ThresholdAbort, ThresholdCommit, ThresholdCommitment, ThresholdKeygenConfirm, ThresholdKeygenRound1, ThresholdKeygenRound2, ThresholdShareClaims, ThresholdShareEnvelope, ThresholdSign, ThresholdSubject, TokenClaims, TopologyGet, TopologyPeers, TransferId, VersionGet, WebrtcAnswer, WebrtcIceCandidate, WebrtcOffer, WireCandidate, bulkAckFrameSchema, bulkCancelSchema, bulkDataFrameSchema, bulkEndFrameSchema, bulkOpenSchema, bulkResumeSchema, candidateKindSchema, candidatesFrameSchema, capabilityGrantOkSchema, capabilityGrantSchema, capabilityRequestSchema, capabilityScopeSchema, capabilityTokenSchema, capabilityVerbSchema, closeFrameSchema, coordinatorFrameSchema, coreCapabilitySchema, coreDomainNameSchema, coseHeaderAlgSchema, coseHeaderKidSchema, coseHeaderLabelSchema, coseSign1Schema, coseTokenHeadersSchema, dataEntriesFrameSchema, dataHaveFrameSchema, dataRequestFrameSchema, deviceIdHexSchema, deviceIdSchema, dmRoomPathSchema, domainIdSchema, execListSchema, execSessionInfoSchema, frameSchema, frameVariantSchema, gossipFrameSchema, handleClaimsSchema, handleRecordSchema, handshakeFrameSchema, iceCandidateInitSchema, identityKeySchema, manageCommandParamsSchema, manageCommandSchema, manageErrorSchema, manageOkSchema, manageRequestFrameSchema, manageResponseFrameSchema, messageRefSchema, namespacedCapabilitySchema, namespacedDomainIdSchema, observedAddressFrameSchema, ownerNamedRoomPathSchema, pathTraceOkSchema, pathTraceSchema, peerAdvertSchema, peerIdentitySchema, pingFrameSchema, pongFrameSchema, privateUseCapabilitySchema, privateUseDomainIdSchema, procKillSchema, procSignalSchema, procSpawnSchema, protocolVersionSchema, ptyKillSchema, ptyResizeSchema, ptySpawnSchema, ptyWriteSchema, relayConnectFrameSchema, relayDataFrameSchema, relayInboundFrameSchema, relayOfferFrameSchema, revocationAnnounceFrameSchema, revocationClaimsSchema, revocationEntrySchema, roomInviteSchema, roomJoinOkSchema, roomJoinSchema, roomLeaveSchema, roomMemberSchema, roomMembersOkSchema, roomMembersSchema, roomNoticeClaimsSchema, roomNoticeSchema, roomPathSchema, roomReadSchema, roomRekeySchema, roomSendSchema, secureDataFrameSchema, secureHelloFrameSchema, sessionIdSchema, sfuTrackEntrySchema, sfuTrackMapSchema, streamAckFrameSchema, streamDataFrameSchema, streamEndFrameSchema, streamSessionSchema, syncPunchFrameSchema, thresholdAbortSchema, thresholdCommitSchema, thresholdCommitmentSchema, thresholdKeygenConfirmSchema, thresholdKeygenRound1Schema, thresholdKeygenRound2Schema, thresholdShareClaimsSchema, thresholdShareEnvelopeSchema, thresholdSignSchema, thresholdSubjectSchema, tokenClaimsSchema, topologyGetSchema, topologyPeersSchema, transferIdSchema, versionGetSchema, webrtcAnswerSchema, webrtcIceCandidateSchema, webrtcOfferSchema, wireCandidateSchema };
@@ -1,2 +1,2 @@
1
- import { $ as PathTraceOk, $n as manageRequestFrameSchema, $r as thresholdCommitSchema, $t as ThresholdSubject, A as DomainId, An as coseSign1Schema, Ar as roomJoinOkSchema, At as RoomPath, B as IdentityKey, Bn as execSessionInfoSchema, Br as roomRekeySchema, Bt as StreamDataFrame, C as CoseTokenHeaders, Cn as closeFrameSchema, Cr as relayDataFrameSchema, Ct as RoomJoinOk, D as DeviceId, Dn as coseHeaderAlgSchema, Dr as revocationClaimsSchema, Dt as RoomMembersOk, E as DataRequestFrame, En as coreDomainNameSchema, Er as revocationAnnounceFrameSchema, Et as RoomMembers, F as GossipFrame, Fn as deviceIdHexSchema, Fr as roomMembersSchema, Ft as SecureHelloFrame, G as ManageRequestFrame, Gn as handleRecordSchema, Gr as sfuTrackEntrySchema, Gt as ThresholdCommit, H as ManageCommandParams, Hn as frameVariantSchema, Hr as secureDataFrameSchema, Ht as StreamSession, I as HandleClaims, In as deviceIdSchema, Ir as roomNoticeClaimsSchema, It as SessionId, J as NamespacedCapability, Jn as identityKeySchema, Jr as streamDataFrameSchema, Jt as ThresholdKeygenRound1, K as ManageResponseFrame, Kn as handshakeFrameSchema, Kr as sfuTrackMapSchema, Kt as ThresholdCommitment, L as HandleRecord, Ln as dmRoomPathSchema, Lr as roomNoticeSchema, Lt as SfuTrackEntry, M as ExecSessionInfo, Mn as dataEntriesFrameSchema, Mr as roomLeaveSchema, Mt as RoomRekey, N as Frame, Nn as dataHaveFrameSchema, Nr as roomMemberSchema, Nt as RoomSend, O as DeviceIdHex, On as coseHeaderKidSchema, Or as revocationEntrySchema, Ot as RoomNotice, P as FrameVariant, Pn as dataRequestFrameSchema, Pr as roomMembersOkSchema, Pt as SecureDataFrame, Q as PathTrace, Qn as manageOkSchema, Qr as thresholdAbortSchema, Qt as ThresholdSign, R as HandshakeFrame, Rn as domainIdSchema, Rr as roomPathSchema, Rt as SfuTrackMap, S as CoseSign1, Sn as capabilityVerbSchema, Sr as relayConnectFrameSchema, St as RoomJoin, T as DataHaveFrame, Tn as coreCapabilitySchema, Tr as relayOfferFrameSchema, Tt as RoomMember, U as ManageError, Un as gossipFrameSchema, Ur as secureHelloFrameSchema, Ut as SyncPunchFrame, V as ManageCommand, Vn as frameSchema, Vr as roomSendSchema, Vt as StreamEndFrame, W as ManageOk, Wn as handleClaimsSchema, Wr as sessionIdSchema, Wt as ThresholdAbort, X as ObservedAddressFrame, Xn as manageCommandSchema, Xr as streamSessionSchema, Xt as ThresholdShareClaims, Y as NamespacedDomainId, Yn as manageCommandParamsSchema, Yr as streamEndFrameSchema, Yt as ThresholdKeygenRound2, Z as OwnerNamedRoomPath, Zn as manageErrorSchema, Zr as syncPunchFrameSchema, Zt as ThresholdShareEnvelope, _ as CoreCapability, _n as capabilityGrantOkSchema, _r as protocolVersionSchema, _t as RelayOfferFrame, a as BulkOpen, ai as thresholdShareEnvelopeSchema, an as WebrtcAnswer, ar as ownerNamedRoomPathSchema, at as PrivateUseDomainId, b as CoseHeaderKid, bn as capabilityScopeSchema, br as ptySpawnSchema, bt as RevocationEntry, c as CandidatesFrame, ci as tokenClaimsSchema, cn as WireCandidate, cr as peerAdvertSchema, ct as ProcSpawn, d as CapabilityRequest, di as transferIdSchema, dn as bulkDataFrameSchema, dr as pongFrameSchema, dt as PtyResize, ei as thresholdCommitmentSchema, en as TokenClaims, er as manageResponseFrameSchema, et as PeerAdvert, f as CapabilityScope, fi as versionGetSchema, fn as bulkEndFrameSchema, fr as privateUseCapabilitySchema, ft as PtySpawn, g as CoordinatorFrame, gi as wireCandidateSchema, gn as candidatesFrameSchema, gr as procSpawnSchema, gt as RelayInboundFrame, h as CloseFrame, hi as webrtcOfferSchema, hn as candidateKindSchema, hr as procSignalSchema, ht as RelayDataFrame, i as BulkEndFrame, ii as thresholdShareClaimsSchema, in as VersionGet, ir as observedAddressFrameSchema, it as PrivateUseCapability, j as ExecList, jn as coseTokenHeadersSchema, jr as roomJoinSchema, jt as RoomRead, k as DmRoomPath, kn as coseHeaderLabelSchema, kr as roomInviteSchema, kt as RoomNoticeClaims, l as CapabilityGrant, li as topologyGetSchema, ln as bulkAckFrameSchema, lr as peerIdentitySchema, lt as ProtocolVersion, m as CapabilityVerb, mi as webrtcIceCandidateSchema, mn as bulkResumeSchema, mr as procKillSchema, mt as RelayConnectFrame, n as BulkCancel, ni as thresholdKeygenRound1Schema, nn as TopologyPeers, nr as namespacedCapabilitySchema, nt as PingFrame, o as BulkResume, oi as thresholdSignSchema, on as WebrtcIceCandidate, or as pathTraceOkSchema, ot as ProcKill, p as CapabilityToken, pi as webrtcAnswerSchema, pn as bulkOpenSchema, pr as privateUseDomainIdSchema, pt as PtyWrite, q as MessageRef, qn as iceCandidateInitSchema, qr as streamAckFrameSchema, qt as ThresholdKeygenConfirm, r as BulkDataFrame, ri as thresholdKeygenRound2Schema, rn as TransferId, rr as namespacedDomainIdSchema, rt as PongFrame, s as CandidateKind, si as thresholdSubjectSchema, sn as WebrtcOffer, sr as pathTraceSchema, st as ProcSignal, t as BulkAckFrame, ti as thresholdKeygenConfirmSchema, tn as TopologyGet, tr as messageRefSchema, tt as PeerIdentity, u as CapabilityGrantOk, ui as topologyPeersSchema, un as bulkCancelSchema, ur as pingFrameSchema, ut as PtyKill, v as CoreDomainName, vn as capabilityGrantSchema, vr as ptyKillSchema, vt as RevocationAnnounceFrame, w as DataEntriesFrame, wn as coordinatorFrameSchema, wr as relayInboundFrameSchema, wt as RoomLeave, x as CoseHeaderLabel, xn as capabilityTokenSchema, xr as ptyWriteSchema, xt as RoomInvite, y as CoseHeaderAlg, yn as capabilityRequestSchema, yr as ptyResizeSchema, yt as RevocationClaims, z as IceCandidateInit, zn as execListSchema, zr as roomReadSchema, zt as StreamAckFrame } from "../protocol-DCDae3z4.mjs";
1
+ import { $ as PathTraceOk, $n as manageRequestFrameSchema, $r as thresholdCommitSchema, $t as ThresholdSubject, A as DomainId, An as coseSign1Schema, Ar as roomJoinOkSchema, At as RoomPath, B as IdentityKey, Bn as execSessionInfoSchema, Br as roomRekeySchema, Bt as StreamDataFrame, C as CoseTokenHeaders, Cn as closeFrameSchema, Cr as relayDataFrameSchema, Ct as RoomJoinOk, D as DeviceId, Dn as coseHeaderAlgSchema, Dr as revocationClaimsSchema, Dt as RoomMembersOk, E as DataRequestFrame, En as coreDomainNameSchema, Er as revocationAnnounceFrameSchema, Et as RoomMembers, F as GossipFrame, Fn as deviceIdHexSchema, Fr as roomMembersSchema, Ft as SecureHelloFrame, G as ManageRequestFrame, Gn as handleRecordSchema, Gr as sfuTrackEntrySchema, Gt as ThresholdCommit, H as ManageCommandParams, Hn as frameVariantSchema, Hr as secureDataFrameSchema, Ht as StreamSession, I as HandleClaims, In as deviceIdSchema, Ir as roomNoticeClaimsSchema, It as SessionId, J as NamespacedCapability, Jn as identityKeySchema, Jr as streamDataFrameSchema, Jt as ThresholdKeygenRound1, K as ManageResponseFrame, Kn as handshakeFrameSchema, Kr as sfuTrackMapSchema, Kt as ThresholdCommitment, L as HandleRecord, Ln as dmRoomPathSchema, Lr as roomNoticeSchema, Lt as SfuTrackEntry, M as ExecSessionInfo, Mn as dataEntriesFrameSchema, Mr as roomLeaveSchema, Mt as RoomRekey, N as Frame, Nn as dataHaveFrameSchema, Nr as roomMemberSchema, Nt as RoomSend, O as DeviceIdHex, On as coseHeaderKidSchema, Or as revocationEntrySchema, Ot as RoomNotice, P as FrameVariant, Pn as dataRequestFrameSchema, Pr as roomMembersOkSchema, Pt as SecureDataFrame, Q as PathTrace, Qn as manageOkSchema, Qr as thresholdAbortSchema, Qt as ThresholdSign, R as HandshakeFrame, Rn as domainIdSchema, Rr as roomPathSchema, Rt as SfuTrackMap, S as CoseSign1, Sn as capabilityVerbSchema, Sr as relayConnectFrameSchema, St as RoomJoin, T as DataHaveFrame, Tn as coreCapabilitySchema, Tr as relayOfferFrameSchema, Tt as RoomMember, U as ManageError, Un as gossipFrameSchema, Ur as secureHelloFrameSchema, Ut as SyncPunchFrame, V as ManageCommand, Vn as frameSchema, Vr as roomSendSchema, Vt as StreamEndFrame, W as ManageOk, Wn as handleClaimsSchema, Wr as sessionIdSchema, Wt as ThresholdAbort, X as ObservedAddressFrame, Xn as manageCommandSchema, Xr as streamSessionSchema, Xt as ThresholdShareClaims, Y as NamespacedDomainId, Yn as manageCommandParamsSchema, Yr as streamEndFrameSchema, Yt as ThresholdKeygenRound2, Z as OwnerNamedRoomPath, Zn as manageErrorSchema, Zr as syncPunchFrameSchema, Zt as ThresholdShareEnvelope, _ as CoreCapability, _n as capabilityGrantOkSchema, _r as protocolVersionSchema, _t as RelayOfferFrame, a as BulkOpen, ai as thresholdShareEnvelopeSchema, an as WebrtcAnswer, ar as ownerNamedRoomPathSchema, at as PrivateUseDomainId, b as CoseHeaderKid, bn as capabilityScopeSchema, br as ptySpawnSchema, bt as RevocationEntry, c as CandidatesFrame, ci as tokenClaimsSchema, cn as WireCandidate, cr as peerAdvertSchema, ct as ProcSpawn, d as CapabilityRequest, di as transferIdSchema, dn as bulkDataFrameSchema, dr as pongFrameSchema, dt as PtyResize, ei as thresholdCommitmentSchema, en as TokenClaims, er as manageResponseFrameSchema, et as PeerAdvert, f as CapabilityScope, fi as versionGetSchema, fn as bulkEndFrameSchema, fr as privateUseCapabilitySchema, ft as PtySpawn, g as CoordinatorFrame, gi as wireCandidateSchema, gn as candidatesFrameSchema, gr as procSpawnSchema, gt as RelayInboundFrame, h as CloseFrame, hi as webrtcOfferSchema, hn as candidateKindSchema, hr as procSignalSchema, ht as RelayDataFrame, i as BulkEndFrame, ii as thresholdShareClaimsSchema, in as VersionGet, ir as observedAddressFrameSchema, it as PrivateUseCapability, j as ExecList, jn as coseTokenHeadersSchema, jr as roomJoinSchema, jt as RoomRead, k as DmRoomPath, kn as coseHeaderLabelSchema, kr as roomInviteSchema, kt as RoomNoticeClaims, l as CapabilityGrant, li as topologyGetSchema, ln as bulkAckFrameSchema, lr as peerIdentitySchema, lt as ProtocolVersion, m as CapabilityVerb, mi as webrtcIceCandidateSchema, mn as bulkResumeSchema, mr as procKillSchema, mt as RelayConnectFrame, n as BulkCancel, ni as thresholdKeygenRound1Schema, nn as TopologyPeers, nr as namespacedCapabilitySchema, nt as PingFrame, o as BulkResume, oi as thresholdSignSchema, on as WebrtcIceCandidate, or as pathTraceOkSchema, ot as ProcKill, p as CapabilityToken, pi as webrtcAnswerSchema, pn as bulkOpenSchema, pr as privateUseDomainIdSchema, pt as PtyWrite, q as MessageRef, qn as iceCandidateInitSchema, qr as streamAckFrameSchema, qt as ThresholdKeygenConfirm, r as BulkDataFrame, ri as thresholdKeygenRound2Schema, rn as TransferId, rr as namespacedDomainIdSchema, rt as PongFrame, s as CandidateKind, si as thresholdSubjectSchema, sn as WebrtcOffer, sr as pathTraceSchema, st as ProcSignal, t as BulkAckFrame, ti as thresholdKeygenConfirmSchema, tn as TopologyGet, tr as messageRefSchema, tt as PeerIdentity, u as CapabilityGrantOk, ui as topologyPeersSchema, un as bulkCancelSchema, ur as pingFrameSchema, ut as PtyKill, v as CoreDomainName, vn as capabilityGrantSchema, vr as ptyKillSchema, vt as RevocationAnnounceFrame, w as DataEntriesFrame, wn as coordinatorFrameSchema, wr as relayInboundFrameSchema, wt as RoomLeave, x as CoseHeaderLabel, xn as capabilityTokenSchema, xr as ptyWriteSchema, xt as RoomInvite, y as CoseHeaderAlg, yn as capabilityRequestSchema, yr as ptyResizeSchema, yt as RevocationClaims, z as IceCandidateInit, zn as execListSchema, zr as roomReadSchema, zt as StreamAckFrame } from "../protocol-BgR1e_NI.mjs";
2
2
  export { BulkAckFrame, BulkCancel, BulkDataFrame, BulkEndFrame, BulkOpen, BulkResume, CandidateKind, CandidatesFrame, CapabilityGrant, CapabilityGrantOk, CapabilityRequest, CapabilityScope, CapabilityToken, CapabilityVerb, CloseFrame, CoordinatorFrame, CoreCapability, CoreDomainName, CoseHeaderAlg, CoseHeaderKid, CoseHeaderLabel, CoseSign1, CoseTokenHeaders, DataEntriesFrame, DataHaveFrame, DataRequestFrame, DeviceId, DeviceIdHex, DmRoomPath, DomainId, ExecList, ExecSessionInfo, Frame, FrameVariant, GossipFrame, HandleClaims, HandleRecord, HandshakeFrame, IceCandidateInit, IdentityKey, ManageCommand, ManageCommandParams, ManageError, ManageOk, ManageRequestFrame, ManageResponseFrame, MessageRef, NamespacedCapability, NamespacedDomainId, ObservedAddressFrame, OwnerNamedRoomPath, PathTrace, PathTraceOk, PeerAdvert, PeerIdentity, PingFrame, PongFrame, PrivateUseCapability, PrivateUseDomainId, ProcKill, ProcSignal, ProcSpawn, ProtocolVersion, PtyKill, PtyResize, PtySpawn, PtyWrite, RelayConnectFrame, RelayDataFrame, RelayInboundFrame, RelayOfferFrame, RevocationAnnounceFrame, RevocationClaims, RevocationEntry, RoomInvite, RoomJoin, RoomJoinOk, RoomLeave, RoomMember, RoomMembers, RoomMembersOk, RoomNotice, RoomNoticeClaims, RoomPath, RoomRead, RoomRekey, RoomSend, SecureDataFrame, SecureHelloFrame, SessionId, SfuTrackEntry, SfuTrackMap, StreamAckFrame, StreamDataFrame, StreamEndFrame, StreamSession, SyncPunchFrame, ThresholdAbort, ThresholdCommit, ThresholdCommitment, ThresholdKeygenConfirm, ThresholdKeygenRound1, ThresholdKeygenRound2, ThresholdShareClaims, ThresholdShareEnvelope, ThresholdSign, ThresholdSubject, TokenClaims, TopologyGet, TopologyPeers, TransferId, VersionGet, WebrtcAnswer, WebrtcIceCandidate, WebrtcOffer, WireCandidate, bulkAckFrameSchema, bulkCancelSchema, bulkDataFrameSchema, bulkEndFrameSchema, bulkOpenSchema, bulkResumeSchema, candidateKindSchema, candidatesFrameSchema, capabilityGrantOkSchema, capabilityGrantSchema, capabilityRequestSchema, capabilityScopeSchema, capabilityTokenSchema, capabilityVerbSchema, closeFrameSchema, coordinatorFrameSchema, coreCapabilitySchema, coreDomainNameSchema, coseHeaderAlgSchema, coseHeaderKidSchema, coseHeaderLabelSchema, coseSign1Schema, coseTokenHeadersSchema, dataEntriesFrameSchema, dataHaveFrameSchema, dataRequestFrameSchema, deviceIdHexSchema, deviceIdSchema, dmRoomPathSchema, domainIdSchema, execListSchema, execSessionInfoSchema, frameSchema, frameVariantSchema, gossipFrameSchema, handleClaimsSchema, handleRecordSchema, handshakeFrameSchema, iceCandidateInitSchema, identityKeySchema, manageCommandParamsSchema, manageCommandSchema, manageErrorSchema, manageOkSchema, manageRequestFrameSchema, manageResponseFrameSchema, messageRefSchema, namespacedCapabilitySchema, namespacedDomainIdSchema, observedAddressFrameSchema, ownerNamedRoomPathSchema, pathTraceOkSchema, pathTraceSchema, peerAdvertSchema, peerIdentitySchema, pingFrameSchema, pongFrameSchema, privateUseCapabilitySchema, privateUseDomainIdSchema, procKillSchema, procSignalSchema, procSpawnSchema, protocolVersionSchema, ptyKillSchema, ptyResizeSchema, ptySpawnSchema, ptyWriteSchema, relayConnectFrameSchema, relayDataFrameSchema, relayInboundFrameSchema, relayOfferFrameSchema, revocationAnnounceFrameSchema, revocationClaimsSchema, revocationEntrySchema, roomInviteSchema, roomJoinOkSchema, roomJoinSchema, roomLeaveSchema, roomMemberSchema, roomMembersOkSchema, roomMembersSchema, roomNoticeClaimsSchema, roomNoticeSchema, roomPathSchema, roomReadSchema, roomRekeySchema, roomSendSchema, secureDataFrameSchema, secureHelloFrameSchema, sessionIdSchema, sfuTrackEntrySchema, sfuTrackMapSchema, streamAckFrameSchema, streamDataFrameSchema, streamEndFrameSchema, streamSessionSchema, syncPunchFrameSchema, thresholdAbortSchema, thresholdCommitSchema, thresholdCommitmentSchema, thresholdKeygenConfirmSchema, thresholdKeygenRound1Schema, thresholdKeygenRound2Schema, thresholdShareClaimsSchema, thresholdShareEnvelopeSchema, thresholdSignSchema, thresholdSubjectSchema, tokenClaimsSchema, topologyGetSchema, topologyPeersSchema, transferIdSchema, versionGetSchema, webrtcAnswerSchema, webrtcIceCandidateSchema, webrtcOfferSchema, wireCandidateSchema };
@@ -468,9 +468,12 @@ const tokenClaimsSchema = z.lazy(() => z.object({
468
468
  "expires": z.number().int().nonnegative(),
469
469
  "not-before": z.number().int().nonnegative().optional(),
470
470
  "parent": z.instanceof(Uint8Array).optional(),
471
+ "authorised-by": z.instanceof(Uint8Array).optional(),
471
472
  "delegations-remaining": z.number().int().nonnegative().optional(),
472
473
  "valid-until": z.number().int().nonnegative().optional(),
473
- "conditions": z.instanceof(Uint8Array).optional()
474
+ "conditions": z.instanceof(Uint8Array).optional(),
475
+ "grants-capability": z.lazy(() => capabilityVerbSchema).optional(),
476
+ "requests-capability": z.lazy(() => capabilityVerbSchema).optional()
474
477
  }).catchall(z.unknown()));
475
478
  const pingFrameSchema = z.lazy(() => z.object({ "type": z.literal("ping") }));
476
479
  const pongFrameSchema = z.lazy(() => z.object({ "type": z.literal("pong") }));
@@ -1,4 +1,4 @@
1
- import { B as IdentityKey, D as DeviceId } from "./protocol-DCDae3z4.cjs";
1
+ import { B as IdentityKey, D as DeviceId } from "./protocol-BgR1e_NI.cjs";
2
2
  //#region src/ports/identity.d.ts
3
3
  /**
4
4
  * Wraps the local node's own identity plus the signing/verification primitives capability-token handling needs -- never hardcoded to one crypto library's own API shape (Node's webcrypto, a WASM implementation, a hardware key, etc. can all satisfy this same contract).
@@ -1,4 +1,4 @@
1
- import { B as IdentityKey, D as DeviceId } from "./protocol-DCDae3z4.mjs";
1
+ import { B as IdentityKey, D as DeviceId } from "./protocol-BgR1e_NI.mjs";
2
2
  //#region src/ports/identity.d.ts
3
3
  /**
4
4
  * Wraps the local node's own identity plus the signing/verification primitives capability-token handling needs -- never hardcoded to one crypto library's own API shape (Node's webcrypto, a WASM implementation, a hardware key, etc. can all satisfy this same contract).
@@ -1,2 +1,2 @@
1
- import { t as IdentityPort } from "../identity-DVCNuFLG.cjs";
1
+ import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
2
2
  export { IdentityPort };
@@ -1,2 +1,2 @@
1
- import { t as IdentityPort } from "../identity-DcaYgjXT.mjs";
1
+ import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
2
2
  export { IdentityPort };
@@ -1,2 +1,2 @@
1
- import { n as Listener, r as Transport, t as Connection } from "../transport-DIXjoQKn.cjs";
1
+ import { n as Listener, r as Transport, t as Connection } from "../transport-DP3hdehk.cjs";
2
2
  export { Connection, Listener, Transport };
@@ -1,2 +1,2 @@
1
- import { n as Listener, r as Transport, t as Connection } from "../transport-B0GywEzG.mjs";
1
+ import { n as Listener, r as Transport, t as Connection } from "../transport-Dv_LTCsF.mjs";
2
2
  export { Connection, Listener, Transport };
@@ -1564,9 +1564,12 @@ declare const tokenClaimsSchema: z.ZodLazy<z.ZodObject<{
1564
1564
  expires: z.ZodNumber;
1565
1565
  "not-before": z.ZodOptional<z.ZodNumber>;
1566
1566
  parent: z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
1567
+ "authorised-by": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
1567
1568
  "delegations-remaining": z.ZodOptional<z.ZodNumber>;
1568
1569
  "valid-until": z.ZodOptional<z.ZodNumber>;
1569
1570
  conditions: z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
1571
+ "grants-capability": z.ZodOptional<z.ZodLazy<z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodString>>, z.ZodLazy<z.ZodLazy<z.ZodString>>, z.ZodLazy<z.ZodLazy<z.ZodString>>]>>>>;
1572
+ "requests-capability": z.ZodOptional<z.ZodLazy<z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodString>>, z.ZodLazy<z.ZodLazy<z.ZodString>>, z.ZodLazy<z.ZodLazy<z.ZodString>>]>>>>;
1570
1573
  }, z.core.$catchall<z.ZodUnknown>>>;
1571
1574
  declare const pingFrameSchema: z.ZodLazy<z.ZodObject<{
1572
1575
  type: z.ZodLiteral<"ping">;
@@ -1564,9 +1564,12 @@ declare const tokenClaimsSchema: z.ZodLazy<z.ZodObject<{
1564
1564
  expires: z.ZodNumber;
1565
1565
  "not-before": z.ZodOptional<z.ZodNumber>;
1566
1566
  parent: z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
1567
+ "authorised-by": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
1567
1568
  "delegations-remaining": z.ZodOptional<z.ZodNumber>;
1568
1569
  "valid-until": z.ZodOptional<z.ZodNumber>;
1569
1570
  conditions: z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
1571
+ "grants-capability": z.ZodOptional<z.ZodLazy<z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodString>>, z.ZodLazy<z.ZodLazy<z.ZodString>>, z.ZodLazy<z.ZodLazy<z.ZodString>>]>>>>;
1572
+ "requests-capability": z.ZodOptional<z.ZodLazy<z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodString>>, z.ZodLazy<z.ZodLazy<z.ZodString>>, z.ZodLazy<z.ZodLazy<z.ZodString>>]>>>>;
1570
1573
  }, z.core.$catchall<z.ZodUnknown>>>;
1571
1574
  declare const pingFrameSchema: z.ZodLazy<z.ZodObject<{
1572
1575
  type: z.ZodLiteral<"ping">;
@@ -1,5 +1,5 @@
1
- import { B as IdentityKey, D as DeviceId, en as TokenClaims, p as CapabilityToken } from "./protocol-DCDae3z4.mjs";
2
- import { l as TokenVerdictReason, u as VerifyCapabilityTokenOptions } from "./tokens-CBiSYuzp.mjs";
1
+ import { B as IdentityKey, D as DeviceId, en as TokenClaims, p as CapabilityToken } from "./protocol-BgR1e_NI.cjs";
2
+ import { TokenVerdictReason, VerifyCapabilityTokenOptions } from "./domain/tokens.cjs";
3
3
  //#region src/domain/room-token-verification.d.ts
4
4
  /** The one capability every core/room verb (room.send/read/leave/members) is gated by, per spec/room.cddl -- room.join/room.invite are deliberately ungated instead and need no token check at all. */
5
5
  declare const ROOM_MEMBER_CAPABILITY = "room:member";
@@ -1,5 +1,5 @@
1
- import { B as IdentityKey, D as DeviceId, en as TokenClaims, p as CapabilityToken } from "./protocol-DCDae3z4.cjs";
2
- import { l as TokenVerdictReason, u as VerifyCapabilityTokenOptions } from "./tokens-DqFu7iMX.cjs";
1
+ import { B as IdentityKey, D as DeviceId, en as TokenClaims, p as CapabilityToken } from "./protocol-BgR1e_NI.mjs";
2
+ import { TokenVerdictReason, VerifyCapabilityTokenOptions } from "./domain/tokens.mjs";
3
3
  //#region src/domain/room-token-verification.d.ts
4
4
  /** The one capability every core/room verb (room.send/read/leave/members) is gated by, per spec/room.cddl -- room.join/room.invite are deliberately ungated instead and need no token check at all. */
5
5
  declare const ROOM_MEMBER_CAPABILITY = "room:member";
@@ -0,0 +1,72 @@
1
+ import { D as DeviceId, en as TokenClaims } from "./protocol-BgR1e_NI.cjs";
2
+ import { t as Clock } from "./clock-DiSx-WKM.cjs";
3
+ import { z } from "zod";
4
+ import { JsonValue, PredicateNode, Resolution } from "trilean";
5
+ //#region src/domain/token-predicates.d.ts
6
+ /** The wire shape of `token-claims.conditions` once CBOR-decoded: trilean's own PredicateNodeSchema is the single source of truth for what a condition entry may contain, re-validated here rather than trusted from a CDDL-generated shadow schema (see tokens.cddl's own comment on why `conditions` is an opaque bstr, not a native CDDL type) -- a token from an untrusted peer must pass trilean's real schema before any of its conditions are evaluated. Explicitly annotated: trilean's PredicateNodeSchema is a deeply recursive z.lazy() type whose inferred shape is too large for tsdown's declaration-file generator to serialise (TS7056) without this. */
7
+ declare const conditionsListSchema: z.ZodType<PredicateNode[]>;
8
+ /**
9
+ * tokens.cddl's mandated core predicate-op vocabulary (issue #85): the five narrowing checks a verifier previously enforced as five hardcoded `if`s, now expressed as `delegate` systems every conforming verifier registers a handler for. Order matches the historical check order in verifyTokenChain/checkNarrowing, preserved so a caller mapping a failing system to its own reason vocabulary (MintRefusalReason's five distinct values; verifyTokenChain's single collapsed "delegation_exceeds_parent") sees the same check run first that always ran first.
10
+ */
11
+ declare const BEARER_IS = "bearer-is";
12
+ declare const EXPIRES_AT = "expires-at";
13
+ declare const SCOPE_NARROWS = "scope-narrows";
14
+ declare const CAPABILITY_IS = "capability-is";
15
+ declare const DEPTH_REMAINING = "depth-remaining";
16
+ type NarrowingSystem = typeof BEARER_IS | typeof EXPIRES_AT | typeof SCOPE_NARROWS | typeof CAPABILITY_IS | typeof DEPTH_REMAINING;
17
+ /** Everything needed to check candidate against parent, restated from tokens.ts's own NarrowingCandidate/checkNarrowing shape rather than requiring a full TokenClaims for the not-yet-minted child -- the same reasoning mintCapabilityToken's own checkNarrowing already applies (a delegation candidate has no token-id/issuer-key/bearer of its own yet). camelCase field names, matching NarrowingCandidate's own convention, deliberately distinct from TokenClaims' hyphenated wire field names. */
18
+ interface NarrowingCandidate {
19
+ capability: TokenClaims["capability"];
20
+ scope: TokenClaims["scope"];
21
+ expires: number;
22
+ delegationsRemaining?: number;
23
+ }
24
+ /**
25
+ * The local evaluation context every token predicate op reads from -- trilean's own `EvaluationContext` is deliberately typed `unknown` (an opaque, in-process value never serialised as part of the tree), so this is wire-mesh's own concrete shape for it. `childIssuer`/`candidate` describe the not-yet-minted or being-verified child; `parentClaims` is the already-decoded-and-verified parent, present only when narrowing is actually being checked against one. No clock: none of the five structural narrowing checks reason about the current time (unlike a conditions-list entry, which might -- see ConditionsContext).
26
+ */
27
+ interface TokenPredicateContext {
28
+ readonly childIssuer: DeviceId;
29
+ readonly candidate: Readonly<NarrowingCandidate>;
30
+ readonly parentClaims?: Readonly<TokenClaims>;
31
+ }
32
+ /** A `conditions` entry's own generic evaluation context: no parent/candidate distinction, since a domain-specific condition (a message TTL, a future revoke-authorization check) reasons about the presented token's own claims directly, not a not-yet-minted delegation candidate. */
33
+ interface ConditionsContext {
34
+ readonly clock: Clock;
35
+ readonly claims: Readonly<TokenClaims>;
36
+ /** The minted child a grant-capability's conditions are being evaluated against (wire-mesh#323 subject mode): present only inside an authorised-by verification walk or a mint-time authorisation check, never when a token's conditions are evaluated against its own claims. */
37
+ readonly subject?: Readonly<GrantSubject>;
38
+ }
39
+ /** The child half of a subject-mode conditions evaluation: the claims of the token a grant-capability authorises, structurally what NarrowingCandidate already is plus the bearer the mint named. Satisfied by a full TokenClaims, so the verifier passes the child's decoded claims directly. */
40
+ interface GrantSubject {
41
+ capability: TokenClaims["capability"];
42
+ scope: TokenClaims["scope"];
43
+ bearer: DeviceId;
44
+ expires: number;
45
+ delegationsRemaining?: number;
46
+ }
47
+ /** The two subject-mode delegate systems (wire-mesh#323), registered only when a ConditionsContext carries a subject, and indeterminate (fail-closed) whenever one does not. */
48
+ declare const GRANTEE_IS = "grantee-is";
49
+ declare const GRANTED_CAPABILITY_IS = "granted-capability-is";
50
+ type SubjectSystem = typeof GRANTEE_IS | typeof GRANTED_CAPABILITY_IS;
51
+ /** The named no-self-grant bar (wire-mesh#323): one conditions entry an issuer puts on a grant-capability so its bearer may not mint a `capability` token naming itself as bearer. `not(and(...))` under strict Kleene: a child granted to anyone else passes, a child granted to the bearer fails, and any unresolvable leg stays indeterminate and refuses. */
52
+ declare function noSelfGrantBar(capability: TokenClaims["capability"], bearer: DeviceId): PredicateNode;
53
+ /** One delegate system's own handler: given the delegate node's payload and the concrete context it was invoked with, resolves to a boolean-valued Resolution. Handlers never throw for a data-quality problem -- an op that cannot make sense of its own payload/context returns `{found: false}`, which the evaluator turns into a fail-closed `indeterminate`. */
54
+ type TokenDelegateHandler<TContext> = (payload: JsonValue, context: TContext) => Resolution | Promise<Resolution>;
55
+ /**
56
+ * Evaluates the five mandatory narrowing predicates against parentClaims/candidate, in their historical check order, short-circuiting on and returning the first that does not hold. Returns undefined when every check holds. This is the single mechanism both mintCapabilityToken's own pre-mint check and verifyTokenChain's own delegation-chain walk call -- the two can never silently drift into different ideas of what "narrows" means, because there is now exactly one implementation of each check, not two hardcoded copies.
57
+ */
58
+ declare function evaluateNarrowing(parentClaims: Readonly<TokenClaims>, childIssuer: DeviceId, candidate: Readonly<NarrowingCandidate>): Promise<NarrowingSystem | undefined>;
59
+ type ConditionsVerdict = {
60
+ ok: true;
61
+ } | {
62
+ ok: false;
63
+ reason: "not_satisfied";
64
+ };
65
+ /**
66
+ * Evaluates token-claims' own `conditions` field (issue #85): additional, issuer-chosen predicates strictly additive to the five mandatory narrowing checks above, which are computed structurally (from a delegated token's own claims and its parent's) and never read from this field -- the five built-ins are inherently about a parent/child relationship, so they are not meaningfully reusable inside a bare, parent-less conditions evaluation, unlike a genuine domain-specific condition (a message TTL, #84's future revoke-authorization check) which reasons about the presented token's own claims directly. `extraHandlers` is the registration point for those: none exist yet, so a `conditions` entry naming any system with no registered handler resolves `{found: false}` -- indeterminate, fail-closed. Absent `nodes` (an empty array, the caller's own signal for "no conditions field present") is trivially `{ok: true}` -- no extra restrictions, exactly today's behaviour. Every entry MUST evaluate to a definite `true`; the loop short-circuits on the first indeterminate or false result.
67
+ */
68
+ declare function evaluateConditions(nodes: readonly PredicateNode[], claims: Readonly<TokenClaims>, clock: Readonly<Clock>, extraHandlers?: Readonly<Record<string, TokenDelegateHandler<ConditionsContext>>>,
69
+ /** Subject mode (wire-mesh#323): the minted child the carrying grant-capability's conditions bind to. Absent evaluates against the carrying token's own claims, exactly as before; present additionally registers the two subject systems, whose handlers read the subject rather than `claims`. */
70
+ subject?: Readonly<GrantSubject>): Promise<ConditionsVerdict>;
71
+ //#endregion
72
+ export { evaluateConditions as _, DEPTH_REMAINING as a, GRANTEE_IS as c, NarrowingSystem as d, SCOPE_NARROWS as f, conditionsListSchema as g, TokenPredicateContext as h, ConditionsVerdict as i, GrantSubject as l, TokenDelegateHandler as m, CAPABILITY_IS as n, EXPIRES_AT as o, SubjectSystem as p, ConditionsContext as r, GRANTED_CAPABILITY_IS as s, BEARER_IS as t, NarrowingCandidate as u, evaluateNarrowing as v, noSelfGrantBar as y };
@@ -0,0 +1,72 @@
1
+ import { D as DeviceId, en as TokenClaims } from "./protocol-BgR1e_NI.mjs";
2
+ import { t as Clock } from "./clock-DiSx-WKM.mjs";
3
+ import { z } from "zod";
4
+ import { JsonValue, PredicateNode, Resolution } from "trilean";
5
+ //#region src/domain/token-predicates.d.ts
6
+ /** The wire shape of `token-claims.conditions` once CBOR-decoded: trilean's own PredicateNodeSchema is the single source of truth for what a condition entry may contain, re-validated here rather than trusted from a CDDL-generated shadow schema (see tokens.cddl's own comment on why `conditions` is an opaque bstr, not a native CDDL type) -- a token from an untrusted peer must pass trilean's real schema before any of its conditions are evaluated. Explicitly annotated: trilean's PredicateNodeSchema is a deeply recursive z.lazy() type whose inferred shape is too large for tsdown's declaration-file generator to serialise (TS7056) without this. */
7
+ declare const conditionsListSchema: z.ZodType<PredicateNode[]>;
8
+ /**
9
+ * tokens.cddl's mandated core predicate-op vocabulary (issue #85): the five narrowing checks a verifier previously enforced as five hardcoded `if`s, now expressed as `delegate` systems every conforming verifier registers a handler for. Order matches the historical check order in verifyTokenChain/checkNarrowing, preserved so a caller mapping a failing system to its own reason vocabulary (MintRefusalReason's five distinct values; verifyTokenChain's single collapsed "delegation_exceeds_parent") sees the same check run first that always ran first.
10
+ */
11
+ declare const BEARER_IS = "bearer-is";
12
+ declare const EXPIRES_AT = "expires-at";
13
+ declare const SCOPE_NARROWS = "scope-narrows";
14
+ declare const CAPABILITY_IS = "capability-is";
15
+ declare const DEPTH_REMAINING = "depth-remaining";
16
+ type NarrowingSystem = typeof BEARER_IS | typeof EXPIRES_AT | typeof SCOPE_NARROWS | typeof CAPABILITY_IS | typeof DEPTH_REMAINING;
17
+ /** Everything needed to check candidate against parent, restated from tokens.ts's own NarrowingCandidate/checkNarrowing shape rather than requiring a full TokenClaims for the not-yet-minted child -- the same reasoning mintCapabilityToken's own checkNarrowing already applies (a delegation candidate has no token-id/issuer-key/bearer of its own yet). camelCase field names, matching NarrowingCandidate's own convention, deliberately distinct from TokenClaims' hyphenated wire field names. */
18
+ interface NarrowingCandidate {
19
+ capability: TokenClaims["capability"];
20
+ scope: TokenClaims["scope"];
21
+ expires: number;
22
+ delegationsRemaining?: number;
23
+ }
24
+ /**
25
+ * The local evaluation context every token predicate op reads from -- trilean's own `EvaluationContext` is deliberately typed `unknown` (an opaque, in-process value never serialised as part of the tree), so this is wire-mesh's own concrete shape for it. `childIssuer`/`candidate` describe the not-yet-minted or being-verified child; `parentClaims` is the already-decoded-and-verified parent, present only when narrowing is actually being checked against one. No clock: none of the five structural narrowing checks reason about the current time (unlike a conditions-list entry, which might -- see ConditionsContext).
26
+ */
27
+ interface TokenPredicateContext {
28
+ readonly childIssuer: DeviceId;
29
+ readonly candidate: Readonly<NarrowingCandidate>;
30
+ readonly parentClaims?: Readonly<TokenClaims>;
31
+ }
32
+ /** A `conditions` entry's own generic evaluation context: no parent/candidate distinction, since a domain-specific condition (a message TTL, a future revoke-authorization check) reasons about the presented token's own claims directly, not a not-yet-minted delegation candidate. */
33
+ interface ConditionsContext {
34
+ readonly clock: Clock;
35
+ readonly claims: Readonly<TokenClaims>;
36
+ /** The minted child a grant-capability's conditions are being evaluated against (wire-mesh#323 subject mode): present only inside an authorised-by verification walk or a mint-time authorisation check, never when a token's conditions are evaluated against its own claims. */
37
+ readonly subject?: Readonly<GrantSubject>;
38
+ }
39
+ /** The child half of a subject-mode conditions evaluation: the claims of the token a grant-capability authorises, structurally what NarrowingCandidate already is plus the bearer the mint named. Satisfied by a full TokenClaims, so the verifier passes the child's decoded claims directly. */
40
+ interface GrantSubject {
41
+ capability: TokenClaims["capability"];
42
+ scope: TokenClaims["scope"];
43
+ bearer: DeviceId;
44
+ expires: number;
45
+ delegationsRemaining?: number;
46
+ }
47
+ /** The two subject-mode delegate systems (wire-mesh#323), registered only when a ConditionsContext carries a subject, and indeterminate (fail-closed) whenever one does not. */
48
+ declare const GRANTEE_IS = "grantee-is";
49
+ declare const GRANTED_CAPABILITY_IS = "granted-capability-is";
50
+ type SubjectSystem = typeof GRANTEE_IS | typeof GRANTED_CAPABILITY_IS;
51
+ /** The named no-self-grant bar (wire-mesh#323): one conditions entry an issuer puts on a grant-capability so its bearer may not mint a `capability` token naming itself as bearer. `not(and(...))` under strict Kleene: a child granted to anyone else passes, a child granted to the bearer fails, and any unresolvable leg stays indeterminate and refuses. */
52
+ declare function noSelfGrantBar(capability: TokenClaims["capability"], bearer: DeviceId): PredicateNode;
53
+ /** One delegate system's own handler: given the delegate node's payload and the concrete context it was invoked with, resolves to a boolean-valued Resolution. Handlers never throw for a data-quality problem -- an op that cannot make sense of its own payload/context returns `{found: false}`, which the evaluator turns into a fail-closed `indeterminate`. */
54
+ type TokenDelegateHandler<TContext> = (payload: JsonValue, context: TContext) => Resolution | Promise<Resolution>;
55
+ /**
56
+ * Evaluates the five mandatory narrowing predicates against parentClaims/candidate, in their historical check order, short-circuiting on and returning the first that does not hold. Returns undefined when every check holds. This is the single mechanism both mintCapabilityToken's own pre-mint check and verifyTokenChain's own delegation-chain walk call -- the two can never silently drift into different ideas of what "narrows" means, because there is now exactly one implementation of each check, not two hardcoded copies.
57
+ */
58
+ declare function evaluateNarrowing(parentClaims: Readonly<TokenClaims>, childIssuer: DeviceId, candidate: Readonly<NarrowingCandidate>): Promise<NarrowingSystem | undefined>;
59
+ type ConditionsVerdict = {
60
+ ok: true;
61
+ } | {
62
+ ok: false;
63
+ reason: "not_satisfied";
64
+ };
65
+ /**
66
+ * Evaluates token-claims' own `conditions` field (issue #85): additional, issuer-chosen predicates strictly additive to the five mandatory narrowing checks above, which are computed structurally (from a delegated token's own claims and its parent's) and never read from this field -- the five built-ins are inherently about a parent/child relationship, so they are not meaningfully reusable inside a bare, parent-less conditions evaluation, unlike a genuine domain-specific condition (a message TTL, #84's future revoke-authorization check) which reasons about the presented token's own claims directly. `extraHandlers` is the registration point for those: none exist yet, so a `conditions` entry naming any system with no registered handler resolves `{found: false}` -- indeterminate, fail-closed. Absent `nodes` (an empty array, the caller's own signal for "no conditions field present") is trivially `{ok: true}` -- no extra restrictions, exactly today's behaviour. Every entry MUST evaluate to a definite `true`; the loop short-circuits on the first indeterminate or false result.
67
+ */
68
+ declare function evaluateConditions(nodes: readonly PredicateNode[], claims: Readonly<TokenClaims>, clock: Readonly<Clock>, extraHandlers?: Readonly<Record<string, TokenDelegateHandler<ConditionsContext>>>,
69
+ /** Subject mode (wire-mesh#323): the minted child the carrying grant-capability's conditions bind to. Absent evaluates against the carrying token's own claims, exactly as before; present additionally registers the two subject systems, whose handlers read the subject rather than `claims`. */
70
+ subject?: Readonly<GrantSubject>): Promise<ConditionsVerdict>;
71
+ //#endregion
72
+ export { evaluateConditions as _, DEPTH_REMAINING as a, GRANTEE_IS as c, NarrowingSystem as d, SCOPE_NARROWS as f, conditionsListSchema as g, TokenPredicateContext as h, ConditionsVerdict as i, GrantSubject as l, TokenDelegateHandler as m, CAPABILITY_IS as n, EXPIRES_AT as o, SubjectSystem as p, ConditionsContext as r, GRANTED_CAPABILITY_IS as s, BEARER_IS as t, NarrowingCandidate as u, evaluateNarrowing as v, noSelfGrantBar as y };
@@ -1,4 +1,4 @@
1
- import { D as DeviceId, N as Frame } from "./protocol-DCDae3z4.cjs";
1
+ import { D as DeviceId, N as Frame } from "./protocol-BgR1e_NI.cjs";
2
2
  //#region src/ports/transport.d.ts
3
3
  /**
4
4
  * An async, serialisable-data contract for exchanging frame values over some connection -- deliberately without baking in any specific transport's own primitives (no raw socket types, no WebSocket-specific options), so a TCP adapter, a WebSocket adapter, or an in-memory adapter for tests can all satisfy it.
@@ -1,4 +1,4 @@
1
- import { D as DeviceId, N as Frame } from "./protocol-DCDae3z4.mjs";
1
+ import { D as DeviceId, N as Frame } from "./protocol-BgR1e_NI.mjs";
2
2
  //#region src/ports/transport.d.ts
3
3
  /**
4
4
  * An async, serialisable-data contract for exchanging frame values over some connection -- deliberately without baking in any specific transport's own primitives (no raw socket types, no WebSocket-specific options), so a TCP adapter, a WebSocket adapter, or an in-memory adapter for tests can all satisfy it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wire-mesh-core",
3
- "version": "3.7.2",
3
+ "version": "3.9.0",
4
4
  "dependencies": {
5
5
  "cbor2": "2.3.0",
6
6
  "cddl.js": "1.0.1",
@@ -194,6 +194,14 @@
194
194
  "import": "./dist/domain/threshold-subject.mjs",
195
195
  "require": "./dist/domain/threshold-subject.cjs"
196
196
  },
197
+ "./domain/token-predicates": {
198
+ "import": "./dist/domain/token-predicates.mjs",
199
+ "require": "./dist/domain/token-predicates.cjs"
200
+ },
201
+ "./domain/token-scope": {
202
+ "import": "./dist/domain/token-scope.mjs",
203
+ "require": "./dist/domain/token-scope.cjs"
204
+ },
197
205
  "./domain/tokens": {
198
206
  "import": "./dist/domain/tokens.mjs",
199
207
  "require": "./dist/domain/tokens.cjs"
@@ -1,126 +0,0 @@
1
- import { B as IdentityKey, D as DeviceId, bt as RevocationEntry, en as TokenClaims, p as CapabilityToken, yt as RevocationClaims } from "./protocol-DCDae3z4.mjs";
2
- import { t as IdentityPort } from "./identity-DcaYgjXT.mjs";
3
- import { t as Clock } from "./clock-DiSx-WKM.mjs";
4
- import { z } from "zod";
5
- import { JsonValue, PredicateNode, Resolution } from "trilean";
6
- //#region src/domain/token-predicates.d.ts
7
- /** Everything needed to check candidate against parent, restated from tokens.ts's own NarrowingCandidate/checkNarrowing shape rather than requiring a full TokenClaims for the not-yet-minted child -- the same reasoning mintCapabilityToken's own checkNarrowing already applies (a delegation candidate has no token-id/issuer-key/bearer of its own yet). camelCase field names, matching NarrowingCandidate's own convention, deliberately distinct from TokenClaims' hyphenated wire field names. */
8
- interface NarrowingCandidate {
9
- capability: TokenClaims["capability"];
10
- scope: TokenClaims["scope"];
11
- expires: number;
12
- delegationsRemaining?: number;
13
- }
14
- /** A `conditions` entry's own generic evaluation context: no parent/candidate distinction, since a domain-specific condition (a message TTL, a future revoke-authorization check) reasons about the presented token's own claims directly, not a not-yet-minted delegation candidate. */
15
- interface ConditionsContext {
16
- readonly clock: Clock;
17
- readonly claims: Readonly<TokenClaims>;
18
- }
19
- /** One delegate system's own handler: given the delegate node's payload and the concrete context it was invoked with, resolves to a boolean-valued Resolution. Handlers never throw for a data-quality problem -- an op that cannot make sense of its own payload/context returns `{found: false}`, which the evaluator turns into a fail-closed `indeterminate`. */
20
- type TokenDelegateHandler<TContext> = (payload: JsonValue, context: TContext) => Resolution | Promise<Resolution>;
21
- //#endregion
22
- //#region src/domain/tokens.d.ts
23
- /**
24
- * The revocation view a verifier consults. Returns every recorded, already-signature-verified revocation-claims for tokenId, across every issuer that has ever submitted one -- unfiltered by the store itself. The actual verifier obligation (an entry counts against a token when its own issuer matches the token's own issuer, OR its optional `authorization` grants delegated revoke authority -- management.cddl) is checked by the caller (verifyTokenChain), not here, since that check needs the target token's own scope plus identity/clock to verify a nested authorization token, none of which a store constructed ahead of time has access to. Implementations ingest gossiped revocation-announce frames via verifyRevocationEntry (which enforces each entry's own signature and self-certification) and key the resulting claims by token-id alone -- a token-id can legitimately carry multiple recorded entries from different issuers.
25
- */
26
- interface RevocationCheck {
27
- entriesFor: (tokenId: Uint8Array) => Promise<readonly RevocationClaims[]>;
28
- }
29
- type TokenVerdictReason = "malformed" | "bad_signature" | "wrong_issuer" | "bearer_mismatch" | "expired" | "not_yet_valid" | "content_expired" | "revoked" | "delegation_exceeds_parent" | "parent_invalid" |
30
- /** claims.conditions is present but its bstr fails CBOR decode, or decodes to something that is not a JSON array of valid trilean PredicateNodes -- fail-closed per CONVENTIONS.md's verifier-obligations glossary, the same treatment "malformed" already gives an undecodable payload. */
31
- "conditions_invalid" |
32
- /** claims.conditions decoded and validated, but at least one entry did not evaluate to a definite `true` (indeterminate or false) -- the issuer's own additional restriction was not met. */
33
- "conditions_not_satisfied";
34
- type TokenVerdict = {
35
- ok: true;
36
- claims: TokenClaims;
37
- /** The device-id at the root of this token's delegation chain: its own issuer when it carries no parent, otherwise the root of its parent's chain. Lets a caller (e.g. core/room's obligation that a chain must terminate at the path's own owner, or the verifier itself for a DM) check the chain's root with one equality comparison instead of re-walking the parent chain a second time. */
38
- rootIssuer: DeviceId;
39
- /** The root ancestor's own self-certifying issuer-key -- already decoded during the walk (every TokenClaims carries its own issuer-key), just threaded up rather than re-derived. Lets a caller compute an ECDH shared secret against the chain's root (e.g. room.rekey's own sender, for a named room whose token chain terminates at the owner) without a separate, out-of-band way to learn that issuer's public key. */
40
- rootIssuerKey: IdentityKey;
41
- /** How many delegation hops this token is from its own root -- 0 for a root grant. Costs nothing extra once rootIssuer is being tracked, and makes the delegation bound observable for diagnostics. */
42
- depth: number;
43
- } | {
44
- ok: false;
45
- reason: TokenVerdictReason;
46
- };
47
- interface VerifyCapabilityTokenOptions {
48
- identity: IdentityPort;
49
- clock: Clock;
50
- revocation: RevocationCheck;
51
- /** When given, the token must bear this device -- the caller presenting a token to authorise itself, not someone else. */
52
- expectedBearer?: DeviceId;
53
- /** Registers domain-specific delegate systems a presented token's own `conditions` entries may name, beyond the five mandatory narrowing ops (which are never reachable from `conditions` -- see evaluateConditions's own doc comment). None are registered by wire-mesh-core itself; a domain (a message TTL, #84's future revoke-authorization check) supplies its own here. A `conditions` entry naming a system absent from this map is indeterminate, and therefore fails the whole token -- fail-closed, not a silent no-op. */
54
- extraPredicateResolvers?: Readonly<Record<string, TokenDelegateHandler<ConditionsContext>>>;
55
- }
56
- /** RFC 9052 §4.4 Sig_structure for a COSE_Sign1 with no external AAD: ["Signature1", protected, external_aad, payload]. Exported (not just used internally by verifyTokenChain) so any other self-certifying COSE_Sign1 construction in this codebase -- e.g. threshold-subject.ts's own to-be-signed bytes for a FROST-signed capability-token/revocation-entry/handle-record/room-notice -- reuses this single construction rather than a second hand-rolled one. */
57
- declare function sig1ToBeSigned(protectedHeader: Uint8Array, payload: Uint8Array): Uint8Array;
58
- /**
59
- * Verifies one capability token per tokens.cddl's own documented rules: the token is a well-formed COSE_Sign1 whose signature actually verifies against its own embedded issuer-key, that issuer-key is self-certifying (sha256(issuer-key.public-key) equals the claimed issuer device-id -- no shared secret needed to check this), the token is currently valid (not expired, not before not-before, not revoked by its own issuer), and -- recursively -- any parent delegation narrows rather than widens across all three axes of authority: the parent's bearer must be this token's issuer (the delegation chain is unbroken), this token's expiry must not exceed its parent's, and this token's scope must narrow its parent's (same kind; equal-or-descendant path when the parent carries one) with an identical capability verb (the capability-verb grammar has no sub-verb relation, so a different verb is a different authority, not a narrower one). Undecodable payload bytes return "malformed" and undecodable parent bytes return "parent_invalid" -- hostile input produces a verdict, never a throw.
60
- */
61
- declare function verifyCapabilityToken(token: CapabilityToken, options: VerifyCapabilityTokenOptions): Promise<TokenVerdict>;
62
- type RevocationEntryVerdictReason = "malformed" | "bad_signature" | "wrong_issuer";
63
- type RevocationEntryVerdict = {
64
- ok: true;
65
- claims: RevocationClaims;
66
- } | {
67
- ok: false;
68
- reason: RevocationEntryVerdictReason;
69
- };
70
- interface VerifyRevocationEntryOptions {
71
- /** Crypto primitives only -- any IdentityPort instance can verify any entry, since everything needed to check one travels inside the entry itself. */
72
- identity: IdentityPort;
73
- }
74
- /**
75
- * Verifies one gossiped revocation-entry (management.cddl): a well-formed COSE_Sign1 whose signature verifies against its own embedded issuer-key, where that issuer-key is self-certifying (sha256(issuer-key.public-key) equals the claimed issuer device-id). A verifier that ingests a revocation-announce frame runs each entry through this before recording it in its revocation view; entries failing here are dropped, not stored. The issuer-match against a specific token's own issuer (only a token's own issuer may revoke it) is deliberately NOT checked here -- it happens at lookup time in RevocationCheck, against whichever token is being verified.
76
- */
77
- declare function verifyRevocationEntry(entry: RevocationEntry, options: VerifyRevocationEntryOptions): Promise<RevocationEntryVerdict>;
78
- type MintRefusalReason = "already_expired" | "parent_malformed" | "parent_bearer_mismatch" | "expires_exceeds_parent" | "scope_does_not_narrow" | "capability_mismatch" | "delegation_exceeds_parent";
79
- type MintVerdict = {
80
- ok: true;
81
- token: CapabilityToken;
82
- } | {
83
- ok: false;
84
- reason: MintRefusalReason;
85
- };
86
- /**
87
- * A pure query: could deviceId, presenting heldToken as its own delegation authority, successfully mint a delegation matching candidate right now -- without attempting (and potentially failing) a real mint just to find out. Reuses mintCapabilityToken's own narrowing arithmetic via checkNarrowing, so the two can never silently drift into different ideas of what "narrows" means.
88
- *
89
- * Deliberately narrower than a full mint attempt in one respect: this checks only the narrowing rules tokens.cddl's own delegation obligations require (bearer match, expiry, scope, capability, delegations-remaining), the same scope mintCapabilityToken itself checks a *parent* against -- it does not verify heldToken's own signature or revocation status, exactly as mintCapabilityToken never re-verifies its own parent's signature either. A caller that also needs heldToken's cryptographic validity confirmed calls verifyCapabilityToken separately.
90
- *
91
- * Async as of the predicate-list evaluator (issue #85): checkNarrowing now routes through trilean's own evaluatePredicate, which is asynchronous throughout -- there is no synchronous path through a real evaluator call, so this is a genuine, deliberate breaking change to what was previously a synchronous pure function. No existing consumer of wire-mesh-core calls canGrant (confirmed against agent-comms, the only other repo depending on this package), so there is nothing to migrate.
92
- */
93
- declare function canGrant(heldToken: CapabilityToken, deviceId: DeviceId, candidate: Readonly<NarrowingCandidate>, now: number): Promise<boolean>;
94
- interface MintCapabilityTokenOptions {
95
- /** The issuer -- signs the token, and supplies the self-certifying issuer/issuer-key claims. */
96
- identity: IdentityPort;
97
- clock: Clock;
98
- tokenId: Uint8Array<ArrayBuffer>;
99
- bearer: DeviceId;
100
- capability: TokenClaims["capability"];
101
- scope: TokenClaims["scope"];
102
- expires: number;
103
- notBefore?: number;
104
- /** How many further delegation hops the *resulting* token itself permits below it -- unrelated to, and never a bound on, whether `identity` may mint further tokens of its own at the root level for other bearers. Those are two different facts: a token minted with `delegationsRemaining: 0` genuinely cannot itself be re-delegated (correct -- e.g. a room owner's own self-signed root grant, which should never be handed onward), but that same `0` says nothing about the issuer's own separate, ordinary authority to mint additional independent root-level grants (naming no `parent` at all) for other bearers. Root-level minting for a second bearer is never blocked by any existing token's own `delegationsRemaining`, because it uses no `parent` in the first place -- there is no narrowing check to run. Confirmed live in agent-comms' own room-membership implementation (`ExaDev/agent-comms` PR #72): each member's own join/invite grant is minted as its own independent, parent-less, root-level token precisely because the room owner's `delegationsRemaining: 0` self-grant cannot parent anything -- correct by this same reasoning, not a workaround. */
105
- delegationsRemaining?: number;
106
- /** The issuer's own token, when this is a delegation rather than a root grant. Its claims are checked against every narrowing rule below -- mint refuses rather than producing a token verifyCapabilityToken would reject anyway. Omit entirely for a root-level grant (including a second, independent root-level grant for a different bearer under the same capability/scope this issuer already grants elsewhere) -- there is no bound on how many such root grants an issuer may mint, since none of them narrows any other. */
107
- parent?: CapabilityToken;
108
- /** Additional, issuer-chosen restrictions beyond the five mandatory narrowing checks (issue #85) -- CBOR-encoded into claims.conditions verbatim, evaluated by every verifier via evaluateConditions. Strictly additive: has no bearing on narrowing, which mint enforces separately above regardless of what's given here. Not re-validated against trilean's own schema before encoding -- the TS type already guarantees a well-formed PredicateNode[] at this call site, unlike the bytes a verifier decodes from an untrusted wire token, which always are. */
109
- conditions?: PredicateNode[];
110
- }
111
- /**
112
- * Mints one capability token: builds token-claims from the given fields, signs it as a COSE_Sign1 under `identity`'s own key, with a protected header matching what the frozen conformance vectors actually encode (`{1: alg, 4: issuer device-id}`, not the empty header a token merely needs to verify against itself).
113
- *
114
- * When `parent` is given, every one of `tokens.cddl`'s own narrowing obligations is enforced here, at issuance, rather than left for the far end to discover minutes or hours later as a bare `delegation_exceeds_parent` from `verifyCapabilityToken` -- the same "fail loudly, fail early" reasoning that governs every other boundary in this codebase. An issuer minting an invalid delegation is a bug in the caller; this function refuses rather than producing a token indistinguishable from a valid one until someone else verifies it.
115
- */
116
- declare function mintCapabilityToken(options: MintCapabilityTokenOptions): Promise<MintVerdict>;
117
- interface MintRevocationEntryOptions {
118
- /** The token's own issuer -- only a token's own issuer may revoke it (management.cddl), so this must be the same identity that minted the token being revoked. */
119
- identity: IdentityPort;
120
- tokenId: Uint8Array<ArrayBuffer>;
121
- revokedAt: number;
122
- }
123
- /** Mints one revocation-entry (management.cddl): a COSE_Sign1 over revocation-claims, signed the same way mintCapabilityToken signs a token. No narrowing chain to check -- a revocation entry has no parent and cannot fail to be issuable the way a delegated token can, so this returns the entry directly rather than a verdict. */
124
- declare function mintRevocationEntry(options: MintRevocationEntryOptions): Promise<RevocationEntry>;
125
- //#endregion
126
- export { verifyRevocationEntry as _, RevocationCheck as a, TokenVerdict as c, VerifyRevocationEntryOptions as d, canGrant as f, verifyCapabilityToken as g, sig1ToBeSigned as h, MintVerdict as i, TokenVerdictReason as l, mintRevocationEntry as m, MintRefusalReason as n, RevocationEntryVerdict as o, mintCapabilityToken as p, MintRevocationEntryOptions as r, RevocationEntryVerdictReason as s, MintCapabilityTokenOptions as t, VerifyCapabilityTokenOptions as u };