@noy-db/hub 0.2.0-pre.9 → 0.3.0-pre.10

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 (615) hide show
  1. package/README.md +129 -3
  2. package/dist/aggregate/index.d.ts +5 -2
  3. package/dist/aggregate/index.js +25 -16
  4. package/dist/aggregate/index.js.map +1 -1
  5. package/dist/api-TX2EX2FX.js +20 -0
  6. package/dist/as/index.d.ts +6 -0
  7. package/dist/as/index.js +30 -0
  8. package/dist/at/index.d.ts +4 -0
  9. package/dist/at/index.js +1 -0
  10. package/dist/attestation/index.d.ts +14 -47
  11. package/dist/attestation/index.js +60 -10
  12. package/dist/attestation/index.js.map +1 -1
  13. package/dist/backup-R7NTDFKY.js +225 -0
  14. package/dist/backup-R7NTDFKY.js.map +1 -0
  15. package/dist/blobs/index.d.ts +5 -8
  16. package/dist/blobs/index.js +25 -12
  17. package/dist/blobs/index.js.map +1 -1
  18. package/dist/bundle/index.d.ts +15 -70
  19. package/dist/bundle/index.js +45 -476
  20. package/dist/bundle/index.js.map +1 -1
  21. package/dist/{ulid-CJ8RzRrm.d.ts → bundle-D6GxiUfq.d.ts} +31 -86
  22. package/dist/by/index.d.ts +1 -0
  23. package/dist/by/index.js +11 -0
  24. package/dist/cargo/index.d.ts +7 -0
  25. package/dist/cargo/index.js +95 -0
  26. package/dist/chunk-2OV5NVE7.js +95 -0
  27. package/dist/chunk-2OV5NVE7.js.map +1 -0
  28. package/dist/chunk-2OZXVKVP.js +367 -0
  29. package/dist/chunk-2OZXVKVP.js.map +1 -0
  30. package/dist/{chunk-HNRHLRDC.js → chunk-2REPHKET.js} +6 -5
  31. package/dist/chunk-2REPHKET.js.map +1 -0
  32. package/dist/{chunk-PE2FR4J3.js → chunk-3JXPAHOZ.js} +17 -17
  33. package/dist/chunk-3JXPAHOZ.js.map +1 -0
  34. package/dist/{chunk-H2X3ISXG.js → chunk-3MATJ6O4.js} +7 -7
  35. package/dist/chunk-3MATJ6O4.js.map +1 -0
  36. package/dist/{chunk-PP6W64Y3.js → chunk-3OPY6MK2.js} +132 -3
  37. package/dist/chunk-3OPY6MK2.js.map +1 -0
  38. package/dist/{chunk-T7JEBOGN.js → chunk-3QSIU3UT.js} +49 -71
  39. package/dist/chunk-3QSIU3UT.js.map +1 -0
  40. package/dist/{chunk-ZYWZWG6G.js → chunk-4OMCIY6F.js} +32 -12
  41. package/dist/chunk-4OMCIY6F.js.map +1 -0
  42. package/dist/chunk-4Q6HSHHL.js +90 -0
  43. package/dist/chunk-4Q6HSHHL.js.map +1 -0
  44. package/dist/chunk-5I35DOHK.js +94 -0
  45. package/dist/chunk-5I35DOHK.js.map +1 -0
  46. package/dist/chunk-5VG4IJR7.js +235 -0
  47. package/dist/chunk-5VG4IJR7.js.map +1 -0
  48. package/dist/chunk-5YESYH2C.js +155 -0
  49. package/dist/chunk-5YESYH2C.js.map +1 -0
  50. package/dist/chunk-6G5ORS5D.js +202 -0
  51. package/dist/chunk-6G5ORS5D.js.map +1 -0
  52. package/dist/{chunk-VTKGMEPP.js → chunk-6P5XCKSD.js} +13 -3
  53. package/dist/chunk-6P5XCKSD.js.map +1 -0
  54. package/dist/{chunk-J66GRPNH.js → chunk-6S7T6WC4.js} +2 -2
  55. package/dist/chunk-6S7T6WC4.js.map +1 -0
  56. package/dist/{chunk-U26HQ6KJ.js → chunk-7BWJHO2A.js} +4 -4
  57. package/dist/chunk-7BWJHO2A.js.map +1 -0
  58. package/dist/chunk-7P2SDJG3.js +279 -0
  59. package/dist/chunk-7P2SDJG3.js.map +1 -0
  60. package/dist/chunk-ANB77BVV.js +150 -0
  61. package/dist/chunk-ANB77BVV.js.map +1 -0
  62. package/dist/chunk-AURFOK3D.js +35 -0
  63. package/dist/chunk-AURFOK3D.js.map +1 -0
  64. package/dist/chunk-BKARNZJN.js +382 -0
  65. package/dist/chunk-BKARNZJN.js.map +1 -0
  66. package/dist/{chunk-3BFJOWSU.js → chunk-BQISD5ZV.js} +35 -7
  67. package/dist/chunk-BQISD5ZV.js.map +1 -0
  68. package/dist/{chunk-2GLDA55J.js → chunk-BUAQ7YI3.js} +260 -135
  69. package/dist/chunk-BUAQ7YI3.js.map +1 -0
  70. package/dist/{chunk-2WUSG3IT.js → chunk-CB7CWSKW.js} +5 -5
  71. package/dist/chunk-CB7CWSKW.js.map +1 -0
  72. package/dist/chunk-CHFZDSE4.js +1 -0
  73. package/dist/{aggregate/index.cjs → chunk-DFVUTGT2.js} +206 -222
  74. package/dist/chunk-DFVUTGT2.js.map +1 -0
  75. package/dist/chunk-DJ7KIPLV.js +23 -0
  76. package/dist/chunk-DJ7KIPLV.js.map +1 -0
  77. package/dist/chunk-DSKDQP3G.js +14066 -0
  78. package/dist/chunk-DSKDQP3G.js.map +1 -0
  79. package/dist/{chunk-5T22KDPN.js → chunk-DV4HUP5G.js} +10 -8
  80. package/dist/chunk-DV4HUP5G.js.map +1 -0
  81. package/dist/chunk-EOXAAJTY.js +621 -0
  82. package/dist/chunk-EOXAAJTY.js.map +1 -0
  83. package/dist/chunk-ET67AY6B.js +74 -0
  84. package/dist/chunk-ET67AY6B.js.map +1 -0
  85. package/dist/chunk-F4CEK5YM.js +123 -0
  86. package/dist/chunk-F4CEK5YM.js.map +1 -0
  87. package/dist/chunk-FORYWFN6.js +130 -0
  88. package/dist/chunk-FORYWFN6.js.map +1 -0
  89. package/dist/{chunk-JWRVQKRZ.js → chunk-FRP6D2DM.js} +21 -20
  90. package/dist/chunk-FRP6D2DM.js.map +1 -0
  91. package/dist/chunk-FUOE7UUV.js +341 -0
  92. package/dist/chunk-FUOE7UUV.js.map +1 -0
  93. package/dist/chunk-G4JYND6L.js +42 -0
  94. package/dist/chunk-G4JYND6L.js.map +1 -0
  95. package/dist/{chunk-53XBRIRT.js → chunk-G6XV4H65.js} +9 -9
  96. package/dist/chunk-G6XV4H65.js.map +1 -0
  97. package/dist/chunk-GHVIKOHT.js +1 -0
  98. package/dist/{chunk-PX35GA7L.js → chunk-GNMXXTMN.js} +11 -9
  99. package/dist/chunk-GNMXXTMN.js.map +1 -0
  100. package/dist/chunk-GYGLAVCX.js +19 -0
  101. package/dist/chunk-GYGLAVCX.js.map +1 -0
  102. package/dist/chunk-HPWKV3YB.js +21 -0
  103. package/dist/chunk-HPWKV3YB.js.map +1 -0
  104. package/dist/chunk-HY3AUMFI.js +41 -0
  105. package/dist/chunk-HY3AUMFI.js.map +1 -0
  106. package/dist/chunk-HYR4WZZ3.js +69 -0
  107. package/dist/chunk-HYR4WZZ3.js.map +1 -0
  108. package/dist/chunk-I7FD46FF.js +9 -0
  109. package/dist/chunk-I7FD46FF.js.map +1 -0
  110. package/dist/{chunk-TFBP23BX.js → chunk-ICXIFFYZ.js} +66 -7
  111. package/dist/chunk-ICXIFFYZ.js.map +1 -0
  112. package/dist/{chunk-TV3YZ35S.js → chunk-IGJCYUT5.js} +17 -8
  113. package/dist/chunk-IGJCYUT5.js.map +1 -0
  114. package/dist/{chunk-F3GDRNUT.js → chunk-IVLTXX4W.js} +36 -68
  115. package/dist/chunk-IVLTXX4W.js.map +1 -0
  116. package/dist/{chunk-DONMZAD2.js → chunk-J4LPNIGK.js} +62 -169
  117. package/dist/chunk-J4LPNIGK.js.map +1 -0
  118. package/dist/chunk-JJZ2LW6T.js +36 -0
  119. package/dist/chunk-JJZ2LW6T.js.map +1 -0
  120. package/dist/chunk-JK733I5V.js +23 -0
  121. package/dist/chunk-JK733I5V.js.map +1 -0
  122. package/dist/{chunk-3YPCK6JX.js → chunk-KJ2BCBTL.js} +181 -422
  123. package/dist/chunk-KJ2BCBTL.js.map +1 -0
  124. package/dist/chunk-KNZB6JMR.js +129 -0
  125. package/dist/chunk-KNZB6JMR.js.map +1 -0
  126. package/dist/{chunk-OIF6LZUR.js → chunk-KPZS5QAQ.js} +30 -11
  127. package/dist/chunk-KPZS5QAQ.js.map +1 -0
  128. package/dist/chunk-LB7FD65R.js +163 -0
  129. package/dist/chunk-LB7FD65R.js.map +1 -0
  130. package/dist/{chunk-DO7C2TOG.js → chunk-LEJIKBBB.js} +3 -3
  131. package/dist/{chunk-DO7C2TOG.js.map → chunk-LEJIKBBB.js.map} +1 -1
  132. package/dist/{chunk-O3VZPBZG.js → chunk-LL2NIVUR.js} +56 -13
  133. package/dist/chunk-LL2NIVUR.js.map +1 -0
  134. package/dist/chunk-LP7BEXCT.js +32 -0
  135. package/dist/chunk-LP7BEXCT.js.map +1 -0
  136. package/dist/chunk-MCHVVJIA.js +968 -0
  137. package/dist/chunk-MCHVVJIA.js.map +1 -0
  138. package/dist/chunk-NO272T7Q.js +194 -0
  139. package/dist/chunk-NO272T7Q.js.map +1 -0
  140. package/dist/{chunk-22DWZL57.js → chunk-NUEQU36L.js} +70 -267
  141. package/dist/chunk-NUEQU36L.js.map +1 -0
  142. package/dist/chunk-O45M6LDB.js +38 -0
  143. package/dist/chunk-O45M6LDB.js.map +1 -0
  144. package/dist/chunk-OBKWYKYC.js +117 -0
  145. package/dist/chunk-OBKWYKYC.js.map +1 -0
  146. package/dist/{chunk-DJHHA6XH.js → chunk-OHHKHSJP.js} +50 -20
  147. package/dist/chunk-OHHKHSJP.js.map +1 -0
  148. package/dist/chunk-OT76OZL6.js +45 -0
  149. package/dist/chunk-OT76OZL6.js.map +1 -0
  150. package/dist/chunk-OVYRLHPE.js +150 -0
  151. package/dist/chunk-OVYRLHPE.js.map +1 -0
  152. package/dist/{chunk-ML236QKC.js → chunk-OXCSVM3B.js} +5 -5
  153. package/dist/chunk-OXCSVM3B.js.map +1 -0
  154. package/dist/chunk-P33LUIML.js +205 -0
  155. package/dist/chunk-P33LUIML.js.map +1 -0
  156. package/dist/{chunk-DL3HWOQ5.js → chunk-PLS64NCS.js} +10 -8
  157. package/dist/chunk-PLS64NCS.js.map +1 -0
  158. package/dist/{chunk-SYMWGEET.js → chunk-PS2NEWEX.js} +3 -3
  159. package/dist/chunk-PS2NEWEX.js.map +1 -0
  160. package/dist/chunk-PY4KJPYU.js +9 -0
  161. package/dist/chunk-PY4KJPYU.js.map +1 -0
  162. package/dist/chunk-PZ5AY32C.js +10 -0
  163. package/dist/chunk-QA2KUPCP.js +45 -0
  164. package/dist/chunk-QA2KUPCP.js.map +1 -0
  165. package/dist/chunk-QOC3VYL2.js +30 -0
  166. package/dist/chunk-QOC3VYL2.js.map +1 -0
  167. package/dist/{chunk-BVRYKATC.js → chunk-QSFOZUYL.js} +62 -34
  168. package/dist/chunk-QSFOZUYL.js.map +1 -0
  169. package/dist/chunk-RHK32N73.js +30 -0
  170. package/dist/chunk-RHK32N73.js.map +1 -0
  171. package/dist/{chunk-K3DK3NU5.js → chunk-RW3Y22MW.js} +20 -5
  172. package/dist/chunk-RW3Y22MW.js.map +1 -0
  173. package/dist/{chunk-B6PB7JLN.js → chunk-S7VFUQM2.js} +541 -6
  174. package/dist/chunk-S7VFUQM2.js.map +1 -0
  175. package/dist/chunk-SVLR4POP.js +64 -0
  176. package/dist/chunk-SVLR4POP.js.map +1 -0
  177. package/dist/chunk-T7WSLRAU.js +49 -0
  178. package/dist/chunk-T7WSLRAU.js.map +1 -0
  179. package/dist/{chunk-WPLVTJ5D.js → chunk-TAKWLZZX.js} +285 -63
  180. package/dist/chunk-TAKWLZZX.js.map +1 -0
  181. package/dist/chunk-THNJ3IKU.js +17 -0
  182. package/dist/chunk-THNJ3IKU.js.map +1 -0
  183. package/dist/{chunk-XJFLDA7A.js → chunk-TMBXVJKT.js} +9 -6
  184. package/dist/chunk-TMBXVJKT.js.map +1 -0
  185. package/dist/chunk-TWKKOM55.js +54 -0
  186. package/dist/chunk-TWKKOM55.js.map +1 -0
  187. package/dist/chunk-U3WZCU7E.js +14 -0
  188. package/dist/chunk-U3WZCU7E.js.map +1 -0
  189. package/dist/{chunk-Z6FNBOTC.js → chunk-UF362QVH.js} +15 -17
  190. package/dist/chunk-UF362QVH.js.map +1 -0
  191. package/dist/chunk-UN4FVIBH.js +135 -0
  192. package/dist/chunk-UN4FVIBH.js.map +1 -0
  193. package/dist/chunk-VEAVKDDB.js +29 -0
  194. package/dist/chunk-VEAVKDDB.js.map +1 -0
  195. package/dist/chunk-VEPTFUJY.js +29 -0
  196. package/dist/chunk-VEPTFUJY.js.map +1 -0
  197. package/dist/chunk-VJV7GKQK.js +662 -0
  198. package/dist/chunk-VJV7GKQK.js.map +1 -0
  199. package/dist/{chunk-2QR2PQTT.js → chunk-VQNJ7UZL.js} +5 -3
  200. package/dist/chunk-VQNJ7UZL.js.map +1 -0
  201. package/dist/chunk-VQRAIPYF.js +50 -0
  202. package/dist/chunk-VQRAIPYF.js.map +1 -0
  203. package/dist/{chunk-DFMLEQZB.js → chunk-VRIYFLBA.js} +5 -10
  204. package/dist/chunk-VRIYFLBA.js.map +1 -0
  205. package/dist/chunk-VWM3DAVB.js +265 -0
  206. package/dist/chunk-VWM3DAVB.js.map +1 -0
  207. package/dist/{chunk-NONAAENK.js → chunk-VWRRVE6D.js} +11 -4
  208. package/dist/chunk-VWRRVE6D.js.map +1 -0
  209. package/dist/chunk-VYYM3MEN.js +98 -0
  210. package/dist/chunk-VYYM3MEN.js.map +1 -0
  211. package/dist/chunk-WBJIQSLL.js +167 -0
  212. package/dist/chunk-WBJIQSLL.js.map +1 -0
  213. package/dist/chunk-WIGQB62E.js +164 -0
  214. package/dist/chunk-WIGQB62E.js.map +1 -0
  215. package/dist/{chunk-EMIGCR7X.js → chunk-WXSYDNBT.js} +2 -2
  216. package/dist/chunk-WXSYDNBT.js.map +1 -0
  217. package/dist/chunk-WZSCE6RM.js +466 -0
  218. package/dist/chunk-WZSCE6RM.js.map +1 -0
  219. package/dist/chunk-XGDAPN6M.js +255 -0
  220. package/dist/chunk-XGDAPN6M.js.map +1 -0
  221. package/dist/{chunk-QODLLGQ7.js → chunk-XH7XP3OL.js} +372 -37
  222. package/dist/chunk-XH7XP3OL.js.map +1 -0
  223. package/dist/chunk-XREOISSI.js +40 -0
  224. package/dist/chunk-XREOISSI.js.map +1 -0
  225. package/dist/chunk-XUBPSPKD.js +164 -0
  226. package/dist/chunk-XUBPSPKD.js.map +1 -0
  227. package/dist/chunk-Y3A5CB5G.js +247 -0
  228. package/dist/chunk-Y3A5CB5G.js.map +1 -0
  229. package/dist/{chunk-I5FOWO4J.js → chunk-YCXCR7VG.js} +52 -73
  230. package/dist/chunk-YCXCR7VG.js.map +1 -0
  231. package/dist/{chunk-A3JMGXPG.js → chunk-YMUGBZN2.js} +2 -2
  232. package/dist/chunk-YMUGBZN2.js.map +1 -0
  233. package/dist/chunk-YMVQD5Q5.js +453 -0
  234. package/dist/chunk-YMVQD5Q5.js.map +1 -0
  235. package/dist/chunk-YN5IAHN6.js +32 -0
  236. package/dist/chunk-YN5IAHN6.js.map +1 -0
  237. package/dist/{chunk-FZU343FL.js → chunk-ZJADGNYF.js} +2 -2
  238. package/dist/chunk-ZJADGNYF.js.map +1 -0
  239. package/dist/chunk-ZYJ55N7N.js +86 -0
  240. package/dist/chunk-ZYJ55N7N.js.map +1 -0
  241. package/dist/classified/index.d.ts +16 -0
  242. package/dist/classified/index.js +40 -0
  243. package/dist/classified-marker-H6YSHYNK.js +24 -0
  244. package/dist/classified-marker-H6YSHYNK.js.map +1 -0
  245. package/dist/collection-facade-LVD22JLM.js +39 -0
  246. package/dist/computed-EXDMQODG.js +11 -0
  247. package/dist/consent/index.d.ts +4 -7
  248. package/dist/consent/index.js +13 -5
  249. package/dist/consent/index.js.map +1 -1
  250. package/dist/crdt/index.d.ts +5 -2
  251. package/dist/crdt/index.js +3 -2
  252. package/dist/crdt/index.js.map +1 -1
  253. package/dist/dead-filter-HQIE2YG7.js +28 -0
  254. package/dist/dead-filter-HQIE2YG7.js.map +1 -0
  255. package/dist/decrypt-partition-IHtxEnTi.d.ts +21 -0
  256. package/dist/delegation-BJP73GAP.js +25 -0
  257. package/dist/derivations/index.d.ts +6 -9
  258. package/dist/derivations/index.js +18 -6
  259. package/dist/derive-BME7HDWO.js +21 -0
  260. package/dist/{dev-unlock-B4kDxep_.d.ts → dev-unlock-Bmm2pgJ0.d.ts} +1 -1
  261. package/dist/discriminant-BN9REW3o.d.ts +60 -0
  262. package/dist/enclave-NHORSWSF.js +125 -0
  263. package/dist/executor-FE6X4LFX.js +9 -0
  264. package/dist/executor-KSHKRJXP.js +25 -0
  265. package/dist/executor-ZHTJJICG.js +9 -0
  266. package/dist/export-accessible-DACHM5VT.js +23 -0
  267. package/dist/extract-partition-RNENZZ4T.js +36 -0
  268. package/dist/fanout-sidecar-OFWN3NM7.js +74 -0
  269. package/dist/fanout-sidecar-OFWN3NM7.js.map +1 -0
  270. package/dist/fence-watcher-DHQ775JB.js +69 -0
  271. package/dist/fence-watcher-DHQ775JB.js.map +1 -0
  272. package/dist/find-BNGBJNKP.js +11 -0
  273. package/dist/forget/index.d.ts +36 -0
  274. package/dist/forget/index.js +25 -0
  275. package/dist/forget/index.js.map +1 -0
  276. package/dist/guards/index.d.ts +12 -9
  277. package/dist/guards/index.js +12 -5
  278. package/dist/{hash-DdpVypUp.d.cts → hash-DAJjMsCE.d.ts} +10 -1
  279. package/dist/history/index.d.ts +5 -8
  280. package/dist/history/index.js +25 -12
  281. package/dist/history/index.js.map +1 -1
  282. package/dist/i18n/index.d.ts +25 -8
  283. package/dist/i18n/index.js +137 -29
  284. package/dist/i18n/index.js.map +1 -1
  285. package/dist/in/index.d.ts +4 -0
  286. package/dist/in/index.js +1 -0
  287. package/dist/in/index.js.map +1 -0
  288. package/dist/index-B9QdHytu.d.ts +123 -0
  289. package/dist/index-DjWbxsjb.d.ts +23579 -0
  290. package/dist/index-qwuNvO2B.d.ts +144 -0
  291. package/dist/index.d.ts +1179 -449
  292. package/dist/index.js +2524 -312
  293. package/dist/index.js.map +1 -1
  294. package/dist/indexing/index.d.ts +5 -3
  295. package/dist/indexing/index.js +6 -5
  296. package/dist/indexing/index.js.map +1 -1
  297. package/dist/issue-NDI4CVZU.js +19 -0
  298. package/dist/issue-NDI4CVZU.js.map +1 -0
  299. package/dist/json-schema-I22JCYCG.js +44 -0
  300. package/dist/json-schema-I22JCYCG.js.map +1 -0
  301. package/dist/lazy/index.d.ts +20 -0
  302. package/dist/lazy/index.js +12 -0
  303. package/dist/lazy/index.js.map +1 -0
  304. package/dist/ledger-6NDS2EO4.js +42 -0
  305. package/dist/ledger-6NDS2EO4.js.map +1 -0
  306. package/dist/liberate-HN3RIGIP.js +24 -0
  307. package/dist/liberate-HN3RIGIP.js.map +1 -0
  308. package/dist/link-set-SJB2MVJV.js +31 -0
  309. package/dist/link-set-SJB2MVJV.js.map +1 -0
  310. package/dist/materialized-views/index.d.ts +23 -20
  311. package/dist/materialized-views/index.js +26 -12
  312. package/dist/mime-magic-bBj5OgUC.d.ts +103 -0
  313. package/dist/noydb-BWF6EPIR.js +66 -0
  314. package/dist/noydb-BWF6EPIR.js.map +1 -0
  315. package/dist/on/index.d.ts +4 -0
  316. package/dist/on/index.js +17 -0
  317. package/dist/on/index.js.map +1 -0
  318. package/dist/overlay-views/index.d.ts +26 -11
  319. package/dist/overlay-views/index.js +7 -6
  320. package/dist/periods/index.d.ts +4 -7
  321. package/dist/periods/index.js +27 -9
  322. package/dist/pod/index.d.ts +62 -0
  323. package/dist/pod/index.js +67 -0
  324. package/dist/pod/index.js.map +1 -0
  325. package/dist/policy-WGNAG5H6.js +41 -0
  326. package/dist/policy-WGNAG5H6.js.map +1 -0
  327. package/dist/portability/index.d.ts +19 -0
  328. package/dist/portability/index.js +43 -0
  329. package/dist/portability/index.js.map +1 -0
  330. package/dist/post-register-CWKBQRC7.js +55 -0
  331. package/dist/post-register-CWKBQRC7.js.map +1 -0
  332. package/dist/{public-envelope-BW6OXORV.js → public-envelope-EJLVIFX7.js} +6 -5
  333. package/dist/public-envelope-EJLVIFX7.js.map +1 -0
  334. package/dist/query/index.d.ts +4 -3
  335. package/dist/query/index.js +24 -13
  336. package/dist/read-only-facade-CHCKSEPD.js +8 -0
  337. package/dist/read-only-facade-CHCKSEPD.js.map +1 -0
  338. package/dist/register-SBIX7TVV.js +23 -0
  339. package/dist/register-SBIX7TVV.js.map +1 -0
  340. package/dist/registry-3EQG6OOE.js +18 -0
  341. package/dist/registry-3EQG6OOE.js.map +1 -0
  342. package/dist/registry-CA327ACV.js +9 -0
  343. package/dist/registry-CA327ACV.js.map +1 -0
  344. package/dist/registry-E7OXOTSV.js +19 -0
  345. package/dist/registry-E7OXOTSV.js.map +1 -0
  346. package/dist/registry-VW6P6A3J.js +8 -0
  347. package/dist/registry-VW6P6A3J.js.map +1 -0
  348. package/dist/request-withdrawal-KAH2AAXC.js +31 -0
  349. package/dist/request-withdrawal-KAH2AAXC.js.map +1 -0
  350. package/dist/reveal-R3JLHMUF.js +38 -0
  351. package/dist/reveal-R3JLHMUF.js.map +1 -0
  352. package/dist/revoke-IXLOJ3IH.js +24 -0
  353. package/dist/revoke-IXLOJ3IH.js.map +1 -0
  354. package/dist/satellites/index.d.ts +4 -0
  355. package/dist/satellites/index.js +8 -0
  356. package/dist/satellites/index.js.map +1 -0
  357. package/dist/sealed-record/index.d.ts +68 -0
  358. package/dist/sealed-record/index.js +71 -0
  359. package/dist/sealed-record/index.js.map +1 -0
  360. package/dist/session/index.d.ts +5 -8
  361. package/dist/session/index.js +13 -5
  362. package/dist/session/index.js.map +1 -1
  363. package/dist/shadow/index.d.ts +4 -7
  364. package/dist/shadow/index.js +4 -3
  365. package/dist/shadow/index.js.map +1 -1
  366. package/dist/signer-Y46N2GJ3.js +25 -0
  367. package/dist/signer-Y46N2GJ3.js.map +1 -0
  368. package/dist/snapshots/index.d.ts +5 -8
  369. package/dist/snapshots/index.js +19 -11
  370. package/dist/snapshots/index.js.map +1 -1
  371. package/dist/{stale-6ZDBTQT7.js → stale-Z7IW6RIL.js} +3 -2
  372. package/dist/stale-Z7IW6RIL.js.map +1 -0
  373. package/dist/storage-ADNP2UWI.js +23 -0
  374. package/dist/storage-ADNP2UWI.js.map +1 -0
  375. package/dist/store-coordination-provider-DTDMI6VL.js +142 -0
  376. package/dist/store-coordination-provider-DTDMI6VL.js.map +1 -0
  377. package/dist/subject-index-CyOgGMJL.d.ts +380 -0
  378. package/dist/sync/index.d.ts +3 -6
  379. package/dist/sync/index.js +13 -6
  380. package/dist/sync/index.js.map +1 -1
  381. package/dist/team/index.d.ts +46 -10
  382. package/dist/team/index.js +35 -18
  383. package/dist/tiers/index.d.ts +4 -0
  384. package/dist/tiers/index.js +39 -0
  385. package/dist/tiers/index.js.map +1 -0
  386. package/dist/to/index.d.ts +4 -0
  387. package/dist/to/index.js +16 -0
  388. package/dist/to/index.js.map +1 -0
  389. package/dist/transition-guard-DI-krBsZ.d.ts +165 -0
  390. package/dist/tx/index.d.ts +22 -9
  391. package/dist/tx/index.js +13 -8
  392. package/dist/tx/index.js.map +1 -1
  393. package/dist/ui/index.d.ts +4 -0
  394. package/dist/ui/index.js +1 -0
  395. package/dist/ui/index.js.map +1 -0
  396. package/dist/ulid-DRH25k3y.d.ts +66 -0
  397. package/dist/ulid-PTAIMDG4.js +10 -0
  398. package/dist/ulid-PTAIMDG4.js.map +1 -0
  399. package/dist/util/index.d.ts +2 -0
  400. package/dist/util/index.js +7 -2
  401. package/dist/util/index.js.map +1 -1
  402. package/dist/validators-BUcli5Nh.d.ts +101 -0
  403. package/dist/vault-diff-Z2DUayMe.d.ts +147 -0
  404. package/dist/verify-JPF2YR5E.js +139 -0
  405. package/dist/verify-JPF2YR5E.js.map +1 -0
  406. package/dist/walk-XYA2O3LW.js +241 -0
  407. package/dist/walk-XYA2O3LW.js.map +1 -0
  408. package/dist/with/index.d.ts +37 -0
  409. package/dist/with/index.js +31 -0
  410. package/dist/with/index.js.map +1 -0
  411. package/dist/{with-materialized-view-BLkQxoQN.d.ts → with-materialized-view-BUmzlXue.d.ts} +1 -1
  412. package/dist/{with-overlayed-view-CRsSEwHR.d.ts → with-overlayed-view-m4FaXXTO.d.ts} +2 -3
  413. package/dist/with-rollup-DEKGI9vb.d.ts +47 -0
  414. package/dist/withdraw-accessible-WLV4MTEN.js +28 -0
  415. package/dist/withdraw-accessible-WLV4MTEN.js.map +1 -0
  416. package/dist/zod-HAJM7LMS.js +14763 -0
  417. package/dist/zod-HAJM7LMS.js.map +1 -0
  418. package/package.json +122 -202
  419. package/dist/aggregate/index.cjs.map +0 -1
  420. package/dist/aggregate/index.d.cts +0 -38
  421. package/dist/attestation/index.cjs +0 -305
  422. package/dist/attestation/index.cjs.map +0 -1
  423. package/dist/attestation/index.d.cts +0 -52
  424. package/dist/blobs/index.cjs +0 -1480
  425. package/dist/blobs/index.cjs.map +0 -1
  426. package/dist/blobs/index.d.cts +0 -46
  427. package/dist/bundle/index.cjs +0 -19264
  428. package/dist/bundle/index.cjs.map +0 -1
  429. package/dist/bundle/index.d.cts +0 -176
  430. package/dist/chunk-22DWZL57.js.map +0 -1
  431. package/dist/chunk-2GLDA55J.js.map +0 -1
  432. package/dist/chunk-2QR2PQTT.js.map +0 -1
  433. package/dist/chunk-2WUSG3IT.js.map +0 -1
  434. package/dist/chunk-3BFJOWSU.js.map +0 -1
  435. package/dist/chunk-3YPCK6JX.js.map +0 -1
  436. package/dist/chunk-53XBRIRT.js.map +0 -1
  437. package/dist/chunk-5T22KDPN.js.map +0 -1
  438. package/dist/chunk-5XHKQ56N.js +0 -340
  439. package/dist/chunk-5XHKQ56N.js.map +0 -1
  440. package/dist/chunk-6CME4UEK.js +0 -10329
  441. package/dist/chunk-6CME4UEK.js.map +0 -1
  442. package/dist/chunk-6STK5TQP.js +0 -139
  443. package/dist/chunk-6STK5TQP.js.map +0 -1
  444. package/dist/chunk-A3JMGXPG.js.map +0 -1
  445. package/dist/chunk-B6PB7JLN.js.map +0 -1
  446. package/dist/chunk-BVRYKATC.js.map +0 -1
  447. package/dist/chunk-DE6GKS6G.js +0 -79
  448. package/dist/chunk-DE6GKS6G.js.map +0 -1
  449. package/dist/chunk-DFMLEQZB.js.map +0 -1
  450. package/dist/chunk-DJHHA6XH.js.map +0 -1
  451. package/dist/chunk-DL3HWOQ5.js.map +0 -1
  452. package/dist/chunk-DONMZAD2.js.map +0 -1
  453. package/dist/chunk-EMIGCR7X.js.map +0 -1
  454. package/dist/chunk-F3GDRNUT.js.map +0 -1
  455. package/dist/chunk-FZU343FL.js.map +0 -1
  456. package/dist/chunk-H2X3ISXG.js.map +0 -1
  457. package/dist/chunk-HNRHLRDC.js.map +0 -1
  458. package/dist/chunk-I5FOWO4J.js.map +0 -1
  459. package/dist/chunk-J66GRPNH.js.map +0 -1
  460. package/dist/chunk-JWRVQKRZ.js.map +0 -1
  461. package/dist/chunk-K3DK3NU5.js.map +0 -1
  462. package/dist/chunk-ML236QKC.js.map +0 -1
  463. package/dist/chunk-NONAAENK.js.map +0 -1
  464. package/dist/chunk-O3VZPBZG.js.map +0 -1
  465. package/dist/chunk-OIF6LZUR.js.map +0 -1
  466. package/dist/chunk-OQ6PIGHA.js +0 -19
  467. package/dist/chunk-OQ6PIGHA.js.map +0 -1
  468. package/dist/chunk-PE2FR4J3.js.map +0 -1
  469. package/dist/chunk-PP6W64Y3.js.map +0 -1
  470. package/dist/chunk-PX35GA7L.js.map +0 -1
  471. package/dist/chunk-QEILDE6R.js +0 -793
  472. package/dist/chunk-QEILDE6R.js.map +0 -1
  473. package/dist/chunk-QODLLGQ7.js.map +0 -1
  474. package/dist/chunk-RAZ4OVLL.js +0 -51
  475. package/dist/chunk-RAZ4OVLL.js.map +0 -1
  476. package/dist/chunk-SYMWGEET.js.map +0 -1
  477. package/dist/chunk-T7JEBOGN.js.map +0 -1
  478. package/dist/chunk-TFBP23BX.js.map +0 -1
  479. package/dist/chunk-TV3YZ35S.js.map +0 -1
  480. package/dist/chunk-U26HQ6KJ.js.map +0 -1
  481. package/dist/chunk-UF3BUNQZ.js +0 -1
  482. package/dist/chunk-UMLVJTYV.js +0 -20
  483. package/dist/chunk-UMLVJTYV.js.map +0 -1
  484. package/dist/chunk-VTKGMEPP.js.map +0 -1
  485. package/dist/chunk-W6EQLGMB.js +0 -100
  486. package/dist/chunk-W6EQLGMB.js.map +0 -1
  487. package/dist/chunk-WIRRPTFH.js +0 -17
  488. package/dist/chunk-WIRRPTFH.js.map +0 -1
  489. package/dist/chunk-WPLVTJ5D.js.map +0 -1
  490. package/dist/chunk-XJFLDA7A.js.map +0 -1
  491. package/dist/chunk-Z6FNBOTC.js.map +0 -1
  492. package/dist/chunk-ZYWZWG6G.js.map +0 -1
  493. package/dist/consent/index.cjs +0 -204
  494. package/dist/consent/index.cjs.map +0 -1
  495. package/dist/consent/index.d.cts +0 -25
  496. package/dist/crdt/index.cjs +0 -152
  497. package/dist/crdt/index.cjs.map +0 -1
  498. package/dist/crdt/index.d.cts +0 -30
  499. package/dist/crypto-HTZ4FJOP.js +0 -44
  500. package/dist/delegation-RI54P6I5.js +0 -17
  501. package/dist/derivations/index.cjs +0 -351
  502. package/dist/derivations/index.cjs.map +0 -1
  503. package/dist/derivations/index.d.cts +0 -72
  504. package/dist/dev-unlock-BIoEFbwm.d.cts +0 -263
  505. package/dist/executor-5PNY7LGW.js +0 -8
  506. package/dist/executor-B4QIYGZX.js +0 -8
  507. package/dist/executor-BWXXDQ7K.js +0 -11
  508. package/dist/fanout-sidecar-OKPMMPLG.js +0 -51
  509. package/dist/fanout-sidecar-OKPMMPLG.js.map +0 -1
  510. package/dist/guards/index.cjs +0 -322
  511. package/dist/guards/index.cjs.map +0 -1
  512. package/dist/guards/index.d.cts +0 -31
  513. package/dist/hash-HJqD14vS.d.ts +0 -63
  514. package/dist/history/index.cjs +0 -1222
  515. package/dist/history/index.cjs.map +0 -1
  516. package/dist/history/index.d.cts +0 -63
  517. package/dist/i18n/index.cjs +0 -1100
  518. package/dist/i18n/index.cjs.map +0 -1
  519. package/dist/i18n/index.d.cts +0 -39
  520. package/dist/index-4fBVt8j9.d.cts +0 -2387
  521. package/dist/index-D8I_pyJD.d.ts +0 -2387
  522. package/dist/index.cjs +0 -24487
  523. package/dist/index.cjs.map +0 -1
  524. package/dist/index.d.cts +0 -776
  525. package/dist/indexing/index.cjs +0 -742
  526. package/dist/indexing/index.cjs.map +0 -1
  527. package/dist/indexing/index.d.cts +0 -36
  528. package/dist/issue-VGDPP4B5.js +0 -12
  529. package/dist/lazy-builder-7tIpFyWN.d.ts +0 -304
  530. package/dist/lazy-builder-wY4pMCEe.d.cts +0 -304
  531. package/dist/ledger-TMRZYNVJ.js +0 -33
  532. package/dist/materialized-views/index.cjs +0 -854
  533. package/dist/materialized-views/index.cjs.map +0 -1
  534. package/dist/materialized-views/index.d.cts +0 -186
  535. package/dist/mime-magic-CBBSOkjm.d.cts +0 -50
  536. package/dist/mime-magic-CBBSOkjm.d.ts +0 -50
  537. package/dist/noydb-G725ZSZG.js +0 -34
  538. package/dist/overlay-views/index.cjs +0 -359
  539. package/dist/overlay-views/index.cjs.map +0 -1
  540. package/dist/overlay-views/index.d.cts +0 -82
  541. package/dist/periods/index.cjs +0 -1041
  542. package/dist/periods/index.cjs.map +0 -1
  543. package/dist/periods/index.d.cts +0 -22
  544. package/dist/predicate-BSAGEyu5.d.cts +0 -209
  545. package/dist/predicate-BSAGEyu5.d.ts +0 -209
  546. package/dist/query/index.cjs +0 -2375
  547. package/dist/query/index.cjs.map +0 -1
  548. package/dist/query/index.d.cts +0 -3
  549. package/dist/read-only-facade-ITU6L7BL.js +0 -7
  550. package/dist/registry-3QP3YKQS.js +0 -8
  551. package/dist/registry-DKEXOJVO.js +0 -7
  552. package/dist/registry-OJIOSBV6.js +0 -10
  553. package/dist/registry-USRVT6YF.js +0 -8
  554. package/dist/revoke-JCC7N56X.js +0 -17
  555. package/dist/session/index.cjs +0 -495
  556. package/dist/session/index.cjs.map +0 -1
  557. package/dist/session/index.d.cts +0 -46
  558. package/dist/shadow/index.cjs +0 -133
  559. package/dist/shadow/index.cjs.map +0 -1
  560. package/dist/shadow/index.d.cts +0 -17
  561. package/dist/signer-72QAUSVW.js +0 -18
  562. package/dist/snapshots/index.cjs +0 -937
  563. package/dist/snapshots/index.cjs.map +0 -1
  564. package/dist/snapshots/index.d.cts +0 -28
  565. package/dist/store/index.cjs +0 -1083
  566. package/dist/store/index.cjs.map +0 -1
  567. package/dist/store/index.d.cts +0 -492
  568. package/dist/store/index.d.ts +0 -492
  569. package/dist/store/index.js +0 -37
  570. package/dist/strategy-BSxFXGzb.d.cts +0 -110
  571. package/dist/strategy-BSxFXGzb.d.ts +0 -110
  572. package/dist/strategy-DSTrsZ8t.d.cts +0 -601
  573. package/dist/strategy-DSTrsZ8t.d.ts +0 -601
  574. package/dist/sync/index.cjs +0 -1062
  575. package/dist/sync/index.cjs.map +0 -1
  576. package/dist/sync/index.d.cts +0 -43
  577. package/dist/team/index.cjs +0 -2798
  578. package/dist/team/index.cjs.map +0 -1
  579. package/dist/team/index.d.cts +0 -118
  580. package/dist/tx/index.cjs +0 -544
  581. package/dist/tx/index.cjs.map +0 -1
  582. package/dist/tx/index.d.cts +0 -21
  583. package/dist/types-Df28QFKb.d.ts +0 -12818
  584. package/dist/types-DyXYr8rE.d.cts +0 -12818
  585. package/dist/ulid-COREQ2RQ.js +0 -9
  586. package/dist/ulid-Drr7ykr6.d.cts +0 -603
  587. package/dist/util/index.cjs +0 -230
  588. package/dist/util/index.cjs.map +0 -1
  589. package/dist/util/index.d.cts +0 -77
  590. package/dist/with-derivation-DFnFByiQ.d.ts +0 -13
  591. package/dist/with-derivation-DU3Sjazm.d.cts +0 -13
  592. package/dist/with-guard-ByyxmEe7.d.cts +0 -18
  593. package/dist/with-guard-qube6BMI.d.ts +0 -18
  594. package/dist/with-materialized-view-BmEToIR1.d.cts +0 -27
  595. package/dist/with-overlayed-view-BMsQQbWm.d.cts +0 -13
  596. /package/dist/{chunk-UF3BUNQZ.js.map → api-TX2EX2FX.js.map} +0 -0
  597. /package/dist/{store → as}/index.js.map +0 -0
  598. /package/dist/{crypto-HTZ4FJOP.js.map → at/index.js.map} +0 -0
  599. /package/dist/{delegation-RI54P6I5.js.map → by/index.js.map} +0 -0
  600. /package/dist/{executor-5PNY7LGW.js.map → cargo/index.js.map} +0 -0
  601. /package/dist/{executor-B4QIYGZX.js.map → chunk-CHFZDSE4.js.map} +0 -0
  602. /package/dist/{executor-BWXXDQ7K.js.map → chunk-GHVIKOHT.js.map} +0 -0
  603. /package/dist/{issue-VGDPP4B5.js.map → chunk-PZ5AY32C.js.map} +0 -0
  604. /package/dist/{ledger-TMRZYNVJ.js.map → classified/index.js.map} +0 -0
  605. /package/dist/{noydb-G725ZSZG.js.map → collection-facade-LVD22JLM.js.map} +0 -0
  606. /package/dist/{public-envelope-BW6OXORV.js.map → computed-EXDMQODG.js.map} +0 -0
  607. /package/dist/{read-only-facade-ITU6L7BL.js.map → delegation-BJP73GAP.js.map} +0 -0
  608. /package/dist/{registry-3QP3YKQS.js.map → derive-BME7HDWO.js.map} +0 -0
  609. /package/dist/{registry-DKEXOJVO.js.map → enclave-NHORSWSF.js.map} +0 -0
  610. /package/dist/{registry-OJIOSBV6.js.map → executor-FE6X4LFX.js.map} +0 -0
  611. /package/dist/{registry-USRVT6YF.js.map → executor-KSHKRJXP.js.map} +0 -0
  612. /package/dist/{revoke-JCC7N56X.js.map → executor-ZHTJJICG.js.map} +0 -0
  613. /package/dist/{signer-72QAUSVW.js.map → export-accessible-DACHM5VT.js.map} +0 -0
  614. /package/dist/{stale-6ZDBTQT7.js.map → extract-partition-RNENZZ4T.js.map} +0 -0
  615. /package/dist/{ulid-COREQ2RQ.js.map → find-BNGBJNKP.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-party/team/deed.ts","../src/with-party/custody/liberate.ts"],"sourcesContent":["/**\n * FR-6 — Deed: sealed / hidden-owner provisioning.\n *\n * A **Deed** is a vault owned by a *latent* principal who never\n * authenticates. The owner credential (the random passphrase that\n * derives `KEK_owner`) is minted machine-side and sealed under a\n * **non-firm** {@link SealingKeyProvider} — that sealing boundary is\n * the cryptographic *inalienability anchor*: whoever holds the\n * provider (the client / their KMS) is the only party that can ever\n * re-derive `KEK_owner`. A firm-side custodian operates the vault\n * fully but can never reach the owner key — there is deliberately NO\n * firm-controlled fallback.\n *\n * Provisioning reuses the managed-mode seam:\n * - {@link resolveManagedSecret} mints + seals + persists the random\n * passphrase at `_meta/sealed-passphrase` (and unseals it on every\n * subsequent open through the same provider).\n * - {@link createOwnerKeyring} derives `KEK_owner` from that\n * passphrase and writes the `_keyring/<ownerUserId>` file.\n *\n * On top of that, a Deed writes a `_meta/deed` **marker**. The marker\n * is PLAINTEXT metadata — it records WHO the latent owner is and WHICH\n * sealing boundary protects them, so it must be readable without\n * unlocking the vault (a custodian or auditor inspecting the vault must\n * be able to see \"this is a Deed vault, owner = X, sealed under Y\"\n * without any key). The marker itself is therefore never sealed; only\n * the owner *credential* is.\n *\n * @module\n */\n\nimport type { NoydbStore, EncryptedEnvelope } from '../../kernel/types.js'\nimport { NOYDB_FORMAT_VERSION } from '../../kernel/types.js'\nimport type { UnlockedKeyring } from './keyring.js'\nimport { createOwnerKeyring } from './keyring.js'\nimport type { SealingKeyProvider } from './managed-passphrase.js'\nimport { resolveManagedSecret } from './managed-passphrase.js'\n\n/** Reserved id for the Deed marker under `_meta`. */\nexport const DEED_RECORD_ID = 'deed' as const\n\n/**\n * Plaintext metadata recording a vault's latent-owner Deed. Persisted\n * at `_meta/deed`. Readable without unlocking the vault by design — it\n * carries no secret material, only the identity of the latent owner\n * and the sealing boundary that anchors inalienability.\n */\nexport interface DeedMarker {\n /** The latent owner principal — the user id of the `_keyring/<id>` owner file. */\n readonly ownerUserId: string\n /**\n * The `SealingKeyProvider.id` the owner credential is sealed under.\n * The inalienability anchor: only the holder of this (non-firm)\n * provider can re-derive `KEK_owner`. Audit metadata — never secret.\n */\n readonly sealedUnder: string\n /** Always `true` for a Deed — the owner never authenticates interactively. */\n readonly latent: true\n /** ISO-8601 timestamp the Deed was issued. */\n readonly issuedAt: string\n /**\n * ISO-8601 timestamp the vault was liberated (a new owner claimed it\n * via the audited Liberate ceremony), if any. Absent until liberation.\n */\n readonly liberatedAt?: string\n}\n\n/**\n * Wire-format payload stored inside the `_meta/deed` envelope. Carries\n * a magic marker for forensics + the {@link DeedMarker} fields. JSON,\n * AES-GCM bypassed (the marker is plaintext metadata by design).\n */\ninterface DeedEnvelopePayload extends DeedMarker {\n readonly _noydb_deed: 1\n}\n\n/**\n * Provision a Deed: a latent owner whose credential is sealed under\n * `sealing` (a NON-firm provider). Mints + seals the owner passphrase\n * via {@link resolveManagedSecret}, derives the owner keyring via\n * {@link createOwnerKeyring}, then writes the plaintext `_meta/deed`\n * marker. Returns the unlocked owner keyring.\n *\n * The returned keyring is the only in-memory window onto `KEK_owner`\n * for this call; the persistent re-entry point is the sealing provider\n * (re-run {@link resolveManagedSecret} with the same provider to\n * re-resolve the passphrase, then {@link createOwnerKeyring}/load to\n * unlock — no interactive passphrase is ever required).\n *\n * There is deliberately no firm-controlled fallback: the marker's\n * `sealedUnder` is the single cryptographic anchor of ownership.\n */\nexport async function createDeedOwner(\n store: NoydbStore,\n vault: string,\n ownerUserId: string,\n sealing: SealingKeyProvider,\n): Promise<UnlockedKeyring> {\n // 1. Mint + seal + persist the random owner passphrase under the\n // non-firm provider (writes _meta/sealed-passphrase).\n const passphrase = await resolveManagedSecret(store, vault, sealing)\n\n // 2. Derive KEK_owner from the (never-human-seen) passphrase and\n // write the owner keyring file.\n const keyring = await createOwnerKeyring(store, vault, ownerUserId, passphrase)\n\n // 3. Write the plaintext Deed marker. NOT sealed — it is audit\n // metadata that must be readable without unlocking.\n await saveDeedMarker(store, vault, {\n ownerUserId,\n sealedUnder: sealing.id,\n latent: true,\n issuedAt: new Date().toISOString(),\n })\n\n return keyring\n}\n\n/**\n * Read the {@link DeedMarker} from `_meta/deed`, or `null` if the vault\n * has no Deed marker (i.e. it is not a Deed vault). Plaintext read — no\n * unlocking required.\n */\nexport async function loadDeedMarker(\n store: NoydbStore,\n vault: string,\n): Promise<DeedMarker | null> {\n const envelope = await store.get(vault, '_meta', DEED_RECORD_ID)\n if (!envelope) return null\n let payload: unknown\n try {\n payload = JSON.parse(envelope._data)\n } catch {\n return null\n }\n if (typeof payload !== 'object' || payload === null) return null\n const r = payload as Record<string, unknown>\n if (r._noydb_deed !== 1) return null\n if (\n typeof r.ownerUserId !== 'string'\n || typeof r.sealedUnder !== 'string'\n || r.latent !== true\n || typeof r.issuedAt !== 'string'\n ) {\n return null\n }\n const marker: DeedMarker = {\n ownerUserId: r.ownerUserId,\n sealedUnder: r.sealedUnder,\n latent: true,\n issuedAt: r.issuedAt,\n ...(typeof r.liberatedAt === 'string' ? { liberatedAt: r.liberatedAt } : {}),\n }\n return marker\n}\n\n/** Whether `vault` carries a Deed marker (a sealed/latent owner). */\nexport async function isDeedVault(\n store: NoydbStore,\n vault: string,\n): Promise<boolean> {\n return (await loadDeedMarker(store, vault)) !== null\n}\n\n/**\n * Persist a {@link DeedMarker} at `_meta/deed`. Mirrors\n * `saveSealedPassphrase`'s envelope shape: a standard\n * {@link EncryptedEnvelope} with AES-GCM bypassed (`_iv: ''`), the\n * payload stored as plaintext JSON in `_data`. The marker is metadata,\n * not a secret — sealing it would defeat its purpose (auditors /\n * custodians must read it without a key).\n *\n * @internal — used by `createDeedOwner` and (later) the Liberate\n * ceremony to stamp `liberatedAt`.\n */\nexport async function saveDeedMarker(\n store: NoydbStore,\n vault: string,\n marker: DeedMarker,\n): Promise<void> {\n const persisted: DeedEnvelopePayload = { _noydb_deed: 1, ...marker }\n const prior = await store.get(vault, '_meta', DEED_RECORD_ID)\n const env: EncryptedEnvelope = {\n _noydb: NOYDB_FORMAT_VERSION,\n _v: (prior?._v ?? 0) + 1,\n _ts: new Date().toISOString(),\n // AES-GCM bypassed — the marker is plaintext audit metadata.\n _iv: '',\n _data: JSON.stringify(persisted),\n }\n await store.put(vault, '_meta', DEED_RECORD_ID, env)\n}\n","/**\n * `liberateVault` — the audited claim of ownership over a\n * sealed-owner (Deed) vault. The inverse of withdrawal.\n *\n * A **Deed** vault's owner credential is sealed under a non-firm provider, so\n * the firm-side **custodian** (which holds every collection DEK and operates\n * the vault fully) can never reach `KEK_owner`. Liberation is the ONLY route\n * by which a custodian assumes ownership, and it is deliberately a manual,\n * audited ceremony:\n *\n * 1. gate `'liberate-vault'` (fail-closed)\n * 2. caller MUST be the `custodian` (the de-facto authority holding the DEKs)\n * 3. freeze a PRE-liberation EVIDENCE snapshot (hash-pinned in the ledger) —\n * but PRESERVE the live data for the new owner (see the freeze decision\n * below)\n * 4. mint a NEW owner keyring re-wrapping the incumbent DEKs under the new\n * owner's KEK\n * 5. lifecycle ledger `liberation-claimed:<newOwnerId>:<legalBasis>`\n * 6. stamp the `_meta/deed` marker with `liberatedAt`\n *\n * ## Security: the inalienability floor\n *\n * Liberation **mints a new owner from the custodian's DEKs** — it does NOT\n * unseal the original sealed owner. The old sealed-owner credential is left\n * untouched and ORPHANED (its `_keyring/<id>` file remains, its KEK is still\n * sealed under the non-firm provider), never impersonated. The new owner is a\n * DISTINCT principal under a fresh KEK derived from `newOwnerPassphrase`. This\n * preserves the inalienability floor: the act of claiming ownership is itself\n * auditable and produces a different principal, rather than silently assuming\n * the latent owner's identity.\n *\n * ## Freeze decision: snapshot-only, not freeze-and-delete\n *\n * `freezeAndDeleteClosure` (withdraw-accessible.ts) writes a hash-pinned\n * snapshot and THEN delete-closures the live records — correct for a\n * destructive withdrawal, WRONG for liberation. Liberation transfers\n * operational continuity; it must leave the live data intact for the new\n * owner. We therefore call the snapshot-only core `freezeSnapshotOnly`\n * (factored out of that module; the freeze-AND-delete withdrawal path is\n * unchanged) to pin the evidence snapshot while preserving the records.\n *\n * @module\n */\n\nimport type { Vault } from '../../kernel/vault.js'\nimport type { FactorProofBundle, KeyringFile } from '../../kernel/types.js'\nimport { PermissionDeniedError } from '../../kernel/errors.js'\nimport { wrapKey } from '../../kernel/enclave/index.js'\nimport { createOwnerKeyring } from '../team/keyring.js'\nimport type { FrozenSnapshotRef } from '../../with-audit/portability/withdraw-accessible.js'\nimport { freezeSnapshotOnly } from '../../with-audit/portability/withdraw-accessible.js'\nimport { loadDeedMarker, saveDeedMarker } from '../team/deed.js'\n\nexport interface LiberateOptions {\n /** The id of the new owner principal the custodian mints by claiming ownership. */\n readonly newOwnerId: string\n /** The passphrase that derives the new owner's KEK (the DEKs are re-wrapped under it). */\n readonly newOwnerPassphrase: string\n /** Legal/contractual basis recorded in the audit (e.g. 'contractual-handover'). */\n readonly legalBasis: string\n readonly factors?: FactorProofBundle\n}\n\nexport interface LiberateResult {\n /** The hash-pinned pre-liberation evidence snapshot. */\n readonly snapshot: FrozenSnapshotRef\n}\n\n/**\n * Audited claim of ownership over a sealed-owner vault by its custodian. See\n * the module doc for the full ceremony + security rationale.\n */\nexport async function liberateVault(\n vault: Vault,\n opts: LiberateOptions,\n): Promise<LiberateResult> {\n // 1. gate — fail-closed `liberate-vault`.\n await vault.noydb.checkGate(vault.name, 'liberate-vault', opts.factors)\n\n // 2. caller must be the custodian (the de-facto authority holding the DEKs).\n const { name: vaultName, adapter, keyring } = vault._introspectState()\n if (keyring.role !== 'custodian') {\n throw new PermissionDeniedError(\n 'liberation is claimed only by the custodian (the de-facto authority holding the DEKs)',\n )\n }\n\n // Refuse to clobber an existing principal: the new owner must be a FRESH id.\n // (Checked before any side effect so a colliding id never leaves a half-run\n // ceremony — no orphan snapshot, no partial keyring overwrite.)\n const existing = await adapter.get(vaultName, '_keyring', opts.newOwnerId)\n if (existing) {\n throw new PermissionDeniedError(\n `liberateVault: newOwnerId \"${opts.newOwnerId}\" already exists as a principal; choose a fresh id (liberation mints a distinct owner, it never overwrites an existing keyring)`,\n )\n }\n\n // 3. Pre-liberation EVIDENCE snapshot of every operational collection —\n // snapshot-only (live data preserved for the new owner; liberation\n // transfers operational continuity, it does not erase).\n const collections = await listOperationalCollections(vault)\n const snapshot = await freezeSnapshotOnly(vault, collections, { actorUserId: keyring.userId })\n\n // 4. Mint a NEW owner keyring, re-wrapping the incumbent DEKs under the new\n // owner's fresh KEK. The old sealed owner is NOT unsealed — a DISTINCT\n // principal is minted and the original owner credential is left orphaned\n // (inalienability floor). Mirrors adopt-partition.ts's DEK re-wrap.\n const newOwner = await createOwnerKeyring(adapter, vaultName, opts.newOwnerId, opts.newOwnerPassphrase)\n if (!newOwner.kek) {\n throw new PermissionDeniedError(\n `new owner keyring for \"${opts.newOwnerId}\" has no KEK to re-wrap the incumbent DEKs under`,\n )\n }\n const env = await adapter.get(vaultName, '_keyring', opts.newOwnerId)\n if (!env) {\n throw new PermissionDeniedError(`new owner keyring for \"${opts.newOwnerId}\" did not persist`)\n }\n const keyringFile = JSON.parse(env._data) as KeyringFile\n const mergedDeks: Record<string, string> = { ...keyringFile.deks }\n for (const [collection, dek] of keyring.deks) {\n mergedDeks[collection] = await wrapKey(dek, newOwner.kek)\n }\n const mergedFile: KeyringFile = { ...keyringFile, deks: mergedDeks }\n await adapter.put(vaultName, '_keyring', opts.newOwnerId, { ...env, _data: JSON.stringify(mergedFile) })\n\n // 5. Lifecycle ledger audit (no-op if the history strategy is absent).\n await vault._getLedgerOrNull()?.append({\n op: 'lifecycle', collection: '', id: '', version: 0, actor: opts.newOwnerId, payloadHash: '',\n reason: `liberation-claimed:${opts.newOwnerId}:${opts.legalBasis}`,\n })\n\n // 6. Stamp the Deed marker with `liberatedAt` (if a marker exists).\n const marker = await loadDeedMarker(adapter, vaultName)\n if (marker) {\n await saveDeedMarker(adapter, vaultName, { ...marker, liberatedAt: new Date().toISOString() })\n }\n\n return { snapshot }\n}\n\n/**\n * Enumerate the vault's operational (user-facing) collections — those carried\n * by the caller's keyring DEK map, minus the reserved internal collections\n * (`_*`). These are the collections frozen into the evidence snapshot.\n */\nasync function listOperationalCollections(vault: Vault): Promise<readonly string[]> {\n const { keyring } = vault._introspectState()\n return [...keyring.deks.keys()].filter((c) => !c.startsWith('_'))\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,29 @@
1
+ import {
2
+ NoydbError
3
+ } from "./chunk-S7VFUQM2.js";
4
+
5
+ // src/kernel/via/index.ts
6
+ var binders = /* @__PURE__ */ new Map();
7
+ function installViaBinder(brand, binder) {
8
+ if (!binders.has(brand)) binders.set(brand, binder);
9
+ }
10
+ function isViaInstalled(brand) {
11
+ return binders.has(brand);
12
+ }
13
+ function viaBinder(brand) {
14
+ const b = binders.get(brand);
15
+ if (!b) {
16
+ throw new NoydbError(
17
+ "VIA_NOT_LINKED",
18
+ `via feature "${brand}" requires descriptors created via its declaration factory from @noy-db/hub`
19
+ );
20
+ }
21
+ return b;
22
+ }
23
+
24
+ export {
25
+ installViaBinder,
26
+ isViaInstalled,
27
+ viaBinder
28
+ };
29
+ //# sourceMappingURL=chunk-VEAVKDDB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/kernel/via/index.ts"],"sourcesContent":["// kernel/via/index.ts — the ONLY kernel-resident via surface.\nimport { NoydbError } from '../errors.js'\nimport type { EncryptedEnvelope } from '../types.js'\n\n/** Awaitable type for potentially async results. */\ntype Awaitable<T> = T | Promise<T>\n\n/** Declared security posture — a property the kernel enforces (enforcement activates in phases B/C). */\nexport interface ViaPosture {\n readonly encryptedAtRest: 'envelope' | 'sealed'\n readonly queryable: 'none' | 'det-exact' | 'ordered' | 'full'\n readonly exportable: boolean\n readonly forgettable: boolean\n}\n\n/** Opaque marker every feature descriptor extends; the kernel never sees concrete descriptor types. */\nexport interface ViaDescriptor { readonly _viaBrand: string }\n\n/** Per-call write context (A: minimal; B/C extend). */\nexport interface ViaWriteCtx {\n readonly id: string\n /** Owning vault name (event payload identity — e.g. i18n:script-violation). */\n readonly vault: string\n /** Prior stored record (decoded), lazily resolved. Null when creating. */\n readonly prior: () => Promise<Record<string, unknown> | null>\n /** Typed event emission (e.g. i18n:script-violation). */\n readonly emit: (event: string, payload: unknown) => void\n}\n\n/** Per-call read context — mirrors LocaleReadOptions loosely; features narrow. */\nexport interface ViaReadCtx {\n readonly locale?: unknown\n readonly fallback?: unknown\n readonly layer: string\n}\n\n/** One sealed slot's ciphertext — matches the existing `iv:data` sealed map entries (seam map §2 step 2). */\nexport interface SealedSlotRef { readonly iv: string; readonly data: string }\n\n/**\n * A scoped crypto capability handed to a `via` feature's `encodeAtRest`/\n * `decodeAtRest`/`erase` hooks — never the keyring, never the enclave.\n * `sealedSlots` is pre-bound to one `(collection, recordId)`; `reservedEnvelopes`\n * is a whole-envelope encrypt/decrypt door scoped to collection names under a\n * declared prefix (e.g. `_dict_`).\n */\nexport interface ViaCryptoCtx {\n readonly sealedSlots: {\n seal(field: string, plaintext: unknown): Promise<SealedSlotRef>\n unseal(field: string, ref: SealedSlotRef): Promise<unknown>\n delete(field: string): Promise<void>\n }\n reservedEnvelopes(prefix: string): {\n encrypt(collection: string, json: string, v: number): Promise<EncryptedEnvelope>\n decrypt(collection: string, env: EncryptedEnvelope): Promise<string>\n }\n}\n\n/** Per-call erase context — `forget()`'s per-ref participation door (phase C). */\nexport interface ViaEraseCtx { readonly id: string; readonly vault: string; readonly live: unknown /* EncryptedEnvelope */; readonly crypto: ViaCryptoCtx }\n/**\n * What an `erase` hook reports back to `forget()`'s summary ledger entry.\n * `retainedShared` is additive (#629 Task 10) — content NOT erased because\n * still referenced by another live record (blob's shared-chunk dual\n * accounting, `shredAllForRecord()`'s `retainedShared` count). Absent/0 for\n * bindings with no such concept (a sealed field is never \"shared\").\n */\nexport interface ViaEraseReport { readonly shredded: number; readonly residue: readonly unknown[]; readonly retainedShared?: number }\n\n/**\n * A feature bound to one collection's declared config. Record-grain hooks —\n * every hook receives the whole record (matches the real engine signatures,\n * e.g. quantizeMoneyFields(record, moneyFields)). All hooks optional;\n * absent = passthrough. Query-participation hooks are SYNC (#553).\n */\nexport interface ViaBinding {\n readonly brand: string\n readonly posture: ViaPosture\n /** Declared dependencies (field paths / cross-record specs). MANDATORY for any future\n * derive-bearing binding — phase C validates well-formedness (strings, non-empty,\n * reference declared fields) and graph-registers a derived edge for each covered\n * field at declare time, right after `compileViaBindings` builds the bindings\n * (unknown source field throws `ValidationError`). See\n * `kernel/collection-config.ts`'s `resolveViaBindingDepsEdges`. */\n readonly deps?: readonly string[]\n /** Collection-name prefixes this binding's `reservedEnvelopes` capability may address (e.g. `_dict_`). */\n readonly reservedPrefixes?: readonly string[]\n /**\n * Does this binding own `field`? Backs `ViaPipeline.postureFor` (#629 Task\n * 8's posture consumer) — a passive coverage check, independent of\n * `buildClause`/`compareForOrder` (which some bindings, e.g. classified and\n * blob, never define). SYNC, no side effects.\n *\n * Contract (documentation only — not enforced at runtime, future work):\n * any binding declaring a non-default posture value — `queryable: 'none'`\n * (#629 Task 8) or `exportable: false` (#629 Task 9's `redactForExport`)\n * — MUST implement `covers()`. `postureFor`'s consumers only engage for\n * fields a binding actively claims via `covers()`; a binding that omits\n * it would silently fall through to the generic (unrefused/unredacted)\n * path instead.\n */\n covers?(field: string): boolean\n // NOTE: phase C adds a `derive` hook ADDITIVELY — do not stub it now.\n // ── write pipeline ──\n /** Refuse a write before crypto runs (classified step-3 slot: storage:'never' rejection + validators). Throws to refuse. */\n enforceWrite?(record: Record<string, unknown>, ctx: ViaWriteCtx): void | Promise<void>\n /** First pipeline stage (money canonicalizeIncomingMoney). SYNC. */\n ingest?(record: Record<string, unknown>): Record<string, unknown>\n /** Decode STORED form to canonical for internal boundaries (gates, derivations, patch bases). SYNC. */\n canonicalizeStored?(record: Record<string, unknown>): Record<string, unknown>\n /** Post-validation write encoding (money quantize; i18n translate→script→validate→densify). May be async. */\n encodeWrite?(record: Record<string, unknown>, ctx: ViaWriteCtx): Awaitable<Record<string, unknown>>\n /** Final write-pipeline stage: seal/encrypt declared fields via `crypto` before the envelope body is built (classified step-2 slot). */\n encodeAtRest?(record: Record<string, unknown>, crypto: ViaCryptoCtx): Promise<{ record: Record<string, unknown>; sealed?: Record<string, SealedSlotRef> }>\n // ── read pipeline ──\n /** First read-pipeline stage: unseal/decrypt declared fields via `crypto` before `present` runs (classified sealed-handle slot). */\n decodeAtRest?(record: Record<string, unknown>, sealed: Record<string, SealedSlotRef>, crypto: ViaCryptoCtx, opts: { asHandles: boolean }): Promise<Record<string, unknown>>\n /** Read-time presentation (money decode+virtuals; i18n locale/labels/strip). May be async. */\n present?(record: Record<string, unknown>, ctx: ViaReadCtx): Awaitable<Record<string, unknown>>\n /**\n * Late read-time presentation (#669) — runs AFTER every binding's `present()` in the\n * money+computed present-order segment (`ViaPipeline`'s `_presentOrder`, `kernel/via/\n * pipeline.ts`), BEFORE the \"everything else\" segment (i18n/lookup dressing, taint\n * redaction) runs. Exists for a binding that needs to react to a virtual computed\n * field's fresh OWN-field output before anything dresses it (money's MAJOR-UNITS\n * quantize-and-present for a field that is BOTH money AND `mode:'virtual'` computed) —\n * `present()` alone can't express \"run after computed for THESE fields only, before\n * computed for all others\", since it's a per-BINDING fold, not per-field. Folded over\n * `bindings` in declaration order (mirrors every other per-binding fold), so lookup/\n * i18n dressing and taint/redaction (both in the \"everything else\" segment) still see\n * the already-dressed value.\n */\n presentLate?(record: Record<string, unknown>, ctx: ViaReadCtx): Awaitable<Record<string, unknown>>\n // ── query participation (ALL SYNC — #553) ──\n /** Returns an opaque clause payload when this binding covers `field`, else undefined. */\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n buildClause?(field: string, op: string, value: unknown): unknown | undefined\n /** Evaluate a payload produced by buildClause against a raw stored value. */\n evaluateClause?(actual: unknown, op: string, payload: unknown): boolean\n /**\n * Optional: the STORED-form operand for a direct secondary-index probe\n * against a payload produced by `buildClause` (#625) — lets\n * `candidateRecords()` (`query/builder.ts`) hit `CollectionIndexes.\n * lookupEqual`/`lookupIn` for `==`/`in` clauses instead of falling back\n * to a linear scan + per-record `evaluateClause`. Returning `undefined`\n * means \"no sound probe for this op/payload\" (e.g. a comparison whose\n * stored form isn't a single index-bucketable value, or an op the index\n * can't serve) — the caller falls back to the scan. A binding that\n * never implements this hook always falls back, unchanged from before\n * this hook existed.\n */\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n indexProbe?(op: string, payload: unknown): unknown | undefined\n /**\n * Optional: canonicalize a raw STORED field value into the bucket key an\n * eager index should use (#672) — lets `CollectionIndexes` group a\n * pre-declaration / non-canonical stored value (e.g. a money field's\n * leftover `'0100'` written before its `money()` declaration) under the\n * SAME key a canonical write produces (`'100'`), so the index-probe fast\n * path (`indexProbe` above) and the fallback scan (`evaluateClause`)\n * agree on which records match. `undefined` means \"not mine / can't\n * canonicalize this value\" — the caller buckets the raw stringified\n * value, unchanged from before this hook existed. MUST agree with what\n * this binding's own `evaluateClause`/`indexProbe` treat as equal, or\n * the fast path and the scan will disagree.\n */\n canonicalizeIndexKey?(field: string, rawValue: unknown): string | undefined\n /** Decode a raw stored record for query/scan results and callback views ('raw' — no virtuals). */\n decodeResults?(record: unknown): unknown\n /** Exact ordering for a covered field; undefined when the field is not covered. */\n compareForOrder?(field: string, a: unknown, b: unknown): number | undefined\n /**\n * Per-key, PER-CALL-locale label resolution for `orderBy(field, dir,\n * { by: 'label' })` (#650 Task 7) — the sibling `compareForOrder` above\n * structurally cannot serve, since it carries no locale parameter.\n * `locale` is the query's per-call locale (`undefined` for a locale-less\n * query — a binding may fall back to its own descriptor-level default,\n * mirroring `present`'s displayLocale hinge). `undefined` return = this\n * binding doesn't resolve a label for `key` at `field` — caller falls\n * back to the raw stored value, same graceful-degrade discipline every\n * other via query hook uses. SYNC (#553 — query participation).\n */\n resolveOrderLabel?(field: string, key: string, locale: string | undefined): string | undefined\n /** Rewrite an aggregate spec (money exact reducers). */\n wrapReducers?(spec: unknown): unknown\n // ── forget participation ──\n /** `forget()`'s per-ref erasure door — shred/report this binding's residue for one record (classified/blob forget participation). */\n erase?(ctx: ViaEraseCtx): Promise<ViaEraseReport>\n // ── introspection ──\n describeFragment?(): Record<string, unknown>\n}\n\n/** Binder: constructs a binding from a collection's declared config. Installed by the feature's declaration factory. */\nexport type ViaBinder = (config: unknown) => ViaBinding\n\nconst binders = new Map<string, ViaBinder>()\n\n/** @internal — called (idempotently, first-wins) by a feature's declaration factory, e.g. money(). */\nexport function installViaBinder(brand: string, binder: ViaBinder): void {\n if (!binders.has(brand)) binders.set(brand, binder)\n}\n\n/** @internal — registry presence check. Used by tests (mirrors isMoneyEngineInstalled) and by vault's i18n validator delegators as a no-i18n-ever-declared fast path. */\nexport function isViaInstalled(brand: string): boolean {\n return binders.has(brand)\n}\n\n/** @internal — resolve a binder; throws when the declaration factory never ran (hand-rolled descriptors). */\nexport function viaBinder(brand: string): ViaBinder {\n const b = binders.get(brand)\n if (!b) {\n throw new NoydbError(\n 'VIA_NOT_LINKED',\n `via feature \"${brand}\" requires descriptors created via its declaration factory from @noy-db/hub`,\n )\n }\n return b\n}\n"],"mappings":";;;;;AAmMA,IAAM,UAAU,oBAAI,IAAuB;AAGpC,SAAS,iBAAiB,OAAe,QAAyB;AACvE,MAAI,CAAC,QAAQ,IAAI,KAAK,EAAG,SAAQ,IAAI,OAAO,MAAM;AACpD;AAGO,SAAS,eAAe,OAAwB;AACrD,SAAO,QAAQ,IAAI,KAAK;AAC1B;AAGO,SAAS,UAAU,OAA0B;AAClD,QAAM,IAAI,QAAQ,IAAI,KAAK;AAC3B,MAAI,CAAC,GAAG;AACN,UAAM,IAAI;AAAA,MACR;AAAA,MACA,gBAAgB,KAAK;AAAA,IACvB;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -0,0 +1,29 @@
1
+ import {
2
+ decrypt,
3
+ deriveSealedFieldKey,
4
+ deriveSealedFieldKeyFromCek
5
+ } from "./chunk-3OPY6MK2.js";
6
+
7
+ // src/kernel/enclave/record-keys/sealed-slot.ts
8
+ function parseSealedSlot(blob) {
9
+ const sep = blob.indexOf(":");
10
+ return { iv: blob.slice(0, sep), data: blob.slice(sep + 1) };
11
+ }
12
+ async function dualReadSealedSlot(blob, field, collection, cek, dek) {
13
+ const { iv, data } = parseSealedSlot(blob);
14
+ if (cek !== void 0) {
15
+ try {
16
+ const fieldKey2 = await deriveSealedFieldKeyFromCek(cek, collection, field);
17
+ return await decrypt(iv, data, fieldKey2);
18
+ } catch {
19
+ }
20
+ }
21
+ const fieldKey = await deriveSealedFieldKey(dek, collection, field);
22
+ return decrypt(iv, data, fieldKey);
23
+ }
24
+
25
+ export {
26
+ parseSealedSlot,
27
+ dualReadSealedSlot
28
+ };
29
+ //# sourceMappingURL=chunk-VEPTFUJY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/kernel/enclave/record-keys/sealed-slot.ts"],"sourcesContent":["/**\n * Sealed-slot (`iv:data`) parsing + the CEK/DEK dual-read, factored out so the\n * three callers that decrypt a `_sealed[field]` slot share ONE implementation\n * with no coupling between them:\n *\n * - {@link RecordCodec.unsealField} / `classifySealedShred` (read + classify),\n * - `record-keys/sealing.ts:rotateRecordCek` (re-seal under a new CEK).\n *\n * These are pure helpers over an explicit `(cek, dek)` pair — NOT a context\n * object — so `sealing.ts` (which holds only the DEK) can import them without\n * pulling in the whole codec, avoiding a codec↔sealing dependency cycle.\n */\nimport { decrypt, deriveSealedFieldKey, deriveSealedFieldKeyFromCek } from '../crypto.js'\n\n/** Parse an `iv:data` sealed slot (split on the FIRST `:`). */\nexport function parseSealedSlot(blob: string): { iv: string; data: string } {\n const sep = blob.indexOf(':')\n return { iv: blob.slice(0, sep), data: blob.slice(sep + 1) }\n}\n\n/**\n * Dual-read: decrypt a sealed slot trying the CEK-derived field key first,\n * falling back to the collection-DEK field key. Legacy records\n * (even ones whose body is CEK-encrypted) are sealed under the collection-DEK\n * key; current writes seal under the per-record CEK. Try the CEK key first; on\n * its AES-GCM auth failure, fall back to the DEK key. Throws only if BOTH fail.\n * Returns the plaintext string (callers `JSON.parse` as needed).\n */\nexport async function dualReadSealedSlot(\n blob: string,\n field: string,\n collection: string,\n cek: CryptoKey | undefined,\n dek: CryptoKey,\n): Promise<string> {\n const { iv, data } = parseSealedSlot(blob)\n if (cek !== undefined) {\n try {\n const fieldKey = await deriveSealedFieldKeyFromCek(cek, collection, field)\n return await decrypt(iv, data, fieldKey)\n } catch {\n // fall through to the legacy collection-DEK derivation\n }\n }\n const fieldKey = await deriveSealedFieldKey(dek, collection, field)\n return decrypt(iv, data, fieldKey)\n}\n"],"mappings":";;;;;;;AAeO,SAAS,gBAAgB,MAA4C;AAC1E,QAAM,MAAM,KAAK,QAAQ,GAAG;AAC5B,SAAO,EAAE,IAAI,KAAK,MAAM,GAAG,GAAG,GAAG,MAAM,KAAK,MAAM,MAAM,CAAC,EAAE;AAC7D;AAUA,eAAsB,mBACpB,MACA,OACA,YACA,KACA,KACiB;AACjB,QAAM,EAAE,IAAI,KAAK,IAAI,gBAAgB,IAAI;AACzC,MAAI,QAAQ,QAAW;AACrB,QAAI;AACF,YAAMA,YAAW,MAAM,4BAA4B,KAAK,YAAY,KAAK;AACzE,aAAO,MAAM,QAAQ,IAAI,MAAMA,SAAQ;AAAA,IACzC,QAAQ;AAAA,IAER;AAAA,EACF;AACA,QAAM,WAAW,MAAM,qBAAqB,KAAK,YAAY,KAAK;AAClE,SAAO,QAAQ,IAAI,MAAM,QAAQ;AACnC;","names":["fieldKey"]}