@openvtc/trust-tasks 0.16.6 → 0.16.7

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 (40) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/dist/_shared/components.d.ts +75 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +6 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +6 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/rooms/_shared/0.1/room.d.ts +16 -0
  9. package/dist/rooms/_shared/0.1/room.d.ts.map +1 -0
  10. package/dist/rooms/_shared/0.1/room.js +6 -0
  11. package/dist/rooms/_shared/0.1/room.js.map +1 -0
  12. package/dist/rooms/create/0.1/payload.d.ts +305 -0
  13. package/dist/rooms/create/0.1/payload.d.ts.map +1 -0
  14. package/dist/rooms/create/0.1/payload.js +176 -0
  15. package/dist/rooms/create/0.1/payload.js.map +1 -0
  16. package/dist/rooms/epoch/mint/0.1/payload.d.ts +385 -0
  17. package/dist/rooms/epoch/mint/0.1/payload.d.ts.map +1 -0
  18. package/dist/rooms/epoch/mint/0.1/payload.js +214 -0
  19. package/dist/rooms/epoch/mint/0.1/payload.js.map +1 -0
  20. package/dist/rooms/records/get/0.1/payload.d.ts +505 -0
  21. package/dist/rooms/records/get/0.1/payload.d.ts.map +1 -0
  22. package/dist/rooms/records/get/0.1/payload.js +279 -0
  23. package/dist/rooms/records/get/0.1/payload.js.map +1 -0
  24. package/dist/rooms/records/list/0.1/payload.d.ts +618 -0
  25. package/dist/rooms/records/list/0.1/payload.d.ts.map +1 -0
  26. package/dist/rooms/records/list/0.1/payload.js +338 -0
  27. package/dist/rooms/records/list/0.1/payload.js.map +1 -0
  28. package/dist/rooms/records/put/0.1/payload.d.ts +591 -0
  29. package/dist/rooms/records/put/0.1/payload.d.ts.map +1 -0
  30. package/dist/rooms/records/put/0.1/payload.js +314 -0
  31. package/dist/rooms/records/put/0.1/payload.js.map +1 -0
  32. package/package.json +1 -1
  33. package/src/_shared/components.ts +83 -0
  34. package/src/index.ts +6 -0
  35. package/src/rooms/_shared/0.1/room.ts +17 -0
  36. package/src/rooms/create/0.1/payload.ts +224 -0
  37. package/src/rooms/epoch/mint/0.1/payload.ts +262 -0
  38. package/src/rooms/records/get/0.1/payload.ts +333 -0
  39. package/src/rooms/records/list/0.1/payload.ts +397 -0
  40. package/src/rooms/records/put/0.1/payload.ts +388 -0
