wire-mesh-core 1.23.0 → 1.25.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/bulk.cjs +400 -0
- package/dist/domain/bulk.d.cts +97 -0
- package/dist/domain/bulk.d.mts +97 -0
- package/dist/domain/bulk.mjs +393 -0
- package/dist/domain/capability-grant.d.cts +3 -3
- package/dist/domain/capability-grant.d.mts +3 -3
- 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/grant-candidates.d.cts +1 -1
- package/dist/domain/grant-candidates.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 +2 -2
- package/dist/domain/relay-hub.d.mts +2 -2
- package/dist/domain/relay-use-gate.d.cts +2 -2
- package/dist/domain/relay-use-gate.d.mts +2 -2
- package/dist/domain/revocation-view.cjs +1 -1
- package/dist/domain/revocation-view.d.cts +2 -2
- package/dist/domain/revocation-view.d.mts +2 -2
- package/dist/domain/revocation-view.mjs +1 -1
- package/dist/domain/room-token-verification.cjs +1 -1
- package/dist/domain/room-token-verification.d.cts +2 -2
- package/dist/domain/room-token-verification.d.mts +2 -2
- package/dist/domain/room-token-verification.mjs +1 -1
- package/dist/domain/room.cjs +108 -0
- package/dist/domain/room.d.cts +36 -0
- package/dist/domain/room.d.mts +36 -0
- package/dist/domain/room.mjs +106 -0
- package/dist/domain/tokens.d.cts +1 -1
- package/dist/domain/tokens.d.mts +1 -1
- package/dist/generated/protocol.cjs +78 -28
- package/dist/generated/protocol.d.cts +2 -2
- package/dist/generated/protocol.d.mts +2 -2
- package/dist/generated/protocol.mjs +72 -29
- package/dist/{identity-5LJ_B8go.d.mts → identity-C5N86BPz.d.mts} +1 -1
- package/dist/{identity-bg6IVGsH.d.cts → identity-DJ06jn4k.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-l9RMR3s5.d.cts → protocol-sW8d6Og-.d.cts} +177 -43
- package/dist/{protocol-l9RMR3s5.d.mts → protocol-sW8d6Og-.d.mts} +177 -43
- package/dist/{tokens-CBI54oF-.d.mts → tokens-CpLDI5Fo.d.mts} +2 -2
- package/dist/{tokens-H_mV_JCC.d.cts → tokens-DfVfE00W.d.cts} +2 -2
- package/dist/{transport-Baipikk7.d.cts → transport-B5E896PN.d.mts} +1 -1
- package/dist/{transport-DWbvUc3L.d.mts → transport-DxZ4JWZc.d.cts} +1 -1
- package/package.json +9 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Connection } from "../transport-
|
|
1
|
+
import { N as Frame } from "../protocol-sW8d6Og-.mjs";
|
|
2
|
+
import { t as Connection } from "../transport-B5E896PN.mjs";
|
|
3
3
|
//#region src/domain/relay-use-gate.d.ts
|
|
4
4
|
export interface RelayUseAuthorizationTracker {
|
|
5
5
|
/** True once authorize() has been called for this exact connection and revoke() has not been called since. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_tokens = require("../tokens-CiNXdKJ8.cjs");
|
|
3
2
|
const require_domain_device_id = require("./device-id.cjs");
|
|
3
|
+
const require_tokens = require("../tokens-CiNXdKJ8.cjs");
|
|
4
4
|
//#region src/domain/revocation-view.ts
|
|
5
5
|
function revocationKey(tokenId) {
|
|
6
6
|
return require_domain_device_id.bytesToHex(tokenId);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-
|
|
1
|
+
import { _t as RevocationEntry } from "../protocol-sW8d6Og-.cjs";
|
|
2
|
+
import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-DfVfE00W.cjs";
|
|
3
3
|
//#region src/domain/revocation-view.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* An in-memory RevocationCheck fed by ingested revocation-announce frames. Keyed by token-id alone, per management.cddl's contract: a token-id can legitimately carry multiple recorded entries from different issuers (the token's own issuer, and/or any number of parties holding a delegated manage:revoke authorization over it) -- entriesFor returns every one of them unfiltered, since checking which actually apply (issuer-match, or a verified authorization) is verifyTokenChain's own obligation, not this store's.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-
|
|
1
|
+
import { _t as RevocationEntry } from "../protocol-sW8d6Og-.mjs";
|
|
2
|
+
import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-CpLDI5Fo.mjs";
|
|
3
3
|
//#region src/domain/revocation-view.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* An in-memory RevocationCheck fed by ingested revocation-announce frames. Keyed by token-id alone, per management.cddl's contract: a token-id can legitimately carry multiple recorded entries from different issuers (the token's own issuer, and/or any number of parties holding a delegated manage:revoke authorization over it) -- entriesFor returns every one of them unfiltered, since checking which actually apply (issuer-match, or a verified authorization) is verifyTokenChain's own obligation, not this store's.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as verifyRevocationEntry } from "../tokens-VicRWTj1.mjs";
|
|
2
1
|
import { bytesToHex } from "./device-id.mjs";
|
|
2
|
+
import { a as verifyRevocationEntry } from "../tokens-VicRWTj1.mjs";
|
|
3
3
|
//#region src/domain/revocation-view.ts
|
|
4
4
|
function revocationKey(tokenId) {
|
|
5
5
|
return bytesToHex(tokenId);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_tokens = require("../tokens-CiNXdKJ8.cjs");
|
|
3
2
|
const require_domain_device_id = require("./device-id.cjs");
|
|
3
|
+
const require_tokens = require("../tokens-CiNXdKJ8.cjs");
|
|
4
4
|
const require_domain_room_path = require("./room-path.cjs");
|
|
5
5
|
//#region src/domain/room-token-verification.ts
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as TokenVerdictReason, u as VerifyCapabilityTokenOptions } from "../tokens-
|
|
1
|
+
import { D as DeviceId, Ft as TokenClaims, p as CapabilityToken } from "../protocol-sW8d6Og-.cjs";
|
|
2
|
+
import { l as TokenVerdictReason, u as VerifyCapabilityTokenOptions } from "../tokens-DfVfE00W.cjs";
|
|
3
3
|
//#region src/domain/room-token-verification.d.ts
|
|
4
4
|
/** The one capability every core/room verb (room.send/read/leave/members) is gated by, per spec/room.cddl -- room.join/room.invite are deliberately ungated instead and need no token check at all. */
|
|
5
5
|
export declare const ROOM_MEMBER_CAPABILITY = "room:member";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as TokenVerdictReason, u as VerifyCapabilityTokenOptions } from "../tokens-
|
|
1
|
+
import { D as DeviceId, Ft as TokenClaims, p as CapabilityToken } from "../protocol-sW8d6Og-.mjs";
|
|
2
|
+
import { l as TokenVerdictReason, u as VerifyCapabilityTokenOptions } from "../tokens-CpLDI5Fo.mjs";
|
|
3
3
|
//#region src/domain/room-token-verification.d.ts
|
|
4
4
|
/** The one capability every core/room verb (room.send/read/leave/members) is gated by, per spec/room.cddl -- room.join/room.invite are deliberately ungated instead and need no token check at all. */
|
|
5
5
|
export declare const ROOM_MEMBER_CAPABILITY = "room:member";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as verifyCapabilityToken } from "../tokens-VicRWTj1.mjs";
|
|
2
1
|
import { deviceIdToHex } from "./device-id.mjs";
|
|
2
|
+
import { i as verifyCapabilityToken } from "../tokens-VicRWTj1.mjs";
|
|
3
3
|
import { parseRoomPath } from "./room-path.mjs";
|
|
4
4
|
//#region src/domain/room-token-verification.ts
|
|
5
5
|
/**
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_generated_protocol = require("../generated/protocol.cjs");
|
|
3
|
+
const require_domain_room_token_verification = require("./room-token-verification.cjs");
|
|
4
|
+
let cbor2 = require("cbor2");
|
|
5
|
+
//#region src/domain/room.ts
|
|
6
|
+
/**
|
|
7
|
+
* Room-notice verification (spec/room.cddl's own noticeboard extension of core/room). A room-notice is self-certifying the same way a capability-token or revocation-entry already is: a bare cose-sign1 whose payload carries its own signer's key, so a reader verifies posting authority from the entry alone, with no prior contact with the poster and no central gatekeeper. This module is the first TypeScript verifier for it -- no `room.ts` domain module existed anywhere before this, despite the CDDL claim (including `valid-until`) having shipped already.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* RFC 9052 §4.4 Sig_structure for a COSE_Sign1 with no external AAD -- identical in shape to tokens.ts's own private helper of the same name, but reimplemented here rather than imported, since tokens.ts does not export it. Worth consolidating into a shared cose.ts once a third caller needs the identical helper, but two independent five-line copies is not yet a real duplication problem on its own.
|
|
11
|
+
*/
|
|
12
|
+
function sig1ToBeSigned(protectedHeader, payload) {
|
|
13
|
+
return (0, cbor2.encode)([
|
|
14
|
+
"Signature1",
|
|
15
|
+
protectedHeader,
|
|
16
|
+
/* @__PURE__ */ new Uint8Array(0),
|
|
17
|
+
payload
|
|
18
|
+
], cbor2.cdeEncodeOptions);
|
|
19
|
+
}
|
|
20
|
+
function bytesEqual(a, b) {
|
|
21
|
+
if (a.length !== b.length) return false;
|
|
22
|
+
for (let i = 0; i < a.length; i += 1) if (a[i] !== b[i]) return false;
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
/** Lexicographic (bytewise-ascending) ordering -- the same convention room.cddl's own DM room-path already uses for its sorted pair. Shorter-but-equal-prefix sorts first, matching how Uint8Array.prototype comparisons behave nowhere natively, so this exists at all. */
|
|
26
|
+
function compareBytes(a, b) {
|
|
27
|
+
const length = Math.min(a.length, b.length);
|
|
28
|
+
for (let i = 0; i < length; i += 1) {
|
|
29
|
+
const byteA = a[i];
|
|
30
|
+
const byteB = b[i];
|
|
31
|
+
if (byteA === void 0 || byteB === void 0) throw new Error("compareBytes: index out of range");
|
|
32
|
+
if (byteA !== byteB) return byteA - byteB;
|
|
33
|
+
}
|
|
34
|
+
return a.length - b.length;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Verifies one room-notice (spec/room.cddl) against every obligation its own "Six verifier obligations" comment documents, including `valid-until` (obligation 6): the envelope is a well-formed COSE_Sign1 whose signature verifies against its own embedded poster-key, and poster-key is self-certifying (sha256(poster-key.public-key) equals poster); the embedded token independently passes every ordinary capability-token obligation (signature, expiry, not-before, revocation, delegations- remaining, and -- since the embedded token is itself room-scoped -- the chain-root and scope obligations spec/room.cddl's own six general verifier obligations require of any room:member token) with its bearer pinned to this notice's own `poster` field and its scope pinned to this notice's own `room` field; and, if present, `valid-until` has not yet elapsed as of the injected clock. Checks run cheapest-and-structural first, signature next, the recursive token-chain verification last, mirroring tokens.ts's own ordering discipline.
|
|
38
|
+
*
|
|
39
|
+
* Cross-author ordering (obligation 4) is deliberately NOT checked here -- it is a property of how a reader merges several posters' notices into one sequence, not a pass/fail condition on any single notice. Use compareRoomNotices for that once notices are already individually verified.
|
|
40
|
+
*
|
|
41
|
+
* Revocation (obligation 5) needs no separate step of its own: verifying the embedded token below already walks the full delegation chain against `options.revocation` as part of ordinary capability-token verification, and obligation 5 explicitly disclaims any retroactive "was the poster revoked as of posted-at" check -- only the token's own present-tense validity matters, which the embedded-token verification already establishes.
|
|
42
|
+
*/
|
|
43
|
+
async function verifyRoomNotice(notice, options) {
|
|
44
|
+
const [protectedHeader, , payload, signature] = notice;
|
|
45
|
+
if (payload === null) return {
|
|
46
|
+
ok: false,
|
|
47
|
+
reason: "malformed"
|
|
48
|
+
};
|
|
49
|
+
let decoded;
|
|
50
|
+
try {
|
|
51
|
+
decoded = (0, cbor2.decode)(payload, cbor2.cdeDecodeOptions);
|
|
52
|
+
} catch {
|
|
53
|
+
return {
|
|
54
|
+
ok: false,
|
|
55
|
+
reason: "malformed"
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const parsed = require_generated_protocol.roomNoticeClaimsSchema.safeParse(decoded);
|
|
59
|
+
if (!parsed.success) return {
|
|
60
|
+
ok: false,
|
|
61
|
+
reason: "malformed"
|
|
62
|
+
};
|
|
63
|
+
const claims = parsed.data;
|
|
64
|
+
if (options.expectedRoom !== void 0 && claims.room !== options.expectedRoom) return {
|
|
65
|
+
ok: false,
|
|
66
|
+
reason: "wrong_room"
|
|
67
|
+
};
|
|
68
|
+
if (!await options.identity.verify(claims["poster-key"], sig1ToBeSigned(protectedHeader, payload), signature)) return {
|
|
69
|
+
ok: false,
|
|
70
|
+
reason: "bad_signature"
|
|
71
|
+
};
|
|
72
|
+
if (!bytesEqual(await options.identity.deriveDeviceId(claims["poster-key"]["public-key"]), claims.poster)) return {
|
|
73
|
+
ok: false,
|
|
74
|
+
reason: "wrong_poster"
|
|
75
|
+
};
|
|
76
|
+
const validUntil = claims["valid-until"];
|
|
77
|
+
if (validUntil !== void 0 && validUntil <= options.clock.now()) return {
|
|
78
|
+
ok: false,
|
|
79
|
+
reason: "content_expired"
|
|
80
|
+
};
|
|
81
|
+
const tokenVerdict = await require_domain_room_token_verification.verifyRoomToken(claims.token, {
|
|
82
|
+
identity: options.identity,
|
|
83
|
+
clock: options.clock,
|
|
84
|
+
revocation: options.revocation,
|
|
85
|
+
expectedBearer: claims.poster,
|
|
86
|
+
roomPath: claims.room
|
|
87
|
+
});
|
|
88
|
+
if (!tokenVerdict.ok) return {
|
|
89
|
+
ok: false,
|
|
90
|
+
reason: tokenVerdict.reason
|
|
91
|
+
};
|
|
92
|
+
return {
|
|
93
|
+
ok: true,
|
|
94
|
+
claims
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Deterministic display ordering for room-notice entries from possibly several different posters (spec/room.cddl obligation 4): sorts by (posted-at, poster, notice-id), the exact tiebreak idiom the CDDL comment specifies -- the same "lowest wins" idea coordinator-frame's own lowest-device-id rule already uses for equal-term claims elsewhere in this spec. Takes already-verified claims (the output of verifyRoomNotice) -- this is purely a merge-order comparator, never a validity check, so it is kept structurally separate from verifyRoomNotice's own pass/fail verdict.
|
|
99
|
+
*/
|
|
100
|
+
function compareRoomNotices(a, b) {
|
|
101
|
+
if (a["posted-at"] !== b["posted-at"]) return a["posted-at"] - b["posted-at"];
|
|
102
|
+
const posterOrder = compareBytes(a.poster, b.poster);
|
|
103
|
+
if (posterOrder !== 0) return posterOrder;
|
|
104
|
+
return compareBytes(a["notice-id"], b["notice-id"]);
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
exports.compareRoomNotices = compareRoomNotices;
|
|
108
|
+
exports.verifyRoomNotice = verifyRoomNotice;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Dt as RoomPath, Et as RoomNoticeClaims, Tt as RoomNotice } from "../protocol-sW8d6Og-.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DJ06jn4k.cjs";
|
|
3
|
+
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
4
|
+
import { a as RevocationCheck } from "../tokens-DfVfE00W.cjs";
|
|
5
|
+
import { RoomTokenVerdictReason } from "./room-token-verification.cjs";
|
|
6
|
+
//#region src/domain/room.d.ts
|
|
7
|
+
export type RoomNoticeVerdictReason = "malformed" | "wrong_room" | "bad_signature" | "wrong_poster" | "content_expired" | RoomTokenVerdictReason;
|
|
8
|
+
export type RoomNoticeVerdict = {
|
|
9
|
+
ok: true;
|
|
10
|
+
claims: RoomNoticeClaims;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
reason: RoomNoticeVerdictReason;
|
|
14
|
+
};
|
|
15
|
+
export interface VerifyRoomNoticeOptions {
|
|
16
|
+
identity: IdentityPort;
|
|
17
|
+
clock: Clock;
|
|
18
|
+
revocation: RevocationCheck;
|
|
19
|
+
/**
|
|
20
|
+
* When given, refuses any notice not claiming exactly this room -- "is this the room I actually asked to read", checked against the notice's own self-declared `room` field before any cryptographic work, so a caller scanning a mixed stream of notices can cheaply skip ones for other rooms. Independent of, and layered on top of, this function's own unconditional internal self-consistency check (the embedded token's scope.path MUST equal the notice's own `room` field regardless of whether expectedRoom is given at all) -- a notice can be internally self-consistent yet still be for a room other than the one a caller expected, and this is the option that catches that case. Mirrors verifyCapabilityToken's own optional expectedBearer for the same "also assert it matches what I expected" shape.
|
|
21
|
+
*/
|
|
22
|
+
expectedRoom?: RoomPath;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Verifies one room-notice (spec/room.cddl) against every obligation its own "Six verifier obligations" comment documents, including `valid-until` (obligation 6): the envelope is a well-formed COSE_Sign1 whose signature verifies against its own embedded poster-key, and poster-key is self-certifying (sha256(poster-key.public-key) equals poster); the embedded token independently passes every ordinary capability-token obligation (signature, expiry, not-before, revocation, delegations- remaining, and -- since the embedded token is itself room-scoped -- the chain-root and scope obligations spec/room.cddl's own six general verifier obligations require of any room:member token) with its bearer pinned to this notice's own `poster` field and its scope pinned to this notice's own `room` field; and, if present, `valid-until` has not yet elapsed as of the injected clock. Checks run cheapest-and-structural first, signature next, the recursive token-chain verification last, mirroring tokens.ts's own ordering discipline.
|
|
26
|
+
*
|
|
27
|
+
* Cross-author ordering (obligation 4) is deliberately NOT checked here -- it is a property of how a reader merges several posters' notices into one sequence, not a pass/fail condition on any single notice. Use compareRoomNotices for that once notices are already individually verified.
|
|
28
|
+
*
|
|
29
|
+
* Revocation (obligation 5) needs no separate step of its own: verifying the embedded token below already walks the full delegation chain against `options.revocation` as part of ordinary capability-token verification, and obligation 5 explicitly disclaims any retroactive "was the poster revoked as of posted-at" check -- only the token's own present-tense validity matters, which the embedded-token verification already establishes.
|
|
30
|
+
*/
|
|
31
|
+
export declare function verifyRoomNotice(notice: RoomNotice, options: Readonly<VerifyRoomNoticeOptions>): Promise<RoomNoticeVerdict>;
|
|
32
|
+
/**
|
|
33
|
+
* Deterministic display ordering for room-notice entries from possibly several different posters (spec/room.cddl obligation 4): sorts by (posted-at, poster, notice-id), the exact tiebreak idiom the CDDL comment specifies -- the same "lowest wins" idea coordinator-frame's own lowest-device-id rule already uses for equal-term claims elsewhere in this spec. Takes already-verified claims (the output of verifyRoomNotice) -- this is purely a merge-order comparator, never a validity check, so it is kept structurally separate from verifyRoomNotice's own pass/fail verdict.
|
|
34
|
+
*/
|
|
35
|
+
export declare function compareRoomNotices(a: Readonly<RoomNoticeClaims>, b: Readonly<RoomNoticeClaims>): number;
|
|
36
|
+
//#endregion
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Dt as RoomPath, Et as RoomNoticeClaims, Tt as RoomNotice } from "../protocol-sW8d6Og-.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-C5N86BPz.mjs";
|
|
3
|
+
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
4
|
+
import { a as RevocationCheck } from "../tokens-CpLDI5Fo.mjs";
|
|
5
|
+
import { RoomTokenVerdictReason } from "./room-token-verification.mjs";
|
|
6
|
+
//#region src/domain/room.d.ts
|
|
7
|
+
export type RoomNoticeVerdictReason = "malformed" | "wrong_room" | "bad_signature" | "wrong_poster" | "content_expired" | RoomTokenVerdictReason;
|
|
8
|
+
export type RoomNoticeVerdict = {
|
|
9
|
+
ok: true;
|
|
10
|
+
claims: RoomNoticeClaims;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
reason: RoomNoticeVerdictReason;
|
|
14
|
+
};
|
|
15
|
+
export interface VerifyRoomNoticeOptions {
|
|
16
|
+
identity: IdentityPort;
|
|
17
|
+
clock: Clock;
|
|
18
|
+
revocation: RevocationCheck;
|
|
19
|
+
/**
|
|
20
|
+
* When given, refuses any notice not claiming exactly this room -- "is this the room I actually asked to read", checked against the notice's own self-declared `room` field before any cryptographic work, so a caller scanning a mixed stream of notices can cheaply skip ones for other rooms. Independent of, and layered on top of, this function's own unconditional internal self-consistency check (the embedded token's scope.path MUST equal the notice's own `room` field regardless of whether expectedRoom is given at all) -- a notice can be internally self-consistent yet still be for a room other than the one a caller expected, and this is the option that catches that case. Mirrors verifyCapabilityToken's own optional expectedBearer for the same "also assert it matches what I expected" shape.
|
|
21
|
+
*/
|
|
22
|
+
expectedRoom?: RoomPath;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Verifies one room-notice (spec/room.cddl) against every obligation its own "Six verifier obligations" comment documents, including `valid-until` (obligation 6): the envelope is a well-formed COSE_Sign1 whose signature verifies against its own embedded poster-key, and poster-key is self-certifying (sha256(poster-key.public-key) equals poster); the embedded token independently passes every ordinary capability-token obligation (signature, expiry, not-before, revocation, delegations- remaining, and -- since the embedded token is itself room-scoped -- the chain-root and scope obligations spec/room.cddl's own six general verifier obligations require of any room:member token) with its bearer pinned to this notice's own `poster` field and its scope pinned to this notice's own `room` field; and, if present, `valid-until` has not yet elapsed as of the injected clock. Checks run cheapest-and-structural first, signature next, the recursive token-chain verification last, mirroring tokens.ts's own ordering discipline.
|
|
26
|
+
*
|
|
27
|
+
* Cross-author ordering (obligation 4) is deliberately NOT checked here -- it is a property of how a reader merges several posters' notices into one sequence, not a pass/fail condition on any single notice. Use compareRoomNotices for that once notices are already individually verified.
|
|
28
|
+
*
|
|
29
|
+
* Revocation (obligation 5) needs no separate step of its own: verifying the embedded token below already walks the full delegation chain against `options.revocation` as part of ordinary capability-token verification, and obligation 5 explicitly disclaims any retroactive "was the poster revoked as of posted-at" check -- only the token's own present-tense validity matters, which the embedded-token verification already establishes.
|
|
30
|
+
*/
|
|
31
|
+
export declare function verifyRoomNotice(notice: RoomNotice, options: Readonly<VerifyRoomNoticeOptions>): Promise<RoomNoticeVerdict>;
|
|
32
|
+
/**
|
|
33
|
+
* Deterministic display ordering for room-notice entries from possibly several different posters (spec/room.cddl obligation 4): sorts by (posted-at, poster, notice-id), the exact tiebreak idiom the CDDL comment specifies -- the same "lowest wins" idea coordinator-frame's own lowest-device-id rule already uses for equal-term claims elsewhere in this spec. Takes already-verified claims (the output of verifyRoomNotice) -- this is purely a merge-order comparator, never a validity check, so it is kept structurally separate from verifyRoomNotice's own pass/fail verdict.
|
|
34
|
+
*/
|
|
35
|
+
export declare function compareRoomNotices(a: Readonly<RoomNoticeClaims>, b: Readonly<RoomNoticeClaims>): number;
|
|
36
|
+
//#endregion
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { roomNoticeClaimsSchema } from "../generated/protocol.mjs";
|
|
2
|
+
import { verifyRoomToken } from "./room-token-verification.mjs";
|
|
3
|
+
import { cdeDecodeOptions, cdeEncodeOptions, decode, encode } from "cbor2";
|
|
4
|
+
//#region src/domain/room.ts
|
|
5
|
+
/**
|
|
6
|
+
* Room-notice verification (spec/room.cddl's own noticeboard extension of core/room). A room-notice is self-certifying the same way a capability-token or revocation-entry already is: a bare cose-sign1 whose payload carries its own signer's key, so a reader verifies posting authority from the entry alone, with no prior contact with the poster and no central gatekeeper. This module is the first TypeScript verifier for it -- no `room.ts` domain module existed anywhere before this, despite the CDDL claim (including `valid-until`) having shipped already.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* RFC 9052 §4.4 Sig_structure for a COSE_Sign1 with no external AAD -- identical in shape to tokens.ts's own private helper of the same name, but reimplemented here rather than imported, since tokens.ts does not export it. Worth consolidating into a shared cose.ts once a third caller needs the identical helper, but two independent five-line copies is not yet a real duplication problem on its own.
|
|
10
|
+
*/
|
|
11
|
+
function sig1ToBeSigned(protectedHeader, payload) {
|
|
12
|
+
return encode([
|
|
13
|
+
"Signature1",
|
|
14
|
+
protectedHeader,
|
|
15
|
+
/* @__PURE__ */ new Uint8Array(0),
|
|
16
|
+
payload
|
|
17
|
+
], cdeEncodeOptions);
|
|
18
|
+
}
|
|
19
|
+
function bytesEqual(a, b) {
|
|
20
|
+
if (a.length !== b.length) return false;
|
|
21
|
+
for (let i = 0; i < a.length; i += 1) if (a[i] !== b[i]) return false;
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
/** Lexicographic (bytewise-ascending) ordering -- the same convention room.cddl's own DM room-path already uses for its sorted pair. Shorter-but-equal-prefix sorts first, matching how Uint8Array.prototype comparisons behave nowhere natively, so this exists at all. */
|
|
25
|
+
function compareBytes(a, b) {
|
|
26
|
+
const length = Math.min(a.length, b.length);
|
|
27
|
+
for (let i = 0; i < length; i += 1) {
|
|
28
|
+
const byteA = a[i];
|
|
29
|
+
const byteB = b[i];
|
|
30
|
+
if (byteA === void 0 || byteB === void 0) throw new Error("compareBytes: index out of range");
|
|
31
|
+
if (byteA !== byteB) return byteA - byteB;
|
|
32
|
+
}
|
|
33
|
+
return a.length - b.length;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Verifies one room-notice (spec/room.cddl) against every obligation its own "Six verifier obligations" comment documents, including `valid-until` (obligation 6): the envelope is a well-formed COSE_Sign1 whose signature verifies against its own embedded poster-key, and poster-key is self-certifying (sha256(poster-key.public-key) equals poster); the embedded token independently passes every ordinary capability-token obligation (signature, expiry, not-before, revocation, delegations- remaining, and -- since the embedded token is itself room-scoped -- the chain-root and scope obligations spec/room.cddl's own six general verifier obligations require of any room:member token) with its bearer pinned to this notice's own `poster` field and its scope pinned to this notice's own `room` field; and, if present, `valid-until` has not yet elapsed as of the injected clock. Checks run cheapest-and-structural first, signature next, the recursive token-chain verification last, mirroring tokens.ts's own ordering discipline.
|
|
37
|
+
*
|
|
38
|
+
* Cross-author ordering (obligation 4) is deliberately NOT checked here -- it is a property of how a reader merges several posters' notices into one sequence, not a pass/fail condition on any single notice. Use compareRoomNotices for that once notices are already individually verified.
|
|
39
|
+
*
|
|
40
|
+
* Revocation (obligation 5) needs no separate step of its own: verifying the embedded token below already walks the full delegation chain against `options.revocation` as part of ordinary capability-token verification, and obligation 5 explicitly disclaims any retroactive "was the poster revoked as of posted-at" check -- only the token's own present-tense validity matters, which the embedded-token verification already establishes.
|
|
41
|
+
*/
|
|
42
|
+
async function verifyRoomNotice(notice, options) {
|
|
43
|
+
const [protectedHeader, , payload, signature] = notice;
|
|
44
|
+
if (payload === null) return {
|
|
45
|
+
ok: false,
|
|
46
|
+
reason: "malformed"
|
|
47
|
+
};
|
|
48
|
+
let decoded;
|
|
49
|
+
try {
|
|
50
|
+
decoded = decode(payload, cdeDecodeOptions);
|
|
51
|
+
} catch {
|
|
52
|
+
return {
|
|
53
|
+
ok: false,
|
|
54
|
+
reason: "malformed"
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const parsed = roomNoticeClaimsSchema.safeParse(decoded);
|
|
58
|
+
if (!parsed.success) return {
|
|
59
|
+
ok: false,
|
|
60
|
+
reason: "malformed"
|
|
61
|
+
};
|
|
62
|
+
const claims = parsed.data;
|
|
63
|
+
if (options.expectedRoom !== void 0 && claims.room !== options.expectedRoom) return {
|
|
64
|
+
ok: false,
|
|
65
|
+
reason: "wrong_room"
|
|
66
|
+
};
|
|
67
|
+
if (!await options.identity.verify(claims["poster-key"], sig1ToBeSigned(protectedHeader, payload), signature)) return {
|
|
68
|
+
ok: false,
|
|
69
|
+
reason: "bad_signature"
|
|
70
|
+
};
|
|
71
|
+
if (!bytesEqual(await options.identity.deriveDeviceId(claims["poster-key"]["public-key"]), claims.poster)) return {
|
|
72
|
+
ok: false,
|
|
73
|
+
reason: "wrong_poster"
|
|
74
|
+
};
|
|
75
|
+
const validUntil = claims["valid-until"];
|
|
76
|
+
if (validUntil !== void 0 && validUntil <= options.clock.now()) return {
|
|
77
|
+
ok: false,
|
|
78
|
+
reason: "content_expired"
|
|
79
|
+
};
|
|
80
|
+
const tokenVerdict = await verifyRoomToken(claims.token, {
|
|
81
|
+
identity: options.identity,
|
|
82
|
+
clock: options.clock,
|
|
83
|
+
revocation: options.revocation,
|
|
84
|
+
expectedBearer: claims.poster,
|
|
85
|
+
roomPath: claims.room
|
|
86
|
+
});
|
|
87
|
+
if (!tokenVerdict.ok) return {
|
|
88
|
+
ok: false,
|
|
89
|
+
reason: tokenVerdict.reason
|
|
90
|
+
};
|
|
91
|
+
return {
|
|
92
|
+
ok: true,
|
|
93
|
+
claims
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Deterministic display ordering for room-notice entries from possibly several different posters (spec/room.cddl obligation 4): sorts by (posted-at, poster, notice-id), the exact tiebreak idiom the CDDL comment specifies -- the same "lowest wins" idea coordinator-frame's own lowest-device-id rule already uses for equal-term claims elsewhere in this spec. Takes already-verified claims (the output of verifyRoomNotice) -- this is purely a merge-order comparator, never a validity check, so it is kept structurally separate from verifyRoomNotice's own pass/fail verdict.
|
|
98
|
+
*/
|
|
99
|
+
function compareRoomNotices(a, b) {
|
|
100
|
+
if (a["posted-at"] !== b["posted-at"]) return a["posted-at"] - b["posted-at"];
|
|
101
|
+
const posterOrder = compareBytes(a.poster, b.poster);
|
|
102
|
+
if (posterOrder !== 0) return posterOrder;
|
|
103
|
+
return compareBytes(a["notice-id"], b["notice-id"]);
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { compareRoomNotices, verifyRoomNotice };
|
package/dist/domain/tokens.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RevocationCheck, c as TokenVerdict, d as VerifyRevocationEntryOptions, f as canGrant, g as verifyRevocationEntry, h as verifyCapabilityToken, i as MintVerdict, l as TokenVerdictReason, m as mintRevocationEntry, n as MintRefusalReason, o as RevocationEntryVerdict, p as mintCapabilityToken, r as MintRevocationEntryOptions, s as RevocationEntryVerdictReason, t as MintCapabilityTokenOptions, u as VerifyCapabilityTokenOptions } from "../tokens-
|
|
1
|
+
import { a as RevocationCheck, c as TokenVerdict, d as VerifyRevocationEntryOptions, f as canGrant, g as verifyRevocationEntry, h as verifyCapabilityToken, i as MintVerdict, l as TokenVerdictReason, m as mintRevocationEntry, n as MintRefusalReason, o as RevocationEntryVerdict, p as mintCapabilityToken, r as MintRevocationEntryOptions, s as RevocationEntryVerdictReason, t as MintCapabilityTokenOptions, u as VerifyCapabilityTokenOptions } from "../tokens-DfVfE00W.cjs";
|
|
2
2
|
export { MintCapabilityTokenOptions, MintRefusalReason, MintRevocationEntryOptions, MintVerdict, RevocationCheck, RevocationEntryVerdict, RevocationEntryVerdictReason, TokenVerdict, TokenVerdictReason, VerifyCapabilityTokenOptions, VerifyRevocationEntryOptions, canGrant, mintCapabilityToken, mintRevocationEntry, verifyCapabilityToken, verifyRevocationEntry };
|
package/dist/domain/tokens.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RevocationCheck, c as TokenVerdict, d as VerifyRevocationEntryOptions, f as canGrant, g as verifyRevocationEntry, h as verifyCapabilityToken, i as MintVerdict, l as TokenVerdictReason, m as mintRevocationEntry, n as MintRefusalReason, o as RevocationEntryVerdict, p as mintCapabilityToken, r as MintRevocationEntryOptions, s as RevocationEntryVerdictReason, t as MintCapabilityTokenOptions, u as VerifyCapabilityTokenOptions } from "../tokens-
|
|
1
|
+
import { a as RevocationCheck, c as TokenVerdict, d as VerifyRevocationEntryOptions, f as canGrant, g as verifyRevocationEntry, h as verifyCapabilityToken, i as MintVerdict, l as TokenVerdictReason, m as mintRevocationEntry, n as MintRefusalReason, o as RevocationEntryVerdict, p as mintCapabilityToken, r as MintRevocationEntryOptions, s as RevocationEntryVerdictReason, t as MintCapabilityTokenOptions, u as VerifyCapabilityTokenOptions } from "../tokens-CpLDI5Fo.mjs";
|
|
2
2
|
export { MintCapabilityTokenOptions, MintRefusalReason, MintRevocationEntryOptions, MintVerdict, RevocationCheck, RevocationEntryVerdict, RevocationEntryVerdictReason, TokenVerdict, TokenVerdictReason, VerifyCapabilityTokenOptions, VerifyRevocationEntryOptions, canGrant, mintCapabilityToken, mintRevocationEntry, verifyCapabilityToken, verifyRevocationEntry };
|
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let zod = require("zod");
|
|
3
3
|
//#region src/generated/protocol.ts
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"handle": zod.z.string(),
|
|
22
|
-
"device-id": zod.z.lazy(() => deviceIdSchema),
|
|
23
|
-
"identity-key": zod.z.lazy(() => identityKeySchema),
|
|
24
|
-
"candidates": zod.z.array(zod.z.lazy(() => wireCandidateSchema)).optional(),
|
|
25
|
-
"mailboxes": zod.z.array(zod.z.lazy(() => deviceIdSchema)).optional(),
|
|
26
|
-
"issued": zod.z.number().int().nonnegative(),
|
|
27
|
-
"expires": zod.z.number().int().nonnegative()
|
|
28
|
-
}));
|
|
29
|
-
const handleRecordSchema = zod.z.lazy(() => zod.z.lazy(() => coseSign1Schema));
|
|
4
|
+
const transferIdSchema = zod.z.lazy(() => zod.z.instanceof(Uint8Array).refine((v) => v.length === 16, { message: "expected exactly 16 bytes" }));
|
|
5
|
+
const bulkOpenSchema = zod.z.lazy(() => zod.z.object({
|
|
6
|
+
"verb": zod.z.literal("bulk.open"),
|
|
7
|
+
"transfer-id": zod.z.lazy(() => transferIdSchema),
|
|
8
|
+
"total-size": zod.z.number().int().nonnegative().optional(),
|
|
9
|
+
"content-type": zod.z.string().optional()
|
|
10
|
+
}).catchall(zod.z.unknown()));
|
|
11
|
+
const bulkResumeSchema = zod.z.lazy(() => zod.z.object({
|
|
12
|
+
"verb": zod.z.literal("bulk.resume"),
|
|
13
|
+
"transfer-id": zod.z.lazy(() => transferIdSchema),
|
|
14
|
+
"ack-seq": zod.z.number().int().nonnegative()
|
|
15
|
+
}).catchall(zod.z.unknown()));
|
|
16
|
+
const bulkCancelSchema = zod.z.lazy(() => zod.z.object({
|
|
17
|
+
"verb": zod.z.literal("bulk.cancel"),
|
|
18
|
+
"transfer-id": zod.z.lazy(() => transferIdSchema),
|
|
19
|
+
"reason": zod.z.string().optional()
|
|
20
|
+
}).catchall(zod.z.unknown()));
|
|
30
21
|
const manageCommandParamsSchema = zod.z.lazy(() => zod.z.union([
|
|
22
|
+
zod.z.union([
|
|
23
|
+
zod.z.lazy(() => bulkOpenSchema),
|
|
24
|
+
zod.z.lazy(() => bulkResumeSchema),
|
|
25
|
+
zod.z.lazy(() => bulkCancelSchema)
|
|
26
|
+
]),
|
|
31
27
|
zod.z.union([
|
|
32
28
|
zod.z.lazy(() => ptySpawnSchema),
|
|
33
29
|
zod.z.lazy(() => ptyWriteSchema),
|
|
@@ -54,6 +50,49 @@ const manageCommandParamsSchema = zod.z.lazy(() => zod.z.union([
|
|
|
54
50
|
zod.z.lazy(() => webrtcIceCandidateSchema)
|
|
55
51
|
])
|
|
56
52
|
]));
|
|
53
|
+
const bulkDataFrameSchema = zod.z.lazy(() => zod.z.object({
|
|
54
|
+
"type": zod.z.literal("bulk-data"),
|
|
55
|
+
"transfer-id": zod.z.lazy(() => transferIdSchema),
|
|
56
|
+
"seq": zod.z.number().int().nonnegative(),
|
|
57
|
+
"bytes": zod.z.instanceof(Uint8Array)
|
|
58
|
+
}));
|
|
59
|
+
const bulkAckFrameSchema = zod.z.lazy(() => zod.z.object({
|
|
60
|
+
"type": zod.z.literal("bulk-ack"),
|
|
61
|
+
"transfer-id": zod.z.lazy(() => transferIdSchema),
|
|
62
|
+
"ack-seq": zod.z.number().int().nonnegative(),
|
|
63
|
+
"window": zod.z.number().int().nonnegative()
|
|
64
|
+
}));
|
|
65
|
+
const bulkEndFrameSchema = zod.z.lazy(() => zod.z.object({
|
|
66
|
+
"type": zod.z.literal("bulk-end"),
|
|
67
|
+
"transfer-id": zod.z.lazy(() => transferIdSchema),
|
|
68
|
+
"digest": zod.z.instanceof(Uint8Array)
|
|
69
|
+
}));
|
|
70
|
+
const dataHaveFrameSchema = zod.z.lazy(() => zod.z.object({
|
|
71
|
+
"type": zod.z.literal("data-have"),
|
|
72
|
+
"peer": zod.z.lazy(() => deviceIdSchema),
|
|
73
|
+
"head-seq": zod.z.number().int().nonnegative()
|
|
74
|
+
}));
|
|
75
|
+
const dataRequestFrameSchema = zod.z.lazy(() => zod.z.object({
|
|
76
|
+
"type": zod.z.literal("data-request"),
|
|
77
|
+
"peer": zod.z.lazy(() => deviceIdSchema),
|
|
78
|
+
"from-seq": zod.z.number().int().nonnegative()
|
|
79
|
+
}));
|
|
80
|
+
const dataEntriesFrameSchema = zod.z.lazy(() => zod.z.object({
|
|
81
|
+
"type": zod.z.literal("data-entries"),
|
|
82
|
+
"peer": zod.z.lazy(() => deviceIdSchema),
|
|
83
|
+
"from-seq": zod.z.number().int().nonnegative(),
|
|
84
|
+
"entries": zod.z.array(zod.z.instanceof(Uint8Array))
|
|
85
|
+
}));
|
|
86
|
+
const handleClaimsSchema = zod.z.lazy(() => zod.z.object({
|
|
87
|
+
"handle": zod.z.string(),
|
|
88
|
+
"device-id": zod.z.lazy(() => deviceIdSchema),
|
|
89
|
+
"identity-key": zod.z.lazy(() => identityKeySchema),
|
|
90
|
+
"candidates": zod.z.array(zod.z.lazy(() => wireCandidateSchema)).optional(),
|
|
91
|
+
"mailboxes": zod.z.array(zod.z.lazy(() => deviceIdSchema)).optional(),
|
|
92
|
+
"issued": zod.z.number().int().nonnegative(),
|
|
93
|
+
"expires": zod.z.number().int().nonnegative()
|
|
94
|
+
}));
|
|
95
|
+
const handleRecordSchema = zod.z.lazy(() => zod.z.lazy(() => coseSign1Schema));
|
|
57
96
|
const ptySpawnSchema = zod.z.lazy(() => zod.z.object({
|
|
58
97
|
"verb": zod.z.literal("pty.spawn"),
|
|
59
98
|
"shell": zod.z.string().optional(),
|
|
@@ -122,7 +161,10 @@ const frameVariantSchema = zod.z.lazy(() => zod.z.union([
|
|
|
122
161
|
zod.z.lazy(() => streamEndFrameSchema),
|
|
123
162
|
zod.z.lazy(() => dataHaveFrameSchema),
|
|
124
163
|
zod.z.lazy(() => dataRequestFrameSchema),
|
|
125
|
-
zod.z.lazy(() => dataEntriesFrameSchema)
|
|
164
|
+
zod.z.lazy(() => dataEntriesFrameSchema),
|
|
165
|
+
zod.z.lazy(() => bulkDataFrameSchema),
|
|
166
|
+
zod.z.lazy(() => bulkAckFrameSchema),
|
|
167
|
+
zod.z.lazy(() => bulkEndFrameSchema)
|
|
126
168
|
]));
|
|
127
169
|
const frameSchema = zod.z.lazy(() => zod.z.lazy(() => frameVariantSchema));
|
|
128
170
|
const protocolVersionSchema = zod.z.lazy(() => zod.z.number().int().nonnegative());
|
|
@@ -137,7 +179,8 @@ const coreDomainNameSchema = zod.z.lazy(() => zod.z.union([
|
|
|
137
179
|
zod.z.literal("core/data"),
|
|
138
180
|
zod.z.literal("core/federation"),
|
|
139
181
|
zod.z.literal("core/webrtc"),
|
|
140
|
-
zod.z.literal("core/room")
|
|
182
|
+
zod.z.literal("core/room"),
|
|
183
|
+
zod.z.literal("core/bulk")
|
|
141
184
|
]));
|
|
142
185
|
const namespacedDomainIdSchema = zod.z.lazy(() => zod.z.string().regex(/* @__PURE__ */ new RegExp("[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+/[A-Za-z0-9_.-]+")));
|
|
143
186
|
const privateUseDomainIdSchema = zod.z.lazy(() => zod.z.string().regex(/* @__PURE__ */ new RegExp("x-[A-Za-z0-9_.-]+")));
|
|
@@ -399,6 +442,12 @@ const iceCandidateInitSchema = zod.z.lazy(() => zod.z.object({
|
|
|
399
442
|
"username-fragment": zod.z.string().optional()
|
|
400
443
|
}));
|
|
401
444
|
//#endregion
|
|
445
|
+
exports.bulkAckFrameSchema = bulkAckFrameSchema;
|
|
446
|
+
exports.bulkCancelSchema = bulkCancelSchema;
|
|
447
|
+
exports.bulkDataFrameSchema = bulkDataFrameSchema;
|
|
448
|
+
exports.bulkEndFrameSchema = bulkEndFrameSchema;
|
|
449
|
+
exports.bulkOpenSchema = bulkOpenSchema;
|
|
450
|
+
exports.bulkResumeSchema = bulkResumeSchema;
|
|
402
451
|
exports.candidateKindSchema = candidateKindSchema;
|
|
403
452
|
exports.candidatesFrameSchema = candidatesFrameSchema;
|
|
404
453
|
exports.capabilityGrantOkSchema = capabilityGrantOkSchema;
|
|
@@ -482,6 +531,7 @@ exports.streamEndFrameSchema = streamEndFrameSchema;
|
|
|
482
531
|
exports.streamSessionSchema = streamSessionSchema;
|
|
483
532
|
exports.syncPunchFrameSchema = syncPunchFrameSchema;
|
|
484
533
|
exports.tokenClaimsSchema = tokenClaimsSchema;
|
|
534
|
+
exports.transferIdSchema = transferIdSchema;
|
|
485
535
|
exports.webrtcAnswerSchema = webrtcAnswerSchema;
|
|
486
536
|
exports.webrtcIceCandidateSchema = webrtcIceCandidateSchema;
|
|
487
537
|
exports.webrtcOfferSchema = webrtcOfferSchema;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
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
|
+
import { $ as PeerIdentity, $n as relayInboundFrameSchema, $t as capabilityTokenSchema, A as DomainId, An as manageOkSchema, At as StreamAckFrame, B as IdentityKey, Bn as pingFrameSchema, Bt as WireCandidate, C as CoseTokenHeaders, Cn as handleRecordSchema, Cr as webrtcAnswerSchema, Ct as RoomMembers, D as DeviceId, Dn as manageCommandParamsSchema, Dt as RoomPath, E as DataRequestFrame, En as identityKeySchema, Er as wireCandidateSchema, Et as RoomNoticeClaims, F as GossipFrame, Fn as namespacedDomainIdSchema, Ft as TokenClaims, G as ManageRequestFrame, Gn as procSpawnSchema, Gt as bulkOpenSchema, H as ManageCommandParams, Hn as privateUseDomainIdSchema, Ht as bulkCancelSchema, I as HandleClaims, In as observedAddressFrameSchema, It as TransferId, J as NamespacedCapability, Jn as ptyResizeSchema, Jt as candidatesFrameSchema, K as ManageResponseFrame, Kn as protocolVersionSchema, Kt as bulkResumeSchema, L as HandleRecord, Ln as ownerNamedRoomPathSchema, Lt as WebrtcAnswer, M as ExecSessionInfo, Mn as manageResponseFrameSchema, Mt as StreamEndFrame, N as Frame, Nn as messageRefSchema, Nt as StreamSession, O as DeviceIdHex, On as manageCommandSchema, Ot as RoomRead, P as FrameVariant, Pn as namespacedCapabilitySchema, Pt as SyncPunchFrame, Q as PeerAdvert, Qn as relayDataFrameSchema, Qt as capabilityScopeSchema, R as HandshakeFrame, Rn as peerAdvertSchema, Rt as WebrtcIceCandidate, S as CoseSign1, Sn as handleClaimsSchema, Sr as transferIdSchema, St as RoomMember, T as DataHaveFrame, Tn as iceCandidateInitSchema, Tr as webrtcOfferSchema, Tt as RoomNotice, U as ManageError, Un as procKillSchema, Ut as bulkDataFrameSchema, V as ManageCommand, Vn as privateUseCapabilitySchema, Vt as bulkAckFrameSchema, W as ManageOk, Wn as procSignalSchema, Wt as bulkEndFrameSchema, X as ObservedAddressFrame, Xn as ptyWriteSchema, Xt as capabilityGrantSchema, Y as NamespacedDomainId, Yn as ptySpawnSchema, Yt as capabilityGrantOkSchema, Z as OwnerNamedRoomPath, Zn as relayConnectFrameSchema, Zt as capabilityRequestSchema, _ as CoreCapability, _n as execListSchema, _r as streamDataFrameSchema, _t as RevocationEntry, a as BulkOpen, an as coseHeaderAlgSchema, ar as roomJoinOkSchema, at as ProcSpawn, b as CoseHeaderKid, bn as frameVariantSchema, br as syncPunchFrameSchema, bt as RoomJoinOk, c as CandidatesFrame, cn as coseSign1Schema, cr as roomMemberSchema, ct as PtyResize, d as CapabilityRequest, dn as dataHaveFrameSchema, dr as roomNoticeClaimsSchema, dt as RelayConnectFrame, en as capabilityVerbSchema, er as relayOfferFrameSchema, et as PingFrame, f as CapabilityScope, fn as dataRequestFrameSchema, fr as roomNoticeSchema, ft as RelayDataFrame, g as CoordinatorFrame, gn as domainIdSchema, gr as streamAckFrameSchema, gt as RevocationClaims, h as CloseFrame, hn as dmRoomPathSchema, hr as roomSendSchema, ht as RevocationAnnounceFrame, i as BulkEndFrame, in as coreDomainNameSchema, ir as roomInviteSchema, it as ProcSignal, j as ExecList, jn as manageRequestFrameSchema, jt as StreamDataFrame, k as DmRoomPath, kn as manageErrorSchema, kt as RoomSend, l as CapabilityGrant, ln as coseTokenHeadersSchema, lr as roomMembersOkSchema, lt as PtySpawn, m as CapabilityVerb, mn as deviceIdSchema, mr as roomReadSchema, mt as RelayOfferFrame, n as BulkCancel, nn as coordinatorFrameSchema, nr as revocationClaimsSchema, nt as PrivateUseDomainId, o as BulkResume, on as coseHeaderKidSchema, or as roomJoinSchema, ot as ProtocolVersion, p as CapabilityToken, pn as deviceIdHexSchema, pr as roomPathSchema, pt as RelayInboundFrame, q as MessageRef, qn as ptyKillSchema, qt as candidateKindSchema, r as BulkDataFrame, rn as coreCapabilitySchema, rr as revocationEntrySchema, rt as ProcKill, s as CandidateKind, sn as coseHeaderLabelSchema, sr as roomLeaveSchema, st as PtyKill, t as BulkAckFrame, tn as closeFrameSchema, tr as revocationAnnounceFrameSchema, tt as PrivateUseCapability, u as CapabilityGrantOk, un as dataEntriesFrameSchema, ur as roomMembersSchema, ut as PtyWrite, v as CoreDomainName, vn as execSessionInfoSchema, vr as streamEndFrameSchema, vt as RoomInvite, w as DataEntriesFrame, wn as handshakeFrameSchema, wr as webrtcIceCandidateSchema, wt as RoomMembersOk, x as CoseHeaderLabel, xn as gossipFrameSchema, xr as tokenClaimsSchema, xt as RoomLeave, y as CoseHeaderAlg, yn as frameSchema, yr as streamSessionSchema, yt as RoomJoin, z as IceCandidateInit, zn as peerIdentitySchema, zt as WebrtcOffer } from "../protocol-sW8d6Og-.cjs";
|
|
2
|
+
export { BulkAckFrame, BulkCancel, BulkDataFrame, BulkEndFrame, BulkOpen, BulkResume, CandidateKind, CandidatesFrame, CapabilityGrant, CapabilityGrantOk, CapabilityRequest, CapabilityScope, CapabilityToken, CapabilityVerb, CloseFrame, CoordinatorFrame, CoreCapability, CoreDomainName, CoseHeaderAlg, CoseHeaderKid, CoseHeaderLabel, CoseSign1, CoseTokenHeaders, DataEntriesFrame, DataHaveFrame, DataRequestFrame, DeviceId, DeviceIdHex, DmRoomPath, DomainId, ExecList, ExecSessionInfo, Frame, FrameVariant, GossipFrame, HandleClaims, HandleRecord, HandshakeFrame, IceCandidateInit, IdentityKey, ManageCommand, ManageCommandParams, ManageError, ManageOk, ManageRequestFrame, ManageResponseFrame, MessageRef, NamespacedCapability, NamespacedDomainId, ObservedAddressFrame, OwnerNamedRoomPath, 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, TransferId, WebrtcAnswer, WebrtcIceCandidate, WebrtcOffer, WireCandidate, bulkAckFrameSchema, bulkCancelSchema, bulkDataFrameSchema, bulkEndFrameSchema, bulkOpenSchema, bulkResumeSchema, candidateKindSchema, candidatesFrameSchema, capabilityGrantOkSchema, capabilityGrantSchema, capabilityRequestSchema, capabilityScopeSchema, capabilityTokenSchema, capabilityVerbSchema, closeFrameSchema, coordinatorFrameSchema, coreCapabilitySchema, coreDomainNameSchema, coseHeaderAlgSchema, coseHeaderKidSchema, coseHeaderLabelSchema, coseSign1Schema, coseTokenHeadersSchema, dataEntriesFrameSchema, dataHaveFrameSchema, dataRequestFrameSchema, deviceIdHexSchema, deviceIdSchema, dmRoomPathSchema, domainIdSchema, execListSchema, execSessionInfoSchema, frameSchema, frameVariantSchema, gossipFrameSchema, handleClaimsSchema, handleRecordSchema, handshakeFrameSchema, iceCandidateInitSchema, identityKeySchema, manageCommandParamsSchema, manageCommandSchema, manageErrorSchema, manageOkSchema, manageRequestFrameSchema, manageResponseFrameSchema, messageRefSchema, namespacedCapabilitySchema, namespacedDomainIdSchema, observedAddressFrameSchema, ownerNamedRoomPathSchema, 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, transferIdSchema, webrtcAnswerSchema, webrtcIceCandidateSchema, webrtcOfferSchema, wireCandidateSchema };
|