@openvtc/trust-tasks 0.26.10 → 0.26.11

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../src/rooms/keys/open/0.2/payload.ts"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openvtc/trust-tasks",
3
- "version": "0.26.10",
3
+ "version": "0.26.11",
4
4
  "description": "Generated TypeScript bindings for the Trust Tasks framework registry.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -445,14 +445,17 @@ export * as RoomsEpochMint_v0_1 from "./rooms/epoch/mint/0.1/payload.js";
445
445
  export * as RoomsEpochPrune_v0_1 from "./rooms/epoch/prune/0.1/payload.js";
446
446
  export * as RoomsInfo_v0_1 from "./rooms/info/0.1/payload.js";
447
447
  export * as RoomsKeysAct_v0_1 from "./rooms/keys/act/0.1/payload.js";
448
+ export * as RoomsKeysAct_v0_2 from "./rooms/keys/act/0.2/payload.js";
448
449
  export * as RoomsKeysBackfill_v0_1 from "./rooms/keys/backfill/0.1/payload.js";
449
450
  export * as RoomsKeysBrowse_v0_1 from "./rooms/keys/browse/0.1/payload.js";
450
451
  export * as RoomsKeysChain_v0_1 from "./rooms/keys/chain/0.1/payload.js";
451
452
  export * as RoomsKeysCommit_v0_1 from "./rooms/keys/commit/0.1/payload.js";
452
453
  export * as RoomsKeysFileKey_v0_1 from "./rooms/keys/file-key/0.1/payload.js";
454
+ export * as RoomsKeysFileKey_v0_2 from "./rooms/keys/file-key/0.2/payload.js";
453
455
  export * as RoomsKeysKeyPackage_v0_1 from "./rooms/keys/key-package/0.1/payload.js";
454
456
  export * as RoomsKeysList_v0_1 from "./rooms/keys/list/0.1/payload.js";
455
457
  export * as RoomsKeysOpen_v0_1 from "./rooms/keys/open/0.1/payload.js";
458
+ export * as RoomsKeysOpen_v0_2 from "./rooms/keys/open/0.2/payload.js";
456
459
  export * as RoomsKeysPresent_v0_1 from "./rooms/keys/present/0.1/payload.js";
457
460
  export * as RoomsKeysPresent_v0_2 from "./rooms/keys/present/0.2/payload.js";
458
461
  export * as RoomsKeysRead_v0_1 from "./rooms/keys/read/0.1/payload.js";
