@noy-db/hub 0.8.0-pre.0 → 0.8.0

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 (624) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/api-OS747DS4.js +18 -0
  3. package/dist/as/index.js +11 -12
  4. package/dist/as/index.js.map +1 -1
  5. package/dist/at/index.js +9 -10
  6. package/dist/attestation/index.js +39 -28
  7. package/dist/attestation/index.js.map +1 -1
  8. package/dist/{backup-7TFRVFLH.js → backup-YE2VQ26S.js} +15 -16
  9. package/dist/backup-YE2VQ26S.js.map +1 -0
  10. package/dist/blobs/index.js +13 -14
  11. package/dist/blobs/index.js.map +1 -1
  12. package/dist/broker/index.js +12 -13
  13. package/dist/broker/index.js.map +1 -1
  14. package/dist/by/index.js +2 -2
  15. package/dist/capsule/contract.d.ts +159 -0
  16. package/dist/capsule/contract.js +95 -0
  17. package/dist/capsule/enclave-aes/bound.d.ts +52 -0
  18. package/dist/capsule/enclave-aes/capabilities.d.ts +2 -0
  19. package/dist/capsule/enclave-aes/classify/compare.d.ts +20 -0
  20. package/dist/{kernel/enclave → capsule/enclave-aes}/classify/find.d.ts +1 -1
  21. package/dist/{kernel/enclave → capsule/enclave-aes}/classify/reveal.d.ts +1 -1
  22. package/dist/{kernel/enclave → capsule/enclave-aes}/classify/verify.d.ts +2 -2
  23. package/dist/{kernel/enclave → capsule/enclave-aes}/classify/write.d.ts +1 -1
  24. package/dist/{kernel/enclave → capsule/enclave-aes}/crypto.d.ts +33 -129
  25. package/dist/capsule/enclave-aes/index.d.ts +113 -0
  26. package/dist/capsule/enclave-aes/index.js +335 -0
  27. package/dist/capsule/enclave-aes/index.js.map +1 -0
  28. package/dist/capsule/enclave-aes/primitives.d.ts +29 -0
  29. package/dist/capsule/index.d.ts +27 -0
  30. package/dist/capsule/plumbing/ct-equal.d.ts +11 -0
  31. package/dist/{kernel/enclave/record-keys → capsule/plumbing}/deterministic.d.ts +8 -21
  32. package/dist/capsule/plumbing/digest.d.ts +122 -0
  33. package/dist/{kernel/enclave/record-keys → capsule/plumbing}/envelope-body.d.ts +44 -48
  34. package/dist/capsule/plumbing/index.d.ts +100 -0
  35. package/dist/capsule/plumbing/lifecycle.d.ts +50 -0
  36. package/dist/{kernel/enclave/record-keys → capsule/plumbing}/record-codec.d.ts +55 -20
  37. package/dist/{kernel/enclave → capsule/plumbing}/record-envelope.d.ts +1 -1
  38. package/dist/capsule/plumbing/rekey-blob.d.ts +33 -0
  39. package/dist/capsule/plumbing/rekey.d.ts +44 -0
  40. package/dist/capsule/plumbing/sealed-slot.d.ts +22 -0
  41. package/dist/capsule/plumbing/sealed-slots.d.ts +37 -0
  42. package/dist/capsule/plumbing/sealing.d.ts +29 -0
  43. package/dist/capsule/plumbing/sign.d.ts +9 -0
  44. package/dist/{kernel/enclave/record-keys → capsule/plumbing}/tombstone.d.ts +2 -2
  45. package/dist/capsule-VOLX3QRQ.js +209 -0
  46. package/dist/cargo/index.js +36 -36
  47. package/dist/{chunk-DF73H4UN.js → chunk-23D6M6VM.js} +5 -5
  48. package/dist/chunk-23D6M6VM.js.map +1 -0
  49. package/dist/{chunk-FH2L2E34.js → chunk-244QBK7Z.js} +4 -4
  50. package/dist/{chunk-FH2L2E34.js.map → chunk-244QBK7Z.js.map} +1 -1
  51. package/dist/{chunk-YSK2CU2Q.js → chunk-2AFX33YA.js} +2 -2
  52. package/dist/{chunk-TKUOEU2F.js → chunk-2GHDLTPE.js} +2 -2
  53. package/dist/{chunk-GYGLAVCX.js → chunk-2MG3SW7Q.js} +6 -2
  54. package/dist/chunk-2MG3SW7Q.js.map +1 -0
  55. package/dist/{chunk-6OWXYZK2.js → chunk-2ODVB6LZ.js} +2 -2
  56. package/dist/{chunk-X25NWUZB.js → chunk-2PVXF5CS.js} +3 -3
  57. package/dist/{chunk-IEX7NK2K.js → chunk-2RH777HH.js} +21 -20
  58. package/dist/{chunk-IEX7NK2K.js.map → chunk-2RH777HH.js.map} +1 -1
  59. package/dist/{chunk-244VXYPG.js → chunk-37EPTBBR.js} +14 -1
  60. package/dist/chunk-37EPTBBR.js.map +1 -0
  61. package/dist/{chunk-NRT6QZQB.js → chunk-3A5DUZ56.js} +6 -6
  62. package/dist/chunk-3A5DUZ56.js.map +1 -0
  63. package/dist/{chunk-ORDURZBU.js → chunk-3EWS67C7.js} +2 -2
  64. package/dist/{chunk-3H5KLDZN.js → chunk-3L2NBKDR.js} +4 -8
  65. package/dist/chunk-3L2NBKDR.js.map +1 -0
  66. package/dist/{chunk-ENAG3IY7.js → chunk-3XJQBBZD.js} +26 -28
  67. package/dist/chunk-3XJQBBZD.js.map +1 -0
  68. package/dist/{chunk-KJFW62P4.js → chunk-42ALPZ2B.js} +652 -662
  69. package/dist/chunk-42ALPZ2B.js.map +1 -0
  70. package/dist/{chunk-FXQBGFOX.js → chunk-4CIQDWRB.js} +8 -8
  71. package/dist/{chunk-HT2AHGQI.js → chunk-4JPMZTJY.js} +2 -2
  72. package/dist/{chunk-FQ5VRHIB.js → chunk-4T3SE27M.js} +5 -9
  73. package/dist/chunk-4T3SE27M.js.map +1 -0
  74. package/dist/{chunk-MKXXMNJH.js → chunk-4V3Q35WG.js} +2 -2
  75. package/dist/{chunk-A6IJU4TK.js → chunk-52MGURXO.js} +2 -2
  76. package/dist/{chunk-IUWCVHQ7.js → chunk-5A4345TG.js} +4 -4
  77. package/dist/{chunk-IUWCVHQ7.js.map → chunk-5A4345TG.js.map} +1 -1
  78. package/dist/{chunk-ISZQJBML.js → chunk-5FE75J4S.js} +6 -6
  79. package/dist/chunk-5FE75J4S.js.map +1 -0
  80. package/dist/chunk-5KC7QYEC.js +565 -0
  81. package/dist/chunk-5KC7QYEC.js.map +1 -0
  82. package/dist/{chunk-NNARWO72.js → chunk-5UMK7GRI.js} +13 -12
  83. package/dist/chunk-5UMK7GRI.js.map +1 -0
  84. package/dist/{chunk-HLEK5VAN.js → chunk-5WWDGFOS.js} +2 -2
  85. package/dist/{chunk-CKNGS5MH.js → chunk-6QVKPHBF.js} +3 -5
  86. package/dist/chunk-6QVKPHBF.js.map +1 -0
  87. package/dist/{chunk-PSIV7CJV.js → chunk-747G6CT3.js} +2 -2
  88. package/dist/chunk-747G6CT3.js.map +1 -0
  89. package/dist/{chunk-LGRLME4M.js → chunk-7R2Q7CPL.js} +16 -16
  90. package/dist/chunk-7R2Q7CPL.js.map +1 -0
  91. package/dist/{chunk-SOIQ4MM4.js → chunk-7XMHMVTS.js} +3 -3
  92. package/dist/{chunk-BUDAGWL5.js → chunk-A4XMIZT3.js} +6 -6
  93. package/dist/{chunk-BUDAGWL5.js.map → chunk-A4XMIZT3.js.map} +1 -1
  94. package/dist/{chunk-4MXI3ODD.js → chunk-AEQGFRU4.js} +3 -3
  95. package/dist/{chunk-7JE7BDYJ.js → chunk-AL6ML4LA.js} +5 -5
  96. package/dist/{chunk-ZUVBC32X.js → chunk-AUKKUPVB.js} +2 -2
  97. package/dist/chunk-BNWA3WG5.js +22 -0
  98. package/dist/chunk-BNWA3WG5.js.map +1 -0
  99. package/dist/{chunk-WY2XXTET.js → chunk-BPWYQ25R.js} +4 -4
  100. package/dist/{chunk-EOVMT6TB.js → chunk-BVCUTXE3.js} +2 -2
  101. package/dist/{chunk-UPD5NWI5.js → chunk-DHHGL42E.js} +13 -16
  102. package/dist/chunk-DHHGL42E.js.map +1 -0
  103. package/dist/{chunk-3JWHAR6E.js → chunk-DIZLQVAA.js} +2 -2
  104. package/dist/{chunk-QWFHIOD2.js → chunk-DLD5LGDS.js} +11 -12
  105. package/dist/chunk-DLD5LGDS.js.map +1 -0
  106. package/dist/{chunk-ZE4CHIED.js → chunk-DQESF6RP.js} +17 -28
  107. package/dist/chunk-DQESF6RP.js.map +1 -0
  108. package/dist/{chunk-IT22PWKV.js → chunk-E2N2T5ZO.js} +2 -2
  109. package/dist/{chunk-3ELRMVJK.js → chunk-EGVJ7TM4.js} +31 -34
  110. package/dist/chunk-EGVJ7TM4.js.map +1 -0
  111. package/dist/{chunk-WNJ4AVGE.js → chunk-EJLV62NI.js} +2 -2
  112. package/dist/{chunk-QBBUZ3I3.js → chunk-EYG2CY2X.js} +11 -11
  113. package/dist/{enclave-27SMF6GF.js → chunk-EZGV6F47.js} +83 -56
  114. package/dist/chunk-EZGV6F47.js.map +1 -0
  115. package/dist/{chunk-LQ4ZHOKP.js → chunk-EZOAKKTB.js} +36 -27
  116. package/dist/chunk-EZOAKKTB.js.map +1 -0
  117. package/dist/{chunk-BJ2IXQ5Q.js → chunk-FFJFE4T7.js} +2 -2
  118. package/dist/{chunk-JCN44NCY.js → chunk-FLPCETP6.js} +2 -2
  119. package/dist/{chunk-5O7D6ZTW.js → chunk-FOEDQATO.js} +2 -2
  120. package/dist/{chunk-VNNRUGMM.js → chunk-FVH5QYY2.js} +2 -2
  121. package/dist/{chunk-ANWPSTZU.js → chunk-G2MVBDFP.js} +23 -26
  122. package/dist/chunk-G2MVBDFP.js.map +1 -0
  123. package/dist/chunk-GMKGGY7V.js +234 -0
  124. package/dist/chunk-GMKGGY7V.js.map +1 -0
  125. package/dist/{chunk-EIPVYUEP.js → chunk-GQ4MF3CM.js} +3 -3
  126. package/dist/chunk-GQ4MF3CM.js.map +1 -0
  127. package/dist/{chunk-PEOZ34EM.js → chunk-GSAK56VF.js} +1 -1
  128. package/dist/chunk-GSAK56VF.js.map +1 -0
  129. package/dist/{chunk-QOOUUR4A.js → chunk-GUZET4SG.js} +10 -4
  130. package/dist/chunk-GUZET4SG.js.map +1 -0
  131. package/dist/{chunk-4AF3TUMP.js → chunk-GZT3NQRA.js} +2 -2
  132. package/dist/{chunk-N5DNADLQ.js → chunk-H23XHRTT.js} +19 -34
  133. package/dist/chunk-H23XHRTT.js.map +1 -0
  134. package/dist/{chunk-MVZ2TPVP.js → chunk-H427H63K.js} +2 -2
  135. package/dist/{chunk-6B3VNR4P.js → chunk-H7JBY4P7.js} +23 -32
  136. package/dist/chunk-H7JBY4P7.js.map +1 -0
  137. package/dist/{chunk-MLPHLJIQ.js → chunk-HS554XAF.js} +2 -2
  138. package/dist/{chunk-HK67PX4J.js → chunk-HW7CMKUG.js} +1 -1
  139. package/dist/chunk-HW7CMKUG.js.map +1 -0
  140. package/dist/{chunk-S57HTZ6X.js → chunk-IMQKWR46.js} +5 -7
  141. package/dist/chunk-IMQKWR46.js.map +1 -0
  142. package/dist/{chunk-FCKWQE2H.js → chunk-IUBMZPHM.js} +7 -7
  143. package/dist/chunk-IUBMZPHM.js.map +1 -0
  144. package/dist/{chunk-UD5EVGZ7.js → chunk-IUT3GWP3.js} +49 -13
  145. package/dist/chunk-IUT3GWP3.js.map +1 -0
  146. package/dist/{chunk-J6UOHJY5.js → chunk-JDEYF3PJ.js} +4 -8
  147. package/dist/{chunk-J6UOHJY5.js.map → chunk-JDEYF3PJ.js.map} +1 -1
  148. package/dist/{chunk-NWHBJQAL.js → chunk-JIBUPZHA.js} +4 -4
  149. package/dist/chunk-JIBUPZHA.js.map +1 -0
  150. package/dist/{chunk-TROR3ALR.js → chunk-JOSPH3E5.js} +2 -2
  151. package/dist/{chunk-F24ZZTHQ.js → chunk-JQYKPKG6.js} +4 -4
  152. package/dist/{chunk-GF5BZ7D4.js → chunk-JSMTXZR3.js} +8 -12
  153. package/dist/chunk-JSMTXZR3.js.map +1 -0
  154. package/dist/chunk-JWWYRR4Q.js +12 -0
  155. package/dist/chunk-JWWYRR4Q.js.map +1 -0
  156. package/dist/{chunk-HBPPGWUM.js → chunk-KZXDLBY6.js} +14 -9
  157. package/dist/chunk-KZXDLBY6.js.map +1 -0
  158. package/dist/{chunk-7VCXZDA4.js → chunk-LIOVX5TJ.js} +7 -11
  159. package/dist/chunk-LIOVX5TJ.js.map +1 -0
  160. package/dist/{chunk-QWGU66MP.js → chunk-LNSVGRHO.js} +5 -7
  161. package/dist/chunk-LNSVGRHO.js.map +1 -0
  162. package/dist/{chunk-MDWKM2XC.js → chunk-M5B2W6YY.js} +3 -3
  163. package/dist/{chunk-F2TDU7MQ.js → chunk-MBMTND6D.js} +2 -2
  164. package/dist/{chunk-K6W7BVZ6.js → chunk-MILI22XQ.js} +3 -3
  165. package/dist/{chunk-YNIUIERI.js → chunk-MXKI4ABF.js} +18 -59
  166. package/dist/chunk-MXKI4ABF.js.map +1 -0
  167. package/dist/{chunk-T2LBQ5DV.js → chunk-MXOQ5JCG.js} +252 -214
  168. package/dist/chunk-MXOQ5JCG.js.map +1 -0
  169. package/dist/{chunk-ZXABPVM6.js → chunk-N7EVQD5S.js} +9 -13
  170. package/dist/chunk-N7EVQD5S.js.map +1 -0
  171. package/dist/{chunk-CF5UU4S7.js → chunk-N7UDP5VU.js} +7 -7
  172. package/dist/{chunk-FQ54DWUQ.js → chunk-NBQ3KK6X.js} +4 -4
  173. package/dist/{chunk-4I522ERM.js → chunk-NCO25JZO.js} +4 -4
  174. package/dist/chunk-NH2UOV3B.js +18 -0
  175. package/dist/chunk-NH2UOV3B.js.map +1 -0
  176. package/dist/{chunk-SI3V7D4G.js → chunk-O2IMQSNA.js} +2 -2
  177. package/dist/{chunk-T52GX4SA.js → chunk-O46CHQT7.js} +4 -4
  178. package/dist/chunk-OIEO4WDL.js +27 -0
  179. package/dist/chunk-OIEO4WDL.js.map +1 -0
  180. package/dist/{chunk-GHLTDZRS.js → chunk-OKSTSITU.js} +25 -4
  181. package/dist/chunk-OKSTSITU.js.map +1 -0
  182. package/dist/{chunk-TOPYQ6GA.js → chunk-OYW3I5M4.js} +6 -6
  183. package/dist/{chunk-X4773RBR.js → chunk-PD64727P.js} +2 -2
  184. package/dist/chunk-PD64727P.js.map +1 -0
  185. package/dist/{chunk-BP6DARYA.js → chunk-PP3K67AJ.js} +4 -4
  186. package/dist/chunk-PP3K67AJ.js.map +1 -0
  187. package/dist/chunk-Q2XRFWOI.js +40 -0
  188. package/dist/chunk-Q2XRFWOI.js.map +1 -0
  189. package/dist/{chunk-AOWGXU6D.js → chunk-Q4UHJ5SN.js} +2 -2
  190. package/dist/{chunk-FW22ZCXT.js → chunk-QBLT6POL.js} +2 -2
  191. package/dist/chunk-QMWY2FDS.js +157 -0
  192. package/dist/chunk-QMWY2FDS.js.map +1 -0
  193. package/dist/{chunk-I3JDRCMW.js → chunk-RB4DOPGZ.js} +10 -10
  194. package/dist/{chunk-32YV3TJT.js → chunk-SMV2HRDU.js} +2 -2
  195. package/dist/{chunk-ODVPTDPK.js → chunk-SV2PM2OY.js} +1 -1
  196. package/dist/chunk-SV2PM2OY.js.map +1 -0
  197. package/dist/{chunk-Z5HTYMMQ.js → chunk-SYNY3VB5.js} +2 -2
  198. package/dist/{chunk-SYVZW77S.js → chunk-TEHHROZL.js} +6 -8
  199. package/dist/chunk-TEHHROZL.js.map +1 -0
  200. package/dist/{chunk-ZSX4S5XB.js → chunk-TKVUE4JF.js} +9 -9
  201. package/dist/{chunk-B57AFBY2.js → chunk-TZZBXPZK.js} +2 -2
  202. package/dist/{chunk-VNPEWFPD.js → chunk-U2FZNEWJ.js} +4 -4
  203. package/dist/chunk-U2FZNEWJ.js.map +1 -0
  204. package/dist/{chunk-5FDLC6G7.js → chunk-UA372JHH.js} +3 -3
  205. package/dist/{chunk-PDCG6PR5.js → chunk-UEFOQH74.js} +2 -2
  206. package/dist/chunk-UEFOQH74.js.map +1 -0
  207. package/dist/{chunk-HVSCEIYL.js → chunk-UIYESRD6.js} +9 -11
  208. package/dist/chunk-UIYESRD6.js.map +1 -0
  209. package/dist/{chunk-B6SJIBQK.js → chunk-V3RWOOSO.js} +4 -4
  210. package/dist/{chunk-HBRLNOHL.js → chunk-V7ADQF5O.js} +4 -4
  211. package/dist/{chunk-L7DOS3TE.js → chunk-VAORSCSU.js} +3 -3
  212. package/dist/chunk-VAORSCSU.js.map +1 -0
  213. package/dist/{chunk-M522UYZ2.js → chunk-VFHCKG5M.js} +6 -10
  214. package/dist/chunk-VFHCKG5M.js.map +1 -0
  215. package/dist/{chunk-DC5QVPV7.js → chunk-VHBKYN2J.js} +3 -3
  216. package/dist/chunk-VHBKYN2J.js.map +1 -0
  217. package/dist/{chunk-WX5ADGTZ.js → chunk-VKI2EB3N.js} +3 -3
  218. package/dist/chunk-VKI2EB3N.js.map +1 -0
  219. package/dist/{chunk-MTL7MXGR.js → chunk-VMV5SBE4.js} +16 -17
  220. package/dist/chunk-VMV5SBE4.js.map +1 -0
  221. package/dist/{chunk-F7XGHL5O.js → chunk-VQDZYB2B.js} +3 -3
  222. package/dist/{chunk-BK2HHQGN.js → chunk-VVOLDVIR.js} +2 -2
  223. package/dist/{chunk-6LMQ5R26.js → chunk-WPOYWFSE.js} +7 -7
  224. package/dist/{chunk-6LMQ5R26.js.map → chunk-WPOYWFSE.js.map} +1 -1
  225. package/dist/{chunk-3F7GLNAE.js → chunk-WXE4W2U6.js} +7 -11
  226. package/dist/chunk-WXE4W2U6.js.map +1 -0
  227. package/dist/{chunk-6K7DPM7D.js → chunk-XQRFSKYM.js} +2 -2
  228. package/dist/{chunk-M7NI3IWE.js → chunk-XSPFDUDG.js} +22 -50
  229. package/dist/chunk-XSPFDUDG.js.map +1 -0
  230. package/dist/{chunk-ID6Z6E66.js → chunk-Y2RKVFKR.js} +2 -2
  231. package/dist/{chunk-6LNL42F5.js → chunk-Y3LPTBG7.js} +12 -12
  232. package/dist/chunk-Y3LPTBG7.js.map +1 -0
  233. package/dist/{chunk-FN5EBVTQ.js → chunk-YRXFFWG4.js} +2 -2
  234. package/dist/classified/index.js +5 -5
  235. package/dist/{classified-marker-W3USLL5M.js → classified-marker-SIYKUU5L.js} +3 -3
  236. package/dist/classified-marker-SIYKUU5L.js.map +1 -0
  237. package/dist/collection-facade-CS7CA2XO.js +47 -0
  238. package/dist/{computed-TPFBX7U4.js → computed-FAD7SED4.js} +3 -3
  239. package/dist/consent/index.js +10 -11
  240. package/dist/consent/index.js.map +1 -1
  241. package/dist/cover/index.js +9 -10
  242. package/dist/custody/index.js +12 -13
  243. package/dist/{dead-filter-U2UYKSZL.js → dead-filter-4F3LWYKH.js} +11 -3
  244. package/dist/dead-filter-4F3LWYKH.js.map +1 -0
  245. package/dist/debug/index.js +11 -2
  246. package/dist/debug/index.js.map +1 -1
  247. package/dist/{delegation-S3AEPW2T.js → delegation-NANZDG4N.js} +13 -16
  248. package/dist/delegation-NANZDG4N.js.map +1 -0
  249. package/dist/derivations/index.js +23 -24
  250. package/dist/derive-XLOJVXPU.js +20 -0
  251. package/dist/directory/index.js +10 -11
  252. package/dist/{dispatch-3CQDJV5Q.js → dispatch-H4HV32AM.js} +5 -5
  253. package/dist/{dispatch-RH4LHKBH.js → dispatch-JDZNGEB3.js} +21 -22
  254. package/dist/dispatch-JDZNGEB3.js.map +1 -0
  255. package/dist/executor-FMPVN6DT.js +35 -0
  256. package/dist/executor-LBBBRTN5.js +8 -0
  257. package/dist/executor-OSRZST2U.js +8 -0
  258. package/dist/export-accessible-RAOJAAU5.js +22 -0
  259. package/dist/extract-partition-JD5CUSTG.js +37 -0
  260. package/dist/{fanout-sidecar-OT6RYLOL.js → fanout-sidecar-L7NHPIOC.js} +13 -15
  261. package/dist/fanout-sidecar-L7NHPIOC.js.map +1 -0
  262. package/dist/find-JRN4RNQ5.js +10 -0
  263. package/dist/forget/index.js +9 -10
  264. package/dist/forget/index.js.map +1 -1
  265. package/dist/guards/index.js +4 -4
  266. package/dist/history/index.js +13 -14
  267. package/dist/history/index.js.map +1 -1
  268. package/dist/i18n/index.js +14 -15
  269. package/dist/i18n/index.js.map +1 -1
  270. package/dist/index.d.ts +8 -8
  271. package/dist/index.js +183 -184
  272. package/dist/index.js.map +1 -1
  273. package/dist/indexing/index.js +5 -5
  274. package/dist/introspection/index.js +11 -12
  275. package/dist/issue-YIVBZUTH.js +19 -0
  276. package/dist/kernel/attestation-types.d.ts +62 -0
  277. package/dist/kernel/collection-config.d.ts +1 -48
  278. package/dist/kernel/collection.d.ts +1 -1
  279. package/dist/kernel/cutover-transform.d.ts +1 -1
  280. package/dist/kernel/errors.d.ts +30 -2
  281. package/dist/kernel/merge-authority.d.ts +1 -1
  282. package/dist/kernel/paths.d.ts +29 -5
  283. package/dist/kernel/prepared-write.d.ts +1 -1
  284. package/dist/kernel/secret-mode.d.ts +1 -1
  285. package/dist/kernel/types.d.ts +42 -5
  286. package/dist/kernel/vault.d.ts +2 -2
  287. package/dist/kernel/write-queue.d.ts +17 -0
  288. package/dist/{ledger-KZPCMVZY.js → ledger-5ZMGE44K.js} +11 -12
  289. package/dist/liberate-WZSZM2W6.js +24 -0
  290. package/dist/link-set-MFXC24VK.js +29 -0
  291. package/dist/{managed-secret-S3MQ6SH6.js → managed-secret-MFTFT22X.js} +10 -11
  292. package/dist/materialized-views/index.js +26 -27
  293. package/dist/{migrate-cek-V7GKJZ7O.js → migrate-cek-DZRFFOHW.js} +2 -2
  294. package/dist/money/index.js +5 -5
  295. package/dist/noydb-ITIGNKUF.js +96 -0
  296. package/dist/overlay-views/index.js +4 -4
  297. package/dist/periods/index.js +12 -13
  298. package/dist/pod/index.js +72 -72
  299. package/dist/{pod-handle-WGDFB4C2.js → pod-handle-A3LET7NO.js} +10 -11
  300. package/dist/pod-handle-A3LET7NO.js.map +1 -0
  301. package/dist/policy/index.js +10 -11
  302. package/dist/port/on/index.d.ts +1 -1
  303. package/dist/port/to/index.d.ts +1 -1
  304. package/dist/port/with/blob-strategy.d.ts +1 -1
  305. package/dist/port/with/classified-strategy.d.ts +1 -1
  306. package/dist/port/with/collection-options.d.ts +1 -1
  307. package/dist/port/with/collection-registries.d.ts +1 -1
  308. package/dist/port/with/lookup-strategy.d.ts +2 -2
  309. package/dist/portability/index.js +8 -8
  310. package/dist/{post-register-SLSXIPBV.js → post-register-7ND27CF2.js} +6 -6
  311. package/dist/post-register-7ND27CF2.js.map +1 -0
  312. package/dist/query/all/index.js +15 -15
  313. package/dist/query/index.js +7 -7
  314. package/dist/query/live/index.js +7 -7
  315. package/dist/query/reduce/index.js +10 -10
  316. package/dist/query/relate/index.js +9 -9
  317. package/dist/reduce/index.js +8 -8
  318. package/dist/register-DT5HZ2LZ.js +30 -0
  319. package/dist/registry-BHRZGZHF.js +8 -0
  320. package/dist/registry-ET6ZFFWA.js +34 -0
  321. package/dist/registry-HXFGLGTG.js +8 -0
  322. package/dist/registry-THCPDEOD.js +23 -0
  323. package/dist/request-withdrawal-AV2MJJKY.js +30 -0
  324. package/dist/{reveal-4BCKPEC2.js → reveal-B2TLP4JQ.js} +10 -9
  325. package/dist/reveal-B2TLP4JQ.js.map +1 -0
  326. package/dist/revoke-6DWIEOCV.js +24 -0
  327. package/dist/satellites/index.js +1 -1
  328. package/dist/schema-update/index.js +2 -2
  329. package/dist/sealed-record/index.js +16 -18
  330. package/dist/sealed-record/index.js.map +1 -1
  331. package/dist/search/index.js +4 -4
  332. package/dist/{seed-4JS2RJ4A.js → seed-XNSE4U3S.js} +15 -18
  333. package/dist/seed-XNSE4U3S.js.map +1 -0
  334. package/dist/sequence/index.js +9 -10
  335. package/dist/session/index.js +9 -10
  336. package/dist/session/index.js.map +1 -1
  337. package/dist/shadow/index.js +2 -2
  338. package/dist/signer-MHGW3OIL.js +23 -0
  339. package/dist/snapshots/index.js +11 -11
  340. package/dist/stale-6GCFMOOR.js +28 -0
  341. package/dist/storage-BYN5LO6Z.js +21 -0
  342. package/dist/store/index.js +1 -1
  343. package/dist/{store-coordination-provider-2O2VUHKW.js → store-coordination-provider-C4BPT5XF.js} +11 -12
  344. package/dist/store-coordination-provider-C4BPT5XF.js.map +1 -0
  345. package/dist/sync/index.js +10 -11
  346. package/dist/sync/index.js.map +1 -1
  347. package/dist/team/index.js +15 -16
  348. package/dist/tiers/index.js +11 -12
  349. package/dist/to/index.js +2 -2
  350. package/dist/transactions/index.js +3 -3
  351. package/dist/util/index.js +1 -1
  352. package/dist/vault-head/index.js +11 -14
  353. package/dist/vault-head/index.js.map +1 -1
  354. package/dist/{verify-RVT67IMH.js → verify-UKALW7C2.js} +14 -12
  355. package/dist/verify-UKALW7C2.js.map +1 -0
  356. package/dist/via/classified/binding.d.ts +2 -2
  357. package/dist/via/classified/config-drift.d.ts +2 -2
  358. package/dist/via/classified/errors.d.ts +1 -1
  359. package/dist/via/lookup/handle.d.ts +4 -4
  360. package/dist/walk-4VPK7AS4.js +20 -0
  361. package/dist/with-audit/attestation/index.d.ts +2 -1
  362. package/dist/with-audit/attestation/issue.d.ts +2 -2
  363. package/dist/with-audit/attestation/revoke.d.ts +2 -2
  364. package/dist/with-audit/attestation/scheme.d.ts +7 -0
  365. package/dist/with-audit/attestation/signer.d.ts +1 -1
  366. package/dist/with-audit/attestation/strategy.d.ts +2 -2
  367. package/dist/with-audit/attestation/types.d.ts +10 -0
  368. package/dist/with-audit/attestation/vault-facade.d.ts +2 -2
  369. package/dist/with-audit/attestation/verifier.d.ts +6 -0
  370. package/dist/with-audit/consent/consent.d.ts +1 -1
  371. package/dist/with-audit/consent/strategy.d.ts +1 -1
  372. package/dist/with-audit/forget/subject-index.d.ts +1 -1
  373. package/dist/with-audit/periods/vault-facade.d.ts +1 -1
  374. package/dist/with-audit/sealed-record/index.d.ts +2 -2
  375. package/dist/with-audit/sealed-record/strategy.d.ts +1 -1
  376. package/dist/with-audit/tiers/index.d.ts +2 -2
  377. package/dist/with-cargo/adopt-partition.d.ts +1 -1
  378. package/dist/with-cargo/extract-partition.d.ts +1 -1
  379. package/dist/with-cargo/floor.d.ts +1 -1
  380. package/dist/with-commit/history/history.d.ts +2 -2
  381. package/dist/with-commit/history/index.d.ts +1 -1
  382. package/dist/with-commit/history/ledger/store.d.ts +1 -1
  383. package/dist/with-commit/history/strategy.d.ts +1 -1
  384. package/dist/with-commit/history/time-machine.d.ts +1 -1
  385. package/dist/with-commit/numbering/index.d.ts +1 -1
  386. package/dist/with-commit/sequence/index.d.ts +1 -1
  387. package/dist/with-commit/vault-head/head.d.ts +1 -1
  388. package/dist/with-commit/vault-head/index.d.ts +1 -1
  389. package/dist/with-commit/vault-head/strategy.d.ts +1 -1
  390. package/dist/with-commit/vault-head/verify.d.ts +1 -1
  391. package/dist/with-formula/derivations/dispatch.d.ts +1 -1
  392. package/dist/with-formula/derivations/fanout-sidecar.d.ts +1 -1
  393. package/dist/with-lookup/indexing/collection-facade.d.ts +1 -1
  394. package/dist/with-lookup/search/collection-facade.d.ts +1 -1
  395. package/dist/with-party/broker/index.d.ts +3 -3
  396. package/dist/with-party/directory/user-envelope/storage.d.ts +1 -1
  397. package/dist/with-party/team/delegation.d.ts +1 -1
  398. package/dist/with-party/team/echo-secret.d.ts +2 -2
  399. package/dist/with-party/team/index.d.ts +1 -1
  400. package/dist/with-party/team/keyring.d.ts +1 -1
  401. package/dist/with-party/team/magic-link-grant.d.ts +1 -1
  402. package/dist/with-party/team/recovery.d.ts +1 -1
  403. package/dist/with-party/team/roster-tag.d.ts +1 -1
  404. package/dist/with-party/team/rotate-recover.d.ts +1 -1
  405. package/dist/with-party/team/wrapped-deks.d.ts +1 -1
  406. package/dist/with-pod/index.d.ts +1 -1
  407. package/dist/with-shape/blobs/blob-compaction.d.ts +1 -1
  408. package/dist/with-shape/blobs/blob-intent.d.ts +1 -1
  409. package/dist/with-shape/blobs/blob-set.d.ts +2 -2
  410. package/dist/with-shape/blobs/legacy-sweep.d.ts +1 -1
  411. package/dist/with-shape/introspection/describe.d.ts +1 -1
  412. package/dist/with-shape/introspection/walk.d.ts +1 -1
  413. package/dist/with-shape/links/lazy-handle.d.ts +1 -1
  414. package/dist/with-shape/links/link-set.d.ts +1 -1
  415. package/dist/with-shape/manifest/derive.d.ts +1 -1
  416. package/dist/with-shape/manifest/storage.d.ts +1 -1
  417. package/dist/with-shape/persisted-schemas/register.d.ts +1 -1
  418. package/dist/with-shape/persisted-schemas/storage.d.ts +1 -1
  419. package/dist/with-shape/satellites/dead-filter.d.ts +1 -1
  420. package/dist/with-shape/satellites/declare.d.ts +1 -1
  421. package/dist/with-shape/satellites/marker.d.ts +1 -1
  422. package/dist/with-shape/satellites/post-register.d.ts +1 -1
  423. package/dist/with-sync/presence.d.ts +5 -10
  424. package/dist/withdraw-accessible-HL7GACUE.js +27 -0
  425. package/dist/withdraw-accessible-HL7GACUE.js.map +1 -0
  426. package/package.json +14 -5
  427. package/dist/api-GVYEKSJE.js +0 -19
  428. package/dist/backup-7TFRVFLH.js.map +0 -1
  429. package/dist/chunk-244VXYPG.js.map +0 -1
  430. package/dist/chunk-3ELRMVJK.js.map +0 -1
  431. package/dist/chunk-3F7GLNAE.js.map +0 -1
  432. package/dist/chunk-3H5KLDZN.js.map +0 -1
  433. package/dist/chunk-6B3VNR4P.js.map +0 -1
  434. package/dist/chunk-6LNL42F5.js.map +0 -1
  435. package/dist/chunk-6QSQQLSE.js +0 -95
  436. package/dist/chunk-6QSQQLSE.js.map +0 -1
  437. package/dist/chunk-7VCXZDA4.js.map +0 -1
  438. package/dist/chunk-ANWPSTZU.js.map +0 -1
  439. package/dist/chunk-BP6DARYA.js.map +0 -1
  440. package/dist/chunk-CKNGS5MH.js.map +0 -1
  441. package/dist/chunk-DC5QVPV7.js.map +0 -1
  442. package/dist/chunk-DE4DH2RZ.js +0 -29
  443. package/dist/chunk-DE4DH2RZ.js.map +0 -1
  444. package/dist/chunk-DF73H4UN.js.map +0 -1
  445. package/dist/chunk-EIPVYUEP.js.map +0 -1
  446. package/dist/chunk-ENAG3IY7.js.map +0 -1
  447. package/dist/chunk-FCKWQE2H.js.map +0 -1
  448. package/dist/chunk-FQ5VRHIB.js.map +0 -1
  449. package/dist/chunk-GF5BZ7D4.js.map +0 -1
  450. package/dist/chunk-GHLTDZRS.js.map +0 -1
  451. package/dist/chunk-GYGLAVCX.js.map +0 -1
  452. package/dist/chunk-HBPPGWUM.js.map +0 -1
  453. package/dist/chunk-HK67PX4J.js.map +0 -1
  454. package/dist/chunk-HVSCEIYL.js.map +0 -1
  455. package/dist/chunk-ISZQJBML.js.map +0 -1
  456. package/dist/chunk-KJFW62P4.js.map +0 -1
  457. package/dist/chunk-L7DOS3TE.js.map +0 -1
  458. package/dist/chunk-LGRLME4M.js.map +0 -1
  459. package/dist/chunk-LP7BEXCT.js +0 -32
  460. package/dist/chunk-LP7BEXCT.js.map +0 -1
  461. package/dist/chunk-LQ4ZHOKP.js.map +0 -1
  462. package/dist/chunk-M522UYZ2.js.map +0 -1
  463. package/dist/chunk-M7NI3IWE.js.map +0 -1
  464. package/dist/chunk-MTL7MXGR.js.map +0 -1
  465. package/dist/chunk-N5DNADLQ.js.map +0 -1
  466. package/dist/chunk-NNARWO72.js.map +0 -1
  467. package/dist/chunk-NRT6QZQB.js.map +0 -1
  468. package/dist/chunk-NWHBJQAL.js.map +0 -1
  469. package/dist/chunk-ODVPTDPK.js.map +0 -1
  470. package/dist/chunk-PDCG6PR5.js.map +0 -1
  471. package/dist/chunk-PEOZ34EM.js.map +0 -1
  472. package/dist/chunk-PSIV7CJV.js.map +0 -1
  473. package/dist/chunk-QOOUUR4A.js.map +0 -1
  474. package/dist/chunk-QWFHIOD2.js.map +0 -1
  475. package/dist/chunk-QWGU66MP.js.map +0 -1
  476. package/dist/chunk-S57HTZ6X.js.map +0 -1
  477. package/dist/chunk-SEE332EV.js +0 -66
  478. package/dist/chunk-SEE332EV.js.map +0 -1
  479. package/dist/chunk-SYVZW77S.js.map +0 -1
  480. package/dist/chunk-T2LBQ5DV.js.map +0 -1
  481. package/dist/chunk-UD5EVGZ7.js.map +0 -1
  482. package/dist/chunk-UPD5NWI5.js.map +0 -1
  483. package/dist/chunk-UYB234ZR.js +0 -479
  484. package/dist/chunk-UYB234ZR.js.map +0 -1
  485. package/dist/chunk-VNPEWFPD.js.map +0 -1
  486. package/dist/chunk-WX5ADGTZ.js.map +0 -1
  487. package/dist/chunk-X4773RBR.js.map +0 -1
  488. package/dist/chunk-YNIUIERI.js.map +0 -1
  489. package/dist/chunk-ZE4CHIED.js.map +0 -1
  490. package/dist/chunk-ZXABPVM6.js.map +0 -1
  491. package/dist/classified-marker-W3USLL5M.js.map +0 -1
  492. package/dist/collection-facade-QU6IJBN3.js +0 -48
  493. package/dist/dead-filter-U2UYKSZL.js.map +0 -1
  494. package/dist/delegation-S3AEPW2T.js.map +0 -1
  495. package/dist/derive-OX7F6TGG.js +0 -21
  496. package/dist/dispatch-RH4LHKBH.js.map +0 -1
  497. package/dist/executor-B6SRO2QS.js +0 -36
  498. package/dist/executor-BI5CHWRY.js +0 -8
  499. package/dist/executor-RBKM5W5K.js +0 -8
  500. package/dist/export-accessible-VMA3YM5V.js +0 -22
  501. package/dist/extract-partition-NF7PXGPP.js +0 -37
  502. package/dist/fanout-sidecar-OT6RYLOL.js.map +0 -1
  503. package/dist/find-LZMP26KF.js +0 -10
  504. package/dist/issue-IHARXWW5.js +0 -18
  505. package/dist/kernel/enclave/classify/compare.d.ts +0 -10
  506. package/dist/kernel/enclave/index.d.ts +0 -87
  507. package/dist/kernel/enclave/record-keys/lifecycle.d.ts +0 -124
  508. package/dist/kernel/enclave/record-keys/rekey-blob.d.ts +0 -88
  509. package/dist/kernel/enclave/record-keys/rekey.d.ts +0 -91
  510. package/dist/kernel/enclave/record-keys/sealed-slot.d.ts +0 -14
  511. package/dist/kernel/enclave/record-keys/sealed-slots.d.ts +0 -123
  512. package/dist/kernel/enclave/record-keys/sealing.d.ts +0 -70
  513. package/dist/liberate-GRLCZMW4.js +0 -24
  514. package/dist/link-set-JCMJ7ULP.js +0 -30
  515. package/dist/noydb-SWQJ3MZS.js +0 -97
  516. package/dist/pod-handle-WGDFB4C2.js.map +0 -1
  517. package/dist/post-register-SLSXIPBV.js.map +0 -1
  518. package/dist/register-F3OYE7MJ.js +0 -31
  519. package/dist/registry-CILQFXFK.js +0 -8
  520. package/dist/registry-XNNYQVKV.js +0 -8
  521. package/dist/registry-YCDZV3VW.js +0 -35
  522. package/dist/registry-ZGYS33TE.js +0 -24
  523. package/dist/request-withdrawal-Z5NC6TXT.js +0 -30
  524. package/dist/reveal-4BCKPEC2.js.map +0 -1
  525. package/dist/revoke-ZL62WC2D.js +0 -23
  526. package/dist/seed-4JS2RJ4A.js.map +0 -1
  527. package/dist/signer-MBZZMXTC.js +0 -24
  528. package/dist/stale-TJ3DYZMQ.js +0 -29
  529. package/dist/storage-SVMKRGCW.js +0 -22
  530. package/dist/store-coordination-provider-2O2VUHKW.js.map +0 -1
  531. package/dist/verify-RVT67IMH.js.map +0 -1
  532. package/dist/walk-HJ42EISE.js +0 -21
  533. package/dist/withdraw-accessible-5NZUPAVA.js +0 -27
  534. /package/dist/{api-GVYEKSJE.js.map → api-OS747DS4.js.map} +0 -0
  535. /package/dist/{computed-TPFBX7U4.js.map → capsule/contract.js.map} +0 -0
  536. /package/dist/{kernel/enclave → capsule/enclave-aes}/broker/proof.d.ts +0 -0
  537. /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/bidx.d.ts +0 -0
  538. /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/digest.d.ts +0 -0
  539. /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/vdig.d.ts +0 -0
  540. /package/dist/{kernel/enclave/classify → capsule/plumbing}/kofn.d.ts +0 -0
  541. /package/dist/{kernel/enclave/classify → capsule/plumbing}/normalize.d.ts +0 -0
  542. /package/dist/{kernel/enclave → capsule/plumbing}/record-aad.d.ts +0 -0
  543. /package/dist/{collection-facade-QU6IJBN3.js.map → capsule-VOLX3QRQ.js.map} +0 -0
  544. /package/dist/{chunk-YSK2CU2Q.js.map → chunk-2AFX33YA.js.map} +0 -0
  545. /package/dist/{chunk-TKUOEU2F.js.map → chunk-2GHDLTPE.js.map} +0 -0
  546. /package/dist/{chunk-6OWXYZK2.js.map → chunk-2ODVB6LZ.js.map} +0 -0
  547. /package/dist/{chunk-X25NWUZB.js.map → chunk-2PVXF5CS.js.map} +0 -0
  548. /package/dist/{chunk-ORDURZBU.js.map → chunk-3EWS67C7.js.map} +0 -0
  549. /package/dist/{chunk-FXQBGFOX.js.map → chunk-4CIQDWRB.js.map} +0 -0
  550. /package/dist/{chunk-HT2AHGQI.js.map → chunk-4JPMZTJY.js.map} +0 -0
  551. /package/dist/{chunk-MKXXMNJH.js.map → chunk-4V3Q35WG.js.map} +0 -0
  552. /package/dist/{chunk-A6IJU4TK.js.map → chunk-52MGURXO.js.map} +0 -0
  553. /package/dist/{chunk-HLEK5VAN.js.map → chunk-5WWDGFOS.js.map} +0 -0
  554. /package/dist/{chunk-SOIQ4MM4.js.map → chunk-7XMHMVTS.js.map} +0 -0
  555. /package/dist/{chunk-4MXI3ODD.js.map → chunk-AEQGFRU4.js.map} +0 -0
  556. /package/dist/{chunk-7JE7BDYJ.js.map → chunk-AL6ML4LA.js.map} +0 -0
  557. /package/dist/{chunk-ZUVBC32X.js.map → chunk-AUKKUPVB.js.map} +0 -0
  558. /package/dist/{chunk-WY2XXTET.js.map → chunk-BPWYQ25R.js.map} +0 -0
  559. /package/dist/{chunk-EOVMT6TB.js.map → chunk-BVCUTXE3.js.map} +0 -0
  560. /package/dist/{chunk-3JWHAR6E.js.map → chunk-DIZLQVAA.js.map} +0 -0
  561. /package/dist/{chunk-IT22PWKV.js.map → chunk-E2N2T5ZO.js.map} +0 -0
  562. /package/dist/{chunk-WNJ4AVGE.js.map → chunk-EJLV62NI.js.map} +0 -0
  563. /package/dist/{chunk-QBBUZ3I3.js.map → chunk-EYG2CY2X.js.map} +0 -0
  564. /package/dist/{chunk-BJ2IXQ5Q.js.map → chunk-FFJFE4T7.js.map} +0 -0
  565. /package/dist/{chunk-JCN44NCY.js.map → chunk-FLPCETP6.js.map} +0 -0
  566. /package/dist/{chunk-5O7D6ZTW.js.map → chunk-FOEDQATO.js.map} +0 -0
  567. /package/dist/{chunk-VNNRUGMM.js.map → chunk-FVH5QYY2.js.map} +0 -0
  568. /package/dist/{chunk-4AF3TUMP.js.map → chunk-GZT3NQRA.js.map} +0 -0
  569. /package/dist/{chunk-MVZ2TPVP.js.map → chunk-H427H63K.js.map} +0 -0
  570. /package/dist/{chunk-MLPHLJIQ.js.map → chunk-HS554XAF.js.map} +0 -0
  571. /package/dist/{chunk-TROR3ALR.js.map → chunk-JOSPH3E5.js.map} +0 -0
  572. /package/dist/{chunk-F24ZZTHQ.js.map → chunk-JQYKPKG6.js.map} +0 -0
  573. /package/dist/{chunk-MDWKM2XC.js.map → chunk-M5B2W6YY.js.map} +0 -0
  574. /package/dist/{chunk-F2TDU7MQ.js.map → chunk-MBMTND6D.js.map} +0 -0
  575. /package/dist/{chunk-K6W7BVZ6.js.map → chunk-MILI22XQ.js.map} +0 -0
  576. /package/dist/{chunk-CF5UU4S7.js.map → chunk-N7UDP5VU.js.map} +0 -0
  577. /package/dist/{chunk-FQ54DWUQ.js.map → chunk-NBQ3KK6X.js.map} +0 -0
  578. /package/dist/{chunk-4I522ERM.js.map → chunk-NCO25JZO.js.map} +0 -0
  579. /package/dist/{chunk-SI3V7D4G.js.map → chunk-O2IMQSNA.js.map} +0 -0
  580. /package/dist/{chunk-T52GX4SA.js.map → chunk-O46CHQT7.js.map} +0 -0
  581. /package/dist/{chunk-TOPYQ6GA.js.map → chunk-OYW3I5M4.js.map} +0 -0
  582. /package/dist/{chunk-AOWGXU6D.js.map → chunk-Q4UHJ5SN.js.map} +0 -0
  583. /package/dist/{chunk-FW22ZCXT.js.map → chunk-QBLT6POL.js.map} +0 -0
  584. /package/dist/{chunk-I3JDRCMW.js.map → chunk-RB4DOPGZ.js.map} +0 -0
  585. /package/dist/{chunk-32YV3TJT.js.map → chunk-SMV2HRDU.js.map} +0 -0
  586. /package/dist/{chunk-Z5HTYMMQ.js.map → chunk-SYNY3VB5.js.map} +0 -0
  587. /package/dist/{chunk-ZSX4S5XB.js.map → chunk-TKVUE4JF.js.map} +0 -0
  588. /package/dist/{chunk-B57AFBY2.js.map → chunk-TZZBXPZK.js.map} +0 -0
  589. /package/dist/{chunk-5FDLC6G7.js.map → chunk-UA372JHH.js.map} +0 -0
  590. /package/dist/{chunk-B6SJIBQK.js.map → chunk-V3RWOOSO.js.map} +0 -0
  591. /package/dist/{chunk-HBRLNOHL.js.map → chunk-V7ADQF5O.js.map} +0 -0
  592. /package/dist/{chunk-F7XGHL5O.js.map → chunk-VQDZYB2B.js.map} +0 -0
  593. /package/dist/{chunk-BK2HHQGN.js.map → chunk-VVOLDVIR.js.map} +0 -0
  594. /package/dist/{chunk-6K7DPM7D.js.map → chunk-XQRFSKYM.js.map} +0 -0
  595. /package/dist/{chunk-ID6Z6E66.js.map → chunk-Y2RKVFKR.js.map} +0 -0
  596. /package/dist/{chunk-FN5EBVTQ.js.map → chunk-YRXFFWG4.js.map} +0 -0
  597. /package/dist/{derive-OX7F6TGG.js.map → collection-facade-CS7CA2XO.js.map} +0 -0
  598. /package/dist/{enclave-27SMF6GF.js.map → computed-FAD7SED4.js.map} +0 -0
  599. /package/dist/{executor-B6SRO2QS.js.map → derive-XLOJVXPU.js.map} +0 -0
  600. /package/dist/{dispatch-3CQDJV5Q.js.map → dispatch-H4HV32AM.js.map} +0 -0
  601. /package/dist/{executor-BI5CHWRY.js.map → executor-FMPVN6DT.js.map} +0 -0
  602. /package/dist/{executor-RBKM5W5K.js.map → executor-LBBBRTN5.js.map} +0 -0
  603. /package/dist/{export-accessible-VMA3YM5V.js.map → executor-OSRZST2U.js.map} +0 -0
  604. /package/dist/{extract-partition-NF7PXGPP.js.map → export-accessible-RAOJAAU5.js.map} +0 -0
  605. /package/dist/{find-LZMP26KF.js.map → extract-partition-JD5CUSTG.js.map} +0 -0
  606. /package/dist/{issue-IHARXWW5.js.map → find-JRN4RNQ5.js.map} +0 -0
  607. /package/dist/{ledger-KZPCMVZY.js.map → issue-YIVBZUTH.js.map} +0 -0
  608. /package/dist/{liberate-GRLCZMW4.js.map → ledger-5ZMGE44K.js.map} +0 -0
  609. /package/dist/{link-set-JCMJ7ULP.js.map → liberate-WZSZM2W6.js.map} +0 -0
  610. /package/dist/{managed-secret-S3MQ6SH6.js.map → link-set-MFXC24VK.js.map} +0 -0
  611. /package/dist/{noydb-SWQJ3MZS.js.map → managed-secret-MFTFT22X.js.map} +0 -0
  612. /package/dist/{migrate-cek-V7GKJZ7O.js.map → migrate-cek-DZRFFOHW.js.map} +0 -0
  613. /package/dist/{register-F3OYE7MJ.js.map → noydb-ITIGNKUF.js.map} +0 -0
  614. /package/dist/{registry-CILQFXFK.js.map → register-DT5HZ2LZ.js.map} +0 -0
  615. /package/dist/{registry-XNNYQVKV.js.map → registry-BHRZGZHF.js.map} +0 -0
  616. /package/dist/{registry-YCDZV3VW.js.map → registry-ET6ZFFWA.js.map} +0 -0
  617. /package/dist/{registry-ZGYS33TE.js.map → registry-HXFGLGTG.js.map} +0 -0
  618. /package/dist/{request-withdrawal-Z5NC6TXT.js.map → registry-THCPDEOD.js.map} +0 -0
  619. /package/dist/{revoke-ZL62WC2D.js.map → request-withdrawal-AV2MJJKY.js.map} +0 -0
  620. /package/dist/{signer-MBZZMXTC.js.map → revoke-6DWIEOCV.js.map} +0 -0
  621. /package/dist/{stale-TJ3DYZMQ.js.map → signer-MHGW3OIL.js.map} +0 -0
  622. /package/dist/{storage-SVMKRGCW.js.map → stale-6GCFMOOR.js.map} +0 -0
  623. /package/dist/{walk-HJ42EISE.js.map → storage-BYN5LO6Z.js.map} +0 -0
  624. /package/dist/{withdraw-accessible-5NZUPAVA.js.map → walk-4VPK7AS4.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-LGNDFRYC.js";
5
5
  import {
6
6
  readPath
7
- } from "./chunk-HLEK5VAN.js";
7
+ } from "./chunk-5WWDGFOS.js";
8
8
 
