wire-mesh-core 3.8.0 → 3.10.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 (123) 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 +18 -6
  24. package/dist/domain/capability-request.d.cts +10 -3
  25. package/dist/domain/capability-request.d.mts +10 -3
  26. package/dist/domain/capability-request.mjs +15 -4
  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 +2 -2
  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 +1 -1
  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.cjs +72 -15
  60. package/dist/domain/relay-hub.d.cts +6 -2
  61. package/dist/domain/relay-hub.d.mts +6 -2
  62. package/dist/domain/relay-hub.mjs +72 -15
  63. package/dist/domain/relay-use-gate.d.cts +2 -2
  64. package/dist/domain/relay-use-gate.d.mts +2 -2
  65. package/dist/domain/revocation-view.cjs +2 -2
  66. package/dist/domain/revocation-view.d.cts +2 -2
  67. package/dist/domain/revocation-view.d.mts +2 -2
  68. package/dist/domain/revocation-view.mjs +1 -1
  69. package/dist/domain/room-rekey.d.cts +3 -3
  70. package/dist/domain/room-rekey.d.mts +3 -3
  71. package/dist/domain/room-token-verification.cjs +2 -2
  72. package/dist/domain/room-token-verification.d.cts +1 -1
  73. package/dist/domain/room-token-verification.d.mts +1 -1
  74. package/dist/domain/room-token-verification.mjs +1 -1
  75. package/dist/domain/room.d.cts +4 -4
  76. package/dist/domain/room.d.mts +4 -4
  77. package/dist/domain/shard-manifest.d.cts +1 -1
  78. package/dist/domain/shard-manifest.d.mts +1 -1
  79. package/dist/domain/threshold-subject.cjs +2 -2
  80. package/dist/domain/threshold-subject.mjs +1 -1
  81. package/dist/domain/token-predicates.cjs +184 -0
  82. package/dist/domain/token-predicates.d.cts +2 -0
  83. package/dist/domain/token-predicates.d.mts +2 -0
  84. package/dist/domain/token-predicates.mjs +173 -0
  85. package/dist/{token-scope-CxHXTT3u.cjs → domain/token-scope.cjs} +3 -12
  86. package/dist/domain/token-scope.d.cts +11 -0
  87. package/dist/domain/token-scope.d.mts +11 -0
  88. package/dist/{token-scope-Z4bmci4M.mjs → domain/token-scope.mjs} +1 -1
  89. package/dist/domain/tokens.cjs +466 -9
  90. package/dist/domain/tokens.d.cts +131 -2
  91. package/dist/domain/tokens.d.mts +131 -2
  92. package/dist/domain/tokens.mjs +458 -1
  93. package/dist/domain/topology-snapshot.d.cts +1 -1
  94. package/dist/domain/topology-snapshot.d.mts +1 -1
  95. package/dist/domain/topology.d.cts +1 -1
  96. package/dist/domain/topology.d.mts +1 -1
  97. package/dist/domain/webrtc-signaling.cjs +2 -2
  98. package/dist/domain/webrtc-signaling.d.cts +2 -2
  99. package/dist/domain/webrtc-signaling.d.mts +2 -2
  100. package/dist/domain/webrtc-signaling.mjs +1 -1
  101. package/dist/generated/protocol.cjs +4 -2
  102. package/dist/generated/protocol.d.cts +1 -1
  103. package/dist/generated/protocol.d.mts +1 -1
  104. package/dist/generated/protocol.mjs +4 -2
  105. package/dist/{identity-DJbr96J3.d.cts → identity-B6nhlSOT.d.cts} +1 -1
  106. package/dist/{identity-ViYdZrIU.d.mts → identity-EV-HHv_D.d.mts} +1 -1
  107. package/dist/ports/identity.d.cts +1 -1
  108. package/dist/ports/identity.d.mts +1 -1
  109. package/dist/ports/transport.d.cts +1 -1
  110. package/dist/ports/transport.d.mts +1 -1
  111. package/dist/{protocol-BgR1e_NI.d.cts → protocol-DzmpxxUr.d.cts} +6 -0
  112. package/dist/{protocol-BgR1e_NI.d.mts → protocol-DzmpxxUr.d.mts} +6 -0
  113. package/dist/{room-token-verification-7zD4ib-A.d.mts → room-token-verification-Dh7SGJfK.d.cts} +2 -2
  114. package/dist/{room-token-verification-hFtBDZPO.d.cts → room-token-verification-Hb1LkpFh.d.mts} +2 -2
  115. package/dist/token-predicates-D4NNPLnp.d.cts +72 -0
  116. package/dist/token-predicates-DqpG8VZZ.d.mts +72 -0
  117. package/dist/{transport-Dv_LTCsF.d.mts → transport-bD3p_TO_.d.mts} +1 -1
  118. package/dist/{transport-DP3hdehk.d.cts → transport-gDbSHO-r.d.cts} +1 -1
  119. package/package.json +9 -1
  120. package/dist/tokens-BMWCnQEF.d.cts +0 -158
  121. package/dist/tokens-D8JlTJNA.mjs +0 -617
  122. package/dist/tokens-DRkm_QOR.d.mts +0 -158
  123. package/dist/tokens-tPJQ7Vzt.cjs +0 -664
@@ -1,5 +1,5 @@
1
- import { N as Frame } from "../protocol-BgR1e_NI.cjs";
2
- import { t as Connection } from "../transport-DP3hdehk.cjs";
1
+ import { N as Frame } from "../protocol-DzmpxxUr.cjs";
2
+ import { t as Connection } from "../transport-gDbSHO-r.cjs";
3
3
  //#region src/adapters/byte-stream-connection.d.ts
