@openvtc/trust-tasks 0.16.8 → 0.16.9

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 (50) hide show
  1. package/CHANGELOG.md +136 -0
  2. package/dist/_shared/components.d.ts +2 -2
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/device/list/0.1/payload.d.ts +4 -4
  5. package/dist/device/list/0.1/payload.d.ts.map +1 -1
  6. package/dist/device/list/0.1/payload.js +6 -2
  7. package/dist/device/list/0.1/payload.js.map +1 -1
  8. package/dist/device/list/0.2/payload.d.ts +4 -4
  9. package/dist/device/list/0.2/payload.d.ts.map +1 -1
  10. package/dist/device/list/0.2/payload.js +6 -2
  11. package/dist/device/list/0.2/payload.js.map +1 -1
  12. package/dist/device/register/0.1/payload.d.ts +4 -4
  13. package/dist/device/register/0.1/payload.d.ts.map +1 -1
  14. package/dist/device/register/0.1/payload.js +6 -2
  15. package/dist/device/register/0.1/payload.js.map +1 -1
  16. package/dist/device/register/0.2/payload.d.ts +4 -4
  17. package/dist/device/register/0.2/payload.d.ts.map +1 -1
  18. package/dist/device/register/0.2/payload.js +6 -2
  19. package/dist/device/register/0.2/payload.js.map +1 -1
  20. package/dist/index.d.ts +4 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +4 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/rooms/keys/commit/0.1/payload.d.ts +266 -0
  25. package/dist/rooms/keys/commit/0.1/payload.d.ts.map +1 -0
  26. package/dist/rooms/keys/commit/0.1/payload.js +146 -0
  27. package/dist/rooms/keys/commit/0.1/payload.js.map +1 -0
  28. package/dist/rooms/keys/key-package/0.1/payload.d.ts +272 -0
  29. package/dist/rooms/keys/key-package/0.1/payload.d.ts.map +1 -0
  30. package/dist/rooms/keys/key-package/0.1/payload.js +147 -0
  31. package/dist/rooms/keys/key-package/0.1/payload.js.map +1 -0
  32. package/dist/rooms/keys/welcome/0.1/payload.d.ts +276 -0
  33. package/dist/rooms/keys/welcome/0.1/payload.d.ts.map +1 -0
  34. package/dist/rooms/keys/welcome/0.1/payload.js +148 -0
  35. package/dist/rooms/keys/welcome/0.1/payload.js.map +1 -0
  36. package/dist/rooms/records/curate/0.1/payload.d.ts +500 -0
  37. package/dist/rooms/records/curate/0.1/payload.d.ts.map +1 -0
  38. package/dist/rooms/records/curate/0.1/payload.js +277 -0
  39. package/dist/rooms/records/curate/0.1/payload.js.map +1 -0
  40. package/package.json +1 -1
  41. package/src/_shared/components.ts +6 -2
  42. package/src/device/list/0.1/payload.ts +6 -2
  43. package/src/device/list/0.2/payload.ts +6 -2
  44. package/src/device/register/0.1/payload.ts +6 -2
  45. package/src/device/register/0.2/payload.ts +6 -2
  46. package/src/index.ts +4 -0
  47. package/src/rooms/keys/commit/0.1/payload.ts +195 -0
  48. package/src/rooms/keys/key-package/0.1/payload.ts +196 -0
  49. package/src/rooms/keys/welcome/0.1/payload.ts +201 -0
  50. package/src/rooms/records/curate/0.1/payload.ts +357 -0