9
9
  // src/kernel/query/relate/join-on.ts
10
10
  var RANGE_OPS = /* @__PURE__ */ new Set(["<", "<=", ">", ">=", "between"]);
@@ -201,4 +201,4 @@ export {
201
201
  joinOnDispatch,
202
202
  matchDeclaredJoin
203
203
  };
204
- //# sourceMappingURL=chunk-MKXXMNJH.js.map
204
+ //# sourceMappingURL=chunk-4V3Q35WG.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CargoNotEnabledError
3
- } from "./chunk-244VXYPG.js";
3
+ } from "./chunk-37EPTBBR.js";
4
4
 
5
5
  // src/with-cargo/strategy.ts
6
6
  var NO_CARGO = {
@@ -12,4 +12,4 @@ var NO_CARGO = {
12
12
  export {
13
13
  NO_CARGO
14
14
  };
15
- //# sourceMappingURL=chunk-A6IJU4TK.js.map
15
+ //# sourceMappingURL=chunk-52MGURXO.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  buildRecordEnvelope
3
- } from "./chunk-SEE332EV.js";
3
+ } from "./chunk-EZGV6F47.js";
4
4
  import {
5
5
  ValidationError
6
- } from "./chunk-244VXYPG.js";
6
+ } from "./chunk-37EPTBBR.js";
7
7
 