@@ -0,0 +1,591 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/records/put/0.1/payload.schema.json
4
+ */
5
+ import type { AuthorityPresentation, Ext, SealedRecord } from "../../../../_shared/components.js";
6
+ export interface RoomsRecordsPutPayload {
7
+ /**
8
+ * The room's identifier. A host verifies the presentation against credentials issued by this identifier, never against a member list of its own — which is what lets a room move hosts without reissuing a credential.
9
+ */
10
+ roomId: string;
11
+ /**
12
+ * The record's key within the room. MUST be opaque on an `attributed` or `private` room; see RecordMetadata.key.
13
+ */
14
+ key: string;
15
+ /**
16
+ * Must confer the `write` action at this room's scope.
17
+ */
18
+ presentation: AuthorityPresentation;
19
+ /**
20
+ * Optional precondition. Omit to overwrite unconditionally; `0` means create-only and fails if the key exists. On mismatch the host returns `rooms/records/put:versionConflict` CARRYING THE CURRENT VERSION AND RECORD — a bare rejection would force a re-read, and between rejection and re-read the record can change again, so the pattern has no fixed point under contention.
21
+ */
22
+ expectedVersion?: number;
23
+ /**
24
+ * REQUIRED on an `attributed` or `private` room. Mutually exclusive with `cleartext`.
25
+ */
26
+ sealed?: SealedRecord;
27
+ /**
28
+ * REQUIRED on an `open` room, where the host reads records and can therefore search them. Mutually exclusive with `sealed`.
29
+ */
30
+ cleartext?: {
31
+ title?: string;
32
+ description?: string;
33
+ body: string;
34
+ /**
35
+ * @maxItems 32
36
+ */
37
+ tags?: string[];
38
+ };
39
+ /**
40
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
41
+ */
42
+ ext?: Ext;
43
+ }
44
+ /**
45
+ * Success response to rooms/records/put. Type https://trusttasks.org/spec/rooms/records/put/0.1#response.
46
+ */
47
+ export interface RoomsRecordsPutResponsePayload {
48
+ /**
49
+ * The stored record's key.
50
+ */
51
+ key: string;
52
+ /**
53
+ * The version assigned, monotonic per room.
54
+ */
55
+ version: number;
56
+ /**
57
+ * The epoch the record was stored under.
58
+ */
59
+ epoch?: number;
60
+ ext?: Ext;
61
+ }
62
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
63
+ export type { AuthorityPresentation, Ext, SealedRecord };
64
+ /** Trust Task type URI. */
65
+ export declare const TYPE_URI: "https://trusttasks.org/spec/rooms/records/put/0.1";
66
+ /** Stable alias for this specification's request payload shape. */
67
+ export type Payload = RoomsRecordsPutPayload;
68
+ /** Trust Task response type URI (request type URI + "#response"). */
69
+ export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/rooms/records/put/0.1#response";
70
+ /** Stable alias for this specification's success-response payload shape. */
71
+ export type Response = RoomsRecordsPutResponsePayload;
72
+ /**
73
+ * This specification's payload schema, as a value.
74
+ *
75
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
76
+ * rather than only as a `.json` file because TypeScript types are erased
77
+ * at runtime: without a schema a consumer has nothing to validate, and
78
+ * every REQUIRED payload member is optional in practice. Cross-file
79
+ * `$ref`s are already inlined, so it needs no resolver.
80
+ */
81
+ export declare const PAYLOAD_SCHEMA: {
82
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
83
+ readonly $id: "https://trusttasks.org/spec/rooms/records/put/0.1";
84
+ readonly title: "Rooms Records Put — payload";
85
+ readonly type: "object";
86
+ readonly additionalProperties: false;
87
+ readonly required: readonly ["roomId", "key", "presentation"];
88
+ readonly properties: {
89
+ readonly roomId: {
90
+ readonly type: "string";
91
+ readonly description: "The room's identifier. A host verifies the presentation against credentials issued by this identifier, never against a member list of its own — which is what lets a room move hosts without reissuing a credential.";
92
+ };
93
+ readonly key: {
94
+ readonly type: "string";
95
+ readonly maxLength: 512;
96
+ readonly description: "The record's key within the room. MUST be opaque on an `attributed` or `private` room; see RecordMetadata.key.";
97
+ };
98
+ readonly presentation: {
99
+ readonly $ref: "#/$defs/AuthorityPresentation";
100
+ readonly description: "Must confer the `write` action at this room's scope.";
101
+ };
102
+ readonly expectedVersion: {
103
+ readonly type: "integer";
104
+ readonly minimum: 0;
105
+ readonly description: "Optional precondition. Omit to overwrite unconditionally; `0` means create-only and fails if the key exists. On mismatch the host returns `rooms/records/put:versionConflict` CARRYING THE CURRENT VERSION AND RECORD — a bare rejection would force a re-read, and between rejection and re-read the record can change again, so the pattern has no fixed point under contention.";
106
+ };
107
+ readonly sealed: {
108
+ readonly $ref: "#/$defs/SealedRecord";
109
+ readonly description: "REQUIRED on an `attributed` or `private` room. Mutually exclusive with `cleartext`.";
110
+ };
111
+ readonly cleartext: {
112
+ readonly type: "object";
113
+ readonly additionalProperties: false;
114
+ readonly required: readonly ["body"];
115
+ readonly description: "REQUIRED on an `open` room, where the host reads records and can therefore search them. Mutually exclusive with `sealed`.";
116
+ readonly properties: {
117
+ readonly title: {
118
+ readonly type: "string";
119
+ readonly maxLength: 512;
120
+ };
121
+ readonly description: {
122
+ readonly type: "string";
123
+ readonly maxLength: 2048;
124
+ };
125
+ readonly body: {
126
+ readonly type: "string";
127
+ readonly maxLength: 1048576;
128
+ };
129
+ readonly tags: {
130
+ readonly type: "array";
131
+ readonly items: {
132
+ readonly type: "string";
133
+ readonly maxLength: 64;
134
+ };
135
+ readonly maxItems: 32;
136
+ };
137
+ };
138
+ };
139
+ readonly ext: {
140
+ readonly $ref: "#/$defs/Ext";
141
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
142
+ };
143
+ };
144
+ readonly $defs: {
145
+ readonly Response: {
146
+ readonly $anchor: "response";
147
+ readonly title: "Rooms Records Put — response payload";
148
+ readonly description: "Success response to rooms/records/put. Type https://trusttasks.org/spec/rooms/records/put/0.1#response.";
149
+ readonly type: "object";
150
+ readonly additionalProperties: false;
151
+ readonly required: readonly ["key", "version"];
152
+ readonly properties: {
153
+ readonly key: {
154
+ readonly type: "string";
155
+ readonly description: "The stored record's key.";
156
+ };
157
+ readonly version: {
158
+ readonly type: "integer";
159
+ readonly minimum: 1;
160
+ readonly description: "The version assigned, monotonic per room.";
161
+ };
162
+ readonly epoch: {
163
+ readonly type: "integer";
164
+ readonly minimum: 1;
165
+ readonly description: "The epoch the record was stored under.";
166
+ };
167
+ readonly ext: {
168
+ readonly $ref: "#/$defs/Ext";
169
+ };
170
+ };
171
+ };
172
+ readonly Ext: {
173
+ readonly title: "Ext";
174
+ readonly 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.";
175
+ readonly type: "object";
176
+ readonly minProperties: 1;
177
+ readonly additionalProperties: true;
178
+ readonly propertyNames: {
179
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
180
+ };
181
+ };
182
+ readonly SealedRecord: {
183
+ readonly title: "SealedRecord";
184
+ readonly type: "object";
185
+ readonly additionalProperties: false;
186
+ readonly required: readonly ["ciphertext", "nonce", "epoch"];
187
+ readonly description: "A record as a host stores it on an `attributed` or `private` room. Title, description, body, author and tags are sealed together in one blob rather than separately: splitting them would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way.";
188
+ readonly properties: {
189
+ readonly ciphertext: {
190
+ readonly type: "string";
191
+ readonly description: "The sealed record, base64url. Bound by AEAD associated data to `roomId`, `key`, `version` and `epoch`, so a host that relocates it to another key, version, epoch or room produces a mismatch and the open fails. The record cannot be moved undetected even though the host holds every byte of it.";
192
+ };
193
+ readonly nonce: {
194
+ readonly type: "string";
195
+ readonly description: "AEAD nonce, base64url.";
196
+ };
197
+ readonly epoch: {
198
+ readonly type: "integer";
199
+ readonly minimum: 1;
200
+ readonly description: "The key epoch this record was sealed under. Cleartext because the host must serve the right ciphertext, and bound into the associated data so that relabelling it fails authentication rather than causing a reader to try the wrong key.";
201
+ };
202
+ };
203
+ };
204
+ readonly AuthorityPresentation: {
205
+ readonly title: "AuthorityPresentation";
206
+ readonly type: "object";
207
+ readonly additionalProperties: false;
208
+ readonly required: readonly ["membership", "authority"];
209
+ readonly description: "What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier.";
210
+ readonly properties: {
211
+ readonly membership: {
212
+ readonly type: "string";
213
+ readonly description: "The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile.";
214
+ };
215
+ readonly authority: {
216
+ readonly type: "array";
217
+ readonly minItems: 1;
218
+ readonly maxItems: 8;
219
+ readonly items: {
220
+ readonly type: "string";
221
+ };
222
+ readonly description: "The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent.";
223
+ };
224
+ readonly subjectBinding: {
225
+ readonly type: "string";
226
+ readonly description: "REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this.";
227
+ };
228
+ };
229
+ };
230
+ };
231
+ };
232
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
233
+ export declare const RESPONSE_PAYLOAD_SCHEMA: {
234
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
235
+ readonly $ref: "#/$defs/Response";
236
+ readonly $defs: {
237
+ readonly Response: {
238
+ readonly $anchor: "response";
239
+ readonly title: "Rooms Records Put — response payload";
240
+ readonly description: "Success response to rooms/records/put. Type https://trusttasks.org/spec/rooms/records/put/0.1#response.";
241
+ readonly type: "object";
242
+ readonly additionalProperties: false;
243
+ readonly required: readonly ["key", "version"];
244
+ readonly properties: {
245
+ readonly key: {
246
+ readonly type: "string";
247
+ readonly description: "The stored record's key.";
248
+ };
249
+ readonly version: {
250
+ readonly type: "integer";
251
+ readonly minimum: 1;
252
+ readonly description: "The version assigned, monotonic per room.";
253
+ };
254
+ readonly epoch: {
255
+ readonly type: "integer";
256
+ readonly minimum: 1;
257
+ readonly description: "The epoch the record was stored under.";
258
+ };
259
+ readonly ext: {
260
+ readonly $ref: "#/$defs/Ext";
261
+ };
262
+ };
263
+ };
264
+ readonly Ext: {
265
+ readonly title: "Ext";
266
+ readonly 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.";
267
+ readonly type: "object";
268
+ readonly minProperties: 1;
269
+ readonly additionalProperties: true;
270
+ readonly propertyNames: {
271
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
272
+ };
273
+ };
274
+ readonly SealedRecord: {
275
+ readonly title: "SealedRecord";
276
+ readonly type: "object";
277
+ readonly additionalProperties: false;
278
+ readonly required: readonly ["ciphertext", "nonce", "epoch"];
279
+ readonly description: "A record as a host stores it on an `attributed` or `private` room. Title, description, body, author and tags are sealed together in one blob rather than separately: splitting them would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way.";
280
+ readonly properties: {
281
+ readonly ciphertext: {
282
+ readonly type: "string";
283
+ readonly description: "The sealed record, base64url. Bound by AEAD associated data to `roomId`, `key`, `version` and `epoch`, so a host that relocates it to another key, version, epoch or room produces a mismatch and the open fails. The record cannot be moved undetected even though the host holds every byte of it.";
284
+ };
285
+ readonly nonce: {
286
+ readonly type: "string";
287
+ readonly description: "AEAD nonce, base64url.";
288
+ };
289
+ readonly epoch: {
290
+ readonly type: "integer";
291
+ readonly minimum: 1;
292
+ readonly description: "The key epoch this record was sealed under. Cleartext because the host must serve the right ciphertext, and bound into the associated data so that relabelling it fails authentication rather than causing a reader to try the wrong key.";
293
+ };
294
+ };
295
+ };
296
+ readonly AuthorityPresentation: {
297
+ readonly title: "AuthorityPresentation";
298
+ readonly type: "object";
299
+ readonly additionalProperties: false;
300
+ readonly required: readonly ["membership", "authority"];
301
+ readonly description: "What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier.";
302
+ readonly properties: {
303
+ readonly membership: {
304
+ readonly type: "string";
305
+ readonly description: "The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile.";
306
+ };
307
+ readonly authority: {
308
+ readonly type: "array";
309
+ readonly minItems: 1;
310
+ readonly maxItems: 8;
311
+ readonly items: {
312
+ readonly type: "string";
313
+ };
314
+ readonly description: "The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent.";
315
+ };
316
+ readonly subjectBinding: {
317
+ readonly type: "string";
318
+ readonly description: "REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this.";
319
+ };
320
+ };
321
+ };
322
+ };
323
+ };
324
+ /**
325
+ * SPEC.md §7.2 policy for the request variant, from this specification's
326
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
327
+ * per-specification and cannot be derived from the document alone, and
328
+ * item 2 needs the schema this carries.
329
+ */
330
+ export declare const SPEC: {
331
+ readonly typeUri: "https://trusttasks.org/spec/rooms/records/put/0.1";
332
+ readonly isBearer: false;
333
+ readonly isProofRequired: true;
334
+ readonly isRecipientRequired: true;
335
+ readonly isIssuedAtRequired: true;
336
+ readonly payloadSchema: {
337
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
338
+ readonly $id: "https://trusttasks.org/spec/rooms/records/put/0.1";
339
+ readonly title: "Rooms Records Put — payload";
340
+ readonly type: "object";
341
+ readonly additionalProperties: false;
342
+ readonly required: readonly ["roomId", "key", "presentation"];
343
+ readonly properties: {
344
+ readonly roomId: {
345
+ readonly type: "string";
346
+ readonly description: "The room's identifier. A host verifies the presentation against credentials issued by this identifier, never against a member list of its own — which is what lets a room move hosts without reissuing a credential.";
347
+ };
348
+ readonly key: {
349
+ readonly type: "string";
350
+ readonly maxLength: 512;
351
+ readonly description: "The record's key within the room. MUST be opaque on an `attributed` or `private` room; see RecordMetadata.key.";
352
+ };
353
+ readonly presentation: {
354
+ readonly $ref: "#/$defs/AuthorityPresentation";
355
+ readonly description: "Must confer the `write` action at this room's scope.";
356
+ };
357
+ readonly expectedVersion: {
358
+ readonly type: "integer";
359
+ readonly minimum: 0;
360
+ readonly description: "Optional precondition. Omit to overwrite unconditionally; `0` means create-only and fails if the key exists. On mismatch the host returns `rooms/records/put:versionConflict` CARRYING THE CURRENT VERSION AND RECORD — a bare rejection would force a re-read, and between rejection and re-read the record can change again, so the pattern has no fixed point under contention.";
361
+ };
362
+ readonly sealed: {
363
+ readonly $ref: "#/$defs/SealedRecord";
364
+ readonly description: "REQUIRED on an `attributed` or `private` room. Mutually exclusive with `cleartext`.";
365
+ };
366
+ readonly cleartext: {
367
+ readonly type: "object";
368
+ readonly additionalProperties: false;
369
+ readonly required: readonly ["body"];
370
+ readonly description: "REQUIRED on an `open` room, where the host reads records and can therefore search them. Mutually exclusive with `sealed`.";
371
+ readonly properties: {
372
+ readonly title: {
373
+ readonly type: "string";
374
+ readonly maxLength: 512;
375
+ };
376
+ readonly description: {
377
+ readonly type: "string";
378
+ readonly maxLength: 2048;
379
+ };
380
+ readonly body: {
381
+ readonly type: "string";
382
+ readonly maxLength: 1048576;
383
+ };
384
+ readonly tags: {
385
+ readonly type: "array";
386
+ readonly items: {
387
+ readonly type: "string";
388
+ readonly maxLength: 64;
389
+ };
390
+ readonly maxItems: 32;
391
+ };
392
+ };
393
+ };
394
+ readonly ext: {
395
+ readonly $ref: "#/$defs/Ext";
396
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
397
+ };
398
+ };
399
+ readonly $defs: {
400
+ readonly Response: {
401
+ readonly $anchor: "response";
402
+ readonly title: "Rooms Records Put — response payload";
403
+ readonly description: "Success response to rooms/records/put. Type https://trusttasks.org/spec/rooms/records/put/0.1#response.";
404
+ readonly type: "object";
405
+ readonly additionalProperties: false;
406
+ readonly required: readonly ["key", "version"];
407
+ readonly properties: {
408
+ readonly key: {
409
+ readonly type: "string";
410
+ readonly description: "The stored record's key.";
411
+ };
412
+ readonly version: {
413
+ readonly type: "integer";
414
+ readonly minimum: 1;
415
+ readonly description: "The version assigned, monotonic per room.";
416
+ };
417
+ readonly epoch: {
418
+ readonly type: "integer";
419
+ readonly minimum: 1;
420
+ readonly description: "The epoch the record was stored under.";
421
+ };
422
+ readonly ext: {
423
+ readonly $ref: "#/$defs/Ext";
424
+ };
425
+ };
426
+ };
427
+ readonly Ext: {
428
+ readonly title: "Ext";
429
+ readonly 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.";
430
+ readonly type: "object";
431
+ readonly minProperties: 1;
432
+ readonly additionalProperties: true;
433
+ readonly propertyNames: {
434
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
435
+ };
436
+ };
437
+ readonly SealedRecord: {
438
+ readonly title: "SealedRecord";
439
+ readonly type: "object";
440
+ readonly additionalProperties: false;
441
+ readonly required: readonly ["ciphertext", "nonce", "epoch"];
442
+ readonly description: "A record as a host stores it on an `attributed` or `private` room. Title, description, body, author and tags are sealed together in one blob rather than separately: splitting them would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way.";
443
+ readonly properties: {
444
+ readonly ciphertext: {
445
+ readonly type: "string";
446
+ readonly description: "The sealed record, base64url. Bound by AEAD associated data to `roomId`, `key`, `version` and `epoch`, so a host that relocates it to another key, version, epoch or room produces a mismatch and the open fails. The record cannot be moved undetected even though the host holds every byte of it.";
447
+ };
448
+ readonly nonce: {
449
+ readonly type: "string";
450
+ readonly description: "AEAD nonce, base64url.";
451
+ };
452
+ readonly epoch: {
453
+ readonly type: "integer";
454
+ readonly minimum: 1;
455
+ readonly description: "The key epoch this record was sealed under. Cleartext because the host must serve the right ciphertext, and bound into the associated data so that relabelling it fails authentication rather than causing a reader to try the wrong key.";
456
+ };
457
+ };
458
+ };
459
+ readonly AuthorityPresentation: {
460
+ readonly title: "AuthorityPresentation";
461
+ readonly type: "object";
462
+ readonly additionalProperties: false;
463
+ readonly required: readonly ["membership", "authority"];
464
+ readonly description: "What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier.";
465
+ readonly properties: {
466
+ readonly membership: {
467
+ readonly type: "string";
468
+ readonly description: "The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile.";
469
+ };
470
+ readonly authority: {
471
+ readonly type: "array";
472
+ readonly minItems: 1;
473
+ readonly maxItems: 8;
474
+ readonly items: {
475
+ readonly type: "string";
476
+ };
477
+ readonly description: "The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent.";
478
+ };
479
+ readonly subjectBinding: {
480
+ readonly type: "string";
481
+ readonly description: "REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this.";
482
+ };
483
+ };
484
+ };
485
+ };
486
+ };
487
+ };
488
+ /**
489
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
490
+ * tracks the *issuer* party's requirement because a response swaps the
491
+ * parties (§7.3 item 5).
492
+ */
493
+ export declare const RESPONSE_SPEC: {
494
+ readonly typeUri: "https://trusttasks.org/spec/rooms/records/put/0.1#response";
495
+ readonly isBearer: false;
496
+ readonly isProofRequired: true;
497
+ readonly isRecipientRequired: true;
498
+ readonly isIssuedAtRequired: true;
499
+ readonly payloadSchema: {
500
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
501
+ readonly $ref: "#/$defs/Response";
502
+ readonly $defs: {
503
+ readonly Response: {
504
+ readonly $anchor: "response";
505
+ readonly title: "Rooms Records Put — response payload";
506
+ readonly description: "Success response to rooms/records/put. Type https://trusttasks.org/spec/rooms/records/put/0.1#response.";
507
+ readonly type: "object";
508
+ readonly additionalProperties: false;
509
+ readonly required: readonly ["key", "version"];
510
+ readonly properties: {
511
+ readonly key: {
512
+ readonly type: "string";
513
+ readonly description: "The stored record's key.";
514
+ };
515
+ readonly version: {
516
+ readonly type: "integer";
517
+ readonly minimum: 1;
518
+ readonly description: "The version assigned, monotonic per room.";
519
+ };
520
+ readonly epoch: {
521
+ readonly type: "integer";
522
+ readonly minimum: 1;
523
+ readonly description: "The epoch the record was stored under.";
524
+ };
525
+ readonly ext: {
526
+ readonly $ref: "#/$defs/Ext";
527
+ };
528
+ };
529
+ };
530
+ readonly Ext: {
531
+ readonly title: "Ext";
532
+ readonly 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.";
533
+ readonly type: "object";
534
+ readonly minProperties: 1;
535
+ readonly additionalProperties: true;
536
+ readonly propertyNames: {
537
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
538
+ };
539
+ };
540
+ readonly SealedRecord: {
541
+ readonly title: "SealedRecord";
542
+ readonly type: "object";
543
+ readonly additionalProperties: false;
544
+ readonly required: readonly ["ciphertext", "nonce", "epoch"];
545
+ readonly description: "A record as a host stores it on an `attributed` or `private` room. Title, description, body, author and tags are sealed together in one blob rather than separately: splitting them would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way.";
546
+ readonly properties: {
547
+ readonly ciphertext: {
548
+ readonly type: "string";
549
+ readonly description: "The sealed record, base64url. Bound by AEAD associated data to `roomId`, `key`, `version` and `epoch`, so a host that relocates it to another key, version, epoch or room produces a mismatch and the open fails. The record cannot be moved undetected even though the host holds every byte of it.";
550
+ };
551
+ readonly nonce: {
552
+ readonly type: "string";
553
+ readonly description: "AEAD nonce, base64url.";
554
+ };
555
+ readonly epoch: {
556
+ readonly type: "integer";
557
+ readonly minimum: 1;
558
+ readonly description: "The key epoch this record was sealed under. Cleartext because the host must serve the right ciphertext, and bound into the associated data so that relabelling it fails authentication rather than causing a reader to try the wrong key.";
559
+ };
560
+ };
561
+ };
562
+ readonly AuthorityPresentation: {
563
+ readonly title: "AuthorityPresentation";
564
+ readonly type: "object";
565
+ readonly additionalProperties: false;
566
+ readonly required: readonly ["membership", "authority"];
567
+ readonly description: "What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier.";
568
+ readonly properties: {
569
+ readonly membership: {
570
+ readonly type: "string";
571
+ readonly description: "The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile.";
572
+ };
573
+ readonly authority: {
574
+ readonly type: "array";
575
+ readonly minItems: 1;
576
+ readonly maxItems: 8;
577
+ readonly items: {
578
+ readonly type: "string";
579
+ };
580
+ readonly description: "The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent.";
581
+ };
582
+ readonly subjectBinding: {
583
+ readonly type: "string";
584
+ readonly description: "REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this.";
585
+ };
586
+ };
587
+ };
588
+ };
589
+ };
590
+ };
591
+ //# sourceMappingURL=payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../../src/rooms/records/put/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGlG,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,YAAY,EAAE,qBAAqB,CAAC;IACpC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE;QACV,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IACF;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AACD;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AAED,kHAAkH;AAClH,YAAY,EAAE,qBAAqB,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;AAEzD,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,EAAG,mDAA4D,CAAC;AAErF,mEAAmE;AACnE,MAAM,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAE7C,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,EAAG,4DAAqE,CAAC;AAEvG,4EAA4E;AAC5E,MAAM,MAAM,QAAQ,GAAG,8BAA8B,CAAC;AAEtD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsKjB,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoG1B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOP,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhB,CAAC"}