wire-mesh-core 1.14.0 → 1.16.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 (51) hide show
  1. package/dist/adapters/frame-codec.d.cts +1 -1
  2. package/dist/adapters/frame-codec.d.mts +1 -1
  3. package/dist/adapters/node-identity.d.cts +2 -2
  4. package/dist/adapters/node-identity.d.mts +2 -2
  5. package/dist/adapters/tcp-transport.d.cts +1 -1
  6. package/dist/adapters/tcp-transport.d.mts +1 -1
  7. package/dist/adapters/tls-transport.d.cts +1 -1
  8. package/dist/adapters/tls-transport.d.mts +1 -1
  9. package/dist/domain/capability-grant.cjs +90 -0
  10. package/dist/domain/capability-grant.d.cts +44 -0
  11. package/dist/domain/capability-grant.d.mts +44 -0
  12. package/dist/domain/capability-grant.mjs +87 -0
  13. package/dist/domain/capability-request.cjs +118 -0
  14. package/dist/domain/capability-request.d.cts +56 -0
  15. package/dist/domain/capability-request.d.mts +56 -0
  16. package/dist/domain/capability-request.mjs +115 -0
  17. package/dist/domain/device-id.d.cts +1 -1
  18. package/dist/domain/device-id.d.mts +1 -1
  19. package/dist/domain/handshake.d.cts +1 -1
  20. package/dist/domain/handshake.d.mts +1 -1
  21. package/dist/domain/mesh-session.d.cts +3 -3
  22. package/dist/domain/mesh-session.d.mts +3 -3
  23. package/dist/domain/relay-hub.d.cts +1 -1
  24. package/dist/domain/relay-hub.d.mts +1 -1
  25. package/dist/domain/revocation-view.cjs +1 -1
  26. package/dist/domain/revocation-view.d.cts +1 -1
  27. package/dist/domain/revocation-view.d.mts +1 -1
  28. package/dist/domain/revocation-view.mjs +1 -1
  29. package/dist/domain/room-token-verification.cjs +1 -1
  30. package/dist/domain/room-token-verification.d.cts +1 -1
  31. package/dist/domain/room-token-verification.d.mts +1 -1
  32. package/dist/domain/room-token-verification.mjs +1 -1
  33. package/dist/domain/tokens.cjs +2 -1
  34. package/dist/domain/tokens.d.cts +6 -2
  35. package/dist/domain/tokens.d.mts +6 -2
  36. package/dist/domain/tokens.mjs +2 -2
  37. package/dist/generated/protocol.cjs +6 -0
  38. package/dist/generated/protocol.d.cts +2 -2
  39. package/dist/generated/protocol.d.mts +2 -2
  40. package/dist/generated/protocol.mjs +6 -1
  41. package/dist/{identity-D8iJZRZZ.d.mts → identity-B1hBV3YA.d.mts} +1 -1
  42. package/dist/{identity-DkEe1465.d.cts → identity-BldV8xFj.d.cts} +1 -1
  43. package/dist/ports/identity.d.cts +1 -1
  44. package/dist/ports/identity.d.mts +1 -1
  45. package/dist/ports/transport.d.cts +2 -29
  46. package/dist/ports/transport.d.mts +2 -29
  47. package/dist/{protocol-MnxTzpRP.d.cts → protocol-Dhswk7YD.d.cts} +39 -1
  48. package/dist/{protocol-MnxTzpRP.d.mts → protocol-Dhswk7YD.d.mts} +39 -1
  49. package/dist/transport-BNNdUBq-.d.mts +30 -0
  50. package/dist/transport-hEUxrdhT.d.cts +30 -0
  51. package/package.json +9 -1
@@ -0,0 +1,115 @@
1
+ import { capabilityGrantOkSchema, capabilityRequestSchema } from "../generated/protocol.mjs";
2
+ import { mintCapabilityToken } from "./tokens.mjs";
3
+ //#region src/domain/capability-request.ts
4
+ /**
5
+ * The generic, capability-agnostic capability-request / capability-grant-ok primitive (wire-mesh#78, spec/management.cddl). Lifts core/room's own room.join shape -- an ungated ask, held open, a human (or any other domain-supplied decision) accepts or refuses, acceptance mints and returns a token on the same response -- out of that one domain so any capability can reuse it, not just room:member. core/room's own room-client.ts is the reference consumer: it rewires requestToJoin/createRoomRouter's room.join handling onto requestCapability/createCapabilityRequestHandler below, supplying room-specific extension fields (its member list) through this module's own extensions mechanism rather than this module knowing anything about rooms.
6
+ *
7
+ * Two responsibilities live here, split the same way tokens.ts and room-token-verification.ts already split verification concerns: requestCapability is the asking side (a thin wrapper over MeshSession.sendManageRequest, parsing the grant response), and createCapabilityRequestHandler is the receiving side (validates the incoming ask, arms a receiver-side timeout so an unanswered request never hangs a requester forever, and hands the decision to the domain).
8
+ */
9
+ const TOKEN_ID_BYTE_LENGTH = 16;
10
+ function randomTokenId() {
11
+ const bytes = new Uint8Array(TOKEN_ID_BYTE_LENGTH);
12
+ crypto.getRandomValues(bytes);
13
+ return bytes;
14
+ }
15
+ /**
16
+ * 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.
17
+ */
18
+ function buildCapabilityRequestCommand(capability, validUntil) {
19
+ return {
20
+ verb: capability,
21
+ params: {
22
+ verb: "capability.request",
23
+ capability,
24
+ ...validUntil !== void 0 ? { "valid-until": validUntil } : {}
25
+ }
26
+ };
27
+ }
28
+ /**
29
+ * 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.
30
+ *
31
+ * targetDevice and timeoutMs forward directly to MeshSession.sendManageRequest's own identically-named parameters (relay routing and a requester-side give-up bound respectively -- wire-mesh#80 is already implemented there, not duplicated here). validUntil, when given, is attached to the request itself (wire-mesh#82) so a slow-to-answer receiver -- or a relay/facilitator forwarding this request on the caller's behalf -- can refuse or drop a now-stale ask outright rather than holding or forwarding it.
32
+ */
33
+ async function requestCapability(session, capability, scope, targetDevice, timeoutMs, validUntil) {
34
+ const outcome = await session.sendManageRequest(buildCapabilityRequestCommand(capability, validUntil), scope, targetDevice, void 0, timeoutMs);
35
+ if (outcome.result !== "ok") throw new Error(`capability request for "${capability}" was refused (${outcome.code})`);
36
+ const parsed = capabilityGrantOkSchema.safeParse(outcome);
37
+ if (!parsed.success) throw new Error(`capability request for "${capability}" response was malformed`);
38
+ return parsed.data;
39
+ }
40
+ /**
41
+ * Builds a reusable handler for one capability's incoming capability-requests. The returned function is the generic counterpart to room-client.ts's own (now capability-specific) handleRoomJoin: given one IncomingManageRequest, it refuses a request for the wrong capability or a malformed payload as `{result:"error", code:"malformed"}`, refuses an already-expired request (per its own `valid-until`, wire-mesh#82) as `{result:"error", code:"expired"}` without ever invoking onRequest, otherwise arms the receiver-side timeout described on CreateCapabilityRequestHandlerOptions.timeoutMs and calls onRequest so the domain can accept (minting a fresh token via mintCapabilityToken and responding `{result:"ok", "granted-token": token, ...extensions}`) or reject (an ordinary manage-error) via the event's own decide().
42
+ */
43
+ function createCapabilityRequestHandler(options) {
44
+ return async function handleCapabilityRequest(incoming) {
45
+ const parsed = capabilityRequestSchema.safeParse(incoming.command.params);
46
+ if (!parsed.success || parsed.data.capability !== options.capability) {
47
+ await incoming.respond({
48
+ result: "error",
49
+ code: "malformed"
50
+ });
51
+ return;
52
+ }
53
+ const validUntil = parsed.data["valid-until"];
54
+ if (validUntil !== void 0 && validUntil <= options.clock.now()) {
55
+ await incoming.respond({
56
+ result: "error",
57
+ code: "expired"
58
+ });
59
+ return;
60
+ }
61
+ let settled = false;
62
+ const timeoutHandle = setTimeout(() => {
63
+ if (settled) return;
64
+ settled = true;
65
+ incoming.respond({
66
+ result: "error",
67
+ code: "timeout",
68
+ message: "no decision within the capability-request timeout"
69
+ }).catch(() => void 0);
70
+ }, options.timeoutMs);
71
+ timeoutHandle.unref();
72
+ options.onRequest({
73
+ scope: incoming.scope,
74
+ requesterDevice: options.bearerDevice,
75
+ async decide(decision) {
76
+ if (settled) return;
77
+ settled = true;
78
+ clearTimeout(timeoutHandle);
79
+ if (decision.kind === "reject") {
80
+ await incoming.respond({
81
+ result: "error",
82
+ code: "denied",
83
+ ...decision.reason !== void 0 ? { message: decision.reason } : {}
84
+ });
85
+ return;
86
+ }
87
+ const verdict = await mintCapabilityToken({
88
+ identity: options.identity,
89
+ clock: options.clock,
90
+ tokenId: randomTokenId(),
91
+ bearer: options.bearerDevice,
92
+ capability: decision.capability,
93
+ scope: incoming.scope,
94
+ expires: decision.expires,
95
+ ...decision.delegationsRemaining !== void 0 ? { delegationsRemaining: decision.delegationsRemaining } : {}
96
+ });
97
+ if (!verdict.ok) {
98
+ await incoming.respond({
99
+ result: "error",
100
+ code: "mint_failed"
101
+ });
102
+ return;
103
+ }
104
+ const grantedToken = verdict.token;
105
+ await incoming.respond({
106
+ result: "ok",
107
+ "granted-token": grantedToken,
108
+ ...decision.extensions ?? {}
109
+ });
110
+ }
111
+ });
112
+ };
113
+ }
114
+ //#endregion
115
+ export { buildCapabilityRequestCommand, createCapabilityRequestHandler, requestCapability };
@@ -1,4 +1,4 @@
1
- import { b as DeviceId } from "../protocol-MnxTzpRP.cjs";
1
+ import { x as DeviceId } from "../protocol-Dhswk7YD.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 { b as DeviceId } from "../protocol-MnxTzpRP.mjs";
1
+ import { x as DeviceId } from "../protocol-Dhswk7YD.mjs";
2
2
  //#region src/domain/device-id.d.ts
