@openvtc/trust-tasks 0.26.11 → 0.26.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +274 -0
  2. package/dist/_shared/components.d.ts +18 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +11 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +11 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/rooms/keys/act/0.3/payload.d.ts +546 -0
  9. package/dist/rooms/keys/act/0.3/payload.d.ts.map +1 -0
  10. package/dist/rooms/keys/act/0.3/payload.js +305 -0
  11. package/dist/rooms/keys/act/0.3/payload.js.map +1 -0
  12. package/dist/rooms/owner/group/add/0.2/payload.d.ts +417 -0
  13. package/dist/rooms/owner/group/add/0.2/payload.d.ts.map +1 -0
  14. package/dist/rooms/owner/group/add/0.2/payload.js +218 -0
  15. package/dist/rooms/owner/group/add/0.2/payload.js.map +1 -0
  16. package/dist/vta/_shared/0.6/witness-party.d.ts +16 -0
  17. package/dist/vta/_shared/0.6/witness-party.d.ts.map +1 -0
  18. package/dist/vta/_shared/0.6/witness-party.js +6 -0
  19. package/dist/vta/_shared/0.6/witness-party.js.map +1 -0
  20. package/dist/vta/witness/accept/0.2/payload.d.ts +499 -0
  21. package/dist/vta/witness/accept/0.2/payload.d.ts.map +1 -0
  22. package/dist/vta/witness/accept/0.2/payload.js +278 -0
  23. package/dist/vta/witness/accept/0.2/payload.js.map +1 -0
  24. package/dist/vta/witness/open/0.2/payload.d.ts +500 -0
  25. package/dist/vta/witness/open/0.2/payload.d.ts.map +1 -0
  26. package/dist/vta/witness/open/0.2/payload.js +259 -0
  27. package/dist/vta/witness/open/0.2/payload.js.map +1 -0
  28. package/dist/vta/witness/present/0.2/payload.d.ts +303 -0
  29. package/dist/vta/witness/present/0.2/payload.d.ts.map +1 -0
  30. package/dist/vta/witness/present/0.2/payload.js +170 -0
  31. package/dist/vta/witness/present/0.2/payload.js.map +1 -0
  32. package/dist/vtc/members/personhood/assert/0.2/payload.d.ts +536 -0
  33. package/dist/vtc/members/personhood/assert/0.2/payload.d.ts.map +1 -0
  34. package/dist/vtc/members/personhood/assert/0.2/payload.js +228 -0
  35. package/dist/vtc/members/personhood/assert/0.2/payload.js.map +1 -0
  36. package/dist/vtc/members/registry-consent/0.1/payload.d.ts +311 -0
  37. package/dist/vtc/members/registry-consent/0.1/payload.d.ts.map +1 -0
  38. package/dist/vtc/members/registry-consent/0.1/payload.js +183 -0
  39. package/dist/vtc/members/registry-consent/0.1/payload.js.map +1 -0
  40. package/dist/vtc/members/update/0.1/payload.d.ts +3 -3
  41. package/dist/vtc/members/update/0.1/payload.js +1 -1
  42. package/dist/vtc/members/update/0.1/payload.js.map +1 -1
  43. package/dist/witness/_shared/0.1/outcome-evidence.d.ts +16 -0
  44. package/dist/witness/_shared/0.1/outcome-evidence.d.ts.map +1 -0
  45. package/dist/witness/_shared/0.1/outcome-evidence.js +6 -0
  46. package/dist/witness/_shared/0.1/outcome-evidence.js.map +1 -0
  47. package/dist/witness/session/0.2/payload.d.ts +274 -0
  48. package/dist/witness/session/0.2/payload.d.ts.map +1 -0
  49. package/dist/witness/session/0.2/payload.js +152 -0
  50. package/dist/witness/session/0.2/payload.js.map +1 -0
  51. package/dist/witness/session/submit/0.2/payload.d.ts +295 -0
  52. package/dist/witness/session/submit/0.2/payload.d.ts.map +1 -0
  53. package/dist/witness/session/submit/0.2/payload.js +166 -0
  54. package/dist/witness/session/submit/0.2/payload.js.map +1 -0
  55. package/package.json +1 -1
  56. package/src/_shared/components.ts +17 -0
  57. package/src/index.ts +11 -0
  58. package/src/rooms/keys/act/0.3/payload.ts +380 -0
  59. package/src/rooms/owner/group/add/0.2/payload.ts +288 -0
  60. package/src/vta/_shared/0.6/witness-party.ts +17 -0
  61. package/src/vta/witness/accept/0.2/payload.ts +330 -0
  62. package/src/vta/witness/open/0.2/payload.ts +336 -0
  63. package/src/vta/witness/present/0.2/payload.ts +210 -0
  64. package/src/vtc/members/personhood/assert/0.2/payload.ts +421 -0
  65. package/src/vtc/members/registry-consent/0.1/payload.ts +231 -0
  66. package/src/vtc/members/update/0.1/payload.ts +2 -2
  67. package/src/witness/_shared/0.1/outcome-evidence.ts +17 -0
  68. package/src/witness/session/0.2/payload.ts +197 -0
  69. package/src/witness/session/submit/0.2/payload.ts +212 -0
