@openvtc/trust-tasks 0.28.23 → 0.28.25

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 (100) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/dist/_shared/components.d.ts +520 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +45 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +45 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/messaging/mux/_shared/0.1/mux.d.ts +16 -0
  9. package/dist/messaging/mux/_shared/0.1/mux.d.ts.map +1 -0
  10. package/dist/messaging/mux/_shared/0.1/mux.js +6 -0
  11. package/dist/messaging/mux/_shared/0.1/mux.js.map +1 -0
  12. package/dist/messaging/mux/attach/0.1/payload.d.ts +996 -0
  13. package/dist/messaging/mux/attach/0.1/payload.d.ts.map +1 -0
  14. package/dist/messaging/mux/attach/0.1/payload.js +594 -0
  15. package/dist/messaging/mux/attach/0.1/payload.js.map +1 -0
  16. package/dist/messaging/mux/detach/0.1/payload.d.ts +398 -0
  17. package/dist/messaging/mux/detach/0.1/payload.d.ts.map +1 -0
  18. package/dist/messaging/mux/detach/0.1/payload.js +215 -0
  19. package/dist/messaging/mux/detach/0.1/payload.js.map +1 -0
  20. package/dist/messaging/mux/event/0.1/payload.d.ts +513 -0
  21. package/dist/messaging/mux/event/0.1/payload.d.ts.map +1 -0
  22. package/dist/messaging/mux/event/0.1/payload.js +260 -0
  23. package/dist/messaging/mux/event/0.1/payload.js.map +1 -0
  24. package/dist/messaging/mux/grant/0.1/payload.d.ts +1008 -0
  25. package/dist/messaging/mux/grant/0.1/payload.d.ts.map +1 -0
  26. package/dist/messaging/mux/grant/0.1/payload.js +606 -0
  27. package/dist/messaging/mux/grant/0.1/payload.js.map +1 -0
  28. package/dist/messaging/mux/list/0.1/payload.d.ts +1241 -0
  29. package/dist/messaging/mux/list/0.1/payload.d.ts.map +1 -0
  30. package/dist/messaging/mux/list/0.1/payload.js +715 -0
  31. package/dist/messaging/mux/list/0.1/payload.js.map +1 -0
  32. package/dist/messaging/mux/notice/0.1/payload.d.ts +489 -0
  33. package/dist/messaging/mux/notice/0.1/payload.d.ts.map +1 -0
  34. package/dist/messaging/mux/notice/0.1/payload.js +249 -0
  35. package/dist/messaging/mux/notice/0.1/payload.js.map +1 -0
  36. package/dist/messaging/mux/revoke/0.1/payload.d.ts +585 -0
  37. package/dist/messaging/mux/revoke/0.1/payload.d.ts.map +1 -0
  38. package/dist/messaging/mux/revoke/0.1/payload.js +311 -0
  39. package/dist/messaging/mux/revoke/0.1/payload.js.map +1 -0
  40. package/dist/messaging/mux/revoke-all/0.1/payload.d.ts +682 -0
  41. package/dist/messaging/mux/revoke-all/0.1/payload.d.ts.map +1 -0
  42. package/dist/messaging/mux/revoke-all/0.1/payload.js +397 -0
  43. package/dist/messaging/mux/revoke-all/0.1/payload.js.map +1 -0
  44. package/dist/messaging/mux/update/0.1/payload.d.ts +995 -0
  45. package/dist/messaging/mux/update/0.1/payload.d.ts.map +1 -0
  46. package/dist/messaging/mux/update/0.1/payload.js +586 -0
  47. package/dist/messaging/mux/update/0.1/payload.js.map +1 -0
  48. package/dist/vta/_shared/0.1/memory-record.d.ts +22 -0
  49. package/dist/vta/_shared/0.1/memory-record.d.ts.map +1 -0
  50. package/dist/vta/_shared/0.1/memory-record.js +6 -0
  51. package/dist/vta/_shared/0.1/memory-record.js.map +1 -0
  52. package/dist/vta/memory/delete/0.1/payload.d.ts +13 -2
  53. package/dist/vta/memory/delete/0.1/payload.d.ts.map +1 -1
  54. package/dist/vta/memory/delete/0.1/payload.js +1 -1
  55. package/dist/vta/memory/delete/0.1/payload.js.map +1 -1
  56. package/dist/vta/memory/delete/0.2/payload.d.ts +415 -0
  57. package/dist/vta/memory/delete/0.2/payload.d.ts.map +1 -0
  58. package/dist/vta/memory/delete/0.2/payload.js +224 -0
  59. package/dist/vta/memory/delete/0.2/payload.js.map +1 -0
  60. package/dist/vta/memory/get/0.1/payload.d.ts +646 -0
  61. package/dist/vta/memory/get/0.1/payload.d.ts.map +1 -0
  62. package/dist/vta/memory/get/0.1/payload.js +349 -0
  63. package/dist/vta/memory/get/0.1/payload.js.map +1 -0
  64. package/dist/vta/memory/list/0.1/payload.d.ts +13 -2
  65. package/dist/vta/memory/list/0.1/payload.d.ts.map +1 -1
  66. package/dist/vta/memory/list/0.1/payload.js +1 -1
  67. package/dist/vta/memory/list/0.1/payload.js.map +1 -1
  68. package/dist/vta/memory/list/0.2/payload.d.ts +693 -0
  69. package/dist/vta/memory/list/0.2/payload.d.ts.map +1 -0
  70. package/dist/vta/memory/list/0.2/payload.js +363 -0
  71. package/dist/vta/memory/list/0.2/payload.js.map +1 -0
  72. package/dist/vta/memory/put/0.1/payload.d.ts +13 -2
  73. package/dist/vta/memory/put/0.1/payload.d.ts.map +1 -1
  74. package/dist/vta/memory/put/0.1/payload.js +1 -1
  75. package/dist/vta/memory/put/0.1/payload.js.map +1 -1
  76. package/dist/vta/memory/put/0.2/payload.d.ts +490 -0
  77. package/dist/vta/memory/put/0.2/payload.d.ts.map +1 -0
  78. package/dist/vta/memory/put/0.2/payload.js +264 -0
  79. package/dist/vta/memory/put/0.2/payload.js.map +1 -0
  80. package/package.json +1 -1
  81. package/src/_shared/components.ts +581 -0
  82. package/src/index.ts +45 -0
  83. package/src/messaging/mux/_shared/0.1/mux.ts +17 -0
  84. package/src/messaging/mux/attach/0.1/payload.ts +682 -0
  85. package/src/messaging/mux/detach/0.1/payload.ts +278 -0
  86. package/src/messaging/mux/event/0.1/payload.ts +371 -0
  87. package/src/messaging/mux/grant/0.1/payload.ts +710 -0
  88. package/src/messaging/mux/list/0.1/payload.ts +793 -0
  89. package/src/messaging/mux/notice/0.1/payload.ts +362 -0
  90. package/src/messaging/mux/revoke/0.1/payload.ts +389 -0
  91. package/src/messaging/mux/revoke-all/0.1/payload.ts +452 -0
  92. package/src/messaging/mux/update/0.1/payload.ts +644 -0
  93. package/src/vta/_shared/0.1/memory-record.ts +23 -0
  94. package/src/vta/memory/delete/0.1/payload.ts +14 -3
  95. package/src/vta/memory/delete/0.2/payload.ts +288 -0
  96. package/src/vta/memory/get/0.1/payload.ts +414 -0
  97. package/src/vta/memory/list/0.1/payload.ts +14 -3
  98. package/src/vta/memory/list/0.2/payload.ts +445 -0
  99. package/src/vta/memory/put/0.1/payload.ts +14 -3
  100. package/src/vta/memory/put/0.2/payload.ts +333 -0
