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.
- package/dist/adapters/frame-codec.d.cts +1 -1
- package/dist/adapters/frame-codec.d.mts +1 -1
- package/dist/adapters/node-identity.d.cts +2 -2
- package/dist/adapters/node-identity.d.mts +2 -2
- package/dist/adapters/tcp-transport.d.cts +1 -1
- package/dist/adapters/tcp-transport.d.mts +1 -1
- package/dist/adapters/tls-transport.d.cts +1 -1
- package/dist/adapters/tls-transport.d.mts +1 -1
- package/dist/domain/capability-grant.cjs +90 -0
- package/dist/domain/capability-grant.d.cts +44 -0
- package/dist/domain/capability-grant.d.mts +44 -0
- package/dist/domain/capability-grant.mjs +87 -0
- package/dist/domain/capability-request.d.cts +2 -2
- package/dist/domain/capability-request.d.mts +2 -2
- package/dist/domain/device-id.d.cts +1 -1
- package/dist/domain/device-id.d.mts +1 -1
- package/dist/domain/handshake.d.cts +1 -1
- package/dist/domain/handshake.d.mts +1 -1
- package/dist/domain/mesh-session.d.cts +3 -3
- package/dist/domain/mesh-session.d.mts +3 -3
- package/dist/domain/relay-hub.d.cts +1 -1
- package/dist/domain/relay-hub.d.mts +1 -1
- package/dist/domain/revocation-view.d.cts +1 -1
- package/dist/domain/revocation-view.d.mts +1 -1
- package/dist/domain/room-token-verification.d.cts +1 -1
- package/dist/domain/room-token-verification.d.mts +1 -1
- package/dist/domain/tokens.cjs +2 -1
- package/dist/domain/tokens.d.cts +6 -2
- package/dist/domain/tokens.d.mts +6 -2
- package/dist/domain/tokens.mjs +2 -2
- package/dist/generated/protocol.cjs +6 -0
- package/dist/generated/protocol.d.cts +2 -2
- package/dist/generated/protocol.d.mts +2 -2
- package/dist/generated/protocol.mjs +6 -1
- package/dist/{identity-D8iJZRZZ.d.mts → identity-B1hBV3YA.d.mts} +1 -1
- package/dist/{identity-DkEe1465.d.cts → identity-BldV8xFj.d.cts} +1 -1
- package/dist/ports/identity.d.cts +1 -1
- package/dist/ports/identity.d.mts +1 -1
- package/dist/ports/transport.d.cts +1 -1
- package/dist/ports/transport.d.mts +1 -1
- package/dist/{protocol-MnxTzpRP.d.cts → protocol-Dhswk7YD.d.cts} +39 -1
- package/dist/{protocol-MnxTzpRP.d.mts → protocol-Dhswk7YD.d.mts} +39 -1
- package/dist/{transport-Da7GP9ya.d.cts → transport-BNNdUBq-.d.mts} +1 -1
- package/dist/{transport-ESMXRz3s.d.mts → transport-hEUxrdhT.d.cts} +1 -1
- package/package.json +5 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 {
|
|
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 {
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
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 {
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
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-
|
|
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-
|
|
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;
|
|
@@ -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 {
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
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 {
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
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-
|
|
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 {
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
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-
|
|
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-
|
|
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-
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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. */
|
package/dist/domain/tokens.cjs
CHANGED
|
@@ -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;
|
package/dist/domain/tokens.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
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
|
*/
|
package/dist/domain/tokens.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
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
|
*/
|
package/dist/domain/tokens.mjs
CHANGED
|
@@ -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
|
|
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
|
|
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 {
|
|
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 {
|
|
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-
|
|
1
|
+
import { t as IdentityPort } from "../identity-BldV8xFj.cjs";
|
|
2
2
|
export { IdentityPort };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as IdentityPort } from "../identity-
|
|
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-
|
|
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-
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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.
|
|
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"
|