@@ -0,0 +1,380 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/keys/act/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A member's own client asks the member's key holder to complete one host-bound room request as the member: the member's own authority narrowed to the one action the request's type needs, the member as issuer, and the member's signature. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface RoomsKeysActPayload {
13
+ document: UnsignedRoomRequest;
14
+ /**
15
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
16
+ */
17
+ ext?: Ext;
18
+ }
19
+ /**
20
+ * The room request to complete, as the client will send it, minus its presentation and its proof.
21
+ */
22
+ export interface UnsignedRoomRequest {
23
+ /**
24
+ * The request's identifier, set by the client. The host keys duplicate-execution protection on it.
25
+ */
26
+ id: string;
27
+ /**
28
+ * The room request's Type URI. Only the types in this task's table are completed; any other is `typeNotActable`.
29
+ */
30
+ type: string;
31
+ /**
32
+ * The member to act as, and this task's subject (subjectPath /document/issuer). REQUIRED for a type that names no room (rooms/blobs/chunk/0.1, rooms/blobs/upload/{commit,abort}/0.2), where it is the member whose request opened the transfer; REQUIRED where the caller may act as more than one member of the room; optional where it may act as exactly one. A rule over two members this schema does not express: the recipient refuses an absent issuer it needs with principalAmbiguous. Never the client's own identifier.
33
+ */
34
+ issuer?: string;
35
+ /**
36
+ * The room's host, which the completed document is for. Covered by the member's proof.
37
+ */
38
+ recipient: string;
39
+ issuedAt: string;
40
+ expiresAt?: string;
41
+ threadId?: string;
42
+ /**
43
+ * The request's payload, as the named type's schema defines it but without `presentation`: the recipient inserts the member's own, narrowed to the table's action, and refuses a payload that already carries one.
44
+ */
45
+ payload: {};
46
+ ext?: Ext;
47
+ }
48
+ /**
49
+ * Success response to rooms/keys/act. Type https://trusttasks.org/spec/rooms/keys/act/0.2#response. The request, completed as the member, for the caller to send to its recipient unaltered.
50
+ */
51
+ export interface RoomsKeysActResponsePayload {
52
+ /**
53
+ * The member the recipient signed as: the completed document's `issuer`.
54
+ */
55
+ principal: string;
56
+ /**
57
+ * The supplied document with `issuer` set to the member, `payload.presentation` inserted where the type takes one, and the member's Data Integrity `proof` (`proofPurpose: authentication`). Every other member is unchanged.
58
+ */
59
+ document: {};
60
+ /**
61
+ * When the inserted presentation's leaf lapses. Absent when the type takes no presentation.
62
+ */
63
+ expiresAt?: string;
64
+ ext?: Ext;
65
+ }
66
+
67
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
68
+ export type { Ext };
69
+
70
+ /** Trust Task type URI. */
71
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/keys/act/0.2" as const;
72
+
73
+ /** Stable alias for this specification's request payload shape. */
74
+ export type Payload = RoomsKeysActPayload;
75
+
76
+ /** Trust Task response type URI (request type URI + "#response"). */
77
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/keys/act/0.2#response" as const;
78
+
79
+ /** Stable alias for this specification's success-response payload shape. */
80
+ export type Response = RoomsKeysActResponsePayload;
81
+
82
+ /**
83
+ * This specification's payload schema, as a value.
84
+ *
85
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
86
+ * rather than only as a `.json` file because TypeScript types are erased
87
+ * at runtime: without a schema a consumer has nothing to validate, and
88
+ * every REQUIRED payload member is optional in practice. Cross-file
89
+ * `$ref`s are already inlined, so it needs no resolver.
90
+ */
91
+ export const PAYLOAD_SCHEMA = {
92
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
93
+ "$id": "https://trusttasks.org/spec/rooms/keys/act/0.2",
94
+ "title": "Rooms Keys Act — payload",
95
+ "description": "A member's own client asks the member's key holder to complete one host-bound room request as the member: the member's own authority narrowed to the one action the request's type needs, the member as issuer, and the member's signature. The outer document members are owned by the framework — SPEC §6.3.",
96
+ "type": "object",
97
+ "additionalProperties": false,
98
+ "required": [
99
+ "document"
100
+ ],
101
+ "properties": {
102
+ "document": {
103
+ "$ref": "#/$defs/UnsignedRoomRequest",
104
+ "description": "The room request to complete, as the client will send it, minus its presentation and its proof."
105
+ },
106
+ "ext": {
107
+ "$ref": "#/$defs/Ext",
108
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
109
+ }
110
+ },
111
+ "$defs": {
112
+ "UnsignedRoomRequest": {
113
+ "$anchor": "unsigned-room-request",
114
+ "title": "Unsigned room request",
115
+ "description": "A Trust Task document of a type in the rooms/keys/act table, built by the member's client: no proof, and no presentation in its payload. The recipient validates the payload against the named type's own schema; this one fixes only the envelope.",
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": [
119
+ "id",
120
+ "type",
121
+ "recipient",
122
+ "issuedAt",
123
+ "payload"
124
+ ],
125
+ "properties": {
126
+ "id": {
127
+ "type": "string",
128
+ "minLength": 1,
129
+ "maxLength": 512,
130
+ "description": "The request's identifier, set by the client. The host keys duplicate-execution protection on it."
131
+ },
132
+ "type": {
133
+ "type": "string",
134
+ "pattern": "^https://trusttasks\\.org/spec/rooms/",
135
+ "maxLength": 2048,
136
+ "description": "The room request's Type URI. Only the types in this task's table are completed; any other is `typeNotActable`."
137
+ },
138
+ "issuer": {
139
+ "type": "string",
140
+ "pattern": "^did:",
141
+ "maxLength": 2048,
142
+ "description": "The member to act as, and this task's subject (subjectPath /document/issuer). REQUIRED for a type that names no room (rooms/blobs/chunk/0.1, rooms/blobs/upload/{commit,abort}/0.2), where it is the member whose request opened the transfer; REQUIRED where the caller may act as more than one member of the room; optional where it may act as exactly one. A rule over two members this schema does not express: the recipient refuses an absent issuer it needs with principalAmbiguous. Never the client's own identifier."
143
+ },
144
+ "recipient": {
145
+ "type": "string",
146
+ "pattern": "^did:",
147
+ "maxLength": 2048,
148
+ "description": "The room's host, which the completed document is for. Covered by the member's proof."
149
+ },
150
+ "issuedAt": {
151
+ "type": "string",
152
+ "format": "date-time"
153
+ },
154
+ "expiresAt": {
155
+ "type": "string",
156
+ "format": "date-time"
157
+ },
158
+ "threadId": {
159
+ "type": "string",
160
+ "minLength": 1,
161
+ "maxLength": 512
162
+ },
163
+ "payload": {
164
+ "type": "object",
165
+ "description": "The request's payload, as the named type's schema defines it but without `presentation`: the recipient inserts the member's own, narrowed to the table's action, and refuses a payload that already carries one."
166
+ },
167
+ "ext": {
168
+ "$ref": "#/$defs/Ext"
169
+ }
170
+ },
171
+ "not": {
172
+ "required": [
173
+ "proof"
174
+ ]
175
+ }
176
+ },
177
+ "Response": {
178
+ "$anchor": "response",
179
+ "title": "Rooms Keys Act — response payload",
180
+ "description": "Success response to rooms/keys/act. Type https://trusttasks.org/spec/rooms/keys/act/0.2#response. The request, completed as the member, for the caller to send to its recipient unaltered.",
181
+ "type": "object",
182
+ "additionalProperties": false,
183
+ "required": [
184
+ "principal",
185
+ "document"
186
+ ],
187
+ "properties": {
188
+ "principal": {
189
+ "type": "string",
190
+ "pattern": "^did:",
191
+ "maxLength": 2048,
192
+ "description": "The member the recipient signed as: the completed document's `issuer`."
193
+ },
194
+ "document": {
195
+ "type": "object",
196
+ "required": [
197
+ "id",
198
+ "type",
199
+ "issuer",
200
+ "recipient",
201
+ "issuedAt",
202
+ "payload",
203
+ "proof"
204
+ ],
205
+ "description": "The supplied document with `issuer` set to the member, `payload.presentation` inserted where the type takes one, and the member's Data Integrity `proof` (`proofPurpose: authentication`). Every other member is unchanged."
206
+ },
207
+ "expiresAt": {
208
+ "type": "string",
209
+ "format": "date-time",
210
+ "description": "When the inserted presentation's leaf lapses. Absent when the type takes no presentation."
211
+ },
212
+ "ext": {
213
+ "$ref": "#/$defs/Ext"
214
+ }
215
+ }
216
+ },
217
+ "Ext": {
218
+ "title": "Ext",
219
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
220
+ "type": "object",
221
+ "minProperties": 1,
222
+ "additionalProperties": true,
223
+ "propertyNames": {
224
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
225
+ }
226
+ }
227
+ }
228
+ } as const;
229
+
230
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
231
+ export const RESPONSE_PAYLOAD_SCHEMA = {
232
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
233
+ "$ref": "#/$defs/Response",
234
+ "$defs": {
235
+ "UnsignedRoomRequest": {
236
+ "$anchor": "unsigned-room-request",
237
+ "title": "Unsigned room request",
238
+ "description": "A Trust Task document of a type in the rooms/keys/act table, built by the member's client: no proof, and no presentation in its payload. The recipient validates the payload against the named type's own schema; this one fixes only the envelope.",
239
+ "type": "object",
240
+ "additionalProperties": false,
241
+ "required": [
242
+ "id",
243
+ "type",
244
+ "recipient",
245
+ "issuedAt",
246
+ "payload"
247
+ ],
248
+ "properties": {
249
+ "id": {
250
+ "type": "string",
251
+ "minLength": 1,
252
+ "maxLength": 512,
253
+ "description": "The request's identifier, set by the client. The host keys duplicate-execution protection on it."
254
+ },
255
+ "type": {
256
+ "type": "string",
257
+ "pattern": "^https://trusttasks\\.org/spec/rooms/",
258
+ "maxLength": 2048,
259
+ "description": "The room request's Type URI. Only the types in this task's table are completed; any other is `typeNotActable`."
260
+ },
261
+ "issuer": {
262
+ "type": "string",
263
+ "pattern": "^did:",
264
+ "maxLength": 2048,
265
+ "description": "The member to act as, and this task's subject (subjectPath /document/issuer). REQUIRED for a type that names no room (rooms/blobs/chunk/0.1, rooms/blobs/upload/{commit,abort}/0.2), where it is the member whose request opened the transfer; REQUIRED where the caller may act as more than one member of the room; optional where it may act as exactly one. A rule over two members this schema does not express: the recipient refuses an absent issuer it needs with principalAmbiguous. Never the client's own identifier."
266
+ },
267
+ "recipient": {
268
+ "type": "string",
269
+ "pattern": "^did:",
270
+ "maxLength": 2048,
271
+ "description": "The room's host, which the completed document is for. Covered by the member's proof."
272
+ },
273
+ "issuedAt": {
274
+ "type": "string",
275
+ "format": "date-time"
276
+ },
277
+ "expiresAt": {
278
+ "type": "string",
279
+ "format": "date-time"
280
+ },
281
+ "threadId": {
282
+ "type": "string",
283
+ "minLength": 1,
284
+ "maxLength": 512
285
+ },
286
+ "payload": {
287
+ "type": "object",
288
+ "description": "The request's payload, as the named type's schema defines it but without `presentation`: the recipient inserts the member's own, narrowed to the table's action, and refuses a payload that already carries one."
289
+ },
290
+ "ext": {
291
+ "$ref": "#/$defs/Ext"
292
+ }
293
+ },
294
+ "not": {
295
+ "required": [
296
+ "proof"
297
+ ]
298
+ }
299
+ },
300
+ "Response": {
301
+ "$anchor": "response",
302
+ "title": "Rooms Keys Act — response payload",
303
+ "description": "Success response to rooms/keys/act. Type https://trusttasks.org/spec/rooms/keys/act/0.2#response. The request, completed as the member, for the caller to send to its recipient unaltered.",
304
+ "type": "object",
305
+ "additionalProperties": false,
306
+ "required": [
307
+ "principal",
308
+ "document"
309
+ ],
310
+ "properties": {
311
+ "principal": {
312
+ "type": "string",
313
+ "pattern": "^did:",
314
+ "maxLength": 2048,
315
+ "description": "The member the recipient signed as: the completed document's `issuer`."
316
+ },
317
+ "document": {
318
+ "type": "object",
319
+ "required": [
320
+ "id",
321
+ "type",
322
+ "issuer",
323
+ "recipient",
324
+ "issuedAt",
325
+ "payload",
326
+ "proof"
327
+ ],
328
+ "description": "The supplied document with `issuer` set to the member, `payload.presentation` inserted where the type takes one, and the member's Data Integrity `proof` (`proofPurpose: authentication`). Every other member is unchanged."
329
+ },
330
+ "expiresAt": {
331
+ "type": "string",
332
+ "format": "date-time",
333
+ "description": "When the inserted presentation's leaf lapses. Absent when the type takes no presentation."
334
+ },
335
+ "ext": {
336
+ "$ref": "#/$defs/Ext"
337
+ }
338
+ }
339
+ },
340
+ "Ext": {
341
+ "title": "Ext",
342
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
343
+ "type": "object",
344
+ "minProperties": 1,
345
+ "additionalProperties": true,
346
+ "propertyNames": {
347
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
348
+ }
349
+ }
350
+ }
351
+ } as const;
352
+
353
+ /**
354
+ * SPEC.md §7.2 policy for the request variant, from this specification's
355
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
356
+ * per-specification and cannot be derived from the document alone, and
357
+ * item 2 needs the schema this carries.
358
+ */
359
+ export const SPEC = {
360
+ typeUri: TYPE_URI,
361
+ isBearer: false,
362
+ isProofRequired: true,
363
+ isRecipientRequired: true,
364
+ isIssuedAtRequired: true,
365
+ payloadSchema: PAYLOAD_SCHEMA,
366
+ } as const;
367
+
368
+ /**
369
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
370
+ * tracks the *issuer* party's requirement because a response swaps the
371
+ * parties (§7.3 item 5).
372
+ */
373
+ export const RESPONSE_SPEC = {
374
+ typeUri: RESPONSE_TYPE_URI,
375
+ isBearer: false,
376
+ isProofRequired: true,
377
+ isRecipientRequired: true,
378
+ isIssuedAtRequired: true,
379
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
380
+ } as const;
@@ -0,0 +1,224 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/keys/file-key/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A caller asks the party holding its principal's room keys for the key of ONE file in a room: derived from the room's storage key for an epoch, bound to the room, the epoch and the file's identifier, and opening that file and nothing else.
11
+ */
12
+ export interface RoomsKeysFileKeyPayload {
13
+ /**
14
+ * The room the file belongs to. Bound into the derivation, so a key released for one room cannot open a blob relocated from another.
15
+ */
16
+ roomId: string;
17
+ /**
18
+ * The file's identifier: 32 random bytes, base64url without padding, as in FileManifest.fileId. The salt of the derivation. For `seal` the caller mints it fresh and MUST NOT reuse it; for `open` it is read from the sealed record's file manifest.
19
+ */
20
+ fileId: string;
21
+ /**
22
+ * `seal`: a key for a file about to be uploaded, derived under the room's CURRENT epoch, which the response names. `open`: a key for a file already in the room, derived under the epoch its manifest names.
23
+ */
24
+ purpose: "seal" | "open";
25
+ /**
26
+ * The epoch the file key derives from, as FileManifest.epoch states it. REQUIRED for `open` and forbidden for `seal` — a rule over two members this schema does not express; the custodian refuses a violation with `malformedRequest`. A sealing caller never chooses the epoch: sealing under anything but the current one would produce a file members who joined later could not open, or one a removed member still could.
27
+ */
28
+ epoch?: number;
29
+ /**
30
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
31
+ */
32
+ ext?: Ext;
33
+ }
34
+ /**
35
+ * Success response to rooms/keys/file-key. Type https://trusttasks.org/spec/rooms/keys/file-key/0.2#response.
36
+ */
37
+ export interface RoomsKeysFileKeyResponsePayload {
38
+ /**
39
+ * The 32-byte file key, base64url without padding. Opens exactly one file. The caller holds it in memory for as long as the file is being sealed or opened and then discards it; it never stores, logs or forwards it.
40
+ */
41
+ key: string;
42
+ /**
43
+ * The epoch the key was derived under. For `seal`, the room's current epoch, which the caller writes into the file's manifest; for `open`, the epoch requested.
44
+ */
45
+ epoch: number;
46
+ ext?: Ext;
47
+ }
48
+
49
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
50
+ export type { Ext };
51
+
52
+ /** Trust Task type URI. */
53
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/keys/file-key/0.2" as const;
54
+
55
+ /** Stable alias for this specification's request payload shape. */
56
+ export type Payload = RoomsKeysFileKeyPayload;
57
+
58
+ /** Trust Task response type URI (request type URI + "#response"). */
59
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/keys/file-key/0.2#response" as const;
60
+
61
+ /** Stable alias for this specification's success-response payload shape. */
62
+ export type Response = RoomsKeysFileKeyResponsePayload;
63
+
64
+ /**
65
+ * This specification's payload schema, as a value.
66
+ *
67
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
68
+ * rather than only as a `.json` file because TypeScript types are erased
69
+ * at runtime: without a schema a consumer has nothing to validate, and
70
+ * every REQUIRED payload member is optional in practice. Cross-file
71
+ * `$ref`s are already inlined, so it needs no resolver.
72
+ */
73
+ export const PAYLOAD_SCHEMA = {
74
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
75
+ "$id": "https://trusttasks.org/spec/rooms/keys/file-key/0.2",
76
+ "title": "Rooms Keys File Key — payload",
77
+ "description": "A caller asks the party holding its principal's room keys for the key of ONE file in a room: derived from the room's storage key for an epoch, bound to the room, the epoch and the file's identifier, and opening that file and nothing else.",
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": [
81
+ "roomId",
82
+ "fileId",
83
+ "purpose"
84
+ ],
85
+ "properties": {
86
+ "roomId": {
87
+ "type": "string",
88
+ "description": "The room the file belongs to. Bound into the derivation, so a key released for one room cannot open a blob relocated from another."
89
+ },
90
+ "fileId": {
91
+ "type": "string",
92
+ "pattern": "^[A-Za-z0-9_-]{43}$",
93
+ "description": "The file's identifier: 32 random bytes, base64url without padding, as in FileManifest.fileId. The salt of the derivation. For `seal` the caller mints it fresh and MUST NOT reuse it; for `open` it is read from the sealed record's file manifest."
94
+ },
95
+ "purpose": {
96
+ "type": "string",
97
+ "enum": [
98
+ "seal",
99
+ "open"
100
+ ],
101
+ "description": "`seal`: a key for a file about to be uploaded, derived under the room's CURRENT epoch, which the response names. `open`: a key for a file already in the room, derived under the epoch its manifest names."
102
+ },
103
+ "epoch": {
104
+ "type": "integer",
105
+ "minimum": 1,
106
+ "description": "The epoch the file key derives from, as FileManifest.epoch states it. REQUIRED for `open` and forbidden for `seal` — a rule over two members this schema does not express; the custodian refuses a violation with `malformedRequest`. A sealing caller never chooses the epoch: sealing under anything but the current one would produce a file members who joined later could not open, or one a removed member still could."
107
+ },
108
+ "ext": {
109
+ "$ref": "#/$defs/Ext",
110
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
111
+ }
112
+ },
113
+ "$defs": {
114
+ "Response": {
115
+ "$anchor": "response",
116
+ "title": "Rooms Keys File Key — response payload",
117
+ "description": "Success response to rooms/keys/file-key. Type https://trusttasks.org/spec/rooms/keys/file-key/0.2#response.",
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "required": [
121
+ "key",
122
+ "epoch"
123
+ ],
124
+ "properties": {
125
+ "key": {
126
+ "type": "string",
127
+ "pattern": "^[A-Za-z0-9_-]{43}$",
128
+ "description": "The 32-byte file key, base64url without padding. Opens exactly one file. The caller holds it in memory for as long as the file is being sealed or opened and then discards it; it never stores, logs or forwards it."
129
+ },
130
+ "epoch": {
131
+ "type": "integer",
132
+ "minimum": 1,
133
+ "description": "The epoch the key was derived under. For `seal`, the room's current epoch, which the caller writes into the file's manifest; for `open`, the epoch requested."
134
+ },
135
+ "ext": {
136
+ "$ref": "#/$defs/Ext"
137
+ }
138
+ }
139
+ },
140
+ "Ext": {
141
+ "title": "Ext",
142
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
143
+ "type": "object",
144
+ "minProperties": 1,
145
+ "additionalProperties": true,
146
+ "propertyNames": {
147
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
148
+ }
149
+ }
150
+ }
151
+ } as const;
152
+
153
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
154
+ export const RESPONSE_PAYLOAD_SCHEMA = {
155
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
156
+ "$ref": "#/$defs/Response",
157
+ "$defs": {
158
+ "Response": {
159
+ "$anchor": "response",
160
+ "title": "Rooms Keys File Key — response payload",
161
+ "description": "Success response to rooms/keys/file-key. Type https://trusttasks.org/spec/rooms/keys/file-key/0.2#response.",
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "required": [
165
+ "key",
166
+ "epoch"
167
+ ],
168
+ "properties": {
169
+ "key": {
170
+ "type": "string",
171
+ "pattern": "^[A-Za-z0-9_-]{43}$",
172
+ "description": "The 32-byte file key, base64url without padding. Opens exactly one file. The caller holds it in memory for as long as the file is being sealed or opened and then discards it; it never stores, logs or forwards it."
173
+ },
174
+ "epoch": {
175
+ "type": "integer",
176
+ "minimum": 1,
177
+ "description": "The epoch the key was derived under. For `seal`, the room's current epoch, which the caller writes into the file's manifest; for `open`, the epoch requested."
178
+ },
179
+ "ext": {
180
+ "$ref": "#/$defs/Ext"
181
+ }
182
+ }
183
+ },
184
+ "Ext": {
185
+ "title": "Ext",
186
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
187
+ "type": "object",
188
+ "minProperties": 1,
189
+ "additionalProperties": true,
190
+ "propertyNames": {
191
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
192
+ }
193
+ }
194
+ }
195
+ } as const;
196
+
197
+ /**
198
+ * SPEC.md §7.2 policy for the request variant, from this specification's
199
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
200
+ * per-specification and cannot be derived from the document alone, and
201
+ * item 2 needs the schema this carries.
202
+ */
203
+ export const SPEC = {
204
+ typeUri: TYPE_URI,
205
+ isBearer: false,
206
+ isProofRequired: true,
207
+ isRecipientRequired: true,
208
+ isIssuedAtRequired: true,
209
+ payloadSchema: PAYLOAD_SCHEMA,
210
+ } as const;
211
+
212
+ /**
213
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
214
+ * tracks the *issuer* party's requirement because a response swaps the
215
+ * parties (§7.3 item 5).
216
+ */
217
+ export const RESPONSE_SPEC = {
218
+ typeUri: RESPONSE_TYPE_URI,
219
+ isBearer: false,
220
+ isProofRequired: true,
221
+ isRecipientRequired: true,
222
+ isIssuedAtRequired: true,
223
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
224
+ } as const;