@@ -0,0 +1,333 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/memory/put/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { Ext, MemoryExpectedVersion, MemoryKey, MemoryValue, MemoryVersion } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Store one memory item at its `(contextId, key)` address. `expectedVersion` makes the write conditional: a positive value requires the item to be at exactly that version, and zero requires that no live item exists.
11
+ */
12
+ export interface VTAMemoryPutPayload {
13
+ /**
14
+ * The VTA context the item is scoped to; the isolation boundary.
15
+ */
16
+ contextId: string;
17
+ key: MemoryKey;
18
+ value: MemoryValue;
19
+ /**
20
+ * Optional precondition. Omit for a last-writer-wins upsert, as in 0.1. Supply the version a prior read returned to make the write conditional; supply 0 to create only.
21
+ */
22
+ expectedVersion?: MemoryExpectedVersion;
23
+ /**
24
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
25
+ */
26
+ ext?: Ext;
27
+ }
28
+ /**
29
+ * Success response to vta/memory/put. Type https://trusttasks.org/spec/vta/memory/put/0.2#response. A failed precondition is not a success: it is a trust-task-error carrying vta/memory/put:versionConflict, whose details carry the maintainer's current version and value.
30
+ */
31
+ export interface VTAMemoryPutResponsePayload {
32
+ /**
33
+ * Echoed from the request.
34
+ */
35
+ contextId: string;
36
+ key: MemoryKey;
37
+ /**
38
+ * The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read.
39
+ */
40
+ version: MemoryVersion;
41
+ /**
42
+ * True when no live item existed at the key beforehand — including when the key held a tombstone, since a tombstone is not a live item.
43
+ */
44
+ wasCreated: boolean;
45
+ /**
46
+ * When the write was applied.
47
+ */
48
+ updatedAt: string;
49
+ /**
50
+ * Size of the stored value in bytes as the maintainer measured it against its per-item cap.
51
+ */
52
+ valueBytes?: number;
53
+ /**
54
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
55
+ */
56
+ ext?: Ext;
57
+ }
58
+
59
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
60
+ export type { Ext, MemoryExpectedVersion, MemoryKey, MemoryValue, MemoryVersion };
61
+
62
+ /** Trust Task type URI. */
63
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/memory/put/0.2" as const;
64
+
65
+ /**
66
+ * The earlier version of this specification that this one declares it
67
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
68
+ * `null`. Only the direct declaration — follow the chain with
69
+ * `extendsChain` / `readForSpec`.
70
+ */
71
+ export const EXTENDS: string | null = null;
72
+
73
+ /**
74
+ * Why this version is deprecated, or `null` while it is current. A
75
+ * superseded or retired version is still supported, and is withdrawn from
76
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
77
+ * Versions").
78
+ */
79
+ export const DEPRECATION: string | null = null;
80
+
81
+ /** Stable alias for this specification's request payload shape. */
82
+ export type Payload = VTAMemoryPutPayload;
83
+
84
+ /** Trust Task response type URI (request type URI + "#response"). */
85
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/memory/put/0.2#response" as const;
86
+
87
+ /** Stable alias for this specification's success-response payload shape. */
88
+ export type Response = VTAMemoryPutResponsePayload;
89
+
90
+ /**
91
+ * This specification's payload schema, as a value.
92
+ *
93
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
94
+ * rather than only as a `.json` file because TypeScript types are erased
95
+ * at runtime: without a schema a consumer has nothing to validate, and
96
+ * every REQUIRED payload member is optional in practice. Cross-file
97
+ * `$ref`s are already inlined, so it needs no resolver.
98
+ */
99
+ export const PAYLOAD_SCHEMA = {
100
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
101
+ "$id": "https://trusttasks.org/spec/vta/memory/put/0.2",
102
+ "title": "VTA Memory Put — payload",
103
+ "description": "Store one memory item at its `(contextId, key)` address. `expectedVersion` makes the write conditional: a positive value requires the item to be at exactly that version, and zero requires that no live item exists.",
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": [
107
+ "contextId",
108
+ "key",
109
+ "value"
110
+ ],
111
+ "properties": {
112
+ "contextId": {
113
+ "type": "string",
114
+ "minLength": 1,
115
+ "description": "The VTA context the item is scoped to; the isolation boundary."
116
+ },
117
+ "key": {
118
+ "$ref": "#/$defs/MemoryKey"
119
+ },
120
+ "value": {
121
+ "$ref": "#/$defs/MemoryValue"
122
+ },
123
+ "expectedVersion": {
124
+ "$ref": "#/$defs/MemoryExpectedVersion",
125
+ "description": "Optional precondition. Omit for a last-writer-wins upsert, as in 0.1. Supply the version a prior read returned to make the write conditional; supply 0 to create only."
126
+ },
127
+ "ext": {
128
+ "$ref": "#/$defs/Ext",
129
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
130
+ }
131
+ },
132
+ "$defs": {
133
+ "Response": {
134
+ "$anchor": "response",
135
+ "title": "VTA Memory Put — response payload",
136
+ "description": "Success response to vta/memory/put. Type https://trusttasks.org/spec/vta/memory/put/0.2#response. A failed precondition is not a success: it is a trust-task-error carrying vta/memory/put:versionConflict, whose details carry the maintainer's current version and value.",
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "required": [
140
+ "contextId",
141
+ "key",
142
+ "version",
143
+ "wasCreated",
144
+ "updatedAt"
145
+ ],
146
+ "properties": {
147
+ "contextId": {
148
+ "type": "string",
149
+ "minLength": 1,
150
+ "description": "Echoed from the request."
151
+ },
152
+ "key": {
153
+ "$ref": "#/$defs/MemoryKey"
154
+ },
155
+ "version": {
156
+ "$ref": "#/$defs/MemoryVersion",
157
+ "description": "The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read."
158
+ },
159
+ "wasCreated": {
160
+ "type": "boolean",
161
+ "description": "True when no live item existed at the key beforehand — including when the key held a tombstone, since a tombstone is not a live item."
162
+ },
163
+ "updatedAt": {
164
+ "type": "string",
165
+ "format": "date-time",
166
+ "description": "When the write was applied."
167
+ },
168
+ "valueBytes": {
169
+ "type": "integer",
170
+ "minimum": 0,
171
+ "description": "Size of the stored value in bytes as the maintainer measured it against its per-item cap."
172
+ },
173
+ "ext": {
174
+ "$ref": "#/$defs/Ext",
175
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
176
+ }
177
+ }
178
+ },
179
+ "Ext": {
180
+ "title": "Ext",
181
+ "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.",
182
+ "type": "object",
183
+ "minProperties": 1,
184
+ "additionalProperties": true,
185
+ "propertyNames": {
186
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
187
+ }
188
+ },
189
+ "MemoryVersion": {
190
+ "title": "MemoryVersion",
191
+ "description": "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.",
192
+ "type": "integer",
193
+ "minimum": 1
194
+ },
195
+ "MemoryKey": {
196
+ "title": "MemoryKey",
197
+ "description": "Agent-chosen identifier for an item within a context. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `vta/memory/list` is a byte-prefix comparison over the UTF-8 encoding. Agents SHOULD use `/`-delimited hierarchical keys (`contact/billing`, `preference/timezone`) so that `prefix` can address a family of items, but the delimiter is a convention between an agent and itself. A key is content as well as an address: a key naming a person, a condition or a dispute discloses something to anyone who can list the context, even without its value.",
198
+ "type": "string",
199
+ "minLength": 1,
200
+ "maxLength": 512,
201
+ "pattern": "^[^\\u0000]+$"
202
+ },
203
+ "MemoryExpectedVersion": {
204
+ "title": "MemoryExpectedVersion",
205
+ "description": "Optimistic-concurrency precondition on a write. A positive value requires that the item's current `version` equals it exactly. Zero means \"create only\" — the write applies only if no LIVE item exists at the key. A tombstone is not a live item, so `expectedVersion: 0` succeeds over one; the created item takes the context's next counter value, which is necessarily greater than the tombstone's.",
206
+ "type": "integer",
207
+ "minimum": 0
208
+ },
209
+ "MemoryValue": {
210
+ "title": "MemoryValue",
211
+ "description": "The remembered text: a fact, a summary, a preference. Opaque to the maintainer, which stores it as given and never interprets, rewrites or summarises it. The maintainer enforces a documented per-item cap on its size (see `vta/memory/put`).",
212
+ "type": "string"
213
+ }
214
+ }
215
+ } as const;
216
+
217
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
218
+ export const RESPONSE_PAYLOAD_SCHEMA = {
219
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
220
+ "$ref": "#/$defs/Response",
221
+ "$defs": {
222
+ "Response": {
223
+ "$anchor": "response",
224
+ "title": "VTA Memory Put — response payload",
225
+ "description": "Success response to vta/memory/put. Type https://trusttasks.org/spec/vta/memory/put/0.2#response. A failed precondition is not a success: it is a trust-task-error carrying vta/memory/put:versionConflict, whose details carry the maintainer's current version and value.",
226
+ "type": "object",
227
+ "additionalProperties": false,
228
+ "required": [
229
+ "contextId",
230
+ "key",
231
+ "version",
232
+ "wasCreated",
233
+ "updatedAt"
234
+ ],
235
+ "properties": {
236
+ "contextId": {
237
+ "type": "string",
238
+ "minLength": 1,
239
+ "description": "Echoed from the request."
240
+ },
241
+ "key": {
242
+ "$ref": "#/$defs/MemoryKey"
243
+ },
244
+ "version": {
245
+ "$ref": "#/$defs/MemoryVersion",
246
+ "description": "The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read."
247
+ },
248
+ "wasCreated": {
249
+ "type": "boolean",
250
+ "description": "True when no live item existed at the key beforehand — including when the key held a tombstone, since a tombstone is not a live item."
251
+ },
252
+ "updatedAt": {
253
+ "type": "string",
254
+ "format": "date-time",
255
+ "description": "When the write was applied."
256
+ },
257
+ "valueBytes": {
258
+ "type": "integer",
259
+ "minimum": 0,
260
+ "description": "Size of the stored value in bytes as the maintainer measured it against its per-item cap."
261
+ },
262
+ "ext": {
263
+ "$ref": "#/$defs/Ext",
264
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
265
+ }
266
+ }
267
+ },
268
+ "Ext": {
269
+ "title": "Ext",
270
+ "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.",
271
+ "type": "object",
272
+ "minProperties": 1,
273
+ "additionalProperties": true,
274
+ "propertyNames": {
275
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
276
+ }
277
+ },
278
+ "MemoryVersion": {
279
+ "title": "MemoryVersion",
280
+ "description": "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.",
281
+ "type": "integer",
282
+ "minimum": 1
283
+ },
284
+ "MemoryKey": {
285
+ "title": "MemoryKey",
286
+ "description": "Agent-chosen identifier for an item within a context. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `vta/memory/list` is a byte-prefix comparison over the UTF-8 encoding. Agents SHOULD use `/`-delimited hierarchical keys (`contact/billing`, `preference/timezone`) so that `prefix` can address a family of items, but the delimiter is a convention between an agent and itself. A key is content as well as an address: a key naming a person, a condition or a dispute discloses something to anyone who can list the context, even without its value.",
287
+ "type": "string",
288
+ "minLength": 1,
289
+ "maxLength": 512,
290
+ "pattern": "^[^\\u0000]+$"
291
+ },
292
+ "MemoryExpectedVersion": {
293
+ "title": "MemoryExpectedVersion",
294
+ "description": "Optimistic-concurrency precondition on a write. A positive value requires that the item's current `version` equals it exactly. Zero means \"create only\" — the write applies only if no LIVE item exists at the key. A tombstone is not a live item, so `expectedVersion: 0` succeeds over one; the created item takes the context's next counter value, which is necessarily greater than the tombstone's.",
295
+ "type": "integer",
296
+ "minimum": 0
297
+ },
298
+ "MemoryValue": {
299
+ "title": "MemoryValue",
300
+ "description": "The remembered text: a fact, a summary, a preference. Opaque to the maintainer, which stores it as given and never interprets, rewrites or summarises it. The maintainer enforces a documented per-item cap on its size (see `vta/memory/put`).",
301
+ "type": "string"
302
+ }
303
+ }
304
+ } as const;
305
+
306
+ /**
307
+ * SPEC.md §7.2 policy for the request variant, from this specification's
308
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
309
+ * per-specification and cannot be derived from the document alone, and
310
+ * item 2 needs the schema this carries.
311
+ */
312
+ export const SPEC = {
313
+ typeUri: TYPE_URI,
314
+ isBearer: false,
315
+ isProofRequired: true,
316
+ isRecipientRequired: true,
317
+ isIssuedAtRequired: true,
318
+ payloadSchema: PAYLOAD_SCHEMA,
319
+ } as const;
320
+
321
+ /**
322
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
323
+ * tracks the *issuer* party's requirement because a response swaps the
324
+ * parties (§7.3 item 5).
325
+ */
326
+ export const RESPONSE_SPEC = {
327
+ typeUri: RESPONSE_TYPE_URI,
328
+ isBearer: false,
329
+ isProofRequired: true,
330
+ isRecipientRequired: true,
331
+ isIssuedAtRequired: true,
332
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
333
+ } as const;