@openvtc/trust-tasks 0.28.14 → 0.28.15

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 (298) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/_extends.d.ts.map +1 -1
  3. package/dist/_extends.js +5 -0
  4. package/dist/_extends.js.map +1 -1
  5. package/dist/_shared/components.d.ts +344 -1
  6. package/dist/_shared/components.d.ts.map +1 -1
  7. package/dist/did-management/stats/set-resolution/0.1/payload.d.ts +398 -0
  8. package/dist/did-management/stats/set-resolution/0.1/payload.d.ts.map +1 -0
  9. package/dist/did-management/stats/set-resolution/0.1/payload.js +247 -0
  10. package/dist/did-management/stats/set-resolution/0.1/payload.js.map +1 -0
  11. package/dist/index.d.ts +75 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +75 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/rooms/_shared/0.1/room.d.ts +1 -1
  16. package/dist/rooms/_shared/0.1/room.d.ts.map +1 -1
  17. package/dist/rooms/_shared/0.2/room.d.ts +1 -1
  18. package/dist/rooms/_shared/0.2/room.d.ts.map +1 -1
  19. package/dist/rooms/_shared/0.3/member-profile.d.ts +11 -0
  20. package/dist/rooms/_shared/0.3/member-profile.d.ts.map +1 -0
  21. package/dist/rooms/_shared/0.3/member-profile.js +6 -0
  22. package/dist/rooms/_shared/0.3/member-profile.js.map +1 -0
  23. package/dist/rooms/changed/0.1/payload.d.ts +139 -0
  24. package/dist/rooms/changed/0.1/payload.d.ts.map +1 -0
  25. package/dist/rooms/changed/0.1/payload.js +84 -0
  26. package/dist/rooms/changed/0.1/payload.js.map +1 -0
  27. package/dist/rooms/keys/act/0.1/payload.d.ts +4 -4
  28. package/dist/rooms/keys/act/0.1/payload.js +1 -1
  29. package/dist/rooms/keys/act/0.10/payload.d.ts +14 -2
  30. package/dist/rooms/keys/act/0.10/payload.d.ts.map +1 -1
  31. package/dist/rooms/keys/act/0.10/payload.js +1 -1
  32. package/dist/rooms/keys/act/0.10/payload.js.map +1 -1
  33. package/dist/rooms/keys/act/0.11/payload.d.ts +572 -0
  34. package/dist/rooms/keys/act/0.11/payload.d.ts.map +1 -0
  35. package/dist/rooms/keys/act/0.11/payload.js +319 -0
  36. package/dist/rooms/keys/act/0.11/payload.js.map +1 -0
  37. package/dist/rooms/keys/act/0.12/payload.d.ts +560 -0
  38. package/dist/rooms/keys/act/0.12/payload.d.ts.map +1 -0
  39. package/dist/rooms/keys/act/0.12/payload.js +319 -0
  40. package/dist/rooms/keys/act/0.12/payload.js.map +1 -0
  41. package/dist/rooms/keys/act/0.2/payload.d.ts +4 -4
  42. package/dist/rooms/keys/act/0.2/payload.js +1 -1
  43. package/dist/rooms/keys/act/0.3/payload.d.ts +4 -4
  44. package/dist/rooms/keys/act/0.3/payload.js +1 -1
  45. package/dist/rooms/keys/act/0.4/payload.d.ts +4 -4
  46. package/dist/rooms/keys/act/0.4/payload.js +1 -1
  47. package/dist/rooms/keys/act/0.5/payload.d.ts +4 -4
  48. package/dist/rooms/keys/act/0.5/payload.js +1 -1
  49. package/dist/rooms/keys/act/0.6/payload.d.ts +4 -4
  50. package/dist/rooms/keys/act/0.6/payload.js +1 -1
  51. package/dist/rooms/keys/act/0.7/payload.d.ts +4 -4
  52. package/dist/rooms/keys/act/0.7/payload.js +1 -1
  53. package/dist/rooms/keys/act/0.8/payload.d.ts +4 -4
  54. package/dist/rooms/keys/act/0.8/payload.js +1 -1
  55. package/dist/rooms/keys/act/0.9/payload.d.ts +4 -4
  56. package/dist/rooms/keys/act/0.9/payload.js +1 -1
  57. package/dist/rooms/keys/browse/0.1/payload.d.ts +4 -4
  58. package/dist/rooms/keys/browse/0.1/payload.js +1 -1
  59. package/dist/rooms/keys/browse/0.2/payload.d.ts +4 -4
  60. package/dist/rooms/keys/browse/0.2/payload.js +1 -1
  61. package/dist/rooms/keys/browse/0.3/payload.d.ts +14 -2
  62. package/dist/rooms/keys/browse/0.3/payload.d.ts.map +1 -1
  63. package/dist/rooms/keys/browse/0.3/payload.js +1 -1
  64. package/dist/rooms/keys/browse/0.3/payload.js.map +1 -1
  65. package/dist/rooms/keys/browse/0.4/payload.d.ts +1127 -0
  66. package/dist/rooms/keys/browse/0.4/payload.d.ts.map +1 -0
  67. package/dist/rooms/keys/browse/0.4/payload.js +658 -0
  68. package/dist/rooms/keys/browse/0.4/payload.js.map +1 -0
  69. package/dist/rooms/keys/changed/0.1/payload.d.ts +173 -0
  70. package/dist/rooms/keys/changed/0.1/payload.d.ts.map +1 -0
  71. package/dist/rooms/keys/changed/0.1/payload.js +99 -0
  72. package/dist/rooms/keys/changed/0.1/payload.js.map +1 -0
  73. package/dist/rooms/keys/profile/read/0.1/payload.d.ts +56 -4
  74. package/dist/rooms/keys/profile/read/0.1/payload.d.ts.map +1 -1
  75. package/dist/rooms/keys/profile/read/0.1/payload.js +28 -2
  76. package/dist/rooms/keys/profile/read/0.1/payload.js.map +1 -1
  77. package/dist/rooms/keys/profile/write/0.1/payload.d.ts +56 -4
  78. package/dist/rooms/keys/profile/write/0.1/payload.d.ts.map +1 -1
  79. package/dist/rooms/keys/profile/write/0.1/payload.js +28 -2
  80. package/dist/rooms/keys/profile/write/0.1/payload.js.map +1 -1
  81. package/dist/rooms/keys/read/0.1/payload.d.ts +14 -2
  82. package/dist/rooms/keys/read/0.1/payload.d.ts.map +1 -1
  83. package/dist/rooms/keys/read/0.1/payload.js +1 -1
  84. package/dist/rooms/keys/read/0.1/payload.js.map +1 -1
  85. package/dist/rooms/keys/read/0.2/payload.d.ts +1287 -0
  86. package/dist/rooms/keys/read/0.2/payload.d.ts.map +1 -0
  87. package/dist/rooms/keys/read/0.2/payload.js +689 -0
  88. package/dist/rooms/keys/read/0.2/payload.js.map +1 -0
  89. package/dist/rooms/keys/seal/0.1/payload.d.ts +4 -4
  90. package/dist/rooms/keys/seal/0.1/payload.js +1 -1
  91. package/dist/rooms/keys/seal/0.2/payload.d.ts +13 -2
  92. package/dist/rooms/keys/seal/0.2/payload.d.ts.map +1 -1
  93. package/dist/rooms/keys/seal/0.2/payload.js +1 -1
  94. package/dist/rooms/keys/seal/0.2/payload.js.map +1 -1
  95. package/dist/rooms/keys/seal/0.3/payload.d.ts +402 -0
  96. package/dist/rooms/keys/seal/0.3/payload.d.ts.map +1 -0
  97. package/dist/rooms/keys/seal/0.3/payload.js +229 -0
  98. package/dist/rooms/keys/seal/0.3/payload.js.map +1 -0
  99. package/dist/rooms/keys/watch/0.1/payload.d.ts +652 -0
  100. package/dist/rooms/keys/watch/0.1/payload.d.ts.map +1 -0
  101. package/dist/rooms/keys/watch/0.1/payload.js +343 -0
  102. package/dist/rooms/keys/watch/0.1/payload.js.map +1 -0
  103. package/dist/rooms/records/get/0.1/payload.d.ts +4 -4
  104. package/dist/rooms/records/get/0.1/payload.js +1 -1
  105. package/dist/rooms/records/get/0.2/payload.d.ts +13 -2
  106. package/dist/rooms/records/get/0.2/payload.d.ts.map +1 -1
  107. package/dist/rooms/records/get/0.2/payload.js +1 -1
  108. package/dist/rooms/records/get/0.2/payload.js.map +1 -1
  109. package/dist/rooms/records/get/0.3/payload.d.ts +1064 -0
  110. package/dist/rooms/records/get/0.3/payload.d.ts.map +1 -0
  111. package/dist/rooms/records/get/0.3/payload.js +571 -0
  112. package/dist/rooms/records/get/0.3/payload.js.map +1 -0
  113. package/dist/rooms/records/list/0.1/payload.d.ts +4 -4
  114. package/dist/rooms/records/list/0.1/payload.js +1 -1
  115. package/dist/rooms/records/list/0.2/payload.d.ts +4 -4
  116. package/dist/rooms/records/list/0.2/payload.js +1 -1
  117. package/dist/rooms/records/list/0.3/payload.d.ts +4 -4
  118. package/dist/rooms/records/list/0.3/payload.js +1 -1
  119. package/dist/rooms/records/list/0.4/payload.d.ts +4 -4
  120. package/dist/rooms/records/list/0.4/payload.js +1 -1
  121. package/dist/rooms/records/list/0.5/payload.d.ts +13 -2
  122. package/dist/rooms/records/list/0.5/payload.d.ts.map +1 -1
  123. package/dist/rooms/records/list/0.5/payload.js +1 -1
  124. package/dist/rooms/records/list/0.5/payload.js.map +1 -1
  125. package/dist/rooms/records/list/0.6/payload.d.ts +1096 -0
  126. package/dist/rooms/records/list/0.6/payload.d.ts.map +1 -0
  127. package/dist/rooms/records/list/0.6/payload.js +596 -0
  128. package/dist/rooms/records/list/0.6/payload.js.map +1 -0
  129. package/dist/rooms/records/put/0.1/payload.d.ts +4 -4
  130. package/dist/rooms/records/put/0.1/payload.js +1 -1
  131. package/dist/rooms/records/put/0.2/payload.d.ts +4 -4
  132. package/dist/rooms/records/put/0.2/payload.js +1 -1
  133. package/dist/rooms/records/put/0.3/payload.d.ts +4 -4
  134. package/dist/rooms/records/put/0.3/payload.js +1 -1
  135. package/dist/rooms/records/put/0.4/payload.d.ts +146 -6
  136. package/dist/rooms/records/put/0.4/payload.d.ts.map +1 -1
  137. package/dist/rooms/records/put/0.4/payload.js +81 -3
  138. package/dist/rooms/records/put/0.4/payload.js.map +1 -1
  139. package/dist/rooms/records/put/0.5/payload.d.ts +1808 -0
  140. package/dist/rooms/records/put/0.5/payload.d.ts.map +1 -0
  141. package/dist/rooms/records/put/0.5/payload.js +984 -0
  142. package/dist/rooms/records/put/0.5/payload.js.map +1 -0
  143. package/dist/rooms/watch/0.1/payload.d.ts +497 -0
  144. package/dist/rooms/watch/0.1/payload.d.ts.map +1 -0
  145. package/dist/rooms/watch/0.1/payload.js +268 -0
  146. package/dist/rooms/watch/0.1/payload.js.map +1 -0
  147. package/dist/vtc/_shared/0.7/network-membership.d.ts +16 -0
  148. package/dist/vtc/_shared/0.7/network-membership.d.ts.map +1 -0
  149. package/dist/vtc/_shared/0.7/network-membership.js +6 -0
  150. package/dist/vtc/_shared/0.7/network-membership.js.map +1 -0
  151. package/dist/vtc/boards/delete/0.1/payload.d.ts +416 -0
  152. package/dist/vtc/boards/delete/0.1/payload.d.ts.map +1 -0
  153. package/dist/vtc/boards/delete/0.1/payload.js +236 -0
  154. package/dist/vtc/boards/delete/0.1/payload.js.map +1 -0
  155. package/dist/vtc/boards/update/0.1/payload.d.ts +147 -2
  156. package/dist/vtc/boards/update/0.1/payload.d.ts.map +1 -1
  157. package/dist/vtc/boards/update/0.1/payload.js +72 -0
  158. package/dist/vtc/boards/update/0.1/payload.js.map +1 -1
  159. package/dist/vtc/elections/list/0.5/payload.d.ts +3 -3
  160. package/dist/vtc/elections/list/0.5/payload.js +1 -1
  161. package/dist/vtc/elections/list/0.5/payload.js.map +1 -1
  162. package/dist/vtc/elections/show/0.6/payload.d.ts +3 -3
  163. package/dist/vtc/elections/show/0.6/payload.js +1 -1
  164. package/dist/vtc/elections/show/0.6/payload.js.map +1 -1
  165. package/dist/vtc/elections/tombstones/show/0.1/payload.d.ts +593 -0
  166. package/dist/vtc/elections/tombstones/show/0.1/payload.d.ts.map +1 -0
  167. package/dist/vtc/elections/tombstones/show/0.1/payload.js +335 -0
  168. package/dist/vtc/elections/tombstones/show/0.1/payload.js.map +1 -0
  169. package/dist/vtc/networks/deliver/0.1/payload.d.ts +354 -0
  170. package/dist/vtc/networks/deliver/0.1/payload.d.ts.map +1 -0
  171. package/dist/vtc/networks/deliver/0.1/payload.js +213 -0
  172. package/dist/vtc/networks/deliver/0.1/payload.js.map +1 -0
  173. package/dist/vtc/networks/evidence/0.1/payload.d.ts +14 -2
  174. package/dist/vtc/networks/evidence/0.1/payload.d.ts.map +1 -1
  175. package/dist/vtc/networks/evidence/0.1/payload.js +1 -1
  176. package/dist/vtc/networks/evidence/0.1/payload.js.map +1 -1
  177. package/dist/vtc/networks/evidence/0.2/payload.d.ts +412 -0
  178. package/dist/vtc/networks/evidence/0.2/payload.d.ts.map +1 -0
  179. package/dist/vtc/networks/evidence/0.2/payload.js +233 -0
  180. package/dist/vtc/networks/evidence/0.2/payload.js.map +1 -0
  181. package/dist/vtc/networks/groups/register/0.1/payload.d.ts +14 -2
  182. package/dist/vtc/networks/groups/register/0.1/payload.d.ts.map +1 -1
  183. package/dist/vtc/networks/groups/register/0.1/payload.js +1 -1
  184. package/dist/vtc/networks/groups/register/0.1/payload.js.map +1 -1
  185. package/dist/vtc/networks/groups/register/0.2/payload.d.ts +680 -0
  186. package/dist/vtc/networks/groups/register/0.2/payload.d.ts.map +1 -0
  187. package/dist/vtc/networks/groups/register/0.2/payload.js +401 -0
  188. package/dist/vtc/networks/groups/register/0.2/payload.js.map +1 -0
  189. package/dist/vtc/networks/join/0.1/payload.d.ts +14 -2
  190. package/dist/vtc/networks/join/0.1/payload.d.ts.map +1 -1
  191. package/dist/vtc/networks/join/0.1/payload.js +1 -1
  192. package/dist/vtc/networks/join/0.1/payload.js.map +1 -1
  193. package/dist/vtc/networks/join/0.2/payload.d.ts +760 -0
  194. package/dist/vtc/networks/join/0.2/payload.d.ts.map +1 -0
  195. package/dist/vtc/networks/join/0.2/payload.js +445 -0
  196. package/dist/vtc/networks/join/0.2/payload.js.map +1 -0
  197. package/dist/vtc/networks/leave/0.1/payload.d.ts +14 -2
  198. package/dist/vtc/networks/leave/0.1/payload.d.ts.map +1 -1
  199. package/dist/vtc/networks/leave/0.1/payload.js +1 -1
  200. package/dist/vtc/networks/leave/0.1/payload.js.map +1 -1
  201. package/dist/vtc/networks/leave/0.2/payload.d.ts +664 -0
  202. package/dist/vtc/networks/leave/0.2/payload.d.ts.map +1 -0
  203. package/dist/vtc/networks/leave/0.2/payload.js +393 -0
  204. package/dist/vtc/networks/leave/0.2/payload.js.map +1 -0
  205. package/dist/vtc/networks/list/0.1/payload.d.ts +14 -2
  206. package/dist/vtc/networks/list/0.1/payload.d.ts.map +1 -1
  207. package/dist/vtc/networks/list/0.1/payload.js +1 -1
  208. package/dist/vtc/networks/list/0.1/payload.js.map +1 -1
  209. package/dist/vtc/networks/list/0.2/payload.d.ts +713 -0
  210. package/dist/vtc/networks/list/0.2/payload.d.ts.map +1 -0
  211. package/dist/vtc/networks/list/0.2/payload.js +417 -0
  212. package/dist/vtc/networks/list/0.2/payload.js.map +1 -0
  213. package/dist/vtc/networks/repudiate/0.1/payload.d.ts +14 -2
  214. package/dist/vtc/networks/repudiate/0.1/payload.d.ts.map +1 -1
  215. package/dist/vtc/networks/repudiate/0.1/payload.js +1 -1
  216. package/dist/vtc/networks/repudiate/0.1/payload.js.map +1 -1
  217. package/dist/vtc/networks/repudiate/0.2/payload.d.ts +680 -0
  218. package/dist/vtc/networks/repudiate/0.2/payload.d.ts.map +1 -0
  219. package/dist/vtc/networks/repudiate/0.2/payload.js +400 -0
  220. package/dist/vtc/networks/repudiate/0.2/payload.js.map +1 -0
  221. package/dist/vtc/networks/show/0.1/payload.d.ts +14 -2
  222. package/dist/vtc/networks/show/0.1/payload.d.ts.map +1 -1
  223. package/dist/vtc/networks/show/0.1/payload.js +1 -1
  224. package/dist/vtc/networks/show/0.1/payload.js.map +1 -1
  225. package/dist/vtc/networks/show/0.2/payload.d.ts +650 -0
  226. package/dist/vtc/networks/show/0.2/payload.d.ts.map +1 -0
  227. package/dist/vtc/networks/show/0.2/payload.js +388 -0
  228. package/dist/vtc/networks/show/0.2/payload.js.map +1 -0
  229. package/package.json +1 -1
  230. package/src/_extends.ts +5 -0
  231. package/src/_shared/components.ts +352 -1
  232. package/src/did-management/stats/set-resolution/0.1/payload.ts +312 -0
  233. package/src/index.ts +75 -0
  234. package/src/rooms/_shared/0.1/room.ts +1 -1
  235. package/src/rooms/_shared/0.2/room.ts +1 -1
  236. package/src/rooms/_shared/0.3/member-profile.ts +11 -0
  237. package/src/rooms/changed/0.1/payload.ts +115 -0
  238. package/src/rooms/keys/act/0.1/payload.ts +5 -5
  239. package/src/rooms/keys/act/0.10/payload.ts +15 -3
  240. package/src/rooms/keys/act/0.11/payload.ts +408 -0
  241. package/src/rooms/keys/act/0.12/payload.ts +396 -0
  242. package/src/rooms/keys/act/0.2/payload.ts +5 -5
  243. package/src/rooms/keys/act/0.3/payload.ts +5 -5
  244. package/src/rooms/keys/act/0.4/payload.ts +5 -5
  245. package/src/rooms/keys/act/0.5/payload.ts +5 -5
  246. package/src/rooms/keys/act/0.6/payload.ts +5 -5
  247. package/src/rooms/keys/act/0.7/payload.ts +5 -5
  248. package/src/rooms/keys/act/0.8/payload.ts +5 -5
  249. package/src/rooms/keys/act/0.9/payload.ts +5 -5
  250. package/src/rooms/keys/browse/0.1/payload.ts +5 -5
  251. package/src/rooms/keys/browse/0.2/payload.ts +5 -5
  252. package/src/rooms/keys/browse/0.3/payload.ts +15 -3
  253. package/src/rooms/keys/browse/0.4/payload.ts +730 -0
  254. package/src/rooms/keys/changed/0.1/payload.ts +138 -0
  255. package/src/rooms/keys/profile/read/0.1/payload.ts +28 -2
  256. package/src/rooms/keys/profile/write/0.1/payload.ts +28 -2
  257. package/src/rooms/keys/read/0.1/payload.ts +15 -3
  258. package/src/rooms/keys/read/0.2/payload.ts +855 -0
  259. package/src/rooms/keys/seal/0.1/payload.ts +5 -5
  260. package/src/rooms/keys/seal/0.2/payload.ts +14 -3
  261. package/src/rooms/keys/seal/0.3/payload.ts +282 -0
  262. package/src/rooms/keys/watch/0.1/payload.ts +452 -0
  263. package/src/rooms/records/get/0.1/payload.ts +5 -5
  264. package/src/rooms/records/get/0.2/payload.ts +14 -3
  265. package/src/rooms/records/get/0.3/payload.ts +684 -0
  266. package/src/rooms/records/list/0.1/payload.ts +5 -5
  267. package/src/rooms/records/list/0.2/payload.ts +5 -5
  268. package/src/rooms/records/list/0.3/payload.ts +5 -5
  269. package/src/rooms/records/list/0.4/payload.ts +5 -5
  270. package/src/rooms/records/list/0.5/payload.ts +14 -3
  271. package/src/rooms/records/list/0.6/payload.ts +673 -0
  272. package/src/rooms/records/put/0.1/payload.ts +5 -5
  273. package/src/rooms/records/put/0.2/payload.ts +5 -5
  274. package/src/rooms/records/put/0.3/payload.ts +5 -5
  275. package/src/rooms/records/put/0.4/payload.ts +95 -5
  276. package/src/rooms/records/put/0.5/payload.ts +1095 -0
  277. package/src/rooms/watch/0.1/payload.ts +340 -0
  278. package/src/vtc/_shared/0.7/network-membership.ts +17 -0
  279. package/src/vtc/boards/delete/0.1/payload.ts +293 -0
  280. package/src/vtc/boards/update/0.1/payload.ts +91 -2
  281. package/src/vtc/elections/list/0.5/payload.ts +2 -2
  282. package/src/vtc/elections/show/0.6/payload.ts +2 -2
  283. package/src/vtc/elections/tombstones/show/0.1/payload.ts +401 -0
  284. package/src/vtc/networks/deliver/0.1/payload.ts +254 -0
  285. package/src/vtc/networks/evidence/0.1/payload.ts +15 -3
  286. package/src/vtc/networks/evidence/0.2/payload.ts +290 -0
  287. package/src/vtc/networks/groups/register/0.1/payload.ts +15 -3
  288. package/src/vtc/networks/groups/register/0.2/payload.ts +446 -0
  289. package/src/vtc/networks/join/0.1/payload.ts +15 -3
  290. package/src/vtc/networks/join/0.2/payload.ts +492 -0
  291. package/src/vtc/networks/leave/0.1/payload.ts +15 -3
  292. package/src/vtc/networks/leave/0.2/payload.ts +434 -0
  293. package/src/vtc/networks/list/0.1/payload.ts +15 -3
  294. package/src/vtc/networks/list/0.2/payload.ts +463 -0
  295. package/src/vtc/networks/repudiate/0.1/payload.ts +15 -3
  296. package/src/vtc/networks/repudiate/0.2/payload.ts +445 -0
  297. package/src/vtc/networks/show/0.1/payload.ts +15 -3
  298. package/src/vtc/networks/show/0.2/payload.ts +425 -0