@@ -0,0 +1,357 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/records/curate/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { AuthorityPresentation, Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A member curates a record: demotes it, retracts it, restores it from demotion, or pins it. Distinct from `rooms/records/put`, which replaces content — curation changes a record's standing in the room without a member having to rewrite it, and `curate` is a separate authority action so a community can grant one without the other.
11
+ */
12
+ export type RoomsRecordsCuratePayload = {
13
+ [k: string]: unknown | undefined;
14
+ } & {
15
+ /**
16
+ * The room's identifier. A host verifies the presentation against credentials issued by this identifier, never against a member list of its own.
17
+ */
18
+ roomId: string;
19
+ /**
20
+ * The record to curate.
21
+ */
22
+ key: string;
23
+ /**
24
+ * Must confer the `curate` action at this room's scope. Deliberately not implied by `write`: curation is judgement over what a room's shared knowledge is worth, which is a different grant from the ability to add to it.
25
+ */
26
+ presentation: AuthorityPresentation;
27
+ /**
28
+ * The standing to move the record to. `deprecated` demotes it — the body is retained and a recalling agent MUST treat it as demoted rather than hidden. `retracted` is a tombstone: the body is dropped and the key, version and epoch remain so incremental sync converges. `active` restores a `deprecated` record; it MUST NOT be accepted for a `retracted` one, whose body is already gone and cannot be restored by a status change.
29
+ */
30
+ status?: "active" | "deprecated" | "retracted";
31
+ /**
32
+ * Whether the record is pinned. Orthogonal to `status` — a pinned record is still active, deprecated or retracted — because pinning answers 'what matters here' and status answers 'is this still current'. Omit to leave unchanged.
33
+ */
34
+ pinned?: boolean;
35
+ /**
36
+ * Why, for the room's audit trail. A retraction without a reason is the one a member cannot interpret later.
37
+ */
38
+ reason?: string;
39
+ /**
40
+ * Optional precondition: the record's current version. Curation assigns a new version — a demotion other members must converge on is a change like any other — so a caller that read a record before deciding to curate it can require that nothing has replaced it since.
41
+ */
42
+ expectedVersion?: number;
43
+ /**
44
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
45
+ */
46
+ ext?: Ext;
47
+ };
48
+
49
+ /**
50
+ * Success response to rooms/records/curate. Type https://trusttasks.org/spec/rooms/records/curate/0.1#response.
51
+ */
52
+ export interface RoomsRecordsCurateResponsePayload {
53
+ /**
54
+ * The record curated.
55
+ */
56
+ key: string;
57
+ /**
58
+ * The version the curation assigned. A caller syncing on `sinceVersion` sees the change at this version.
59
+ */
60
+ version: number;
61
+ /**
62
+ * The record's standing after the operation.
63
+ */
64
+ status: "active" | "deprecated" | "retracted";
65
+ /**
66
+ * Whether the record is pinned after the operation.
67
+ */
68
+ pinned?: boolean;
69
+ ext?: Ext;
70
+ }
71
+
72
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
73
+ export type { AuthorityPresentation, Ext };
74
+
75
+ /** Trust Task type URI. */
76
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/records/curate/0.1" as const;
77
+
78
+ /** Stable alias for this specification's request payload shape. */
79
+ export type Payload = RoomsRecordsCuratePayload;
80
+
81
+ /** Trust Task response type URI (request type URI + "#response"). */
82
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/records/curate/0.1#response" as const;
83
+
84
+ /** Stable alias for this specification's success-response payload shape. */
85
+ export type Response = RoomsRecordsCurateResponsePayload;
86
+
87
+ /**
88
+ * This specification's payload schema, as a value.
89
+ *
90
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
91
+ * rather than only as a `.json` file because TypeScript types are erased
92
+ * at runtime: without a schema a consumer has nothing to validate, and
93
+ * every REQUIRED payload member is optional in practice. Cross-file
94
+ * `$ref`s are already inlined, so it needs no resolver.
95
+ */
96
+ export const PAYLOAD_SCHEMA = {
97
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
98
+ "$id": "https://trusttasks.org/spec/rooms/records/curate/0.1",
99
+ "title": "Rooms Records Curate — payload",
100
+ "description": "A member curates a record: demotes it, retracts it, restores it from demotion, or pins it. Distinct from `rooms/records/put`, which replaces content — curation changes a record's standing in the room without a member having to rewrite it, and `curate` is a separate authority action so a community can grant one without the other.",
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "required": [
104
+ "roomId",
105
+ "key",
106
+ "presentation"
107
+ ],
108
+ "properties": {
109
+ "roomId": {
110
+ "type": "string",
111
+ "description": "The room's identifier. A host verifies the presentation against credentials issued by this identifier, never against a member list of its own."
112
+ },
113
+ "key": {
114
+ "type": "string",
115
+ "maxLength": 512,
116
+ "description": "The record to curate."
117
+ },
118
+ "presentation": {
119
+ "$ref": "#/$defs/AuthorityPresentation",
120
+ "description": "Must confer the `curate` action at this room's scope. Deliberately not implied by `write`: curation is judgement over what a room's shared knowledge is worth, which is a different grant from the ability to add to it."
121
+ },
122
+ "status": {
123
+ "type": "string",
124
+ "enum": [
125
+ "active",
126
+ "deprecated",
127
+ "retracted"
128
+ ],
129
+ "description": "The standing to move the record to. `deprecated` demotes it — the body is retained and a recalling agent MUST treat it as demoted rather than hidden. `retracted` is a tombstone: the body is dropped and the key, version and epoch remain so incremental sync converges. `active` restores a `deprecated` record; it MUST NOT be accepted for a `retracted` one, whose body is already gone and cannot be restored by a status change."
130
+ },
131
+ "pinned": {
132
+ "type": "boolean",
133
+ "description": "Whether the record is pinned. Orthogonal to `status` — a pinned record is still active, deprecated or retracted — because pinning answers 'what matters here' and status answers 'is this still current'. Omit to leave unchanged."
134
+ },
135
+ "reason": {
136
+ "type": "string",
137
+ "maxLength": 512,
138
+ "description": "Why, for the room's audit trail. A retraction without a reason is the one a member cannot interpret later."
139
+ },
140
+ "expectedVersion": {
141
+ "type": "integer",
142
+ "minimum": 1,
143
+ "description": "Optional precondition: the record's current version. Curation assigns a new version — a demotion other members must converge on is a change like any other — so a caller that read a record before deciding to curate it can require that nothing has replaced it since."
144
+ },
145
+ "ext": {
146
+ "$ref": "#/$defs/Ext",
147
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
148
+ }
149
+ },
150
+ "anyOf": [
151
+ {
152
+ "required": [
153
+ "status"
154
+ ]
155
+ },
156
+ {
157
+ "required": [
158
+ "pinned"
159
+ ]
160
+ }
161
+ ],
162
+ "$defs": {
163
+ "Response": {
164
+ "$anchor": "response",
165
+ "title": "Rooms Records Curate — response payload",
166
+ "description": "Success response to rooms/records/curate. Type https://trusttasks.org/spec/rooms/records/curate/0.1#response.",
167
+ "type": "object",
168
+ "additionalProperties": false,
169
+ "required": [
170
+ "key",
171
+ "version",
172
+ "status"
173
+ ],
174
+ "properties": {
175
+ "key": {
176
+ "type": "string",
177
+ "description": "The record curated."
178
+ },
179
+ "version": {
180
+ "type": "integer",
181
+ "minimum": 1,
182
+ "description": "The version the curation assigned. A caller syncing on `sinceVersion` sees the change at this version."
183
+ },
184
+ "status": {
185
+ "type": "string",
186
+ "enum": [
187
+ "active",
188
+ "deprecated",
189
+ "retracted"
190
+ ],
191
+ "description": "The record's standing after the operation."
192
+ },
193
+ "pinned": {
194
+ "type": "boolean",
195
+ "description": "Whether the record is pinned after the operation."
196
+ },
197
+ "ext": {
198
+ "$ref": "#/$defs/Ext"
199
+ }
200
+ }
201
+ },
202
+ "Ext": {
203
+ "title": "Ext",
204
+ "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.",
205
+ "type": "object",
206
+ "minProperties": 1,
207
+ "additionalProperties": true,
208
+ "propertyNames": {
209
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
210
+ }
211
+ },
212
+ "AuthorityPresentation": {
213
+ "title": "AuthorityPresentation",
214
+ "type": "object",
215
+ "additionalProperties": false,
216
+ "required": [
217
+ "membership",
218
+ "authority"
219
+ ],
220
+ "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.",
221
+ "properties": {
222
+ "membership": {
223
+ "type": "string",
224
+ "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."
225
+ },
226
+ "authority": {
227
+ "type": "array",
228
+ "minItems": 1,
229
+ "maxItems": 8,
230
+ "items": {
231
+ "type": "string"
232
+ },
233
+ "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."
234
+ },
235
+ "subjectBinding": {
236
+ "type": "string",
237
+ "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."
238
+ }
239
+ }
240
+ }
241
+ }
242
+ } as const;
243
+
244
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
245
+ export const RESPONSE_PAYLOAD_SCHEMA = {
246
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
247
+ "$ref": "#/$defs/Response",
248
+ "$defs": {
249
+ "Response": {
250
+ "$anchor": "response",
251
+ "title": "Rooms Records Curate — response payload",
252
+ "description": "Success response to rooms/records/curate. Type https://trusttasks.org/spec/rooms/records/curate/0.1#response.",
253
+ "type": "object",
254
+ "additionalProperties": false,
255
+ "required": [
256
+ "key",
257
+ "version",
258
+ "status"
259
+ ],
260
+ "properties": {
261
+ "key": {
262
+ "type": "string",
263
+ "description": "The record curated."
264
+ },
265
+ "version": {
266
+ "type": "integer",
267
+ "minimum": 1,
268
+ "description": "The version the curation assigned. A caller syncing on `sinceVersion` sees the change at this version."
269
+ },
270
+ "status": {
271
+ "type": "string",
272
+ "enum": [
273
+ "active",
274
+ "deprecated",
275
+ "retracted"
276
+ ],
277
+ "description": "The record's standing after the operation."
278
+ },
279
+ "pinned": {
280
+ "type": "boolean",
281
+ "description": "Whether the record is pinned after the operation."
282
+ },
283
+ "ext": {
284
+ "$ref": "#/$defs/Ext"
285
+ }
286
+ }
287
+ },
288
+ "Ext": {
289
+ "title": "Ext",
290
+ "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.",
291
+ "type": "object",
292
+ "minProperties": 1,
293
+ "additionalProperties": true,
294
+ "propertyNames": {
295
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
296
+ }
297
+ },
298
+ "AuthorityPresentation": {
299
+ "title": "AuthorityPresentation",
300
+ "type": "object",
301
+ "additionalProperties": false,
302
+ "required": [
303
+ "membership",
304
+ "authority"
305
+ ],
306
+ "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.",
307
+ "properties": {
308
+ "membership": {
309
+ "type": "string",
310
+ "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."
311
+ },
312
+ "authority": {
313
+ "type": "array",
314
+ "minItems": 1,
315
+ "maxItems": 8,
316
+ "items": {
317
+ "type": "string"
318
+ },
319
+ "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."
320
+ },
321
+ "subjectBinding": {
322
+ "type": "string",
323
+ "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."
324
+ }
325
+ }
326
+ }
327
+ }
328
+ } as const;
329
+
330
+ /**
331
+ * SPEC.md §7.2 policy for the request variant, from this specification's
332
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
333
+ * per-specification and cannot be derived from the document alone, and
334
+ * item 2 needs the schema this carries.
335
+ */
336
+ export const SPEC = {
337
+ typeUri: TYPE_URI,
338
+ isBearer: false,
339
+ isProofRequired: true,
340
+ isRecipientRequired: true,
341
+ isIssuedAtRequired: true,
342
+ payloadSchema: PAYLOAD_SCHEMA,
343
+ } as const;
344
+
345
+ /**
346
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
347
+ * tracks the *issuer* party's requirement because a response swaps the
348
+ * parties (§7.3 item 5).
349
+ */
350
+ export const RESPONSE_SPEC = {
351
+ typeUri: RESPONSE_TYPE_URI,
352
+ isBearer: false,
353
+ isProofRequired: true,
354
+ isRecipientRequired: true,
355
+ isIssuedAtRequired: true,
356
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
357
+ } as const;