4
4
  /** The largest frame body a peer may announce in a length prefix, matching the 100 MiB the `ws` package applies to one message on the same hub, so a WebSocket peer and a byte-stream peer are bounded alike. Without a bound a peer-controlled 4 GiB prefix makes the reader buffer until memory runs out. */
5
5
  export declare const MAX_FRAME_BYTES: number;
@@ -1,5 +1,5 @@
1
- import { N as Frame } from "../protocol-BgR1e_NI.mjs";
2
- import { t as Connection } from "../transport-Dv_LTCsF.mjs";
1
+ import { N as Frame } from "../protocol-DzmpxxUr.mjs";
2
+ import { t as Connection } from "../transport-bD3p_TO_.mjs";
3
3
  //#region src/adapters/byte-stream-connection.d.ts
4
4
  /** The largest frame body a peer may announce in a length prefix, matching the 100 MiB the `ws` package applies to one message on the same hub, so a WebSocket peer and a byte-stream peer are bounded alike. Without a bound a peer-controlled 4 GiB prefix makes the reader buffer until memory runs out. */
5
5
  export declare const MAX_FRAME_BYTES: number;
@@ -1,4 +1,4 @@
1
- import { D as DeviceId, N as Frame, ht as RelayDataFrame } from "../protocol-BgR1e_NI.cjs";
1
+ import { D as DeviceId, N as Frame, ht as RelayDataFrame } from "../protocol-DzmpxxUr.cjs";
2
2
  //#region src/adapters/frame-codec.d.ts
3
3
  export declare function messageFromFrame(frame: Frame): Uint8Array<ArrayBuffer>;
4
4
  /** Wraps frame as a relay-data-frame's own opaque payload, stamping to-device when the caller knows which established pairing to address it to (wire-mesh#30) -- the outbound counterpart to tryDecodeFrame's own doc comment below, which describes the inbound side of the same relay-data envelope. Omitting toDevice leaves the frame unaddressed, which the receiving hub then routes via its own most-recently-established-pairing fallback. */
@@ -1,4 +1,4 @@
1
- import { D as DeviceId, N as Frame, ht as RelayDataFrame } from "../protocol-BgR1e_NI.mjs";
1
+ import { D as DeviceId, N as Frame, ht as RelayDataFrame } from "../protocol-DzmpxxUr.mjs";
2
2
  //#region src/adapters/frame-codec.d.ts
3
3
  export declare function messageFromFrame(frame: Frame): Uint8Array<ArrayBuffer>;
4
4
  /** Wraps frame as a relay-data-frame's own opaque payload, stamping to-device when the caller knows which established pairing to address it to (wire-mesh#30) -- the outbound counterpart to tryDecodeFrame's own doc comment below, which describes the inbound side of the same relay-data envelope. Omitting toDevice leaves the frame unaddressed, which the receiving hub then routes via its own most-recently-established-pairing fallback. */
@@ -1,5 +1,5 @@
1
- import { B as IdentityKey, D as DeviceId } from "../protocol-BgR1e_NI.cjs";
2
- import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
1
+ import { B as IdentityKey, D as DeviceId } from "../protocol-DzmpxxUr.cjs";
2
+ import { t as IdentityPort } from "../identity-B6nhlSOT.cjs";
3
3
  import { webcrypto } from "node:crypto";
4
4
  //#region src/adapters/node-identity.d.ts
5
5
  export declare function deriveDeviceId(publicKey: Uint8Array): Promise<DeviceId>;
@@ -1,5 +1,5 @@
1
- import { B as IdentityKey, D as DeviceId } from "../protocol-BgR1e_NI.mjs";
2
- import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
1
+ import { B as IdentityKey, D as DeviceId } from "../protocol-DzmpxxUr.mjs";
2
+ import { t as IdentityPort } from "../identity-EV-HHv_D.mjs";
3
3
  import { webcrypto } from "node:crypto";
4
4
  //#region src/adapters/node-identity.d.ts
5
5
  export declare function deriveDeviceId(publicKey: Uint8Array): Promise<DeviceId>;
@@ -1,4 +1,4 @@
1
- import { r as Transport } from "../transport-DP3hdehk.cjs";
1
+ import { r as Transport } from "../transport-gDbSHO-r.cjs";
2
2
  //#region src/adapters/tcp-transport.d.ts
3
3
  /** A Node net.Socket-based Transport: length-prefixed, CBOR-encoded frames over plain TCP -- matching Cascade's own transport shape, since interop with Cascade nodes is wire-mesh's stated goal. Framing (not TLS) is this adapter's own concern; a TLS-terminated variant is a separate adapter behind the same Transport contract. */
4
4
  export declare function createTcpTransport(): Transport;
@@ -1,4 +1,4 @@
1
- import { r as Transport } from "../transport-Dv_LTCsF.mjs";
1
+ import { r as Transport } from "../transport-bD3p_TO_.mjs";
2
2
  //#region src/adapters/tcp-transport.d.ts
3
3
  /** A Node net.Socket-based Transport: length-prefixed, CBOR-encoded frames over plain TCP -- matching Cascade's own transport shape, since interop with Cascade nodes is wire-mesh's stated goal. Framing (not TLS) is this adapter's own concern; a TLS-terminated variant is a separate adapter behind the same Transport contract. */
4
4
  export declare function createTcpTransport(): Transport;
