wire-mesh-core 1.15.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 (45) 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.d.cts +2 -2
  14. package/dist/domain/capability-request.d.mts +2 -2
  15. package/dist/domain/device-id.d.cts +1 -1
  16. package/dist/domain/device-id.d.mts +1 -1
  17. package/dist/domain/handshake.d.cts +1 -1
  18. package/dist/domain/handshake.d.mts +1 -1
  19. package/dist/domain/mesh-session.d.cts +3 -3
  20. package/dist/domain/mesh-session.d.mts +3 -3
  21. package/dist/domain/relay-hub.d.cts +1 -1
  22. package/dist/domain/relay-hub.d.mts +1 -1
  23. package/dist/domain/revocation-view.d.cts +1 -1
  24. package/dist/domain/revocation-view.d.mts +1 -1
  25. package/dist/domain/room-token-verification.d.cts +1 -1
  26. package/dist/domain/room-token-verification.d.mts +1 -1
  27. package/dist/domain/tokens.cjs +2 -1
  28. package/dist/domain/tokens.d.cts +6 -2
  29. package/dist/domain/tokens.d.mts +6 -2
  30. package/dist/domain/tokens.mjs +2 -2
  31. package/dist/generated/protocol.cjs +6 -0
  32. package/dist/generated/protocol.d.cts +2 -2
  33. package/dist/generated/protocol.d.mts +2 -2
  34. package/dist/generated/protocol.mjs +6 -1
  35. package/dist/{identity-D8iJZRZZ.d.mts → identity-B1hBV3YA.d.mts} +1 -1
  36. package/dist/{identity-DkEe1465.d.cts → identity-BldV8xFj.d.cts} +1 -1
  37. package/dist/ports/identity.d.cts +1 -1
  38. package/dist/ports/identity.d.mts +1 -1
  39. package/dist/ports/transport.d.cts +1 -1
  40. package/dist/ports/transport.d.mts +1 -1
  41. package/dist/{protocol-MnxTzpRP.d.cts → protocol-Dhswk7YD.d.cts} +39 -1
  42. package/dist/{protocol-MnxTzpRP.d.mts → protocol-Dhswk7YD.d.mts} +39 -1
  43. package/dist/{transport-Da7GP9ya.d.cts → transport-BNNdUBq-.d.mts} +1 -1
  44. package/dist/{transport-ESMXRz3s.d.mts → transport-hEUxrdhT.d.cts} +1 -1
  45. package/package.json +5 -1
@@ -1,4 +1,4 @@
1
- import { E as Frame } from "../protocol-MnxTzpRP.cjs";
1
+ import { D as Frame } from "../protocol-Dhswk7YD.cjs";
2
2
  //#region src/adapters/frame-codec.d.ts
3
3
  export declare function messageFromFrame(frame: Frame): Uint8Array<ArrayBuffer>;
4
4
  /** A frame that fails schema validation, caught separately from a decode failure so it can be dropped without disconnecting. */
@@ -1,4 +1,4 @@
1
- import { E as Frame } from "../protocol-MnxTzpRP.mjs";
1
+ import { D as Frame } from "../protocol-Dhswk7YD.mjs";
2
2
  //#region src/adapters/frame-codec.d.ts
3
3
  export declare function messageFromFrame(frame: Frame): Uint8Array<ArrayBuffer>;
4
4
  /** A frame that fails schema validation, caught separately from a decode failure so it can be dropped without disconnecting. */
@@ -1,5 +1,5 @@
1
- import { N as IdentityKey, b as DeviceId } from "../protocol-MnxTzpRP.cjs";
2
- import { t as IdentityPort } from "../identity-DkEe1465.cjs";
1
+ import { P as IdentityKey, x as DeviceId } from "../protocol-Dhswk7YD.cjs";
2
+ import { t as IdentityPort } from "../identity-BldV8xFj.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 { N as IdentityKey, b as DeviceId } from "../protocol-MnxTzpRP.mjs";
2
- import { t as IdentityPort } from "../identity-D8iJZRZZ.mjs";
1
+ import { P as IdentityKey, x as DeviceId } from "../protocol-Dhswk7YD.mjs";
2
+ import { t as IdentityPort } from "../identity-B1hBV3YA.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-Da7GP9ya.cjs";
1
+ import { r as Transport } from "../transport-hEUxrdhT.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-ESMXRz3s.mjs";
1
+ import { r as Transport } from "../transport-BNNdUBq-.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,4 +1,4 @@
1
- import { r as Transport } from "../transport-Da7GP9ya.cjs";
1
+ import { r as Transport } from "../transport-hEUxrdhT.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-ESMXRz3s.mjs";
1
+ import { r as Transport } from "../transport-BNNdUBq-.mjs";
2
2
  //#region src/adapters/tls-transport.d.ts
