@noy-db/hub 0.8.0 → 0.9.0-pre.1

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 (567) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +8 -8
  3. package/codemods/0.4.0-pre.json +1 -1
  4. package/codemods/0.8.0-pre.json +1 -1
  5. package/dist/api-6EFD43KN.js +18 -0
  6. package/dist/as/index.js +33 -23
  7. package/dist/as/index.js.map +1 -1
  8. package/dist/at/index.js +8 -8
  9. package/dist/attestation/index.js +18 -18
  10. package/dist/{backup-YE2VQ26S.js → backup-RJBFQSHE.js} +92 -31
  11. package/dist/backup-RJBFQSHE.js.map +1 -0
  12. package/dist/blobs/index.js +12 -12
  13. package/dist/broker/index.js +19 -11
  14. package/dist/broker/index.js.map +1 -1
  15. package/dist/by/index.js +2 -2
  16. package/dist/capsule/contract.d.ts +1 -1
  17. package/dist/capsule/contract.js +6 -6
  18. package/dist/capsule/enclave-aes/broker/proof.d.ts +12 -3
  19. package/dist/capsule/enclave-aes/crypto.d.ts +18 -0
  20. package/dist/capsule/enclave-aes/index.d.ts +3 -3
  21. package/dist/capsule/enclave-aes/index.js +46 -14
  22. package/dist/capsule/enclave-aes/index.js.map +1 -1
  23. package/dist/capsule/index.d.ts +2 -2
  24. package/dist/capsule/plumbing/record-codec.d.ts +7 -0
  25. package/dist/{capsule-VOLX3QRQ.js → capsule-6LJAVQNM.js} +14 -8
  26. package/dist/cargo/index.js +35 -35
  27. package/dist/{chunk-GZT3NQRA.js → chunk-25FXU6WS.js} +8 -2
  28. package/dist/chunk-25FXU6WS.js.map +1 -0
  29. package/dist/{chunk-OYW3I5M4.js → chunk-2DOCDOPL.js} +6 -6
  30. package/dist/chunk-2DX4JCRI.js +1 -0
  31. package/dist/{chunk-FLPCETP6.js → chunk-2LBS62AC.js} +2 -2
  32. package/dist/{chunk-WXE4W2U6.js → chunk-2ST3WA3C.js} +4 -4
  33. package/dist/{chunk-DQESF6RP.js → chunk-3G3GOGZZ.js} +50 -40
  34. package/dist/chunk-3G3GOGZZ.js.map +1 -0
  35. package/dist/{chunk-O2IMQSNA.js → chunk-3YBIVLTC.js} +2 -2
  36. package/dist/{chunk-LGNDFRYC.js → chunk-4CFHL5RY.js} +1 -1
  37. package/dist/chunk-4CFHL5RY.js.map +1 -0
  38. package/dist/{chunk-DIZLQVAA.js → chunk-4CHM2TRS.js} +2 -2
  39. package/dist/{chunk-V7ADQF5O.js → chunk-4CUJLEOA.js} +4 -4
  40. package/dist/{chunk-3EWS67C7.js → chunk-4TG2ITRW.js} +2 -2
  41. package/dist/{chunk-HS554XAF.js → chunk-5HQFROZS.js} +2 -2
  42. package/dist/{chunk-IUBMZPHM.js → chunk-5ZVE3N5C.js} +5 -6
  43. package/dist/chunk-5ZVE3N5C.js.map +1 -0
  44. package/dist/{chunk-PP3K67AJ.js → chunk-654RE5YC.js} +3 -3
  45. package/dist/{chunk-FOEDQATO.js → chunk-66GD7XXU.js} +2 -2
  46. package/dist/{chunk-BNWA3WG5.js → chunk-72FQ46VW.js} +3 -3
  47. package/dist/{chunk-EYG2CY2X.js → chunk-7JPA3LIH.js} +11 -11
  48. package/dist/chunk-7JPA3LIH.js.map +1 -0
  49. package/dist/{chunk-JQYKPKG6.js → chunk-7K42TSCY.js} +4 -4
  50. package/dist/{chunk-BPWYQ25R.js → chunk-7Q6IU3R7.js} +4 -4
  51. package/dist/{chunk-BPWYQ25R.js.map → chunk-7Q6IU3R7.js.map} +1 -1
  52. package/dist/{chunk-T7IR4N2S.js → chunk-7UHLO4ZN.js} +37 -2
  53. package/dist/chunk-7UHLO4ZN.js.map +1 -0
  54. package/dist/{chunk-UEFOQH74.js → chunk-ADCXTW7L.js} +2 -2
  55. package/dist/{chunk-MBMTND6D.js → chunk-AGGPT4UE.js} +2 -2
  56. package/dist/{chunk-RB4DOPGZ.js → chunk-AKIEBFIJ.js} +10 -10
  57. package/dist/{chunk-VHBKYN2J.js → chunk-B3B6HV5S.js} +2 -2
  58. package/dist/{chunk-JWWYRR4Q.js → chunk-B6EWMGFX.js} +2 -2
  59. package/dist/{chunk-H7JBY4P7.js → chunk-B7Y2BRQA.js} +14 -14
  60. package/dist/chunk-B7Y2BRQA.js.map +1 -0
  61. package/dist/{chunk-4CIQDWRB.js → chunk-BFJE2GPP.js} +14 -8
  62. package/dist/{chunk-4CIQDWRB.js.map → chunk-BFJE2GPP.js.map} +1 -1
  63. package/dist/{chunk-WPOYWFSE.js → chunk-BJRKXNFP.js} +7 -7
  64. package/dist/{chunk-H427H63K.js → chunk-BPQ5CRJF.js} +2 -2
  65. package/dist/{chunk-VFHCKG5M.js → chunk-BVRJYMFZ.js} +3 -3
  66. package/dist/{chunk-244QBK7Z.js → chunk-C4XV3PSJ.js} +4 -4
  67. package/dist/{chunk-244QBK7Z.js.map → chunk-C4XV3PSJ.js.map} +1 -1
  68. package/dist/{chunk-SMV2HRDU.js → chunk-DFC4WTJW.js} +2 -2
  69. package/dist/{chunk-5A4345TG.js → chunk-DMIEKD24.js} +3 -3
  70. package/dist/{chunk-TKVUE4JF.js → chunk-DQAXA2GK.js} +9 -9
  71. package/dist/{chunk-AL6ML4LA.js → chunk-DWCFGF2K.js} +5 -5
  72. package/dist/{chunk-Y3LPTBG7.js → chunk-E2C6FFSI.js} +6 -9
  73. package/dist/chunk-E2C6FFSI.js.map +1 -0
  74. package/dist/{chunk-LNSVGRHO.js → chunk-EQ6C2ZPT.js} +17 -51
  75. package/dist/chunk-EQ6C2ZPT.js.map +1 -0
  76. package/dist/chunk-EZOFTI4K.js +60 -0
  77. package/dist/chunk-EZOFTI4K.js.map +1 -0
  78. package/dist/{chunk-PD64727P.js → chunk-FMINS2B6.js} +2 -2
  79. package/dist/chunk-FMINS2B6.js.map +1 -0
  80. package/dist/{chunk-QBLT6POL.js → chunk-FPF5HRBE.js} +2 -2
  81. package/dist/{chunk-UA372JHH.js → chunk-FZVCZEVI.js} +3 -3
  82. package/dist/chunk-FZVCZEVI.js.map +1 -0
  83. package/dist/{chunk-FFWI7UH7.js → chunk-GAGT3YZN.js} +1 -1
  84. package/dist/chunk-GAGT3YZN.js.map +1 -0
  85. package/dist/{chunk-5WWDGFOS.js → chunk-GIQJGXV7.js} +2 -2
  86. package/dist/{chunk-V3RWOOSO.js → chunk-GYZICGRU.js} +4 -4
  87. package/dist/chunk-GYZICGRU.js.map +1 -0
  88. package/dist/{chunk-BVCUTXE3.js → chunk-H334G6KU.js} +2 -2
  89. package/dist/{chunk-AEQGFRU4.js → chunk-HE7EAHGS.js} +3 -3
  90. package/dist/chunk-HKB4HZDU.js +74 -0
  91. package/dist/chunk-HKB4HZDU.js.map +1 -0
  92. package/dist/{chunk-4V3Q35WG.js → chunk-ICF3TIGY.js} +3 -3
  93. package/dist/{chunk-3L2NBKDR.js → chunk-IF2M43G4.js} +2 -2
  94. package/dist/{chunk-37EPTBBR.js → chunk-IKPQ2GGB.js} +46 -4
  95. package/dist/chunk-IKPQ2GGB.js.map +1 -0
  96. package/dist/{chunk-DHHGL42E.js → chunk-IKS2CPAG.js} +27 -11
  97. package/dist/chunk-IKS2CPAG.js.map +1 -0
  98. package/dist/{chunk-3A5DUZ56.js → chunk-IMIQAGR7.js} +6 -6
  99. package/dist/{chunk-3A5DUZ56.js.map → chunk-IMIQAGR7.js.map} +1 -1
  100. package/dist/{chunk-A4XMIZT3.js → chunk-IQAJ4OR6.js} +41 -6
  101. package/dist/chunk-IQAJ4OR6.js.map +1 -0
  102. package/dist/{chunk-IUT3GWP3.js → chunk-IUD7WU67.js} +17 -93
  103. package/dist/chunk-IUD7WU67.js.map +1 -0
  104. package/dist/{chunk-AUKKUPVB.js → chunk-IVLRPRXM.js} +2 -2
  105. package/dist/{chunk-GUZET4SG.js → chunk-JAQHWHUN.js} +4 -4
  106. package/dist/chunk-JAQHWHUN.js.map +1 -0
  107. package/dist/{chunk-Y2RKVFKR.js → chunk-K4JSTGXT.js} +2 -2
  108. package/dist/{chunk-EJLV62NI.js → chunk-KN4LUMH6.js} +2 -2
  109. package/dist/{chunk-23D6M6VM.js → chunk-KZA3DITX.js} +4 -4
  110. package/dist/{chunk-E2N2T5ZO.js → chunk-L2VM64HK.js} +2 -2
  111. package/dist/chunk-L4UL4IAR.js +55 -0
  112. package/dist/chunk-L4UL4IAR.js.map +1 -0
  113. package/dist/{chunk-UIYESRD6.js → chunk-LUCQY3OM.js} +10 -10
  114. package/dist/{chunk-UIYESRD6.js.map → chunk-LUCQY3OM.js.map} +1 -1
  115. package/dist/{chunk-O46CHQT7.js → chunk-MAQBYBUX.js} +4 -4
  116. package/dist/{chunk-EZOAKKTB.js → chunk-MBPZMZVB.js} +2 -2
  117. package/dist/{chunk-XQRFSKYM.js → chunk-MCNNZBG7.js} +2 -2
  118. package/dist/{chunk-YRXFFWG4.js → chunk-MLVPMDOZ.js} +2 -2
  119. package/dist/{chunk-5FE75J4S.js → chunk-MMCN7TLK.js} +5 -5
  120. package/dist/{chunk-MXOQ5JCG.js → chunk-MRCR7ZMC.js} +686 -202
  121. package/dist/chunk-MRCR7ZMC.js.map +1 -0
  122. package/dist/{chunk-SYNY3VB5.js → chunk-NCTN2FW4.js} +2 -2
  123. package/dist/{chunk-4T3SE27M.js → chunk-ND6S2DKC.js} +2 -2
  124. package/dist/{chunk-3XJQBBZD.js → chunk-NTVKHQ3L.js} +2 -2
  125. package/dist/{chunk-RHVMZSUU.js → chunk-NV4OESHC.js} +1 -1
  126. package/dist/chunk-NV4OESHC.js.map +1 -0
  127. package/dist/chunk-NXQEOC3X.js +40 -0
  128. package/dist/chunk-NXQEOC3X.js.map +1 -0
  129. package/dist/{chunk-Q4UHJ5SN.js → chunk-O2VQ3K36.js} +2 -2
  130. package/dist/{chunk-HW7CMKUG.js → chunk-OFD2HD6F.js} +1 -1
  131. package/dist/{chunk-HW7CMKUG.js.map → chunk-OFD2HD6F.js.map} +1 -1
  132. package/dist/{chunk-2GHDLTPE.js → chunk-OGKMRIIJ.js} +2 -2
  133. package/dist/{chunk-N7EVQD5S.js → chunk-ONZ3B5EW.js} +4 -4
  134. package/dist/{chunk-VKI2EB3N.js → chunk-OOPSMQX5.js} +3 -3
  135. package/dist/{chunk-VMV5SBE4.js → chunk-OYEBSWLE.js} +5 -5
  136. package/dist/{chunk-JDEYF3PJ.js → chunk-P6FATPXQ.js} +2 -2
  137. package/dist/chunk-P6FATPXQ.js.map +1 -0
  138. package/dist/{chunk-VVOLDVIR.js → chunk-PLTIJDQN.js} +2 -2
  139. package/dist/{chunk-OKSTSITU.js → chunk-PR7ILCIH.js} +3 -3
  140. package/dist/{chunk-7R2Q7CPL.js → chunk-QE3TLZ6Z.js} +7 -7
  141. package/dist/{chunk-G2MVBDFP.js → chunk-QFW4MYGN.js} +39 -9
  142. package/dist/chunk-QFW4MYGN.js.map +1 -0
  143. package/dist/{chunk-6QVKPHBF.js → chunk-QHG7GQKM.js} +2 -2
  144. package/dist/chunk-QJNAHPVT.js +91 -0
  145. package/dist/chunk-QJNAHPVT.js.map +1 -0
  146. package/dist/{chunk-LIOVX5TJ.js → chunk-QT5ITL25.js} +3 -3
  147. package/dist/{chunk-IMQKWR46.js → chunk-R2ZULFXU.js} +4 -5
  148. package/dist/chunk-R2ZULFXU.js.map +1 -0
  149. package/dist/{chunk-Q2XRFWOI.js → chunk-RRTQAQ3N.js} +2 -2
  150. package/dist/{chunk-H23XHRTT.js → chunk-RUE6TCES.js} +809 -101
  151. package/dist/chunk-RUE6TCES.js.map +1 -0
  152. package/dist/chunk-RWFQVNXR.js +24 -0
  153. package/dist/chunk-RWFQVNXR.js.map +1 -0
  154. package/dist/{chunk-2PVXF5CS.js → chunk-SALY3LIJ.js} +3 -3
  155. package/dist/{chunk-JOSPH3E5.js → chunk-SBAR5JQ6.js} +2 -2
  156. package/dist/{chunk-N7UDP5VU.js → chunk-SCH2F7R2.js} +7 -7
  157. package/dist/{chunk-MXKI4ABF.js → chunk-SOOAW6HK.js} +3 -3
  158. package/dist/{chunk-VQDZYB2B.js → chunk-T4VTRKCY.js} +3 -3
  159. package/dist/{chunk-VQDZYB2B.js.map → chunk-T4VTRKCY.js.map} +1 -1
  160. package/dist/{chunk-TEHHROZL.js → chunk-T5EXREMW.js} +5 -5
  161. package/dist/{chunk-M5B2W6YY.js → chunk-TDJVQTXD.js} +3 -3
  162. package/dist/{chunk-QMWY2FDS.js → chunk-THQ3BHLM.js} +2 -2
  163. package/dist/{chunk-VAORSCSU.js → chunk-TLIFNRU5.js} +2 -2
  164. package/dist/chunk-TLIFNRU5.js.map +1 -0
  165. package/dist/{chunk-FVH5QYY2.js → chunk-TRHUNPXP.js} +2 -2
  166. package/dist/{chunk-EGVJ7TM4.js → chunk-UL6MTRMJ.js} +8 -9
  167. package/dist/chunk-UL6MTRMJ.js.map +1 -0
  168. package/dist/chunk-UNL6YGL5.js +169 -0
  169. package/dist/chunk-UNL6YGL5.js.map +1 -0
  170. package/dist/{chunk-747G6CT3.js → chunk-UORWAG7K.js} +2 -2
  171. package/dist/{chunk-XSPFDUDG.js → chunk-V7AKGAXY.js} +314 -77
  172. package/dist/chunk-V7AKGAXY.js.map +1 -0
  173. package/dist/{chunk-TZZBXPZK.js → chunk-VLQ6KT7F.js} +2 -2
  174. package/dist/{chunk-NCO25JZO.js → chunk-VP37VUKQ.js} +4 -4
  175. package/dist/{chunk-52MGURXO.js → chunk-WBUHHMLN.js} +2 -2
  176. package/dist/{chunk-EZGV6F47.js → chunk-WRLWEYHY.js} +7 -1
  177. package/dist/chunk-WRLWEYHY.js.map +1 -0
  178. package/dist/{chunk-2MG3SW7Q.js → chunk-X6Z2SIRF.js} +2 -2
  179. package/dist/{chunk-U2FZNEWJ.js → chunk-XLKWF3L4.js} +8 -6
  180. package/dist/{chunk-U2FZNEWJ.js.map → chunk-XLKWF3L4.js.map} +1 -1
  181. package/dist/{chunk-5UMK7GRI.js → chunk-XPNJH7GN.js} +5 -5
  182. package/dist/{chunk-KZXDLBY6.js → chunk-XPW7T2GN.js} +5 -5
  183. package/dist/{chunk-SV2PM2OY.js → chunk-XX4R7TUB.js} +1 -1
  184. package/dist/chunk-XX4R7TUB.js.map +1 -0
  185. package/dist/{chunk-NBQ3KK6X.js → chunk-Y55XHMQB.js} +4 -4
  186. package/dist/chunk-Y55XHMQB.js.map +1 -0
  187. package/dist/{chunk-5KC7QYEC.js → chunk-YH4OUOSI.js} +33 -7
  188. package/dist/chunk-YH4OUOSI.js.map +1 -0
  189. package/dist/{chunk-FFJFE4T7.js → chunk-YJGKOSQD.js} +2 -2
  190. package/dist/{chunk-2AFX33YA.js → chunk-Z3STG43F.js} +3 -3
  191. package/dist/chunk-Z3STG43F.js.map +1 -0
  192. package/dist/{chunk-OIEO4WDL.js → chunk-ZD7WFMV2.js} +2 -2
  193. package/dist/chunk-ZD7WFMV2.js.map +1 -0
  194. package/dist/{chunk-42ALPZ2B.js → chunk-ZF6JECDT.js} +4 -4
  195. package/dist/{chunk-42ALPZ2B.js.map → chunk-ZF6JECDT.js.map} +1 -1
  196. package/dist/{chunk-4JPMZTJY.js → chunk-ZF7KNSLU.js} +2 -2
  197. package/dist/{chunk-2ODVB6LZ.js → chunk-ZGKODRGB.js} +2 -2
  198. package/dist/{chunk-JIBUPZHA.js → chunk-ZNEKQFGF.js} +4 -4
  199. package/dist/{chunk-DLD5LGDS.js → chunk-ZUTUNVFD.js} +3 -3
  200. package/dist/{chunk-JSMTXZR3.js → chunk-ZWMOHANW.js} +8 -6
  201. package/dist/chunk-ZWMOHANW.js.map +1 -0
  202. package/dist/{chunk-MILI22XQ.js → chunk-ZZZ4VCY2.js} +10 -10
  203. package/dist/chunk-ZZZ4VCY2.js.map +1 -0
  204. package/dist/classified/index.js +5 -5
  205. package/dist/{classified-marker-SIYKUU5L.js → classified-marker-WKP33U2R.js} +3 -3
  206. package/dist/collection-facade-COSGZKLC.js +41 -0
  207. package/dist/{computed-FAD7SED4.js → computed-WN6V53ZV.js} +3 -3
  208. package/dist/consent/index.js +8 -8
  209. package/dist/cover/index.js +8 -8
  210. package/dist/coverage/index.js +1 -1
  211. package/dist/custody/index.js +12 -11
  212. package/dist/{dead-filter-4F3LWYKH.js → dead-filter-43WL3Y5H.js} +10 -10
  213. package/dist/debug/index.js +7 -7
  214. package/dist/delegation-5UWT4JGT.js +26 -0
  215. package/dist/derivations/index.js +24 -23
  216. package/dist/derive-IL5JNLEE.js +20 -0
  217. package/dist/directory/index.js +9 -9
  218. package/dist/{dispatch-JDZNGEB3.js → dispatch-LOQQD5JK.js} +20 -20
  219. package/dist/{dispatch-H4HV32AM.js → dispatch-SHKTG57L.js} +5 -5
  220. package/dist/executor-6PQ7WAGV.js +35 -0
  221. package/dist/executor-6ZPQA6HS.js +8 -0
  222. package/dist/executor-OXRA64TY.js +8 -0
  223. package/dist/export-accessible-XG3FKJWW.js +22 -0
  224. package/dist/extract-partition-33747NY5.js +35 -0
  225. package/dist/{fanout-sidecar-L7NHPIOC.js → fanout-sidecar-NEB6IYV7.js} +8 -8
  226. package/dist/find-VW543G3J.js +10 -0
  227. package/dist/forget/index.js +25 -8
  228. package/dist/forget/index.js.map +1 -1
  229. package/dist/guards/index.js +4 -4
  230. package/dist/history/index.js +15 -13
  231. package/dist/history/index.js.map +1 -1
  232. package/dist/i18n/index.js +13 -13
  233. package/dist/index.d.ts +9 -6
  234. package/dist/index.js +126 -110
  235. package/dist/index.js.map +1 -1
  236. package/dist/indexing/index.js +6 -6
  237. package/dist/introspection/index.js +15 -11
  238. package/dist/issue-4ZPSY44M.js +19 -0
  239. package/dist/kernel/cache/index.d.ts +1 -1
  240. package/dist/kernel/collection.d.ts +86 -6
  241. package/dist/kernel/constants.d.ts +7 -0
  242. package/dist/kernel/errors.d.ts +42 -4
  243. package/dist/kernel/export-scope.d.ts +40 -0
  244. package/dist/kernel/merge-authority.d.ts +5 -1
  245. package/dist/kernel/noydb.d.ts +118 -21
  246. package/dist/kernel/put-many-atomic.d.ts +1 -1
  247. package/dist/kernel/query/live/live.d.ts +2 -1
  248. package/dist/kernel/query/sort-key.d.ts +0 -2
  249. package/dist/kernel/rejection-seal.d.ts +13 -0
  250. package/dist/kernel/sync-wiring.d.ts +55 -0
  251. package/dist/kernel/tx-write-gate.d.ts +2 -4
  252. package/dist/kernel/types.d.ts +463 -14
  253. package/dist/kernel/validation.d.ts +0 -10
  254. package/dist/kernel/vault.d.ts +42 -4
  255. package/dist/kernel/via/reconcile.d.ts +1 -42
  256. package/dist/{ledger-5ZMGE44K.js → ledger-MZ25UFT2.js} +10 -10
  257. package/dist/liberate-OJIP2ZFX.js +25 -0
  258. package/dist/{link-set-MFXC24VK.js → link-set-4FRRAVTH.js} +10 -10
  259. package/dist/{managed-secret-MFTFT22X.js → managed-secret-SQWO2EUR.js} +9 -9
  260. package/dist/materialized-views/index.js +26 -26
  261. package/dist/{migrate-cek-DZRFFOHW.js → migrate-cek-JWEM4RP6.js} +2 -2
  262. package/dist/money/index.js +5 -5
  263. package/dist/noydb-U62OVKXB.js +100 -0
  264. package/dist/on/index.js +25 -0
  265. package/dist/overlay-views/index.js +4 -4
  266. package/dist/periods/index.js +11 -11
  267. package/dist/pod/index.js +71 -67
  268. package/dist/{pod-handle-A3LET7NO.js → pod-handle-R6Y4MILX.js} +8 -8
  269. package/dist/policy/index.js +9 -9
  270. package/dist/port/as/active.d.ts +4 -0
  271. package/dist/port/as/index.d.ts +1 -0
  272. package/dist/port/by/index.d.ts +14 -5
  273. package/dist/port/on/index.d.ts +26 -0
  274. package/dist/port/to/index.d.ts +1 -1
  275. package/dist/port/with/admission-authority.d.ts +34 -0
  276. package/dist/port/with/broker-strategy.d.ts +24 -0
  277. package/dist/port/with/coverage-strategy.d.ts +17 -1
  278. package/dist/port/with/formats-strategy.d.ts +34 -1
  279. package/dist/port/with/lookup-strategy.d.ts +85 -4
  280. package/dist/port/with/rejection-courier.d.ts +37 -0
  281. package/dist/port/with/restore-host.d.ts +33 -0
  282. package/dist/port/with/service-bus.d.ts +20 -1
  283. package/dist/port/with/team-strategy.d.ts +2 -2
  284. package/dist/port/with/write-hooks.d.ts +2 -0
  285. package/dist/portability/index.js +8 -8
  286. package/dist/{post-register-7ND27CF2.js → post-register-GRVQHBOH.js} +6 -6
  287. package/dist/query/all/index.js +16 -16
  288. package/dist/query/index.js +8 -8
  289. package/dist/query/live/index.js +7 -7
  290. package/dist/query/reduce/index.js +10 -10
  291. package/dist/query/relate/index.js +10 -10
  292. package/dist/reduce/index.js +8 -8
  293. package/dist/register-YJ5YLQ36.js +30 -0
  294. package/dist/registry-ICOHBQFD.js +8 -0
  295. package/dist/registry-MJ7MWCSW.js +35 -0
  296. package/dist/registry-MVEKKGWL.js +23 -0
  297. package/dist/registry-XP744FAP.js +8 -0
  298. package/dist/request-withdrawal-LSU4G6W3.js +28 -0
  299. package/dist/restore-to-DVBHAQAA.js +66 -0
  300. package/dist/restore-to-DVBHAQAA.js.map +1 -0
  301. package/dist/{reveal-B2TLP4JQ.js → reveal-AIHOIK2N.js} +7 -7
  302. package/dist/revoke-QUT7WWG3.js +24 -0
  303. package/dist/satellites/index.js +1 -1
  304. package/dist/schema-update/index.js +2 -2
  305. package/dist/sealed-record/index.js +11 -11
  306. package/dist/search/index.js +4 -4
  307. package/dist/{seed-XNSE4U3S.js → seed-GFLA4FCK.js} +136 -27
  308. package/dist/seed-GFLA4FCK.js.map +1 -0
  309. package/dist/sequence/index.js +8 -8
  310. package/dist/session/index.js +8 -8
  311. package/dist/shadow/index.js +2 -2
  312. package/dist/signer-NYR4I3FO.js +23 -0
  313. package/dist/snapshots/index.js +9 -9
  314. package/dist/{stale-6GCFMOOR.js → stale-PIJPAL5T.js} +9 -9
  315. package/dist/storage-VH6SPXHC.js +21 -0
  316. package/dist/{store-coordination-provider-C4BPT5XF.js → store-coordination-provider-2KSHCOPU.js} +9 -9
  317. package/dist/sync/index.js +19 -13
  318. package/dist/sync/index.js.map +1 -1
  319. package/dist/team/index.js +17 -15
  320. package/dist/tiers/index.js +10 -10
  321. package/dist/to/index.js +2 -2
  322. package/dist/transactions/index.js +3 -3
  323. package/dist/util/index.js +1 -1
  324. package/dist/vault-head/index.js +8 -8
  325. package/dist/{verify-UKALW7C2.js → verify-PCFS4PNS.js} +7 -7
  326. package/dist/via/classified/presets.d.ts +29 -0
  327. package/dist/via/classified/resolve.d.ts +7 -0
  328. package/dist/via/geo/binding.d.ts +0 -4
  329. package/dist/via/lookup/index.d.ts +32 -0
  330. package/dist/via/money/binding.d.ts +0 -9
  331. package/dist/walk-OZCN6LJS.js +20 -0
  332. package/dist/with-audit/attestation/strategy.d.ts +2 -1
  333. package/dist/with-audit/attestation/vault-facade.d.ts +7 -0
  334. package/dist/with-audit/forget/completeness.d.ts +66 -0
  335. package/dist/with-audit/forget/index.d.ts +2 -0
  336. package/dist/with-audit/forget/strategy.d.ts +65 -0
  337. package/dist/with-audit/guards/types.d.ts +2 -0
  338. package/dist/with-audit/periods/periods.d.ts +0 -9
  339. package/dist/with-audit/periods/reserved-collections.d.ts +7 -0
  340. package/dist/with-audit/portability/request-withdrawal.d.ts +0 -1
  341. package/dist/with-audit/portability/withdraw-accessible.d.ts +0 -1
  342. package/dist/with-audit/tiers/index.d.ts +6 -6
  343. package/dist/with-audit/tiers/strategy.d.ts +19 -0
  344. package/dist/with-cargo/extract-partition.d.ts +0 -46
  345. package/dist/with-commit/history/history.d.ts +16 -0
  346. package/dist/with-commit/history/restore-to.d.ts +40 -0
  347. package/dist/with-commit/numbering/index.d.ts +0 -2
  348. package/dist/with-commit/tx/transaction.d.ts +2 -24
  349. package/dist/with-commit/vault-head/strategy.d.ts +7 -0
  350. package/dist/with-fork/snapshots/noydb-facade.d.ts +7 -0
  351. package/dist/with-formula/derivations/trigger-match.d.ts +8 -5
  352. package/dist/with-formula/materialized-views/emit-memo.d.ts +0 -2
  353. package/dist/with-lookup/embeddings/index.d.ts +1 -2
  354. package/dist/with-lookup/indexing/collection-facade.d.ts +1 -15
  355. package/dist/with-lookup/indexing/eager-indexes.d.ts +2 -1
  356. package/dist/with-lookup/search/collection-facade.d.ts +0 -12
  357. package/dist/with-party/broker/index.d.ts +2 -2
  358. package/dist/with-party/broker/seed.d.ts +29 -10
  359. package/dist/with-party/custody/strategy.d.ts +2 -2
  360. package/dist/with-party/policy/noydb-facade.d.ts +1 -31
  361. package/dist/with-party/team/delegation.d.ts +93 -7
  362. package/dist/with-party/team/echo-secret.d.ts +0 -2
  363. package/dist/with-party/team/index.d.ts +2 -0
  364. package/dist/with-party/team/keyring.d.ts +133 -24
  365. package/dist/with-party/team/magic-link-grant.d.ts +11 -1
  366. package/dist/with-party/team/noydb-facade.d.ts +19 -2
  367. package/dist/with-party/team/reserved-secret-collections.d.ts +10 -8
  368. package/dist/with-party/team/roster-tag.d.ts +42 -1
  369. package/dist/with-party/team/tiers.d.ts +36 -5
  370. package/dist/with-pod/backup.d.ts +9 -17
  371. package/dist/with-shape/blobs/blob-set.d.ts +23 -0
  372. package/dist/with-shape/blobs/legacy-sweep.d.ts +16 -0
  373. package/dist/with-shape/introspection/describe.d.ts +1 -2
  374. package/dist/with-shape/introspection/index.d.ts +1 -0
  375. package/dist/with-shape/introspection/types.d.ts +2 -1
  376. package/dist/with-shape/schema-update/fence.d.ts +7 -0
  377. package/dist/with-sync/active.d.ts +28 -1
  378. package/dist/with-sync/engine.d.ts +88 -2
  379. package/dist/with-sync/index.d.ts +1 -0
  380. package/dist/with-sync/reserved-mirror.d.ts +112 -0
  381. package/dist/with-sync/strategy.d.ts +9 -0
  382. package/dist/with-sync/tab-write-relay.d.ts +0 -10
  383. package/dist/withdraw-accessible-MTFP7OIB.js +25 -0
  384. package/dist/withdraw-accessible-MTFP7OIB.js.map +1 -0
  385. package/package.json +3 -3
  386. package/dist/api-OS747DS4.js +0 -18
  387. package/dist/backup-YE2VQ26S.js.map +0 -1
  388. package/dist/chunk-2AFX33YA.js.map +0 -1
  389. package/dist/chunk-2RH777HH.js +0 -126
  390. package/dist/chunk-2RH777HH.js.map +0 -1
  391. package/dist/chunk-37EPTBBR.js.map +0 -1
  392. package/dist/chunk-5KC7QYEC.js.map +0 -1
  393. package/dist/chunk-7XMHMVTS.js +0 -20
  394. package/dist/chunk-7XMHMVTS.js.map +0 -1
  395. package/dist/chunk-A4XMIZT3.js.map +0 -1
  396. package/dist/chunk-DHHGL42E.js.map +0 -1
  397. package/dist/chunk-DQESF6RP.js.map +0 -1
  398. package/dist/chunk-EGVJ7TM4.js.map +0 -1
  399. package/dist/chunk-EYG2CY2X.js.map +0 -1
  400. package/dist/chunk-EZGV6F47.js.map +0 -1
  401. package/dist/chunk-FFWI7UH7.js.map +0 -1
  402. package/dist/chunk-G2MVBDFP.js.map +0 -1
  403. package/dist/chunk-GUZET4SG.js.map +0 -1
  404. package/dist/chunk-GZT3NQRA.js.map +0 -1
  405. package/dist/chunk-H23XHRTT.js.map +0 -1
  406. package/dist/chunk-H7JBY4P7.js.map +0 -1
  407. package/dist/chunk-IMQKWR46.js.map +0 -1
  408. package/dist/chunk-IUBMZPHM.js.map +0 -1
  409. package/dist/chunk-IUT3GWP3.js.map +0 -1
  410. package/dist/chunk-JDEYF3PJ.js.map +0 -1
  411. package/dist/chunk-JSMTXZR3.js.map +0 -1
  412. package/dist/chunk-LGNDFRYC.js.map +0 -1
  413. package/dist/chunk-LNSVGRHO.js.map +0 -1
  414. package/dist/chunk-MILI22XQ.js.map +0 -1
  415. package/dist/chunk-MXOQ5JCG.js.map +0 -1
  416. package/dist/chunk-NBQ3KK6X.js.map +0 -1
  417. package/dist/chunk-OIEO4WDL.js.map +0 -1
  418. package/dist/chunk-PD64727P.js.map +0 -1
  419. package/dist/chunk-RHVMZSUU.js.map +0 -1
  420. package/dist/chunk-SV2PM2OY.js.map +0 -1
  421. package/dist/chunk-T7IR4N2S.js.map +0 -1
  422. package/dist/chunk-UA372JHH.js.map +0 -1
  423. package/dist/chunk-UBSFPGVJ.js +0 -1
  424. package/dist/chunk-V3RWOOSO.js.map +0 -1
  425. package/dist/chunk-VAORSCSU.js.map +0 -1
  426. package/dist/chunk-XSPFDUDG.js.map +0 -1
  427. package/dist/chunk-Y3LPTBG7.js.map +0 -1
  428. package/dist/collection-facade-CS7CA2XO.js +0 -47
  429. package/dist/delegation-NANZDG4N.js +0 -102
  430. package/dist/delegation-NANZDG4N.js.map +0 -1
  431. package/dist/derive-XLOJVXPU.js +0 -20
  432. package/dist/executor-FMPVN6DT.js +0 -35
  433. package/dist/executor-LBBBRTN5.js +0 -8
  434. package/dist/executor-OSRZST2U.js +0 -8
  435. package/dist/export-accessible-RAOJAAU5.js +0 -22
  436. package/dist/extract-partition-JD5CUSTG.js +0 -37
  437. package/dist/find-JRN4RNQ5.js +0 -10
  438. package/dist/issue-YIVBZUTH.js +0 -19
  439. package/dist/liberate-WZSZM2W6.js +0 -24
  440. package/dist/noydb-ITIGNKUF.js +0 -96
  441. package/dist/register-DT5HZ2LZ.js +0 -30
  442. package/dist/registry-BHRZGZHF.js +0 -8
  443. package/dist/registry-ET6ZFFWA.js +0 -34
  444. package/dist/registry-HXFGLGTG.js +0 -8
  445. package/dist/registry-THCPDEOD.js +0 -23
  446. package/dist/request-withdrawal-AV2MJJKY.js +0 -30
  447. package/dist/revoke-6DWIEOCV.js +0 -24
  448. package/dist/seed-XNSE4U3S.js.map +0 -1
  449. package/dist/signer-MHGW3OIL.js +0 -23
  450. package/dist/storage-BYN5LO6Z.js +0 -21
  451. package/dist/walk-4VPK7AS4.js +0 -20
  452. package/dist/withdraw-accessible-HL7GACUE.js +0 -27
  453. /package/dist/{api-OS747DS4.js.map → api-6EFD43KN.js.map} +0 -0
  454. /package/dist/{capsule-VOLX3QRQ.js.map → capsule-6LJAVQNM.js.map} +0 -0
  455. /package/dist/{chunk-OYW3I5M4.js.map → chunk-2DOCDOPL.js.map} +0 -0
  456. /package/dist/{chunk-UBSFPGVJ.js.map → chunk-2DX4JCRI.js.map} +0 -0
  457. /package/dist/{chunk-FLPCETP6.js.map → chunk-2LBS62AC.js.map} +0 -0
  458. /package/dist/{chunk-WXE4W2U6.js.map → chunk-2ST3WA3C.js.map} +0 -0
  459. /package/dist/{chunk-O2IMQSNA.js.map → chunk-3YBIVLTC.js.map} +0 -0
  460. /package/dist/{chunk-DIZLQVAA.js.map → chunk-4CHM2TRS.js.map} +0 -0
  461. /package/dist/{chunk-V7ADQF5O.js.map → chunk-4CUJLEOA.js.map} +0 -0
  462. /package/dist/{chunk-3EWS67C7.js.map → chunk-4TG2ITRW.js.map} +0 -0
  463. /package/dist/{chunk-HS554XAF.js.map → chunk-5HQFROZS.js.map} +0 -0
  464. /package/dist/{chunk-PP3K67AJ.js.map → chunk-654RE5YC.js.map} +0 -0
  465. /package/dist/{chunk-FOEDQATO.js.map → chunk-66GD7XXU.js.map} +0 -0
  466. /package/dist/{chunk-BNWA3WG5.js.map → chunk-72FQ46VW.js.map} +0 -0
  467. /package/dist/{chunk-JQYKPKG6.js.map → chunk-7K42TSCY.js.map} +0 -0
  468. /package/dist/{chunk-UEFOQH74.js.map → chunk-ADCXTW7L.js.map} +0 -0
  469. /package/dist/{chunk-MBMTND6D.js.map → chunk-AGGPT4UE.js.map} +0 -0
  470. /package/dist/{chunk-RB4DOPGZ.js.map → chunk-AKIEBFIJ.js.map} +0 -0
  471. /package/dist/{chunk-VHBKYN2J.js.map → chunk-B3B6HV5S.js.map} +0 -0
  472. /package/dist/{chunk-JWWYRR4Q.js.map → chunk-B6EWMGFX.js.map} +0 -0
  473. /package/dist/{chunk-WPOYWFSE.js.map → chunk-BJRKXNFP.js.map} +0 -0
  474. /package/dist/{chunk-H427H63K.js.map → chunk-BPQ5CRJF.js.map} +0 -0
  475. /package/dist/{chunk-VFHCKG5M.js.map → chunk-BVRJYMFZ.js.map} +0 -0
  476. /package/dist/{chunk-SMV2HRDU.js.map → chunk-DFC4WTJW.js.map} +0 -0
  477. /package/dist/{chunk-5A4345TG.js.map → chunk-DMIEKD24.js.map} +0 -0
  478. /package/dist/{chunk-TKVUE4JF.js.map → chunk-DQAXA2GK.js.map} +0 -0
  479. /package/dist/{chunk-AL6ML4LA.js.map → chunk-DWCFGF2K.js.map} +0 -0
  480. /package/dist/{chunk-QBLT6POL.js.map → chunk-FPF5HRBE.js.map} +0 -0
  481. /package/dist/{chunk-5WWDGFOS.js.map → chunk-GIQJGXV7.js.map} +0 -0
  482. /package/dist/{chunk-BVCUTXE3.js.map → chunk-H334G6KU.js.map} +0 -0
  483. /package/dist/{chunk-AEQGFRU4.js.map → chunk-HE7EAHGS.js.map} +0 -0
  484. /package/dist/{chunk-4V3Q35WG.js.map → chunk-ICF3TIGY.js.map} +0 -0
  485. /package/dist/{chunk-3L2NBKDR.js.map → chunk-IF2M43G4.js.map} +0 -0
  486. /package/dist/{chunk-AUKKUPVB.js.map → chunk-IVLRPRXM.js.map} +0 -0
  487. /package/dist/{chunk-Y2RKVFKR.js.map → chunk-K4JSTGXT.js.map} +0 -0
  488. /package/dist/{chunk-EJLV62NI.js.map → chunk-KN4LUMH6.js.map} +0 -0
  489. /package/dist/{chunk-23D6M6VM.js.map → chunk-KZA3DITX.js.map} +0 -0
  490. /package/dist/{chunk-E2N2T5ZO.js.map → chunk-L2VM64HK.js.map} +0 -0
  491. /package/dist/{chunk-O46CHQT7.js.map → chunk-MAQBYBUX.js.map} +0 -0
  492. /package/dist/{chunk-EZOAKKTB.js.map → chunk-MBPZMZVB.js.map} +0 -0
  493. /package/dist/{chunk-XQRFSKYM.js.map → chunk-MCNNZBG7.js.map} +0 -0
  494. /package/dist/{chunk-YRXFFWG4.js.map → chunk-MLVPMDOZ.js.map} +0 -0
  495. /package/dist/{chunk-5FE75J4S.js.map → chunk-MMCN7TLK.js.map} +0 -0
  496. /package/dist/{chunk-SYNY3VB5.js.map → chunk-NCTN2FW4.js.map} +0 -0
  497. /package/dist/{chunk-4T3SE27M.js.map → chunk-ND6S2DKC.js.map} +0 -0
  498. /package/dist/{chunk-3XJQBBZD.js.map → chunk-NTVKHQ3L.js.map} +0 -0
  499. /package/dist/{chunk-Q4UHJ5SN.js.map → chunk-O2VQ3K36.js.map} +0 -0
  500. /package/dist/{chunk-2GHDLTPE.js.map → chunk-OGKMRIIJ.js.map} +0 -0
  501. /package/dist/{chunk-N7EVQD5S.js.map → chunk-ONZ3B5EW.js.map} +0 -0
  502. /package/dist/{chunk-VKI2EB3N.js.map → chunk-OOPSMQX5.js.map} +0 -0
  503. /package/dist/{chunk-VMV5SBE4.js.map → chunk-OYEBSWLE.js.map} +0 -0
  504. /package/dist/{chunk-VVOLDVIR.js.map → chunk-PLTIJDQN.js.map} +0 -0
  505. /package/dist/{chunk-OKSTSITU.js.map → chunk-PR7ILCIH.js.map} +0 -0
  506. /package/dist/{chunk-7R2Q7CPL.js.map → chunk-QE3TLZ6Z.js.map} +0 -0
  507. /package/dist/{chunk-6QVKPHBF.js.map → chunk-QHG7GQKM.js.map} +0 -0
  508. /package/dist/{chunk-LIOVX5TJ.js.map → chunk-QT5ITL25.js.map} +0 -0
  509. /package/dist/{chunk-Q2XRFWOI.js.map → chunk-RRTQAQ3N.js.map} +0 -0
  510. /package/dist/{chunk-2PVXF5CS.js.map → chunk-SALY3LIJ.js.map} +0 -0
  511. /package/dist/{chunk-JOSPH3E5.js.map → chunk-SBAR5JQ6.js.map} +0 -0
  512. /package/dist/{chunk-N7UDP5VU.js.map → chunk-SCH2F7R2.js.map} +0 -0
  513. /package/dist/{chunk-MXKI4ABF.js.map → chunk-SOOAW6HK.js.map} +0 -0
  514. /package/dist/{chunk-TEHHROZL.js.map → chunk-T5EXREMW.js.map} +0 -0
  515. /package/dist/{chunk-M5B2W6YY.js.map → chunk-TDJVQTXD.js.map} +0 -0
  516. /package/dist/{chunk-QMWY2FDS.js.map → chunk-THQ3BHLM.js.map} +0 -0
  517. /package/dist/{chunk-FVH5QYY2.js.map → chunk-TRHUNPXP.js.map} +0 -0
  518. /package/dist/{chunk-747G6CT3.js.map → chunk-UORWAG7K.js.map} +0 -0
  519. /package/dist/{chunk-TZZBXPZK.js.map → chunk-VLQ6KT7F.js.map} +0 -0
  520. /package/dist/{chunk-NCO25JZO.js.map → chunk-VP37VUKQ.js.map} +0 -0
  521. /package/dist/{chunk-52MGURXO.js.map → chunk-WBUHHMLN.js.map} +0 -0
  522. /package/dist/{chunk-2MG3SW7Q.js.map → chunk-X6Z2SIRF.js.map} +0 -0
  523. /package/dist/{chunk-5UMK7GRI.js.map → chunk-XPNJH7GN.js.map} +0 -0
  524. /package/dist/{chunk-KZXDLBY6.js.map → chunk-XPW7T2GN.js.map} +0 -0
  525. /package/dist/{chunk-FFJFE4T7.js.map → chunk-YJGKOSQD.js.map} +0 -0
  526. /package/dist/{chunk-4JPMZTJY.js.map → chunk-ZF7KNSLU.js.map} +0 -0
  527. /package/dist/{chunk-2ODVB6LZ.js.map → chunk-ZGKODRGB.js.map} +0 -0
  528. /package/dist/{chunk-JIBUPZHA.js.map → chunk-ZNEKQFGF.js.map} +0 -0
  529. /package/dist/{chunk-DLD5LGDS.js.map → chunk-ZUTUNVFD.js.map} +0 -0
  530. /package/dist/{classified-marker-SIYKUU5L.js.map → classified-marker-WKP33U2R.js.map} +0 -0
  531. /package/dist/{collection-facade-CS7CA2XO.js.map → collection-facade-COSGZKLC.js.map} +0 -0
  532. /package/dist/{computed-FAD7SED4.js.map → computed-WN6V53ZV.js.map} +0 -0
  533. /package/dist/{dead-filter-4F3LWYKH.js.map → dead-filter-43WL3Y5H.js.map} +0 -0
  534. /package/dist/{derive-XLOJVXPU.js.map → delegation-5UWT4JGT.js.map} +0 -0
  535. /package/dist/{executor-FMPVN6DT.js.map → derive-IL5JNLEE.js.map} +0 -0
  536. /package/dist/{dispatch-JDZNGEB3.js.map → dispatch-LOQQD5JK.js.map} +0 -0
  537. /package/dist/{dispatch-H4HV32AM.js.map → dispatch-SHKTG57L.js.map} +0 -0
  538. /package/dist/{executor-LBBBRTN5.js.map → executor-6PQ7WAGV.js.map} +0 -0
  539. /package/dist/{executor-OSRZST2U.js.map → executor-6ZPQA6HS.js.map} +0 -0
  540. /package/dist/{export-accessible-RAOJAAU5.js.map → executor-OXRA64TY.js.map} +0 -0
  541. /package/dist/{extract-partition-JD5CUSTG.js.map → export-accessible-XG3FKJWW.js.map} +0 -0
  542. /package/dist/{find-JRN4RNQ5.js.map → extract-partition-33747NY5.js.map} +0 -0
  543. /package/dist/{fanout-sidecar-L7NHPIOC.js.map → fanout-sidecar-NEB6IYV7.js.map} +0 -0
  544. /package/dist/{issue-YIVBZUTH.js.map → find-VW543G3J.js.map} +0 -0
  545. /package/dist/{ledger-5ZMGE44K.js.map → issue-4ZPSY44M.js.map} +0 -0
  546. /package/dist/{liberate-WZSZM2W6.js.map → ledger-MZ25UFT2.js.map} +0 -0
  547. /package/dist/{link-set-MFXC24VK.js.map → liberate-OJIP2ZFX.js.map} +0 -0
  548. /package/dist/{managed-secret-MFTFT22X.js.map → link-set-4FRRAVTH.js.map} +0 -0
  549. /package/dist/{noydb-ITIGNKUF.js.map → managed-secret-SQWO2EUR.js.map} +0 -0
  550. /package/dist/{migrate-cek-DZRFFOHW.js.map → migrate-cek-JWEM4RP6.js.map} +0 -0
  551. /package/dist/{register-DT5HZ2LZ.js.map → noydb-U62OVKXB.js.map} +0 -0
  552. /package/dist/{pod-handle-A3LET7NO.js.map → pod-handle-R6Y4MILX.js.map} +0 -0
  553. /package/dist/{post-register-7ND27CF2.js.map → post-register-GRVQHBOH.js.map} +0 -0
  554. /package/dist/{registry-BHRZGZHF.js.map → register-YJ5YLQ36.js.map} +0 -0
  555. /package/dist/{registry-ET6ZFFWA.js.map → registry-ICOHBQFD.js.map} +0 -0
  556. /package/dist/{registry-HXFGLGTG.js.map → registry-MJ7MWCSW.js.map} +0 -0
  557. /package/dist/{registry-THCPDEOD.js.map → registry-MVEKKGWL.js.map} +0 -0
  558. /package/dist/{request-withdrawal-AV2MJJKY.js.map → registry-XP744FAP.js.map} +0 -0
  559. /package/dist/{revoke-6DWIEOCV.js.map → request-withdrawal-LSU4G6W3.js.map} +0 -0
  560. /package/dist/{reveal-B2TLP4JQ.js.map → reveal-AIHOIK2N.js.map} +0 -0
  561. /package/dist/{signer-MHGW3OIL.js.map → revoke-QUT7WWG3.js.map} +0 -0
  562. /package/dist/{stale-6GCFMOOR.js.map → signer-NYR4I3FO.js.map} +0 -0
  563. /package/dist/{storage-BYN5LO6Z.js.map → stale-PIJPAL5T.js.map} +0 -0
  564. /package/dist/{walk-4VPK7AS4.js.map → storage-VH6SPXHC.js.map} +0 -0
  565. /package/dist/{store-coordination-provider-C4BPT5XF.js.map → store-coordination-provider-2KSHCOPU.js.map} +0 -0
  566. /package/dist/{verify-UKALW7C2.js.map → verify-PCFS4PNS.js.map} +0 -0
  567. /package/dist/{withdraw-accessible-HL7GACUE.js.map → walk-OZCN6LJS.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # Changelog — hub
2
2
 
3
+ ## 0.9.0-pre.1
4
+
5
+ **A correctness release on the 0.9 line. The headline is a keyring race that surfaced as a tamper alarm on the user's own data** (core#132) — everything else is additive.
6
+
7
+ ⛔ **`_keyring` writes are now compare-and-swap.** Two sessions putting to a new collection each minted a DEK, one write silently lost, and a cold session then failed to authenticate **both** rows — reported as tampering, on data the user had just written themselves. A keyring write is now CAS'd against the version it was computed from, and a session that loses a mint **adopts the winner's DEK** instead of keeping its own. If you held data written by two concurrent first-writers on `0.9.0-pre.0`, this is the release that stops it recurring; it does not retroactively repair a pair of rows already minted under different DEKs.
8
+
9
+ **Sync — three fixes pilot-1 witnessed against real DynamoDB** (core#107, core#108).
10
+ - An arbiter now **replicates its admission refusals**, so the writer finds out at all. A refusal made on another device arrives as `origin: 'arbiter'` and is **report-only** — the local record is untouched, and `readmit()` is meaningless for it.
11
+ - A dirty record **re-runs this device's own gates before pushing**, so a record refused on the way out (`origin: 'push-recheck'`) stays local and dirty and pushes itself once it passes again.
12
+ - `RecordRejection` carries `recordAt` alongside `at`: an arbiter judges at **pull** time, so a record legitimately written while a period was open can be refused later. With both timestamps a UI can say *written then, refused now* rather than *your push was wrong*.
13
+
14
+ **Backup and restore** (core#76, core#77, core#101, core#103, core#111, core#122). Reads can carry ids, the restore path is exported rather than inferred, and ⭐ **a restore now rewinds the ledger too** — previously the pod came back but the ledger did not, so the next pull reverted it. ⚠️ Delete markers persist across a restore; `vault.compact()` will not remove them, being blob compaction and cache-budget eviction that happens to share the word.
15
+
16
+ **Presence binds the primary sync target, not `targets[0]`** (core#139). With `sync: [{cloud, role:'backup'}, {daemon, role:'sync-peer'}]` records synced with the daemon while presence published to a **push-only archive** target. The two selectors now agree.
17
+
18
+ **`expectedVersion: 0` means "must not exist", and `@noy-db/ports/to` now asserts it** (core#134). The conformance kit holds the agreement instead of relying on it, and the adapter census found the divergence core#136 warned about is not present in this family.
19
+
20
+ **Surface and docs.** The restore/pod types are exported with an invariant so it is the last time (core#101, core#54). `@internal` is not the surface — the golden is (core#128). The KEK gate that keeps the keyring inbox drain unreachable is pinned in a test (core#130), recorded as an accepted risk rather than a fix. `enrollWebAuthn`'s documented slot `meta` now records `rpId`, which the rotation ceremony falls back to (core#140).
21
+
22
+ ⚠️ **`@noy-db/ports` still carries `latest` on a prerelease**, because npm sets `latest` on a package's first publish regardless of `--tag`. Corrected at the `0.9.0` stable cut; there is no stable version to point it at yet.
23
+
24
+ ## 0.9.0-pre.0
25
+
26
+ **The line moves to 0.9.0 on this pre-release: a new package, a milestone, three seam widenings, and fourteen fewer names.** Everything below is additive unless marked ⛔.
27
+
28
+ **`@noy-db/ports`** — the six conformance kits are one package with one subpath per hub port: `@noy-db/ports/to`, `/as`, `/at`, `/on`, `/by`, `/capsule`. Bind `@noy-db/hub/<port>`, prove it with `@noy-db/ports/<port>`. **Not a break:** function names unchanged, peers unchanged, and the six `@noy-db/test-*-conformance` names keep resolving as re-export shims until the family's satellites have moved. This cut publishes seven conformance names where the last one published six.
29
+
30
+ **Fourteen fewer names.** The `in-*` framework bindings left this repo for `noy-db/in`; they are no longer on this version line. Nothing about `@noy-db/hub` changed for them.
31
+
32
+ **Hot replica** (milestone: core#75, core#73, core#81, core#82, core#83) — a `sync-peer` target is now a full replica.
33
+ - The roster travels: push mirrors `_keyring` to every target, pull brings it back before any record, higher `roster_epoch` wins in both directions. `openVault` on an EMPTY local consults the sync-peer before deciding new-vs-existing — a device that lost its store re-opens with the same target and secret, and a granted member opens on its own device with only its secret. `revoke()` propagates.
34
+ - Reserved-record replication is a DECLARED set: `_meta/invite-audit-*` (magic-link onboarding works on a fresh sync-peer device once the issuer pushed), `_users`, `_delegations` travel; `_history`, `_ledger`, `_sync` and every other `_meta` id do not, by decision. `Vault.revokeDelegation()` rides the dirty log.
35
+ - A pulled change to your own keyring file takes effect in the open session — a widened re-grant is readable after the next `pull()`, no reopen.
36
+ - **`sync:progress`** during pull and push (`{ direction, phase, records, bytes, total? }`, throttled), and optional `inFlight` on `syncStatus()` / `syncTargetStatus()`. Types `SyncProgress` and `RealignResult` on the root barrel.
37
+ - **`db.realign(vault)`** — a corrupted LOCAL envelope is replaced from the target's healthy copy; an ordinary pull could not repair it because it wins on `_v`.
38
+ - **Member-scoped broker credentials** (`@noy-db/hub/broker`): every role can mint its own cloud-store credentials. `grant()` mints a per-grantee `_broker_member` DEK and the kernel enrols the member with the host (`{ userId, role, proofKey }`); members prove with canonical v2 (`userId` + `role` inside the MAC); re-grant re-enrols, `revoke()` de-registers, peer recovery re-enrols. The admin path is byte-identical. `BrokerStrategy` gains `enrolMember` / `revokeMember` (the floor stub implements both as no-ops); `@noy-db/hub/broker` exports `BrokerMemberIdentity`; `VerifyBrokerProofArgs.member` selects v2 on the host. Existing members need a re-grant (or magic-link recovery) to be enrolled.
39
+
40
+ **`/capsule`** (core#42) — ⛔ two published changes a compiler cannot tell you about: **`EnclaveNotSupportedError.group` is widened to `CapsuleGroup`** (it named three of ten groups and could not name `classify`; an exhaustive `switch` on `err.group` has more cases now), and **`capabilities()` reports one more group** — `CapsuleGroup` gains `per-record-keys` (`wrapCek` / `unwrapCek`), which the reference capsule genuinely implements and was under-reporting. Expect ten members, not nine.
41
+
42
+ **Seams widened, all additive, all already on the root barrel:** `@noy-db/hub/on` gains the echo ceremony's player half (`beginEchoUnlock`, `EchoCeremony`, `BeginEchoUnlockOptions`, `EchoCeremonyRequiredError`, `WrongPromptError`, `WrongEchoError` — core#41); `@noy-db/hub/to` gains `StoreAuth` + `StoreAuthKind`, `@noy-db/hub/by` gains `Unsubscribe` (core#54); `CoverageEvent` and its four companions on `@noy-db/hub/coverage` lose a false `@internal` tag — they were always shipped, and are now a published seam (core#38): additive fields only, `source` stays `string`.
43
+
44
+ **Refusals that were silent are now thrown, deliberately:** `query().groupBy()` refuses a `queryable: 'none'` field the way `where()`/`orderBy()`/`distinct()` did (#29) — grouping on a virtual computed field used to fold every row into one bucket keyed on `undefined`; a `via()`-spelled virtual computed field is refused on a late-attach call in either spelling (#33).
45
+
46
+ **Erasure and reclaim, made legible:** `erasureCompleteness(result)` at `@noy-db/hub/forget` (#34) — default-deny over every residue channel; `ForgetResult.blobResidueRecords` at `collection:id` grain, and `blobResidueETags` documented for what it means (legacy chunks were deleted but could not be crypto-shredded — do not intersect with `reclaimedETags`); `compact({ reclaimLegacyBlobs })` returns `unreferencedLegacyBlobs.reclaimedETags` (#28); `Collection.delete()` documents what a `null` blob read proves.
47
+
48
+ **Classified:** `classified.checksummed({ validate })` (#26), a preset for a checksummed institutional identifier, with `luhnCheck` exported; such a field cannot be uniquely indexed, and the doc says why. `Envelope` documents the two kinds of body: `hasSealedBody` tests `_iv`, not `_data`.
49
+
50
+ **Prose and surfaces:** three shipped examples that named a symbol they never imported are fixed, and the gate now treats an un-imported published name as a finding; every one of hub's 55 subpaths has a frozen value surface (11 did). Conformance-kit READMEs import the reader's implementation from `'./my-backend.js'`-style paths.
51
+
3
52
  ## 0.8.0
4
53
 
5
54
  **The capsule seam** (#4). Hub's crypto interior is now one contract behind one door, and an application can replace it at build time without forking hub.
package/README.md CHANGED
@@ -26,17 +26,18 @@ Part of [**noy-db**](https://github.com/noy-db/core) — *"None Of Your Damn Bus
26
26
 
27
27
  ## Install
28
28
 
29
- Every noy-db app needs `@noy-db/hub` plus at least one storage backend (`to-*`). Everything else is optional.
29
+ `@noy-db/hub` ships an in-memory store, so it runs on its own with nothing else installed. Add a
30
+ storage backend (`to-*`) when the data has to survive a restart. Everything else is optional.
30
31
 
31
32
  ```bash
32
- pnpm add @noy-db/hub @noy-db/to-memory
33
+ pnpm add @noy-db/hub
33
34
  ```
34
35
 
35
36
  ### Pick a storage backend — [`@noy-db/to-*`](https://www.npmjs.com/search?q=%40noy-db%2Fto-)
36
37
 
37
38
  | Package | Use for |
38
39
  |---------|---------|
39
- | [`to-memory`](https://www.npmjs.com/package/@noy-db/to-memory) | Tests, prototypes, ephemeral data |
40
+ | [`to-memory`](https://www.npmjs.com/package/@noy-db/to-memory) | Tests, prototypes, ephemeral data — *only if you need a store separate from the built-in `memoryStore()`; ships from [noy-db-to](https://github.com/noy-db/to)* |
40
41
  | [`to-file`](https://www.npmjs.com/package/@noy-db/to-file) | Local disk, USB stick |
41
42
  | [`to-browser-idb`](https://www.npmjs.com/package/@noy-db/to-browser-idb) | Browser IndexedDB (atomic CAS) |
42
43
  | [`to-browser-local`](https://www.npmjs.com/package/@noy-db/to-browser-local) | Browser localStorage |
@@ -68,13 +69,12 @@ pnpm add @noy-db/hub @noy-db/to-memory
68
69
  ## Quick start
69
70
 
70
71
  ```ts
71
- import { createNoydb } from '@noy-db/hub'
72
- import { toMemory } from '@noy-db/to-memory'
72
+ import { createNoydb, memoryStore } from '@noy-db/hub'
73
73
 
74
74
  type Invoice = { id: string; amount: number; customer: string }
75
75
 
76
76
  const db = await createNoydb({
77
- store: toMemory(),
77
+ store: memoryStore(),
78
78
  user: 'alice',
79
79
  secret: 'correct horse battery staple',
80
80
  })
@@ -329,7 +329,7 @@ const cur = await vault.sequence('invoice-2026').peek() // read current value w
329
329
  **Pre-release** (`0.1.0-pre.1`). API may change before `1.0`. Install from the `next` dist-tag:
330
330
 
331
331
  ```bash
332
- pnpm add @noy-db/hub@next @noy-db/to-memory@next
332
+ pnpm add @noy-db/hub@next
333
333
  ```
334
334
 
335
335
  ## Documentation
@@ -340,4 +340,4 @@ pnpm add @noy-db/hub@next @noy-db/to-memory@next
340
340
 
341
341
  ## License
342
342
 
343
- [MIT](./LICENSE) © vLannaAi
343
+ [Apache-2.0](./LICENSE) © vLannaAi
@@ -1,5 +1,5 @@
1
1
  {
2
- "$comment": "Machine-readable rename map for the noy-db 0.4.0-pre breaking set (noy-db#994). Companion to the prose note at https://noy-db.dev/migration/2026-07-30-0.4.0-pre-breaking-set — `section` points back at it. safeGlobalReplace:true means a whole-word match of `from` cannot plausibly hit anything else in a consumer codebase, so a blanket replace is safe; false means anchor on the import specifier or call site instead and read `note` first. Rows are verified against the live surface by packages/hub/__tests__/codemod-map.test.ts. Not covered here because they are structural, not renames: §4 (23 credential methods moved onto db.team), §6 (collection generics take a named shape) and the two silent behaviour changes.",
2
+ "$comment": "Machine-readable rename map for the noy-db 0.4.0-pre breaking set (vLannaAi/noy-db#994). Companion to the prose note at https://noy-db.dev/migration/2026-07-30-0.4.0-pre-breaking-set — `section` points back at it. safeGlobalReplace:true means a whole-word match of `from` cannot plausibly hit anything else in a consumer codebase, so a blanket replace is safe; false means anchor on the import specifier or call site instead and read `note` first. Rows are verified against the live surface by packages/hub/__tests__/codemod-map.test.ts. Not covered here because they are structural, not renames: §4 (23 credential methods moved onto db.team), §6 (collection generics take a named shape) and the two silent behaviour changes.",
3
3
  "version": "0.4.0-pre",
4
4
  "renames": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "$comment": "Machine-readable migration map for noy-db#1458 — the QUERY TIERS split. The query DSL was one class in one subpath; it is now four groups. `@noy-db/hub/query` keeps Find (where/or/and/filter/wherePredicate/orderBy/limit/offset/page/after/first/toArray/count/exists/ids/toPlan) and is unchanged for consumers who only find records. Live, Reduce and Relate moved to `@noy-db/hub/query/{live,reduce,relate}`, which are SIDE-EFFECT imports: one line at the app's entry patches the methods onto Query.prototype and merges their types, so no call site changes. ⭐ WHO IS AFFECTED, precisely: only consumers who import from `@noy-db/hub/query` directly. A consumer on the root barrel `@noy-db/hub` needs NO row here — the root barrel imports all three groups, so every method and every re-export is exactly where it was. That is why the rows below are `import-move` rather than `subpath`: the SUBPATH `@noy-db/hub/query` still resolves and still exports Find; what moved is a set of symbols within it. ⚠️ THE COVERAGE CHECKER CANNOT SEE THIS BREAK. `scripts/check-codemod-coverage.mjs` measures the package's whole reachable surface as a union across subpaths, and every symbol below is still reachable — from a different subpath. It reports zero losses for this change, correctly by its own definition and uselessly for this one. These rows are hand-written for that reason; do not read the green checker as evidence the map is unnecessary.",
2
+ "$comment": "Machine-readable migration map for vLannaAi/noy-db#1458 — the QUERY TIERS split. The query DSL was one class in one subpath; it is now four groups. `@noy-db/hub/query` keeps Find (where/or/and/filter/wherePredicate/orderBy/limit/offset/page/after/first/toArray/count/exists/ids/toPlan) and is unchanged for consumers who only find records. Live, Reduce and Relate moved to `@noy-db/hub/query/{live,reduce,relate}`, which are SIDE-EFFECT imports: one line at the app's entry patches the methods onto Query.prototype and merges their types, so no call site changes. ⭐ WHO IS AFFECTED, precisely: only consumers who import from `@noy-db/hub/query` directly. A consumer on the root barrel `@noy-db/hub` needs NO row here — the root barrel imports all three groups, so every method and every re-export is exactly where it was. That is why the rows below are `import-move` rather than `subpath`: the SUBPATH `@noy-db/hub/query` still resolves and still exports Find; what moved is a set of symbols within it. ⚠️ THE COVERAGE CHECKER CANNOT SEE THIS BREAK. `scripts/check-codemod-coverage.mjs` measures the package's whole reachable surface as a union across subpaths, and every symbol below is still reachable — from a different subpath. It reports zero losses for this change, correctly by its own definition and uselessly for this one. These rows are hand-written for that reason; do not read the green checker as evidence the map is unnecessary.",
3
3
  "version": "0.8.0-pre",
4
4
  "renames": [
5
5
  {
@@ -0,0 +1,18 @@
1
+ import {
2
+ UserApi,
3
+ createUserApi
4
+ } from "./chunk-HE7EAHGS.js";
5
+ import "./chunk-QT5ITL25.js";
6
+ import "./chunk-WRLWEYHY.js";
7
+ import "./chunk-ZD7WFMV2.js";
8
+ import "./chunk-RRTQAQ3N.js";
9
+ import "./chunk-NH2UOV3B.js";
10
+ import "./chunk-ZF6JECDT.js";
11
+ import "./chunk-THQ3BHLM.js";
12
+ import "./chunk-XX4R7TUB.js";
13
+ import "./chunk-IKPQ2GGB.js";
14
+ export {
15
+ UserApi,
16
+ createUserApi
17
+ };
18
+ //# sourceMappingURL=api-6EFD43KN.js.map
package/dist/as/index.js CHANGED
@@ -1,23 +1,27 @@
1
- import "../chunk-UBSFPGVJ.js";
2
- import "../chunk-PP3K67AJ.js";
1
+ import "../chunk-2DX4JCRI.js";
2
+ import "../chunk-654RE5YC.js";
3
3
  import {
4
4
  applyListProjection
5
5
  } from "../chunk-VG2ZSFYD.js";
6
+ import {
7
+ FormatsNotEnabledError
8
+ } from "../chunk-RWFQVNXR.js";
6
9
  import "../chunk-RXLYKVTF.js";
10
+ import "../chunk-QJNAHPVT.js";
7
11
  import "../chunk-VYYM3MEN.js";
8
- import "../chunk-747G6CT3.js";
12
+ import "../chunk-UORWAG7K.js";
9
13
  import "../chunk-Y2NBBT6K.js";
10
- import "../chunk-3L2NBKDR.js";
11
- import "../chunk-EZGV6F47.js";
12
- import "../chunk-OIEO4WDL.js";
13
- import "../chunk-Q2XRFWOI.js";
14
+ import "../chunk-IF2M43G4.js";
15
+ import "../chunk-WRLWEYHY.js";
16
+ import "../chunk-ZD7WFMV2.js";
17
+ import "../chunk-RRTQAQ3N.js";
14
18
  import "../chunk-NH2UOV3B.js";
15
- import "../chunk-42ALPZ2B.js";
16
- import "../chunk-QMWY2FDS.js";
17
- import "../chunk-SV2PM2OY.js";
19
+ import "../chunk-ZF6JECDT.js";
20
+ import "../chunk-THQ3BHLM.js";
21
+ import "../chunk-XX4R7TUB.js";
18
22
  import {
19
23
  ValidationError
20
- } from "../chunk-37EPTBBR.js";
24
+ } from "../chunk-IKPQ2GGB.js";
21
25
 
22
26
  // src/port/as/active.ts
23
27
  function redactChunk(chunk, ctx, redact) {
@@ -52,20 +56,25 @@ function contextFor(vault) {
52
56
  if (!format) throw new TypeError("assertCanImport('plaintext') requires a non-empty format id");
53
57
  vault.assertCanImport("plaintext", format);
54
58
  },
55
- // ⚠️ Filtered HERE, not passed to exportStream — `ExportStreamOptions`
56
- // has no `collections` field, so the option I first passed was silently
57
- // dropped and hub read every collection. Caught by an as-json test
58
- // expecting ['invoices'] and getting ['invoices','payments'].
59
+ // ⭐ PASSED DOWN, not filtered here (core#45b). `ExportStreamOptions` now
60
+ // carries `collections` and narrows the read, so an excluded collection is
61
+ // neither fetched nor decrypted.
59
62
  //
60
- // Post-read filtering is correct but not free: hub still DECRYPTS the
61
- // collections the caller excluded. Pushing the filter down into
62
- // exportStream is the real fix and is a hub change beyond this port.
63
+ // ⚠️ The history is worth keeping, because the obvious edit here is the
64
+ // wrong one twice over. The option was first passed to `exportStream`
65
+ // when that interface had no field for it — silently dropped, every
66
+ // collection read, caught only by an as-json test expecting ['invoices']
67
+ // and getting ['invoices','payments']. The fix then was to filter after
68
+ // the read, which was correct output and a full decrypt: for a
69
+ // zero-knowledge store, a caller scoping an export to limit exposure got
70
+ // no limit at all. Neither the compiler nor any chunk-level assertion can
71
+ // tell these three implementations apart — only a store observation can
72
+ // (`__tests__/45-export-scope-narrows-read.test.ts`).
63
73
  chunks: async function* (collections) {
64
- const wanted = collections ? new Set(collections) : null;
65
- for await (const chunk of vault.exportStream({ granularity: "collection" })) {
66
- if (wanted && !wanted.has(chunk.collection)) continue;
67
- yield chunk;
68
- }
74
+ yield* vault.exportStream({
75
+ granularity: "collection",
76
+ ...collections ? { collections } : {}
77
+ });
69
78
  },
70
79
  // NOT swallowed. A caller who asked for redaction and silently got
71
80
  // unredacted output is the exact failure this port exists to remove — a
@@ -140,6 +149,7 @@ function withFormats() {
140
149
  };
141
150
  }
142
151
  export {
152
+ FormatsNotEnabledError,
143
153
  withFormats
144
154
  };
145
155
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/port/as/active.ts"],"sourcesContent":["/**\n * `withFormats()` — the service that consumes the `as-*` port.\n *\n * Everything with a correctness or security consequence lives here rather\n * than in each format: the capability gate, the vault read, and redaction.\n * A {@link NoydbFormat} receives records and returns bytes.\n *\n * That is the whole point of the inversion (ADR 0004). The conformance kit it\n * replaces could only check implementors who ran it; a format that cannot\n * reach a vault is gated whether its author cooperated or not.\n *\n * @module\n */\nimport type { NoydbFormat, ImportPlan } from './types.js'\nimport type {\n FormatsStrategy,\n FormatsContext,\n FormatExportOptions,\n FormatImportOptions,\n} from '../with/formats-strategy.js'\nimport type { ExportChunk } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { ImportPolicy } from './types.js'\nimport { applyListProjection } from '../../with-shape/introspection/index.js'\nimport type { CollectionDescription, ListProjectionOptions } from '../../with-shape/introspection/index.js'\nimport { ValidationError } from '../../kernel/errors.js'\n\n/** Apply the redaction projection hub owns, so a format never asks for it. */\nfunction redactChunk(\n chunk: ExportChunk,\n ctx: FormatsContext,\n redact: FormatExportOptions['redact'],\n): ExportChunk {\n if (redact === undefined) return chunk\n const described = ctx.describe(chunk.collection) as CollectionDescription | undefined\n if (!described) {\n throw new Error(\n `vault.export: redaction was requested but '${chunk.collection}' has no description to redact against. ` +\n 'Open the collection with its classifiedFields / fieldMeta options first.',\n )\n }\n const opts: ListProjectionOptions | undefined =\n redact === true ? undefined : { sensitivity: redact.sensitivity as never }\n const records = chunk.records.map((r) =>\n applyListProjection(described, r as Record<string, unknown>, opts),\n )\n return { ...chunk, records: records as typeof chunk.records }\n}\n\n/**\n * Derive the narrow, format-facing capability from the vault.\n *\n * Lives here rather than on `Vault` because `kernel-surface` said so, and it\n * was right: this is service capability, not spine. The spine keeps two\n * delegating methods and nothing else.\n */\nfunction contextFor(vault: Vault): FormatsContext {\n return {\n // The empty-id guards are NOT defensive padding. The\n // plaintext tier is gated per-format, so a missing id means the calling\n // binding is broken — and without this it would reach the gate, miss the\n // allowlist, and surface as `ExportCapabilityError`: \"the owner did not\n // grant this\", which sends the reader to the keyring instead of to the\n // format. A loud TypeError names the real fault.\n assertCanExport: (tier, format) => {\n if (tier === 'bundle') return vault.assertCanExport('bundle')\n if (!format) throw new TypeError(\"assertCanExport('plaintext') requires a non-empty format id\")\n vault.assertCanExport('plaintext', format)\n },\n assertCanImport: (tier, format) => {\n if (tier === 'bundle') return vault.assertCanImport('bundle')\n if (!format) throw new TypeError(\"assertCanImport('plaintext') requires a non-empty format id\")\n vault.assertCanImport('plaintext', format)\n },\n // ⚠️ Filtered HERE, not passed to exportStream — `ExportStreamOptions`\n // has no `collections` field, so the option I first passed was silently\n // dropped and hub read every collection. Caught by an as-json test\n // expecting ['invoices'] and getting ['invoices','payments'].\n //\n // Post-read filtering is correct but not free: hub still DECRYPTS the\n // collections the caller excluded. Pushing the filter down into\n // exportStream is the real fix and is a hub change beyond this port.\n chunks: async function* (collections) {\n const wanted = collections ? new Set(collections) : null\n for await (const chunk of vault.exportStream({ granularity: 'collection' })) {\n if (wanted && !wanted.has(chunk.collection)) continue\n yield chunk\n }\n },\n // NOT swallowed. A caller who asked for redaction and silently got\n // unredacted output is the exact failure this port exists to remove — a\n // security duty that fails quiet. If the description cannot be read, the\n // export fails instead.\n describe: (collection) => vault.collection(collection).describe() as never,\n plan: async (records, policy: ImportPolicy, formatId: string, idKey?: string) => {\n const { diffVault } = await import('../../with-cargo/vault-diff.js')\n const plan = await diffVault(vault, records as never, idKey ? { idKey } : {})\n return {\n plan,\n policy,\n // The apply walk every as-* package had independently: added always,\n // modified unless insert-only, deleted only on replace — in one\n // transaction so a partial failure rolls back. Owned once, here.\n apply: async () => {\n await vault.noydb.transaction((tx) => {\n const txVault = tx.vault(vault.name)\n const reason = `import:${formatId}`\n for (const e of plan.added) {\n txVault.collection(e.collection).put(e.id, e.record as never, { reason })\n }\n if (policy !== 'insert-only') {\n for (const e of plan.modified) {\n txVault.collection(e.collection).put(e.id, e.record as never, { reason })\n }\n }\n if (policy === 'replace') {\n for (const e of plan.deleted) txVault.collection(e.collection).delete(e.id)\n }\n })\n },\n }\n },\n }\n}\n\n/**\n * Enable `vault.export()` / `vault.import()`.\n *\n * ```ts\n * const db = await createNoydb({ store, user, secret, formatsStrategy: withFormats() })\n * const csv = await vault.export(asCsv(), { collections: ['invoices'] })\n * ```\n */\nexport function withFormats(): FormatsStrategy {\n return {\n enabled: true,\n\n async exportWith<Out extends string | Uint8Array>(\n vault: Vault,\n format: NoydbFormat<Out>,\n options: FormatExportOptions = {},\n ): Promise<Out> {\n const ctx = contextFor(vault)\n // FIRST, and before a single record is read. The format is not in scope\n // yet and could not reach the vault if it were.\n if (format.tier === 'bundle') ctx.assertCanExport('bundle')\n else ctx.assertCanExport('plaintext', format.id)\n\n const chunks: ExportChunk[] = []\n for await (const chunk of ctx.chunks(options.collections)) {\n chunks.push(redactChunk(chunk, ctx, options.redact))\n }\n return format.encode(chunks)\n },\n\n async importWith<Out extends string | Uint8Array>(\n vault: Vault,\n format: NoydbFormat<Out>,\n input: Out,\n options: FormatImportOptions = {},\n ): Promise<ImportPlan> {\n const ctx = contextFor(vault)\n // Mirrors the export side: the import gate is two-tier as well, and a\n // bundle format importing under the plaintext tier would be a silent\n // downgrade in the other direction.\n if (format.tier === 'bundle') ctx.assertCanImport('bundle')\n else ctx.assertCanImport('plaintext', format.id)\n if (!format.decode) {\n throw new ValidationError(\n `vault.import: the '${format.id}' format is export-only — it declares no decode(). ` +\n 'Pick a format that round-trips, or write the records directly.',\n )\n }\n const decoded = await format.decode(input)\n const candidate: Record<string, readonly unknown[]> = {}\n for (const chunk of decoded) {\n const target = chunk.collection || options.collection\n if (!target) {\n throw new ValidationError(\n `vault.import: the '${format.id}' input names no collection and none was supplied. ` +\n 'Pass { collection } for formats whose payload is collection-less.',\n )\n }\n candidate[target] = [...(candidate[target] ?? []), ...chunk.records]\n }\n return ctx.plan(candidate, options.policy ?? 'merge', format.id, options.idKey)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAS,YACP,OACA,KACA,QACa;AACb,MAAI,WAAW,OAAW,QAAO;AACjC,QAAM,YAAY,IAAI,SAAS,MAAM,UAAU;AAC/C,MAAI,CAAC,WAAW;AACd,UAAM,IAAI;AAAA,MACR,8CAA8C,MAAM,UAAU;AAAA,IAEhE;AAAA,EACF;AACA,QAAM,OACJ,WAAW,OAAO,SAAY,EAAE,aAAa,OAAO,YAAqB;AAC3E,QAAM,UAAU,MAAM,QAAQ;AAAA,IAAI,CAAC,MACjC,oBAAoB,WAAW,GAA8B,IAAI;AAAA,EACnE;AACA,SAAO,EAAE,GAAG,OAAO,QAAyC;AAC9D;AASA,SAAS,WAAW,OAA8B;AAChD,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL,iBAAiB,CAAC,MAAM,WAAW;AACjC,UAAI,SAAS,SAAU,QAAO,MAAM,gBAAgB,QAAQ;AAC5D,UAAI,CAAC,OAAQ,OAAM,IAAI,UAAU,6DAA6D;AAC9F,YAAM,gBAAgB,aAAa,MAAM;AAAA,IAC3C;AAAA,IACA,iBAAiB,CAAC,MAAM,WAAW;AACjC,UAAI,SAAS,SAAU,QAAO,MAAM,gBAAgB,QAAQ;AAC5D,UAAI,CAAC,OAAQ,OAAM,IAAI,UAAU,6DAA6D;AAC9F,YAAM,gBAAgB,aAAa,MAAM;AAAA,IAC3C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,QAAQ,iBAAiB,aAAa;AACpC,YAAM,SAAS,cAAc,IAAI,IAAI,WAAW,IAAI;AACpD,uBAAiB,SAAS,MAAM,aAAa,EAAE,aAAa,aAAa,CAAC,GAAG;AAC3E,YAAI,UAAU,CAAC,OAAO,IAAI,MAAM,UAAU,EAAG;AAC7C,cAAM;AAAA,MACR;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAU,CAAC,eAAe,MAAM,WAAW,UAAU,EAAE,SAAS;AAAA,IAChE,MAAM,OAAO,SAAS,QAAsB,UAAkB,UAAmB;AAC/E,YAAM,EAAE,UAAU,IAAI,MAAM,OAAO,2BAAgC;AACnE,YAAM,OAAO,MAAM,UAAU,OAAO,SAAkB,QAAQ,EAAE,MAAM,IAAI,CAAC,CAAC;AAC5E,aAAO;AAAA,QACL;AAAA,QACA;AAAA;AAAA;AAAA;AAAA,QAIA,OAAO,YAAY;AACjB,gBAAM,MAAM,MAAM,YAAY,CAAC,OAAO;AACpC,kBAAM,UAAU,GAAG,MAAM,MAAM,IAAI;AACnC,kBAAM,SAAS,UAAU,QAAQ;AACjC,uBAAW,KAAK,KAAK,OAAO;AAC1B,sBAAQ,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,QAAiB,EAAE,OAAO,CAAC;AAAA,YAC1E;AACA,gBAAI,WAAW,eAAe;AAC5B,yBAAW,KAAK,KAAK,UAAU;AAC7B,wBAAQ,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,QAAiB,EAAE,OAAO,CAAC;AAAA,cAC1E;AAAA,YACF;AACA,gBAAI,WAAW,WAAW;AACxB,yBAAW,KAAK,KAAK,QAAS,SAAQ,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;AAAA,YAC5E;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAUO,SAAS,cAA+B;AAC7C,SAAO;AAAA,IACL,SAAS;AAAA,IAET,MAAM,WACJ,OACA,QACA,UAA+B,CAAC,GAClB;AACd,YAAM,MAAM,WAAW,KAAK;AAG5B,UAAI,OAAO,SAAS,SAAU,KAAI,gBAAgB,QAAQ;AAAA,UACrD,KAAI,gBAAgB,aAAa,OAAO,EAAE;AAE/C,YAAM,SAAwB,CAAC;AAC/B,uBAAiB,SAAS,IAAI,OAAO,QAAQ,WAAW,GAAG;AACzD,eAAO,KAAK,YAAY,OAAO,KAAK,QAAQ,MAAM,CAAC;AAAA,MACrD;AACA,aAAO,OAAO,OAAO,MAAM;AAAA,IAC7B;AAAA,IAEA,MAAM,WACJ,OACA,QACA,OACA,UAA+B,CAAC,GACX;AACrB,YAAM,MAAM,WAAW,KAAK;AAI5B,UAAI,OAAO,SAAS,SAAU,KAAI,gBAAgB,QAAQ;AAAA,UACrD,KAAI,gBAAgB,aAAa,OAAO,EAAE;AAC/C,UAAI,CAAC,OAAO,QAAQ;AAClB,cAAM,IAAI;AAAA,UACR,sBAAsB,OAAO,EAAE;AAAA,QAEjC;AAAA,MACF;AACA,YAAM,UAAU,MAAM,OAAO,OAAO,KAAK;AACzC,YAAM,YAAgD,CAAC;AACvD,iBAAW,SAAS,SAAS;AAC3B,cAAM,SAAS,MAAM,cAAc,QAAQ;AAC3C,YAAI,CAAC,QAAQ;AACX,gBAAM,IAAI;AAAA,YACR,sBAAsB,OAAO,EAAE;AAAA,UAEjC;AAAA,QACF;AACA,kBAAU,MAAM,IAAI,CAAC,GAAI,UAAU,MAAM,KAAK,CAAC,GAAI,GAAG,MAAM,OAAO;AAAA,MACrE;AACA,aAAO,IAAI,KAAK,WAAW,QAAQ,UAAU,SAAS,OAAO,IAAI,QAAQ,KAAK;AAAA,IAChF;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/port/as/active.ts"],"sourcesContent":["/**\n * `withFormats()` — the service that consumes the `as-*` port.\n *\n * Everything with a correctness or security consequence lives here rather\n * than in each format: the capability gate, the vault read, and redaction.\n * A {@link NoydbFormat} receives records and returns bytes.\n *\n * That is the whole point of the inversion (ADR 0004). The conformance kit it\n * replaces could only check implementors who ran it; a format that cannot\n * reach a vault is gated whether its author cooperated or not.\n *\n * @module\n */\nimport type { NoydbFormat, ImportPlan } from './types.js'\nimport type {\n FormatsStrategy,\n FormatsContext,\n FormatExportOptions,\n FormatImportOptions,\n} from '../with/formats-strategy.js'\nimport type { ExportChunk } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { ImportPolicy } from './types.js'\nimport { applyListProjection } from '../../with-shape/introspection/index.js'\nimport type { CollectionDescription, ListProjectionOptions } from '../../with-shape/introspection/index.js'\nimport { ValidationError } from '../../kernel/errors.js'\n\n/** Apply the redaction projection hub owns, so a format never asks for it. */\nfunction redactChunk(\n chunk: ExportChunk,\n ctx: FormatsContext,\n redact: FormatExportOptions['redact'],\n): ExportChunk {\n if (redact === undefined) return chunk\n const described = ctx.describe(chunk.collection) as CollectionDescription | undefined\n if (!described) {\n throw new Error(\n `vault.export: redaction was requested but '${chunk.collection}' has no description to redact against. ` +\n 'Open the collection with its classifiedFields / fieldMeta options first.',\n )\n }\n const opts: ListProjectionOptions | undefined =\n redact === true ? undefined : { sensitivity: redact.sensitivity as never }\n const records = chunk.records.map((r) =>\n applyListProjection(described, r as Record<string, unknown>, opts),\n )\n return { ...chunk, records: records as typeof chunk.records }\n}\n\n/**\n * Derive the narrow, format-facing capability from the vault.\n *\n * Lives here rather than on `Vault` because `kernel-surface` said so, and it\n * was right: this is service capability, not spine. The spine keeps two\n * delegating methods and nothing else.\n */\nfunction contextFor(vault: Vault): FormatsContext {\n return {\n // The empty-id guards are NOT defensive padding. The\n // plaintext tier is gated per-format, so a missing id means the calling\n // binding is broken — and without this it would reach the gate, miss the\n // allowlist, and surface as `ExportCapabilityError`: \"the owner did not\n // grant this\", which sends the reader to the keyring instead of to the\n // format. A loud TypeError names the real fault.\n assertCanExport: (tier, format) => {\n if (tier === 'bundle') return vault.assertCanExport('bundle')\n if (!format) throw new TypeError(\"assertCanExport('plaintext') requires a non-empty format id\")\n vault.assertCanExport('plaintext', format)\n },\n assertCanImport: (tier, format) => {\n if (tier === 'bundle') return vault.assertCanImport('bundle')\n if (!format) throw new TypeError(\"assertCanImport('plaintext') requires a non-empty format id\")\n vault.assertCanImport('plaintext', format)\n },\n // ⭐ PASSED DOWN, not filtered here (core#45b). `ExportStreamOptions` now\n // carries `collections` and narrows the read, so an excluded collection is\n // neither fetched nor decrypted.\n //\n // ⚠️ The history is worth keeping, because the obvious edit here is the\n // wrong one twice over. The option was first passed to `exportStream`\n // when that interface had no field for it — silently dropped, every\n // collection read, caught only by an as-json test expecting ['invoices']\n // and getting ['invoices','payments']. The fix then was to filter after\n // the read, which was correct output and a full decrypt: for a\n // zero-knowledge store, a caller scoping an export to limit exposure got\n // no limit at all. Neither the compiler nor any chunk-level assertion can\n // tell these three implementations apart — only a store observation can\n // (`__tests__/45-export-scope-narrows-read.test.ts`).\n chunks: async function* (collections) {\n yield* vault.exportStream({\n granularity: 'collection',\n ...(collections ? { collections } : {}),\n })\n },\n // NOT swallowed. A caller who asked for redaction and silently got\n // unredacted output is the exact failure this port exists to remove — a\n // security duty that fails quiet. If the description cannot be read, the\n // export fails instead.\n describe: (collection) => vault.collection(collection).describe() as never,\n plan: async (records, policy: ImportPolicy, formatId: string, idKey?: string) => {\n const { diffVault } = await import('../../with-cargo/vault-diff.js')\n const plan = await diffVault(vault, records as never, idKey ? { idKey } : {})\n return {\n plan,\n policy,\n // The apply walk every as-* package had independently: added always,\n // modified unless insert-only, deleted only on replace — in one\n // transaction so a partial failure rolls back. Owned once, here.\n apply: async () => {\n await vault.noydb.transaction((tx) => {\n const txVault = tx.vault(vault.name)\n const reason = `import:${formatId}`\n for (const e of plan.added) {\n txVault.collection(e.collection).put(e.id, e.record as never, { reason })\n }\n if (policy !== 'insert-only') {\n for (const e of plan.modified) {\n txVault.collection(e.collection).put(e.id, e.record as never, { reason })\n }\n }\n if (policy === 'replace') {\n for (const e of plan.deleted) txVault.collection(e.collection).delete(e.id)\n }\n })\n },\n }\n },\n }\n}\n\n/**\n * Enable `vault.export()` / `vault.import()`.\n *\n * ```ts\n * const db = await createNoydb({ store, user, secret, formatsStrategy: withFormats() })\n * const csv = await vault.export(asCsv(), { collections: ['invoices'] })\n * ```\n *\n * ⭐ `collections` scopes the READ: an excluded collection is neither fetched\n * nor decrypted (core#45b, since 0.8 — through 0.7 it filtered output after a\n * full decrypt).\n */\nexport function withFormats(): FormatsStrategy {\n return {\n enabled: true,\n\n async exportWith<Out extends string | Uint8Array>(\n vault: Vault,\n format: NoydbFormat<Out>,\n options: FormatExportOptions = {},\n ): Promise<Out> {\n const ctx = contextFor(vault)\n // FIRST, and before a single record is read. The format is not in scope\n // yet and could not reach the vault if it were.\n if (format.tier === 'bundle') ctx.assertCanExport('bundle')\n else ctx.assertCanExport('plaintext', format.id)\n\n const chunks: ExportChunk[] = []\n for await (const chunk of ctx.chunks(options.collections)) {\n chunks.push(redactChunk(chunk, ctx, options.redact))\n }\n return format.encode(chunks)\n },\n\n async importWith<Out extends string | Uint8Array>(\n vault: Vault,\n format: NoydbFormat<Out>,\n input: Out,\n options: FormatImportOptions = {},\n ): Promise<ImportPlan> {\n const ctx = contextFor(vault)\n // Mirrors the export side: the import gate is two-tier as well, and a\n // bundle format importing under the plaintext tier would be a silent\n // downgrade in the other direction.\n if (format.tier === 'bundle') ctx.assertCanImport('bundle')\n else ctx.assertCanImport('plaintext', format.id)\n if (!format.decode) {\n throw new ValidationError(\n `vault.import: the '${format.id}' format is export-only — it declares no decode(). ` +\n 'Pick a format that round-trips, or write the records directly.',\n )\n }\n const decoded = await format.decode(input)\n const candidate: Record<string, readonly unknown[]> = {}\n for (const chunk of decoded) {\n const target = chunk.collection || options.collection\n if (!target) {\n throw new ValidationError(\n `vault.import: the '${format.id}' input names no collection and none was supplied. ` +\n 'Pass { collection } for formats whose payload is collection-less.',\n )\n }\n candidate[target] = [...(candidate[target] ?? []), ...chunk.records]\n }\n return ctx.plan(candidate, options.policy ?? 'merge', format.id, options.idKey)\n },\n }\n}\n"],"mappings":"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","names":[]}
package/dist/at/index.js CHANGED
@@ -3,15 +3,15 @@ import {
3
3
  MemorySealer,
4
4
  SEALED_SECRET_RECORD_ID,
5
5
  parseSealedEnvelope
6
- } from "../chunk-3XJQBBZD.js";
7
- import "../chunk-EZGV6F47.js";
8
- import "../chunk-OIEO4WDL.js";
9
- import "../chunk-Q2XRFWOI.js";
6
+ } from "../chunk-NTVKHQ3L.js";
7
+ import "../chunk-WRLWEYHY.js";
8
+ import "../chunk-ZD7WFMV2.js";
9
+ import "../chunk-RRTQAQ3N.js";
10
10
  import "../chunk-NH2UOV3B.js";
11
- import "../chunk-42ALPZ2B.js";
12
- import "../chunk-QMWY2FDS.js";
13
- import "../chunk-SV2PM2OY.js";
14
- import "../chunk-37EPTBBR.js";
11
+ import "../chunk-ZF6JECDT.js";
12
+ import "../chunk-THQ3BHLM.js";
13
+ import "../chunk-XX4R7TUB.js";
14
+ import "../chunk-IKPQ2GGB.js";
15
15
  export {
16
16
  MemoryRecipientSealer,
17
17
  MemorySealer,
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  issueAttestationCore
3
- } from "../chunk-VMV5SBE4.js";
3
+ } from "../chunk-OYEBSWLE.js";
4
4
  import {
5
5
  getRevokedDocIdsCore,
6
6
  publishRevocationListCore,
7
7
  revokeDocCore,
8
8
  unrevokeDocCore
9
- } from "../chunk-5UMK7GRI.js";
10
- import "../chunk-JWWYRR4Q.js";
9
+ } from "../chunk-XPNJH7GN.js";
10
+ import "../chunk-B6EWMGFX.js";
11
11
  import {
12
12
  ATTESTATIONS_COLLECTION
13
- } from "../chunk-DLD5LGDS.js";
13
+ } from "../chunk-ZUTUNVFD.js";
14
14
  import {
15
15
  NO_ATTESTATION
16
- } from "../chunk-PD64727P.js";
16
+ } from "../chunk-FMINS2B6.js";
17
17
  import {
18
18
  decodeQr,
19
19
  isRevoked,
@@ -22,27 +22,27 @@ import {
22
22
  verifyRevocationList
23
23
  } from "../chunk-GMKGGY7V.js";
24
24
  import "../chunk-4AOERLTV.js";
25
- import "../chunk-EZGV6F47.js";
26
- import "../chunk-OIEO4WDL.js";
27
- import "../chunk-Q2XRFWOI.js";
25
+ import "../chunk-WRLWEYHY.js";
26
+ import "../chunk-ZD7WFMV2.js";
27
+ import "../chunk-RRTQAQ3N.js";
28
28
  import "../chunk-NH2UOV3B.js";
29
- import "../chunk-42ALPZ2B.js";
30
- import "../chunk-QMWY2FDS.js";
31
- import "../chunk-SV2PM2OY.js";
29
+ import "../chunk-ZF6JECDT.js";
30
+ import "../chunk-THQ3BHLM.js";
31
+ import "../chunk-XX4R7TUB.js";
32
32
  import {
33
33
  AttestationError,
34
34
  AttestationNotEnabledError
35
- } from "../chunk-37EPTBBR.js";
35
+ } from "../chunk-IKPQ2GGB.js";
36
36
 
37
37
  // src/with-audit/attestation/active.ts
38
38
  function withAttestation() {
39
39
  return {
40
40
  async issueAttestation(ctx, args) {
41
- const { issueAttestationCore: issueAttestationCore2 } = await import("../issue-YIVBZUTH.js");
41
+ const { issueAttestationCore: issueAttestationCore2 } = await import("../issue-4ZPSY44M.js");
42
42
  return issueAttestationCore2(ctx, args);
43
43
  },
44
44
  async getDocumentSigningPublicKey(deps) {
45
- const { loadSigner, loadOrCreateSigner } = await import("../signer-MHGW3OIL.js");
45
+ const { loadSigner, loadOrCreateSigner } = await import("../signer-NYR4I3FO.js");
46
46
  const existing = await loadSigner(deps.adapter, deps.vault, deps.getDEK);
47
47
  if (existing) return { keyId: existing.keyId, publicKeyB64: existing.publicKeyB64 };
48
48
  if (deps.role !== "owner") {
@@ -52,19 +52,19 @@ function withAttestation() {
52
52
  return { keyId: signer.keyId, publicKeyB64: signer.publicKeyB64 };
53
53
  },
54
54
  async revokeAttestation(ctx, docId) {
55
- const { revokeDocCore: revokeDocCore2 } = await import("../revoke-6DWIEOCV.js");
55
+ const { revokeDocCore: revokeDocCore2 } = await import("../revoke-QUT7WWG3.js");
56
56
  return revokeDocCore2(ctx, docId);
57
57
  },
58
58
  async unrevokeAttestation(ctx, docId) {
59
- const { unrevokeDocCore: unrevokeDocCore2 } = await import("../revoke-6DWIEOCV.js");
59
+ const { unrevokeDocCore: unrevokeDocCore2 } = await import("../revoke-QUT7WWG3.js");
60
60
  return unrevokeDocCore2(ctx, docId);
61
61
  },
62
62
  async getRevokedDocIds(ctx) {
63
- const { getRevokedDocIdsCore: getRevokedDocIdsCore2 } = await import("../revoke-6DWIEOCV.js");
63
+ const { getRevokedDocIdsCore: getRevokedDocIdsCore2 } = await import("../revoke-QUT7WWG3.js");
64
64
  return getRevokedDocIdsCore2(ctx);
65
65
  },
66
66
  async publishRevocationList(ctx) {
67
- const { publishRevocationListCore: publishRevocationListCore2 } = await import("../revoke-6DWIEOCV.js");
67
+ const { publishRevocationListCore: publishRevocationListCore2 } = await import("../revoke-QUT7WWG3.js");
68
68
  return publishRevocationListCore2(ctx);
69
69
  }
70
70
  };
@@ -3,50 +3,40 @@ import {
3
3
  } from "./chunk-EPFF7LOX.js";
4
4
  import {
5
5
  SCHEMAS_COLLECTION
6
- } from "./chunk-3L2NBKDR.js";
6
+ } from "./chunk-IF2M43G4.js";
7
7
  import {
8
8
  PERIODS_COLLECTION,
9
9
  PERIOD_ARCHIVES_COLLECTION,
10
10
  PERIOD_FREEZES_COLLECTION,
11
11
  PERIOD_REOPENS_COLLECTION,
12
12
  PERIOD_TARGET_PURGES_COLLECTION
13
- } from "./chunk-QBLT6POL.js";
13
+ } from "./chunk-FPF5HRBE.js";
14
14
  import {
15
15
  SEQUENCE_COLLECTION
16
- } from "./chunk-VFHCKG5M.js";
16
+ } from "./chunk-BVRJYMFZ.js";
17
17
  import {
18
18
  LEDGER_COLLECTION,
19
19
  LEDGER_DELTAS_COLLECTION
20
20
  } from "./chunk-I7FD46FF.js";
21
21
  import {
22
22
  buildRecordEnvelope
23
- } from "./chunk-EZGV6F47.js";
24
- import "./chunk-OIEO4WDL.js";
25
- import "./chunk-Q2XRFWOI.js";
23
+ } from "./chunk-WRLWEYHY.js";
24
+ import "./chunk-ZD7WFMV2.js";
25
+ import "./chunk-RRTQAQ3N.js";
26
26
  import "./chunk-NH2UOV3B.js";
27
- import "./chunk-42ALPZ2B.js";
28
- import "./chunk-QMWY2FDS.js";
27
+ import "./chunk-ZF6JECDT.js";
28
+ import "./chunk-THQ3BHLM.js";
29
29
  import {
30
30
  NOYDB_BACKUP_VERSION
31
- } from "./chunk-SV2PM2OY.js";
31
+ } from "./chunk-XX4R7TUB.js";
32
32
  import {
33
33
  BackupCorruptedError,
34
34
  BackupLedgerError
35
- } from "./chunk-37EPTBBR.js";
35
+ } from "./chunk-IKPQ2GGB.js";
36
36
 
37
37
  // src/with-pod/backup.ts
38
- async function dumpVault(ctx) {
39
- const snapshot = await ctx.adapter.loadAll(ctx.vault);
40
- const keyringIds = await ctx.adapter.list(ctx.vault, "_keyring");
41
- const keyrings = {};
42
- for (const keyringId of keyringIds) {
43
- const envelope = await ctx.adapter.get(ctx.vault, "_keyring", keyringId);
44
- if (envelope) {
45
- keyrings[keyringId] = JSON.parse(envelope._data ?? "");
46
- }
47
- }
48
- const internalSnapshot = {};
49
- const internalNames = [
38
+ function internalCollectionNames(dataCollections) {
39
+ return [
50
40
  LEDGER_COLLECTION,
51
41
  LEDGER_DELTAS_COLLECTION,
52
42
  SCHEMAS_COLLECTION,
@@ -87,8 +77,21 @@ async function dumpVault(ctx) {
87
77
  // old eTag may not exist in the destination, so it must be stripped
88
78
  // there instead. Asymmetry: backup = same-vault-resumable = carry;
89
79
  // partition = cross-vault = strip-breadcrumb-carry-marker.
90
- ...Object.keys(snapshot).flatMap((c) => [`_blob_slots_${c}`, `_blob_versions_${c}`])
80
+ ...dataCollections.flatMap((c) => [`_blob_slots_${c}`, `_blob_versions_${c}`])
91
81
  ];
82
+ }
83
+ async function dumpVault(ctx) {
84
+ const snapshot = await ctx.adapter.loadAll(ctx.vault);
85
+ const keyringIds = await ctx.adapter.list(ctx.vault, "_keyring");
86
+ const keyrings = {};
87
+ for (const keyringId of keyringIds) {
88
+ const envelope = await ctx.adapter.get(ctx.vault, "_keyring", keyringId);
89
+ if (envelope) {
90
+ keyrings[keyringId] = JSON.parse(envelope._data ?? "");
91
+ }
92
+ }
93
+ const internalSnapshot = {};
94
+ const internalNames = internalCollectionNames(Object.keys(snapshot));
92
95
  for (const internalName of internalNames) {
93
96
  const ids = await ctx.adapter.list(ctx.vault, internalName);
94
97
  if (ids.length === 0) continue;
@@ -119,9 +122,52 @@ async function dumpVault(ctx) {
119
122
  };
120
123
  return JSON.stringify(backup);
121
124
  }
122
- async function loadVault(ctx, backupJson) {
125
+ async function reconcileCollection(ctx, collection, podRows) {
126
+ let written = 0, skipped = 0, deleted = 0;
127
+ for (const [id, envelope] of Object.entries(podRows)) {
128
+ const local = await ctx.adapter.get(ctx.vault, collection, id);
129
+ if (local && local._v === envelope._v) {
130
+ skipped++;
131
+ continue;
132
+ }
133
+ await ctx.adapter.put(ctx.vault, collection, id, envelope);
134
+ written++;
135
+ }
136
+ for (const id of await ctx.adapter.list(ctx.vault, collection)) {
137
+ if (id in podRows) continue;
138
+ await ctx.adapter.delete(ctx.vault, collection, id);
139
+ deleted++;
140
+ }
141
+ return { written, skipped, deleted };
142
+ }
143
+ function podReport(mode, per) {
144
+ let written = 0, skipped = 0, deleted = 0;
145
+ for (const r of Object.values(per)) {
146
+ written += r.written;
147
+ skipped += r.skipped;
148
+ deleted += r.deleted;
149
+ }
150
+ return { mode, written, skipped, deleted, collections: per };
151
+ }
152
+ async function loadVault(ctx, backupJson, options) {
123
153
  const backup = JSON.parse(backupJson);
124
- await ctx.adapter.saveAll(ctx.vault, backup.collections);
154
+ const mode = options?.mode ?? "replace";
155
+ const per = {};
156
+ if (mode === "incremental" && backup._compartment !== ctx.vault) {
157
+ throw new BackupLedgerError(
158
+ `Incremental load refused: this pod was taken from vault "${backup._compartment}" and is being loaded into "${ctx.vault}". Incremental mode reconciles a vault against its OWN pod; use mode: 'replace' to overwrite this vault with a foreign pod.`
159
+ );
160
+ }
161
+ if (mode === "incremental") {
162
+ const localData = await ctx.adapter.loadAll(ctx.vault);
163
+ const names = /* @__PURE__ */ new Set([...Object.keys(backup.collections), ...Object.keys(localData)]);
164
+ for (const name of names) {
165
+ const r = await reconcileCollection(ctx, name, backup.collections[name] ?? {});
166
+ if (r.written || r.skipped || r.deleted) per[name] = r;
167
+ }
168
+ } else {
169
+ await ctx.adapter.saveAll(ctx.vault, backup.collections);
170
+ }
125
171
  for (const [userId, keyringFile] of Object.entries(backup.keyrings)) {
126
172
  const envelope = buildRecordEnvelope(
127
173
  { collection: "_keyring", id: userId, version: 1 },
@@ -129,16 +175,30 @@ async function loadVault(ctx, backupJson) {
129
175
  );
130
176
  await ctx.adapter.put(ctx.vault, "_keyring", userId, envelope);
131
177
  }
132
- if (backup._internal) {
133
- for (const [internalName, records] of Object.entries(backup._internal)) {
134
- for (const [id, envelope] of Object.entries(records)) {
135
- await ctx.adapter.put(ctx.vault, internalName, id, envelope);
178
+ const internalNamesToLoad = internalCollectionNames(Object.keys(backup.collections));
179
+ if (mode === "incremental") {
180
+ for (const internalName of internalNamesToLoad) {
181
+ const r = await reconcileCollection(ctx, internalName, backup._internal?.[internalName] ?? {});
182
+ if (r.written || r.skipped || r.deleted) per[internalName] = r;
183
+ }
184
+ } else {
185
+ for (const internalName of internalNamesToLoad) {
186
+ for (const id of await ctx.adapter.list(ctx.vault, internalName)) {
187
+ await ctx.adapter.delete(ctx.vault, internalName, id);
188
+ }
189
+ }
190
+ if (backup._internal) {
191
+ for (const [internalName, records] of Object.entries(backup._internal)) {
192
+ for (const [id, envelope] of Object.entries(records)) {
193
+ await ctx.adapter.put(ctx.vault, internalName, id, envelope);
194
+ }
136
195
  }
137
196
  }
138
197
  }
139
198
  await ctx.reloadKeyringAndRebuildDEK();
140
199
  ctx.clearCollectionCache();
141
200
  ctx.resetLedgerStore();
201
+ await ctx.resetSync?.();
142
202
  if (!backup.ledgerHead) {
143
203
  if (ctx.getLedgerOrNull()) {
144
204
  console.warn(
@@ -149,7 +209,7 @@ async function loadVault(ctx, backupJson) {
149
209
  `[noy-db] Loaded a backup with no ledgerHead \u2014 this pod is not integrity-checked. This reader has no ledger enabled (withHistory() is not configured), so nothing is stale: enable the ledger on both the exporter and this reader if tamper detection is wanted.`
150
210
  );
151
211
  }
152
- return;
212
+ return podReport(mode, per);
153
213
  }
154
214
  const result = await verifyBackupIntegrity(ctx);
155
215
  if (!result.ok) {
@@ -167,6 +227,7 @@ async function loadVault(ctx, backupJson) {
167
227
  `Backup ledger head mismatch: embedded "${backup.ledgerHead.hash}" but reconstructed "${result.head}".`
168
228
  );
169
229
  }
230
+ return podReport(mode, per);
170
231
  }
171
232
  async function verifyBackupIntegrity(ctx) {
172
233
  const ledgerForVerify = ctx.getLedgerOrNull();
@@ -266,4 +327,4 @@ export {
266
327
  loadVault,
267
328
  verifyBackupIntegrity
268
329
  };
269
- //# sourceMappingURL=backup-YE2VQ26S.js.map
330
+ //# sourceMappingURL=backup-RJBFQSHE.js.map