@@ -0,0 +1,984 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/records/put/0.5/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/records/put/0.5";
7
+ /**
8
+ * The earlier version of this specification that this one declares it
9
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
10
+ * `null`. Only the direct declaration — follow the chain with
11
+ * `extendsChain` / `readForSpec`.
12
+ */
13
+ export const EXTENDS = "0.4";
14
+ /**
15
+ * Why this version is deprecated, or `null` while it is current. A
16
+ * superseded or retired version is still supported, and is withdrawn from
17
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
18
+ * Versions").
19
+ */
20
+ export const DEPRECATION = null;
21
+ /** Trust Task response type URI (request type URI + "#response"). */
22
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/records/put/0.5#response";
23
+ /**
24
+ * This specification's payload schema, as a value.
25
+ *
26
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
27
+ * rather than only as a `.json` file because TypeScript types are erased
28
+ * at runtime: without a schema a consumer has nothing to validate, and
29
+ * every REQUIRED payload member is optional in practice. Cross-file
30
+ * `$ref`s are already inlined, so it needs no resolver.
31
+ */
32
+ export const PAYLOAD_SCHEMA = {
33
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
34
+ "$id": "https://trusttasks.org/spec/rooms/records/put/0.5",
35
+ "title": "Rooms Records Put — payload",
36
+ "description": "A member writes a record to a data room, authorized by an authority chain the room itself issued. 0.2 added `blobs`: a record can carry a file, whose ciphertext the host stores outside the record and whose description is sealed inside it. 0.3 lets an `open` room's `cleartext` carry the record's provenance — `basis`, `confidence`, `evidence`, `validFor` — and its `validUntil`, which the sealed tiers carry inside the signed `SealedRecordBody`. 0.4 lets an `open` room's record carry a file: its `FileManifest`, with the file key it was sealed under, in `cleartext.file`. 0.5 lets an `open` room's `cleartext` say what the record is to a reader and what it answers and when it was written — `kind`, `inReplyTo` and `writtenAt` — which the sealed tiers carry inside the signed `SealedRecordBody`.",
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": [
40
+ "roomId",
41
+ "key",
42
+ "presentation"
43
+ ],
44
+ "properties": {
45
+ "roomId": {
46
+ "type": "string",
47
+ "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."
48
+ },
49
+ "key": {
50
+ "type": "string",
51
+ "maxLength": 512,
52
+ "description": "The record's key within the room. MUST be opaque on an `attributed` or `private` room; see RecordMetadata.key."
53
+ },
54
+ "presentation": {
55
+ "$ref": "#/$defs/AuthorityPresentation",
56
+ "description": "Must confer the `write` action at this room's scope."
57
+ },
58
+ "expectedVersion": {
59
+ "type": "integer",
60
+ "minimum": 0,
61
+ "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."
62
+ },
63
+ "sealed": {
64
+ "$ref": "#/$defs/SealedRecord",
65
+ "description": "REQUIRED on an `attributed` or `private` room. Mutually exclusive with `cleartext`."
66
+ },
67
+ "cleartext": {
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "required": [
71
+ "body"
72
+ ],
73
+ "description": "REQUIRED on an `open` room, where the host reads records and can therefore search them. Mutually exclusive with `sealed`. On this tier the record is not signed by its author: every member here is the writer's claim as the host stores it, provenance and expiry included.",
74
+ "properties": {
75
+ "title": {
76
+ "type": "string",
77
+ "maxLength": 512
78
+ },
79
+ "description": {
80
+ "type": "string",
81
+ "maxLength": 2048
82
+ },
83
+ "body": {
84
+ "type": "string",
85
+ "maxLength": 1048576,
86
+ "description": "The record's text: plain text on a `message`, which a reader MUST NOT render as markup; the value on a `reaction`; markdown on a note and on a kind the reader does not know (`SealedRecordBody`, *What `body` is*). An empty `body` on a new version of a `message` or `reaction`, written by its author, withdraws it."
87
+ },
88
+ "tags": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "string",
92
+ "maxLength": 64
93
+ },
94
+ "maxItems": 32
95
+ },
96
+ "kind": {
97
+ "$ref": "#/$defs/RecordKind"
98
+ },
99
+ "inReplyTo": {
100
+ "$ref": "#/$defs/RecordReference",
101
+ "description": "The record this one answers or, on a `reaction`, responds to. Stored and served as received; the host does not check that it names a record it holds."
102
+ },
103
+ "writtenAt": {
104
+ "$ref": "#/$defs/RecordWrittenAt"
105
+ },
106
+ "editedAt": {
107
+ "$ref": "#/$defs/RecordEditedAt"
108
+ },
109
+ "basis": {
110
+ "$ref": "#/$defs/RecordBasis",
111
+ "description": "What kind of claim the record is. A writer SHOULD set it; an agent writer that does not know SHOULD write `inferred`. Provenance for display and weighting, never authority."
112
+ },
113
+ "confidence": {
114
+ "$ref": "#/$defs/RecordConfidence"
115
+ },
116
+ "evidence": {
117
+ "$ref": "#/$defs/RecordEvidenceList"
118
+ },
119
+ "validFor": {
120
+ "$ref": "#/$defs/PermittedUse"
121
+ },
122
+ "validUntil": {
123
+ "$ref": "#/$defs/RecordValidUntil",
124
+ "description": "When the writer stops standing behind the record as current. Readers hide the record once it has passed and show it only on explicit request. A host stores and serves it like any other cleartext member and MUST NOT act on it: it neither hides, refuses nor deletes an expired record."
125
+ },
126
+ "file": {
127
+ "$ref": "#/$defs/FileManifest",
128
+ "description": "Present when the record carries a file. Its `fileKey` MUST be present — an open room has no storage key to derive one from — and its `blobRef` MUST be the one the record names in `blobs`. The host reads it, like every other member here."
129
+ }
130
+ }
131
+ },
132
+ "blobs": {
133
+ "type": "array",
134
+ "minItems": 1,
135
+ "maxItems": 1,
136
+ "uniqueItems": true,
137
+ "items": {
138
+ "$ref": "#/$defs/BlobRef"
139
+ },
140
+ "description": "The blobs this record keeps alive: today at most one, the file the record carries. Cleartext on every tier, because the host must know which blobs a record references to refuse a record naming a blob it does not hold, to count usage, and to collect a blob no record names. Every blob named MUST have been committed in THIS room (rooms/blobs/upload/commit). An array so that several files per record is a later minor version rather than a reshaped member. Omit for a record with no file; a rewrite that omits it releases whatever blob the previous version named. On an `open` room the host also checks it against `cleartext.file`, which it can read: exactly that file's `blobRef` when `file` is present, and absent otherwise."
141
+ },
142
+ "ext": {
143
+ "$ref": "#/$defs/Ext",
144
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
145
+ }
146
+ },
147
+ "$defs": {
148
+ "Response": {
149
+ "$anchor": "response",
150
+ "title": "Rooms Records Put — response payload",
151
+ "description": "Success response to rooms/records/put. Type https://trusttasks.org/spec/rooms/records/put/0.3#response.",
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": [
155
+ "key",
156
+ "version"
157
+ ],
158
+ "properties": {
159
+ "key": {
160
+ "type": "string",
161
+ "maxLength": 512,
162
+ "description": "The stored record's key."
163
+ },
164
+ "version": {
165
+ "type": "integer",
166
+ "minimum": 1,
167
+ "description": "The version assigned, monotonic per room."
168
+ },
169
+ "epoch": {
170
+ "type": "integer",
171
+ "minimum": 1,
172
+ "description": "The epoch the record was stored under."
173
+ },
174
+ "ext": {
175
+ "$ref": "#/$defs/Ext"
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
+ "BlobRef": {
190
+ "title": "BlobRef",
191
+ "description": "The name of one blob: the digest of its BlobManifest, taken over the manifest's RFC 8785 (JCS) canonicalization. sha2-256 is RECOMMENDED and MUST be implemented. Content addressing over ciphertext, never plaintext, so a BlobRef says nothing about what the file contains, and two uploads of one file have different BlobRefs (a fresh `fileId` gives a different key, and so different ciphertext). Rooms cannot be correlated by the files they share. Compared as decoded multihash bytes, never as encoded strings. A BlobRef is defined over the manifest's JSON, as this schema states it and RFC 8785 canonicalizes it, never over any binding's generated type: two bindings that model the manifest as distinct types still compute the same BlobRef from the same JSON.",
192
+ "$ref": "#/$defs/DigestMultibase"
193
+ },
194
+ "DigestMultibase": {
195
+ "title": "DigestMultibase",
196
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
197
+ "type": "string",
198
+ "minLength": 16,
199
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
200
+ "examples": [
201
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
202
+ ]
203
+ },
204
+ "FileManifest": {
205
+ "title": "FileManifest",
206
+ "type": "object",
207
+ "additionalProperties": false,
208
+ "required": [
209
+ "fileId",
210
+ "name",
211
+ "size",
212
+ "digest",
213
+ "epoch",
214
+ "segmentSize",
215
+ "blobRef"
216
+ ],
217
+ "description": "Everything that describes a file. On an `attributed` or `private` room it is the `file` member of the sealed record body: sealed with the record, signed by the record's author, and never seen by the host. On an `open` room it is the `file` member of the record's `cleartext` (rooms/records/put/0.4), carrying its own `fileKey`, and the host reads it like the rest of the record. Defined here so that clients interoperate.\n\n**Byte encodings.** In every derivation below, `fileId` is its **32 decoded bytes**, never its base64url text; `roomId` is the **UTF-8 bytes** of the room identifier exactly as it appears on the wire; string constants are their ASCII bytes; `u8`, `u32be` and `u64be` are unsigned integers of that width, big-endian. Epochs are unsigned 64-bit on the wire. An implementation that holds epochs in a narrower type **MUST** refuse a value it cannot represent with `malformedRequest` (or, reading a manifest, refuse the file), and **MUST NOT** truncate it.\n\n**The file key.** `file_key = HKDF-SHA256(ikm = storage_key(epoch), salt = fileId, info = \"openvtc/room/file/v1\" || roomId || u64be(epoch))`, where `storage_key(epoch)` is the room's per-epoch storage key, the one records are sealed under. It is derived per file and never stored. It is bound to the room and the epoch, so a key released for one room cannot open a blob relocated from another, and releasing it exposes one file and nothing else.\n\n**The file key on an `open` room.** An open room has no group and so no storage key to derive from. There the uploader mints the file key itself — 32 bytes from a cryptographically secure random source, for this file only — and carries it in `fileKey`; a reader uses that key and derives nothing. Everything else below (padding, STREAM, the associated data, reading) is the same on every tier, with `epoch` the room's epoch when the file was written. `fileKey` **MUST** be present in an open room's manifest and **MUST** be absent from a sealed record body's, where the key is derived; a reader **MUST** refuse a file whose manifest breaks either rule. The key in the clear withholds nothing from the host or from anyone it serves the record to — the open tier withholds nothing from them — but it keeps the stored blob opaque to whoever holds only the storage, and keeps one blob format, and one reader, for every tier.\n\n**Padding.** With `padding: \"padme\"`, the plaintext of length `L = size` is extended with zero bytes to `padme(L)`: for `L < 2`, `padme(L) = L`; otherwise `E = floor(log2 L)`, `S = floor(log2 E) + 1`, `z = E − S`, `mask = 2^z − 1`, and `padme(L) = (L + mask) & ~mask`. The padded length is `padme(size)`; without padding it is `size`. Padding bytes **MUST** be zero.\n\n**The STREAM construction.** The padded plaintext is cut into `segmentSize`-byte segments, the last holding the remainder; an empty plaintext is one empty final segment. Segment `i` is sealed with ChaCha20-Poly1305 under `file_key`, with nonce `u32be(0) || u64be(i)` and associated data `\"openvtc/room/file/v1\" || roomId || fileId || u64be(epoch) || u64be(i) || u8(final)`, where `final` is 1 on the last segment and 0 on every other. A host that truncates, reorders or splices ciphertext produces an authentication failure, never a shorter or rearranged file. The nonces are counters, so a `file_key` MUST NOT seal two different files; a fresh random `fileId` is what guarantees it. Each sealed segment is one transfer chunk of the blob (BlobManifest), so `segmentSize + 16` is the blob's `chunks.chunkSize`, and an empty file is one 16-byte chunk.\n\n**Reading.** A reader opens the record, derives or obtains the file key, and **MUST**, before trusting a byte:\n- check that the blob's `chunks.chunkSize` equals `segmentSize + 16` and that `chunks.chunkCount` equals `max(1, ceil(paddedLength / segmentSize))`, and refuse the file otherwise;\n- decrypt every segment in order, refusing the file on any authentication failure or on a final flag anywhere but the last segment;\n- check that the decrypted length equals the padded length, that every padding byte is zero, and, after removing the padding, that the plaintext matches `digest`.\n\nA reader **MUST** refuse a file that fails any check, and **MUST NOT** present it with a warning instead. A reader that streams **MUST NOT** treat the plaintext as received — save it under its final name, render it, or hand it to another component — until the digest has verified; it writes to a temporary destination and discards that destination on a mismatch.\n\n**An image's size and preview.** `width`, `height` and `preview` are OPTIONAL and advisory: they let a reader lay out an image, and show something, before it fetches and decrypts the blob. A reader that fetches the file checks them against the bytes — the decoded image's dimensions, and that the file is an image at all — and on a mismatch uses the bytes and discards them; it MUST NOT treat any of them as evidence about the file. On `attributed` and `private` rooms they are inside the sealed, signed body like the rest of the manifest, so the host learns nothing from them; on an `open` room they are in the clear, as everything there is, and a writer carries them only with `rooms/records/put/0.5` or later. A writer uses them only once the room's profile lists them in `recordMembers` (`RoomProfile`), as with the other members a reader that predates them refuses.",
218
+ "properties": {
219
+ "fileId": {
220
+ "type": "string",
221
+ "pattern": "^[A-Za-z0-9_-]{43}$",
222
+ "description": "32 random bytes, base64url without padding, minted by the uploader for this file and never reused. The salt of the file key."
223
+ },
224
+ "name": {
225
+ "type": "string",
226
+ "minLength": 1,
227
+ "maxLength": 255,
228
+ "description": "The file's name as the uploader gave it. Sealed on `attributed` and `private` rooms, where the host never sees it; in the clear on `open` ones. Readers MUST treat it as untrusted text: strip path separators before using it as a local file name, and never interpret it as markup."
229
+ },
230
+ "mediaType": {
231
+ "type": "string",
232
+ "maxLength": 255,
233
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*$",
234
+ "description": "IANA media type, without parameters. Advisory: a reader decides how to render from the bytes and its own policy, never from this alone."
235
+ },
236
+ "size": {
237
+ "type": "integer",
238
+ "minimum": 0,
239
+ "description": "Plaintext bytes, before padding. The decrypted length is `padme(size)` with `padme` padding and `size` without."
240
+ },
241
+ "digest": {
242
+ "$ref": "#/$defs/DigestMultibase",
243
+ "description": "Digest of the plaintext bytes. On `attributed` and `private` rooms it is signed, with the rest of the record body, by the record's author, so a reader that verifies it knows which member put exactly these bytes there. On an `open` room it is the writer's claim as the host stores it, like the rest of the record."
244
+ },
245
+ "epoch": {
246
+ "type": "integer",
247
+ "minimum": 1,
248
+ "description": "The epoch whose storage key the file key derives from. Usually the record's own epoch; a record rewritten under a later epoch that keeps the same blob keeps the file's original epoch here. Unsigned 64-bit; see Byte encodings."
249
+ },
250
+ "segmentSize": {
251
+ "type": "integer",
252
+ "minimum": 16368,
253
+ "maximum": 262128,
254
+ "description": "Plaintext bytes per STREAM segment: the transfer chunk size less the 16-byte tag, so that one sealed segment is one chunk."
255
+ },
256
+ "padding": {
257
+ "type": "string",
258
+ "enum": [
259
+ "none",
260
+ "padme"
261
+ ],
262
+ "description": "Whether the plaintext was padded before sealing, so that ciphertext sizes do not fingerprint known documents. `padme`: zero bytes appended to reach `padme(size)`, the formula above. Absent means `none`. The padding is inside the final segments, and a reader checks it is zero and removes it by truncating to `size`."
263
+ },
264
+ "blobRef": {
265
+ "$ref": "#/$defs/BlobRef"
266
+ },
267
+ "fileKey": {
268
+ "type": "string",
269
+ "pattern": "^[A-Za-z0-9_-]{43}$",
270
+ "description": "The file key itself, 32 bytes base64url without padding: present on an `open` room only, where there is no storage key to derive it from. Minted by the uploader from a cryptographically secure random source for this one file and never reused. MUST be absent on `attributed` and `private` rooms, where the key is derived and never stored."
271
+ },
272
+ "width": {
273
+ "type": "integer",
274
+ "minimum": 1,
275
+ "maximum": 1048576,
276
+ "description": "The image's width in pixels, as the uploader read it. Advisory. A writer sets `width` and `height` together or neither; a reader ignores one without the other. A reader checks it against the decoded image."
277
+ },
278
+ "height": {
279
+ "type": "integer",
280
+ "minimum": 1,
281
+ "maximum": 1048576,
282
+ "description": "The image's height in pixels, as the uploader read it. Advisory. A writer sets `width` and `height` together or neither; a reader ignores one without the other. A reader checks it against the decoded image."
283
+ },
284
+ "preview": {
285
+ "type": "object",
286
+ "additionalProperties": false,
287
+ "required": [
288
+ "mediaType",
289
+ "data"
290
+ ],
291
+ "description": "A small image standing in for the file until it is fetched: at most 8192 bytes before encoding, enough for a blurred thumbnail and small enough not to swell the record every listing reader opens. A reader renders it only as a raster image it decodes itself — never as SVG or any other type that can carry active content, never as a link, never fetching anything — and replaces it with the file once fetched. It is the uploader's rendering of the file, not a digest of it: a reader MUST NOT present it as the file's contents.",
292
+ "properties": {
293
+ "mediaType": {
294
+ "type": "string",
295
+ "enum": [
296
+ "image/jpeg",
297
+ "image/png",
298
+ "image/webp"
299
+ ],
300
+ "description": "The preview's own media type. Raster types only."
301
+ },
302
+ "data": {
303
+ "type": "string",
304
+ "pattern": "^[A-Za-z0-9_-]+$",
305
+ "minLength": 1,
306
+ "maxLength": 10923,
307
+ "description": "The preview's bytes, base64url without padding: at most 8192 bytes decoded."
308
+ }
309
+ }
310
+ }
311
+ }
312
+ },
313
+ "RecordValidUntil": {
314
+ "title": "RecordValidUntil",
315
+ "type": "string",
316
+ "format": "date-time",
317
+ "description": "The instant after which the record's author no longer stands behind it as current. OPTIONAL; absent means the record does not expire. A reader hides a record whose `validUntil` has passed from default listings, search and recall, and shows it only on explicit request (`SealedRecordBody`, **Expiry**). No host enforces it."
318
+ },
319
+ "PermittedUse": {
320
+ "title": "PermittedUse",
321
+ "type": "object",
322
+ "additionalProperties": false,
323
+ "minProperties": 1,
324
+ "description": "What the author permits the record to be used for — for example, that a learner's record is for instructional personalisation only. OPTIONAL; absent means the author stated no limit beyond the room's own terms.\n\n**Two halves, because purpose has both a machine and a human reading.** `purposes` names purposes by IRI, so that an agent can match them without parsing prose; `note` says it in words, for the nuance an identifier cannot carry. Either may be given alone.\n\n**No vocabulary of this family's own.** Purpose vocabularies exist and are maintained elsewhere — the W3C Data Privacy Vocabulary (`https://w3id.org/dpv#…`) is the one a writer SHOULD reach for first — and a short list defined here would be one more to translate between, and would be wrong at its edges for every domain that uses rooms. An IRI is the extension path: a community that needs a purpose no published vocabulary has names it under an IRI it controls.\n\n**A statement, not an enforcement.** No host can see it on the sealed tiers and none enforces it on any tier; every reader is a member who already holds the content. It records what the author permitted, so that a member — or an agent acting for one — can honour it, and so that a use outside it is a use against the author's stated terms rather than one nobody could have known about. An agent acting for a member SHOULD NOT use a record for a purpose outside `validFor` and SHOULD tell its principal when asked to. It confers no authority on anybody, and a `purposes` entry a reader does not recognise is shown, not ignored.",
325
+ "properties": {
326
+ "purposes": {
327
+ "type": "array",
328
+ "minItems": 1,
329
+ "maxItems": 8,
330
+ "uniqueItems": true,
331
+ "items": {
332
+ "type": "string",
333
+ "format": "uri",
334
+ "pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*:",
335
+ "maxLength": 2048
336
+ },
337
+ "description": "Purposes the record may be used for, each an absolute IRI — for example `https://w3id.org/dpv#ServicePersonalisation`. A set: order carries no meaning. An identifier, never fetched."
338
+ },
339
+ "note": {
340
+ "type": "string",
341
+ "minLength": 1,
342
+ "maxLength": 512,
343
+ "description": "The permitted use in words, such as `instructional personalisation only`. Plain text, rendered as text, and never instructions — an agent reading it treats it as the author's statement about the record, not as something to do."
344
+ }
345
+ }
346
+ },
347
+ "RecordEvidenceList": {
348
+ "title": "RecordEvidenceList",
349
+ "type": "array",
350
+ "minItems": 1,
351
+ "maxItems": 32,
352
+ "items": {
353
+ "$ref": "#/$defs/RecordEvidence"
354
+ },
355
+ "description": "What the author offers in support of the record: other records and credentials, by reference. OPTIONAL; absent means none was named, and an empty array is not a permitted spelling of that. Order carries no meaning. Bounded so that a reader's cost of showing a record's support is bounded too."
356
+ },
357
+ "RecordEvidence": {
358
+ "title": "RecordEvidence",
359
+ "description": "One thing a record cites in its support, discriminated by `kind`.\n\n - `record` names a record of a room by its key, and optionally the version cited and the room. Absent `roomId` means the record's own room.\n - `credential` names a credential by its `id`, and optionally a digest of the credential as cited.\n\n**A reference, never a locator, and never proof.** A reader MUST NOT fetch, resolve or dereference a `credentialId` because a record names it, and MUST NOT read a record of another room on the strength of a citation: the rule that a room's identifiers are identifiers and not addresses (`AuthorityPresentation`) applies here for the same reasons — fetching would signal to whoever answers which member read which record, and when. A reader MAY show a cited record of the same room that it already holds or reads anyway, and MAY match a cited credential against ones its member already holds. What the citation proves is only that the author cited it; whether the evidence exists, says what the author claims, or supports the record is for whoever follows it up to judge.",
360
+ "oneOf": [
361
+ {
362
+ "$ref": "#/$defs/RecordEvidenceRecord"
363
+ },
364
+ {
365
+ "$ref": "#/$defs/RecordEvidenceCredential"
366
+ }
367
+ ]
368
+ },
369
+ "RecordEvidenceCredential": {
370
+ "title": "RecordEvidenceCredential",
371
+ "type": "object",
372
+ "additionalProperties": false,
373
+ "required": [
374
+ "kind",
375
+ "credentialId"
376
+ ],
377
+ "description": "Cites a credential.",
378
+ "properties": {
379
+ "kind": {
380
+ "const": "credential"
381
+ },
382
+ "credentialId": {
383
+ "type": "string",
384
+ "minLength": 1,
385
+ "maxLength": 2048,
386
+ "description": "The credential's `id`. An identifier: never fetched because a record names it."
387
+ },
388
+ "digest": {
389
+ "$ref": "#/$defs/DigestMultibase",
390
+ "description": "OPTIONAL. A digest of the credential as cited — the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, `proof` included — so a reader holding a credential with this `id` can tell whether it is the one the author meant."
391
+ }
392
+ }
393
+ },
394
+ "RecordEvidenceRecord": {
395
+ "title": "RecordEvidenceRecord",
396
+ "type": "object",
397
+ "additionalProperties": false,
398
+ "required": [
399
+ "kind",
400
+ "key"
401
+ ],
402
+ "description": "Cites a record of a room.",
403
+ "properties": {
404
+ "kind": {
405
+ "const": "record"
406
+ },
407
+ "key": {
408
+ "type": "string",
409
+ "minLength": 1,
410
+ "maxLength": 512,
411
+ "description": "The cited record's key, as in `rooms/records/put`. Opaque on the sealed tiers, like every key there."
412
+ },
413
+ "version": {
414
+ "type": "integer",
415
+ "minimum": 1,
416
+ "description": "The version cited. OPTIONAL; present, it pins the citation to what the record said then, since a record can be rewritten under the same key. A reader that shows a later version SHOULD say that it is not the one cited."
417
+ },
418
+ "roomId": {
419
+ "type": "string",
420
+ "pattern": "^did:",
421
+ "maxLength": 2048,
422
+ "description": "The cited record's room. Absent means the citing record's own room. A citation into another room tells the reader that room's identifier, so a writer SHOULD NOT cite into a room the citing room's readers are not meant to learn of."
423
+ }
424
+ }
425
+ },
426
+ "RecordConfidence": {
427
+ "title": "RecordConfidence",
428
+ "type": "number",
429
+ "minimum": 0,
430
+ "maximum": 1,
431
+ "description": "The author's own estimate, from 0 to 1, that what the record says is correct. OPTIONAL; absent means no estimate was given, never 1. Meaningful only beside the author who gave it: two writers' numbers are not on one scale, so a reader MUST NOT rank records by `confidence` across authors as though they were, and an agent that weights by it SHOULD weight within an author's own records. Never authority."
432
+ },
433
+ "RecordBasis": {
434
+ "title": "RecordBasis",
435
+ "type": "string",
436
+ "enum": [
437
+ "declared",
438
+ "observed",
439
+ "verified",
440
+ "inferred"
441
+ ],
442
+ "description": "What kind of claim a record is, as its author states it. OPTIONAL wherever it appears; absent means the author did not say, and a reader shows it as unstated rather than assuming any of these.\n\n - `declared` — the author's own statement: a decision, a preference, an intention, a commitment. True because the author says so, and only as far as the author speaks for it.\n - `observed` — something the author saw, measured or was told directly, recorded as found.\n - `verified` — checked against evidence that somebody else can check again, such as a credential or another record. A record that says `verified` SHOULD name that evidence in `evidence`; one that does not is an unsupported claim to have checked, and a reader SHOULD present it so.\n - `inferred` — derived by reasoning from other information: an agent's conclusion, a summary's generalisation, a model's guess. The value an agent writer uses when it does not know which of the others applies.\n\nThe values are the author's account of their own record, signed with it. They are not checked by anybody, confer nothing, and say nothing about whether the record is right — `inferred` can be correct and `observed` mistaken. Aligned with the provenance vocabulary of personal agent memory, so that a record moved between a member's memory and a room keeps its meaning."
443
+ },
444
+ "RecordEditedAt": {
445
+ "title": "RecordEditedAt",
446
+ "type": "string",
447
+ "format": "date-time",
448
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,9})?Z$",
449
+ "description": "The instant the author made the edit that produced this version, RFC 3339 in UTC (`Z`). Set by the writer of every version after the first, and absent on the first, so that a reader seeing a record for the first time can tell whether it was ever edited — which `version` cannot say, since curation moves it too. Signed with the body on the sealed tiers. A reader shows a record carrying it as edited, and treats an implausible one as `SealedRecordBody` (*Edits*) says. Governed by `RoomProfile.recordMembers` like `writtenAt`. No host enforces or reads it."
450
+ },
451
+ "RecordWrittenAt": {
452
+ "title": "RecordWrittenAt",
453
+ "type": "string",
454
+ "format": "date-time",
455
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,9})?Z$",
456
+ "description": "The instant the author wrote the record, RFC 3339 in UTC (`Z`). Set by the author and kept unchanged when the record is rewritten; an edit is marked by `editedAt`. OPTIONAL on a note; a `message` or `reaction` SHOULD carry it. The author's claim, not an attested time: a reader orders messages by it, compares it with the host's `createdAt`, and treats an implausible or backdated one as `SealedRecordBody` (*When it was written*) says. No host enforces or reads it."
457
+ },
458
+ "RecordReference": {
459
+ "title": "RecordReference",
460
+ "type": "object",
461
+ "additionalProperties": false,
462
+ "required": [
463
+ "key"
464
+ ],
465
+ "description": "Names another record of the same room: the record a reply answers or a reaction responds to. Never a record of another room — a citation that crosses rooms is `RecordEvidenceRecord`. A reader resolves it only against records it can already list or read in this room, and MUST NOT fetch anything else because of it. It MUST NOT name a record of kind `reaction`.",
466
+ "properties": {
467
+ "key": {
468
+ "type": "string",
469
+ "minLength": 1,
470
+ "maxLength": 512,
471
+ "description": "The record's key, as in `rooms/records/put`. Opaque on the sealed tiers, like every key there."
472
+ },
473
+ "version": {
474
+ "type": "integer",
475
+ "minimum": 1,
476
+ "description": "The version of the record the author was answering. OPTIONAL. A reader SHOULD say that the target has changed since only when its content has, never because its version moved: curation moves a record's version without touching its content (`SealedRecordBody`, *Whether the target has changed*)."
477
+ }
478
+ }
479
+ },
480
+ "RecordKind": {
481
+ "title": "RecordKind",
482
+ "type": "string",
483
+ "minLength": 1,
484
+ "maxLength": 64,
485
+ "pattern": "^[a-z][A-Za-z0-9]*$",
486
+ "description": "What a reader shows a record as. Defined values: `note` — something kept in the room's library, titled or not, its `body` markdown; `message` — a turn in the room's conversation, its words in `body` as plain text; `reaction` — a short response to another record, its value in `body` (`SealedRecordBody`, *Reactions*). An open set, not an enumeration, so a new kind needs no new version of any schema: a reader MUST present a record whose kind it does not know as a note, and MUST NOT refuse a record for its kind. Absent means `note`, though a reader that keeps a conversation apart MAY show an untitled record without a kind as a message (*Untitled records*). A new version of a record MUST keep its kind. lowerCamelCase, at most 64 characters."
487
+ },
488
+ "SealedRecord": {
489
+ "title": "SealedRecord",
490
+ "type": "object",
491
+ "additionalProperties": false,
492
+ "required": [
493
+ "ciphertext",
494
+ "nonce",
495
+ "epoch"
496
+ ],
497
+ "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.",
498
+ "properties": {
499
+ "ciphertext": {
500
+ "type": "string",
501
+ "description": "The sealed record, base64url. Bound by AEAD associated data to `roomId`, `key`, the version it was sealed at, 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. The version it was sealed at is `version` below where present, and the record's own `version` otherwise."
502
+ },
503
+ "nonce": {
504
+ "type": "string",
505
+ "description": "AEAD nonce, base64url."
506
+ },
507
+ "epoch": {
508
+ "type": "integer",
509
+ "minimum": 1,
510
+ "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."
511
+ },
512
+ "version": {
513
+ "type": "integer",
514
+ "minimum": 1,
515
+ "description": "The version this ciphertext was sealed at, where that is no longer the record's own `version`. A record's version moves when it is curated (`rooms/records/curate`, which MUST assign a new one so that every `sinceVersion` watermark sees the change), but a curation other than a retraction keeps the body — and the body is bound, by the AEAD and by its author's signature (`SealedRecordBody`), to the version it was written at. Without this member a curated record would be opened at a version it was never sealed for, and would not open for anyone.\n\nA host MUST record the version a body was sealed at when it stores it, MUST NOT change it while that body is kept — a curation alters a record's standing, never its sealed content — and MUST include it whenever it differs from the record's `version`. It is absent where the two are equal, which is every record that has not been curated since it was written, so the members a record carries are unchanged until a curation needs this one. It is part of `sealed`, and so of the record the data commitment covers (`CommittedRecord`): a host cannot change it without changing the root.\n\nA reader opens and verifies the body at this version, and MUST refuse a record whose `sealed.version` is greater than its own `version` — a body cannot have been sealed for a version the room had not reached. A host that pairs a newer version with an older body of the same key is rolling the record back; that is a change to the committed record like any other, visible to the comparisons `CommittedRecord` exists for."
516
+ }
517
+ }
518
+ },
519
+ "AuthorityPresentation": {
520
+ "title": "AuthorityPresentation",
521
+ "type": "object",
522
+ "additionalProperties": false,
523
+ "required": [
524
+ "membership",
525
+ "authority"
526
+ ],
527
+ "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. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.\n\n**Every credential is its issuer's attestation, and only its issuer's.** For the membership credential and for every link of `authority`, a host MUST verify the credential's `proof` with a key that the credential's own `issuer` lists for `assertionMethod` in its DID document, and MUST refuse a credential whose proof names a verification method that is not its issuer's. A proof that verifies under some other party's key is that party's statement, not the issuer's, and confers nothing. The same binding holds for every other document a room signs, such as a `RevocationList`.\n\n**A chain that verifies may still be revoked.** A host that has accepted a `RevocationList` for the room (`rooms/revocations/put`) MUST, from the moment it accepted it, refuse every presentation in which the membership credential or any link of `authority` is revoked by that list, under every task and every version of every task it serves for the room. A chain from which any link is revoked is refused whole: a credential delegated from a revoked one confers nothing, however it was attenuated. The refusal is the same `permissionDenied` as any other failed presentation.",
528
+ "properties": {
529
+ "membership": {
530
+ "type": "string",
531
+ "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."
532
+ },
533
+ "authority": {
534
+ "type": "array",
535
+ "minItems": 1,
536
+ "maxItems": 8,
537
+ "items": {
538
+ "type": "string"
539
+ },
540
+ "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."
541
+ },
542
+ "subjectBinding": {
543
+ "type": "string",
544
+ "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."
545
+ }
546
+ }
547
+ }
548
+ }
549
+ };
550
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
551
+ export const RESPONSE_PAYLOAD_SCHEMA = {
552
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
553
+ "$ref": "#/$defs/Response",
554
+ "$defs": {
555
+ "Response": {
556
+ "$anchor": "response",
557
+ "title": "Rooms Records Put — response payload",
558
+ "description": "Success response to rooms/records/put. Type https://trusttasks.org/spec/rooms/records/put/0.3#response.",
559
+ "type": "object",
560
+ "additionalProperties": false,
561
+ "required": [
562
+ "key",
563
+ "version"
564
+ ],
565
+ "properties": {
566
+ "key": {
567
+ "type": "string",
568
+ "maxLength": 512,
569
+ "description": "The stored record's key."
570
+ },
571
+ "version": {
572
+ "type": "integer",
573
+ "minimum": 1,
574
+ "description": "The version assigned, monotonic per room."
575
+ },
576
+ "epoch": {
577
+ "type": "integer",
578
+ "minimum": 1,
579
+ "description": "The epoch the record was stored under."
580
+ },
581
+ "ext": {
582
+ "$ref": "#/$defs/Ext"
583
+ }
584
+ }
585
+ },
586
+ "Ext": {
587
+ "title": "Ext",
588
+ "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.",
589
+ "type": "object",
590
+ "minProperties": 1,
591
+ "additionalProperties": true,
592
+ "propertyNames": {
593
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
594
+ }
595
+ },
596
+ "BlobRef": {
597
+ "title": "BlobRef",
598
+ "description": "The name of one blob: the digest of its BlobManifest, taken over the manifest's RFC 8785 (JCS) canonicalization. sha2-256 is RECOMMENDED and MUST be implemented. Content addressing over ciphertext, never plaintext, so a BlobRef says nothing about what the file contains, and two uploads of one file have different BlobRefs (a fresh `fileId` gives a different key, and so different ciphertext). Rooms cannot be correlated by the files they share. Compared as decoded multihash bytes, never as encoded strings. A BlobRef is defined over the manifest's JSON, as this schema states it and RFC 8785 canonicalizes it, never over any binding's generated type: two bindings that model the manifest as distinct types still compute the same BlobRef from the same JSON.",
599
+ "$ref": "#/$defs/DigestMultibase"
600
+ },
601
+ "DigestMultibase": {
602
+ "title": "DigestMultibase",
603
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
604
+ "type": "string",
605
+ "minLength": 16,
606
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
607
+ "examples": [
608
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
609
+ ]
610
+ },
611
+ "FileManifest": {
612
+ "title": "FileManifest",
613
+ "type": "object",
614
+ "additionalProperties": false,
615
+ "required": [
616
+ "fileId",
617
+ "name",
618
+ "size",
619
+ "digest",
620
+ "epoch",
621
+ "segmentSize",
622
+ "blobRef"
623
+ ],
624
+ "description": "Everything that describes a file. On an `attributed` or `private` room it is the `file` member of the sealed record body: sealed with the record, signed by the record's author, and never seen by the host. On an `open` room it is the `file` member of the record's `cleartext` (rooms/records/put/0.4), carrying its own `fileKey`, and the host reads it like the rest of the record. Defined here so that clients interoperate.\n\n**Byte encodings.** In every derivation below, `fileId` is its **32 decoded bytes**, never its base64url text; `roomId` is the **UTF-8 bytes** of the room identifier exactly as it appears on the wire; string constants are their ASCII bytes; `u8`, `u32be` and `u64be` are unsigned integers of that width, big-endian. Epochs are unsigned 64-bit on the wire. An implementation that holds epochs in a narrower type **MUST** refuse a value it cannot represent with `malformedRequest` (or, reading a manifest, refuse the file), and **MUST NOT** truncate it.\n\n**The file key.** `file_key = HKDF-SHA256(ikm = storage_key(epoch), salt = fileId, info = \"openvtc/room/file/v1\" || roomId || u64be(epoch))`, where `storage_key(epoch)` is the room's per-epoch storage key, the one records are sealed under. It is derived per file and never stored. It is bound to the room and the epoch, so a key released for one room cannot open a blob relocated from another, and releasing it exposes one file and nothing else.\n\n**The file key on an `open` room.** An open room has no group and so no storage key to derive from. There the uploader mints the file key itself — 32 bytes from a cryptographically secure random source, for this file only — and carries it in `fileKey`; a reader uses that key and derives nothing. Everything else below (padding, STREAM, the associated data, reading) is the same on every tier, with `epoch` the room's epoch when the file was written. `fileKey` **MUST** be present in an open room's manifest and **MUST** be absent from a sealed record body's, where the key is derived; a reader **MUST** refuse a file whose manifest breaks either rule. The key in the clear withholds nothing from the host or from anyone it serves the record to — the open tier withholds nothing from them — but it keeps the stored blob opaque to whoever holds only the storage, and keeps one blob format, and one reader, for every tier.\n\n**Padding.** With `padding: \"padme\"`, the plaintext of length `L = size` is extended with zero bytes to `padme(L)`: for `L < 2`, `padme(L) = L`; otherwise `E = floor(log2 L)`, `S = floor(log2 E) + 1`, `z = E − S`, `mask = 2^z − 1`, and `padme(L) = (L + mask) & ~mask`. The padded length is `padme(size)`; without padding it is `size`. Padding bytes **MUST** be zero.\n\n**The STREAM construction.** The padded plaintext is cut into `segmentSize`-byte segments, the last holding the remainder; an empty plaintext is one empty final segment. Segment `i` is sealed with ChaCha20-Poly1305 under `file_key`, with nonce `u32be(0) || u64be(i)` and associated data `\"openvtc/room/file/v1\" || roomId || fileId || u64be(epoch) || u64be(i) || u8(final)`, where `final` is 1 on the last segment and 0 on every other. A host that truncates, reorders or splices ciphertext produces an authentication failure, never a shorter or rearranged file. The nonces are counters, so a `file_key` MUST NOT seal two different files; a fresh random `fileId` is what guarantees it. Each sealed segment is one transfer chunk of the blob (BlobManifest), so `segmentSize + 16` is the blob's `chunks.chunkSize`, and an empty file is one 16-byte chunk.\n\n**Reading.** A reader opens the record, derives or obtains the file key, and **MUST**, before trusting a byte:\n- check that the blob's `chunks.chunkSize` equals `segmentSize + 16` and that `chunks.chunkCount` equals `max(1, ceil(paddedLength / segmentSize))`, and refuse the file otherwise;\n- decrypt every segment in order, refusing the file on any authentication failure or on a final flag anywhere but the last segment;\n- check that the decrypted length equals the padded length, that every padding byte is zero, and, after removing the padding, that the plaintext matches `digest`.\n\nA reader **MUST** refuse a file that fails any check, and **MUST NOT** present it with a warning instead. A reader that streams **MUST NOT** treat the plaintext as received — save it under its final name, render it, or hand it to another component — until the digest has verified; it writes to a temporary destination and discards that destination on a mismatch.\n\n**An image's size and preview.** `width`, `height` and `preview` are OPTIONAL and advisory: they let a reader lay out an image, and show something, before it fetches and decrypts the blob. A reader that fetches the file checks them against the bytes — the decoded image's dimensions, and that the file is an image at all — and on a mismatch uses the bytes and discards them; it MUST NOT treat any of them as evidence about the file. On `attributed` and `private` rooms they are inside the sealed, signed body like the rest of the manifest, so the host learns nothing from them; on an `open` room they are in the clear, as everything there is, and a writer carries them only with `rooms/records/put/0.5` or later. A writer uses them only once the room's profile lists them in `recordMembers` (`RoomProfile`), as with the other members a reader that predates them refuses.",
625
+ "properties": {
626
+ "fileId": {
627
+ "type": "string",
628
+ "pattern": "^[A-Za-z0-9_-]{43}$",
629
+ "description": "32 random bytes, base64url without padding, minted by the uploader for this file and never reused. The salt of the file key."
630
+ },
631
+ "name": {
632
+ "type": "string",
633
+ "minLength": 1,
634
+ "maxLength": 255,
635
+ "description": "The file's name as the uploader gave it. Sealed on `attributed` and `private` rooms, where the host never sees it; in the clear on `open` ones. Readers MUST treat it as untrusted text: strip path separators before using it as a local file name, and never interpret it as markup."
636
+ },
637
+ "mediaType": {
638
+ "type": "string",
639
+ "maxLength": 255,
640
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*$",
641
+ "description": "IANA media type, without parameters. Advisory: a reader decides how to render from the bytes and its own policy, never from this alone."
642
+ },
643
+ "size": {
644
+ "type": "integer",
645
+ "minimum": 0,
646
+ "description": "Plaintext bytes, before padding. The decrypted length is `padme(size)` with `padme` padding and `size` without."
647
+ },
648
+ "digest": {
649
+ "$ref": "#/$defs/DigestMultibase",
650
+ "description": "Digest of the plaintext bytes. On `attributed` and `private` rooms it is signed, with the rest of the record body, by the record's author, so a reader that verifies it knows which member put exactly these bytes there. On an `open` room it is the writer's claim as the host stores it, like the rest of the record."
651
+ },
652
+ "epoch": {
653
+ "type": "integer",
654
+ "minimum": 1,
655
+ "description": "The epoch whose storage key the file key derives from. Usually the record's own epoch; a record rewritten under a later epoch that keeps the same blob keeps the file's original epoch here. Unsigned 64-bit; see Byte encodings."
656
+ },
657
+ "segmentSize": {
658
+ "type": "integer",
659
+ "minimum": 16368,
660
+ "maximum": 262128,
661
+ "description": "Plaintext bytes per STREAM segment: the transfer chunk size less the 16-byte tag, so that one sealed segment is one chunk."
662
+ },
663
+ "padding": {
664
+ "type": "string",
665
+ "enum": [
666
+ "none",
667
+ "padme"
668
+ ],
669
+ "description": "Whether the plaintext was padded before sealing, so that ciphertext sizes do not fingerprint known documents. `padme`: zero bytes appended to reach `padme(size)`, the formula above. Absent means `none`. The padding is inside the final segments, and a reader checks it is zero and removes it by truncating to `size`."
670
+ },
671
+ "blobRef": {
672
+ "$ref": "#/$defs/BlobRef"
673
+ },
674
+ "fileKey": {
675
+ "type": "string",
676
+ "pattern": "^[A-Za-z0-9_-]{43}$",
677
+ "description": "The file key itself, 32 bytes base64url without padding: present on an `open` room only, where there is no storage key to derive it from. Minted by the uploader from a cryptographically secure random source for this one file and never reused. MUST be absent on `attributed` and `private` rooms, where the key is derived and never stored."
678
+ },
679
+ "width": {
680
+ "type": "integer",
681
+ "minimum": 1,
682
+ "maximum": 1048576,
683
+ "description": "The image's width in pixels, as the uploader read it. Advisory. A writer sets `width` and `height` together or neither; a reader ignores one without the other. A reader checks it against the decoded image."
684
+ },
685
+ "height": {
686
+ "type": "integer",
687
+ "minimum": 1,
688
+ "maximum": 1048576,
689
+ "description": "The image's height in pixels, as the uploader read it. Advisory. A writer sets `width` and `height` together or neither; a reader ignores one without the other. A reader checks it against the decoded image."
690
+ },
691
+ "preview": {
692
+ "type": "object",
693
+ "additionalProperties": false,
694
+ "required": [
695
+ "mediaType",
696
+ "data"
697
+ ],
698
+ "description": "A small image standing in for the file until it is fetched: at most 8192 bytes before encoding, enough for a blurred thumbnail and small enough not to swell the record every listing reader opens. A reader renders it only as a raster image it decodes itself — never as SVG or any other type that can carry active content, never as a link, never fetching anything — and replaces it with the file once fetched. It is the uploader's rendering of the file, not a digest of it: a reader MUST NOT present it as the file's contents.",
699
+ "properties": {
700
+ "mediaType": {
701
+ "type": "string",
702
+ "enum": [
703
+ "image/jpeg",
704
+ "image/png",
705
+ "image/webp"
706
+ ],
707
+ "description": "The preview's own media type. Raster types only."
708
+ },
709
+ "data": {
710
+ "type": "string",
711
+ "pattern": "^[A-Za-z0-9_-]+$",
712
+ "minLength": 1,
713
+ "maxLength": 10923,
714
+ "description": "The preview's bytes, base64url without padding: at most 8192 bytes decoded."
715
+ }
716
+ }
717
+ }
718
+ }
719
+ },
720
+ "RecordValidUntil": {
721
+ "title": "RecordValidUntil",
722
+ "type": "string",
723
+ "format": "date-time",
724
+ "description": "The instant after which the record's author no longer stands behind it as current. OPTIONAL; absent means the record does not expire. A reader hides a record whose `validUntil` has passed from default listings, search and recall, and shows it only on explicit request (`SealedRecordBody`, **Expiry**). No host enforces it."
725
+ },
726
+ "PermittedUse": {
727
+ "title": "PermittedUse",
728
+ "type": "object",
729
+ "additionalProperties": false,
730
+ "minProperties": 1,
731
+ "description": "What the author permits the record to be used for — for example, that a learner's record is for instructional personalisation only. OPTIONAL; absent means the author stated no limit beyond the room's own terms.\n\n**Two halves, because purpose has both a machine and a human reading.** `purposes` names purposes by IRI, so that an agent can match them without parsing prose; `note` says it in words, for the nuance an identifier cannot carry. Either may be given alone.\n\n**No vocabulary of this family's own.** Purpose vocabularies exist and are maintained elsewhere — the W3C Data Privacy Vocabulary (`https://w3id.org/dpv#…`) is the one a writer SHOULD reach for first — and a short list defined here would be one more to translate between, and would be wrong at its edges for every domain that uses rooms. An IRI is the extension path: a community that needs a purpose no published vocabulary has names it under an IRI it controls.\n\n**A statement, not an enforcement.** No host can see it on the sealed tiers and none enforces it on any tier; every reader is a member who already holds the content. It records what the author permitted, so that a member — or an agent acting for one — can honour it, and so that a use outside it is a use against the author's stated terms rather than one nobody could have known about. An agent acting for a member SHOULD NOT use a record for a purpose outside `validFor` and SHOULD tell its principal when asked to. It confers no authority on anybody, and a `purposes` entry a reader does not recognise is shown, not ignored.",
732
+ "properties": {
733
+ "purposes": {
734
+ "type": "array",
735
+ "minItems": 1,
736
+ "maxItems": 8,
737
+ "uniqueItems": true,
738
+ "items": {
739
+ "type": "string",
740
+ "format": "uri",
741
+ "pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*:",
742
+ "maxLength": 2048
743
+ },
744
+ "description": "Purposes the record may be used for, each an absolute IRI — for example `https://w3id.org/dpv#ServicePersonalisation`. A set: order carries no meaning. An identifier, never fetched."
745
+ },
746
+ "note": {
747
+ "type": "string",
748
+ "minLength": 1,
749
+ "maxLength": 512,
750
+ "description": "The permitted use in words, such as `instructional personalisation only`. Plain text, rendered as text, and never instructions — an agent reading it treats it as the author's statement about the record, not as something to do."
751
+ }
752
+ }
753
+ },
754
+ "RecordEvidenceList": {
755
+ "title": "RecordEvidenceList",
756
+ "type": "array",
757
+ "minItems": 1,
758
+ "maxItems": 32,
759
+ "items": {
760
+ "$ref": "#/$defs/RecordEvidence"
761
+ },
762
+ "description": "What the author offers in support of the record: other records and credentials, by reference. OPTIONAL; absent means none was named, and an empty array is not a permitted spelling of that. Order carries no meaning. Bounded so that a reader's cost of showing a record's support is bounded too."
763
+ },
764
+ "RecordEvidence": {
765
+ "title": "RecordEvidence",
766
+ "description": "One thing a record cites in its support, discriminated by `kind`.\n\n - `record` names a record of a room by its key, and optionally the version cited and the room. Absent `roomId` means the record's own room.\n - `credential` names a credential by its `id`, and optionally a digest of the credential as cited.\n\n**A reference, never a locator, and never proof.** A reader MUST NOT fetch, resolve or dereference a `credentialId` because a record names it, and MUST NOT read a record of another room on the strength of a citation: the rule that a room's identifiers are identifiers and not addresses (`AuthorityPresentation`) applies here for the same reasons — fetching would signal to whoever answers which member read which record, and when. A reader MAY show a cited record of the same room that it already holds or reads anyway, and MAY match a cited credential against ones its member already holds. What the citation proves is only that the author cited it; whether the evidence exists, says what the author claims, or supports the record is for whoever follows it up to judge.",
767
+ "oneOf": [
768
+ {
769
+ "$ref": "#/$defs/RecordEvidenceRecord"
770
+ },
771
+ {
772
+ "$ref": "#/$defs/RecordEvidenceCredential"
773
+ }
774
+ ]
775
+ },
776
+ "RecordEvidenceCredential": {
777
+ "title": "RecordEvidenceCredential",
778
+ "type": "object",
779
+ "additionalProperties": false,
780
+ "required": [
781
+ "kind",
782
+ "credentialId"
783
+ ],
784
+ "description": "Cites a credential.",
785
+ "properties": {
786
+ "kind": {
787
+ "const": "credential"
788
+ },
789
+ "credentialId": {
790
+ "type": "string",
791
+ "minLength": 1,
792
+ "maxLength": 2048,
793
+ "description": "The credential's `id`. An identifier: never fetched because a record names it."
794
+ },
795
+ "digest": {
796
+ "$ref": "#/$defs/DigestMultibase",
797
+ "description": "OPTIONAL. A digest of the credential as cited — the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, `proof` included — so a reader holding a credential with this `id` can tell whether it is the one the author meant."
798
+ }
799
+ }
800
+ },
801
+ "RecordEvidenceRecord": {
802
+ "title": "RecordEvidenceRecord",
803
+ "type": "object",
804
+ "additionalProperties": false,
805
+ "required": [
806
+ "kind",
807
+ "key"
808
+ ],
809
+ "description": "Cites a record of a room.",
810
+ "properties": {
811
+ "kind": {
812
+ "const": "record"
813
+ },
814
+ "key": {
815
+ "type": "string",
816
+ "minLength": 1,
817
+ "maxLength": 512,
818
+ "description": "The cited record's key, as in `rooms/records/put`. Opaque on the sealed tiers, like every key there."
819
+ },
820
+ "version": {
821
+ "type": "integer",
822
+ "minimum": 1,
823
+ "description": "The version cited. OPTIONAL; present, it pins the citation to what the record said then, since a record can be rewritten under the same key. A reader that shows a later version SHOULD say that it is not the one cited."
824
+ },
825
+ "roomId": {
826
+ "type": "string",
827
+ "pattern": "^did:",
828
+ "maxLength": 2048,
829
+ "description": "The cited record's room. Absent means the citing record's own room. A citation into another room tells the reader that room's identifier, so a writer SHOULD NOT cite into a room the citing room's readers are not meant to learn of."
830
+ }
831
+ }
832
+ },
833
+ "RecordConfidence": {
834
+ "title": "RecordConfidence",
835
+ "type": "number",
836
+ "minimum": 0,
837
+ "maximum": 1,
838
+ "description": "The author's own estimate, from 0 to 1, that what the record says is correct. OPTIONAL; absent means no estimate was given, never 1. Meaningful only beside the author who gave it: two writers' numbers are not on one scale, so a reader MUST NOT rank records by `confidence` across authors as though they were, and an agent that weights by it SHOULD weight within an author's own records. Never authority."
839
+ },
840
+ "RecordBasis": {
841
+ "title": "RecordBasis",
842
+ "type": "string",
843
+ "enum": [
844
+ "declared",
845
+ "observed",
846
+ "verified",
847
+ "inferred"
848
+ ],
849
+ "description": "What kind of claim a record is, as its author states it. OPTIONAL wherever it appears; absent means the author did not say, and a reader shows it as unstated rather than assuming any of these.\n\n - `declared` — the author's own statement: a decision, a preference, an intention, a commitment. True because the author says so, and only as far as the author speaks for it.\n - `observed` — something the author saw, measured or was told directly, recorded as found.\n - `verified` — checked against evidence that somebody else can check again, such as a credential or another record. A record that says `verified` SHOULD name that evidence in `evidence`; one that does not is an unsupported claim to have checked, and a reader SHOULD present it so.\n - `inferred` — derived by reasoning from other information: an agent's conclusion, a summary's generalisation, a model's guess. The value an agent writer uses when it does not know which of the others applies.\n\nThe values are the author's account of their own record, signed with it. They are not checked by anybody, confer nothing, and say nothing about whether the record is right — `inferred` can be correct and `observed` mistaken. Aligned with the provenance vocabulary of personal agent memory, so that a record moved between a member's memory and a room keeps its meaning."
850
+ },
851
+ "RecordEditedAt": {
852
+ "title": "RecordEditedAt",
853
+ "type": "string",
854
+ "format": "date-time",
855
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,9})?Z$",
856
+ "description": "The instant the author made the edit that produced this version, RFC 3339 in UTC (`Z`). Set by the writer of every version after the first, and absent on the first, so that a reader seeing a record for the first time can tell whether it was ever edited — which `version` cannot say, since curation moves it too. Signed with the body on the sealed tiers. A reader shows a record carrying it as edited, and treats an implausible one as `SealedRecordBody` (*Edits*) says. Governed by `RoomProfile.recordMembers` like `writtenAt`. No host enforces or reads it."
857
+ },
858
+ "RecordWrittenAt": {
859
+ "title": "RecordWrittenAt",
860
+ "type": "string",
861
+ "format": "date-time",
862
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,9})?Z$",
863
+ "description": "The instant the author wrote the record, RFC 3339 in UTC (`Z`). Set by the author and kept unchanged when the record is rewritten; an edit is marked by `editedAt`. OPTIONAL on a note; a `message` or `reaction` SHOULD carry it. The author's claim, not an attested time: a reader orders messages by it, compares it with the host's `createdAt`, and treats an implausible or backdated one as `SealedRecordBody` (*When it was written*) says. No host enforces or reads it."
864
+ },
865
+ "RecordReference": {
866
+ "title": "RecordReference",
867
+ "type": "object",
868
+ "additionalProperties": false,
869
+ "required": [
870
+ "key"
871
+ ],
872
+ "description": "Names another record of the same room: the record a reply answers or a reaction responds to. Never a record of another room — a citation that crosses rooms is `RecordEvidenceRecord`. A reader resolves it only against records it can already list or read in this room, and MUST NOT fetch anything else because of it. It MUST NOT name a record of kind `reaction`.",
873
+ "properties": {
874
+ "key": {
875
+ "type": "string",
876
+ "minLength": 1,
877
+ "maxLength": 512,
878
+ "description": "The record's key, as in `rooms/records/put`. Opaque on the sealed tiers, like every key there."
879
+ },
880
+ "version": {
881
+ "type": "integer",
882
+ "minimum": 1,
883
+ "description": "The version of the record the author was answering. OPTIONAL. A reader SHOULD say that the target has changed since only when its content has, never because its version moved: curation moves a record's version without touching its content (`SealedRecordBody`, *Whether the target has changed*)."
884
+ }
885
+ }
886
+ },
887
+ "RecordKind": {
888
+ "title": "RecordKind",
889
+ "type": "string",
890
+ "minLength": 1,
891
+ "maxLength": 64,
892
+ "pattern": "^[a-z][A-Za-z0-9]*$",
893
+ "description": "What a reader shows a record as. Defined values: `note` — something kept in the room's library, titled or not, its `body` markdown; `message` — a turn in the room's conversation, its words in `body` as plain text; `reaction` — a short response to another record, its value in `body` (`SealedRecordBody`, *Reactions*). An open set, not an enumeration, so a new kind needs no new version of any schema: a reader MUST present a record whose kind it does not know as a note, and MUST NOT refuse a record for its kind. Absent means `note`, though a reader that keeps a conversation apart MAY show an untitled record without a kind as a message (*Untitled records*). A new version of a record MUST keep its kind. lowerCamelCase, at most 64 characters."
894
+ },
895
+ "SealedRecord": {
896
+ "title": "SealedRecord",
897
+ "type": "object",
898
+ "additionalProperties": false,
899
+ "required": [
900
+ "ciphertext",
901
+ "nonce",
902
+ "epoch"
903
+ ],
904
+ "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.",
905
+ "properties": {
906
+ "ciphertext": {
907
+ "type": "string",
908
+ "description": "The sealed record, base64url. Bound by AEAD associated data to `roomId`, `key`, the version it was sealed at, 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. The version it was sealed at is `version` below where present, and the record's own `version` otherwise."
909
+ },
910
+ "nonce": {
911
+ "type": "string",
912
+ "description": "AEAD nonce, base64url."
913
+ },
914
+ "epoch": {
915
+ "type": "integer",
916
+ "minimum": 1,
917
+ "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."
918
+ },
919
+ "version": {
920
+ "type": "integer",
921
+ "minimum": 1,
922
+ "description": "The version this ciphertext was sealed at, where that is no longer the record's own `version`. A record's version moves when it is curated (`rooms/records/curate`, which MUST assign a new one so that every `sinceVersion` watermark sees the change), but a curation other than a retraction keeps the body — and the body is bound, by the AEAD and by its author's signature (`SealedRecordBody`), to the version it was written at. Without this member a curated record would be opened at a version it was never sealed for, and would not open for anyone.\n\nA host MUST record the version a body was sealed at when it stores it, MUST NOT change it while that body is kept — a curation alters a record's standing, never its sealed content — and MUST include it whenever it differs from the record's `version`. It is absent where the two are equal, which is every record that has not been curated since it was written, so the members a record carries are unchanged until a curation needs this one. It is part of `sealed`, and so of the record the data commitment covers (`CommittedRecord`): a host cannot change it without changing the root.\n\nA reader opens and verifies the body at this version, and MUST refuse a record whose `sealed.version` is greater than its own `version` — a body cannot have been sealed for a version the room had not reached. A host that pairs a newer version with an older body of the same key is rolling the record back; that is a change to the committed record like any other, visible to the comparisons `CommittedRecord` exists for."
923
+ }
924
+ }
925
+ },
926
+ "AuthorityPresentation": {
927
+ "title": "AuthorityPresentation",
928
+ "type": "object",
929
+ "additionalProperties": false,
930
+ "required": [
931
+ "membership",
932
+ "authority"
933
+ ],
934
+ "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. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.\n\n**Every credential is its issuer's attestation, and only its issuer's.** For the membership credential and for every link of `authority`, a host MUST verify the credential's `proof` with a key that the credential's own `issuer` lists for `assertionMethod` in its DID document, and MUST refuse a credential whose proof names a verification method that is not its issuer's. A proof that verifies under some other party's key is that party's statement, not the issuer's, and confers nothing. The same binding holds for every other document a room signs, such as a `RevocationList`.\n\n**A chain that verifies may still be revoked.** A host that has accepted a `RevocationList` for the room (`rooms/revocations/put`) MUST, from the moment it accepted it, refuse every presentation in which the membership credential or any link of `authority` is revoked by that list, under every task and every version of every task it serves for the room. A chain from which any link is revoked is refused whole: a credential delegated from a revoked one confers nothing, however it was attenuated. The refusal is the same `permissionDenied` as any other failed presentation.",
935
+ "properties": {
936
+ "membership": {
937
+ "type": "string",
938
+ "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."
939
+ },
940
+ "authority": {
941
+ "type": "array",
942
+ "minItems": 1,
943
+ "maxItems": 8,
944
+ "items": {
945
+ "type": "string"
946
+ },
947
+ "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."
948
+ },
949
+ "subjectBinding": {
950
+ "type": "string",
951
+ "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."
952
+ }
953
+ }
954
+ }
955
+ }
956
+ };
957
+ /**
958
+ * SPEC.md §7.2 policy for the request variant, from this specification's
959
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
960
+ * per-specification and cannot be derived from the document alone, and
961
+ * item 2 needs the schema this carries.
962
+ */
963
+ export const SPEC = {
964
+ typeUri: TYPE_URI,
965
+ isBearer: false,
966
+ isProofRequired: true,
967
+ isRecipientRequired: true,
968
+ isIssuedAtRequired: true,
969
+ payloadSchema: PAYLOAD_SCHEMA,
970
+ };
971
+ /**
972
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
973
+ * tracks the *issuer* party's requirement because a response swaps the
974
+ * parties (§7.3 item 5).
975
+ */
976
+ export const RESPONSE_SPEC = {
977
+ typeUri: RESPONSE_TYPE_URI,
978
+ isBearer: false,
979
+ isProofRequired: true,
980
+ isRecipientRequired: true,
981
+ isIssuedAtRequired: true,
982
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
983
+ };
984
+ //# sourceMappingURL=payload.js.map