3
3
  /** Lowercase, byte-exact hex for an arbitrary-length byte string -- the same encoding convention deviceIdToHex uses for the fixed-length device-id case, extracted so any other byte string needing a stable, displayable, map-keyable text form (e.g. a token-id, which tokens.cddl defines as an arbitrary-length bstr rather than a 32-byte device-id) can use the identical convention without going through a device-id-shaped function. */
4
4
  export declare function bytesToHex(bytes: Uint8Array): string;
@@ -1,4 +1,4 @@
1
- import { $ as ProtocolVersion, C as DomainId, j as HandshakeFrame } from "../protocol-MnxTzpRP.cjs";
1
+ import { M as HandshakeFrame, et as ProtocolVersion, w as DomainId } from "../protocol-Dhswk7YD.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 { $ as ProtocolVersion, C as DomainId, j as HandshakeFrame } from "../protocol-MnxTzpRP.mjs";
1
+ import { M as HandshakeFrame, et as ProtocolVersion, w as DomainId } from "../protocol-Dhswk7YD.mjs";
2
2
  //#region src/domain/handshake.d.ts
3
3
  /** The highest protocol version this build of core understands. */
4
4
  export declare const SUPPORTED_PROTOCOL_VERSION: ProtocolVersion;
@@ -1,7 +1,7 @@
1
- import { $ as ProtocolVersion, E as Frame, G as PeerAdvert, I as ManageError, L as ManageOk, P as ManageCommand, a as CapabilityScope, b as DeviceId, o as CapabilityToken, ut as RevocationEntry } from "../protocol-MnxTzpRP.cjs";
2
- import { t as IdentityPort } from "../identity-DkEe1465.cjs";
1
+ import { D as Frame, F as ManageCommand, K as PeerAdvert, L as ManageError, R as ManageOk, dt as RevocationEntry, et as ProtocolVersion, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-Dhswk7YD.cjs";
2
+ import { t as IdentityPort } from "../identity-BldV8xFj.cjs";
3
3
  import { t as Clock } from "../clock-DiSx-WKM.cjs";
4
- import { Connection, Transport } from "../ports/transport.cjs";
4
+ import { r as Transport, t as Connection } from "../transport-hEUxrdhT.cjs";
5
5
  //#region src/domain/mesh-session.d.ts
6
6
  /** How long to wait for the node's handshake before calling it unanswered. A relay-only node never sends one; that is a state to display, not an error. */
7
7
  export declare const HANDSHAKE_TIMEOUT_MS = 3000;
@@ -1,7 +1,7 @@
1
- import { $ as ProtocolVersion, E as Frame, G as PeerAdvert, I as ManageError, L as ManageOk, P as ManageCommand, a as CapabilityScope, b as DeviceId, o as CapabilityToken, ut as RevocationEntry } from "../protocol-MnxTzpRP.mjs";
2
- import { t as IdentityPort } from "../identity-D8iJZRZZ.mjs";
1
+ import { D as Frame, F as ManageCommand, K as PeerAdvert, L as ManageError, R as ManageOk, dt as RevocationEntry, et as ProtocolVersion, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-Dhswk7YD.mjs";
2
+ import { t as IdentityPort } from "../identity-B1hBV3YA.mjs";
3
3
  import { t as Clock } from "../clock-DiSx-WKM.mjs";
4
- import { Connection, Transport } from "../ports/transport.mjs";
4
+ import { r as Transport, t as Connection } from "../transport-BNNdUBq-.mjs";
5
5
  //#region src/domain/mesh-session.d.ts
6
6
  /** How long to wait for the node's handshake before calling it unanswered. A relay-only node never sends one; that is a state to display, not an error. */
7
7
  export declare const HANDSHAKE_TIMEOUT_MS = 3000;
@@ -1,4 +1,4 @@
1
- import { Connection } from "../ports/transport.cjs";
1
+ import { t as Connection } from "../transport-hEUxrdhT.cjs";
2
2
  //#region src/domain/relay-hub.d.ts
3
3
  export interface RelayHub {
4
4
  /** Drives one accepted connection until it closes: registers gossip-advertised devices, answers relay-connect by pairing and notifying the target, and forwards relay-data within established pairings. Resolves when the connection's frame stream ends. */
@@ -1,4 +1,4 @@
1
- import { Connection } from "../ports/transport.mjs";
1
+ import { t as Connection } from "../transport-BNNdUBq-.mjs";
2
2
  //#region src/domain/relay-hub.d.ts
3
3
  export interface RelayHub {
4
4
  /** Drives one accepted connection until it closes: registers gossip-advertised devices, answers relay-connect by pairing and notifying the target, and forwards relay-data within established pairings. Resolves when the connection's frame stream ends. */
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_domain_device_id = require("./device-id.cjs");
3
2
  const require_domain_tokens = require("./tokens.cjs");
3
+ const require_domain_device_id = require("./device-id.cjs");
4
4
  //#region src/domain/revocation-view.ts
5
5
  function revocationKey(tokenId, issuer) {
6
6
  return `${require_domain_device_id.bytesToHex(tokenId)}:${require_domain_device_id.deviceIdToHex(issuer)}`;
@@ -1,4 +1,4 @@
1
- import { ut as RevocationEntry } from "../protocol-MnxTzpRP.cjs";
1
+ import { dt as RevocationEntry } from "../protocol-Dhswk7YD.cjs";
2
2
  import { RevocationCheck, RevocationEntryVerdict, VerifyRevocationEntryOptions } from "./tokens.cjs";
3
3
  //#region src/domain/revocation-view.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { ut as RevocationEntry } from "../protocol-MnxTzpRP.mjs";
1
+ import { dt as RevocationEntry } from "../protocol-Dhswk7YD.mjs";
2
2
  import { RevocationCheck, RevocationEntryVerdict, VerifyRevocationEntryOptions } from "./tokens.mjs";
3
3
  //#region src/domain/revocation-view.d.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
- import { bytesToHex, deviceIdToHex } from "./device-id.mjs";
2
1
  import { verifyRevocationEntry } from "./tokens.mjs";
2
+ import { bytesToHex, deviceIdToHex } from "./device-id.mjs";
3
3
  //#region src/domain/revocation-view.ts
4
4
  function revocationKey(tokenId, issuer) {
5
5
  return `${bytesToHex(tokenId)}:${deviceIdToHex(issuer)}`;
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_domain_tokens = require("./tokens.cjs");
2
3
  const require_domain_device_id = require("./device-id.cjs");
3
4
  const require_domain_room_path = require("./room-path.cjs");
4
- const require_domain_tokens = require("./tokens.cjs");
5
5
  //#region src/domain/room-token-verification.ts
6
6
  /**
7
7
  * core/room's six verifier obligations (spec/room.cddl), layered on top of verifyCapabilityToken (obligations 2, 4, and 5 -- bearer match, ordinary token-claims checks, and delegations-remaining narrowing -- already live there). This module adds the two obligations specific to room-shaped scopes: the chain must terminate at the correct root for the path's own shape (1), and the token's own scope must actually name the room the request claims to act on (3). Obligation 6 (refuse an unrecognised content-type/kind) is a message-handling concern, not a token-verification one, and belongs to each consumer's own room verb router instead.
@@ -1,4 +1,4 @@
1
- import { Ot as TokenClaims, b as DeviceId, o as CapabilityToken } from "../protocol-MnxTzpRP.cjs";
1
+ import { kt as TokenClaims, s as CapabilityToken, x as DeviceId } from "../protocol-Dhswk7YD.cjs";
2
2
  import { TokenVerdictReason, VerifyCapabilityTokenOptions } from "./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. */
@@ -1,4 +1,4 @@
1
- import { Ot as TokenClaims, b as DeviceId, o as CapabilityToken } from "../protocol-MnxTzpRP.mjs";
1
+ import { kt as TokenClaims, s as CapabilityToken, x as DeviceId } from "../protocol-Dhswk7YD.mjs";
2
2
  import { TokenVerdictReason, VerifyCapabilityTokenOptions } from "./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. */
@@ -1,6 +1,6 @@
1
+ import { verifyCapabilityToken } from "./tokens.mjs";
1
2
  import { deviceIdToHex } from "./device-id.mjs";
2
3
  import { parseRoomPath } from "./room-path.mjs";
3
- import { verifyCapabilityToken } from "./tokens.mjs";
4
4
  //#region src/domain/room-token-verification.ts
5
5
  /**
6
6
  * core/room's six verifier obligations (spec/room.cddl), layered on top of verifyCapabilityToken (obligations 2, 4, and 5 -- bearer match, ordinary token-claims checks, and delegations-remaining narrowing -- already live there). This module adds the two obligations specific to room-shaped scopes: the chain must terminate at the correct root for the path's own shape (1), and the token's own scope must actually name the room the request claims to act on (3). Obligation 6 (refuse an unrecognised content-type/kind) is a message-handling concern, not a token-verification one, and belongs to each consumer's own room verb router instead.
@@ -20,7 +20,7 @@ function pathNarrows(childPath, parentPath) {
20
20
  return childPath.charAt(parentPath.length) === "/";
21
21
  }
22
22
  /**
23
- * True when childScope narrows parentScope per tokens.cddl ("each hop can only narrow authority, never widen it"): the kind must be identical (a different kind is a different kind of authority, not a narrower one), and a parent with a path requires the child to carry an equal-or-descendant path -- an absent child path means the kind's whole-scope root, which is wider than any path-narrowed parent. A parent with no path (whole-scope root) lets any child path under the same kind through.
23
+ * True when childScope narrows parentScope per tokens.cddl ("each hop can only narrow authority, never widen it"): the kind must be identical (a different kind is a different kind of authority, not a narrower one), and a parent with a path requires the child to carry an equal-or-descendant path -- an absent child path means the kind's whole-scope root, which is wider than any path-narrowed parent. A parent with no path (whole-scope root) lets any child path under the same kind through. Exported for capability-grant.ts's own obligation 4 (an unsolicited push's embedded token must equal-or-root the enclosing request's own scope), which is exactly this same narrowing relation applied outside a delegation chain.
24
24
  */
25
25
  function scopeNarrows(parent, child) {
26
26
  if (parent.kind !== child.kind) return false;
@@ -311,5 +311,6 @@ async function mintRevocationEntry(options) {
311
311
  exports.canGrant = canGrant;
312
312
  exports.mintCapabilityToken = mintCapabilityToken;
313
313
  exports.mintRevocationEntry = mintRevocationEntry;
314
+ exports.scopeNarrows = scopeNarrows;
314
315
  exports.verifyCapabilityToken = verifyCapabilityToken;
315
316
  exports.verifyRevocationEntry = verifyRevocationEntry;
@@ -1,5 +1,5 @@
1
- import { Ot as TokenClaims, b as DeviceId, lt as RevocationClaims, o as CapabilityToken, ut as RevocationEntry } from "../protocol-MnxTzpRP.cjs";
2
- import { t as IdentityPort } from "../identity-DkEe1465.cjs";
1
+ import { dt as RevocationEntry, kt as TokenClaims, s as CapabilityToken, ut as RevocationClaims, x as DeviceId } from "../protocol-Dhswk7YD.cjs";
2
+ import { t as IdentityPort } from "../identity-BldV8xFj.cjs";
3
3
  import { t as Clock } from "../clock-DiSx-WKM.cjs";
4
4
  //#region src/domain/tokens.d.ts
5
5
  /**
@@ -27,6 +27,10 @@ export interface VerifyCapabilityTokenOptions {
27
27
  /** When given, the token must bear this device -- the caller presenting a token to authorise itself, not someone else. */
28
28
  expectedBearer?: DeviceId;
29
29
  }
30
+ /**
31
+ * True when childScope narrows parentScope per tokens.cddl ("each hop can only narrow authority, never widen it"): the kind must be identical (a different kind is a different kind of authority, not a narrower one), and a parent with a path requires the child to carry an equal-or-descendant path -- an absent child path means the kind's whole-scope root, which is wider than any path-narrowed parent. A parent with no path (whole-scope root) lets any child path under the same kind through. Exported for capability-grant.ts's own obligation 4 (an unsolicited push's embedded token must equal-or-root the enclosing request's own scope), which is exactly this same narrowing relation applied outside a delegation chain.
32
+ */
33
+ export declare function scopeNarrows(parent: TokenClaims["scope"], child: TokenClaims["scope"]): boolean;
30
34
  /**
31
35
  * 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.
32
36
  */
@@ -1,5 +1,5 @@
1
- import { Ot as TokenClaims, b as DeviceId, lt as RevocationClaims, o as CapabilityToken, ut as RevocationEntry } from "../protocol-MnxTzpRP.mjs";
2
- import { t as IdentityPort } from "../identity-D8iJZRZZ.mjs";
1
+ import { dt as RevocationEntry, kt as TokenClaims, s as CapabilityToken, ut as RevocationClaims, x as DeviceId } from "../protocol-Dhswk7YD.mjs";
2
+ import { t as IdentityPort } from "../identity-B1hBV3YA.mjs";
3
3
  import { t as Clock } from "../clock-DiSx-WKM.mjs";
4
4
  //#region src/domain/tokens.d.ts
5
5
  /**
@@ -27,6 +27,10 @@ export interface VerifyCapabilityTokenOptions {
27
27
  /** When given, the token must bear this device -- the caller presenting a token to authorise itself, not someone else. */
28
28
  expectedBearer?: DeviceId;
29
29
  }
30
+ /**
31
+ * True when childScope narrows parentScope per tokens.cddl ("each hop can only narrow authority, never widen it"): the kind must be identical (a different kind is a different kind of authority, not a narrower one), and a parent with a path requires the child to carry an equal-or-descendant path -- an absent child path means the kind's whole-scope root, which is wider than any path-narrowed parent. A parent with no path (whole-scope root) lets any child path under the same kind through. Exported for capability-grant.ts's own obligation 4 (an unsolicited push's embedded token must equal-or-root the enclosing request's own scope), which is exactly this same narrowing relation applied outside a delegation chain.
32
+ */
33
+ export declare function scopeNarrows(parent: TokenClaims["scope"], child: TokenClaims["scope"]): boolean;
30
34
  /**
31
35
  * 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.
32
36
  */
@@ -19,7 +19,7 @@ function pathNarrows(childPath, parentPath) {
19
19
  return childPath.charAt(parentPath.length) === "/";
20
20
  }
21
21
  /**
22
- * True when childScope narrows parentScope per tokens.cddl ("each hop can only narrow authority, never widen it"): the kind must be identical (a different kind is a different kind of authority, not a narrower one), and a parent with a path requires the child to carry an equal-or-descendant path -- an absent child path means the kind's whole-scope root, which is wider than any path-narrowed parent. A parent with no path (whole-scope root) lets any child path under the same kind through.
22
+ * True when childScope narrows parentScope per tokens.cddl ("each hop can only narrow authority, never widen it"): the kind must be identical (a different kind is a different kind of authority, not a narrower one), and a parent with a path requires the child to carry an equal-or-descendant path -- an absent child path means the kind's whole-scope root, which is wider than any path-narrowed parent. A parent with no path (whole-scope root) lets any child path under the same kind through. Exported for capability-grant.ts's own obligation 4 (an unsolicited push's embedded token must equal-or-root the enclosing request's own scope), which is exactly this same narrowing relation applied outside a delegation chain.
23
23
  */
24
24
  function scopeNarrows(parent, child) {
25
25
  if (parent.kind !== child.kind) return false;
@@ -307,4 +307,4 @@ async function mintRevocationEntry(options) {
307
307
  ];
308
308
  }
309
309
  //#endregion
310
- export { canGrant, mintCapabilityToken, mintRevocationEntry, verifyCapabilityToken, verifyRevocationEntry };
310
+ export { canGrant, mintCapabilityToken, mintRevocationEntry, scopeNarrows, verifyCapabilityToken, verifyRevocationEntry };
@@ -40,6 +40,7 @@ const manageCommandParamsSchema = zod.z.lazy(() => zod.z.union([
40
40
  ]),
41
41
  zod.z.object({}).catchall(zod.z.unknown()),
42
42
  zod.z.lazy(() => capabilityRequestSchema),
43
+ zod.z.lazy(() => capabilityGrantSchema),
43
44
  zod.z.union([
44
45
  zod.z.lazy(() => roomSendSchema),
45
46
  zod.z.lazy(() => roomReadSchema),
@@ -187,6 +188,10 @@ const capabilityGrantOkSchema = zod.z.lazy(() => zod.z.object({
187
188
  "result": zod.z.literal("ok"),
188
189
  "granted-token": zod.z.lazy(() => capabilityTokenSchema)
189
190
  }).catchall(zod.z.unknown()));
191
+ const capabilityGrantSchema = zod.z.lazy(() => zod.z.object({
192
+ "verb": zod.z.literal("capability.grant"),
193
+ "granted-token": zod.z.lazy(() => capabilityTokenSchema)
194
+ }).catchall(zod.z.unknown()));
190
195
  const revocationClaimsSchema = zod.z.lazy(() => zod.z.object({
191
196
  "token-id": zod.z.instanceof(Uint8Array),
192
197
  "issuer": zod.z.lazy(() => deviceIdSchema),
@@ -395,6 +400,7 @@ const iceCandidateInitSchema = zod.z.lazy(() => zod.z.object({
395
400
  exports.candidateKindSchema = candidateKindSchema;
396
401
  exports.candidatesFrameSchema = candidatesFrameSchema;
397
402
  exports.capabilityGrantOkSchema = capabilityGrantOkSchema;
403
+ exports.capabilityGrantSchema = capabilityGrantSchema;
398
404
  exports.capabilityRequestSchema = capabilityRequestSchema;
399
405
  exports.capabilityScopeSchema = capabilityScopeSchema;
400
406
  exports.capabilityTokenSchema = capabilityTokenSchema;
@@ -1,2 +1,2 @@
1
- import { $ as ProtocolVersion, $n as roomReadSchema, $t as deviceIdSchema, A as HandleRecord, An as procSpawnSchema, At as WebrtcIceCandidate, B as MessageRef, Bn as revocationAnnounceFrameSchema, Bt as closeFrameSchema, C as DomainId, Cn as peerAdvertSchema, Ct as StreamAckFrame, D as FrameVariant, Dn as privateUseDomainIdSchema, Dt as SyncPunchFrame, E as Frame, En as privateUseCapabilitySchema, Et as StreamSession, F as ManageCommandParams, Fn as ptyWriteSchema, Ft as capabilityGrantOkSchema, G as PeerAdvert, Gn as roomJoinSchema, Gt as coseHeaderKidSchema, H as NamespacedDomainId, Hn as revocationEntrySchema, Ht as coreCapabilitySchema, I as ManageError, In as relayConnectFrameSchema, It as capabilityRequestSchema, J as PrivateUseCapability, Jn as roomMembersOkSchema, Jt as coseTokenHeadersSchema, K as PeerIdentity, Kn as roomLeaveSchema, Kt as coseHeaderLabelSchema, L as ManageOk, Ln as relayDataFrameSchema, Lt as capabilityScopeSchema, M as IceCandidateInit, Mn as ptyKillSchema, Mt as WireCandidate, N as IdentityKey, Nn as ptyResizeSchema, Nt as candidateKindSchema, O as GossipFrame, On as procKillSchema, Ot as TokenClaims, P as ManageCommand, Pn as ptySpawnSchema, Pt as candidatesFrameSchema, Q as ProcSpawn, Qn as roomPathSchema, Qt as deviceIdHexSchema, R as ManageRequestFrame, Rn as relayInboundFrameSchema, Rt as capabilityTokenSchema, S as DmRoomPath, Sn as ownerNamedRoomPathSchema, St as RoomSend, T as ExecSessionInfo, Tn as pingFrameSchema, Tt as StreamEndFrame, U as ObservedAddressFrame, Un as roomInviteSchema, Ut as coreDomainNameSchema, V as NamespacedCapability, Vn as revocationClaimsSchema, Vt as coordinatorFrameSchema, W as OwnerNamedRoomPath, Wn as roomJoinOkSchema, Wt as coseHeaderAlgSchema, X as ProcKill, Xn as roomNoticeClaimsSchema, Xt as dataHaveFrameSchema, Y as PrivateUseDomainId, Yn as roomMembersSchema, Yt as dataEntriesFrameSchema, Z as ProcSignal, Zn as roomNoticeSchema, Zt as dataRequestFrameSchema, _ as DataEntriesFrame, _n as manageResponseFrameSchema, _t as RoomMembersOk, a as CapabilityScope, an as frameVariantSchema, ar as syncPunchFrameSchema, at as RelayDataFrame, b as DeviceId, bn as namespacedDomainIdSchema, bt as RoomPath, c as CloseFrame, cn as handleRecordSchema, cr as webrtcIceCandidateSchema, ct as RevocationAnnounceFrame, d as CoreDomainName, dn as identityKeySchema, dt as RoomInvite, en as dmRoomPathSchema, er as roomSendSchema, et as PtyKill, f as CoseHeaderAlg, fn as manageCommandParamsSchema, ft as RoomJoin, g as CoseTokenHeaders, gn as manageRequestFrameSchema, gt as RoomMembers, h as CoseSign1, hn as manageOkSchema, ht as RoomMember, i as CapabilityRequest, in as frameSchema, ir as streamSessionSchema, it as RelayConnectFrame, j as HandshakeFrame, jn as protocolVersionSchema, jt as WebrtcOffer, k as HandleClaims, kn as procSignalSchema, kt as WebrtcAnswer, l as CoordinatorFrame, ln as handshakeFrameSchema, lr as webrtcOfferSchema, lt as RevocationClaims, m as CoseHeaderLabel, mn as manageErrorSchema, mt as RoomLeave, n as CandidatesFrame, nn as execListSchema, nr as streamDataFrameSchema, nt as PtySpawn, o as CapabilityToken, on as gossipFrameSchema, or as tokenClaimsSchema, ot as RelayInboundFrame, p as CoseHeaderKid, pn as manageCommandSchema, pt as RoomJoinOk, q as PingFrame, qn as roomMemberSchema, qt as coseSign1Schema, r as CapabilityGrantOk, rn as execSessionInfoSchema, rr as streamEndFrameSchema, rt as PtyWrite, s as CapabilityVerb, sn as handleClaimsSchema, sr as webrtcAnswerSchema, st as RelayOfferFrame, t as CandidateKind, tn as domainIdSchema, tr as streamAckFrameSchema, tt as PtyResize, u as CoreCapability, un as iceCandidateInitSchema, ur as wireCandidateSchema, ut as RevocationEntry, v as DataHaveFrame, vn as messageRefSchema, vt as RoomNotice, w as ExecList, wn as peerIdentitySchema, wt as StreamDataFrame, x as DeviceIdHex, xn as observedAddressFrameSchema, xt as RoomRead, y as DataRequestFrame, yn as namespacedCapabilitySchema, yt as RoomNoticeClaims, z as ManageResponseFrame, zn as relayOfferFrameSchema, zt as capabilityVerbSchema } from "../protocol-MnxTzpRP.cjs";
2
- export { CandidateKind, CandidatesFrame, 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, PeerAdvert, PeerIdentity, PingFrame, 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, RoomSend, StreamAckFrame, StreamDataFrame, StreamEndFrame, StreamSession, SyncPunchFrame, TokenClaims, WebrtcAnswer, WebrtcIceCandidate, WebrtcOffer, WireCandidate, candidateKindSchema, candidatesFrameSchema, capabilityGrantOkSchema, 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, peerAdvertSchema, peerIdentitySchema, pingFrameSchema, 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, roomSendSchema, streamAckFrameSchema, streamDataFrameSchema, streamEndFrameSchema, streamSessionSchema, syncPunchFrameSchema, tokenClaimsSchema, webrtcAnswerSchema, webrtcIceCandidateSchema, webrtcOfferSchema, wireCandidateSchema };
1
+ import { $ as ProcSpawn, $n as roomNoticeSchema, $t as dataRequestFrameSchema, A as HandleClaims, An as procKillSchema, At as WebrtcAnswer, B as ManageResponseFrame, Bn as relayInboundFrameSchema, Bt as capabilityTokenSchema, C as DmRoomPath, Cn as observedAddressFrameSchema, Ct as RoomSend, D as Frame, Dn as pingFrameSchema, Dt as StreamSession, E as ExecSessionInfo, En as peerIdentitySchema, Et as StreamEndFrame, F as ManageCommand, Fn as ptyResizeSchema, Ft as candidatesFrameSchema, G as OwnerNamedRoomPath, Gn as roomInviteSchema, Gt as coreDomainNameSchema, H as NamespacedCapability, Hn as revocationAnnounceFrameSchema, Ht as closeFrameSchema, I as ManageCommandParams, In as ptySpawnSchema, It as capabilityGrantOkSchema, J as PingFrame, Jn as roomLeaveSchema, Jt as coseHeaderLabelSchema, K as PeerAdvert, Kn as roomJoinOkSchema, Kt as coseHeaderAlgSchema, L as ManageError, Ln as ptyWriteSchema, Lt as capabilityGrantSchema, M as HandshakeFrame, Mn as procSpawnSchema, Mt as WebrtcOffer, N as IceCandidateInit, Nn as protocolVersionSchema, Nt as WireCandidate, O as FrameVariant, On as privateUseCapabilitySchema, Ot as SyncPunchFrame, P as IdentityKey, Pn as ptyKillSchema, Pt as candidateKindSchema, Q as ProcSignal, Qn as roomNoticeClaimsSchema, Qt as dataHaveFrameSchema, R as ManageOk, Rn as relayConnectFrameSchema, Rt as capabilityRequestSchema, S as DeviceIdHex, Sn as namespacedDomainIdSchema, St as RoomRead, T as ExecList, Tn as peerAdvertSchema, Tt as StreamDataFrame, U as NamespacedDomainId, Un as revocationClaimsSchema, Ut as coordinatorFrameSchema, V as MessageRef, Vn as relayOfferFrameSchema, Vt as capabilityVerbSchema, W as ObservedAddressFrame, Wn as revocationEntrySchema, Wt as coreCapabilitySchema, X as PrivateUseDomainId, Xn as roomMembersOkSchema, Xt as coseTokenHeadersSchema, Y as PrivateUseCapability, Yn as roomMemberSchema, Yt as coseSign1Schema, Z as ProcKill, Zn as roomMembersSchema, Zt as dataEntriesFrameSchema, _ as CoseTokenHeaders, _n as manageOkSchema, _t as RoomMembers, a as CapabilityRequest, an as execSessionInfoSchema, ar as streamEndFrameSchema, at as RelayConnectFrame, b as DataRequestFrame, bn as messageRefSchema, bt as RoomNoticeClaims, c as CapabilityVerb, cn as gossipFrameSchema, cr as tokenClaimsSchema, ct as RelayOfferFrame, d as CoreCapability, dn as handshakeFrameSchema, dr as webrtcOfferSchema, dt as RevocationEntry, en as deviceIdHexSchema, er as roomPathSchema, et as ProtocolVersion, f as CoreDomainName, fn as iceCandidateInitSchema, fr as wireCandidateSchema, ft as RoomInvite, g as CoseSign1, gn as manageErrorSchema, gt as RoomMember, h as CoseHeaderLabel, hn as manageCommandSchema, ht as RoomLeave, i as CapabilityGrantOk, in as execListSchema, ir as streamDataFrameSchema, it as PtyWrite, j as HandleRecord, jn as procSignalSchema, jt as WebrtcIceCandidate, k as GossipFrame, kn as privateUseDomainIdSchema, kt as TokenClaims, l as CloseFrame, ln as handleClaimsSchema, lr as webrtcAnswerSchema, lt as RevocationAnnounceFrame, m as CoseHeaderKid, mn as manageCommandParamsSchema, mt as RoomJoinOk, n as CandidatesFrame, nn as dmRoomPathSchema, nr as roomSendSchema, nt as PtyResize, o as CapabilityScope, on as frameSchema, or as streamSessionSchema, ot as RelayDataFrame, p as CoseHeaderAlg, pn as identityKeySchema, pt as RoomJoin, q as PeerIdentity, qn as roomJoinSchema, qt as coseHeaderKidSchema, r as CapabilityGrant, rn as domainIdSchema, rr as streamAckFrameSchema, rt as PtySpawn, s as CapabilityToken, sn as frameVariantSchema, sr as syncPunchFrameSchema, st as RelayInboundFrame, t as CandidateKind, tn as deviceIdSchema, tr as roomReadSchema, tt as PtyKill, u as CoordinatorFrame, un as handleRecordSchema, ur as webrtcIceCandidateSchema, ut as RevocationClaims, v as DataEntriesFrame, vn as manageRequestFrameSchema, vt as RoomMembersOk, w as DomainId, wn as ownerNamedRoomPathSchema, wt as StreamAckFrame, x as DeviceId, xn as namespacedCapabilitySchema, xt as RoomPath, y as DataHaveFrame, yn as manageResponseFrameSchema, yt as RoomNotice, z as ManageRequestFrame, zn as relayDataFrameSchema, zt as capabilityScopeSchema } from "../protocol-Dhswk7YD.cjs";
2
+ export { 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, PeerAdvert, PeerIdentity, PingFrame, 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, RoomSend, StreamAckFrame, StreamDataFrame, StreamEndFrame, StreamSession, SyncPunchFrame, TokenClaims, WebrtcAnswer, WebrtcIceCandidate, WebrtcOffer, WireCandidate, 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, peerAdvertSchema, peerIdentitySchema, pingFrameSchema, 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, roomSendSchema, streamAckFrameSchema, streamDataFrameSchema, streamEndFrameSchema, streamSessionSchema, syncPunchFrameSchema, tokenClaimsSchema, webrtcAnswerSchema, webrtcIceCandidateSchema, webrtcOfferSchema, wireCandidateSchema };
@@ -1,2 +1,2 @@
1
- import { $ as ProtocolVersion, $n as roomReadSchema, $t as deviceIdSchema, A as HandleRecord, An as procSpawnSchema, At as WebrtcIceCandidate, B as MessageRef, Bn as revocationAnnounceFrameSchema, Bt as closeFrameSchema, C as DomainId, Cn as peerAdvertSchema, Ct as StreamAckFrame, D as FrameVariant, Dn as privateUseDomainIdSchema, Dt as SyncPunchFrame, E as Frame, En as privateUseCapabilitySchema, Et as StreamSession, F as ManageCommandParams, Fn as ptyWriteSchema, Ft as capabilityGrantOkSchema, G as PeerAdvert, Gn as roomJoinSchema, Gt as coseHeaderKidSchema, H as NamespacedDomainId, Hn as revocationEntrySchema, Ht as coreCapabilitySchema, I as ManageError, In as relayConnectFrameSchema, It as capabilityRequestSchema, J as PrivateUseCapability, Jn as roomMembersOkSchema, Jt as coseTokenHeadersSchema, K as PeerIdentity, Kn as roomLeaveSchema, Kt as coseHeaderLabelSchema, L as ManageOk, Ln as relayDataFrameSchema, Lt as capabilityScopeSchema, M as IceCandidateInit, Mn as ptyKillSchema, Mt as WireCandidate, N as IdentityKey, Nn as ptyResizeSchema, Nt as candidateKindSchema, O as GossipFrame, On as procKillSchema, Ot as TokenClaims, P as ManageCommand, Pn as ptySpawnSchema, Pt as candidatesFrameSchema, Q as ProcSpawn, Qn as roomPathSchema, Qt as deviceIdHexSchema, R as ManageRequestFrame, Rn as relayInboundFrameSchema, Rt as capabilityTokenSchema, S as DmRoomPath, Sn as ownerNamedRoomPathSchema, St as RoomSend, T as ExecSessionInfo, Tn as pingFrameSchema, Tt as StreamEndFrame, U as ObservedAddressFrame, Un as roomInviteSchema, Ut as coreDomainNameSchema, V as NamespacedCapability, Vn as revocationClaimsSchema, Vt as coordinatorFrameSchema, W as OwnerNamedRoomPath, Wn as roomJoinOkSchema, Wt as coseHeaderAlgSchema, X as ProcKill, Xn as roomNoticeClaimsSchema, Xt as dataHaveFrameSchema, Y as PrivateUseDomainId, Yn as roomMembersSchema, Yt as dataEntriesFrameSchema, Z as ProcSignal, Zn as roomNoticeSchema, Zt as dataRequestFrameSchema, _ as DataEntriesFrame, _n as manageResponseFrameSchema, _t as RoomMembersOk, a as CapabilityScope, an as frameVariantSchema, ar as syncPunchFrameSchema, at as RelayDataFrame, b as DeviceId, bn as namespacedDomainIdSchema, bt as RoomPath, c as CloseFrame, cn as handleRecordSchema, cr as webrtcIceCandidateSchema, ct as RevocationAnnounceFrame, d as CoreDomainName, dn as identityKeySchema, dt as RoomInvite, en as dmRoomPathSchema, er as roomSendSchema, et as PtyKill, f as CoseHeaderAlg, fn as manageCommandParamsSchema, ft as RoomJoin, g as CoseTokenHeaders, gn as manageRequestFrameSchema, gt as RoomMembers, h as CoseSign1, hn as manageOkSchema, ht as RoomMember, i as CapabilityRequest, in as frameSchema, ir as streamSessionSchema, it as RelayConnectFrame, j as HandshakeFrame, jn as protocolVersionSchema, jt as WebrtcOffer, k as HandleClaims, kn as procSignalSchema, kt as WebrtcAnswer, l as CoordinatorFrame, ln as handshakeFrameSchema, lr as webrtcOfferSchema, lt as RevocationClaims, m as CoseHeaderLabel, mn as manageErrorSchema, mt as RoomLeave, n as CandidatesFrame, nn as execListSchema, nr as streamDataFrameSchema, nt as PtySpawn, o as CapabilityToken, on as gossipFrameSchema, or as tokenClaimsSchema, ot as RelayInboundFrame, p as CoseHeaderKid, pn as manageCommandSchema, pt as RoomJoinOk, q as PingFrame, qn as roomMemberSchema, qt as coseSign1Schema, r as CapabilityGrantOk, rn as execSessionInfoSchema, rr as streamEndFrameSchema, rt as PtyWrite, s as CapabilityVerb, sn as handleClaimsSchema, sr as webrtcAnswerSchema, st as RelayOfferFrame, t as CandidateKind, tn as domainIdSchema, tr as streamAckFrameSchema, tt as PtyResize, u as CoreCapability, un as iceCandidateInitSchema, ur as wireCandidateSchema, ut as RevocationEntry, v as DataHaveFrame, vn as messageRefSchema, vt as RoomNotice, w as ExecList, wn as peerIdentitySchema, wt as StreamDataFrame, x as DeviceIdHex, xn as observedAddressFrameSchema, xt as RoomRead, y as DataRequestFrame, yn as namespacedCapabilitySchema, yt as RoomNoticeClaims, z as ManageResponseFrame, zn as relayOfferFrameSchema, zt as capabilityVerbSchema } from "../protocol-MnxTzpRP.mjs";
2
- export { CandidateKind, CandidatesFrame, 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, PeerAdvert, PeerIdentity, PingFrame, 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, RoomSend, StreamAckFrame, StreamDataFrame, StreamEndFrame, StreamSession, SyncPunchFrame, TokenClaims, WebrtcAnswer, WebrtcIceCandidate, WebrtcOffer, WireCandidate, candidateKindSchema, candidatesFrameSchema, capabilityGrantOkSchema, 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, peerAdvertSchema, peerIdentitySchema, pingFrameSchema, 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, roomSendSchema, streamAckFrameSchema, streamDataFrameSchema, streamEndFrameSchema, streamSessionSchema, syncPunchFrameSchema, tokenClaimsSchema, webrtcAnswerSchema, webrtcIceCandidateSchema, webrtcOfferSchema, wireCandidateSchema };
1
+ import { $ as ProcSpawn, $n as roomNoticeSchema, $t as dataRequestFrameSchema, A as HandleClaims, An as procKillSchema, At as WebrtcAnswer, B as ManageResponseFrame, Bn as relayInboundFrameSchema, Bt as capabilityTokenSchema, C as DmRoomPath, Cn as observedAddressFrameSchema, Ct as RoomSend, D as Frame, Dn as pingFrameSchema, Dt as StreamSession, E as ExecSessionInfo, En as peerIdentitySchema, Et as StreamEndFrame, F as ManageCommand, Fn as ptyResizeSchema, Ft as candidatesFrameSchema, G as OwnerNamedRoomPath, Gn as roomInviteSchema, Gt as coreDomainNameSchema, H as NamespacedCapability, Hn as revocationAnnounceFrameSchema, Ht as closeFrameSchema, I as ManageCommandParams, In as ptySpawnSchema, It as capabilityGrantOkSchema, J as PingFrame, Jn as roomLeaveSchema, Jt as coseHeaderLabelSchema, K as PeerAdvert, Kn as roomJoinOkSchema, Kt as coseHeaderAlgSchema, L as ManageError, Ln as ptyWriteSchema, Lt as capabilityGrantSchema, M as HandshakeFrame, Mn as procSpawnSchema, Mt as WebrtcOffer, N as IceCandidateInit, Nn as protocolVersionSchema, Nt as WireCandidate, O as FrameVariant, On as privateUseCapabilitySchema, Ot as SyncPunchFrame, P as IdentityKey, Pn as ptyKillSchema, Pt as candidateKindSchema, Q as ProcSignal, Qn as roomNoticeClaimsSchema, Qt as dataHaveFrameSchema, R as ManageOk, Rn as relayConnectFrameSchema, Rt as capabilityRequestSchema, S as DeviceIdHex, Sn as namespacedDomainIdSchema, St as RoomRead, T as ExecList, Tn as peerAdvertSchema, Tt as StreamDataFrame, U as NamespacedDomainId, Un as revocationClaimsSchema, Ut as coordinatorFrameSchema, V as MessageRef, Vn as relayOfferFrameSchema, Vt as capabilityVerbSchema, W as ObservedAddressFrame, Wn as revocationEntrySchema, Wt as coreCapabilitySchema, X as PrivateUseDomainId, Xn as roomMembersOkSchema, Xt as coseTokenHeadersSchema, Y as PrivateUseCapability, Yn as roomMemberSchema, Yt as coseSign1Schema, Z as ProcKill, Zn as roomMembersSchema, Zt as dataEntriesFrameSchema, _ as CoseTokenHeaders, _n as manageOkSchema, _t as RoomMembers, a as CapabilityRequest, an as execSessionInfoSchema, ar as streamEndFrameSchema, at as RelayConnectFrame, b as DataRequestFrame, bn as messageRefSchema, bt as RoomNoticeClaims, c as CapabilityVerb, cn as gossipFrameSchema, cr as tokenClaimsSchema, ct as RelayOfferFrame, d as CoreCapability, dn as handshakeFrameSchema, dr as webrtcOfferSchema, dt as RevocationEntry, en as deviceIdHexSchema, er as roomPathSchema, et as ProtocolVersion, f as CoreDomainName, fn as iceCandidateInitSchema, fr as wireCandidateSchema, ft as RoomInvite, g as CoseSign1, gn as manageErrorSchema, gt as RoomMember, h as CoseHeaderLabel, hn as manageCommandSchema, ht as RoomLeave, i as CapabilityGrantOk, in as execListSchema, ir as streamDataFrameSchema, it as PtyWrite, j as HandleRecord, jn as procSignalSchema, jt as WebrtcIceCandidate, k as GossipFrame, kn as privateUseDomainIdSchema, kt as TokenClaims, l as CloseFrame, ln as handleClaimsSchema, lr as webrtcAnswerSchema, lt as RevocationAnnounceFrame, m as CoseHeaderKid, mn as manageCommandParamsSchema, mt as RoomJoinOk, n as CandidatesFrame, nn as dmRoomPathSchema, nr as roomSendSchema, nt as PtyResize, o as CapabilityScope, on as frameSchema, or as streamSessionSchema, ot as RelayDataFrame, p as CoseHeaderAlg, pn as identityKeySchema, pt as RoomJoin, q as PeerIdentity, qn as roomJoinSchema, qt as coseHeaderKidSchema, r as CapabilityGrant, rn as domainIdSchema, rr as streamAckFrameSchema, rt as PtySpawn, s as CapabilityToken, sn as frameVariantSchema, sr as syncPunchFrameSchema, st as RelayInboundFrame, t as CandidateKind, tn as deviceIdSchema, tr as roomReadSchema, tt as PtyKill, u as CoordinatorFrame, un as handleRecordSchema, ur as webrtcIceCandidateSchema, ut as RevocationClaims, v as DataEntriesFrame, vn as manageRequestFrameSchema, vt as RoomMembersOk, w as DomainId, wn as ownerNamedRoomPathSchema, wt as StreamAckFrame, x as DeviceId, xn as namespacedCapabilitySchema, xt as RoomPath, y as DataHaveFrame, yn as manageResponseFrameSchema, yt as RoomNotice, z as ManageRequestFrame, zn as relayDataFrameSchema, zt as capabilityScopeSchema } from "../protocol-Dhswk7YD.mjs";
2
+ export { 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, PeerAdvert, PeerIdentity, PingFrame, 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, RoomSend, StreamAckFrame, StreamDataFrame, StreamEndFrame, StreamSession, SyncPunchFrame, TokenClaims, WebrtcAnswer, WebrtcIceCandidate, WebrtcOffer, WireCandidate, 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, peerAdvertSchema, peerIdentitySchema, pingFrameSchema, 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, roomSendSchema, streamAckFrameSchema, streamDataFrameSchema, streamEndFrameSchema, streamSessionSchema, syncPunchFrameSchema, tokenClaimsSchema, webrtcAnswerSchema, webrtcIceCandidateSchema, webrtcOfferSchema, wireCandidateSchema };
@@ -39,6 +39,7 @@ const manageCommandParamsSchema = z.lazy(() => z.union([
39
39
  ]),
40
40
  z.object({}).catchall(z.unknown()),
41
41
  z.lazy(() => capabilityRequestSchema),
42
+ z.lazy(() => capabilityGrantSchema),
42
43
  z.union([
43
44
  z.lazy(() => roomSendSchema),
44
45
  z.lazy(() => roomReadSchema),
@@ -186,6 +187,10 @@ const capabilityGrantOkSchema = z.lazy(() => z.object({
186
187
  "result": z.literal("ok"),
187
188
  "granted-token": z.lazy(() => capabilityTokenSchema)
188
189
  }).catchall(z.unknown()));
190
+ const capabilityGrantSchema = z.lazy(() => z.object({
191
+ "verb": z.literal("capability.grant"),
192
+ "granted-token": z.lazy(() => capabilityTokenSchema)
193
+ }).catchall(z.unknown()));
189
194
  const revocationClaimsSchema = z.lazy(() => z.object({
190
195
  "token-id": z.instanceof(Uint8Array),
191
196
  "issuer": z.lazy(() => deviceIdSchema),
@@ -391,4 +396,4 @@ const iceCandidateInitSchema = z.lazy(() => z.object({
391
396
  "username-fragment": z.string().optional()
392
397
  }));
393
398
  //#endregion
394
- export { candidateKindSchema, candidatesFrameSchema, capabilityGrantOkSchema, 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, peerAdvertSchema, peerIdentitySchema, pingFrameSchema, 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, roomSendSchema, streamAckFrameSchema, streamDataFrameSchema, streamEndFrameSchema, streamSessionSchema, syncPunchFrameSchema, tokenClaimsSchema, webrtcAnswerSchema, webrtcIceCandidateSchema, webrtcOfferSchema, wireCandidateSchema };
399
+ export { 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, peerAdvertSchema, peerIdentitySchema, pingFrameSchema, 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, roomSendSchema, streamAckFrameSchema, streamDataFrameSchema, streamEndFrameSchema, streamSessionSchema, syncPunchFrameSchema, tokenClaimsSchema, webrtcAnswerSchema, webrtcIceCandidateSchema, webrtcOfferSchema, wireCandidateSchema };
@@ -1,4 +1,4 @@
1
- import { N as IdentityKey, b as DeviceId } from "./protocol-MnxTzpRP.mjs";
1
+ import { P as IdentityKey, x as DeviceId } from "./protocol-Dhswk7YD.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,4 +1,4 @@
1
- import { N as IdentityKey, b as DeviceId } from "./protocol-MnxTzpRP.cjs";
1
+ import { P as IdentityKey, x as DeviceId } from "./protocol-Dhswk7YD.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,2 +1,2 @@
1
- import { t as IdentityPort } from "../identity-DkEe1465.cjs";
1
+ import { t as IdentityPort } from "../identity-BldV8xFj.cjs";
2
2
  export { IdentityPort };
@@ -1,2 +1,2 @@
1
- import { t as IdentityPort } from "../identity-D8iJZRZZ.mjs";
1
+ import { t as IdentityPort } from "../identity-B1hBV3YA.mjs";
2
2
  export { IdentityPort };
@@ -1,29 +1,2 @@
1
- import { E as Frame, b as DeviceId } from "../protocol-MnxTzpRP.cjs";
2
- //#region src/ports/transport.d.ts
3
- /**
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.
5
- */
6
- export interface Connection {
7
- send: (frame: Frame) => Promise<void>;
8
- /** Frames received on this connection, in arrival order, until the connection closes. */
9
- receive: () => AsyncIterable<Frame>;
10
- close: () => Promise<void>;
11
- /** The peer's device-id, cryptographically authenticated by the adapter itself (never a value read off the wire) -- absent when the adapter has nothing to authenticate against (createTcpTransport) or the peer presented no credential to check (an accepting createTlsTransport connection whose peer sent no certificate). A caller that later receives an application-level claim of who the peer is (e.g. an `introduce`-style message) MUST treat a mismatch against this field as a spoofing attempt and refuse the claim, exactly the same "reject and destroy" obligation self-certifying claims elsewhere in this spec already carry. */
12
- readonly peerDeviceId?: DeviceId;
13
- /** Lets the event loop exit while this connection is still open and functioning -- a caller that wants I/O to keep working without keeping the process alive (matching Node's own `net.Socket.unref()`) calls this once. Adapters with no underlying handle to unref (an in-memory test double, a browser WebSocket) simply omit it. */
14
- unref?: () => void;
15
- }
16
- export interface Listener {
17
- /** Stops listening and closes the listener. */
18
- close: () => Promise<void>;
19
- /** The address actually bound, as "host:port". A caller may pass port 0 to take an OS-assigned port and needs it handed back to connect to (or advertise) -- tests rely on this to avoid fixed-port collisions. */
20
- address: string;
21
- /** Lets the event loop exit while this listener is still bound and accepting connections. See Connection.unref for the same rationale; adapters with nothing to unref omit it. */
22
- unref?: () => void;
23
- }
24
- export interface Transport {
25
- connect: (address: string) => Promise<Connection>;
26
- /** Starts listening; each accepted connection is handed to onConnection. Resolves once bound, with the address actually listening on. */
27
- listen: (address: string, onConnection: (connection: Readonly<Connection>) => void) => Promise<Listener>;
28
- }
29
- //#endregion
1
+ import { n as Listener, r as Transport, t as Connection } from "../transport-hEUxrdhT.cjs";
2
+ export { Connection, Listener, Transport };
@@ -1,29 +1,2 @@
1
- import { E as Frame, b as DeviceId } from "../protocol-MnxTzpRP.mjs";
2
- //#region src/ports/transport.d.ts
3
- /**
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.
5
- */
6
- export interface Connection {
7
- send: (frame: Frame) => Promise<void>;
8
- /** Frames received on this connection, in arrival order, until the connection closes. */
9
- receive: () => AsyncIterable<Frame>;
10
- close: () => Promise<void>;
11
- /** The peer's device-id, cryptographically authenticated by the adapter itself (never a value read off the wire) -- absent when the adapter has nothing to authenticate against (createTcpTransport) or the peer presented no credential to check (an accepting createTlsTransport connection whose peer sent no certificate). A caller that later receives an application-level claim of who the peer is (e.g. an `introduce`-style message) MUST treat a mismatch against this field as a spoofing attempt and refuse the claim, exactly the same "reject and destroy" obligation self-certifying claims elsewhere in this spec already carry. */
12
- readonly peerDeviceId?: DeviceId;
13
- /** Lets the event loop exit while this connection is still open and functioning -- a caller that wants I/O to keep working without keeping the process alive (matching Node's own `net.Socket.unref()`) calls this once. Adapters with no underlying handle to unref (an in-memory test double, a browser WebSocket) simply omit it. */
14
- unref?: () => void;
15
- }
16
- export interface Listener {
17
- /** Stops listening and closes the listener. */
18
- close: () => Promise<void>;
19
- /** The address actually bound, as "host:port". A caller may pass port 0 to take an OS-assigned port and needs it handed back to connect to (or advertise) -- tests rely on this to avoid fixed-port collisions. */
20
- address: string;
21
- /** Lets the event loop exit while this listener is still bound and accepting connections. See Connection.unref for the same rationale; adapters with nothing to unref omit it. */
22
- unref?: () => void;
23
- }
24
- export interface Transport {
25
- connect: (address: string) => Promise<Connection>;
26
- /** Starts listening; each accepted connection is handed to onConnection. Resolves once bound, with the address actually listening on. */
27
- listen: (address: string, onConnection: (connection: Readonly<Connection>) => void) => Promise<Listener>;
28
- }
29
- //#endregion
1
+ import { n as Listener, r as Transport, t as Connection } from "../transport-BNNdUBq-.mjs";
2
+ export { Connection, Listener, Transport };