8
8
  // src/with-party/directory/cover/custom.ts
9
9
  var CUSTOM_KEY_PATTERN = /^[a-z0-9]+([.-][a-z0-9]+)+$/i;
@@ -179,7 +179,7 @@ async function loadCover(store, vault) {
179
179
  const envelope = await store.get(vault, "_meta", COVER_RECORD_ID);
180
180
  if (!envelope) return void 0;
181
181
  try {
182
- const parsed = JSON.parse(envelope._data);
182
+ const parsed = JSON.parse(envelope._data ?? "");
183
183
  if (!isCover(parsed)) return void 0;
184
184
  return parsed;
185
185
  } catch {
@@ -230,4 +230,4 @@ export {
230
230
  resolveLocale,
231
231
  pickLocale
232
232
  };
233
- //# sourceMappingURL=chunk-IUWCVHQ7.js.map
233
+ //# sourceMappingURL=chunk-5A4345TG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/with-party/directory/cover/custom.ts","../src/with-party/directory/cover/schema.ts","../src/with-party/directory/cover/storage.ts"],"sourcesContent":["/**\n * The cover's namespaced `custom` extension slot (#800) — input\n * validation, the namespace-level patch merge, and the post-merge\n * size caps.\n *\n * Like everything on the cover, `custom` is plaintext, public by\n * design, and unauthenticated — payloads are hints (display defaults,\n * routing suggestions, registry pointers), never an input to\n * security, authorization, or data-integrity decisions.\n *\n * @see https://github.com/noy-db/docs/blob/main/content/docs/services/public-envelope.md\n *\n * @module\n */\nimport { ValidationError } from '../../../kernel/errors.js'\nimport type { Cover, JsonValue, ResolvedCoverSchema } from './types.js'\n\n/**\n * Namespace keys must be reverse-DNS or package-style identifiers —\n * at least one dot/dash-separated segment (`noydb.viewer`,\n * `com.acme.registry` pass; a bare `config` fails), so two frameworks\n * can't collide on a bare word.\n */\nconst CUSTOM_KEY_PATTERN = /^[a-z0-9]+([.-][a-z0-9]+)+$/i\n\n/** Maximum nesting depth of a namespace payload (containers, not leaves). */\nconst MAX_CUSTOM_DEPTH = 8\n\n/**\n * Validate the owner-supplied `custom` input: the field must be a\n * plain object, every key must match {@link CUSTOM_KEY_PATTERN}, and\n * every value must be JSON-serializable (no functions, `undefined`,\n * symbols, bigints, or cycles) within the depth cap. `null` is\n * accepted — it is the delete-this-namespace directive and never\n * persists. Throws `ValidationError` on the first violation.\n */\nexport function validateCustomInput(custom: Record<string, JsonValue>): void {\n if (custom === null || typeof custom !== 'object' || Array.isArray(custom)) {\n throw new ValidationError(\n `setCover: custom must be a { [namespace]: value } object, got ${\n Array.isArray(custom) ? 'array' : typeof custom\n }.`,\n )\n }\n for (const [ns, value] of Object.entries(custom)) {\n if (!CUSTOM_KEY_PATTERN.test(ns)) {\n throw new ValidationError(\n `setCover: custom namespace \"${ns}\" is invalid. Keys must be ` +\n 'reverse-DNS or package-style identifiers with at least one ' +\n 'dot/dash-separated segment (e.g. \"noydb.viewer\", \"com.acme.registry\").',\n )\n }\n assertJsonValue(value, ns, 1, new Set())\n }\n}\n\nfunction assertJsonValue(\n value: unknown,\n ns: string,\n depth: number,\n seen: Set<object>,\n): void {\n if (value === null) return\n const t = typeof value\n if (t === 'string' || t === 'number' || t === 'boolean') return\n if (t !== 'object') {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] contains a non-JSON value (${t}). ` +\n 'Only strings, numbers, booleans, null, arrays, and plain objects are allowed.',\n )\n }\n const container = value as object\n if (seen.has(container)) {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] contains a circular reference.`,\n )\n }\n if (depth > MAX_CUSTOM_DEPTH) {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] nests deeper than the ${MAX_CUSTOM_DEPTH}-level cap.`,\n )\n }\n seen.add(container)\n const children = Array.isArray(container) ? container : Object.values(container)\n for (const child of children) {\n assertJsonValue(child, ns, depth + 1, seen)\n }\n seen.delete(container)\n}\n\n/**\n * Namespace-level patch merge for `setCover`: provided namespaces\n * replace their previous value, absent namespaces are preserved, and\n * an explicit `null` deletes that namespace (so `null` never persists\n * as a namespace value). A whole-`custom`-absent patch preserves the\n * previous custom, consistent with the other cover fields. Rationale:\n * framework A must never need read-modify-write of framework B's data.\n *\n * Returns a spreadable fragment — `{ custom }` when the merge leaves\n * at least one namespace, `{}` when it leaves none (the field is\n * dropped from the persisted document rather than stored empty).\n */\nexport function mergeCustom(\n existing: Record<string, JsonValue> | undefined,\n patch: Record<string, JsonValue> | undefined,\n): { custom: Record<string, JsonValue> } | Record<string, never> {\n if (patch === undefined) {\n return existing !== undefined ? { custom: existing } : {}\n }\n const merged: Record<string, JsonValue> = { ...existing }\n for (const [ns, value] of Object.entries(patch)) {\n if (value === null) {\n delete merged[ns]\n } else {\n merged[ns] = value\n }\n }\n return Object.keys(merged).length > 0 ? { custom: merged } : {}\n}\n\n/**\n * Post-merge size caps — validates the WOULD-BE-PERSISTED document\n * (after the namespace merge), so a small patch can't tip the stored\n * cover over a cap unnoticed. `maxCoverBytes` bounds the entire\n * serialized document, which also closes the unbounded locale-map\n * key-count hole for `name` / `description`. Sizes are measured as\n * `JSON.stringify` length. Throws `ValidationError` on violation.\n */\nexport function validateCoverSize(\n cover: Cover,\n schema: ResolvedCoverSchema,\n): void {\n if (cover.custom !== undefined) {\n const customSize = JSON.stringify(cover.custom).length\n if (customSize > schema.maxCustomBytes) {\n throw new ValidationError(\n `setCover: custom exceeds the ${schema.maxCustomBytes}-byte cap ` +\n `(got ${customSize} bytes serialized, after merging with the stored namespaces).`,\n )\n }\n }\n const totalSize = JSON.stringify(cover).length\n if (totalSize > schema.maxCoverBytes) {\n throw new ValidationError(\n `setCover: the cover document exceeds the ${schema.maxCoverBytes}-byte cap ` +\n `(got ${totalSize} bytes serialized).`,\n )\n }\n}\n","/**\n * Validate-on-write for the cover. Runs at every `setCover` call;\n * the developer's schema decides which fields are allowed and the\n * size caps that apply.\n *\n * @module\n */\nimport { ValidationError } from '../../../kernel/errors.js'\nimport { validateCustomInput } from './custom.js'\nimport type {\n Cover,\n CoverText,\n JsonValue,\n ResolvedCoverSchema,\n CoverField,\n} from './types.js'\n\n/** Owner-supplied input — the subset of {@link Cover} the owner can set. */\nexport interface SetCoverInput {\n readonly name?: CoverText\n readonly description?: CoverText\n readonly icon?: string\n readonly defaultLocale?: string\n /**\n * Namespace-level patch for the cover's `custom` slot (#800):\n * provided namespaces replace their previous value, absent\n * namespaces are preserved, an explicit `null` deletes that\n * namespace. Requires `'custom'` in the schema's `fields` list —\n * the `cover: true` shorthand does NOT enable it.\n */\n readonly custom?: Record<string, JsonValue>\n}\n\nconst DATA_URL_PREFIX = /^data:([a-zA-Z0-9.+-]+\\/[a-zA-Z0-9.+-]+);base64,/\n\n/**\n * Validate an owner-supplied cover input against the developer's\n * resolved schema. Throws `ValidationError` on the first violation;\n * returns void on success.\n *\n * The validator is deliberately strict: every fail mode is a hard\n * error rather than a silent drop, so the owner finds out immediately\n * which field they oversized rather than discovering a truncated\n * label months later.\n */\nexport function validateCoverInput(\n input: SetCoverInput,\n schema: ResolvedCoverSchema,\n): void {\n const allowed = new Set<CoverField>(schema.fields)\n\n // Reject any key not in the schema's allowed-field list.\n for (const key of Object.keys(input)) {\n const known: CoverField | undefined =\n key === 'name' || key === 'description' || key === 'icon' || key === 'defaultLocale' || key === 'custom'\n ? key\n : undefined\n if (!known) {\n throw new ValidationError(\n `setCover: unknown field \"${key}\". ` +\n `Allowed fields: ${[...allowed].join(', ')}.`,\n )\n }\n if (!allowed.has(known)) {\n throw new ValidationError(\n `setCover: field \"${known}\" is not enabled in this vault's schema. ` +\n `Allowed fields: ${[...allowed].join(', ')}.`,\n )\n }\n }\n\n if (input.name !== undefined) {\n validateText(input.name, 'name', schema.maxStringChars)\n }\n if (input.description !== undefined) {\n validateText(input.description, 'description', schema.maxStringChars)\n }\n if (input.icon !== undefined) {\n validateIcon(input.icon, schema)\n }\n if (input.defaultLocale !== undefined && typeof input.defaultLocale !== 'string') {\n throw new ValidationError(\n `setCover: defaultLocale must be a string (BCP-47), got ${typeof input.defaultLocale}.`,\n )\n }\n if (input.custom !== undefined) {\n validateCustomInput(input.custom)\n }\n}\n\nfunction validateText(\n value: CoverText,\n field: string,\n maxChars: number,\n): void {\n if (typeof value === 'string') {\n if (value.length > maxChars) {\n throw new ValidationError(\n `setCover: ${field} exceeds the ${maxChars}-character cap (got ${value.length}).`,\n )\n }\n return\n }\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new ValidationError(\n `setCover: ${field} must be a string or { [locale]: string } map, got ${typeof value}.`,\n )\n }\n // Locale map. Each value must be a non-empty string within the cap.\n for (const [locale, str] of Object.entries(value)) {\n if (typeof str !== 'string') {\n throw new ValidationError(\n `setCover: ${field}[${locale}] must be a string, got ${typeof str}.`,\n )\n }\n if (str.length > maxChars) {\n throw new ValidationError(\n `setCover: ${field}[${locale}] exceeds the ${maxChars}-character cap (got ${str.length}).`,\n )\n }\n }\n}\n\nfunction validateIcon(icon: string, schema: ResolvedCoverSchema): void {\n if (typeof icon !== 'string') {\n throw new ValidationError(\n `setCover: icon must be a data: URL string, got ${typeof icon}.`,\n )\n }\n if (icon.length > schema.maxIconBytes) {\n throw new ValidationError(\n `setCover: icon exceeds the ${schema.maxIconBytes}-byte cap (got ${icon.length}).`,\n )\n }\n const m = DATA_URL_PREFIX.exec(icon)\n if (!m) {\n throw new ValidationError(\n 'setCover: icon must be a base64 data URL ' +\n '(`data:image/png;base64,…` or `data:image/svg+xml;base64,…`). ' +\n 'External URLs are not supported in v1.',\n )\n }\n const mime = m[1]!\n if (!schema.iconMimeTypes.includes(mime)) {\n throw new ValidationError(\n `setCover: icon MIME type \"${mime}\" is not allowed. ` +\n `Permitted types: ${schema.iconMimeTypes.join(', ')}.`,\n )\n }\n}\n\n/**\n * Lightweight runtime predicate — used by the bundle header\n * validator to recognise a cover without requiring it. (The wire\n * discriminator keeps its frozen name: `_noydb_public: 1`.)\n */\nexport function isCover(x: unknown): x is Cover {\n if (x === null || typeof x !== 'object' || Array.isArray(x)) return false\n const obj = x as Record<string, unknown>\n return obj['_noydb_public'] === 1 && typeof obj['version'] === 'number'\n}\n","/**\n * Persistence helpers for `_meta/public-envelope` — the cover's\n * frozen wire location. Mirrors the bypass-AES pattern used by\n * `_meta/handle` and `_meta/policy` — the document is plaintext\n * JSON, the envelope's `_iv` field is left empty.\n *\n * @module\n */\nimport { buildRecordEnvelope } from '../../../kernel/enclave/index.js'\nimport type { NoydbStore } from '../../../kernel/types.js'\nimport type { Cover } from './types.js'\nimport { isCover } from './schema.js'\n\n/**\n * Reserved id for the vault-level cover record. The VALUE is frozen\n * wire format — the record predates the #799 rename and stays at\n * `_meta/public-envelope` so existing vaults need no migration.\n */\nexport const COVER_RECORD_ID = 'public-envelope'\n\n/**\n * Read the cover from `_meta/public-envelope`. Returns `undefined`\n * when no cover has been persisted (fresh vault, or a vault written\n * before the feature was enabled). Tolerates corrupted documents —\n * a JSON parse failure surfaces as `undefined`, not a thrown error,\n * mirroring `_meta/handle`'s contract.\n */\nexport async function loadCover(\n store: NoydbStore,\n vault: string,\n): Promise<Cover | undefined> {\n const envelope = await store.get(vault, '_meta', COVER_RECORD_ID)\n if (!envelope) return undefined\n try {\n const parsed = JSON.parse(envelope._data) as unknown\n if (!isCover(parsed)) return undefined\n return parsed\n } catch {\n return undefined\n }\n}\n\n/** Persist the cover. Idempotent — overwrites any prior write. */\nexport async function saveCover(\n store: NoydbStore,\n vault: string,\n cover: Cover,\n): Promise<void> {\n const wireEnvelope = buildRecordEnvelope(\n { collection: '_meta', id: COVER_RECORD_ID, version: 1 },\n { iv: '', data: JSON.stringify(cover) },\n )\n await store.put(vault, '_meta', COVER_RECORD_ID, wireEnvelope)\n}\n\n/**\n * Public, no-key reader. Plain function, not a method on `Noydb` —\n * the whole point is it works without an authenticated session, so\n * a UI can show \"Acme 2026 Tax Records\" before unlocking.\n *\n * Resolves any `name` / `description` locale map through the supplied\n * `locale` (when provided). Omitting `locale` returns the raw\n * cover, which a multilingual picker can render as it pleases.\n */\nexport async function readCover(\n store: NoydbStore,\n vault: string,\n opts: { readonly locale?: string } = {},\n): Promise<Cover | undefined> {\n const raw = await loadCover(store, vault)\n if (!raw) return undefined\n if (opts.locale === undefined) return raw\n return resolveLocale(raw, opts.locale)\n}\n\n/**\n * Resolve the locale-map fields (`name`, `description`) of a cover\n * to plain strings for the requested locale, falling back through\n * `defaultLocale` and then any available translation.\n *\n * @internal\n */\nexport function resolveLocale(\n cover: Cover,\n locale: string,\n): Cover {\n return {\n ...cover,\n ...(cover.name !== undefined ? { name: pickLocale(cover.name, locale, cover.defaultLocale) } : {}),\n ...(cover.description !== undefined ? { description: pickLocale(cover.description, locale, cover.defaultLocale) } : {}),\n }\n}\n\n/**\n * Resolve a `string | { [locale]: string }` value to a string for a\n * given locale. Exported so the bundle reader can reuse it without\n * duplicating the fallback chain.\n *\n * **Looser than `resolveI18nText`** — the hub's record-field resolver\n * throws `LocaleNotSpecifiedError` when no translation matches, but\n * label semantics deliberately prefer \"show *something*\" over\n * throwing. The fallback chain is:\n * 1. Exact `locale` match.\n * 2. `defaultLocale` (when supplied on the cover).\n * 3. First non-empty value in the map.\n * 4. Empty string (only if every translation is empty — pathological).\n *\n * This deviation is documented in `https://github.com/noy-db/docs/blob/main/content/docs/services/public-envelope.md`.\n */\nexport function pickLocale(\n value: string | Record<string, string>,\n locale: string,\n defaultLocale: string | undefined,\n): string {\n if (typeof value === 'string') return value\n if (value[locale] !== undefined && value[locale] !== '') return value[locale]\n if (defaultLocale && value[defaultLocale] !== undefined && value[defaultLocale] !== '') {\n return value[defaultLocale]\n }\n for (const v of Object.values(value)) {\n if (v !== '') return v\n }\n return ''\n}\n"],"mappings":";;;;;;;;AAuBA,IAAM,qBAAqB;AAG3B,IAAM,mBAAmB;AAUlB,SAAS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AAqC,CAAC,GACV;AAC5B,QAAM,MAAM,MAAM,UAAU,OAAO,KAAK;AACxC,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI,KAAK,WAAW,OAAW,QAAO;AACtC,SAAO,cAAc,KAAK,KAAK,MAAM;AACvC;AASO,SAAS,cACd,OACA,QACO;AACP,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAI,MAAM,SAAS,SAAY,EAAE,MAAM,WAAW,MAAM,MAAM,QAAQ,MAAM,aAAa,EAAE,IAAI,CAAC;AAAA,IAChG,GAAI,MAAM,gBAAgB,SAAY,EAAE,aAAa,WAAW,MAAM,aAAa,QAAQ,MAAM,aAAa,EAAE,IAAI,CAAC;AAAA,EACvH;AACF;AAkBO,SAAS,WACd,OACA,QACA,eACQ;AACR,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,MAAM,MAAM,MAAM,UAAa,MAAM,MAAM,MAAM,GAAI,QAAO,MAAM,MAAM;AAC5E,MAAI,iBAAiB,MAAM,aAAa,MAAM,UAAa,MAAM,aAAa,MAAM,IAAI;AACtF,WAAO,MAAM,aAAa;AAAA,EAC5B;AACA,aAAW,KAAK,OAAO,OAAO,KAAK,GAAG;AACpC,QAAI,MAAM,GAAI,QAAO;AAAA,EACvB;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/with-party/directory/cover/custom.ts","../src/with-party/directory/cover/schema.ts","../src/with-party/directory/cover/storage.ts"],"sourcesContent":["/**\n * The cover's namespaced `custom` extension slot (#800) — input\n * validation, the namespace-level patch merge, and the post-merge\n * size caps.\n *\n * Like everything on the cover, `custom` is plaintext, public by\n * design, and unauthenticated — payloads are hints (display defaults,\n * routing suggestions, registry pointers), never an input to\n * security, authorization, or data-integrity decisions.\n *\n * @see https://github.com/noy-db/docs/blob/main/content/docs/services/public-envelope.md\n *\n * @module\n */\nimport { ValidationError } from '../../../kernel/errors.js'\nimport type { Cover, JsonValue, ResolvedCoverSchema } from './types.js'\n\n/**\n * Namespace keys must be reverse-DNS or package-style identifiers —\n * at least one dot/dash-separated segment (`noydb.viewer`,\n * `com.acme.registry` pass; a bare `config` fails), so two frameworks\n * can't collide on a bare word.\n */\nconst CUSTOM_KEY_PATTERN = /^[a-z0-9]+([.-][a-z0-9]+)+$/i\n\n/** Maximum nesting depth of a namespace payload (containers, not leaves). */\nconst MAX_CUSTOM_DEPTH = 8\n\n/**\n * Validate the owner-supplied `custom` input: the field must be a\n * plain object, every key must match {@link CUSTOM_KEY_PATTERN}, and\n * every value must be JSON-serializable (no functions, `undefined`,\n * symbols, bigints, or cycles) within the depth cap. `null` is\n * accepted — it is the delete-this-namespace directive and never\n * persists. Throws `ValidationError` on the first violation.\n */\nexport function validateCustomInput(custom: Record<string, JsonValue>): void {\n if (custom === null || typeof custom !== 'object' || Array.isArray(custom)) {\n throw new ValidationError(\n `setCover: custom must be a { [namespace]: value } object, got ${\n Array.isArray(custom) ? 'array' : typeof custom\n }.`,\n )\n }\n for (const [ns, value] of Object.entries(custom)) {\n if (!CUSTOM_KEY_PATTERN.test(ns)) {\n throw new ValidationError(\n `setCover: custom namespace \"${ns}\" is invalid. Keys must be ` +\n 'reverse-DNS or package-style identifiers with at least one ' +\n 'dot/dash-separated segment (e.g. \"noydb.viewer\", \"com.acme.registry\").',\n )\n }\n assertJsonValue(value, ns, 1, new Set())\n }\n}\n\nfunction assertJsonValue(\n value: unknown,\n ns: string,\n depth: number,\n seen: Set<object>,\n): void {\n if (value === null) return\n const t = typeof value\n if (t === 'string' || t === 'number' || t === 'boolean') return\n if (t !== 'object') {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] contains a non-JSON value (${t}). ` +\n 'Only strings, numbers, booleans, null, arrays, and plain objects are allowed.',\n )\n }\n const container = value as object\n if (seen.has(container)) {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] contains a circular reference.`,\n )\n }\n if (depth > MAX_CUSTOM_DEPTH) {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] nests deeper than the ${MAX_CUSTOM_DEPTH}-level cap.`,\n )\n }\n seen.add(container)\n const children = Array.isArray(container) ? container : Object.values(container)\n for (const child of children) {\n assertJsonValue(child, ns, depth + 1, seen)\n }\n seen.delete(container)\n}\n\n/**\n * Namespace-level patch merge for `setCover`: provided namespaces\n * replace their previous value, absent namespaces are preserved, and\n * an explicit `null` deletes that namespace (so `null` never persists\n * as a namespace value). A whole-`custom`-absent patch preserves the\n * previous custom, consistent with the other cover fields. Rationale:\n * framework A must never need read-modify-write of framework B's data.\n *\n * Returns a spreadable fragment — `{ custom }` when the merge leaves\n * at least one namespace, `{}` when it leaves none (the field is\n * dropped from the persisted document rather than stored empty).\n */\nexport function mergeCustom(\n existing: Record<string, JsonValue> | undefined,\n patch: Record<string, JsonValue> | undefined,\n): { custom: Record<string, JsonValue> } | Record<string, never> {\n if (patch === undefined) {\n return existing !== undefined ? { custom: existing } : {}\n }\n const merged: Record<string, JsonValue> = { ...existing }\n for (const [ns, value] of Object.entries(patch)) {\n if (value === null) {\n delete merged[ns]\n } else {\n merged[ns] = value\n }\n }\n return Object.keys(merged).length > 0 ? { custom: merged } : {}\n}\n\n/**\n * Post-merge size caps — validates the WOULD-BE-PERSISTED document\n * (after the namespace merge), so a small patch can't tip the stored\n * cover over a cap unnoticed. `maxCoverBytes` bounds the entire\n * serialized document, which also closes the unbounded locale-map\n * key-count hole for `name` / `description`. Sizes are measured as\n * `JSON.stringify` length. Throws `ValidationError` on violation.\n */\nexport function validateCoverSize(\n cover: Cover,\n schema: ResolvedCoverSchema,\n): void {\n if (cover.custom !== undefined) {\n const customSize = JSON.stringify(cover.custom).length\n if (customSize > schema.maxCustomBytes) {\n throw new ValidationError(\n `setCover: custom exceeds the ${schema.maxCustomBytes}-byte cap ` +\n `(got ${customSize} bytes serialized, after merging with the stored namespaces).`,\n )\n }\n }\n const totalSize = JSON.stringify(cover).length\n if (totalSize > schema.maxCoverBytes) {\n throw new ValidationError(\n `setCover: the cover document exceeds the ${schema.maxCoverBytes}-byte cap ` +\n `(got ${totalSize} bytes serialized).`,\n )\n }\n}\n","/**\n * Validate-on-write for the cover. Runs at every `setCover` call;\n * the developer's schema decides which fields are allowed and the\n * size caps that apply.\n *\n * @module\n */\nimport { ValidationError } from '../../../kernel/errors.js'\nimport { validateCustomInput } from './custom.js'\nimport type {\n Cover,\n CoverText,\n JsonValue,\n ResolvedCoverSchema,\n CoverField,\n} from './types.js'\n\n/** Owner-supplied input — the subset of {@link Cover} the owner can set. */\nexport interface SetCoverInput {\n readonly name?: CoverText\n readonly description?: CoverText\n readonly icon?: string\n readonly defaultLocale?: string\n /**\n * Namespace-level patch for the cover's `custom` slot (#800):\n * provided namespaces replace their previous value, absent\n * namespaces are preserved, an explicit `null` deletes that\n * namespace. Requires `'custom'` in the schema's `fields` list —\n * the `cover: true` shorthand does NOT enable it.\n */\n readonly custom?: Record<string, JsonValue>\n}\n\nconst DATA_URL_PREFIX = /^data:([a-zA-Z0-9.+-]+\\/[a-zA-Z0-9.+-]+);base64,/\n\n/**\n * Validate an owner-supplied cover input against the developer's\n * resolved schema. Throws `ValidationError` on the first violation;\n * returns void on success.\n *\n * The validator is deliberately strict: every fail mode is a hard\n * error rather than a silent drop, so the owner finds out immediately\n * which field they oversized rather than discovering a truncated\n * label months later.\n */\nexport function validateCoverInput(\n input: SetCoverInput,\n schema: ResolvedCoverSchema,\n): void {\n const allowed = new Set<CoverField>(schema.fields)\n\n // Reject any key not in the schema's allowed-field list.\n for (const key of Object.keys(input)) {\n const known: CoverField | undefined =\n key === 'name' || key === 'description' || key === 'icon' || key === 'defaultLocale' || key === 'custom'\n ? key\n : undefined\n if (!known) {\n throw new ValidationError(\n `setCover: unknown field \"${key}\". ` +\n `Allowed fields: ${[...allowed].join(', ')}.`,\n )\n }\n if (!allowed.has(known)) {\n throw new ValidationError(\n `setCover: field \"${known}\" is not enabled in this vault's schema. ` +\n `Allowed fields: ${[...allowed].join(', ')}.`,\n )\n }\n }\n\n if (input.name !== undefined) {\n validateText(input.name, 'name', schema.maxStringChars)\n }\n if (input.description !== undefined) {\n validateText(input.description, 'description', schema.maxStringChars)\n }\n if (input.icon !== undefined) {\n validateIcon(input.icon, schema)\n }\n if (input.defaultLocale !== undefined && typeof input.defaultLocale !== 'string') {\n throw new ValidationError(\n `setCover: defaultLocale must be a string (BCP-47), got ${typeof input.defaultLocale}.`,\n )\n }\n if (input.custom !== undefined) {\n validateCustomInput(input.custom)\n }\n}\n\nfunction validateText(\n value: CoverText,\n field: string,\n maxChars: number,\n): void {\n if (typeof value === 'string') {\n if (value.length > maxChars) {\n throw new ValidationError(\n `setCover: ${field} exceeds the ${maxChars}-character cap (got ${value.length}).`,\n )\n }\n return\n }\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new ValidationError(\n `setCover: ${field} must be a string or { [locale]: string } map, got ${typeof value}.`,\n )\n }\n // Locale map. Each value must be a non-empty string within the cap.\n for (const [locale, str] of Object.entries(value)) {\n if (typeof str !== 'string') {\n throw new ValidationError(\n `setCover: ${field}[${locale}] must be a string, got ${typeof str}.`,\n )\n }\n if (str.length > maxChars) {\n throw new ValidationError(\n `setCover: ${field}[${locale}] exceeds the ${maxChars}-character cap (got ${str.length}).`,\n )\n }\n }\n}\n\nfunction validateIcon(icon: string, schema: ResolvedCoverSchema): void {\n if (typeof icon !== 'string') {\n throw new ValidationError(\n `setCover: icon must be a data: URL string, got ${typeof icon}.`,\n )\n }\n if (icon.length > schema.maxIconBytes) {\n throw new ValidationError(\n `setCover: icon exceeds the ${schema.maxIconBytes}-byte cap (got ${icon.length}).`,\n )\n }\n const m = DATA_URL_PREFIX.exec(icon)\n if (!m) {\n throw new ValidationError(\n 'setCover: icon must be a base64 data URL ' +\n '(`data:image/png;base64,…` or `data:image/svg+xml;base64,…`). ' +\n 'External URLs are not supported in v1.',\n )\n }\n const mime = m[1]!\n if (!schema.iconMimeTypes.includes(mime)) {\n throw new ValidationError(\n `setCover: icon MIME type \"${mime}\" is not allowed. ` +\n `Permitted types: ${schema.iconMimeTypes.join(', ')}.`,\n )\n }\n}\n\n/**\n * Lightweight runtime predicate — used by the bundle header\n * validator to recognise a cover without requiring it. (The wire\n * discriminator keeps its frozen name: `_noydb_public: 1`.)\n */\nexport function isCover(x: unknown): x is Cover {\n if (x === null || typeof x !== 'object' || Array.isArray(x)) return false\n const obj = x as Record<string, unknown>\n return obj['_noydb_public'] === 1 && typeof obj['version'] === 'number'\n}\n","/**\n * Persistence helpers for `_meta/public-envelope` — the cover's\n * frozen wire location. Mirrors the bypass-AES pattern used by\n * `_meta/handle` and `_meta/policy` — the document is plaintext\n * JSON, the envelope's `_iv` field is left empty.\n *\n * @module\n */\nimport { buildRecordEnvelope } from '../../../capsule/index.js'\nimport type { NoydbStore } from '../../../kernel/types.js'\nimport type { Cover } from './types.js'\nimport { isCover } from './schema.js'\n\n/**\n * Reserved id for the vault-level cover record. The VALUE is frozen\n * wire format — the record predates the #799 rename and stays at\n * `_meta/public-envelope` so existing vaults need no migration.\n */\nexport const COVER_RECORD_ID = 'public-envelope'\n\n/**\n * Read the cover from `_meta/public-envelope`. Returns `undefined`\n * when no cover has been persisted (fresh vault, or a vault written\n * before the feature was enabled). Tolerates corrupted documents —\n * a JSON parse failure surfaces as `undefined`, not a thrown error,\n * mirroring `_meta/handle`'s contract.\n */\nexport async function loadCover(\n store: NoydbStore,\n vault: string,\n): Promise<Cover | undefined> {\n const envelope = await store.get(vault, '_meta', COVER_RECORD_ID)\n if (!envelope) return undefined\n try {\n const parsed = JSON.parse(envelope._data ?? '') as unknown\n if (!isCover(parsed)) return undefined\n return parsed\n } catch {\n return undefined\n }\n}\n\n/** Persist the cover. Idempotent — overwrites any prior write. */\nexport async function saveCover(\n store: NoydbStore,\n vault: string,\n cover: Cover,\n): Promise<void> {\n const wireEnvelope = buildRecordEnvelope(\n { collection: '_meta', id: COVER_RECORD_ID, version: 1 },\n { iv: '', data: JSON.stringify(cover) },\n )\n await store.put(vault, '_meta', COVER_RECORD_ID, wireEnvelope)\n}\n\n/**\n * Public, no-key reader. Plain function, not a method on `Noydb` —\n * the whole point is it works without an authenticated session, so\n * a UI can show \"Acme 2026 Tax Records\" before unlocking.\n *\n * Resolves any `name` / `description` locale map through the supplied\n * `locale` (when provided). Omitting `locale` returns the raw\n * cover, which a multilingual picker can render as it pleases.\n */\nexport async function readCover(\n store: NoydbStore,\n vault: string,\n opts: { readonly locale?: string } = {},\n): Promise<Cover | undefined> {\n const raw = await loadCover(store, vault)\n if (!raw) return undefined\n if (opts.locale === undefined) return raw\n return resolveLocale(raw, opts.locale)\n}\n\n/**\n * Resolve the locale-map fields (`name`, `description`) of a cover\n * to plain strings for the requested locale, falling back through\n * `defaultLocale` and then any available translation.\n *\n * @internal\n */\nexport function resolveLocale(\n cover: Cover,\n locale: string,\n): Cover {\n return {\n ...cover,\n ...(cover.name !== undefined ? { name: pickLocale(cover.name, locale, cover.defaultLocale) } : {}),\n ...(cover.description !== undefined ? { description: pickLocale(cover.description, locale, cover.defaultLocale) } : {}),\n }\n}\n\n/**\n * Resolve a `string | { [locale]: string }` value to a string for a\n * given locale. Exported so the bundle reader can reuse it without\n * duplicating the fallback chain.\n *\n * **Looser than `resolveI18nText`** — the hub's record-field resolver\n * throws `LocaleNotSpecifiedError` when no translation matches, but\n * label semantics deliberately prefer \"show *something*\" over\n * throwing. The fallback chain is:\n * 1. Exact `locale` match.\n * 2. `defaultLocale` (when supplied on the cover).\n * 3. First non-empty value in the map.\n * 4. Empty string (only if every translation is empty — pathological).\n *\n * This deviation is documented in `https://github.com/noy-db/docs/blob/main/content/docs/services/public-envelope.md`.\n */\nexport function pickLocale(\n value: string | Record<string, string>,\n locale: string,\n defaultLocale: string | undefined,\n): string {\n if (typeof value === 'string') return value\n if (value[locale] !== undefined && value[locale] !== '') return value[locale]\n if (defaultLocale && value[defaultLocale] !== undefined && value[defaultLocale] !== '') {\n return value[defaultLocale]\n }\n for (const v of Object.values(value)) {\n if (v !== '') return v\n }\n return ''\n}\n"],"mappings":";;;;;;;;A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AO,SAAS,iBAAiB,YAAY;AAC/D;AAWA,eAAsB,UACpB,OACA,OACA,OAAqC,CAAC,GACV;AAC5B,QAAM,MAAM,MAAM,UAAU,OAAO,KAAK;AACxC,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI,KAAK,WAAW,OAAW,QAAO;AACtC,SAAO,cAAc,KAAK,KAAK,MAAM;AACvC;AASO,SAAS,cACd,OACA,QACO;AACP,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAI,MAAM,SAAS,SAAY,EAAE,MAAM,WAAW,MAAM,MAAM,QAAQ,MAAM,aAAa,EAAE,IAAI,CAAC;AAAA,IAChG,GAAI,MAAM,gBAAgB,SAAY,EAAE,aAAa,WAAW,MAAM,aAAa,QAAQ,MAAM,aAAa,EAAE,IAAI,CAAC;AAAA,EACvH;AACF;AAkBO,SAAS,WACd,OACA,QACA,eACQ;AACR,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,MAAM,MAAM,MAAM,UAAa,MAAM,MAAM,MAAM,GAAI,QAAO,MAAM,MAAM;AAC5E,MAAI,iBAAiB,MAAM,aAAa,MAAM,UAAa,MAAM,aAAa,MAAM,IAAI;AACtF,WAAO,MAAM,aAAa;AAAA,EAC5B;AACA,aAAW,KAAK,OAAO,OAAO,KAAK,GAAG;AACpC,QAAI,MAAM,GAAI,QAAO;AAAA,EACvB;AACA,SAAO;AACT;","names":[]}
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  getHistory,
3
3
  historyIdentity
4
- } from "./chunk-QWGU66MP.js";
4
+ } from "./chunk-LNSVGRHO.js";
5
5
  import {
6
6
  liveRecordIsElevated
7
- } from "./chunk-JCN44NCY.js";
7
+ } from "./chunk-FLPCETP6.js";
8
8
  import {
9
9
  openEnvelopeJson
10
- } from "./chunk-KJFW62P4.js";
10
+ } from "./chunk-EZGV6F47.js";
11
11
  import {
12
12
  ReadOnlyAtInstantError
13
- } from "./chunk-244VXYPG.js";
13
+ } from "./chunk-37EPTBBR.js";
14
14
 