@@ -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.3/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 — or one of the two requests by which a member takes up a community's offer of admission to a room — 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: a rooms/* request, or vtc/rooms/offers/{list,accept}. 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 for the offer types (vtc/rooms/offers/list/0.1, vtc/rooms/offers/accept/0.1), where it is the DID the community addressed its offer to; 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, or for the offer types the community that made the offer: the party 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, where the type takes one, and refuses a payload that already carries one. For vtc/rooms/offers/accept/0.1 a `keyPackage`, where present, MUST be one the recipient minted (Recipient item 10).
44
+ */
45
+ payload: {};
46
+ ext?: Ext;
47
+ }
48
+ /**
49
+ * Success response to rooms/keys/act. Type https://trusttasks.org/spec/rooms/keys/act/0.3#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.3" 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.3#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.3",
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 — or one of the two requests by which a member takes up a community's offer of admission to a room — 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|vtc/rooms/offers)/",
135
+ "maxLength": 2048,
136
+ "description": "The room request's Type URI: a rooms/* request, or vtc/rooms/offers/{list,accept}. 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 for the offer types (vtc/rooms/offers/list/0.1, vtc/rooms/offers/accept/0.1), where it is the DID the community addressed its offer to; 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, or for the offer types the community that made the offer: the party 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, where the type takes one, and refuses a payload that already carries one. For vtc/rooms/offers/accept/0.1 a `keyPackage`, where present, MUST be one the recipient minted (Recipient item 10)."
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.3#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|vtc/rooms/offers)/",
258
+ "maxLength": 2048,
259
+ "description": "The room request's Type URI: a rooms/* request, or vtc/rooms/offers/{list,accept}. 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 for the offer types (vtc/rooms/offers/list/0.1, vtc/rooms/offers/accept/0.1), where it is the DID the community addressed its offer to; 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, or for the offer types the community that made the offer: the party 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, where the type takes one, and refuses a payload that already carries one. For vtc/rooms/offers/accept/0.1 a `keyPackage`, where present, MUST be one the recipient minted (Recipient item 10)."
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.3#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,288 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/owner/group/add/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../../_shared/components.js";
7
+
8
+
9
+ export interface RoomsOwnerGroupAddPayload {
10
+ /**
11
+ * The room whose group admits a member. The recipient MUST hold its group.
12
+ */
13
+ roomId: string;
14
+ /**
15
+ * The room's host, as a DID: where the room's epoch advances. Named by the caller because the recipient holds key custody, not a hosting register.
16
+ */
17
+ host: string;
18
+ /**
19
+ * The DID being admitted. The KeyPackage's leaf credential MUST identify it; one that names anyone else is refused, so an owner never admits a party other than the one they meant.
20
+ */
21
+ member: string;
22
+ /**
23
+ * The newcomer's MLS KeyPackage, base64url without padding, as rooms/keys/key-package returned it.
24
+ */
25
+ keyPackage: string;
26
+ /**
27
+ * Why, carried to the host's epoch advance. Untrusted and attributed to its author: it MUST NOT carry personal data or a credential.
28
+ */
29
+ reason?: string;
30
+ /**
31
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
32
+ */
33
+ ext?: Ext;
34
+ }
35
+ /**
36
+ * Success response to rooms/owner/group/add. Type https://trusttasks.org/spec/rooms/owner/group/add/0.2#response. The room's new epoch, and the Welcome for the caller to deliver to the newcomer's key holder with rooms/keys/welcome.
37
+ */
38
+ export interface RoomsOwnerGroupAddResponsePayload {
39
+ /**
40
+ * The room.
41
+ */
42
+ roomId: string;
43
+ /**
44
+ * Who was admitted.
45
+ */
46
+ member: string;
47
+ /**
48
+ * The room epoch after the admission, as the host recorded it.
49
+ */
50
+ epoch: number;
51
+ /**
52
+ * The MLS Welcome, base64url, sealed to the newcomer's KeyPackage. For rooms/keys/welcome; never through the host.
53
+ */
54
+ welcome: string;
55
+ /**
56
+ * The group's ratchet tree, base64url, where the Welcome does not carry it as an extension. Passed to rooms/keys/welcome unchanged.
57
+ */
58
+ ratchetTree?: string;
59
+ ext?: Ext;
60
+ }
61
+
62
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
63
+ export type { Ext };
64
+
65
+ /** Trust Task type URI. */
66
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/owner/group/add/0.2" as const;
67
+
68
+ /** Stable alias for this specification's request payload shape. */
69
+ export type Payload = RoomsOwnerGroupAddPayload;
70
+
71
+ /** Trust Task response type URI (request type URI + "#response"). */
72
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/owner/group/add/0.2#response" as const;
73
+
74
+ /** Stable alias for this specification's success-response payload shape. */
75
+ export type Response = RoomsOwnerGroupAddResponsePayload;
76
+
77
+ /**
78
+ * This specification's payload schema, as a value.
79
+ *
80
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
81
+ * rather than only as a `.json` file because TypeScript types are erased
82
+ * at runtime: without a schema a consumer has nothing to validate, and
83
+ * every REQUIRED payload member is optional in practice. Cross-file
84
+ * `$ref`s are already inlined, so it needs no resolver.
85
+ */
86
+ export const PAYLOAD_SCHEMA = {
87
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
88
+ "$id": "https://trusttasks.org/spec/rooms/owner/group/add/0.2",
89
+ "title": "Rooms Owner Group Add — payload",
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": [
93
+ "roomId",
94
+ "host",
95
+ "member",
96
+ "keyPackage"
97
+ ],
98
+ "properties": {
99
+ "roomId": {
100
+ "type": "string",
101
+ "minLength": 1,
102
+ "maxLength": 512,
103
+ "description": "The room whose group admits a member. The recipient MUST hold its group."
104
+ },
105
+ "host": {
106
+ "type": "string",
107
+ "pattern": "^did:",
108
+ "maxLength": 2048,
109
+ "description": "The room's host, as a DID: where the room's epoch advances. Named by the caller because the recipient holds key custody, not a hosting register."
110
+ },
111
+ "member": {
112
+ "type": "string",
113
+ "pattern": "^did:",
114
+ "maxLength": 2048,
115
+ "description": "The DID being admitted. The KeyPackage's leaf credential MUST identify it; one that names anyone else is refused, so an owner never admits a party other than the one they meant."
116
+ },
117
+ "keyPackage": {
118
+ "type": "string",
119
+ "minLength": 1,
120
+ "maxLength": 65536,
121
+ "pattern": "^[A-Za-z0-9_-]+$",
122
+ "description": "The newcomer's MLS KeyPackage, base64url without padding, as rooms/keys/key-package returned it."
123
+ },
124
+ "reason": {
125
+ "type": "string",
126
+ "minLength": 1,
127
+ "maxLength": 500,
128
+ "description": "Why, carried to the host's epoch advance. Untrusted and attributed to its author: it MUST NOT carry personal data or a credential."
129
+ },
130
+ "ext": {
131
+ "$ref": "#/$defs/Ext",
132
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
133
+ }
134
+ },
135
+ "$defs": {
136
+ "Response": {
137
+ "$anchor": "response",
138
+ "title": "Rooms Owner Group Add — response payload",
139
+ "description": "Success response to rooms/owner/group/add. Type https://trusttasks.org/spec/rooms/owner/group/add/0.2#response. The room's new epoch, and the Welcome for the caller to deliver to the newcomer's key holder with rooms/keys/welcome.",
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "required": [
143
+ "roomId",
144
+ "member",
145
+ "epoch",
146
+ "welcome"
147
+ ],
148
+ "properties": {
149
+ "roomId": {
150
+ "type": "string",
151
+ "minLength": 1,
152
+ "maxLength": 512,
153
+ "description": "The room."
154
+ },
155
+ "member": {
156
+ "type": "string",
157
+ "pattern": "^did:",
158
+ "maxLength": 2048,
159
+ "description": "Who was admitted."
160
+ },
161
+ "epoch": {
162
+ "type": "integer",
163
+ "minimum": 2,
164
+ "description": "The room epoch after the admission, as the host recorded it."
165
+ },
166
+ "welcome": {
167
+ "type": "string",
168
+ "minLength": 1,
169
+ "pattern": "^[A-Za-z0-9_-]+$",
170
+ "description": "The MLS Welcome, base64url, sealed to the newcomer's KeyPackage. For rooms/keys/welcome; never through the host."
171
+ },
172
+ "ratchetTree": {
173
+ "type": "string",
174
+ "minLength": 1,
175
+ "pattern": "^[A-Za-z0-9_-]+$",
176
+ "description": "The group's ratchet tree, base64url, where the Welcome does not carry it as an extension. Passed to rooms/keys/welcome unchanged."
177
+ },
178
+ "ext": {
179
+ "$ref": "#/$defs/Ext"
180
+ }
181
+ }
182
+ },
183
+ "Ext": {
184
+ "title": "Ext",
185
+ "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.",
186
+ "type": "object",
187
+ "minProperties": 1,
188
+ "additionalProperties": true,
189
+ "propertyNames": {
190
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
191
+ }
192
+ }
193
+ }
194
+ } as const;
195
+
196
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
197
+ export const RESPONSE_PAYLOAD_SCHEMA = {
198
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
199
+ "$ref": "#/$defs/Response",
200
+ "$defs": {
201
+ "Response": {
202
+ "$anchor": "response",
203
+ "title": "Rooms Owner Group Add — response payload",
204
+ "description": "Success response to rooms/owner/group/add. Type https://trusttasks.org/spec/rooms/owner/group/add/0.2#response. The room's new epoch, and the Welcome for the caller to deliver to the newcomer's key holder with rooms/keys/welcome.",
205
+ "type": "object",
206
+ "additionalProperties": false,
207
+ "required": [
208
+ "roomId",
209
+ "member",
210
+ "epoch",
211
+ "welcome"
212
+ ],
213
+ "properties": {
214
+ "roomId": {
215
+ "type": "string",
216
+ "minLength": 1,
217
+ "maxLength": 512,
218
+ "description": "The room."
219
+ },
220
+ "member": {
221
+ "type": "string",
222
+ "pattern": "^did:",
223
+ "maxLength": 2048,
224
+ "description": "Who was admitted."
225
+ },
226
+ "epoch": {
227
+ "type": "integer",
228
+ "minimum": 2,
229
+ "description": "The room epoch after the admission, as the host recorded it."
230
+ },
231
+ "welcome": {
232
+ "type": "string",
233
+ "minLength": 1,
234
+ "pattern": "^[A-Za-z0-9_-]+$",
235
+ "description": "The MLS Welcome, base64url, sealed to the newcomer's KeyPackage. For rooms/keys/welcome; never through the host."
236
+ },
237
+ "ratchetTree": {
238
+ "type": "string",
239
+ "minLength": 1,
240
+ "pattern": "^[A-Za-z0-9_-]+$",
241
+ "description": "The group's ratchet tree, base64url, where the Welcome does not carry it as an extension. Passed to rooms/keys/welcome unchanged."
242
+ },
243
+ "ext": {
244
+ "$ref": "#/$defs/Ext"
245
+ }
246
+ }
247
+ },
248
+ "Ext": {
249
+ "title": "Ext",
250
+ "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.",
251
+ "type": "object",
252
+ "minProperties": 1,
253
+ "additionalProperties": true,
254
+ "propertyNames": {
255
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
256
+ }
257
+ }
258
+ }
259
+ } as const;
260
+
261
+ /**
262
+ * SPEC.md §7.2 policy for the request variant, from this specification's
263
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
264
+ * per-specification and cannot be derived from the document alone, and
265
+ * item 2 needs the schema this carries.
266
+ */
267
+ export const SPEC = {
268
+ typeUri: TYPE_URI,
269
+ isBearer: false,
270
+ isProofRequired: true,
271
+ isRecipientRequired: true,
272
+ isIssuedAtRequired: true,
273
+ payloadSchema: PAYLOAD_SCHEMA,
274
+ } as const;
275
+
276
+ /**
277
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
278
+ * tracks the *issuer* party's requirement because a response swaps the
279
+ * parties (§7.3 item 5).
280
+ */
281
+ export const RESPONSE_SPEC = {
282
+ typeUri: RESPONSE_TYPE_URI,
283
+ isBearer: false,
284
+ isProofRequired: true,
285
+ isRecipientRequired: true,
286
+ isIssuedAtRequired: true,
287
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
288
+ } as const;