@@ -1,5 +1,5 @@
1
- import { D as DeviceId } from "../protocol-BgR1e_NI.cjs";
2
- import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
1
+ import { D as DeviceId } from "../protocol-DzmpxxUr.cjs";
2
+ import { t as IdentityPort } from "../identity-B6nhlSOT.cjs";
3
3
  import { DeviceKeyed } from "./threshold-wasm.cjs";
4
4
  import { ThresholdSubject } from "../domain/threshold-subject.cjs";
5
5
  //#region src/adapters/threshold-identity.d.ts
@@ -1,5 +1,5 @@
1
- import { D as DeviceId } from "../protocol-BgR1e_NI.mjs";
2
- import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
1
+ import { D as DeviceId } from "../protocol-DzmpxxUr.mjs";
2
+ import { t as IdentityPort } from "../identity-EV-HHv_D.mjs";
3
3
  import { DeviceKeyed } from "./threshold-wasm.mjs";
4
4
  import { ThresholdSubject } from "../domain/threshold-subject.mjs";
5
5
  //#region src/adapters/threshold-identity.d.ts
@@ -1,4 +1,4 @@
1
- import { D as DeviceId } from "../protocol-BgR1e_NI.cjs";
1
+ import { D as DeviceId } from "../protocol-DzmpxxUr.cjs";
2
2
  //#region src/adapters/threshold-wasm.d.ts
3
3
  /** One `(deviceId, bytes)` pair -- the wasm boundary's own encoding of a map keyed by participant, since wasm-bindgen has no built-in `Map<Uint8Array, Uint8Array>` marshalling. */
