@openvtc/trust-tasks 0.28.24 → 0.28.26

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 (223) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/dist/_extends.d.ts.map +1 -1
  3. package/dist/_extends.js +9 -0
  4. package/dist/_extends.js.map +1 -1
  5. package/dist/_shared/components.d.ts +117 -0
  6. package/dist/_shared/components.d.ts.map +1 -1
  7. package/dist/acl/_shared/0.3/acl-entry.d.ts +24 -0
  8. package/dist/acl/_shared/0.3/acl-entry.d.ts.map +1 -0
  9. package/dist/acl/_shared/0.3/acl-entry.js +6 -0
  10. package/dist/acl/_shared/0.3/acl-entry.js.map +1 -0
  11. package/dist/acl/change-role/0.1/payload.d.ts +4 -4
  12. package/dist/acl/change-role/0.1/payload.js +1 -1
  13. package/dist/acl/change-role/0.2/payload.d.ts +14 -2
  14. package/dist/acl/change-role/0.2/payload.d.ts.map +1 -1
  15. package/dist/acl/change-role/0.2/payload.js +1 -1
  16. package/dist/acl/change-role/0.2/payload.js.map +1 -1
  17. package/dist/acl/change-role/0.3/payload.d.ts +1925 -0
  18. package/dist/acl/change-role/0.3/payload.d.ts.map +1 -0
  19. package/dist/acl/change-role/0.3/payload.js +1109 -0
  20. package/dist/acl/change-role/0.3/payload.js.map +1 -0
  21. package/dist/acl/grant/0.1/payload.d.ts +4 -4
  22. package/dist/acl/grant/0.1/payload.js +1 -1
  23. package/dist/acl/grant/0.2/payload.d.ts +14 -2
  24. package/dist/acl/grant/0.2/payload.d.ts.map +1 -1
  25. package/dist/acl/grant/0.2/payload.js +1 -1
  26. package/dist/acl/grant/0.2/payload.js.map +1 -1
  27. package/dist/acl/grant/0.3/payload.d.ts +1895 -0
  28. package/dist/acl/grant/0.3/payload.d.ts.map +1 -0
  29. package/dist/acl/grant/0.3/payload.js +1096 -0
  30. package/dist/acl/grant/0.3/payload.js.map +1 -0
  31. package/dist/acl/list/0.1/payload.d.ts +4 -4
  32. package/dist/acl/list/0.1/payload.js +1 -1
  33. package/dist/acl/list/0.2/payload.d.ts +4 -4
  34. package/dist/acl/list/0.2/payload.js +1 -1
  35. package/dist/acl/list/0.3/payload.d.ts +14 -2
  36. package/dist/acl/list/0.3/payload.d.ts.map +1 -1
  37. package/dist/acl/list/0.3/payload.js +1 -1
  38. package/dist/acl/list/0.3/payload.js.map +1 -1
  39. package/dist/acl/list/0.4/payload.d.ts +2079 -0
  40. package/dist/acl/list/0.4/payload.d.ts.map +1 -0
  41. package/dist/acl/list/0.4/payload.js +1185 -0
  42. package/dist/acl/list/0.4/payload.js.map +1 -0
  43. package/dist/acl/revoke/0.1/payload.d.ts +4 -4
  44. package/dist/acl/revoke/0.1/payload.js +1 -1
  45. package/dist/acl/revoke/0.2/payload.d.ts +14 -2
  46. package/dist/acl/revoke/0.2/payload.d.ts.map +1 -1
  47. package/dist/acl/revoke/0.2/payload.js +1 -1
  48. package/dist/acl/revoke/0.2/payload.js.map +1 -1
  49. package/dist/acl/revoke/0.3/payload.d.ts +2090 -0
  50. package/dist/acl/revoke/0.3/payload.d.ts.map +1 -0
  51. package/dist/acl/revoke/0.3/payload.js +1206 -0
  52. package/dist/acl/revoke/0.3/payload.js.map +1 -0
  53. package/dist/acl/show/0.1/payload.d.ts +4 -4
  54. package/dist/acl/show/0.1/payload.js +1 -1
  55. package/dist/acl/show/0.2/payload.d.ts +14 -2
  56. package/dist/acl/show/0.2/payload.d.ts.map +1 -1
  57. package/dist/acl/show/0.2/payload.js +1 -1
  58. package/dist/acl/show/0.2/payload.js.map +1 -1
  59. package/dist/acl/show/0.3/payload.d.ts +1935 -0
  60. package/dist/acl/show/0.3/payload.d.ts.map +1 -0
  61. package/dist/acl/show/0.3/payload.js +1122 -0
  62. package/dist/acl/show/0.3/payload.js.map +1 -0
  63. package/dist/acl/update/0.1/payload.d.ts +4 -4
  64. package/dist/acl/update/0.1/payload.js +1 -1
  65. package/dist/acl/update/0.2/payload.d.ts +14 -2
  66. package/dist/acl/update/0.2/payload.d.ts.map +1 -1
  67. package/dist/acl/update/0.2/payload.js +1 -1
  68. package/dist/acl/update/0.2/payload.js.map +1 -1
  69. package/dist/acl/update/0.3/payload.d.ts +2042 -0
  70. package/dist/acl/update/0.3/payload.d.ts.map +1 -0
  71. package/dist/acl/update/0.3/payload.js +1163 -0
  72. package/dist/acl/update/0.3/payload.js.map +1 -0
  73. package/dist/index.d.ts +48 -0
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +48 -0
  76. package/dist/index.js.map +1 -1
  77. package/dist/rooms/_shared/0.2/room.d.ts +1 -1
  78. package/dist/rooms/_shared/0.2/room.d.ts.map +1 -1
  79. package/dist/rooms/keys/file-key/0.1/payload.d.ts +4 -4
  80. package/dist/rooms/keys/file-key/0.1/payload.js +1 -1
  81. package/dist/rooms/keys/file-key/0.2/payload.d.ts +14 -2
  82. package/dist/rooms/keys/file-key/0.2/payload.d.ts.map +1 -1
  83. package/dist/rooms/keys/file-key/0.2/payload.js +1 -1
  84. package/dist/rooms/keys/file-key/0.2/payload.js.map +1 -1
  85. package/dist/rooms/keys/file-key/0.3/payload.d.ts +396 -0
  86. package/dist/rooms/keys/file-key/0.3/payload.d.ts.map +1 -0
  87. package/dist/rooms/keys/file-key/0.3/payload.js +223 -0
  88. package/dist/rooms/keys/file-key/0.3/payload.js.map +1 -0
  89. package/dist/rooms/keys/open/0.1/payload.d.ts +4 -4
  90. package/dist/rooms/keys/open/0.1/payload.js +1 -1
  91. package/dist/rooms/keys/open/0.2/payload.d.ts +14 -2
  92. package/dist/rooms/keys/open/0.2/payload.d.ts.map +1 -1
  93. package/dist/rooms/keys/open/0.2/payload.js +1 -1
  94. package/dist/rooms/keys/open/0.2/payload.js.map +1 -1
  95. package/dist/rooms/keys/open/0.3/payload.d.ts +413 -0
  96. package/dist/rooms/keys/open/0.3/payload.d.ts.map +1 -0
  97. package/dist/rooms/keys/open/0.3/payload.js +227 -0
  98. package/dist/rooms/keys/open/0.3/payload.js.map +1 -0
  99. package/dist/rooms/keys/read/0.1/payload.d.ts +4 -4
  100. package/dist/rooms/keys/read/0.1/payload.js +1 -1
  101. package/dist/rooms/keys/read/0.2/payload.d.ts +14 -2
  102. package/dist/rooms/keys/read/0.2/payload.d.ts.map +1 -1
  103. package/dist/rooms/keys/read/0.2/payload.js +1 -1
  104. package/dist/rooms/keys/read/0.2/payload.js.map +1 -1
  105. package/dist/rooms/keys/read/0.3/payload.d.ts +1363 -0
  106. package/dist/rooms/keys/read/0.3/payload.d.ts.map +1 -0
  107. package/dist/rooms/keys/read/0.3/payload.js +731 -0
  108. package/dist/rooms/keys/read/0.3/payload.js.map +1 -0
  109. package/dist/rooms/owner/issue-authority/0.2/payload.d.ts +13 -2
  110. package/dist/rooms/owner/issue-authority/0.2/payload.d.ts.map +1 -1
  111. package/dist/rooms/owner/issue-authority/0.2/payload.js +1 -1
  112. package/dist/rooms/owner/issue-authority/0.2/payload.js.map +1 -1
  113. package/dist/rooms/owner/issue-authority/0.3/payload.d.ts +557 -0
  114. package/dist/rooms/owner/issue-authority/0.3/payload.d.ts.map +1 -0
  115. package/dist/rooms/owner/issue-authority/0.3/payload.js +322 -0
  116. package/dist/rooms/owner/issue-authority/0.3/payload.js.map +1 -0
  117. package/dist/rooms/records/get/0.1/payload.d.ts +4 -4
  118. package/dist/rooms/records/get/0.1/payload.js +1 -1
  119. package/dist/rooms/records/get/0.2/payload.d.ts +4 -4
  120. package/dist/rooms/records/get/0.2/payload.js +1 -1
  121. package/dist/rooms/records/get/0.3/payload.d.ts +13 -2
  122. package/dist/rooms/records/get/0.3/payload.d.ts.map +1 -1
  123. package/dist/rooms/records/get/0.3/payload.js +1 -1
  124. package/dist/rooms/records/get/0.3/payload.js.map +1 -1
  125. package/dist/rooms/records/get/0.4/payload.d.ts +1140 -0
  126. package/dist/rooms/records/get/0.4/payload.d.ts.map +1 -0
  127. package/dist/rooms/records/get/0.4/payload.js +613 -0
  128. package/dist/rooms/records/get/0.4/payload.js.map +1 -0
  129. package/dist/vault/sign-trust-task/0.2/payload.d.ts +5 -5
  130. package/dist/vault/sign-trust-task/0.2/payload.js +2 -2
  131. package/dist/vta/_shared/0.1/memory-record.d.ts +1 -1
  132. package/dist/vta/_shared/0.1/memory-record.d.ts.map +1 -1
  133. package/dist/vta/memory/delete/0.1/payload.d.ts +4 -4
  134. package/dist/vta/memory/delete/0.1/payload.js +1 -1
  135. package/dist/vta/memory/delete/0.2/payload.d.ts +14 -2
  136. package/dist/vta/memory/delete/0.2/payload.d.ts.map +1 -1
  137. package/dist/vta/memory/delete/0.2/payload.js +1 -1
  138. package/dist/vta/memory/delete/0.2/payload.js.map +1 -1
  139. package/dist/vta/memory/delete/0.3/payload.d.ts +491 -0
  140. package/dist/vta/memory/delete/0.3/payload.d.ts.map +1 -0
  141. package/dist/vta/memory/delete/0.3/payload.js +266 -0
  142. package/dist/vta/memory/delete/0.3/payload.js.map +1 -0
  143. package/dist/vta/memory/get/0.1/payload.d.ts +14 -2
  144. package/dist/vta/memory/get/0.1/payload.d.ts.map +1 -1
  145. package/dist/vta/memory/get/0.1/payload.js +1 -1
  146. package/dist/vta/memory/get/0.1/payload.js.map +1 -1
  147. package/dist/vta/memory/get/0.2/payload.d.ts +722 -0
  148. package/dist/vta/memory/get/0.2/payload.d.ts.map +1 -0
  149. package/dist/vta/memory/get/0.2/payload.js +391 -0
  150. package/dist/vta/memory/get/0.2/payload.js.map +1 -0
  151. package/dist/vta/memory/list/0.1/payload.d.ts +4 -4
  152. package/dist/vta/memory/list/0.1/payload.js +1 -1
  153. package/dist/vta/memory/list/0.2/payload.d.ts +14 -2
  154. package/dist/vta/memory/list/0.2/payload.d.ts.map +1 -1
  155. package/dist/vta/memory/list/0.2/payload.js +1 -1
  156. package/dist/vta/memory/list/0.2/payload.js.map +1 -1
  157. package/dist/vta/memory/list/0.3/payload.d.ts +769 -0
  158. package/dist/vta/memory/list/0.3/payload.d.ts.map +1 -0
  159. package/dist/vta/memory/list/0.3/payload.js +405 -0
  160. package/dist/vta/memory/list/0.3/payload.js.map +1 -0
  161. package/dist/vta/memory/put/0.1/payload.d.ts +4 -4
  162. package/dist/vta/memory/put/0.1/payload.js +1 -1
  163. package/dist/vta/memory/put/0.2/payload.d.ts +14 -2
  164. package/dist/vta/memory/put/0.2/payload.d.ts.map +1 -1
  165. package/dist/vta/memory/put/0.2/payload.js +1 -1
  166. package/dist/vta/memory/put/0.2/payload.js.map +1 -1
  167. package/dist/vta/memory/put/0.3/payload.d.ts +566 -0
  168. package/dist/vta/memory/put/0.3/payload.d.ts.map +1 -0
  169. package/dist/vta/memory/put/0.3/payload.js +306 -0
  170. package/dist/vta/memory/put/0.3/payload.js.map +1 -0
  171. package/package.json +1 -1
  172. package/src/_extends.ts +9 -0
  173. package/src/_shared/components.ts +117 -0
  174. package/src/acl/_shared/0.3/acl-entry.ts +25 -0
  175. package/src/acl/change-role/0.1/payload.ts +5 -5
  176. package/src/acl/change-role/0.2/payload.ts +15 -3
  177. package/src/acl/change-role/0.3/payload.ts +1167 -0
  178. package/src/acl/grant/0.1/payload.ts +5 -5
  179. package/src/acl/grant/0.2/payload.ts +15 -3
  180. package/src/acl/grant/0.3/payload.ts +1146 -0
  181. package/src/acl/list/0.1/payload.ts +5 -5
  182. package/src/acl/list/0.2/payload.ts +5 -5
  183. package/src/acl/list/0.3/payload.ts +15 -3
  184. package/src/acl/list/0.4/payload.ts +1267 -0
  185. package/src/acl/revoke/0.1/payload.ts +5 -5
  186. package/src/acl/revoke/0.2/payload.ts +15 -3
  187. package/src/acl/revoke/0.3/payload.ts +1278 -0
  188. package/src/acl/show/0.1/payload.ts +5 -5
  189. package/src/acl/show/0.2/payload.ts +15 -3
  190. package/src/acl/show/0.3/payload.ts +1172 -0
  191. package/src/acl/update/0.1/payload.ts +5 -5
  192. package/src/acl/update/0.2/payload.ts +15 -3
  193. package/src/acl/update/0.3/payload.ts +1258 -0
  194. package/src/index.ts +48 -0
  195. package/src/rooms/_shared/0.2/room.ts +1 -1
  196. package/src/rooms/keys/file-key/0.1/payload.ts +5 -5
  197. package/src/rooms/keys/file-key/0.2/payload.ts +15 -3
  198. package/src/rooms/keys/file-key/0.3/payload.ts +286 -0
  199. package/src/rooms/keys/open/0.1/payload.ts +5 -5
  200. package/src/rooms/keys/open/0.2/payload.ts +15 -3
  201. package/src/rooms/keys/open/0.3/payload.ts +299 -0
  202. package/src/rooms/keys/read/0.1/payload.ts +5 -5
  203. package/src/rooms/keys/read/0.2/payload.ts +15 -3
  204. package/src/rooms/keys/read/0.3/payload.ts +901 -0
  205. package/src/rooms/owner/issue-authority/0.2/payload.ts +14 -3
  206. package/src/rooms/owner/issue-authority/0.3/payload.ts +388 -0
  207. package/src/rooms/records/get/0.1/payload.ts +5 -5
  208. package/src/rooms/records/get/0.2/payload.ts +5 -5
  209. package/src/rooms/records/get/0.3/payload.ts +14 -3
  210. package/src/rooms/records/get/0.4/payload.ts +730 -0
  211. package/src/vault/sign-trust-task/0.2/payload.ts +3 -3
  212. package/src/vta/_shared/0.1/memory-record.ts +1 -1
  213. package/src/vta/memory/delete/0.1/payload.ts +5 -5
  214. package/src/vta/memory/delete/0.2/payload.ts +15 -3
  215. package/src/vta/memory/delete/0.3/payload.ts +334 -0
  216. package/src/vta/memory/get/0.1/payload.ts +15 -3
  217. package/src/vta/memory/get/0.2/payload.ts +460 -0
  218. package/src/vta/memory/list/0.1/payload.ts +5 -5
  219. package/src/vta/memory/list/0.2/payload.ts +15 -3
  220. package/src/vta/memory/list/0.3/payload.ts +491 -0
  221. package/src/vta/memory/put/0.1/payload.ts +5 -5
  222. package/src/vta/memory/put/0.2/payload.ts +15 -3
  223. package/src/vta/memory/put/0.3/payload.ts +379 -0