3
3
  export interface TlsIdentity {
4
4
  certificatePem: string;
@@ -0,0 +1,90 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_generated_protocol = require("../generated/protocol.cjs");
3
+ const require_domain_tokens = require("./tokens.cjs");
4
+ //#region src/domain/capability-grant.ts
5
+ /**
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.
7
+ *
8
+ * Two responsibilities, split the same way capability-request.ts already splits them: sendCapabilityGrant is the pushing side (a thin wrapper over MeshSession.sendManageRequest), and createCapabilityGrantHandler is the receiving side (validates the pushed token against all four of management.cddl's own capability-grant obligations, then hands the verified grant to the domain). Unlike capability-request's handler, there is no decide()/timeout mechanism here: management.cddl deliberately specifies no protocol-level approval round trip for this primitive (a receiver's manage-response reports validation success or failure only, never a human decision), so onGrant is a plain notification callback, not an event carrying its own responder.
9
+ */
10
+ /**
11
+ * 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.
12
+ */
13
+ function buildCapabilityGrantCommand(capability, grantedToken) {
14
+ return {
15
+ verb: capability,
16
+ params: {
17
+ verb: "capability.grant",
18
+ "granted-token": grantedToken
19
+ }
20
+ };
21
+ }
22
+ /**
23
+ * Pushes an already-minted grantedToken to whichever peer this request is addressed to -- the caller mints grantedToken itself beforehand (there is no minting step here, unlike capability-request's own accept path, since this primitive carries a token the sender already decided to hand over unprompted). Resolves with the raw manage-response outcome: `{result:"ok"}` on successful validation, an ordinary manage-error otherwise (per management.cddl's own capability-grant obligations, this is a validation-failure code only, never a human "no" -- an application wanting a human-decision gate applies it on the RECEIVING side's own onGrant callback instead, exactly as core/room's own room.invite→room_invite delivery event already does today in agent-comms).
24
+ *
25
+ * scope and targetDevice forward directly to MeshSession.sendManageRequest's own identically-named parameters (the request's own top-level scope obligation 4 checks the token against, and relay routing respectively).
26
+ */
27
+ async function sendCapabilityGrant(session, capability, grantedToken, scope, targetDevice) {
28
+ return session.sendManageRequest(buildCapabilityGrantCommand(capability, grantedToken), scope, targetDevice);
29
+ }
30
+ /**
31
+ * Builds a reusable handler for one capability's incoming capability-grants. The returned function checks, in order: the outer verb names this handler's own capability (otherwise `{result:"error", code:"malformed"}`, matching capability-request.ts's identical check); the params payload parses against capability-grant's own CDDL shape (otherwise "malformed"); the embedded token independently passes every ordinary verifyCapabilityToken obligation with `expectedBearer` set to this receiver's OWN identity -- obligations 1 and 3 together, since an unsolicited push must name its actual recipient as bearer and must otherwise be exactly as valid as any other token (a verification failure responds with verifyCapabilityToken's own specific TokenVerdictReason as the error code, e.g. "expired"/"revoked"/"bad_signature", rather than a single generic code, mirroring how capability-request.ts already distinguishes "expired" from "malformed"); the token's own capability claim equals this handler's capability (obligation 2, otherwise "capability_mismatch"); and the token's own scope equals or roots the enclosing request's own top-level scope (obligation 4, via tokens.ts's own scopeNarrows -- otherwise "scope_mismatch"). Only once every obligation passes does it respond `{result:"ok"}` and invoke onGrant -- there is no decide()/timeout mechanism the way createCapabilityRequestHandler has one, since management.cddl specifies no protocol-level approval round trip for this primitive at all.
32
+ */
33
+ function createCapabilityGrantHandler(options) {
34
+ return async function handleCapabilityGrant(incoming) {
35
+ if (incoming.command.verb !== options.capability) {
36
+ await incoming.respond({
37
+ result: "error",
38
+ code: "malformed"
39
+ });
40
+ return;
41
+ }
42
+ const parsed = require_generated_protocol.capabilityGrantSchema.safeParse(incoming.command.params);
43
+ if (!parsed.success) {
44
+ await incoming.respond({
45
+ result: "error",
46
+ code: "malformed"
47
+ });
48
+ return;
49
+ }
50
+ const grantedToken = parsed.data["granted-token"];
51
+ const verdict = await require_domain_tokens.verifyCapabilityToken(grantedToken, {
52
+ identity: options.identity,
53
+ clock: options.clock,
54
+ revocation: options.revocation,
55
+ expectedBearer: options.identity.deviceId
56
+ });
57
+ if (!verdict.ok) {
58
+ await incoming.respond({
59
+ result: "error",
60
+ code: verdict.reason
61
+ });
62
+ return;
63
+ }
64
+ if (verdict.claims.capability !== options.capability) {
65
+ await incoming.respond({
66
+ result: "error",
67
+ code: "capability_mismatch"
68
+ });
69
+ return;
70
+ }
71
+ if (!require_domain_tokens.scopeNarrows(verdict.claims.scope, incoming.scope)) {
72
+ await incoming.respond({
73
+ result: "error",
74
+ code: "scope_mismatch"
75
+ });
76
+ return;
77
+ }
78
+ await incoming.respond({ result: "ok" });
79
+ options.onGrant({
80
+ capability: options.capability,
81
+ grantedToken,
82
+ scope: incoming.scope,
83
+ granterDevice: options.granterDevice
84
+ });
85
+ };
86
+ }
87
+ //#endregion
88
+ exports.buildCapabilityGrantCommand = buildCapabilityGrantCommand;
89
+ exports.createCapabilityGrantHandler = createCapabilityGrantHandler;
90
+ exports.sendCapabilityGrant = sendCapabilityGrant;
@@ -0,0 +1,44 @@
1
+ import { F as ManageCommand, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-Dhswk7YD.cjs";
2
+ import { t as IdentityPort } from "../identity-BldV8xFj.cjs";
3
+ import { t as Clock } from "../clock-DiSx-WKM.cjs";
4
+ import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.cjs";
5
+ import { RevocationCheck } from "./tokens.cjs";
6
+ //#region src/domain/capability-grant.d.ts
7
+ /**
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.
9
+ */
10
+ export declare function buildCapabilityGrantCommand(capability: string, grantedToken: CapabilityToken): ManageCommand;
11
+ /**
12
+ * Pushes an already-minted grantedToken to whichever peer this request is addressed to -- the caller mints grantedToken itself beforehand (there is no minting step here, unlike capability-request's own accept path, since this primitive carries a token the sender already decided to hand over unprompted). Resolves with the raw manage-response outcome: `{result:"ok"}` on successful validation, an ordinary manage-error otherwise (per management.cddl's own capability-grant obligations, this is a validation-failure code only, never a human "no" -- an application wanting a human-decision gate applies it on the RECEIVING side's own onGrant callback instead, exactly as core/room's own room.invite→room_invite delivery event already does today in agent-comms).
13
+ *
14
+ * scope and targetDevice forward directly to MeshSession.sendManageRequest's own identically-named parameters (the request's own top-level scope obligation 4 checks the token against, and relay routing respectively).
15
+ */
16
+ export declare function sendCapabilityGrant(session: Readonly<MeshSession>, capability: string, grantedToken: CapabilityToken, scope: Readonly<CapabilityScope>, targetDevice?: DeviceId): Promise<ManageOutcome>;
17
+ /** One incoming, fully-verified capability-grant, surfaced for the domain to react to (store the token, notify a human, etc.) -- there is no decide() here because management.cddl specifies no protocol-level approval round trip for this primitive; by the time onGrant fires, the wire response has already been sent. */
18
+ export interface CapabilityGrantEvent {
19
+ /** The capability granted -- equals both the outer manage-command.verb and the verified token's own capability claim (obligation 2 already enforced this before onGrant fires). */
20
+ capability: string;
21
+ /** The pushed token, already confirmed to independently pass every ordinary verifyCapabilityToken obligation, name this receiver as its own bearer, and scope-match the enclosing request (obligations 1, 2, 3, and 4 respectively). Ready to use exactly as capability-request.ts's own CapabilityGrantOk["granted-token"] is on the pull side. */
22
+ grantedToken: CapabilityToken;
23
+ /** The scope this grant's own manage-request-frame carried -- e.g. core/room's `{kind:"room", path: roomPath}` -- passed through unchanged so the domain can inspect it (a room handler reads `.path` back out) without this module needing to know its shape. */
24
+ scope: Readonly<CapabilityScope>;
25
+ /** The peer device-id authenticated on the connection this grant arrived on -- the granter, surfaced so the domain can attribute the push (e.g. core/room's own room_invite event names the inviter). Never itself checked against the token's bearer (obligation 1 checks the RECIPIENT's own identity instead -- an unsolicited push names its own recipient by where it was sent, not by who sent it). */
26
+ granterDevice: DeviceId;
27
+ }
28
+ export interface CreateCapabilityGrantHandlerOptions {
29
+ /** The capability this handler accepts pushed grants for. Checked against the incoming command's own outer verb (a mismatch is refused as malformed, mirroring capability-request.ts's identical capability check) and against the verified token's own capability claim (obligation 2); a caller wanting to accept grants for several distinct capabilities over one session constructs one handler per capability, the same way core/room constructs one handler for `room:member` and nothing else. */
30
+ capability: string;
31
+ /** This receiver's own identity -- both the verification primitives every pushed token is checked with, and (via `.deviceId`) the value obligation 1 requires the token's own bearer to equal. There is no separate bearerDevice option the way CreateCapabilityRequestHandlerOptions has one: capability-request's handler mints a NEW token for whichever peer asked, so it needs that peer's device-id as an input; capability-grant's handler verifies an ALREADY-minted token against this side's own identity, which identity.deviceId already provides. */
32
+ identity: IdentityPort;
33
+ clock: Clock;
34
+ revocation: RevocationCheck;
35
+ /** The peer device-id authenticated on this session's own connection -- the granter, surfaced on every CapabilityGrantEvent so the domain can attribute the push. Never used for verification itself (see CapabilityGrantEvent.granterDevice's own doc comment on why obligation 1 checks the recipient's identity instead). */
36
+ granterDevice: DeviceId;
37
+ /** Called once per incoming, fully-verified capability-grant. Fires after the wire response has already been sent (see createCapabilityGrantHandler's own doc comment) -- this is a notification, not a decision point. */
38
+ onGrant: (event: Readonly<CapabilityGrantEvent>) => void;
39
+ }
40
+ /**
41
+ * Builds a reusable handler for one capability's incoming capability-grants. The returned function checks, in order: the outer verb names this handler's own capability (otherwise `{result:"error", code:"malformed"}`, matching capability-request.ts's identical check); the params payload parses against capability-grant's own CDDL shape (otherwise "malformed"); the embedded token independently passes every ordinary verifyCapabilityToken obligation with `expectedBearer` set to this receiver's OWN identity -- obligations 1 and 3 together, since an unsolicited push must name its actual recipient as bearer and must otherwise be exactly as valid as any other token (a verification failure responds with verifyCapabilityToken's own specific TokenVerdictReason as the error code, e.g. "expired"/"revoked"/"bad_signature", rather than a single generic code, mirroring how capability-request.ts already distinguishes "expired" from "malformed"); the token's own capability claim equals this handler's capability (obligation 2, otherwise "capability_mismatch"); and the token's own scope equals or roots the enclosing request's own top-level scope (obligation 4, via tokens.ts's own scopeNarrows -- otherwise "scope_mismatch"). Only once every obligation passes does it respond `{result:"ok"}` and invoke onGrant -- there is no decide()/timeout mechanism the way createCapabilityRequestHandler has one, since management.cddl specifies no protocol-level approval round trip for this primitive at all.
42
+ */
43
+ export declare function createCapabilityGrantHandler(options: Readonly<CreateCapabilityGrantHandlerOptions>): (incoming: Readonly<IncomingManageRequest>) => Promise<void>;
44
+ //#endregion
@@ -0,0 +1,44 @@
1
+ import { F as ManageCommand, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-Dhswk7YD.mjs";
2
+ import { t as IdentityPort } from "../identity-B1hBV3YA.mjs";
3
+ import { t as Clock } from "../clock-DiSx-WKM.mjs";
4
+ import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.mjs";
5
+ import { RevocationCheck } from "./tokens.mjs";
6
+ //#region src/domain/capability-grant.d.ts
7
+ /**
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.
9
+ */
10
+ export declare function buildCapabilityGrantCommand(capability: string, grantedToken: CapabilityToken): ManageCommand;
11
+ /**
12
+ * Pushes an already-minted grantedToken to whichever peer this request is addressed to -- the caller mints grantedToken itself beforehand (there is no minting step here, unlike capability-request's own accept path, since this primitive carries a token the sender already decided to hand over unprompted). Resolves with the raw manage-response outcome: `{result:"ok"}` on successful validation, an ordinary manage-error otherwise (per management.cddl's own capability-grant obligations, this is a validation-failure code only, never a human "no" -- an application wanting a human-decision gate applies it on the RECEIVING side's own onGrant callback instead, exactly as core/room's own room.invite→room_invite delivery event already does today in agent-comms).
13
+ *
14
+ * scope and targetDevice forward directly to MeshSession.sendManageRequest's own identically-named parameters (the request's own top-level scope obligation 4 checks the token against, and relay routing respectively).
15
+ */
16
+ export declare function sendCapabilityGrant(session: Readonly<MeshSession>, capability: string, grantedToken: CapabilityToken, scope: Readonly<CapabilityScope>, targetDevice?: DeviceId): Promise<ManageOutcome>;
17
+ /** One incoming, fully-verified capability-grant, surfaced for the domain to react to (store the token, notify a human, etc.) -- there is no decide() here because management.cddl specifies no protocol-level approval round trip for this primitive; by the time onGrant fires, the wire response has already been sent. */
18
+ export interface CapabilityGrantEvent {
19
+ /** The capability granted -- equals both the outer manage-command.verb and the verified token's own capability claim (obligation 2 already enforced this before onGrant fires). */
20
+ capability: string;
21
+ /** The pushed token, already confirmed to independently pass every ordinary verifyCapabilityToken obligation, name this receiver as its own bearer, and scope-match the enclosing request (obligations 1, 2, 3, and 4 respectively). Ready to use exactly as capability-request.ts's own CapabilityGrantOk["granted-token"] is on the pull side. */
22
+ grantedToken: CapabilityToken;
23
+ /** The scope this grant's own manage-request-frame carried -- e.g. core/room's `{kind:"room", path: roomPath}` -- passed through unchanged so the domain can inspect it (a room handler reads `.path` back out) without this module needing to know its shape. */
24
+ scope: Readonly<CapabilityScope>;
25
+ /** The peer device-id authenticated on the connection this grant arrived on -- the granter, surfaced so the domain can attribute the push (e.g. core/room's own room_invite event names the inviter). Never itself checked against the token's bearer (obligation 1 checks the RECIPIENT's own identity instead -- an unsolicited push names its own recipient by where it was sent, not by who sent it). */
26
+ granterDevice: DeviceId;
27
+ }
28
+ export interface CreateCapabilityGrantHandlerOptions {
29
+ /** The capability this handler accepts pushed grants for. Checked against the incoming command's own outer verb (a mismatch is refused as malformed, mirroring capability-request.ts's identical capability check) and against the verified token's own capability claim (obligation 2); a caller wanting to accept grants for several distinct capabilities over one session constructs one handler per capability, the same way core/room constructs one handler for `room:member` and nothing else. */
30
+ capability: string;
31
+ /** This receiver's own identity -- both the verification primitives every pushed token is checked with, and (via `.deviceId`) the value obligation 1 requires the token's own bearer to equal. There is no separate bearerDevice option the way CreateCapabilityRequestHandlerOptions has one: capability-request's handler mints a NEW token for whichever peer asked, so it needs that peer's device-id as an input; capability-grant's handler verifies an ALREADY-minted token against this side's own identity, which identity.deviceId already provides. */
32
+ identity: IdentityPort;
33
+ clock: Clock;
34
+ revocation: RevocationCheck;
35
+ /** The peer device-id authenticated on this session's own connection -- the granter, surfaced on every CapabilityGrantEvent so the domain can attribute the push. Never used for verification itself (see CapabilityGrantEvent.granterDevice's own doc comment on why obligation 1 checks the recipient's identity instead). */
36
+ granterDevice: DeviceId;
37
+ /** Called once per incoming, fully-verified capability-grant. Fires after the wire response has already been sent (see createCapabilityGrantHandler's own doc comment) -- this is a notification, not a decision point. */
38
+ onGrant: (event: Readonly<CapabilityGrantEvent>) => void;
39
+ }
40
+ /**
41
+ * Builds a reusable handler for one capability's incoming capability-grants. The returned function checks, in order: the outer verb names this handler's own capability (otherwise `{result:"error", code:"malformed"}`, matching capability-request.ts's identical check); the params payload parses against capability-grant's own CDDL shape (otherwise "malformed"); the embedded token independently passes every ordinary verifyCapabilityToken obligation with `expectedBearer` set to this receiver's OWN identity -- obligations 1 and 3 together, since an unsolicited push must name its actual recipient as bearer and must otherwise be exactly as valid as any other token (a verification failure responds with verifyCapabilityToken's own specific TokenVerdictReason as the error code, e.g. "expired"/"revoked"/"bad_signature", rather than a single generic code, mirroring how capability-request.ts already distinguishes "expired" from "malformed"); the token's own capability claim equals this handler's capability (obligation 2, otherwise "capability_mismatch"); and the token's own scope equals or roots the enclosing request's own top-level scope (obligation 4, via tokens.ts's own scopeNarrows -- otherwise "scope_mismatch"). Only once every obligation passes does it respond `{result:"ok"}` and invoke onGrant -- there is no decide()/timeout mechanism the way createCapabilityRequestHandler has one, since management.cddl specifies no protocol-level approval round trip for this primitive at all.
42
+ */
43
+ export declare function createCapabilityGrantHandler(options: Readonly<CreateCapabilityGrantHandlerOptions>): (incoming: Readonly<IncomingManageRequest>) => Promise<void>;
44
+ //#endregion
@@ -0,0 +1,87 @@
1
+ import { capabilityGrantSchema } from "../generated/protocol.mjs";
2
+ import { scopeNarrows, verifyCapabilityToken } from "./tokens.mjs";
3
+ //#region src/domain/capability-grant.ts
4
+ /**
5
+ * 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.
6
+ *
7
+ * Two responsibilities, split the same way capability-request.ts already splits them: sendCapabilityGrant is the pushing side (a thin wrapper over MeshSession.sendManageRequest), and createCapabilityGrantHandler is the receiving side (validates the pushed token against all four of management.cddl's own capability-grant obligations, then hands the verified grant to the domain). Unlike capability-request's handler, there is no decide()/timeout mechanism here: management.cddl deliberately specifies no protocol-level approval round trip for this primitive (a receiver's manage-response reports validation success or failure only, never a human decision), so onGrant is a plain notification callback, not an event carrying its own responder.
8
+ */
9
+ /**
10
+ * 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.
11
+ */
12
+ function buildCapabilityGrantCommand(capability, grantedToken) {
13
+ return {
14
+ verb: capability,
15
+ params: {
16
+ verb: "capability.grant",
17
+ "granted-token": grantedToken
18
+ }
19
+ };
20
+ }
21
+ /**
22
+ * Pushes an already-minted grantedToken to whichever peer this request is addressed to -- the caller mints grantedToken itself beforehand (there is no minting step here, unlike capability-request's own accept path, since this primitive carries a token the sender already decided to hand over unprompted). Resolves with the raw manage-response outcome: `{result:"ok"}` on successful validation, an ordinary manage-error otherwise (per management.cddl's own capability-grant obligations, this is a validation-failure code only, never a human "no" -- an application wanting a human-decision gate applies it on the RECEIVING side's own onGrant callback instead, exactly as core/room's own room.invite→room_invite delivery event already does today in agent-comms).
23
+ *
24
+ * scope and targetDevice forward directly to MeshSession.sendManageRequest's own identically-named parameters (the request's own top-level scope obligation 4 checks the token against, and relay routing respectively).
25
+ */
26
+ async function sendCapabilityGrant(session, capability, grantedToken, scope, targetDevice) {
27
+ return session.sendManageRequest(buildCapabilityGrantCommand(capability, grantedToken), scope, targetDevice);
28
+ }
29
+ /**
30
+ * Builds a reusable handler for one capability's incoming capability-grants. The returned function checks, in order: the outer verb names this handler's own capability (otherwise `{result:"error", code:"malformed"}`, matching capability-request.ts's identical check); the params payload parses against capability-grant's own CDDL shape (otherwise "malformed"); the embedded token independently passes every ordinary verifyCapabilityToken obligation with `expectedBearer` set to this receiver's OWN identity -- obligations 1 and 3 together, since an unsolicited push must name its actual recipient as bearer and must otherwise be exactly as valid as any other token (a verification failure responds with verifyCapabilityToken's own specific TokenVerdictReason as the error code, e.g. "expired"/"revoked"/"bad_signature", rather than a single generic code, mirroring how capability-request.ts already distinguishes "expired" from "malformed"); the token's own capability claim equals this handler's capability (obligation 2, otherwise "capability_mismatch"); and the token's own scope equals or roots the enclosing request's own top-level scope (obligation 4, via tokens.ts's own scopeNarrows -- otherwise "scope_mismatch"). Only once every obligation passes does it respond `{result:"ok"}` and invoke onGrant -- there is no decide()/timeout mechanism the way createCapabilityRequestHandler has one, since management.cddl specifies no protocol-level approval round trip for this primitive at all.
31
+ */
32
+ function createCapabilityGrantHandler(options) {
33
+ return async function handleCapabilityGrant(incoming) {
34
+ if (incoming.command.verb !== options.capability) {
35
+ await incoming.respond({
36
+ result: "error",
37
+ code: "malformed"
38
+ });
39
+ return;
40
+ }
41
+ const parsed = capabilityGrantSchema.safeParse(incoming.command.params);
42
+ if (!parsed.success) {
43
+ await incoming.respond({
44
+ result: "error",
45
+ code: "malformed"
46
+ });
47
+ return;
48
+ }
49
+ const grantedToken = parsed.data["granted-token"];
50
+ const verdict = await verifyCapabilityToken(grantedToken, {
51
+ identity: options.identity,
52
+ clock: options.clock,
53
+ revocation: options.revocation,
54
+ expectedBearer: options.identity.deviceId
55
+ });
56
+ if (!verdict.ok) {
57
+ await incoming.respond({
58
+ result: "error",
59
+ code: verdict.reason
60
+ });
61
+ return;
62
+ }
63
+ if (verdict.claims.capability !== options.capability) {
64
+ await incoming.respond({
65
+ result: "error",
66
+ code: "capability_mismatch"
67
+ });
68
+ return;
69
+ }
70
+ if (!scopeNarrows(verdict.claims.scope, incoming.scope)) {
71
+ await incoming.respond({
72
+ result: "error",
73
+ code: "scope_mismatch"
74
+ });
75
+ return;
76
+ }
77
+ await incoming.respond({ result: "ok" });
78
+ options.onGrant({
79
+ capability: options.capability,
80
+ grantedToken,
81
+ scope: incoming.scope,
82
+ granterDevice: options.granterDevice
83
+ });
84
+ };
85
+ }
86
+ //#endregion
87
+ export { buildCapabilityGrantCommand, createCapabilityGrantHandler, sendCapabilityGrant };
@@ -1,5 +1,5 @@
1
- import { P as ManageCommand, a as CapabilityScope, b as DeviceId, r as CapabilityGrantOk } from "../protocol-MnxTzpRP.cjs";
2
- import { t as IdentityPort } from "../identity-DkEe1465.cjs";
1
+ import { F as ManageCommand, i as CapabilityGrantOk, o as CapabilityScope, 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
  import { IncomingManageRequest, MeshSession } from "./mesh-session.cjs";
5
5
  //#region src/domain/capability-request.d.ts
@@ -1,5 +1,5 @@
1
- import { P as ManageCommand, a as CapabilityScope, b as DeviceId, r as CapabilityGrantOk } from "../protocol-MnxTzpRP.mjs";
2
- import { t as IdentityPort } from "../identity-D8iJZRZZ.mjs";
1
+ import { F as ManageCommand, i as CapabilityGrantOk, o as CapabilityScope, 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
  import { IncomingManageRequest, MeshSession } from "./mesh-session.mjs";
5
5
  //#region src/domain/capability-request.d.ts
@@ -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 { r as Transport, t as Connection } from "../transport-Da7GP9ya.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 { r as Transport, t as Connection } from "../transport-ESMXRz3s.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 { t as Connection } from "../transport-Da7GP9ya.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 { t as Connection } from "../transport-ESMXRz3s.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,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,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. */
@@ -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,2 +1,2 @@
1
- import { n as Listener, r as Transport, t as Connection } from "../transport-Da7GP9ya.cjs";
1
+ import { n as Listener, r as Transport, t as Connection } from "../transport-hEUxrdhT.cjs";
2
2
  export { Connection, Listener, Transport };
@@ -1,2 +1,2 @@
1
- import { n as Listener, r as Transport, t as Connection } from "../transport-ESMXRz3s.mjs";
1
+ import { n as Listener, r as Transport, t as Connection } from "../transport-BNNdUBq-.mjs";
2
2
  export { Connection, Listener, Transport };
@@ -75,6 +75,12 @@ declare const manageCommandParamsSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodUni
75
75
  verb: z.ZodLiteral<"capability.request">;
76
76
  capability: z.ZodString;
77
77
  "valid-until": z.ZodOptional<z.ZodNumber>;
78
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
79
+ verb: z.ZodLiteral<"capability.grant">;
80
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
81
+ "1": z.ZodOptional<z.ZodNumber>;
82
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
83
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
78
84
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodObject<{
79
85
  verb: z.ZodLiteral<"room.send">;
80
86
  "message-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
@@ -263,6 +269,12 @@ declare const frameVariantSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.Zod
263
269
  verb: z.ZodLiteral<"capability.request">;
264
270
  capability: z.ZodString;
265
271
  "valid-until": z.ZodOptional<z.ZodNumber>;
272
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
273
+ verb: z.ZodLiteral<"capability.grant">;
274
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
275
+ "1": z.ZodOptional<z.ZodNumber>;
276
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
277
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
266
278
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodObject<{
267
279
  verb: z.ZodLiteral<"room.send">;
268
280
  "message-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
@@ -457,6 +469,12 @@ declare const frameSchema: z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodUnion<readonly [z.
457
469
  verb: z.ZodLiteral<"capability.request">;
458
470
  capability: z.ZodString;
459
471
  "valid-until": z.ZodOptional<z.ZodNumber>;
472
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
473
+ verb: z.ZodLiteral<"capability.grant">;
474
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
475
+ "1": z.ZodOptional<z.ZodNumber>;
476
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
477
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
460
478
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodObject<{
461
479
  verb: z.ZodLiteral<"room.send">;
462
480
  "message-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
@@ -622,6 +640,12 @@ declare const manageCommandSchema: z.ZodLazy<z.ZodObject<{
622
640
  verb: z.ZodLiteral<"capability.request">;
623
641
  capability: z.ZodString;
624
642
  "valid-until": z.ZodOptional<z.ZodNumber>;
643
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
644
+ verb: z.ZodLiteral<"capability.grant">;
645
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
646
+ "1": z.ZodOptional<z.ZodNumber>;
647
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
648
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
625
649
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodObject<{
626
650
  verb: z.ZodLiteral<"room.send">;
627
651
  "message-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
@@ -712,6 +736,12 @@ declare const manageRequestFrameSchema: z.ZodLazy<z.ZodObject<{
712
736
  verb: z.ZodLiteral<"capability.request">;
713
737
  capability: z.ZodString;
714
738
  "valid-until": z.ZodOptional<z.ZodNumber>;
739
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
740
+ verb: z.ZodLiteral<"capability.grant">;
741
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
742
+ "1": z.ZodOptional<z.ZodNumber>;
743
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
744
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
715
745
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodObject<{
716
746
  verb: z.ZodLiteral<"room.send">;
717
747
  "message-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
@@ -798,6 +828,13 @@ declare const capabilityGrantOkSchema: z.ZodLazy<z.ZodObject<{
798
828
  "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
799
829
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
800
830
  }, z.core.$catchall<z.ZodUnknown>>>;
831
+ declare const capabilityGrantSchema: z.ZodLazy<z.ZodObject<{
832
+ verb: z.ZodLiteral<"capability.grant">;
833
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
834
+ "1": z.ZodOptional<z.ZodNumber>;
835
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
836
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
837
+ }, z.core.$catchall<z.ZodUnknown>>>;
801
838
  declare const revocationClaimsSchema: z.ZodLazy<z.ZodObject<{
802
839
  "token-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
803
840
  issuer: z.ZodLazy<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
@@ -1091,6 +1128,7 @@ type ManageError = z.infer<typeof manageErrorSchema>;
1091
1128
  type ManageResponseFrame = z.infer<typeof manageResponseFrameSchema>;
1092
1129
  type CapabilityRequest = z.infer<typeof capabilityRequestSchema>;
1093
1130
  type CapabilityGrantOk = z.infer<typeof capabilityGrantOkSchema>;
1131
+ type CapabilityGrant = z.infer<typeof capabilityGrantSchema>;
1094
1132
  type RevocationClaims = z.infer<typeof revocationClaimsSchema>;
1095
1133
  type RevocationEntry = z.infer<typeof revocationEntrySchema>;
1096
1134
  type RevocationAnnounceFrame = z.infer<typeof revocationAnnounceFrameSchema>;
@@ -1145,4 +1183,4 @@ type WebrtcAnswer = z.infer<typeof webrtcAnswerSchema>;
1145
1183
  type WebrtcIceCandidate = z.infer<typeof webrtcIceCandidateSchema>;
1146
1184
  type IceCandidateInit = z.infer<typeof iceCandidateInitSchema>;
1147
1185
  //#endregion
1148
- export { ProtocolVersion as $, roomReadSchema as $n, deviceIdSchema as $t, HandleRecord as A, procSpawnSchema as An, WebrtcIceCandidate as At, MessageRef as B, revocationAnnounceFrameSchema as Bn, closeFrameSchema as Bt, DomainId as C, peerAdvertSchema as Cn, StreamAckFrame as Ct, FrameVariant as D, privateUseDomainIdSchema as Dn, SyncPunchFrame as Dt, Frame as E, privateUseCapabilitySchema as En, StreamSession as Et, ManageCommandParams as F, ptyWriteSchema as Fn, capabilityGrantOkSchema as Ft, PeerAdvert as G, roomJoinSchema as Gn, coseHeaderKidSchema as Gt, NamespacedDomainId as H, revocationEntrySchema as Hn, coreCapabilitySchema as Ht, ManageError as I, relayConnectFrameSchema as In, capabilityRequestSchema as It, PrivateUseCapability as J, roomMembersOkSchema as Jn, coseTokenHeadersSchema as Jt, PeerIdentity as K, roomLeaveSchema as Kn, coseHeaderLabelSchema as Kt, ManageOk as L, relayDataFrameSchema as Ln, capabilityScopeSchema as Lt, IceCandidateInit as M, ptyKillSchema as Mn, WireCandidate as Mt, IdentityKey as N, ptyResizeSchema as Nn, candidateKindSchema as Nt, GossipFrame as O, procKillSchema as On, TokenClaims as Ot, ManageCommand as P, ptySpawnSchema as Pn, candidatesFrameSchema as Pt, ProcSpawn as Q, roomPathSchema as Qn, deviceIdHexSchema as Qt, ManageRequestFrame as R, relayInboundFrameSchema as Rn, capabilityTokenSchema as Rt, DmRoomPath as S, ownerNamedRoomPathSchema as Sn, RoomSend as St, ExecSessionInfo as T, pingFrameSchema as Tn, StreamEndFrame as Tt, ObservedAddressFrame as U, roomInviteSchema as Un, coreDomainNameSchema as Ut, NamespacedCapability as V, revocationClaimsSchema as Vn, coordinatorFrameSchema as Vt, OwnerNamedRoomPath as W, roomJoinOkSchema as Wn, coseHeaderAlgSchema as Wt, ProcKill as X, roomNoticeClaimsSchema as Xn, dataHaveFrameSchema as Xt, PrivateUseDomainId as Y, roomMembersSchema as Yn, dataEntriesFrameSchema as Yt, ProcSignal as Z, roomNoticeSchema as Zn, dataRequestFrameSchema as Zt, DataEntriesFrame as _, manageResponseFrameSchema as _n, RoomMembersOk as _t, CapabilityScope as a, frameVariantSchema as an, syncPunchFrameSchema as ar, RelayDataFrame as at, DeviceId as b, namespacedDomainIdSchema as bn, RoomPath as bt, CloseFrame as c, handleRecordSchema as cn, webrtcIceCandidateSchema as cr, RevocationAnnounceFrame as ct, CoreDomainName as d, identityKeySchema as dn, RoomInvite as dt, dmRoomPathSchema as en, roomSendSchema as er, PtyKill as et, CoseHeaderAlg as f, manageCommandParamsSchema as fn, RoomJoin as ft, CoseTokenHeaders as g, manageRequestFrameSchema as gn, RoomMembers as gt, CoseSign1 as h, manageOkSchema as hn, RoomMember as ht, CapabilityRequest as i, frameSchema as in, streamSessionSchema as ir, RelayConnectFrame as it, HandshakeFrame as j, protocolVersionSchema as jn, WebrtcOffer as jt, HandleClaims as k, procSignalSchema as kn, WebrtcAnswer as kt, CoordinatorFrame as l, handshakeFrameSchema as ln, webrtcOfferSchema as lr, RevocationClaims as lt, CoseHeaderLabel as m, manageErrorSchema as mn, RoomLeave as mt, CandidatesFrame as n, execListSchema as nn, streamDataFrameSchema as nr, PtySpawn as nt, CapabilityToken as o, gossipFrameSchema as on, tokenClaimsSchema as or, RelayInboundFrame as ot, CoseHeaderKid as p, manageCommandSchema as pn, RoomJoinOk as pt, PingFrame as q, roomMemberSchema as qn, coseSign1Schema as qt, CapabilityGrantOk as r, execSessionInfoSchema as rn, streamEndFrameSchema as rr, PtyWrite as rt, CapabilityVerb as s, handleClaimsSchema as sn, webrtcAnswerSchema as sr, RelayOfferFrame as st, CandidateKind as t, domainIdSchema as tn, streamAckFrameSchema as tr, PtyResize as tt, CoreCapability as u, iceCandidateInitSchema as un, wireCandidateSchema as ur, RevocationEntry as ut, DataHaveFrame as v, messageRefSchema as vn, RoomNotice as vt, ExecList as w, peerIdentitySchema as wn, StreamDataFrame as wt, DeviceIdHex as x, observedAddressFrameSchema as xn, RoomRead as xt, DataRequestFrame as y, namespacedCapabilitySchema as yn, RoomNoticeClaims as yt, ManageResponseFrame as z, relayOfferFrameSchema as zn, capabilityVerbSchema as zt };
1186
+ export { ProcSpawn as $, roomNoticeSchema as $n, dataRequestFrameSchema as $t, HandleClaims as A, procKillSchema as An, WebrtcAnswer as At, ManageResponseFrame as B, relayInboundFrameSchema as Bn, capabilityTokenSchema as Bt, DmRoomPath as C, observedAddressFrameSchema as Cn, RoomSend as Ct, Frame as D, pingFrameSchema as Dn, StreamSession as Dt, ExecSessionInfo as E, peerIdentitySchema as En, StreamEndFrame as Et, ManageCommand as F, ptyResizeSchema as Fn, candidatesFrameSchema as Ft, OwnerNamedRoomPath as G, roomInviteSchema as Gn, coreDomainNameSchema as Gt, NamespacedCapability as H, revocationAnnounceFrameSchema as Hn, closeFrameSchema as Ht, ManageCommandParams as I, ptySpawnSchema as In, capabilityGrantOkSchema as It, PingFrame as J, roomLeaveSchema as Jn, coseHeaderLabelSchema as Jt, PeerAdvert as K, roomJoinOkSchema as Kn, coseHeaderAlgSchema as Kt, ManageError as L, ptyWriteSchema as Ln, capabilityGrantSchema as Lt, HandshakeFrame as M, procSpawnSchema as Mn, WebrtcOffer as Mt, IceCandidateInit as N, protocolVersionSchema as Nn, WireCandidate as Nt, FrameVariant as O, privateUseCapabilitySchema as On, SyncPunchFrame as Ot, IdentityKey as P, ptyKillSchema as Pn, candidateKindSchema as Pt, ProcSignal as Q, roomNoticeClaimsSchema as Qn, dataHaveFrameSchema as Qt, ManageOk as R, relayConnectFrameSchema as Rn, capabilityRequestSchema as Rt, DeviceIdHex as S, namespacedDomainIdSchema as Sn, RoomRead as St, ExecList as T, peerAdvertSchema as Tn, StreamDataFrame as Tt, NamespacedDomainId as U, revocationClaimsSchema as Un, coordinatorFrameSchema as Ut, MessageRef as V, relayOfferFrameSchema as Vn, capabilityVerbSchema as Vt, ObservedAddressFrame as W, revocationEntrySchema as Wn, coreCapabilitySchema as Wt, PrivateUseDomainId as X, roomMembersOkSchema as Xn, coseTokenHeadersSchema as Xt, PrivateUseCapability as Y, roomMemberSchema as Yn, coseSign1Schema as Yt, ProcKill as Z, roomMembersSchema as Zn, dataEntriesFrameSchema as Zt, CoseTokenHeaders as _, manageOkSchema as _n, RoomMembers as _t, CapabilityRequest as a, execSessionInfoSchema as an, streamEndFrameSchema as ar, RelayConnectFrame as at, DataRequestFrame as b, messageRefSchema as bn, RoomNoticeClaims as bt, CapabilityVerb as c, gossipFrameSchema as cn, tokenClaimsSchema as cr, RelayOfferFrame as ct, CoreCapability as d, handshakeFrameSchema as dn, webrtcOfferSchema as dr, RevocationEntry as dt, deviceIdHexSchema as en, roomPathSchema as er, ProtocolVersion as et, CoreDomainName as f, iceCandidateInitSchema as fn, wireCandidateSchema as fr, RoomInvite as ft, CoseSign1 as g, manageErrorSchema as gn, RoomMember as gt, CoseHeaderLabel as h, manageCommandSchema as hn, RoomLeave as ht, CapabilityGrantOk as i, execListSchema as in, streamDataFrameSchema as ir, PtyWrite as it, HandleRecord as j, procSignalSchema as jn, WebrtcIceCandidate as jt, GossipFrame as k, privateUseDomainIdSchema as kn, TokenClaims as kt, CloseFrame as l, handleClaimsSchema as ln, webrtcAnswerSchema as lr, RevocationAnnounceFrame as lt, CoseHeaderKid as m, manageCommandParamsSchema as mn, RoomJoinOk as mt, CandidatesFrame as n, dmRoomPathSchema as nn, roomSendSchema as nr, PtyResize as nt, CapabilityScope as o, frameSchema as on, streamSessionSchema as or, RelayDataFrame as ot, CoseHeaderAlg as p, identityKeySchema as pn, RoomJoin as pt, PeerIdentity as q, roomJoinSchema as qn, coseHeaderKidSchema as qt, CapabilityGrant as r, domainIdSchema as rn, streamAckFrameSchema as rr, PtySpawn as rt, CapabilityToken as s, frameVariantSchema as sn, syncPunchFrameSchema as sr, RelayInboundFrame as st, CandidateKind as t, deviceIdSchema as tn, roomReadSchema as tr, PtyKill as tt, CoordinatorFrame as u, handleRecordSchema as un, webrtcIceCandidateSchema as ur, RevocationClaims as ut, DataEntriesFrame as v, manageRequestFrameSchema as vn, RoomMembersOk as vt, DomainId as w, ownerNamedRoomPathSchema as wn, StreamAckFrame as wt, DeviceId as x, namespacedCapabilitySchema as xn, RoomPath as xt, DataHaveFrame as y, manageResponseFrameSchema as yn, RoomNotice as yt, ManageRequestFrame as z, relayDataFrameSchema as zn, capabilityScopeSchema as zt };
@@ -75,6 +75,12 @@ declare const manageCommandParamsSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodUni
75
75
  verb: z.ZodLiteral<"capability.request">;
76
76
  capability: z.ZodString;
77
77
  "valid-until": z.ZodOptional<z.ZodNumber>;
78
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
79
+ verb: z.ZodLiteral<"capability.grant">;
80
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
81
+ "1": z.ZodOptional<z.ZodNumber>;
82
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
83
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
78
84
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodObject<{
79
85
  verb: z.ZodLiteral<"room.send">;
80
86
  "message-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
@@ -263,6 +269,12 @@ declare const frameVariantSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.Zod
263
269
  verb: z.ZodLiteral<"capability.request">;
264
270
  capability: z.ZodString;
265
271
  "valid-until": z.ZodOptional<z.ZodNumber>;
272
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
273
+ verb: z.ZodLiteral<"capability.grant">;
274
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
275
+ "1": z.ZodOptional<z.ZodNumber>;
276
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
277
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
266
278
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodObject<{
267
279
  verb: z.ZodLiteral<"room.send">;
268
280
  "message-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
@@ -457,6 +469,12 @@ declare const frameSchema: z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodUnion<readonly [z.
457
469
  verb: z.ZodLiteral<"capability.request">;
458
470
  capability: z.ZodString;
459
471
  "valid-until": z.ZodOptional<z.ZodNumber>;
472
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
473
+ verb: z.ZodLiteral<"capability.grant">;
474
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
475
+ "1": z.ZodOptional<z.ZodNumber>;
476
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
477
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
460
478
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodObject<{
461
479
  verb: z.ZodLiteral<"room.send">;
462
480
  "message-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
@@ -622,6 +640,12 @@ declare const manageCommandSchema: z.ZodLazy<z.ZodObject<{
622
640
  verb: z.ZodLiteral<"capability.request">;
623
641
  capability: z.ZodString;
624
642
  "valid-until": z.ZodOptional<z.ZodNumber>;
643
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
644
+ verb: z.ZodLiteral<"capability.grant">;
645
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
646
+ "1": z.ZodOptional<z.ZodNumber>;
647
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
648
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
625
649
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodObject<{
626
650
  verb: z.ZodLiteral<"room.send">;
627
651
  "message-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
@@ -712,6 +736,12 @@ declare const manageRequestFrameSchema: z.ZodLazy<z.ZodObject<{
712
736
  verb: z.ZodLiteral<"capability.request">;
713
737
  capability: z.ZodString;
714
738
  "valid-until": z.ZodOptional<z.ZodNumber>;
739
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
740
+ verb: z.ZodLiteral<"capability.grant">;
741
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
742
+ "1": z.ZodOptional<z.ZodNumber>;
743
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
744
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
715
745
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodLazy<z.ZodLazy<z.ZodObject<{
716
746
  verb: z.ZodLiteral<"room.send">;
717
747
  "message-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
@@ -798,6 +828,13 @@ declare const capabilityGrantOkSchema: z.ZodLazy<z.ZodObject<{
798
828
  "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
799
829
  }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
800
830
  }, z.core.$catchall<z.ZodUnknown>>>;
831
+ declare const capabilityGrantSchema: z.ZodLazy<z.ZodObject<{
832
+ verb: z.ZodLiteral<"capability.grant">;
833
+ "granted-token": z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodLazy<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodLazy<z.ZodLazy<z.ZodObject<{
834
+ "1": z.ZodOptional<z.ZodNumber>;
835
+ "4": z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
836
+ }, z.core.$catchall<z.ZodUnknown>>>>, z.ZodUnion<readonly [z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodNull]>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>], null>>>>>;
837
+ }, z.core.$catchall<z.ZodUnknown>>>;
801
838
  declare const revocationClaimsSchema: z.ZodLazy<z.ZodObject<{
802
839
  "token-id": z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
803
840
  issuer: z.ZodLazy<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
@@ -1091,6 +1128,7 @@ type ManageError = z.infer<typeof manageErrorSchema>;
1091
1128
  type ManageResponseFrame = z.infer<typeof manageResponseFrameSchema>;
1092
1129
  type CapabilityRequest = z.infer<typeof capabilityRequestSchema>;
1093
1130
  type CapabilityGrantOk = z.infer<typeof capabilityGrantOkSchema>;
1131
+ type CapabilityGrant = z.infer<typeof capabilityGrantSchema>;
1094
1132
  type RevocationClaims = z.infer<typeof revocationClaimsSchema>;
1095
1133
  type RevocationEntry = z.infer<typeof revocationEntrySchema>;
1096
1134
  type RevocationAnnounceFrame = z.infer<typeof revocationAnnounceFrameSchema>;
@@ -1145,4 +1183,4 @@ type WebrtcAnswer = z.infer<typeof webrtcAnswerSchema>;
1145
1183
  type WebrtcIceCandidate = z.infer<typeof webrtcIceCandidateSchema>;
1146
1184
  type IceCandidateInit = z.infer<typeof iceCandidateInitSchema>;
1147
1185
  //#endregion
1148
- export { ProtocolVersion as $, roomReadSchema as $n, deviceIdSchema as $t, HandleRecord as A, procSpawnSchema as An, WebrtcIceCandidate as At, MessageRef as B, revocationAnnounceFrameSchema as Bn, closeFrameSchema as Bt, DomainId as C, peerAdvertSchema as Cn, StreamAckFrame as Ct, FrameVariant as D, privateUseDomainIdSchema as Dn, SyncPunchFrame as Dt, Frame as E, privateUseCapabilitySchema as En, StreamSession as Et, ManageCommandParams as F, ptyWriteSchema as Fn, capabilityGrantOkSchema as Ft, PeerAdvert as G, roomJoinSchema as Gn, coseHeaderKidSchema as Gt, NamespacedDomainId as H, revocationEntrySchema as Hn, coreCapabilitySchema as Ht, ManageError as I, relayConnectFrameSchema as In, capabilityRequestSchema as It, PrivateUseCapability as J, roomMembersOkSchema as Jn, coseTokenHeadersSchema as Jt, PeerIdentity as K, roomLeaveSchema as Kn, coseHeaderLabelSchema as Kt, ManageOk as L, relayDataFrameSchema as Ln, capabilityScopeSchema as Lt, IceCandidateInit as M, ptyKillSchema as Mn, WireCandidate as Mt, IdentityKey as N, ptyResizeSchema as Nn, candidateKindSchema as Nt, GossipFrame as O, procKillSchema as On, TokenClaims as Ot, ManageCommand as P, ptySpawnSchema as Pn, candidatesFrameSchema as Pt, ProcSpawn as Q, roomPathSchema as Qn, deviceIdHexSchema as Qt, ManageRequestFrame as R, relayInboundFrameSchema as Rn, capabilityTokenSchema as Rt, DmRoomPath as S, ownerNamedRoomPathSchema as Sn, RoomSend as St, ExecSessionInfo as T, pingFrameSchema as Tn, StreamEndFrame as Tt, ObservedAddressFrame as U, roomInviteSchema as Un, coreDomainNameSchema as Ut, NamespacedCapability as V, revocationClaimsSchema as Vn, coordinatorFrameSchema as Vt, OwnerNamedRoomPath as W, roomJoinOkSchema as Wn, coseHeaderAlgSchema as Wt, ProcKill as X, roomNoticeClaimsSchema as Xn, dataHaveFrameSchema as Xt, PrivateUseDomainId as Y, roomMembersSchema as Yn, dataEntriesFrameSchema as Yt, ProcSignal as Z, roomNoticeSchema as Zn, dataRequestFrameSchema as Zt, DataEntriesFrame as _, manageResponseFrameSchema as _n, RoomMembersOk as _t, CapabilityScope as a, frameVariantSchema as an, syncPunchFrameSchema as ar, RelayDataFrame as at, DeviceId as b, namespacedDomainIdSchema as bn, RoomPath as bt, CloseFrame as c, handleRecordSchema as cn, webrtcIceCandidateSchema as cr, RevocationAnnounceFrame as ct, CoreDomainName as d, identityKeySchema as dn, RoomInvite as dt, dmRoomPathSchema as en, roomSendSchema as er, PtyKill as et, CoseHeaderAlg as f, manageCommandParamsSchema as fn, RoomJoin as ft, CoseTokenHeaders as g, manageRequestFrameSchema as gn, RoomMembers as gt, CoseSign1 as h, manageOkSchema as hn, RoomMember as ht, CapabilityRequest as i, frameSchema as in, streamSessionSchema as ir, RelayConnectFrame as it, HandshakeFrame as j, protocolVersionSchema as jn, WebrtcOffer as jt, HandleClaims as k, procSignalSchema as kn, WebrtcAnswer as kt, CoordinatorFrame as l, handshakeFrameSchema as ln, webrtcOfferSchema as lr, RevocationClaims as lt, CoseHeaderLabel as m, manageErrorSchema as mn, RoomLeave as mt, CandidatesFrame as n, execListSchema as nn, streamDataFrameSchema as nr, PtySpawn as nt, CapabilityToken as o, gossipFrameSchema as on, tokenClaimsSchema as or, RelayInboundFrame as ot, CoseHeaderKid as p, manageCommandSchema as pn, RoomJoinOk as pt, PingFrame as q, roomMemberSchema as qn, coseSign1Schema as qt, CapabilityGrantOk as r, execSessionInfoSchema as rn, streamEndFrameSchema as rr, PtyWrite as rt, CapabilityVerb as s, handleClaimsSchema as sn, webrtcAnswerSchema as sr, RelayOfferFrame as st, CandidateKind as t, domainIdSchema as tn, streamAckFrameSchema as tr, PtyResize as tt, CoreCapability as u, iceCandidateInitSchema as un, wireCandidateSchema as ur, RevocationEntry as ut, DataHaveFrame as v, messageRefSchema as vn, RoomNotice as vt, ExecList as w, peerIdentitySchema as wn, StreamDataFrame as wt, DeviceIdHex as x, observedAddressFrameSchema as xn, RoomRead as xt, DataRequestFrame as y, namespacedCapabilitySchema as yn, RoomNoticeClaims as yt, ManageResponseFrame as z, relayOfferFrameSchema as zn, capabilityVerbSchema as zt };
1186
+ export { ProcSpawn as $, roomNoticeSchema as $n, dataRequestFrameSchema as $t, HandleClaims as A, procKillSchema as An, WebrtcAnswer as At, ManageResponseFrame as B, relayInboundFrameSchema as Bn, capabilityTokenSchema as Bt, DmRoomPath as C, observedAddressFrameSchema as Cn, RoomSend as Ct, Frame as D, pingFrameSchema as Dn, StreamSession as Dt, ExecSessionInfo as E, peerIdentitySchema as En, StreamEndFrame as Et, ManageCommand as F, ptyResizeSchema as Fn, candidatesFrameSchema as Ft, OwnerNamedRoomPath as G, roomInviteSchema as Gn, coreDomainNameSchema as Gt, NamespacedCapability as H, revocationAnnounceFrameSchema as Hn, closeFrameSchema as Ht, ManageCommandParams as I, ptySpawnSchema as In, capabilityGrantOkSchema as It, PingFrame as J, roomLeaveSchema as Jn, coseHeaderLabelSchema as Jt, PeerAdvert as K, roomJoinOkSchema as Kn, coseHeaderAlgSchema as Kt, ManageError as L, ptyWriteSchema as Ln, capabilityGrantSchema as Lt, HandshakeFrame as M, procSpawnSchema as Mn, WebrtcOffer as Mt, IceCandidateInit as N, protocolVersionSchema as Nn, WireCandidate as Nt, FrameVariant as O, privateUseCapabilitySchema as On, SyncPunchFrame as Ot, IdentityKey as P, ptyKillSchema as Pn, candidateKindSchema as Pt, ProcSignal as Q, roomNoticeClaimsSchema as Qn, dataHaveFrameSchema as Qt, ManageOk as R, relayConnectFrameSchema as Rn, capabilityRequestSchema as Rt, DeviceIdHex as S, namespacedDomainIdSchema as Sn, RoomRead as St, ExecList as T, peerAdvertSchema as Tn, StreamDataFrame as Tt, NamespacedDomainId as U, revocationClaimsSchema as Un, coordinatorFrameSchema as Ut, MessageRef as V, relayOfferFrameSchema as Vn, capabilityVerbSchema as Vt, ObservedAddressFrame as W, revocationEntrySchema as Wn, coreCapabilitySchema as Wt, PrivateUseDomainId as X, roomMembersOkSchema as Xn, coseTokenHeadersSchema as Xt, PrivateUseCapability as Y, roomMemberSchema as Yn, coseSign1Schema as Yt, ProcKill as Z, roomMembersSchema as Zn, dataEntriesFrameSchema as Zt, CoseTokenHeaders as _, manageOkSchema as _n, RoomMembers as _t, CapabilityRequest as a, execSessionInfoSchema as an, streamEndFrameSchema as ar, RelayConnectFrame as at, DataRequestFrame as b, messageRefSchema as bn, RoomNoticeClaims as bt, CapabilityVerb as c, gossipFrameSchema as cn, tokenClaimsSchema as cr, RelayOfferFrame as ct, CoreCapability as d, handshakeFrameSchema as dn, webrtcOfferSchema as dr, RevocationEntry as dt, deviceIdHexSchema as en, roomPathSchema as er, ProtocolVersion as et, CoreDomainName as f, iceCandidateInitSchema as fn, wireCandidateSchema as fr, RoomInvite as ft, CoseSign1 as g, manageErrorSchema as gn, RoomMember as gt, CoseHeaderLabel as h, manageCommandSchema as hn, RoomLeave as ht, CapabilityGrantOk as i, execListSchema as in, streamDataFrameSchema as ir, PtyWrite as it, HandleRecord as j, procSignalSchema as jn, WebrtcIceCandidate as jt, GossipFrame as k, privateUseDomainIdSchema as kn, TokenClaims as kt, CloseFrame as l, handleClaimsSchema as ln, webrtcAnswerSchema as lr, RevocationAnnounceFrame as lt, CoseHeaderKid as m, manageCommandParamsSchema as mn, RoomJoinOk as mt, CandidatesFrame as n, dmRoomPathSchema as nn, roomSendSchema as nr, PtyResize as nt, CapabilityScope as o, frameSchema as on, streamSessionSchema as or, RelayDataFrame as ot, CoseHeaderAlg as p, identityKeySchema as pn, RoomJoin as pt, PeerIdentity as q, roomJoinSchema as qn, coseHeaderKidSchema as qt, CapabilityGrant as r, domainIdSchema as rn, streamAckFrameSchema as rr, PtySpawn as rt, CapabilityToken as s, frameVariantSchema as sn, syncPunchFrameSchema as sr, RelayInboundFrame as st, CandidateKind as t, deviceIdSchema as tn, roomReadSchema as tr, PtyKill as tt, CoordinatorFrame as u, handleRecordSchema as un, webrtcIceCandidateSchema as ur, RevocationClaims as ut, DataEntriesFrame as v, manageRequestFrameSchema as vn, RoomMembersOk as vt, DomainId as w, ownerNamedRoomPathSchema as wn, StreamAckFrame as wt, DeviceId as x, namespacedCapabilitySchema as xn, RoomPath as xt, DataHaveFrame as y, manageResponseFrameSchema as yn, RoomNotice as yt, ManageRequestFrame as z, relayDataFrameSchema as zn, capabilityScopeSchema as zt };
@@ -1,4 +1,4 @@
1
- import { E as Frame, b as DeviceId } from "./protocol-MnxTzpRP.cjs";
1
+ import { D as Frame, x as DeviceId } from "./protocol-Dhswk7YD.mjs";
2
2
  //#region src/ports/transport.d.ts
3
3
  /**
4
4
  * An async, serialisable-data contract for exchanging frame values over some connection -- deliberately without baking in any specific transport's own primitives (no raw socket types, no WebSocket-specific options), so a TCP adapter, a WebSocket adapter, or an in-memory adapter for tests can all satisfy it.
@@ -1,4 +1,4 @@
1
- import { E as Frame, b as DeviceId } from "./protocol-MnxTzpRP.mjs";
1
+ import { D as Frame, x as DeviceId } from "./protocol-Dhswk7YD.cjs";
2
2
  //#region src/ports/transport.d.ts
3
3
  /**
4
4
  * An async, serialisable-data contract for exchanging frame values over some connection -- deliberately without baking in any specific transport's own primitives (no raw socket types, no WebSocket-specific options), so a TCP adapter, a WebSocket adapter, or an in-memory adapter for tests can all satisfy it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wire-mesh-core",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "type": "module",
5
5
  "packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
6
6
  "repository": {
@@ -85,6 +85,10 @@
85
85
  "import": "./dist/adapters/tls-transport.mjs",
86
86
  "require": "./dist/adapters/tls-transport.cjs"
87
87
  },
88
+ "./domain/capability-grant": {
89
+ "import": "./dist/domain/capability-grant.mjs",
90
+ "require": "./dist/domain/capability-grant.cjs"
91
+ },
88
92
  "./domain/capability-request": {
89
93
  "import": "./dist/domain/capability-request.mjs",
90
94
  "require": "./dist/domain/capability-request.cjs"