15
15
  // src/with-commit/history/time-machine.ts
16
16
  var VaultInstant = class {
@@ -52,7 +52,7 @@ var CollectionInstant = class {
52
52
  async get(id) {
53
53
  const found = await this.resolveVisibleEnvelope(id);
54
54
  if (!found) return null;
55
- const plaintext = this.engine.encrypted ? await openEnvelopeJson(found.ref, found.envelope, await this.engine.getDEK(this.name)) : found.envelope._data;
55
+ const plaintext = this.engine.encrypted ? await openEnvelopeJson(found.ref, found.envelope, await this.engine.getDEK(this.name)) : found.envelope._data ?? "";
56
56
  return JSON.parse(plaintext);
57
57
  }
58
58
  /**
@@ -208,4 +208,4 @@ export {
208
208
  VaultInstant,
209
209
  CollectionInstant
210
210
  };
211
- //# sourceMappingURL=chunk-ISZQJBML.js.map
211
+ //# sourceMappingURL=chunk-5FE75J4S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-commit/history/time-machine.ts"],"sourcesContent":["/**\n * Time-machine queries — point-in-time reads reconstructed from the\n * existing history + ledger infrastructure.\n *\n * ## Usage\n *\n * ```ts\n * const vault = await db.openVault('acme', { secret })\n * const q1End = vault.at('2026-03-31T23:59:59Z')\n * const invoice = await q1End.collection<Invoice>('invoices').get('inv-001')\n * // → the record as it stood at the close of Q1 2026\n * ```\n *\n * ## How it works\n *\n * Every write path already fans out into two persistence lanes:\n *\n * 1. `saveHistory(...)` persists a **full encrypted envelope snapshot**\n * per version under the `_history` collection (one envelope per\n * version, keyed by `{collection}:{id}:{paddedVersion}`). Each\n * envelope carries its own `_ts` (the write timestamp).\n * 2. `ledger.append(...)` appends a hash-chained audit entry that\n * records the `op` (put / delete), `version`, and `ts`.\n *\n * Reconstruction at a target timestamp T is therefore:\n *\n * - Find the newest history envelope for `(collection, id)` whose\n * `_ts ≤ T` — that's the state the record was in at T.\n * - Check the ledger for any `op: 'delete'` entry for the same\n * `(collection, id)` with `entry.ts` in `(latestEnvelope._ts, T]` —\n * if present, the record was deleted before T, so return `null`.\n * - Decrypt the surviving envelope with the current collection DEK\n * (DEKs are per-collection but stable across versions — the same\n * key encrypts v1 and v15 of a record).\n *\n * No delta replay. The existing `history.ts` module already stores\n * complete snapshots; we just pick the right one.\n *\n * ## Read-only contract\n *\n * Every write method on `CollectionInstant` throws\n * {@link ReadOnlyAtInstantError}. A historical view is a *read*\n * surface — mutating the past would require either a branch/shadow\n * mechanism (tracked under shadow vaults) or a rewrite of\n * history, which breaks the ledger's tamper-evidence guarantee.\n *\n * @module\n */\nimport type { EncryptedEnvelope, NoydbStore } from '../../kernel/types.js'\nimport type { LedgerStore } from './ledger/store.js'\nimport { getHistory, historyIdentity } from './history.js'\n\n/**\n * An envelope together with **the address it was fetched from**.\n *\n * The time machine resolves a record's state at an instant from two different\n * places — the live collection, or a `_history` snapshot — and those are sealed\n * against different identities (#1041). Returning the envelope alone discards\n * the one fact the reader needs to open it, which is precisely the read-side\n * data-flow gap that binding identity exposes.\n */\ninterface ResolvedEnvelope {\n readonly envelope: EncryptedEnvelope\n readonly ref: { readonly collection: string; readonly id: string }\n}\nimport { openEnvelopeJson, type EnclaveKey } from '../../capsule/index.js'\nimport { ReadOnlyAtInstantError } from '../../kernel/errors.js'\nimport { liveRecordIsElevated } from '../../kernel/tier-visibility.js'\n\n/**\n * Narrow view of a {@link Vault}'s internals that\n * {@link VaultInstant} needs. Passed in by `Vault.at()` rather than\n * constructed here so all crypto + adapter access stays inside the\n * Vault class.\n *\n * Not exported from the public barrel — consumers should get a\n * `VaultInstant` via `vault.at(ts)`, never by constructing one\n * directly.\n */\nexport interface VaultEngine {\n readonly adapter: NoydbStore\n /** Vault name (the compartment). */\n readonly name: string\n /**\n * `true` when the vault was opened with a secret (the normal\n * case). `false` in plaintext-mode vaults (`encrypt: false`) — in\n * that case `envelope._data` is raw JSON and we skip the DEK lookup.\n */\n readonly encrypted: boolean\n /**\n * Resolves the DEK used to decrypt a given collection's envelopes.\n * Not called when `encrypted` is false.\n */\n getDEK(collection: string): Promise<EnclaveKey>\n /**\n * Lazily-initialised ledger. We consult it to detect deletes that\n * happened between the latest history snapshot and the target\n * timestamp. `null` when history is disabled for this vault — in\n * that case time-machine reads fall back to history-only\n * reconstruction (which may miss deletes).\n */\n getLedger(): LedgerStore | null\n}\n\n/**\n * A vault at a fixed instant. Produced by `vault.at(timestamp)`.\n * Carries no session state of its own — every read is a fresh\n * lookup through the vault's adapter.\n *\n * Cheap to construct; safe to throw away. Create one per query.\n */\nexport class VaultInstant {\n constructor(\n private readonly engine: VaultEngine,\n /** Fully-resolved target timestamp (ISO-8601 UTC). */\n public readonly timestamp: string,\n ) {}\n\n /** Get a point-in-time view of a collection. */\n collection<T = unknown>(name: string): CollectionInstant<T> {\n return new CollectionInstant<T>(this.engine, this.timestamp, name)\n }\n}\n\n/**\n * A read-only collection view anchored to a past instant.\n *\n * Every write method throws {@link ReadOnlyAtInstantError} — see the\n * module docstring for why. The read surface is intentionally smaller\n * than the live {@link Collection}: `get` and `list` cover the\n * \"what did the books look like on date X\" use case without pulling\n * in the full query DSL / joins / aggregates at this stage. Follow-up\n * work tracked under.\n */\nexport class CollectionInstant<T = unknown> {\n constructor(\n private readonly engine: VaultEngine,\n private readonly targetTs: string,\n public readonly name: string,\n ) {}\n\n /**\n * Return the record as it existed at the target timestamp, or\n * `null` if the record had not been created yet or had already been\n * deleted by then.\n *\n * Gated on the LIVE record's current tier — #730, mirroring the #712\n * read-gate `history()`/`getVersion()` already apply: an elevated record\n * is invisible through the whole time-machine surface, not just a\n * decrypt failure. See {@link resolveVisibleEnvelope}.\n *\n * Decrypts through {@link openEnvelopeJson}, the `_cek`-aware envelope\n * body opener — a snapshot from a `perRecordKeys` collection is encrypted\n * under its own per-record CEK (wrapped in `_cek`), not the collection\n * DEK directly.\n */\n async get(id: string): Promise<T | null> {\n const found = await this.resolveVisibleEnvelope(id)\n if (!found) return null\n // The envelope may be the LIVE record or a `_history` snapshot, and the two\n // are sealed against different identities (#1041). `resolveEnvelope` carries\n // the address down with the bytes precisely so this read can name it.\n const plaintext = this.engine.encrypted\n ? await openEnvelopeJson(found.ref, found.envelope, await this.engine.getDEK(this.name))\n : (found.envelope._data ?? '')\n return JSON.parse(plaintext) as T\n }\n\n /**\n * IDs of records that existed (had at least one `put` and were not\n * subsequently deleted) at the target timestamp.\n *\n * Implemented as a linear scan over history + ledger. Performance\n * is bounded by total history size (not live-vault size), so the\n * memory-first vault-scale cap (1K–50K records × average history\n * depth) still applies.\n */\n async list(): Promise<string[]> {\n const historyIds = await collectHistoryIds(this.engine.adapter, this.engine.name, this.name)\n const liveIds = await this.engine.adapter.list(this.engine.name, this.name)\n const candidateIds = new Set<string>([...historyIds, ...liveIds])\n const alive: string[] = []\n for (const id of candidateIds) {\n const env = await this.resolveVisibleEnvelope(id)\n if (env) alive.push(id)\n }\n return alive.sort()\n }\n\n // ── write guards ───────────────────────────────────────────────────\n\n async put(_id: string, _record: T): Promise<never> {\n throw new ReadOnlyAtInstantError('put', this.targetTs)\n }\n async delete(_id: string): Promise<never> {\n throw new ReadOnlyAtInstantError('delete', this.targetTs)\n }\n async update(_id: string, _patch: Partial<T>): Promise<never> {\n throw new ReadOnlyAtInstantError('update', this.targetTs)\n }\n\n // ── internals ─────────────────────────────────────────────────────\n\n /**\n * {@link resolveEnvelope}, additionally gated on the record's LIVE\n * (current, not historical) tier — #730. Mirrors the #712 read-gate\n * `history()`/`getVersion()` apply: history snapshots keep their\n * tier-0-wrapped CEKs and carry no `_tier` of their own, so an elevated\n * record's prior versions would otherwise stay tier-0-decryptable here.\n * `null` for a resolved envelope carrying its own `_tier > 0` (a\n * tier-aware snapshot reached some other way) or whose LIVE record is\n * currently elevated — both `get()` and `list()` route through this so\n * the invisibility law holds on the whole time-machine read surface, not\n * just a decrypt failure.\n */\n private async resolveVisibleEnvelope(id: string): Promise<ResolvedEnvelope | null> {\n const found = await this.resolveEnvelope(id)\n if (!found || (found.envelope._tier ?? 0) > 0) return null\n if (await liveRecordIsElevated(this.engine.adapter, this.engine.name, this.name, id)) return null\n return found\n }\n\n /**\n * Return the envelope that represents the record's state at\n * `targetTs`, accounting for deletes. `null` if the record didn't\n * exist at that instant.\n *\n * ## Why we use the ledger as the authoritative timeline\n *\n * The per-version history snapshots saved by `saveHistory()` do\n * carry a `_ts` field, but that timestamp is the moment the\n * snapshot was *captured* (i.e. the instant right before the\n * subsequent overwrite), not the original write time. The ledger,\n * by contrast, records `ts` at the moment of each `put` / `delete`\n * — it's the only source that tracks the real timeline. So:\n *\n * 1. Walk the ledger; find the latest entry for `(collection, id)`\n * with `ts ≤ targetTs`.\n * 2. If that entry is a `delete`, the record was gone at the\n * target instant — return null.\n * 3. Otherwise it's a `put` with a specific `version`. Load the\n * envelope for that version from history, falling back to the\n * live collection for the most recent version.\n *\n * ## Fallback when the ledger is disabled\n *\n * If the vault has history disabled, `getLedger()` returns null and\n * we fall back to comparing envelope `_ts` fields. This is\n * approximate and gets the *last write* right but may confuse the\n * intermediate versions; adopters needing accurate time-machine\n * reads should leave history enabled.\n */\n private async resolveEnvelope(id: string): Promise<ResolvedEnvelope | null> {\n const ledger = this.engine.getLedger()\n if (ledger) {\n return this.resolveViaLedger(id, ledger)\n }\n return this.resolveViaEnvelopeTs(id)\n }\n\n private async resolveViaLedger(id: string, ledger: LedgerStore): Promise<ResolvedEnvelope | null> {\n const entries = await ledger.entries()\n // Entries are already ordered by index which is the mutation order.\n let latest: { op: 'put' | 'delete'; version: number } | null = null\n for (const e of entries) {\n if (e.collection !== this.name || e.id !== id) continue\n if (e.ts > this.targetTs) break // entries are time-ordered by index\n // `amendment` + `lifecycle` entries are audit-only summaries — they\n // carry no (collection, id) tuple of their own and would never match\n // the filter above. The narrow here is a type guard, not a runtime\n // skip.\n // `forget` is a subject-erasure summary with empty (collection, id) —\n // never matches the filter above; the narrow is a type guard.\n if (e.op === 'amendment' || e.op === 'lifecycle' || e.op === 'forget') continue\n // `migration` is a record rewrite (cutover) — resolve it like a put.\n latest = { op: e.op === 'migration' ? 'put' : e.op, version: e.version }\n }\n if (!latest) return null\n if (latest.op === 'delete') return null\n return this.loadVersion(id, latest.version)\n }\n\n private async resolveViaEnvelopeTs(id: string): Promise<ResolvedEnvelope | null> {\n const history = await getHistory(\n this.engine.adapter, this.engine.name, this.name, id,\n )\n const live = await this.engine.adapter.get(this.engine.name, this.name, id)\n // Each candidate keeps the address it came from — a snapshot and the live\n // record are sealed against different identities, and this map is exactly\n // where that provenance used to be discarded (#1041).\n const byVersion = new Map<number, ResolvedEnvelope>()\n for (const e of history) {\n byVersion.set(e._v, { envelope: e, ref: historyIdentity(this.name, id, e._v) })\n }\n if (live) byVersion.set(live._v, { envelope: live, ref: { collection: this.name, id } })\n const sorted = [...byVersion.values()].sort((a, b) =>\n a.envelope._ts < b.envelope._ts ? 1 : a.envelope._ts > b.envelope._ts ? -1 : 0,\n )\n return sorted.find((e) => e.envelope._ts <= this.targetTs) ?? null\n }\n\n /**\n * Fetch the envelope for a specific version. The live record (most\n * recent put) lives in the main collection; prior versions live in\n * `_history`. We check live first because the common case after a\n * delete is that we're trying to load the last-live version from\n * history, and skipping live for the current-version case avoids a\n * redundant lookup.\n */\n private async loadVersion(id: string, version: number): Promise<ResolvedEnvelope | null> {\n const live = await this.engine.adapter.get(this.engine.name, this.name, id)\n if (live && live._v === version) {\n return { envelope: live, ref: { collection: this.name, id } }\n }\n\n // Direct lookup by (collection, id, version) — avoids scanning all history.\n //\n // This used to rebuild the key inline as\n // `${name}:${id}:${padStart(10,'0')}` — a SECOND definition of the history\n // layout, free to drift from `historyId`'s. It now goes through\n // `historyIdentity`, the same function `saveHistory` writes with, so the\n // read address and the write address cannot disagree (#1041).\n const ref = historyIdentity(this.name, id, version)\n const envelope = await this.engine.adapter.get(this.engine.name, ref.collection, ref.id)\n return envelope ? { envelope, ref } : null\n }\n}\n\n/**\n * Scan the `_history` collection once and collect every distinct\n * `recordId` for the given collection. History keys follow the\n * shape `<collection>:<recordId>:<paddedVersion>`; we split on the\n * last two colons (delimiter-safe because `paddedVersion` is\n * exactly 10 digits).\n */\nasync function collectHistoryIds(\n adapter: NoydbStore,\n vault: string,\n collection: string,\n): Promise<string[]> {\n const all = await adapter.list(vault, '_history')\n const prefix = `${collection}:`\n const seen = new Set<string>()\n for (const key of all) {\n if (!key.startsWith(prefix)) continue\n const lastColon = key.lastIndexOf(':')\n if (lastColon <= prefix.length) continue\n const middle = key.slice(prefix.length, lastColon)\n seen.add(middle)\n }\n return [...seen]\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+GO,IAAM,eAAN,MAAmB;AAAA,EACxB,YACmB,QAED,WAChB;AAHiB;AAED;AAAA,EACf;AAAA,EAHgB;AAAA,EAED;AAAA;AAAA,EAIlB,WAAwB,MAAoC;AAC1D,WAAO,IAAI,kBAAqB,KAAK,QAAQ,KAAK,WAAW,IAAI;AAAA,EACnE;AACF;AAYO,IAAM,oBAAN,MAAqC;AAAA,EAC1C,YACmB,QACA,UACD,MAChB;AAHiB;AACA;AACD;AAAA,EACf;AAAA,EAHgB;AAAA,EACA;AAAA,EACD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBlB,MAAM,IAAI,IAA+B;AACvC,UAAM,QAAQ,MAAM,KAAK,uBAAuB,EAAE;AAClD,QAAI,CAAC,MAAO,QAAO;AAInB,UAAM,YAAY,KAAK,OAAO,YAC1B,MAAM,iBAAiB,MAAM,KAAK,MAAM,UAAU,MAAM,KAAK,OAAO,OAAO,KAAK,IAAI,CAAC,IACpF,MAAM,SAAS,SAAS;AAC7B,WAAO,KAAK,MAAM,SAAS;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,OAA0B;AAC9B,UAAM,aAAa,MAAM,kBAAkB,KAAK,OAAO,SAAS,KAAK,OAAO,MAAM,KAAK,IAAI;AAC3F,UAAM,UAAU,MAAM,KAAK,OAAO,QAAQ,KAAK,KAAK,OAAO,MAAM,KAAK,IAA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