@@ -0,0 +1,379 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/memory/put/0.3/payload.schema.json
4
+ */
5
+
6
+ import type { Ext, MemoryExpectedVersion, MemoryKey, MemoryPurpose, MemoryValue, MemoryVersion, Purpose_AclV0_3 as Purpose, Purpose_AclV0_31, Purpose_AclV0_32 } 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
+ * OPTIONAL. The one purpose the caller will use the content this request discloses for (VTI-ACL-103). Granted only as the caller's ACL entry grants it; a purpose the entry does not grant is refused with `purposeNotGranted`. May be omitted where the entry lists exactly one purpose, or states `any`.
25
+ */
26
+ purpose?: MemoryPurpose;
27
+ /**
28
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
29
+ */
30
+ ext?: Ext;
31
+ }
32
+ /**
33
+ * Success response to vta/memory/put. Type https://trusttasks.org/spec/vta/memory/put/0.3#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.
34
+ */
35
+ export interface VTAMemoryPutResponsePayload {
36
+ /**
37
+ * Echoed from the request.
38
+ */
39
+ contextId: string;
40
+ key: MemoryKey;
41
+ /**
42
+ * The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read.
43
+ */
44
+ version: MemoryVersion;
45
+ /**
46
+ * 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.
47
+ */
48
+ wasCreated: boolean;
49
+ /**
50
+ * When the write was applied.
51
+ */
52
+ updatedAt: string;
53
+ /**
54
+ * Size of the stored value in bytes as the maintainer measured it against its per-item cap.
55
+ */
56
+ valueBytes?: number;
57
+ /**
58
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
59
+ */
60
+ ext?: Ext;
61
+ }
62
+
63
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
64
+ export type { Ext, MemoryExpectedVersion, MemoryKey, MemoryPurpose, MemoryValue, MemoryVersion, Purpose, Purpose_AclV0_31, Purpose_AclV0_32 };
65
+
66
+ /** Trust Task type URI. */
67
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/memory/put/0.3" as const;
68
+
69
+ /**
70
+ * The earlier version of this specification that this one declares it
71
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
72
+ * `null`. Only the direct declaration — follow the chain with
73
+ * `extendsChain` / `readForSpec`.
74
+ */
75
+ export const EXTENDS: string | null = "0.2";
76
+
77
+ /**
78
+ * Why this version is deprecated, or `null` while it is current. A
79
+ * superseded or retired version is still supported, and is withdrawn from
80
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
81
+ * Versions").
82
+ */
83
+ export const DEPRECATION: string | null = null;
84
+
85
+ /** Stable alias for this specification's request payload shape. */
86
+ export type Payload = VTAMemoryPutPayload;
87
+
88
+ /** Trust Task response type URI (request type URI + "#response"). */
89
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/memory/put/0.3#response" as const;
90
+
91
+ /** Stable alias for this specification's success-response payload shape. */
92
+ export type Response = VTAMemoryPutResponsePayload;
93
+
94
+ /**
95
+ * This specification's payload schema, as a value.
96
+ *
97
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
98
+ * rather than only as a `.json` file because TypeScript types are erased
99
+ * at runtime: without a schema a consumer has nothing to validate, and
100
+ * every REQUIRED payload member is optional in practice. Cross-file
101
+ * `$ref`s are already inlined, so it needs no resolver.
102
+ */
103
+ export const PAYLOAD_SCHEMA = {
104
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
105
+ "$id": "https://trusttasks.org/spec/vta/memory/put/0.3",
106
+ "title": "VTA Memory Put — payload",
107
+ "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.",
108
+ "type": "object",
109
+ "additionalProperties": false,
110
+ "required": [
111
+ "contextId",
112
+ "key",
113
+ "value"
114
+ ],
115
+ "properties": {
116
+ "contextId": {
117
+ "type": "string",
118
+ "minLength": 1,
119
+ "description": "The VTA context the item is scoped to; the isolation boundary."
120
+ },
121
+ "key": {
122
+ "$ref": "#/$defs/MemoryKey"
123
+ },
124
+ "value": {
125
+ "$ref": "#/$defs/MemoryValue"
126
+ },
127
+ "expectedVersion": {
128
+ "$ref": "#/$defs/MemoryExpectedVersion",
129
+ "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."
130
+ },
131
+ "purpose": {
132
+ "$ref": "#/$defs/MemoryPurpose",
133
+ "description": "OPTIONAL. The one purpose the caller will use the content this request discloses for (VTI-ACL-103). Granted only as the caller's ACL entry grants it; a purpose the entry does not grant is refused with `purposeNotGranted`. May be omitted where the entry lists exactly one purpose, or states `any`."
134
+ },
135
+ "ext": {
136
+ "$ref": "#/$defs/Ext",
137
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
138
+ }
139
+ },
140
+ "$defs": {
141
+ "Response": {
142
+ "$anchor": "response",
143
+ "title": "VTA Memory Put — response payload",
144
+ "description": "Success response to vta/memory/put. Type https://trusttasks.org/spec/vta/memory/put/0.3#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.",
145
+ "type": "object",
146
+ "additionalProperties": false,
147
+ "required": [
148
+ "contextId",
149
+ "key",
150
+ "version",
151
+ "wasCreated",
152
+ "updatedAt"
153
+ ],
154
+ "properties": {
155
+ "contextId": {
156
+ "type": "string",
157
+ "minLength": 1,
158
+ "description": "Echoed from the request."
159
+ },
160
+ "key": {
161
+ "$ref": "#/$defs/MemoryKey"
162
+ },
163
+ "version": {
164
+ "$ref": "#/$defs/MemoryVersion",
165
+ "description": "The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read."
166
+ },
167
+ "wasCreated": {
168
+ "type": "boolean",
169
+ "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."
170
+ },
171
+ "updatedAt": {
172
+ "type": "string",
173
+ "format": "date-time",
174
+ "description": "When the write was applied."
175
+ },
176
+ "valueBytes": {
177
+ "type": "integer",
178
+ "minimum": 0,
179
+ "description": "Size of the stored value in bytes as the maintainer measured it against its per-item cap."
180
+ },
181
+ "ext": {
182
+ "$ref": "#/$defs/Ext",
183
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
184
+ }
185
+ }
186
+ },
187
+ "Ext": {
188
+ "title": "Ext",
189
+ "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.",
190
+ "type": "object",
191
+ "minProperties": 1,
192
+ "additionalProperties": true,
193
+ "propertyNames": {
194
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
195
+ }
196
+ },
197
+ "MemoryVersion": {
198
+ "title": "MemoryVersion",
199
+ "description": "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.",
200
+ "type": "integer",
201
+ "minimum": 1
202
+ },
203
+ "MemoryKey": {
204
+ "title": "MemoryKey",
205
+ "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.",
206
+ "type": "string",
207
+ "minLength": 1,
208
+ "maxLength": 512,
209
+ "pattern": "^[^\\u0000]+$"
210
+ },
211
+ "MemoryPurpose": {
212
+ "title": "MemoryPurpose",
213
+ "description": "The one purpose for which the caller will use the memory content a request discloses (VTI-ACL-103): a name registered in the VTI specification's purpose registry (`personalisation`, `taskExecution`, `analytics`, `modelTraining`) or an absolute IRI. The VTA grants it only if the caller's ACL entry does — `any` grants every purpose but `modelTraining` — refuses it otherwise (`purposeNotGranted`), and records it in the audit record of the read. Optional where the entry lists exactly one purpose (that one applies) or states `any` (the read is recorded as for no stated purpose).",
214
+ "$ref": "#/$defs/Purpose"
215
+ },
216
+ "Purpose": {
217
+ "title": "Purpose",
218
+ "description": "What content is used for: a lowerCamelCase name registered in the VTI specification's purpose registry (Appendix H) — `personalisation`, `taskExecution`, `analytics`, `modelTraining` at the time of writing — or an absolute IRI naming a purpose defined elsewhere, such as a purpose of the W3C Data Privacy Vocabulary (`https://w3id.org/dpv#ServicePersonalisation`). Compared by exact string equality: a consumer MUST NOT treat a purpose it does not recognise as equal to any other, and grants only a request naming exactly a listed purpose (VTI-ACL-109). A registered name is never an IRI, because it contains no `:`.",
219
+ "type": "string",
220
+ "maxLength": 2048,
221
+ "anyOf": [
222
+ {
223
+ "pattern": "^[a-z][a-zA-Z0-9]{0,63}$"
224
+ },
225
+ {
226
+ "pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*:[^\\s]+$"
227
+ }
228
+ ]
229
+ },
230
+ "MemoryExpectedVersion": {
231
+ "title": "MemoryExpectedVersion",
232
+ "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.",
233
+ "type": "integer",
234
+ "minimum": 0
235
+ },
236
+ "MemoryValue": {
237
+ "title": "MemoryValue",
238
+ "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`).",
239
+ "type": "string"
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": "VTA Memory Put — response payload",
252
+ "description": "Success response to vta/memory/put. Type https://trusttasks.org/spec/vta/memory/put/0.3#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.",
253
+ "type": "object",
254
+ "additionalProperties": false,
255
+ "required": [
256
+ "contextId",
257
+ "key",
258
+ "version",
259
+ "wasCreated",
260
+ "updatedAt"
261
+ ],
262
+ "properties": {
263
+ "contextId": {
264
+ "type": "string",
265
+ "minLength": 1,
266
+ "description": "Echoed from the request."
267
+ },
268
+ "key": {
269
+ "$ref": "#/$defs/MemoryKey"
270
+ },
271
+ "version": {
272
+ "$ref": "#/$defs/MemoryVersion",
273
+ "description": "The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read."
274
+ },
275
+ "wasCreated": {
276
+ "type": "boolean",
277
+ "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."
278
+ },
279
+ "updatedAt": {
280
+ "type": "string",
281
+ "format": "date-time",
282
+ "description": "When the write was applied."
283
+ },
284
+ "valueBytes": {
285
+ "type": "integer",
286
+ "minimum": 0,
287
+ "description": "Size of the stored value in bytes as the maintainer measured it against its per-item cap."
288
+ },
289
+ "ext": {
290
+ "$ref": "#/$defs/Ext",
291
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
292
+ }
293
+ }
294
+ },
295
+ "Ext": {
296
+ "title": "Ext",
297
+ "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.",
298
+ "type": "object",
299
+ "minProperties": 1,
300
+ "additionalProperties": true,
301
+ "propertyNames": {
302
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
303
+ }
304
+ },
305
+ "MemoryVersion": {
306
+ "title": "MemoryVersion",
307
+ "description": "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.",
308
+ "type": "integer",
309
+ "minimum": 1
310
+ },
311
+ "MemoryKey": {
312
+ "title": "MemoryKey",
313
+ "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.",
314
+ "type": "string",
315
+ "minLength": 1,
316
+ "maxLength": 512,
317
+ "pattern": "^[^\\u0000]+$"
318
+ },
319
+ "MemoryPurpose": {
320
+ "title": "MemoryPurpose",
321
+ "description": "The one purpose for which the caller will use the memory content a request discloses (VTI-ACL-103): a name registered in the VTI specification's purpose registry (`personalisation`, `taskExecution`, `analytics`, `modelTraining`) or an absolute IRI. The VTA grants it only if the caller's ACL entry does — `any` grants every purpose but `modelTraining` — refuses it otherwise (`purposeNotGranted`), and records it in the audit record of the read. Optional where the entry lists exactly one purpose (that one applies) or states `any` (the read is recorded as for no stated purpose).",
322
+ "$ref": "#/$defs/Purpose"
323
+ },
324
+ "Purpose": {
325
+ "title": "Purpose",
326
+ "description": "What content is used for: a lowerCamelCase name registered in the VTI specification's purpose registry (Appendix H) — `personalisation`, `taskExecution`, `analytics`, `modelTraining` at the time of writing — or an absolute IRI naming a purpose defined elsewhere, such as a purpose of the W3C Data Privacy Vocabulary (`https://w3id.org/dpv#ServicePersonalisation`). Compared by exact string equality: a consumer MUST NOT treat a purpose it does not recognise as equal to any other, and grants only a request naming exactly a listed purpose (VTI-ACL-109). A registered name is never an IRI, because it contains no `:`.",
327
+ "type": "string",
328
+ "maxLength": 2048,
329
+ "anyOf": [
330
+ {
331
+ "pattern": "^[a-z][a-zA-Z0-9]{0,63}$"
332
+ },
333
+ {
334
+ "pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*:[^\\s]+$"
335
+ }
336
+ ]
337
+ },
338
+ "MemoryExpectedVersion": {
339
+ "title": "MemoryExpectedVersion",
340
+ "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.",
341
+ "type": "integer",
342
+ "minimum": 0
343
+ },
344
+ "MemoryValue": {
345
+ "title": "MemoryValue",
346
+ "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`).",
347
+ "type": "string"
348
+ }
349
+ }
350
+ } as const;
351
+
352
+ /**
353
+ * SPEC.md §7.2 policy for the request variant, from this specification's
354
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
355
+ * per-specification and cannot be derived from the document alone, and
356
+ * item 2 needs the schema this carries.
357
+ */
358
+ export const SPEC = {
359
+ typeUri: TYPE_URI,
360
+ isBearer: false,
361
+ isProofRequired: true,
362
+ isRecipientRequired: true,
363
+ isIssuedAtRequired: true,
364
+ payloadSchema: PAYLOAD_SCHEMA,
365
+ } as const;
366
+
367
+ /**
368
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
369
+ * tracks the *issuer* party's requirement because a response swaps the
370
+ * parties (§7.3 item 5).
371
+ */
372
+ export const RESPONSE_SPEC = {
373
+ typeUri: RESPONSE_TYPE_URI,
374
+ isBearer: false,
375
+ isProofRequired: true,
376
+ isRecipientRequired: true,
377
+ isIssuedAtRequired: true,
378
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
379
+ } as const;