4
4
  export interface DeviceKeyed<T extends Uint8Array = Uint8Array<ArrayBuffer>> {
@@ -1,4 +1,4 @@
1
- import { D as DeviceId } from "../protocol-BgR1e_NI.mjs";
1
+ import { D as DeviceId } from "../protocol-DzmpxxUr.mjs";
2
2
  //#region src/adapters/threshold-wasm.d.ts
3
3
  /** One `(deviceId, bytes)` pair -- the wasm boundary's own encoding of a map keyed by participant, since wasm-bindgen has no built-in `Map<Uint8Array, Uint8Array>` marshalling. */
4
4
  export interface DeviceKeyed<T extends Uint8Array = Uint8Array<ArrayBuffer>> {
@@ -1,4 +1,4 @@
1
- import { r as Transport } from "../transport-DP3hdehk.cjs";
1
+ import { r as Transport } from "../transport-gDbSHO-r.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-Dv_LTCsF.mjs";
1
+ import { r as Transport } from "../transport-bD3p_TO_.mjs";
2
2
  //#region src/adapters/tls-transport.d.ts
3
3
  export interface TlsIdentity {
4
4
  certificatePem: string;
@@ -1,4 +1,4 @@
1
- import { et as PeerAdvert } from "../protocol-BgR1e_NI.cjs";
1
+ import { et as PeerAdvert } from "../protocol-DzmpxxUr.cjs";
2
2
  //#region src/domain/advert-extension-policy.d.ts
3
3
  /** Whether one extension entry's value is one the hub will carry. Must be strict: a value with a field the validator did not expect is refused, since the point is that nothing unexpected is published. */
4
4
  export type ExtensionValidator = (value: unknown) => boolean;
@@ -1,4 +1,4 @@
1
- import { et as PeerAdvert } from "../protocol-BgR1e_NI.mjs";
1
+ import { et as PeerAdvert } from "../protocol-DzmpxxUr.mjs";
2
2
  //#region src/domain/advert-extension-policy.d.ts
3
3
  /** Whether one extension entry's value is one the hub will carry. Must be strict: a value with a field the validator did not expect is refused, since the point is that nothing unexpected is published. */
4
4
  export type ExtensionValidator = (value: unknown) => boolean;
@@ -1,5 +1,5 @@
1
- import { D as DeviceId, N as Frame, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-BgR1e_NI.cjs";
2
- import { t as Connection } from "../transport-DP3hdehk.cjs";
1
+ import { D as DeviceId, N as Frame, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DzmpxxUr.cjs";
2
+ import { t as Connection } from "../transport-gDbSHO-r.cjs";
3
3
  import { t as KeyValueStorage } from "../storage-B403CRyu.cjs";
4
4
  import { IncomingManageRequest, MeshSession } from "./mesh-session.cjs";
5
5
  //#region src/domain/bulk.d.ts
@@ -1,5 +1,5 @@
1
- import { D as DeviceId, N as Frame, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-BgR1e_NI.mjs";
2
- import { t as Connection } from "../transport-Dv_LTCsF.mjs";
1
+ import { D as DeviceId, N as Frame, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DzmpxxUr.mjs";
2
+ import { t as Connection } from "../transport-bD3p_TO_.mjs";
3
3
  import { t as KeyValueStorage } from "../storage-B403CRyu.mjs";
4
4
  import { IncomingManageRequest, MeshSession } from "./mesh-session.mjs";
5
5
  //#region src/domain/bulk.d.ts
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_generated_protocol = require("../generated/protocol.cjs");
3
- const require_token_scope = require("../token-scope-CxHXTT3u.cjs");
4
- const require_tokens = require("../tokens-tPJQ7Vzt.cjs");
3
+ const require_domain_token_scope = require("./token-scope.cjs");
4
+ const require_domain_tokens = require("./tokens.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.
@@ -49,7 +49,7 @@ function createCapabilityGrantHandler(options) {
49
49
  return;
50
50
  }
51
51
  const grantedToken = parsed.data["granted-token"];
52
- const verdict = await require_tokens.verifyCapabilityToken(grantedToken, {
52
+ const verdict = await require_domain_tokens.verifyCapabilityToken(grantedToken, {
53
53
  identity: options.identity,
54
54
  clock: options.clock,
55
55
  revocation: options.revocation,
@@ -69,7 +69,7 @@ function createCapabilityGrantHandler(options) {
69
69
  });
70
70
  return;
71
71
  }
72
- if (!require_token_scope.scopeNarrows(verdict.claims.scope, incoming.scope)) {
72
+ if (!require_domain_token_scope.scopeNarrows(verdict.claims.scope, incoming.scope)) {
73
73
  await incoming.respond({
74
74
  result: "error",
75
75
  code: "scope_mismatch"
@@ -1,8 +1,8 @@
1
- import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-BgR1e_NI.cjs";
2
- import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
1
+ import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DzmpxxUr.cjs";
2
+ import { t as IdentityPort } from "../identity-B6nhlSOT.cjs";
3
3
  import { t as Clock } from "../clock-DiSx-WKM.cjs";
4
4
  import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.cjs";
5
- import { o as RevocationCheck } from "../tokens-BMWCnQEF.cjs";
5
+ import { RevocationCheck } from "./tokens.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-BgR1e_NI.mjs";
2
- import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
1
+ import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DzmpxxUr.mjs";
2
+ import { t as IdentityPort } from "../identity-EV-HHv_D.mjs";
3
3
  import { t as Clock } from "../clock-DiSx-WKM.mjs";
4
4
  import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.mjs";
5
- import { o as RevocationCheck } from "../tokens-DRkm_QOR.mjs";
5
+ import { RevocationCheck } from "./tokens.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
- import { n as scopeNarrows } from "../token-scope-Z4bmci4M.mjs";
3
- import { s as verifyCapabilityToken } from "../tokens-D8JlTJNA.mjs";
2
+ import { scopeNarrows } from "./token-scope.mjs";
3
+ import { verifyCapabilityToken } from "./tokens.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,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_generated_protocol = require("../generated/protocol.cjs");
3
- const require_token_scope = require("../token-scope-CxHXTT3u.cjs");
4
- const require_tokens = require("../tokens-tPJQ7Vzt.cjs");
3
+ const require_domain_token_scope = require("./token-scope.cjs");
4
+ const require_domain_tokens = require("./tokens.cjs");
5
5
  //#region src/domain/capability-request.ts
6
6
  /**
7
7
  * 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.
@@ -31,6 +31,17 @@ function buildCapabilityRequestCommand(capability, validUntil) {
31
31
  }
32
32
  };
33
33
  }
34
+ /** A capability request the other side answered with a manage-error. The code is the receiver's own (`denied` for a human's no, `token_required`, `capability_mismatch` or `scope_mismatch` from the request-permission gate, or a verifier reason for a presented token it did not accept), kept as a field so a caller can tell a policy refusal from a person's decision without parsing the message. */
35
+ var CapabilityRequestRefusedError = class extends Error {
36
+ capability;
37
+ code;
38
+ constructor(capability, code) {
39
+ super(`capability request for "${capability}" was refused (${code})`);
40
+ this.name = "CapabilityRequestRefusedError";
41
+ this.capability = capability;
42
+ this.code = code;
43
+ }
44
+ };
34
45
  /**
35
46
  * Sends a deliberately ungated capability-request (no token field at all -- per management.cddl's own header comment, this primitive puts access control entirely in the receiving side's own decision, not a capability check on the request itself, the same design room.join already established). Resolves with the freshly granted capability-grant-ok on approval (its own open `* tstr => any` tail may carry domain-specific extension fields, e.g. core/room's member list -- a caller that needs those parses the raw result itself, the same way room-client.ts's own requestToJoin wrapper does); rejects on denial (an ordinary manage-error) or a malformed response.
36
47
  *
@@ -38,7 +49,7 @@ function buildCapabilityRequestCommand(capability, validUntil) {
38
49
  */
39
50
  async function requestCapability(session, capability, scope, targetDevice, timeoutMs, validUntil, requestToken) {
40
51
  const outcome = await session.sendManageRequest(buildCapabilityRequestCommand(capability, validUntil), scope, targetDevice, requestToken, timeoutMs);
41
- if (outcome.result !== "ok") throw new Error(`capability request for "${capability}" was refused (${outcome.code})`);
52
+ if (outcome.result !== "ok") throw new CapabilityRequestRefusedError(capability, outcome.code);
42
53
  const parsed = require_generated_protocol.capabilityGrantOkSchema.safeParse(outcome);
43
54
  if (!parsed.success) throw new Error(`capability request for "${capability}" response was malformed`);
44
55
  return parsed.data;
@@ -52,7 +63,7 @@ async function checkRequestPermission(incoming, options) {
52
63
  code: "token_required"
53
64
  };
54
65
  if (options.revocation === void 0) throw new Error("requireRequestToken needs a revocation view on the handler options");
55
- const verdict = await require_tokens.verifyCapabilityToken(incoming.token, {
66
+ const verdict = await require_domain_tokens.verifyCapabilityToken(incoming.token, {
56
67
  identity: options.identity,
57
68
  clock: options.clock,
58
69
  revocation: options.revocation,
@@ -72,7 +83,7 @@ async function checkRequestPermission(incoming, options) {
72
83
  ok: false,
73
84
  code: "capability_mismatch"
74
85
  };
75
- if (!require_token_scope.scopeNarrows(verdict.claims.scope, incoming.scope)) return {
86
+ if (!require_domain_token_scope.scopeNarrows(verdict.claims.scope, incoming.scope)) return {
76
87
  ok: false,
77
88
  code: "scope_mismatch"
78
89
  };
@@ -136,7 +147,7 @@ function createCapabilityRequestHandler(options) {
136
147
  });
137
148
  return;
138
149
  }
139
- const verdict = await require_tokens.mintCapabilityToken({
150
+ const verdict = await require_domain_tokens.mintCapabilityToken({
140
151
  identity: options.identity,
141
152
  clock: options.clock,
142
153
  tokenId: randomTokenId(),
@@ -164,6 +175,7 @@ function createCapabilityRequestHandler(options) {
164
175
  };
165
176
  }
166
177
  //#endregion
178
+ exports.CapabilityRequestRefusedError = CapabilityRequestRefusedError;
167
179
  exports.MANAGE_REQUEST_CAPABILITY = MANAGE_REQUEST_CAPABILITY;
168
180
  exports.buildCapabilityRequestCommand = buildCapabilityRequestCommand;
169
181
  exports.createCapabilityRequestHandler = createCapabilityRequestHandler;
@@ -1,13 +1,20 @@
1
- import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken, u as CapabilityGrantOk } from "../protocol-BgR1e_NI.cjs";
2
- import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
1
+ import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken, u as CapabilityGrantOk } from "../protocol-DzmpxxUr.cjs";
2
+ import { t as IdentityPort } from "../identity-B6nhlSOT.cjs";
3
3
  import { t as Clock } from "../clock-DiSx-WKM.cjs";
4
4
  import { IncomingManageRequest, MeshSession } from "./mesh-session.cjs";
5
- import { b as ConditionsContext, o as RevocationCheck, x as TokenDelegateHandler } from "../tokens-BMWCnQEF.cjs";
5
+ import { m as TokenDelegateHandler, r as ConditionsContext } from "../token-predicates-D4NNPLnp.cjs";
6
+ import { RevocationCheck } from "./tokens.cjs";
6
7
  //#region src/domain/capability-request.d.ts
7
8
  /**
8
9
  * Builds a capability-request command per management.cddl. The outer `manage-command.verb` is the capability string itself -- the same value as this map's own `params.capability` field -- never a generic literal: capability-verb's own CDDL grammar is a closed alternation of colon-delimited `domain:noun` regexes (spec/tokens.cddl), so a bare literal like "capability" could never satisfy it, and routing by capability (the same way room.send/room.join already share the ROOM_MEMBER_CAPABILITY outer verb) is how a receiver's own per-capability handler knows which grant this ask is even for. `params.verb` is the fixed "capability.request" marker that distinguishes this ask from any other verb sharing the same outer capability (mirroring room.send/room.join's own inner `params.verb` split under one shared outer verb). `valid-until`, when given, bounds how long this ask is worth granting (wire-mesh#82) -- a receiver refuses outright once its own clock has passed it, rather than presenting a stale ask to a human for approval.
9
10
  */
10
11
  export declare function buildCapabilityRequestCommand(capability: string, validUntil?: number): ManageCommand;
12
+ /** A capability request the other side answered with a manage-error. The code is the receiver's own (`denied` for a human's no, `token_required`, `capability_mismatch` or `scope_mismatch` from the request-permission gate, or a verifier reason for a presented token it did not accept), kept as a field so a caller can tell a policy refusal from a person's decision without parsing the message. */
13
+ export declare class CapabilityRequestRefusedError extends Error {
14
+ readonly capability: string;
15
+ readonly code: string;
16
+ constructor(capability: string, code: string);
17
+ }
11
18
  /**
12
19
  * Sends a deliberately ungated capability-request (no token field at all -- per management.cddl's own header comment, this primitive puts access control entirely in the receiving side's own decision, not a capability check on the request itself, the same design room.join already established). Resolves with the freshly granted capability-grant-ok on approval (its own open `* tstr => any` tail may carry domain-specific extension fields, e.g. core/room's member list -- a caller that needs those parses the raw result itself, the same way room-client.ts's own requestToJoin wrapper does); rejects on denial (an ordinary manage-error) or a malformed response.
13
20
  *
@@ -1,13 +1,20 @@
1
- import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken, u as CapabilityGrantOk } from "../protocol-BgR1e_NI.mjs";
2
- import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
1
+ import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken, u as CapabilityGrantOk } from "../protocol-DzmpxxUr.mjs";
2
+ import { t as IdentityPort } from "../identity-EV-HHv_D.mjs";
3
3
  import { t as Clock } from "../clock-DiSx-WKM.mjs";
4
4
  import { IncomingManageRequest, MeshSession } from "./mesh-session.mjs";
5
- import { b as ConditionsContext, o as RevocationCheck, x as TokenDelegateHandler } from "../tokens-DRkm_QOR.mjs";
5
+ import { m as TokenDelegateHandler, r as ConditionsContext } from "../token-predicates-DqpG8VZZ.mjs";
6
+ import { RevocationCheck } from "./tokens.mjs";
6
7
  //#region src/domain/capability-request.d.ts
7
8
  /**
8
9
  * Builds a capability-request command per management.cddl. The outer `manage-command.verb` is the capability string itself -- the same value as this map's own `params.capability` field -- never a generic literal: capability-verb's own CDDL grammar is a closed alternation of colon-delimited `domain:noun` regexes (spec/tokens.cddl), so a bare literal like "capability" could never satisfy it, and routing by capability (the same way room.send/room.join already share the ROOM_MEMBER_CAPABILITY outer verb) is how a receiver's own per-capability handler knows which grant this ask is even for. `params.verb` is the fixed "capability.request" marker that distinguishes this ask from any other verb sharing the same outer capability (mirroring room.send/room.join's own inner `params.verb` split under one shared outer verb). `valid-until`, when given, bounds how long this ask is worth granting (wire-mesh#82) -- a receiver refuses outright once its own clock has passed it, rather than presenting a stale ask to a human for approval.
9
10
  */
10
11
  export declare function buildCapabilityRequestCommand(capability: string, validUntil?: number): ManageCommand;
12
+ /** A capability request the other side answered with a manage-error. The code is the receiver's own (`denied` for a human's no, `token_required`, `capability_mismatch` or `scope_mismatch` from the request-permission gate, or a verifier reason for a presented token it did not accept), kept as a field so a caller can tell a policy refusal from a person's decision without parsing the message. */
13
+ export declare class CapabilityRequestRefusedError extends Error {
14
+ readonly capability: string;
15
+ readonly code: string;
16
+ constructor(capability: string, code: string);
17
+ }
11
18
  /**
12
19
  * Sends a deliberately ungated capability-request (no token field at all -- per management.cddl's own header comment, this primitive puts access control entirely in the receiving side's own decision, not a capability check on the request itself, the same design room.join already established). Resolves with the freshly granted capability-grant-ok on approval (its own open `* tstr => any` tail may carry domain-specific extension fields, e.g. core/room's member list -- a caller that needs those parses the raw result itself, the same way room-client.ts's own requestToJoin wrapper does); rejects on denial (an ordinary manage-error) or a malformed response.
13
20
  *
@@ -1,6 +1,6 @@
1
1
  import { capabilityGrantOkSchema, capabilityRequestSchema } from "../generated/protocol.mjs";
2
- import { n as scopeNarrows } from "../token-scope-Z4bmci4M.mjs";
3
- import { i as mintCapabilityToken, s as verifyCapabilityToken } from "../tokens-D8JlTJNA.mjs";
2
+ import { scopeNarrows } from "./token-scope.mjs";
3
+ import { mintCapabilityToken, verifyCapabilityToken } from "./tokens.mjs";
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.
@@ -30,6 +30,17 @@ function buildCapabilityRequestCommand(capability, validUntil) {
30
30
  }
31
31
  };
32
32
  }
33
+ /** A capability request the other side answered with a manage-error. The code is the receiver's own (`denied` for a human's no, `token_required`, `capability_mismatch` or `scope_mismatch` from the request-permission gate, or a verifier reason for a presented token it did not accept), kept as a field so a caller can tell a policy refusal from a person's decision without parsing the message. */
34
+ var CapabilityRequestRefusedError = class extends Error {
35
+ capability;
36
+ code;
37
+ constructor(capability, code) {
38
+ super(`capability request for "${capability}" was refused (${code})`);
39
+ this.name = "CapabilityRequestRefusedError";
40
+ this.capability = capability;
41
+ this.code = code;
42
+ }
43
+ };
33
44
  /**
34
45
  * Sends a deliberately ungated capability-request (no token field at all -- per management.cddl's own header comment, this primitive puts access control entirely in the receiving side's own decision, not a capability check on the request itself, the same design room.join already established). Resolves with the freshly granted capability-grant-ok on approval (its own open `* tstr => any` tail may carry domain-specific extension fields, e.g. core/room's member list -- a caller that needs those parses the raw result itself, the same way room-client.ts's own requestToJoin wrapper does); rejects on denial (an ordinary manage-error) or a malformed response.
35
46
  *
@@ -37,7 +48,7 @@ function buildCapabilityRequestCommand(capability, validUntil) {
37
48
  */
38
49
  async function requestCapability(session, capability, scope, targetDevice, timeoutMs, validUntil, requestToken) {
39
50
  const outcome = await session.sendManageRequest(buildCapabilityRequestCommand(capability, validUntil), scope, targetDevice, requestToken, timeoutMs);
40
- if (outcome.result !== "ok") throw new Error(`capability request for "${capability}" was refused (${outcome.code})`);
51
+ if (outcome.result !== "ok") throw new CapabilityRequestRefusedError(capability, outcome.code);
41
52
  const parsed = capabilityGrantOkSchema.safeParse(outcome);
42
53
  if (!parsed.success) throw new Error(`capability request for "${capability}" response was malformed`);
43
54
  return parsed.data;
@@ -163,4 +174,4 @@ function createCapabilityRequestHandler(options) {
163
174
  };
164
175
  }
165
176
  //#endregion
166
- export { MANAGE_REQUEST_CAPABILITY, buildCapabilityRequestCommand, createCapabilityRequestHandler, requestCapability };
177
+ export { CapabilityRequestRefusedError, MANAGE_REQUEST_CAPABILITY, buildCapabilityRequestCommand, createCapabilityRequestHandler, requestCapability };
@@ -1,4 +1,4 @@
1
- import { D as DeviceId, g as CoordinatorFrame } from "../protocol-BgR1e_NI.cjs";
1
+ import { D as DeviceId, g as CoordinatorFrame } from "../protocol-DzmpxxUr.cjs";
2
2
  //#region src/domain/coordinator-election.d.ts
3
3
  /** The claim this side currently accepts: one coordinator, at the term that put it there. */
4
4
  export interface CoordinatorClaim {
@@ -1,4 +1,4 @@
1
- import { D as DeviceId, g as CoordinatorFrame } from "../protocol-BgR1e_NI.mjs";
1
+ import { D as DeviceId, g as CoordinatorFrame } from "../protocol-DzmpxxUr.mjs";
2
2
  //#region src/domain/coordinator-election.d.ts
3
3
  /** The claim this side currently accepts: one coordinator, at the term that put it there. */
4
4
  export interface CoordinatorClaim {
@@ -1,6 +1,6 @@
1
- import { D as DeviceId, E as DataRequestFrame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-BgR1e_NI.cjs";
1
+ import { D as DeviceId, E as DataRequestFrame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-DzmpxxUr.cjs";
2
2
  import { t as KeyValueStorage } from "../storage-B403CRyu.cjs";
3
- import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
3
+ import { t as IdentityPort } from "../identity-B6nhlSOT.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-BgR1e_NI.mjs";
1
+ import { D as DeviceId, E as DataRequestFrame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-DzmpxxUr.mjs";
2
2
  import { t as KeyValueStorage } from "../storage-B403CRyu.mjs";
3
- import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
3
+ import { t as IdentityPort } from "../identity-EV-HHv_D.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-BgR1e_NI.cjs";
1
+ import { D as DeviceId } from "../protocol-DzmpxxUr.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-BgR1e_NI.mjs";
1
+ import { D as DeviceId } from "../protocol-DzmpxxUr.mjs";
2
2
  //#region src/domain/device-id.d.ts
3
3
  /** Lowercase, byte-exact hex for an arbitrary-length byte string -- the same encoding convention deviceIdToHex uses for the fixed-length device-id case, extracted so any other byte string needing a stable, displayable, map-keyable text form (e.g. a token-id, which tokens.cddl defines as an arbitrary-length bstr rather than a 32-byte device-id) can use the identical convention without going through a device-id-shaped function. */
4
4
  export declare function bytesToHex(bytes: Uint8Array): string;
@@ -1,5 +1,5 @@
1
- import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-BgR1e_NI.cjs";
2
- import { r as Transport, t as Connection } from "../transport-DP3hdehk.cjs";
1
+ import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DzmpxxUr.cjs";
2
+ import { r as Transport, t as Connection } from "../transport-gDbSHO-r.cjs";
3
3
  import { IncomingManageRequest, ManageOutcome } from "./mesh-session.cjs";
4
4
  //#region src/domain/direct-manage-request.d.ts
5
5
  /** Reads exactly one frame off a freshly-accepted, bare connection and, if it's a manage-request, returns an IncomingManageRequest ready to hand to the same application-level dispatch logic session.incomingManageRequests already feeds elsewhere -- no handshake or gossip is ever read or sent on this connection (wire-mesh#38: the manage-request/manage-response exchange has no dependency on handshake state at the dispatch layer, confirmed against mesh-session.ts's own applyManageRequest/applyFrame). respond() sends the manage-response directly and closes the connection, since a one-off request/response is this connection's entire purpose -- unlike a real MeshSession, there is nothing further to do with it afterwards. Resolves null, without closing the connection (that's the caller's call), for any other first frame or if the connection ends before one arrives: interpreting either case is a Transport.listen() caller's own business, e.g. peeking the first frame to route between this path and acceptMeshSession's own handshake path. */
@@ -1,5 +1,5 @@
1
- import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-BgR1e_NI.mjs";
2
- import { r as Transport, t as Connection } from "../transport-Dv_LTCsF.mjs";
1
+ import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-DzmpxxUr.mjs";
2
+ import { r as Transport, t as Connection } from "../transport-bD3p_TO_.mjs";
3
3
  import { IncomingManageRequest, ManageOutcome } from "./mesh-session.mjs";
4
4
  //#region src/domain/direct-manage-request.d.ts
5
5
  /** Reads exactly one frame off a freshly-accepted, bare connection and, if it's a manage-request, returns an IncomingManageRequest ready to hand to the same application-level dispatch logic session.incomingManageRequests already feeds elsewhere -- no handshake or gossip is ever read or sent on this connection (wire-mesh#38: the manage-request/manage-response exchange has no dependency on handshake state at the dispatch layer, confirmed against mesh-session.ts's own applyManageRequest/applyFrame). respond() sends the manage-response directly and closes the connection, since a one-off request/response is this connection's entire purpose -- unlike a real MeshSession, there is nothing further to do with it afterwards. Resolves null, without closing the connection (that's the caller's call), for any other first frame or if the connection ends before one arrives: interpreting either case is a Transport.listen() caller's own business, e.g. peeking the first frame to route between this path and acceptMeshSession's own handshake path. */
@@ -1,4 +1,4 @@
1
- import { D as DeviceId, et as PeerAdvert } from "../protocol-BgR1e_NI.cjs";
1
+ import { D as DeviceId, et as PeerAdvert } from "../protocol-DzmpxxUr.cjs";
2
2
  import { MeshSession } from "./mesh-session.cjs";
3
3
  //#region src/domain/gossip-expansion.d.ts
4
4
  /** One not-yet-considered device this session's gossip directory has surfaced, carrying only what a dial/trust decision needs: the device-id to decide identity, and the "host:port" addresses its own peer-advert claims are directly reachable at, in the order it advertised them. */
@@ -1,4 +1,4 @@
1
- import { D as DeviceId, et as PeerAdvert } from "../protocol-BgR1e_NI.mjs";
1
+ import { D as DeviceId, et as PeerAdvert } from "../protocol-DzmpxxUr.mjs";
2
2
  import { MeshSession } from "./mesh-session.mjs";
3
3
  //#region src/domain/gossip-expansion.d.ts
4
4
  /** One not-yet-considered device this session's gossip directory has surfaced, carrying only what a dial/trust decision needs: the device-id to decide identity, and the "host:port" addresses its own peer-advert claims are directly reachable at, in the order it advertised them. */
@@ -1,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_token_scope = require("../token-scope-CxHXTT3u.cjs");
3
+ const require_domain_token_scope = require("./token-scope.cjs");
4
4
  let zod = require("zod");
5
5
  //#region src/domain/grant-candidates.ts
6
6
  /**
@@ -38,7 +38,7 @@ function findGrantCandidate(directory, capability, scope) {
38
38
  if (candidate.capability !== capability) continue;
39
39
  const remaining = candidate["delegations-remaining"];
40
40
  if (remaining !== void 0 && remaining <= 0) continue;
41
- if (require_token_scope.scopeNarrows(candidate.scope, scope)) return entry.device;
41
+ if (require_domain_token_scope.scopeNarrows(candidate.scope, scope)) return entry.device;
42
42
  }
43
43
  }
44
44
  }
@@ -1,4 +1,4 @@
1
- import { D as DeviceId, f as CapabilityScope } from "../protocol-BgR1e_NI.cjs";
1
+ import { D as DeviceId, f as CapabilityScope } from "../protocol-DzmpxxUr.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-BgR1e_NI.mjs";
1
+ import { D as DeviceId, f as CapabilityScope } from "../protocol-DzmpxxUr.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,5 +1,5 @@
1
1
  import { capabilityScopeSchema } from "../generated/protocol.mjs";
2
- import { n as scopeNarrows } from "../token-scope-Z4bmci4M.mjs";
2
+ import { scopeNarrows } from "./token-scope.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/domain/grant-candidates.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-BgR1e_NI.cjs";
1
+ import { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-DzmpxxUr.cjs";
2
2
  //#region src/domain/handshake.d.ts
3
3
  /** The highest protocol version this build of core understands. */
4
4
  export declare const SUPPORTED_PROTOCOL_VERSION: ProtocolVersion;
@@ -1,4 +1,4 @@
1
- import { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-BgR1e_NI.mjs";
1
+ import { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-DzmpxxUr.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,4 +1,4 @@
1
- import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-BgR1e_NI.cjs";
1
+ import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-DzmpxxUr.cjs";
2
2
  import { t as KeyValueStorage } from "../storage-B403CRyu.cjs";
3
3
  //#region src/domain/hub-mailbox.d.ts
4
4
  export interface MailboxLimits {
@@ -1,4 +1,4 @@
1
- import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-BgR1e_NI.mjs";
1
+ import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-DzmpxxUr.mjs";
2
2
  import { t as KeyValueStorage } from "../storage-B403CRyu.mjs";
3
3
  //#region src/domain/hub-mailbox.d.ts
4
4
  export interface MailboxLimits {
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_adapters_frame_codec = require("../adapters/frame-codec.cjs");
3
3
  const require_domain_device_id = require("./device-id.cjs");
4
- const require_token_scope = require("../token-scope-CxHXTT3u.cjs");
4
+ const require_domain_token_scope = require("./token-scope.cjs");
5
5
  const require_gossip_extensions = require("../gossip-extensions-BBYgMZ2N.cjs");
6
6
  const require_domain_peer_advert = require("./peer-advert.cjs");
7
7
  const require_domain_async_queue = require("./async-queue.cjs");
@@ -101,7 +101,7 @@ async function verifyHello(identity, hello) {
101
101
  const key = hello["identity-key"];
102
102
  try {
103
103
  const sender = await identity.deriveDeviceId(key["public-key"]);
104
- if (!require_token_scope.bytesEqual(hello["to-device"], identity.deviceId)) return {
104
+ if (!require_domain_token_scope.bytesEqual(hello["to-device"], identity.deviceId)) return {
105
105
  ok: false,
106
106
  reason: "wrong_recipient"
107
107
  };
@@ -1,6 +1,6 @@
1
- import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, bt as RevocationEntry, et as PeerAdvert, f as CapabilityScope, g as CoordinatorFrame, lt as ProtocolVersion, nn as TopologyPeers, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-BgR1e_NI.cjs";
2
- import { r as Transport, t as Connection } from "../transport-DP3hdehk.cjs";
3
- import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
1
+ import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, bt as RevocationEntry, et as PeerAdvert, f as CapabilityScope, g as CoordinatorFrame, lt as ProtocolVersion, nn as TopologyPeers, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-DzmpxxUr.cjs";
2
+ import { r as Transport, t as Connection } from "../transport-gDbSHO-r.cjs";
3
+ import { t as IdentityPort } from "../identity-B6nhlSOT.cjs";
4
4
  import { t as Clock } from "../clock-DiSx-WKM.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. */
@@ -1,6 +1,6 @@
1
- import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, bt as RevocationEntry, et as PeerAdvert, f as CapabilityScope, g as CoordinatorFrame, lt as ProtocolVersion, nn as TopologyPeers, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-BgR1e_NI.mjs";
2
- import { r as Transport, t as Connection } from "../transport-Dv_LTCsF.mjs";
3
- import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
1
+ import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, bt as RevocationEntry, et as PeerAdvert, f as CapabilityScope, g as CoordinatorFrame, lt as ProtocolVersion, nn as TopologyPeers, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-DzmpxxUr.mjs";
2
+ import { r as Transport, t as Connection } from "../transport-bD3p_TO_.mjs";
3
+ import { t as IdentityPort } from "../identity-EV-HHv_D.mjs";
4
4
  import { t as Clock } from "../clock-DiSx-WKM.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. */