@noy-db/hub 0.6.0-pre.11 → 0.6.0-pre.13

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 (368) hide show
  1. package/dist/api-FYF5WE2E.js +20 -0
  2. package/dist/attestation/index.js +18 -18
  3. package/dist/{backup-AVAGHAJE.js → backup-JNCS4OMI.js} +15 -14
  4. package/dist/backup-JNCS4OMI.js.map +1 -0
  5. package/dist/blobs/index.js +13 -13
  6. package/dist/broker/index.js +12 -12
  7. package/dist/{bundle-handle-GFNHT52M.js → bundle-handle-RJZXOFXE.js} +2 -2
  8. package/dist/cargo/index.js +29 -29
  9. package/dist/{chunk-NJDQ4YSV.js → chunk-2BBXXSAD.js} +4 -4
  10. package/dist/{chunk-6FJWSWFT.js → chunk-2KHT6EP3.js} +3 -3
  11. package/dist/{chunk-6HFM7EIT.js → chunk-2KX6MT3D.js} +2 -2
  12. package/dist/{chunk-AHLJSVRL.js → chunk-37M5QBAS.js} +2 -2
  13. package/dist/{chunk-QULVCV3M.js → chunk-3EFQV2XQ.js} +4 -4
  14. package/dist/{chunk-747LRSOO.js → chunk-3IJK5FRG.js} +2 -2
  15. package/dist/{chunk-YJ6IONGA.js → chunk-45UIDGPY.js} +3 -3
  16. package/dist/{chunk-WLZ47GSL.js → chunk-4R4N5PRM.js} +4 -4
  17. package/dist/{chunk-2BMRJ6LQ.js → chunk-4TLFWYZG.js} +3 -3
  18. package/dist/{chunk-4HDYQL3J.js → chunk-4TRAQICY.js} +2 -2
  19. package/dist/{chunk-JIUVJ4M7.js → chunk-4WXISHDI.js} +2 -2
  20. package/dist/{chunk-VZ3XFUQ7.js → chunk-65NL6YZM.js} +8 -5
  21. package/dist/chunk-65NL6YZM.js.map +1 -0
  22. package/dist/{chunk-OF3L2SD6.js → chunk-6FXQZ3T7.js} +2 -2
  23. package/dist/{chunk-UHXCLPGC.js → chunk-7DK6CYXO.js} +2 -2
  24. package/dist/{chunk-YPYHVOXP.js → chunk-7GWC6RI5.js} +1 -1
  25. package/dist/chunk-7GWC6RI5.js.map +1 -0
  26. package/dist/{chunk-X56RTUK3.js → chunk-A5AB7EZU.js} +3 -3
  27. package/dist/{chunk-CEJWMBXO.js → chunk-A7BP42KY.js} +2 -2
  28. package/dist/{chunk-FDX7OWWI.js → chunk-ALBA4CET.js} +2 -2
  29. package/dist/{chunk-YAWK6AWF.js → chunk-ALDFGMO7.js} +2 -2
  30. package/dist/{chunk-UV4O7FAL.js → chunk-AS53PYO6.js} +85 -83
  31. package/dist/{chunk-UV4O7FAL.js.map → chunk-AS53PYO6.js.map} +1 -1
  32. package/dist/{chunk-3FSX6LDG.js → chunk-C5N3ZWGJ.js} +2 -2
  33. package/dist/{chunk-FFDNKRCY.js → chunk-C6RYZ4ZD.js} +2 -2
  34. package/dist/{chunk-JRKZTEZZ.js → chunk-CFM6GBNF.js} +7 -7
  35. package/dist/{chunk-JRKZTEZZ.js.map → chunk-CFM6GBNF.js.map} +1 -1
  36. package/dist/{chunk-Q6TEJXBX.js → chunk-CM7MGRP3.js} +6 -6
  37. package/dist/{chunk-HNGSV2YC.js → chunk-CT35TQV7.js} +1 -3
  38. package/dist/chunk-CT35TQV7.js.map +1 -0
  39. package/dist/{chunk-AR2JDFAE.js → chunk-CUEWN4FX.js} +2 -2
  40. package/dist/{chunk-DMQCLZ4Z.js → chunk-DKJXAZWF.js} +2 -2
  41. package/dist/{chunk-CDB2HVQW.js → chunk-DMRDPZQ7.js} +4 -4
  42. package/dist/{chunk-5JY5TSVY.js → chunk-EPUDMBVL.js} +5 -5
  43. package/dist/{chunk-7G6VDWXB.js → chunk-EWTAUGAK.js} +3 -3
  44. package/dist/{chunk-3URQC7EH.js → chunk-EZYLQKHP.js} +35 -8
  45. package/dist/chunk-EZYLQKHP.js.map +1 -0
  46. package/dist/{chunk-35EBKWQU.js → chunk-FWZ7WYAH.js} +3 -3
  47. package/dist/{chunk-4VUPLMZ6.js → chunk-GAELDPIH.js} +6 -12
  48. package/dist/chunk-GAELDPIH.js.map +1 -0
  49. package/dist/{chunk-6BU3L4UE.js → chunk-GGM3JCEG.js} +2 -2
  50. package/dist/{chunk-6BVER473.js → chunk-GNMGX4FY.js} +8 -8
  51. package/dist/{chunk-CBXHHCZT.js → chunk-H3BDH7DA.js} +3 -3
  52. package/dist/{chunk-WFUIE565.js → chunk-H6UFT22R.js} +4 -4
  53. package/dist/{chunk-Z45YRGFO.js → chunk-HRQF23XS.js} +2 -2
  54. package/dist/{chunk-7F4DBNSP.js → chunk-IHKRTVJQ.js} +3 -3
  55. package/dist/{chunk-7TSYBD3E.js → chunk-IONRKUH4.js} +2 -2
  56. package/dist/{chunk-W3TVWF6N.js → chunk-IQVVUZ6Z.js} +2 -2
  57. package/dist/{chunk-5ZKS6ZE2.js → chunk-J5LO2H42.js} +4 -4
  58. package/dist/{chunk-WLYIROCJ.js → chunk-J6EBSGIR.js} +2 -2
  59. package/dist/{chunk-55LKVALY.js → chunk-JN64WH3U.js} +1 -3
  60. package/dist/chunk-JN64WH3U.js.map +1 -0
  61. package/dist/{chunk-RXYYFSBB.js → chunk-JTZRLD47.js} +3 -3
  62. package/dist/{chunk-CCVYQFLU.js → chunk-KMLMEIWV.js} +7 -11
  63. package/dist/chunk-KMLMEIWV.js.map +1 -0
  64. package/dist/{chunk-3JVXVJ7L.js → chunk-KOM2GMTW.js} +10 -10
  65. package/dist/{chunk-PL2GHSCM.js → chunk-KYIXANXU.js} +7 -7
  66. package/dist/{chunk-G6S5VVHP.js → chunk-LOLK4EAT.js} +5 -5
  67. package/dist/{chunk-HVQGCKY4.js → chunk-LQEHLFFF.js} +2 -2
  68. package/dist/{chunk-H4YQSDOI.js → chunk-LQFNJRMI.js} +2 -2
  69. package/dist/{chunk-7H73RIE3.js → chunk-LVLXWIBF.js} +2 -2
  70. package/dist/{chunk-NPP5R7FF.js → chunk-LZHDIO64.js} +7 -7
  71. package/dist/{chunk-DG27IUVI.js → chunk-M3VRXAVD.js} +2 -2
  72. package/dist/{chunk-FMQJZH4R.js → chunk-M3XBZPLU.js} +6 -6
  73. package/dist/{chunk-PDLLCOGD.js → chunk-M44ZBLL3.js} +6 -6
  74. package/dist/{chunk-FNSMZQS4.js → chunk-MLMDO4OQ.js} +2 -2
  75. package/dist/{chunk-ADW22QSB.js → chunk-MRDQ6HJS.js} +4 -4
  76. package/dist/{chunk-52JPHN5N.js → chunk-MSCXCF4T.js} +6 -6
  77. package/dist/{chunk-BRVW2GS5.js → chunk-MUE2CQX2.js} +45 -13
  78. package/dist/chunk-MUE2CQX2.js.map +1 -0
  79. package/dist/{chunk-VJFMXYKP.js → chunk-MVWO6KXU.js} +2 -2
  80. package/dist/{chunk-3IXIU6FP.js → chunk-NW3PSKAN.js} +2 -2
  81. package/dist/{chunk-CCZJJ4I2.js → chunk-OERLXUF5.js} +4 -4
  82. package/dist/{chunk-W77KZHCW.js → chunk-OFGLLNQW.js} +6 -6
  83. package/dist/{chunk-4GZ6XOVW.js → chunk-OGQSJJWF.js} +9 -9
  84. package/dist/{chunk-WASHZV34.js → chunk-OOOU3F5Y.js} +5 -5
  85. package/dist/{chunk-HPLWFNG4.js → chunk-P7A2FX5Y.js} +2 -2
  86. package/dist/{chunk-KUDZVJKQ.js → chunk-PLJ622XY.js} +2 -2
  87. package/dist/{chunk-PNKHAKQ7.js → chunk-PRN65IDE.js} +5 -5
  88. package/dist/{chunk-6NVPFKN3.js → chunk-PV76W4KB.js} +7 -7
  89. package/dist/{chunk-RTAMLDWP.js → chunk-Q4AU3NJE.js} +2 -2
  90. package/dist/{chunk-5O5HRRTV.js → chunk-QLFLX5VA.js} +6 -6
  91. package/dist/{chunk-JJNOLSG5.js → chunk-QNGRTWGM.js} +5 -5
  92. package/dist/{chunk-GU7A7MQA.js → chunk-R6V4M2JO.js} +15 -12
  93. package/dist/chunk-R6V4M2JO.js.map +1 -0
  94. package/dist/{chunk-O2ERS4UJ.js → chunk-S7UTUFPU.js} +11 -11
  95. package/dist/chunk-S7UTUFPU.js.map +1 -0
  96. package/dist/{chunk-2DHSSLOD.js → chunk-SX2ZKKZS.js} +6 -6
  97. package/dist/{chunk-2Z3NCLNX.js → chunk-SX4HK6FU.js} +7 -7
  98. package/dist/{chunk-FUHKW252.js → chunk-TAFRRVFR.js} +2 -2
  99. package/dist/{chunk-JRCYZEHU.js → chunk-TEOL6VAV.js} +2 -2
  100. package/dist/{chunk-U5O6GIWZ.js → chunk-TJGB5I4J.js} +3 -3
  101. package/dist/{chunk-MSWYQLMQ.js → chunk-V3WLQXDF.js} +2 -2
  102. package/dist/{chunk-VMCCGUQB.js → chunk-VDQZKDED.js} +2 -2
  103. package/dist/{chunk-BGQ63MCT.js → chunk-VFBJMTLJ.js} +3 -3
  104. package/dist/{chunk-VCETL77O.js → chunk-WJD5VF2N.js} +14 -6
  105. package/dist/chunk-WJD5VF2N.js.map +1 -0
  106. package/dist/{chunk-N35NC4JH.js → chunk-WX5ABQSL.js} +2 -2
  107. package/dist/{chunk-FAXZQ5UF.js → chunk-Y2FDCDLY.js} +2 -2
  108. package/dist/{chunk-7MNBICB5.js → chunk-Y6C67PJX.js} +5 -5
  109. package/dist/{chunk-4I72F5DF.js → chunk-YKDAFWWS.js} +5 -5
  110. package/dist/{chunk-HXGUIPQB.js → chunk-YRMA7CJH.js} +3 -3
  111. package/dist/{chunk-6SAFL5YE.js → chunk-YRTS5MWY.js} +3 -3
  112. package/dist/{chunk-HNHCQ556.js → chunk-YVGJLRXN.js} +2 -2
  113. package/dist/{chunk-SUFG5E73.js → chunk-YZC4DWJQ.js} +2 -2
  114. package/dist/{chunk-XWX7GL56.js → chunk-Z7PW63ZC.js} +2 -2
  115. package/dist/{chunk-FZ6NYJ7L.js → chunk-ZFO26ZZR.js} +5 -5
  116. package/dist/{chunk-4UVDI4XE.js → chunk-ZG7MXW5J.js} +3 -3
  117. package/dist/classified/index.js +5 -5
  118. package/dist/{classified-marker-2KJAXRRO.js → classified-marker-IYWA7L6U.js} +3 -3
  119. package/dist/collection-facade-FLXXGAPR.js +45 -0
  120. package/dist/{computed-6G5M3UPH.js → computed-B3BJQSU5.js} +3 -3
  121. package/dist/consent/index.js +9 -9
  122. package/dist/cover/index.js +3 -3
  123. package/dist/custody/index.js +11 -11
  124. package/dist/{dead-filter-DCB62VWW.js → dead-filter-QV7ORQS3.js} +2 -2
  125. package/dist/debug/index.js +1 -1
  126. package/dist/{delegation-MO7YZYJS.js → delegation-UPE5PUKB.js} +13 -11
  127. package/dist/delegation-UPE5PUKB.js.map +1 -0
  128. package/dist/derivations/index.js +12 -12
  129. package/dist/derive-R7ALNQRH.js +22 -0
  130. package/dist/directory/index.js +10 -10
  131. package/dist/{dispatch-MJ6SHB3Y.js → dispatch-BW2W2LXV.js} +18 -18
  132. package/dist/{dispatch-23SKSHPD.js → dispatch-OBZS537P.js} +5 -5
  133. package/dist/{enclave-JU4YIEPB.js → enclave-LXFVDJLO.js} +11 -9
  134. package/dist/executor-4WZG7D46.js +9 -0
  135. package/dist/executor-5RWPUTGR.js +29 -0
  136. package/dist/executor-VOD4C6ZA.js +9 -0
  137. package/dist/export-accessible-TCVU6B72.js +23 -0
  138. package/dist/extract-partition-UNUQF5MD.js +38 -0
  139. package/dist/{fanout-sidecar-NNAJQXMX.js → fanout-sidecar-BD4ZSPER.js} +9 -9
  140. package/dist/find-QJPVK6CY.js +11 -0
  141. package/dist/forget/index.js +9 -9
  142. package/dist/guards/index.js +4 -4
  143. package/dist/history/index.js +12 -12
  144. package/dist/i18n/index.js +14 -14
  145. package/dist/index.d.ts +8 -8
  146. package/dist/index.js +91 -105
  147. package/dist/index.js.map +1 -1
  148. package/dist/indexing/index.js +2 -2
  149. package/dist/introspection/index.js +11 -11
  150. package/dist/issue-QYCCTU4S.js +19 -0
  151. package/dist/kernel/enclave/crypto.d.ts +24 -4
  152. package/dist/kernel/enclave/index.d.ts +2 -0
  153. package/dist/kernel/enclave/record-aad.d.ts +59 -0
  154. package/dist/kernel/errors.d.ts +0 -4
  155. package/dist/kernel/sync-policy.d.ts +0 -2
  156. package/dist/kernel/types.d.ts +31 -5
  157. package/dist/{ledger-AETNF4OM.js → ledger-6EMFGJRU.js} +11 -11
  158. package/dist/liberate-ZJDLMKOW.js +24 -0
  159. package/dist/{link-set-E5HNY67I.js → link-set-GUKFJQGW.js} +11 -11
  160. package/dist/{managed-secret-CWQ6PND5.js → managed-secret-T6X4VHB2.js} +3 -3
  161. package/dist/materialized-views/index.js +20 -20
  162. package/dist/money/index.js +4 -4
  163. package/dist/noydb-IP2QPER4.js +83 -0
  164. package/dist/overlay-views/index.js +4 -4
  165. package/dist/periods/index.js +12 -12
  166. package/dist/pod/index.js +55 -67
  167. package/dist/policy/index.js +4 -4
  168. package/dist/port/to/index.d.ts +2 -2
  169. package/dist/port/with/service-bus.d.ts +0 -4
  170. package/dist/portability/index.js +8 -8
  171. package/dist/{post-register-2XSSMGEQ.js → post-register-XKYJDDZL.js} +6 -6
  172. package/dist/query/index.js +3 -3
  173. package/dist/reduce/index.js +4 -4
  174. package/dist/register-GFYFTV74.js +32 -0
  175. package/dist/registry-BY7Z54RJ.js +9 -0
  176. package/dist/registry-D6NSZUVQ.js +9 -0
  177. package/dist/registry-KQPWMFIP.js +19 -0
  178. package/dist/registry-P7RU4TPR.js +18 -0
  179. package/dist/request-withdrawal-6RA6PGWD.js +31 -0
  180. package/dist/{reveal-BW36KCOQ.js → reveal-IN2ZBB5U.js} +6 -6
  181. package/dist/revoke-ETYVUNHE.js +24 -0
  182. package/dist/satellites/index.js +1 -1
  183. package/dist/schema-update/index.js +2 -2
  184. package/dist/sealed-record/index.js +12 -12
  185. package/dist/search/index.js +4 -4
  186. package/dist/{seed-GDV5PT4R.js → seed-D623RNG3.js} +11 -11
  187. package/dist/sequence/index.js +9 -9
  188. package/dist/session/index.js +9 -9
  189. package/dist/shadow/index.js +2 -2
  190. package/dist/signer-FLW4HHWM.js +25 -0
  191. package/dist/snapshots/index.js +10 -10
  192. package/dist/{stale-4PUTWI2H.js → stale-O3CZVYMO.js} +10 -10
  193. package/dist/storage-7GVHLKVJ.js +23 -0
  194. package/dist/{store-coordination-provider-GFCUOBR6.js → store-coordination-provider-RKBDHHN4.js} +3 -3
  195. package/dist/sync/index.js +11 -11
  196. package/dist/team/index.js +14 -14
  197. package/dist/tiers/index.js +10 -10
  198. package/dist/to/index.js +1 -3
  199. package/dist/to/index.js.map +1 -1
  200. package/dist/transactions/index.js +3 -3
  201. package/dist/util/index.js +1 -1
  202. package/dist/{verify-RO5RTZOJ.js → verify-GB7SBYC3.js} +5 -5
  203. package/dist/walk-77FSILOU.js +21 -0
  204. package/dist/with-pod/bundle.d.ts +3 -11
  205. package/dist/with-pod/format.d.ts +0 -2
  206. package/dist/with-pod/index.d.ts +6 -6
  207. package/dist/with-pod/pod-store.d.ts +0 -8
  208. package/dist/with-sync/engine.d.ts +21 -0
  209. package/dist/withdraw-accessible-XMWJWDZP.js +28 -0
  210. package/package.json +3 -3
  211. package/dist/api-RXUMEKT3.js +0 -20
  212. package/dist/backup-AVAGHAJE.js.map +0 -1
  213. package/dist/chunk-3URQC7EH.js.map +0 -1
  214. package/dist/chunk-4VUPLMZ6.js.map +0 -1
  215. package/dist/chunk-55LKVALY.js.map +0 -1
  216. package/dist/chunk-BRVW2GS5.js.map +0 -1
  217. package/dist/chunk-CCVYQFLU.js.map +0 -1
  218. package/dist/chunk-GU7A7MQA.js.map +0 -1
  219. package/dist/chunk-HNGSV2YC.js.map +0 -1
  220. package/dist/chunk-O2ERS4UJ.js.map +0 -1
  221. package/dist/chunk-VCETL77O.js.map +0 -1
  222. package/dist/chunk-VZ3XFUQ7.js.map +0 -1
  223. package/dist/chunk-YPYHVOXP.js.map +0 -1
  224. package/dist/collection-facade-QEJIM6BC.js +0 -45
  225. package/dist/delegation-MO7YZYJS.js.map +0 -1
  226. package/dist/derive-IUA6JFLB.js +0 -22
  227. package/dist/executor-CYJQLKKI.js +0 -9
  228. package/dist/executor-FKZURXVV.js +0 -29
  229. package/dist/executor-S4QIKEHW.js +0 -9
  230. package/dist/export-accessible-4S36PQNR.js +0 -23
  231. package/dist/extract-partition-IO7FDZ2P.js +0 -38
  232. package/dist/find-RBBYKXI7.js +0 -11
  233. package/dist/issue-RIVHSY2S.js +0 -19
  234. package/dist/liberate-GFN4C7RR.js +0 -24
  235. package/dist/noydb-FYTCH2GD.js +0 -83
  236. package/dist/register-4EFJCVYD.js +0 -32
  237. package/dist/registry-4SDHHOJ7.js +0 -18
  238. package/dist/registry-CZVINVQH.js +0 -9
  239. package/dist/registry-IKUR2MXD.js +0 -9
  240. package/dist/registry-OYTFGWVK.js +0 -19
  241. package/dist/request-withdrawal-KGXGDPVQ.js +0 -31
  242. package/dist/revoke-JFN773KF.js +0 -24
  243. package/dist/signer-TA55QB6R.js +0 -25
  244. package/dist/storage-V7MTFAQJ.js +0 -23
  245. package/dist/walk-3ZECBFDA.js +0 -21
  246. package/dist/withdraw-accessible-7PG4DYQK.js +0 -28
  247. /package/dist/{api-RXUMEKT3.js.map → api-FYF5WE2E.js.map} +0 -0
  248. /package/dist/{bundle-handle-GFNHT52M.js.map → bundle-handle-RJZXOFXE.js.map} +0 -0
  249. /package/dist/{chunk-NJDQ4YSV.js.map → chunk-2BBXXSAD.js.map} +0 -0
  250. /package/dist/{chunk-6FJWSWFT.js.map → chunk-2KHT6EP3.js.map} +0 -0
  251. /package/dist/{chunk-6HFM7EIT.js.map → chunk-2KX6MT3D.js.map} +0 -0
  252. /package/dist/{chunk-AHLJSVRL.js.map → chunk-37M5QBAS.js.map} +0 -0
  253. /package/dist/{chunk-QULVCV3M.js.map → chunk-3EFQV2XQ.js.map} +0 -0
  254. /package/dist/{chunk-747LRSOO.js.map → chunk-3IJK5FRG.js.map} +0 -0
  255. /package/dist/{chunk-YJ6IONGA.js.map → chunk-45UIDGPY.js.map} +0 -0
  256. /package/dist/{chunk-WLZ47GSL.js.map → chunk-4R4N5PRM.js.map} +0 -0
  257. /package/dist/{chunk-2BMRJ6LQ.js.map → chunk-4TLFWYZG.js.map} +0 -0
  258. /package/dist/{chunk-4HDYQL3J.js.map → chunk-4TRAQICY.js.map} +0 -0
  259. /package/dist/{chunk-JIUVJ4M7.js.map → chunk-4WXISHDI.js.map} +0 -0
  260. /package/dist/{chunk-OF3L2SD6.js.map → chunk-6FXQZ3T7.js.map} +0 -0
  261. /package/dist/{chunk-UHXCLPGC.js.map → chunk-7DK6CYXO.js.map} +0 -0
  262. /package/dist/{chunk-X56RTUK3.js.map → chunk-A5AB7EZU.js.map} +0 -0
  263. /package/dist/{chunk-CEJWMBXO.js.map → chunk-A7BP42KY.js.map} +0 -0
  264. /package/dist/{chunk-FDX7OWWI.js.map → chunk-ALBA4CET.js.map} +0 -0
  265. /package/dist/{chunk-YAWK6AWF.js.map → chunk-ALDFGMO7.js.map} +0 -0
  266. /package/dist/{chunk-3FSX6LDG.js.map → chunk-C5N3ZWGJ.js.map} +0 -0
  267. /package/dist/{chunk-FFDNKRCY.js.map → chunk-C6RYZ4ZD.js.map} +0 -0
  268. /package/dist/{chunk-Q6TEJXBX.js.map → chunk-CM7MGRP3.js.map} +0 -0
  269. /package/dist/{chunk-AR2JDFAE.js.map → chunk-CUEWN4FX.js.map} +0 -0
  270. /package/dist/{chunk-DMQCLZ4Z.js.map → chunk-DKJXAZWF.js.map} +0 -0
  271. /package/dist/{chunk-CDB2HVQW.js.map → chunk-DMRDPZQ7.js.map} +0 -0
  272. /package/dist/{chunk-5JY5TSVY.js.map → chunk-EPUDMBVL.js.map} +0 -0
  273. /package/dist/{chunk-7G6VDWXB.js.map → chunk-EWTAUGAK.js.map} +0 -0
  274. /package/dist/{chunk-35EBKWQU.js.map → chunk-FWZ7WYAH.js.map} +0 -0
  275. /package/dist/{chunk-6BU3L4UE.js.map → chunk-GGM3JCEG.js.map} +0 -0
  276. /package/dist/{chunk-6BVER473.js.map → chunk-GNMGX4FY.js.map} +0 -0
  277. /package/dist/{chunk-CBXHHCZT.js.map → chunk-H3BDH7DA.js.map} +0 -0
  278. /package/dist/{chunk-WFUIE565.js.map → chunk-H6UFT22R.js.map} +0 -0
  279. /package/dist/{chunk-Z45YRGFO.js.map → chunk-HRQF23XS.js.map} +0 -0
  280. /package/dist/{chunk-7F4DBNSP.js.map → chunk-IHKRTVJQ.js.map} +0 -0
  281. /package/dist/{chunk-7TSYBD3E.js.map → chunk-IONRKUH4.js.map} +0 -0
  282. /package/dist/{chunk-W3TVWF6N.js.map → chunk-IQVVUZ6Z.js.map} +0 -0
  283. /package/dist/{chunk-5ZKS6ZE2.js.map → chunk-J5LO2H42.js.map} +0 -0
  284. /package/dist/{chunk-WLYIROCJ.js.map → chunk-J6EBSGIR.js.map} +0 -0
  285. /package/dist/{chunk-RXYYFSBB.js.map → chunk-JTZRLD47.js.map} +0 -0
  286. /package/dist/{chunk-3JVXVJ7L.js.map → chunk-KOM2GMTW.js.map} +0 -0
  287. /package/dist/{chunk-PL2GHSCM.js.map → chunk-KYIXANXU.js.map} +0 -0
  288. /package/dist/{chunk-G6S5VVHP.js.map → chunk-LOLK4EAT.js.map} +0 -0
  289. /package/dist/{chunk-HVQGCKY4.js.map → chunk-LQEHLFFF.js.map} +0 -0
  290. /package/dist/{chunk-H4YQSDOI.js.map → chunk-LQFNJRMI.js.map} +0 -0
  291. /package/dist/{chunk-7H73RIE3.js.map → chunk-LVLXWIBF.js.map} +0 -0
  292. /package/dist/{chunk-NPP5R7FF.js.map → chunk-LZHDIO64.js.map} +0 -0
  293. /package/dist/{chunk-DG27IUVI.js.map → chunk-M3VRXAVD.js.map} +0 -0
  294. /package/dist/{chunk-FMQJZH4R.js.map → chunk-M3XBZPLU.js.map} +0 -0
  295. /package/dist/{chunk-PDLLCOGD.js.map → chunk-M44ZBLL3.js.map} +0 -0
  296. /package/dist/{chunk-FNSMZQS4.js.map → chunk-MLMDO4OQ.js.map} +0 -0
  297. /package/dist/{chunk-ADW22QSB.js.map → chunk-MRDQ6HJS.js.map} +0 -0
  298. /package/dist/{chunk-52JPHN5N.js.map → chunk-MSCXCF4T.js.map} +0 -0
  299. /package/dist/{chunk-VJFMXYKP.js.map → chunk-MVWO6KXU.js.map} +0 -0
  300. /package/dist/{chunk-3IXIU6FP.js.map → chunk-NW3PSKAN.js.map} +0 -0
  301. /package/dist/{chunk-CCZJJ4I2.js.map → chunk-OERLXUF5.js.map} +0 -0
  302. /package/dist/{chunk-W77KZHCW.js.map → chunk-OFGLLNQW.js.map} +0 -0
  303. /package/dist/{chunk-4GZ6XOVW.js.map → chunk-OGQSJJWF.js.map} +0 -0
  304. /package/dist/{chunk-WASHZV34.js.map → chunk-OOOU3F5Y.js.map} +0 -0
  305. /package/dist/{chunk-HPLWFNG4.js.map → chunk-P7A2FX5Y.js.map} +0 -0
  306. /package/dist/{chunk-KUDZVJKQ.js.map → chunk-PLJ622XY.js.map} +0 -0
  307. /package/dist/{chunk-PNKHAKQ7.js.map → chunk-PRN65IDE.js.map} +0 -0
  308. /package/dist/{chunk-6NVPFKN3.js.map → chunk-PV76W4KB.js.map} +0 -0
  309. /package/dist/{chunk-RTAMLDWP.js.map → chunk-Q4AU3NJE.js.map} +0 -0
  310. /package/dist/{chunk-5O5HRRTV.js.map → chunk-QLFLX5VA.js.map} +0 -0
  311. /package/dist/{chunk-JJNOLSG5.js.map → chunk-QNGRTWGM.js.map} +0 -0
  312. /package/dist/{chunk-2DHSSLOD.js.map → chunk-SX2ZKKZS.js.map} +0 -0
  313. /package/dist/{chunk-2Z3NCLNX.js.map → chunk-SX4HK6FU.js.map} +0 -0
  314. /package/dist/{chunk-FUHKW252.js.map → chunk-TAFRRVFR.js.map} +0 -0
  315. /package/dist/{chunk-JRCYZEHU.js.map → chunk-TEOL6VAV.js.map} +0 -0
  316. /package/dist/{chunk-U5O6GIWZ.js.map → chunk-TJGB5I4J.js.map} +0 -0
  317. /package/dist/{chunk-MSWYQLMQ.js.map → chunk-V3WLQXDF.js.map} +0 -0
  318. /package/dist/{chunk-VMCCGUQB.js.map → chunk-VDQZKDED.js.map} +0 -0
  319. /package/dist/{chunk-BGQ63MCT.js.map → chunk-VFBJMTLJ.js.map} +0 -0
  320. /package/dist/{chunk-N35NC4JH.js.map → chunk-WX5ABQSL.js.map} +0 -0
  321. /package/dist/{chunk-FAXZQ5UF.js.map → chunk-Y2FDCDLY.js.map} +0 -0
  322. /package/dist/{chunk-7MNBICB5.js.map → chunk-Y6C67PJX.js.map} +0 -0
  323. /package/dist/{chunk-4I72F5DF.js.map → chunk-YKDAFWWS.js.map} +0 -0
  324. /package/dist/{chunk-HXGUIPQB.js.map → chunk-YRMA7CJH.js.map} +0 -0
  325. /package/dist/{chunk-6SAFL5YE.js.map → chunk-YRTS5MWY.js.map} +0 -0
  326. /package/dist/{chunk-HNHCQ556.js.map → chunk-YVGJLRXN.js.map} +0 -0
  327. /package/dist/{chunk-SUFG5E73.js.map → chunk-YZC4DWJQ.js.map} +0 -0
  328. /package/dist/{chunk-XWX7GL56.js.map → chunk-Z7PW63ZC.js.map} +0 -0
  329. /package/dist/{chunk-FZ6NYJ7L.js.map → chunk-ZFO26ZZR.js.map} +0 -0
  330. /package/dist/{chunk-4UVDI4XE.js.map → chunk-ZG7MXW5J.js.map} +0 -0
  331. /package/dist/{classified-marker-2KJAXRRO.js.map → classified-marker-IYWA7L6U.js.map} +0 -0
  332. /package/dist/{collection-facade-QEJIM6BC.js.map → collection-facade-FLXXGAPR.js.map} +0 -0
  333. /package/dist/{computed-6G5M3UPH.js.map → computed-B3BJQSU5.js.map} +0 -0
  334. /package/dist/{dead-filter-DCB62VWW.js.map → dead-filter-QV7ORQS3.js.map} +0 -0
  335. /package/dist/{derive-IUA6JFLB.js.map → derive-R7ALNQRH.js.map} +0 -0
  336. /package/dist/{dispatch-MJ6SHB3Y.js.map → dispatch-BW2W2LXV.js.map} +0 -0
  337. /package/dist/{dispatch-23SKSHPD.js.map → dispatch-OBZS537P.js.map} +0 -0
  338. /package/dist/{enclave-JU4YIEPB.js.map → enclave-LXFVDJLO.js.map} +0 -0
  339. /package/dist/{executor-CYJQLKKI.js.map → executor-4WZG7D46.js.map} +0 -0
  340. /package/dist/{executor-FKZURXVV.js.map → executor-5RWPUTGR.js.map} +0 -0
  341. /package/dist/{executor-S4QIKEHW.js.map → executor-VOD4C6ZA.js.map} +0 -0
  342. /package/dist/{export-accessible-4S36PQNR.js.map → export-accessible-TCVU6B72.js.map} +0 -0
  343. /package/dist/{extract-partition-IO7FDZ2P.js.map → extract-partition-UNUQF5MD.js.map} +0 -0
  344. /package/dist/{fanout-sidecar-NNAJQXMX.js.map → fanout-sidecar-BD4ZSPER.js.map} +0 -0
  345. /package/dist/{find-RBBYKXI7.js.map → find-QJPVK6CY.js.map} +0 -0
  346. /package/dist/{issue-RIVHSY2S.js.map → issue-QYCCTU4S.js.map} +0 -0
  347. /package/dist/{ledger-AETNF4OM.js.map → ledger-6EMFGJRU.js.map} +0 -0
  348. /package/dist/{liberate-GFN4C7RR.js.map → liberate-ZJDLMKOW.js.map} +0 -0
  349. /package/dist/{link-set-E5HNY67I.js.map → link-set-GUKFJQGW.js.map} +0 -0
  350. /package/dist/{managed-secret-CWQ6PND5.js.map → managed-secret-T6X4VHB2.js.map} +0 -0
  351. /package/dist/{noydb-FYTCH2GD.js.map → noydb-IP2QPER4.js.map} +0 -0
  352. /package/dist/{post-register-2XSSMGEQ.js.map → post-register-XKYJDDZL.js.map} +0 -0
  353. /package/dist/{register-4EFJCVYD.js.map → register-GFYFTV74.js.map} +0 -0
  354. /package/dist/{registry-4SDHHOJ7.js.map → registry-BY7Z54RJ.js.map} +0 -0
  355. /package/dist/{registry-CZVINVQH.js.map → registry-D6NSZUVQ.js.map} +0 -0
  356. /package/dist/{registry-IKUR2MXD.js.map → registry-KQPWMFIP.js.map} +0 -0
  357. /package/dist/{registry-OYTFGWVK.js.map → registry-P7RU4TPR.js.map} +0 -0
  358. /package/dist/{request-withdrawal-KGXGDPVQ.js.map → request-withdrawal-6RA6PGWD.js.map} +0 -0
  359. /package/dist/{reveal-BW36KCOQ.js.map → reveal-IN2ZBB5U.js.map} +0 -0
  360. /package/dist/{revoke-JFN773KF.js.map → revoke-ETYVUNHE.js.map} +0 -0
  361. /package/dist/{seed-GDV5PT4R.js.map → seed-D623RNG3.js.map} +0 -0
  362. /package/dist/{signer-TA55QB6R.js.map → signer-FLW4HHWM.js.map} +0 -0
  363. /package/dist/{stale-4PUTWI2H.js.map → stale-O3CZVYMO.js.map} +0 -0
  364. /package/dist/{storage-V7MTFAQJ.js.map → storage-7GVHLKVJ.js.map} +0 -0
  365. /package/dist/{store-coordination-provider-GFCUOBR6.js.map → store-coordination-provider-RKBDHHN4.js.map} +0 -0
  366. /package/dist/{verify-RO5RTZOJ.js.map → verify-GB7SBYC3.js.map} +0 -0
  367. /package/dist/{walk-3ZECBFDA.js.map → walk-77FSILOU.js.map} +0 -0
  368. /package/dist/{withdraw-accessible-7PG4DYQK.js.map → withdraw-accessible-XMWJWDZP.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/kernel/sync-policy.ts","../src/with-sync/strategy.ts"],"sourcesContent":["/**\n * Sync scheduling policy.\n *\n * ## What it controls\n *\n * A {@link SyncPolicy} has two halves:\n * - **push** ({@link PushPolicy}) — when dirty local writes are sent to the remote.\n * - **pull** ({@link PullPolicy}) — when the remote is polled for new data.\n *\n * ## Choosing a policy\n *\n * The right policy depends on the backend's operational characteristics:\n *\n * | Backend type | Recommended policy |\n * |---|---|\n * | Per-record (DynamoDB, S3, IDB) | {@link INDEXED_STORE_POLICY} — `on-change` push, `manual` pull |\n * | Bundle (Drive, WebDAV, Git) | {@link POD_STORE_POLICY} — `debounce` push, `interval` pull |\n *\n * Consumers can override via `createNoydb({ syncPolicy: { ... } })`:\n *\n * ```ts\n * const db = await createNoydb({\n * store: toFile({ dir: './data' }),\n * syncPolicy: {\n * push: { mode: 'debounce', debounceMs: 5_000 },\n * pull: { mode: 'on-focus' },\n * },\n * })\n * ```\n *\n * ## Scheduler lifecycle\n *\n * {@link SyncScheduler} owns all timers, debounce logic, and browser lifecycle\n * hooks (`visibilitychange`, `pagehide`, `beforeExit`). Call `scheduler.start()`\n * after opening a vault and `scheduler.stop()` when closing it. The scheduler\n * delegates actual push/pull work to {@link SyncSchedulerCallbacks} provided\n * by the {@link SyncEngine}.\n *\n * @module\n */\n\n// ─── Policy types ───────────────────────────────────────────────────────\n\n/**\n * When push operations are triggered automatically.\n *\n * - `'manual'` — only on explicit `sync.push()` calls.\n * - `'on-change'` — immediately after every local write (respecting `minIntervalMs`).\n * - `'debounce'` — after `debounceMs` of inactivity following a write.\n * - `'interval'` — on a fixed timer regardless of writes.\n */\nexport type PushMode = 'manual' | 'on-change' | 'debounce' | 'interval'\n\n/**\n * When pull operations are triggered automatically.\n *\n * - `'manual'` — only on explicit `sync.pull()` calls.\n * - `'interval'` — on a fixed `intervalMs` timer.\n * - `'on-focus'` — when the browser tab regains visibility.\n * - `'phased'` — pull the collections named in `sequence`, in order, one at a\n * time, then settle into steady state. For thin clients that need their\n * navigation-critical collections before bulk history.\n */\nexport type PullMode = 'manual' | 'interval' | 'on-focus' | 'phased'\n\n/**\n * Push half of a sync policy. Controls the trigger mode and timing guards\n * for outbound sync operations.\n */\nexport interface PushPolicy {\n /** Push trigger mode. */\n readonly mode: PushMode\n /** Debounce delay in ms. Only used when `mode: 'debounce'`. Default: 30_000. */\n readonly debounceMs?: number\n /** Interval in ms between automatic pushes. Used by `'interval'` and as floor for `'debounce'`. */\n readonly intervalMs?: number\n /**\n * Hard floor between pushes regardless of mode. Prevents burst writes\n * from hammering the remote. Default: 0 (no floor).\n */\n readonly minIntervalMs?: number\n /**\n * Force a push on page unload (`pagehide` / `visibilitychange → hidden`)\n * in browsers, `beforeExit` in Node. Default: true for non-manual modes.\n */\n readonly onUnload?: boolean\n}\n\n/**\n * Pull half of a sync policy. Controls when and how often inbound sync\n * operations are triggered.\n */\nexport interface PullPolicy {\n /** Pull trigger mode. */\n readonly mode: PullMode\n /**\n * Interval in ms between automatic pulls. Used by `'interval'` mode. Default: 60_000.\n * Under `'phased'` it is the steady-state cadence adopted *after* the sequence\n * completes; omit it to go idle instead.\n */\n readonly intervalMs?: number\n /**\n * Collection names to pull in order, one at a time. Required when\n * `mode: 'phased'` and rejected otherwise. Entries must be non-empty and\n * unique — without period narrowing a repeated collection can only be a\n * mistake, so it is rejected rather than silently merged.\n *\n * Period-scoped phases (`collection@period`) are deferred to `partitions`;\n * use `db.pull(vault, { periods })` explicitly meanwhile.\n */\n readonly sequence?: readonly string[]\n}\n\n/**\n * Combined push + pull sync scheduling policy for a vault.\n *\n * Pass via `createNoydb({ syncPolicy })` to override the default policy\n * derived from the active store type. Pre-built defaults are available\n * as `INDEXED_STORE_POLICY` and `POD_STORE_POLICY`.\n */\nexport interface SyncPolicy {\n readonly push: PushPolicy\n readonly pull: PullPolicy\n}\n\n// ─── Default policies by store category ─────────────────────────────────\n\n/** Default for per-record stores (DynamoDB, S3, file, IDB). */\nexport const INDEXED_STORE_POLICY: SyncPolicy = {\n push: { mode: 'on-change', minIntervalMs: 0, onUnload: true },\n pull: { mode: 'manual' },\n}\n\n/** Default for bundle stores (Drive, WebDAV, Git). */\nexport const POD_STORE_POLICY: SyncPolicy = {\n push: { mode: 'debounce', debounceMs: 30_000, minIntervalMs: 120_000, onUnload: true },\n pull: { mode: 'interval', intervalMs: 60_000 },\n}\n\n\n// ─── Sync scheduler ─────────────────────────────────────────────────────\n\n/**\n * Current operational state of the `SyncScheduler`.\n *\n * - `'idle'` — no pending or active sync operations.\n * - `'pending'` — local writes are queued, waiting for debounce/interval to fire.\n * - `'pushing'` — push in progress.\n * - `'pulling'` — pull in progress.\n * - `'error'` — last sync operation failed; `lastError` holds the cause.\n */\nexport type SyncSchedulerState = 'idle' | 'pending' | 'pushing' | 'pulling' | 'error'\n\n/**\n * How much of a collection a caller may rely on, under a `'phased'` pull.\n *\n * - `'cold'` — not pulled yet, or its phase did not complete cleanly. A miss\n * from `get()` proves nothing.\n * - `'pulling'` — its phase is in flight. Never terminal: a phase always ends\n * in `'live'` or back in `'cold'`, because a stuck `'pulling'` would leave a\n * permanent skeleton in the UI.\n * - `'live'` — its phase completed cleanly, so a miss is a real absence.\n */\nexport type ReadinessState = 'cold' | 'pulling' | 'live'\n\n/**\n * What a scheduler-initiated pull achieved, as reported by the callback.\n *\n * `'incomplete'` covers both a pull that reported errors (`PullResult.errors`\n * accumulates without throwing) and one that was skipped — e.g. role-gated on a\n * backup target. Either way nothing may be claimed about completeness.\n */\nexport type PullPhaseOutcome = 'complete' | 'incomplete'\n\n/**\n * Snapshot of the sync scheduler's state, returned by `SyncScheduler.status`.\n * Safe to expose in a reactive UI status indicator.\n */\nexport interface SyncSchedulerStatus {\n readonly state: SyncSchedulerState\n readonly lastPushAt: string | null\n readonly lastPullAt: string | null\n readonly lastError: Error | null\n readonly pendingWrites: number\n /**\n * Per-collection readiness. Empty unless `pull.mode === 'phased'`.\n *\n * A collection the sequence never names is **absent** from the map, and\n * `undefined` means *\"no claim made\"* — never a reason to gate a UI.\n */\n readonly readiness: ReadonlyMap<string, ReadinessState>\n /** 1-based position in the sequence, or `null` outside a phased run. */\n readonly phase: { readonly index: number; readonly total: number } | null\n}\n\n/**\n * Callbacks injected into `SyncScheduler` by the SyncEngine.\n *\n * The scheduler owns timers and lifecycle hooks; it delegates actual push/pull\n * work to these callbacks to stay decoupled from the sync implementation.\n */\nexport interface SyncSchedulerCallbacks {\n push(): Promise<void>\n /**\n * @param collections - Narrow the pull to these collections. Passed by a\n * `'phased'` sequence, one collection per phase; omitted for a whole-vault pull.\n * @returns Whether the pull may be treated as complete. Returning `void` reads\n * as `'complete'`, so callers with nothing to report need not opt in.\n */\n pull(collections?: readonly string[]): Promise<PullPhaseOutcome | void>\n getDirtyCount(): number\n}\n\n/**\n * Reject a policy that cannot mean anything, at construction rather than on\n * the first tick. Module-private: `SyncScheduler` is the choke point every\n * policy that can actually schedule must pass through — primary and per-target\n * alike — so validating here needs no new public surface and costs the kernel\n * floor nothing.\n */\nfunction validatePullPolicy(pull: PullPolicy): void {\n if (pull.mode !== 'phased') {\n if (pull.sequence !== undefined) {\n throw new Error(\n `syncPolicy.pull.sequence is only meaningful with mode: 'phased' (got '${pull.mode}'). ` +\n `Set mode: 'phased' to run the sequence, or drop the field.`,\n )\n }\n return\n }\n\n const { sequence } = pull\n if (!sequence || sequence.length === 0) {\n throw new Error(\n `syncPolicy.pull.mode: 'phased' requires a non-empty 'sequence' of collection names.`,\n )\n }\n for (const name of sequence) {\n if (typeof name !== 'string' || name.length === 0) {\n throw new Error(\n `syncPolicy.pull.sequence entries must be non-empty collection names (got ${JSON.stringify(name)}).`,\n )\n }\n }\n const duplicate = sequence.find((name, i) => sequence.indexOf(name) !== i)\n if (duplicate !== undefined) {\n throw new Error(\n `syncPolicy.pull.sequence lists \"${duplicate}\" more than once. ` +\n `Each collection is pulled whole, so a repeat does no additional work.`,\n )\n }\n}\n\n/**\n * Manages sync timing according to a `SyncPolicy`.\n *\n * The scheduler owns all timers and lifecycle hooks. It delegates actual\n * push/pull work to callbacks provided by the SyncEngine.\n */\nexport class SyncScheduler {\n private readonly policy: SyncPolicy\n private readonly callbacks: SyncSchedulerCallbacks\n\n private _state: SyncSchedulerState = 'idle'\n private _lastPushAt: string | null = null\n private _lastPullAt: string | null = null\n private _lastError: Error | null = null\n private _lastPushTime = 0 // monotonic ms for minIntervalMs enforcement\n\n // Phased-pull progress. Empty for every other mode, so non-adopters carry\n // an empty Map and a null — no per-read cost, nothing to interpret.\n private readonly _readiness = new Map<string, ReadinessState>()\n private _phase: { readonly index: number; readonly total: number } | null = null\n\n // Timers\n private debounceTimer: ReturnType<typeof setTimeout> | null = null\n private pushIntervalTimer: ReturnType<typeof setInterval> | null = null\n private pullIntervalTimer: ReturnType<typeof setInterval> | null = null\n\n // Bound handlers for cleanup\n private readonly boundOnVisibilityChange: (() => void) | null = null\n private readonly boundOnBeforeExit: (() => void) | null = null\n private readonly boundOnPageHide: (() => void) | null = null\n\n private started = false\n\n constructor(policy: SyncPolicy, callbacks: SyncSchedulerCallbacks) {\n validatePullPolicy(policy.pull)\n this.policy = policy\n this.callbacks = callbacks\n\n // Pre-bind handlers\n if (this.shouldRegisterUnload()) {\n this.boundOnVisibilityChange = this.handleVisibilityChange.bind(this)\n this.boundOnPageHide = this.handlePageHide.bind(this)\n this.boundOnBeforeExit = this.handleBeforeExit.bind(this)\n }\n }\n\n /** Current scheduler status snapshot. */\n get status(): SyncSchedulerStatus {\n return {\n state: this._state,\n lastPushAt: this._lastPushAt,\n lastPullAt: this._lastPullAt,\n lastError: this._lastError,\n pendingWrites: this.callbacks.getDirtyCount(),\n // Copied, not aliased — a status snapshot must not mutate under its reader.\n readiness: new Map(this._readiness),\n phase: this._phase,\n }\n }\n\n /** Start the scheduler — registers timers, event listeners. */\n start(): void {\n if (this.started) return\n this.started = true\n\n // Push: interval mode\n if (this.policy.push.mode === 'interval' && this.policy.push.intervalMs) {\n this.pushIntervalTimer = setInterval(() => {\n void this.executePush()\n }, this.policy.push.intervalMs)\n }\n\n // Pull: interval mode\n if (this.policy.pull.mode === 'interval') {\n this.startPullInterval()\n }\n\n // Pull: phased mode — walk the sequence in order, then settle into steady\n // state. Unawaited by design: start() is synchronous and the caller\n // (vault open) must not block on a bootstrap pull.\n if (this.policy.pull.mode === 'phased') {\n const sequence = this.policy.pull.sequence ?? []\n // Every named collection is 'cold' from the moment we start, so a reader\n // that races the first phase sees \"not ready\", never a missing entry.\n for (const collection of sequence) this._readiness.set(collection, 'cold')\n void this.runSequence(sequence)\n }\n\n // Pull: on-focus mode\n if (this.policy.pull.mode === 'on-focus' && typeof document !== 'undefined') {\n document.addEventListener('visibilitychange', this.handleFocusPull)\n }\n\n // Unload hooks\n if (this.shouldRegisterUnload()) {\n if (typeof document !== 'undefined' && this.boundOnVisibilityChange) {\n document.addEventListener('visibilitychange', this.boundOnVisibilityChange)\n }\n if (typeof globalThis.addEventListener === 'function' && this.boundOnPageHide) {\n globalThis.addEventListener('pagehide', this.boundOnPageHide)\n }\n if (typeof process !== 'undefined' && this.boundOnBeforeExit) {\n process.on('beforeExit', this.boundOnBeforeExit)\n }\n }\n }\n\n /** Stop the scheduler — clears timers, removes event listeners. */\n stop(): void {\n if (!this.started) return\n this.started = false\n\n // A sequence cut mid-phase must not leave that collection 'pulling' —\n // a reader would show a skeleton that never resolves.\n for (const [collection, state] of this._readiness) {\n if (state === 'pulling') this._readiness.set(collection, 'cold')\n }\n this._phase = null\n\n if (this.debounceTimer) {\n clearTimeout(this.debounceTimer)\n this.debounceTimer = null\n }\n if (this.pushIntervalTimer) {\n clearInterval(this.pushIntervalTimer)\n this.pushIntervalTimer = null\n }\n if (this.pullIntervalTimer) {\n clearInterval(this.pullIntervalTimer)\n this.pullIntervalTimer = null\n }\n\n // Focus pull\n if (this.policy.pull.mode === 'on-focus' && typeof document !== 'undefined') {\n document.removeEventListener('visibilitychange', this.handleFocusPull)\n }\n\n // Unload hooks\n if (typeof document !== 'undefined' && this.boundOnVisibilityChange) {\n document.removeEventListener('visibilitychange', this.boundOnVisibilityChange)\n }\n if (typeof globalThis.removeEventListener === 'function' && this.boundOnPageHide) {\n globalThis.removeEventListener('pagehide', this.boundOnPageHide)\n }\n if (typeof process !== 'undefined' && this.boundOnBeforeExit) {\n process.removeListener('beforeExit', this.boundOnBeforeExit)\n }\n }\n\n /**\n * Notify the scheduler that a local write occurred.\n * For `on-change` mode: triggers immediate push (respecting minIntervalMs).\n * For `debounce` mode: resets the debounce timer.\n * For `manual` / `interval`: no-op.\n */\n notifyChange(): void {\n if (!this.started) return\n\n if (this.policy.push.mode === 'on-change') {\n void this.executePush()\n } else if (this.policy.push.mode === 'debounce') {\n this.resetDebounce()\n }\n }\n\n /** Force an immediate push, bypassing the scheduler. */\n async forcePush(): Promise<void> {\n await this.executePush()\n }\n\n /** Force an immediate pull, bypassing the scheduler. */\n async forcePull(): Promise<void> {\n await this.executePull()\n }\n\n // ─── Internal ─────────────────────────────────────────────────────\n\n /**\n * Arm the steady-state pull timer, if the policy specifies a cadence.\n * Shared by `'interval'` mode and by `'phased'` once its sequence drains.\n */\n private startPullInterval(): void {\n if (this.pullIntervalTimer || !this.policy.pull.intervalMs) return\n this.pullIntervalTimer = setInterval(() => {\n void this.executePull()\n }, this.policy.pull.intervalMs)\n }\n\n /**\n * Pull each collection in turn, then hand over to steady state.\n *\n * Strictly sequential — running phases concurrently would defeat the\n * prioritisation that is the entire point of a sequence. Each phase is an\n * ordinary scoped pull, so a phase that reports errors does not abort the\n * ones behind it; `executePull` records the failure and the walk continues.\n * `started` is re-checked between phases so `stop()` cuts a sequence short\n * instead of letting it run on against a closed vault.\n */\n private async runSequence(sequence: readonly string[]): Promise<void> {\n for (const [i, collection] of sequence.entries()) {\n if (!this.started) return\n this._readiness.set(collection, 'pulling')\n this._phase = { index: i + 1, total: sequence.length }\n\n const outcome = await this.executePull([collection])\n\n // 'live' only on a clean phase. Anything else — reported errors, a\n // role-gated skip, a throw — goes back to 'cold', because 'live' is a\n // promise that a miss from get() is a real absence.\n this._readiness.set(collection, outcome === 'complete' ? 'live' : 'cold')\n }\n this._phase = null\n if (this.started) this.startPullInterval()\n }\n\n private async executePush(): Promise<void> {\n if (this._state === 'pushing') return // already in progress\n\n // minIntervalMs enforcement\n const minInterval = this.policy.push.minIntervalMs ?? 0\n if (minInterval > 0) {\n const elapsed = Date.now() - this._lastPushTime\n if (elapsed < minInterval) {\n // Schedule for later if debounce mode\n if (this.policy.push.mode === 'debounce') {\n this.scheduleDebounce(minInterval - elapsed)\n }\n return\n }\n }\n\n // Nothing to push\n if (this.callbacks.getDirtyCount() === 0) {\n this._state = 'idle'\n return\n }\n\n this._state = 'pushing'\n try {\n await this.callbacks.push()\n this._lastPushAt = new Date().toISOString()\n this._lastPushTime = Date.now()\n this._lastError = null\n this._state = this.callbacks.getDirtyCount() > 0 ? 'pending' : 'idle'\n } catch (err) {\n this._lastError = err instanceof Error ? err : new Error(String(err))\n this._state = 'error'\n }\n }\n\n private async executePull(collections?: readonly string[]): Promise<PullPhaseOutcome> {\n if (this._state === 'pulling') return 'incomplete'\n\n const previousState = this._state\n this._state = 'pulling'\n try {\n const outcome = await this.callbacks.pull(collections)\n this._lastPullAt = new Date().toISOString()\n this._lastError = null\n this._state = previousState === 'pending' ? 'pending' : 'idle'\n return outcome ?? 'complete'\n } catch (err) {\n this._lastError = err instanceof Error ? err : new Error(String(err))\n this._state = 'error'\n return 'incomplete'\n }\n }\n\n private resetDebounce(): void {\n if (this.debounceTimer) clearTimeout(this.debounceTimer)\n const ms = this.policy.push.debounceMs ?? 30_000\n this._state = 'pending'\n this.scheduleDebounce(ms)\n }\n\n private scheduleDebounce(ms: number): void {\n if (this.debounceTimer) clearTimeout(this.debounceTimer)\n this.debounceTimer = setTimeout(() => {\n this.debounceTimer = null\n void this.executePush()\n }, ms)\n }\n\n private shouldRegisterUnload(): boolean {\n const onUnload = this.policy.push.onUnload\n if (onUnload !== undefined) return onUnload\n return this.policy.push.mode !== 'manual'\n }\n\n // ─── Event handlers ───────────────────────────────────────────────\n\n private handleVisibilityChange(): void {\n if (typeof document !== 'undefined' && document.visibilityState === 'hidden') {\n this.fireUnloadPush()\n }\n }\n\n private handlePageHide(): void {\n this.fireUnloadPush()\n }\n\n private handleBeforeExit(): void {\n this.fireUnloadPush()\n }\n\n private handleFocusPull = (): void => {\n if (typeof document !== 'undefined' && document.visibilityState === 'visible') {\n void this.executePull()\n }\n }\n\n private fireUnloadPush(): void {\n if (this.callbacks.getDirtyCount() === 0) return\n // Best-effort synchronous-ish push on unload\n void this.callbacks.push().catch(() => {})\n }\n}\n","/**\n * Strategy seam for the optional sync engine + presence service.\n * Core imports `SyncStrategy` type-only + `NO_SYNC` stub; the real\n * `SyncEngine`, `SyncTransaction`, and `PresenceHandle` constructors\n * are only reachable via `withSync()` in `./sync-active.ts`.\n *\n * Solo apps that never configure `sync` and never call\n * `collection.presence()` ship none of the ~856 LOC behind this seam\n * (`sync.ts` + `sync-transaction.ts` + `presence.ts`).\n *\n * Note: `keyring.ts` (~746 LOC) stays in core because it's required\n * for any multi-user vault — even single-owner vaults use a keyring\n * to wrap the DEK. The team package's grant/revoke/magic-link/\n * delegation modules tree-shake naturally via direct named imports.\n *\n * Behavior under NO_SYNC:\n *\n * - **buildSyncEngine** — throws. Only fires when `createNoydb({ sync })`\n * passes a remote target.\n * - **buildSyncTransaction** — throws. Only fires when `db.transaction(vault)`\n * is called on a vault with sync configured.\n * - **buildPresence** — throws. Only fires when user code calls\n * `collection.presence()`.\n *\n * @internal\n */\n\nimport type {\n NoydbStore,\n ConflictStrategy,\n SyncTargetRole,\n} from '../kernel/types.js'\nimport type { NoydbEventEmitter } from '../kernel/events.js'\nimport type { SyncPolicy } from '../kernel/sync-policy.js'\nimport type { SyncEngine } from './engine.js'\nimport type { SyncTransaction } from './transaction.js'\nimport type { PresenceHandle, PresenceHandleOpts } from './presence.js'\nimport type { Vault } from '../kernel/vault.js'\n\n/**\n * Options accepted by `SyncStrategy.buildSyncEngine`. Mirrors the\n * `SyncEngine` constructor verbatim — kept here so core code never\n * imports the sync module at runtime.\n *\n * @internal\n */\nexport interface BuildSyncEngineOptions {\n local: NoydbStore\n remote: NoydbStore\n vault: string\n strategy: ConflictStrategy\n emitter: NoydbEventEmitter\n syncPolicy?: SyncPolicy\n role?: SyncTargetRole\n label?: string\n}\n\n/**\n * @internal\n */\nexport interface SyncStrategy {\n buildSyncEngine(opts: BuildSyncEngineOptions): SyncEngine\n buildSyncTransaction(vault: Vault, engine: SyncEngine): SyncTransaction\n buildPresence<P>(opts: PresenceHandleOpts): PresenceHandle<P>\n}\n\nfunction notEnabled(op: string): Error {\n return new Error(\n `${op} requires the sync strategy. Import ` +\n '`{ withSync }` from \"@noy-db/hub/sync\" and pass it to ' +\n '`createNoydb({ syncStrategy: withSync() })`.',\n )\n}\n\n/**\n * No-sync stub. Every constructor throws with an actionable pointer\n * — there is no useful \"off\" mode for sync engine / presence /\n * sync-transaction; if the consumer reached one of these surfaces,\n * they intended to use it.\n *\n * @internal\n */\nexport const NO_SYNC: SyncStrategy = {\n buildSyncEngine() { throw notEnabled('SyncEngine') },\n buildSyncTransaction() { throw notEnabled('SyncTransaction') },\n buildPresence() { throw notEnabled('collection.presence()') },\n}\n"],"mappings":";AAgIO,IAAM,uBAAmC;AAAA,EAC9C,MAAM,EAAE,MAAM,aAAa,eAAe,GAAG,UAAU,KAAK;AAAA,EAC5D,MAAM,EAAE,MAAM,SAAS;AACzB;AAGO,IAAM,mBAA+B;AAAA,EAC1C,MAAM,EAAE,MAAM,YAAY,YAAY,KAAQ,eAAe,MAAS,UAAU,KAAK;AAAA,EACrF,MAAM,EAAE,MAAM,YAAY,YAAY,IAAO;AAC/C;AAmFA,SAAS,mBAAmB,MAAwB;AAClD,MAAI,KAAK,SAAS,UAAU;AAC1B,QAAI,KAAK,aAAa,QAAW;AAC/B,YAAM,IAAI;AAAA,QACR,yEAAyE,KAAK,IAAI;AAAA,MAEpF;AAAA,IACF;AACA;AAAA,EACF;AAEA,QAAM,EAAE,SAAS,IAAI;AACrB,MAAI,CAAC,YAAY,SAAS,WAAW,GAAG;AACtC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,aAAW,QAAQ,UAAU;AAC3B,QAAI,OAAO,SAAS,YAAY,KAAK,WAAW,GAAG;AACjD,YAAM,IAAI;AAAA,QACR,4EAA4E,KAAK,UAAU,IAAI,CAAC;AAAA,MAClG;AAAA,IACF;AAAA,EACF;AACA,QAAM,YAAY,SAAS,KAAK,CAAC,MAAM,MAAM,SAAS,QAAQ,IAAI,MAAM,CAAC;AACzE,MAAI,cAAc,QAAW;AAC3B,UAAM,IAAI;AAAA,MACR,mCAAmC,SAAS;AAAA,IAE9C;AAAA,EACF;AACF;AAQO,IAAM,gBAAN,MAAoB;AAAA,EACR;AAAA,EACA;AAAA,EAET,SAA6B;AAAA,EAC7B,cAA6B;AAAA,EAC7B,cAA6B;AAAA,EAC7B,aAA2B;AAAA,EAC3B,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAIP,aAAa,oBAA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unk-IGJCYUT5.js";
4
4
  import {
5
5
  installViaBinder
6
- } from "./chunk-UHXCLPGC.js";
6
+ } from "./chunk-7DK6CYXO.js";
7
7
  import {
8
8
  NoydbError,
9
9
  ValidationError
10
- } from "./chunk-HNGSV2YC.js";
10
+ } from "./chunk-CT35TQV7.js";
11
11
 
12
12
  // src/via/money/iso4217.ts
13
13
  var MINOR_UNITS = {
@@ -1044,4 +1044,4 @@ export {
1044
1044
  decodeMoneyFields,
1045
1045
  exactMath
1046
1046
  };
1047
- //# sourceMappingURL=chunk-RXYYFSBB.js.map
1047
+ //# sourceMappingURL=chunk-JTZRLD47.js.map
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  createNoydb
3
- } from "./chunk-UV4O7FAL.js";
3
+ } from "./chunk-AS53PYO6.js";
4
4
  import {
5
5
  deriveSchemaManifest
6
- } from "./chunk-2DHSSLOD.js";
6
+ } from "./chunk-SX2ZKKZS.js";
7
7
  import {
8
8
  loadFence
9
- } from "./chunk-6BU3L4UE.js";
9
+ } from "./chunk-GGM3JCEG.js";
10
10
  import {
11
11
  readPod,
12
12
  readPodRedirect,
13
13
  signRecord,
14
14
  verifyPodHeader,
15
15
  verifyRecord
16
- } from "./chunk-4VUPLMZ6.js";
16
+ } from "./chunk-GAELDPIH.js";
17
17
  import {
18
18
  loadKeyring
19
- } from "./chunk-JRKZTEZZ.js";
19
+ } from "./chunk-CFM6GBNF.js";
20
20
  import {
21
21
  ConflictError,
22
22
  MigrationRequiredError,
@@ -26,7 +26,7 @@ import {
26
26
  RedirectDepthExceededError,
27
27
  RedirectLoopError,
28
28
  RedirectUnreachableError
29
- } from "./chunk-HNGSV2YC.js";
29
+ } from "./chunk-CT35TQV7.js";
30
30
 
31
31
  // src/with-pod/pod-store.ts
32
32
  var BUNDLE_STORE_VERSION = 1;
@@ -192,8 +192,6 @@ function mergeSnapshots(remote, local) {
192
192
  function createPodStore(factory) {
193
193
  return factory;
194
194
  }
195
- var wrapBundleStore = wrapPodStore;
196
- var createBundleStore = createPodStore;
197
195
 
198
196
  // src/with-pod/redirect.ts
199
197
  async function signRedirect(signer, fields) {
@@ -283,11 +281,9 @@ async function open(podFileOrBytes, opts) {
283
281
  export {
284
282
  wrapPodStore,
285
283
  createPodStore,
286
- wrapBundleStore,
287
- createBundleStore,
288
284
  signRedirect,
289
285
  verifyRedirect,
290
286
  followRedirects,
291
287
  open
292
288
  };
293
- //# sourceMappingURL=chunk-CCVYQFLU.js.map
289
+ //# sourceMappingURL=chunk-KMLMEIWV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-pod/pod-store.ts","../src/with-pod/redirect.ts","../src/with-pod/open.ts"],"sourcesContent":["import type { NoydbStore, NoydbPodStore, VaultSnapshot, EncryptedEnvelope } from '../kernel/types.js'\nimport { ConflictError, PodVersionConflictError } from '../kernel/errors.js'\n\n// ─── Bundle format ─────────────────────────────────────────────────────\n\nconst BUNDLE_STORE_VERSION = 1 as const\n\n/**\n * Wire format written by `wrapPodStore`. A JSON-serialised object that\n * contains the entire `VaultSnapshot` (all encrypted envelopes) plus a small\n * header for integrity checking. The envelopes inside are already AES-GCM\n * encrypted by core — the bundle bytes themselves are not additionally\n * encrypted, but they are safe to store on untrusted blob hosts because\n * every record inside is already ciphertext.\n *\n * @internal\n */\ninterface BundleStoreData {\n readonly _noydb_bundle_store: typeof BUNDLE_STORE_VERSION\n readonly vault: string\n readonly ts: string\n readonly data: VaultSnapshot\n}\n\n// ─── Options ───────────────────────────────────────────────────────────\n\nexport interface WrapPodStoreOptions {\n /**\n * When `true` (default), every `put()` and `delete()` flushes the full\n * vault snapshot to the bundle backend. Set to `false` for bulk operations\n * and call `store.flush(vaultId)` manually.\n */\n autoFlush?: boolean\n}\n\n// ─── Extended NoydbStore with flush/batch ───────────────────────────────\n\nexport interface WrappedPodNoydbStore extends NoydbStore {\n /** Manually flush the in-memory snapshot to the bundle backend. */\n flush(vaultId: string): Promise<void>\n /**\n * Run a batch of mutations without flushing until the callback completes.\n * A single flush is performed at the end.\n */\n batch(vaultId: string, fn: () => Promise<void>): Promise<void>\n}\n\n// ─── wrapPodStore ───────────────────────────────────────────────────\n\nconst MAX_CONFLICT_RETRIES = 3\n\n/**\n * Convert a `NoydbPodStore` (blob-oriented read/write with OCC) into the\n * standard six-method `NoydbStore` interface expected by `createNoydb({ store })`.\n *\n * Bundle stores operate on the entire vault as a single serialised unit —\n * ideal for backends like Google Drive, WebDAV, or iCloud Drive that work\n * best with whole-file I/O rather than per-record KV operations.\n *\n * ## Optimistic concurrency\n *\n * The wrapper tracks the `version` token from the last `readBundle` and\n * passes it as `expectedVersion` on every flush. On\n * `PodVersionConflictError`, it re-reads, merges the remote snapshot\n * (last-write-wins per record key), and retries (max 3 attempts).\n *\n * ## Flush modes\n *\n * By default, flushes on every mutation (O(vault size) per write). Options:\n * - `autoFlush: false` + explicit `store.flush(vaultId)` calls\n * - `store.batch(vaultId, async () => { ... })` — defers flush until end\n * - Pair with `syncPolicy: { push: { mode: 'debounce' } }` from \n */\nexport function wrapPodStore(\n bundle: NoydbPodStore,\n options?: WrapPodStoreOptions,\n): WrappedPodNoydbStore {\n const autoFlush = options?.autoFlush !== false\n\n // Per-vault state\n const snapshots = new Map<string, VaultSnapshot>()\n const versions = new Map<string, string | null>()\n const loaded = new Set<string>()\n\n // Batch mode: when > 0, suppress auto-flush\n let batchDepth = 0\n\n // #908 — in-flight loads, keyed by vault. Without this, every concurrent\n // caller issued its own `readBundle` and then REPLACED `snapshots` with a\n // freshly parsed object — orphaning the mutations earlier callers had\n // already made to the object they were handed. 100 racing puts kept 1.\n const loading = new Map<string, Promise<VaultSnapshot>>()\n\n async function load(vault: string): Promise<VaultSnapshot> {\n if (loaded.has(vault)) return snapshots.get(vault)!\n\n const inFlight = loading.get(vault)\n if (inFlight) return inFlight\n\n const pending = (async () => {\n const result = await bundle.readBundle(vault)\n if (result) {\n const text = new TextDecoder().decode(result.bytes)\n const format = JSON.parse(text) as BundleStoreData\n snapshots.set(vault, format.data)\n versions.set(vault, result.version)\n } else {\n snapshots.set(vault, {})\n versions.set(vault, null)\n }\n\n loaded.add(vault)\n return snapshots.get(vault)!\n })()\n\n loading.set(vault, pending)\n try {\n return await pending\n } finally {\n // Clear on failure too, so a transient read error does not poison\n // every later load of this vault with a rejected promise.\n loading.delete(vault)\n }\n }\n\n async function flush(vault: string): Promise<void> {\n const snapshot = snapshots.get(vault) ?? {}\n const format: BundleStoreData = {\n _noydb_bundle_store: BUNDLE_STORE_VERSION,\n vault,\n ts: new Date().toISOString(),\n data: snapshot,\n }\n const bytes = new TextEncoder().encode(JSON.stringify(format))\n const expectedVersion = versions.get(vault) ?? null\n\n for (let attempt = 0; attempt < MAX_CONFLICT_RETRIES; attempt++) {\n try {\n const { version: newVersion } = await bundle.writeBundle(vault, bytes, expectedVersion)\n versions.set(vault, newVersion)\n return\n } catch (err) {\n if (err instanceof PodVersionConflictError && attempt < MAX_CONFLICT_RETRIES - 1) {\n // Pull remote, merge (last-write-wins by record key), retry\n const remote = await bundle.readBundle(vault)\n if (remote) {\n const remoteText = new TextDecoder().decode(remote.bytes)\n const remoteFormat = JSON.parse(remoteText) as BundleStoreData\n const localSnap = snapshots.get(vault) ?? {}\n const mergedSnap = mergeSnapshots(remoteFormat.data, localSnap)\n snapshots.set(vault, mergedSnap)\n versions.set(vault, remote.version)\n }\n // Re-encode with merged data for the retry\n continue\n }\n throw err\n }\n }\n }\n\n // #908 — one flush at a time per vault. `flush` reads and writes the vault's\n // version token, so concurrent flushes race: each sends the same\n // `expectedVersion`, the losers take the conflict/merge path, and with enough\n // of them the retry budget is exhausted and the error surfaces to a caller\n // whose write was perfectly valid. Serialising makes every flush see the\n // token its predecessor produced.\n const flushChain = new Map<string, Promise<void>>()\n\n function serialFlush(vault: string): Promise<void> {\n const prev = flushChain.get(vault) ?? Promise.resolve()\n // Chain past a rejection as well — one failed flush must not wedge every\n // subsequent write to this vault.\n const next = prev.then(() => flush(vault), () => flush(vault))\n flushChain.set(vault, next)\n return next\n }\n\n async function maybeFlush(vault: string): Promise<void> {\n if (autoFlush && batchDepth === 0) {\n await serialFlush(vault)\n }\n }\n\n const store: WrappedPodNoydbStore = {\n name: bundle.name ?? 'bundle',\n\n async flush(vaultId: string): Promise<void> {\n await serialFlush(vaultId)\n },\n\n async batch(vaultId: string, fn: () => Promise<void>): Promise<void> {\n await load(vaultId) // ensure loaded before batch\n batchDepth++\n try {\n await fn()\n } finally {\n batchDepth--\n }\n await serialFlush(vaultId)\n },\n\n async get(vault: string, collection: string, id: string): Promise<EncryptedEnvelope | null> {\n const snap = await load(vault)\n return snap[collection]?.[id] ?? null\n },\n\n async put(\n vault: string,\n collection: string,\n id: string,\n envelope: EncryptedEnvelope,\n expectedVersion?: number,\n ): Promise<void> {\n const snap = await load(vault)\n\n if (expectedVersion !== undefined) {\n const current = snap[collection]?.[id]\n const currentVersion = current?._v ?? 0\n if (currentVersion !== expectedVersion) {\n throw new ConflictError(\n currentVersion,\n `Expected version ${expectedVersion} but found ${currentVersion} on ${collection}/${id}`,\n )\n }\n }\n\n snap[collection] ??= {}\n snap[collection][id] = envelope\n await maybeFlush(vault)\n },\n\n async delete(vault: string, collection: string, id: string): Promise<void> {\n const snap = await load(vault)\n if (snap[collection]) {\n delete snap[collection][id]\n await maybeFlush(vault)\n }\n },\n\n async list(vault: string, collection: string): Promise<string[]> {\n const snap = await load(vault)\n return Object.keys(snap[collection] ?? {})\n },\n\n async loadAll(vault: string): Promise<VaultSnapshot> {\n const snap = await load(vault)\n // #908 — two contract fixes in one place:\n // 1. internal collections (`_keyring`, `_sync`) are the vault's own\n // bookkeeping and must not appear in a snapshot — `@noy-db/to-file`\n // sets the reference behaviour with this same `_`-prefix rule;\n // 2. copy rather than hand out the live cache, which let a caller\n // mutating the result silently rewrite the wrapper's own state.\n // `get()`/`list()` still serve internal collections; this is about what\n // a *snapshot* claims, not about hiding data.\n const out: VaultSnapshot = {}\n for (const [collection, records] of Object.entries(snap)) {\n if (collection.startsWith('_')) continue\n out[collection] = { ...records }\n }\n return out\n },\n\n async saveAll(vault: string, data: VaultSnapshot): Promise<void> {\n snapshots.set(vault, data)\n loaded.add(vault)\n await serialFlush(vault)\n },\n }\n\n return store\n}\n\n// ─── Snapshot merge (last-write-wins per record) ────────────────────────\n\nfunction mergeSnapshots(remote: VaultSnapshot, local: VaultSnapshot): VaultSnapshot {\n const merged: VaultSnapshot = {}\n\n // Start with all remote collections\n for (const [coll, records] of Object.entries(remote)) {\n merged[coll] = { ...records }\n }\n\n // Overlay local collections — LWW by _ts per record\n for (const [coll, records] of Object.entries(local)) {\n if (!merged[coll]) {\n merged[coll] = { ...records }\n continue\n }\n for (const [id, envelope] of Object.entries(records)) {\n const existing = merged[coll][id]\n if (!existing || envelope._ts >= existing._ts) {\n merged[coll][id] = envelope\n }\n }\n }\n\n return merged\n}\n\n// ─── Factory helper ─────────────────────────────────────────────────────\n\n/**\n * Type-safe factory helper for `NoydbPodStore` implementations,\n * analogous to `createStore` for KV stores.\n */\nexport function createPodStore<TOptions>(\n factory: (options: TOptions) => NoydbPodStore,\n): (options: TOptions) => NoydbPodStore {\n return factory\n}\n\n// ─── Deprecated aliases (pre-rename compatibility) ──────────────────────\n\n","/**\n * Redirect record (#944) — a signed \"this moved, go there\" pointer carried\n * in the pod's PLAINTEXT header (`NoydbPodHeader.redirect`, see\n * `format.ts`) so a dispatcher can follow it pre-auth: no secret, no\n * decompression.\n *\n * The record carries its OWN inner `sig` (via `signRecord`/`verifyRecord`\n * from `signature.ts`) — independent from, and in addition to, the #943\n * pod-header signature. A Redirect is REQUIRED to be signed: there is no\n * legacy unsigned install base for this new record type, so an absent or\n * invalid signature is invalid for following, not merely \"unverified\".\n *\n * Minimum-disclosure: the record is kept to exactly\n * `{ v, target, reason, issuedBy, sig }` — no timestamps, no identities\n * beyond the signer's `keyId` fingerprint.\n */\n\nimport type { DocSigner } from '../with-audit/attestation/signer.js'\nimport { signRecord, verifyRecord } from './signature.js'\nimport { readPodRedirect } from './bundle.js'\nimport {\n RedirectBadSignatureError,\n RedirectDepthExceededError,\n RedirectLoopError,\n RedirectUnreachableError,\n} from '../kernel/errors.js'\n\n/**\n * A signed pointer to another pod. `target` is a locator string or URL —\n * the forthcoming #945 `Locator` type isn't built yet, so `target` stays a\n * plain string for now (forward-seam noted, not blurred: a Redirect says\n * \"go elsewhere once\"; a Locator will say \"where cargo lives\").\n */\nexport interface Redirect {\n readonly v: 1\n readonly target: string\n readonly reason: 'moved' | 'release' | 'tombstone' | 'repoint'\n readonly issuedBy: string\n readonly sig: string\n}\n\n/**\n * Sign a new Redirect record with `signer`. Builds the record minus `sig`,\n * signs it via the #943 `signRecord` convention, and returns the complete\n * signed record.\n */\nexport async function signRedirect(\n signer: DocSigner,\n fields: { readonly target: string; readonly reason: Redirect['reason'] },\n): Promise<Redirect> {\n const record = {\n v: 1 as const,\n target: fields.target,\n reason: fields.reason,\n issuedBy: signer.keyId,\n }\n const sig = await signRecord(signer.privateKeyPkcs8B64, record)\n return { ...record, sig }\n}\n\n/**\n * Verify a Redirect record's signature against `trustedKeys`\n * (`keyId → publicKeyB64`). Fails closed: an `issuedBy` not present in\n * `trustedKeys` is untrusted/unverifiable and returns `false`, same as a\n * tampered or forged signature.\n */\nexport async function verifyRedirect(\n record: Redirect,\n trustedKeys: Readonly<Record<string, string>>,\n): Promise<boolean> {\n const publicKeyB64 = trustedKeys[record.issuedBy]\n if (publicKeyB64 === undefined) return false\n const payload = { v: record.v, target: record.target, reason: record.reason, issuedBy: record.issuedBy }\n return verifyRecord(publicKeyB64, record.sig, payload)\n}\n\n/** One followed hop's provenance — surfaced so a UI can show \"moved from X via Y\". */\nexport interface RedirectHop {\n readonly target: string\n readonly reason: Redirect['reason']\n readonly issuedBy: string\n}\n\n/** Result of {@link followRedirects}: the terminal (non-redirect) pod's bytes, plus the ordered hop list that led there. */\nexport interface FollowRedirectsResult {\n readonly terminal: Uint8Array\n readonly hops: readonly RedirectHop[]\n}\n\n/**\n * Follow a chain of Redirect records starting from `start`'s pod bytes,\n * fetching each hop's target via `fetcher`, until a pod with no `redirect`\n * header field (the terminal) is reached.\n *\n * HTTP-redirect discipline: each hop's Redirect is verified against\n * `opts.trustedKeys` BEFORE it is followed (fail closed — an untrusted or\n * forged hop never advances the walk), loops are detected on the target\n * about to be followed, and the hop count is capped at `opts.maxDepth`\n * (default 8). `fetcher` throwing or returning `null` for a target means\n * that hop is unreachable.\n *\n * @throws {RedirectBadSignatureError} a hop's Redirect fails verification.\n * @throws {RedirectLoopError} a hop's target was already followed in this chain.\n * @throws {RedirectDepthExceededError} more than `maxDepth` hops were followed.\n * @throws {RedirectUnreachableError} `fetcher` threw or returned `null` for a target.\n */\nexport async function followRedirects(\n start: Uint8Array,\n fetcher: (target: string) => Promise<Uint8Array | null>,\n opts: { readonly trustedKeys: Readonly<Record<string, string>>; readonly maxDepth?: number },\n): Promise<FollowRedirectsResult> {\n const maxDepth = opts.maxDepth ?? 8\n let current = start\n const hops: RedirectHop[] = []\n const visited = new Set<string>()\n\n for (;;) {\n const rec = readPodRedirect(current)\n if (rec === undefined) return { terminal: current, hops }\n\n if (!(await verifyRedirect(rec, opts.trustedKeys))) {\n throw new RedirectBadSignatureError(rec.target)\n }\n if (visited.has(rec.target)) {\n throw new RedirectLoopError(rec.target)\n }\n visited.add(rec.target)\n\n hops.push({ target: rec.target, reason: rec.reason, issuedBy: rec.issuedBy })\n if (hops.length > maxDepth) {\n throw new RedirectDepthExceededError(maxDepth)\n }\n\n let next: Uint8Array | null\n try {\n next = await fetcher(rec.target)\n } catch (cause) {\n throw new RedirectUnreachableError(rec.target, cause)\n }\n if (next === null) {\n throw new RedirectUnreachableError(rec.target)\n }\n current = next\n }\n}\n","/**\n * `open(podBytesOrFile)` — the pod READ-path orchestrator (#941 Task 4).\n *\n * A free function (never a `Vault` method — `kernel/vault.ts` is at its\n * line ceiling and open() needs no vault-internal state that isn't already\n * reachable through published seams). Composes, in order:\n *\n * 1. `readPod` — parse + integrity-check the container (throws\n * `BundleIntegrityError` on a corrupted/truncated pod).\n * 2. `verifyPodHeader` — only when `opts.trustedKeys` is supplied.\n * `'unsigned'` is benign (legacy pod, or `writePod({ sign: false })`)\n * and open() proceeds; `'untrusted'` / `'tampered'` are fail-closed —\n * `PodHeaderVerificationError` — mirroring `followRedirects`'s\n * `RedirectBadSignatureError` posture: once a caller opts into\n * verification, an unverifiable header is a hard stop.\n * 3. `createNoydb` + `openVault` + `vault.load(dumpJson)` — the exact\n * unlock+restore sequence `bundle-roundtrip.test.ts` drives by hand.\n * The pod header carries no vault name (minimum-disclosure —\n * `format.ts`'s forbidden-fields list), so the caller names the\n * target vault via `opts.vault`.\n * 4. Re-derive the `SchemaManifest` from the just-restored `_schemas/*`\n * (the source of truth — Task 3's `deriveSchemaManifest`), via a\n * NON-MINTING `LookupDEK` built from `loadKeyring`'s already-unwrapped\n * `UnlockedKeyring.deks` map directly (`with-party/team/keyring.js`).\n * **Not** `ensureCollectionDEK` (#941 review fix — Important 2): that\n * helper mints+persists a fresh DEK into `_keyring/<user>` for any\n * collection absent from the keyring, which is correct for a WRITE\n * path but wrong here — `deriveSchemaManifest` only ever reads\n * collections that already have a `_schemas` envelope, so an absent\n * DEK means \"this principal can't decrypt this sibling\" (e.g. a\n * collection-scoped grantee), never \"new collection.\" The old\n * minting call polluted a scoped principal's freshly-restored keyring\n * with garbage sibling DEKs on every `open()`. The returned\n * `manifest` is that principal's own visible slice — see\n * `derive.ts`'s `LookupDEK` doc and `sync.ts`'s module doc for the\n * full rationale (the same distinction governs why the sync path\n * must SKIP rather than write a partial manifest).\n * 5. Generation check (AC #4 coexistence): compare the HIGHEST\n * per-collection generation stamp carried by the restored manifest\n * against THIS store's schema-fence generation as it stood\n * immediately before the restore (0 for a brand-new vault; whatever a\n * coexisting local vault already had). If the pod is ahead and\n * `!opts.allowGenerationAhead`, throw `MigrationRequiredError` (the\n * same class `SchemaFenceController`'s write-path gate throws) — the\n * reader hasn't reconciled schema changes that happened elsewhere.\n * `allowGenerationAhead: true` is the documented dev override: open\n * proceeds, with a console warning. Divergence in the OTHER direction\n * (reader ahead of the pod) is non-fatal but also warned (#941\n * review, Important 3 — AC #4 coexistence divergence must be\n * observable in either direction, not just the bypass case).\n *\n * NOTE: this deliberately reads per-collection entries, not\n * `manifest.generation` itself. `_meta/schema-fence` is local\n * session-coordination state and does NOT travel in a pod dump\n * (`with-pod/backup.ts`'s reserved-collection list carries `_schemas`\n * and `_manifest` but not `_meta`) — a fresh re-derive's top-level\n * `generation` is always driven by the (untouched-by-restore) target\n * store's own fence, not the pod's. Each `_schemas/<collection>`\n * envelope's own `generation` field DOES travel (it's stamped at\n * declare-time from the writer's real fence), so per-collection\n * entries are the only signal that survives a restore intact.\n *\n * @module\n */\n\nimport { readPod, verifyPodHeader } from './bundle.js'\nimport type { NoydbPodHeader } from './format.js'\nimport type { PodVerifyResult } from './bundle.js'\nimport { createNoydb } from '../kernel/noydb.js'\nimport type { Noydb } from '../kernel/noydb.js'\nimport type { Vault } from '../kernel/vault.js'\nimport type { NoydbOptions, NoydbStore, EchoSecretParts } from '../kernel/types.js'\nimport { MigrationRequiredError, PodHeaderVerificationError } from '../kernel/errors.js'\nimport { loadKeyring } from '../with-party/team/keyring.js'\nimport { loadFence } from '../with-shape/schema-update/fence.js'\nimport { deriveSchemaManifest, type LookupDEK } from '../with-shape/manifest/derive.js'\nimport type { SchemaManifest } from '../with-shape/manifest/types.js'\n\nexport interface OpenPodOptions {\n /** The ciphertext store to restore into (and where the opened `Vault` lives). */\n readonly store: NoydbStore\n /**\n * The target vault name. The pod header deliberately carries no vault\n * name (minimum-disclosure — `NoydbPodHeader`'s forbidden-fields list),\n * so the caller names the vault to restore into/open.\n */\n readonly vault: string\n /** User identifier — passed through to `createNoydb`. */\n readonly user: string\n /** That user's secret — passed through to `createNoydb` / `loadKeyring`. */\n readonly secret: string | EchoSecretParts\n /**\n * Trusted signing keys (`keyId → publicKeyB64`). When supplied,\n * `verifyPodHeader` runs and its result is returned as `verification`.\n * Omitted → no verification attempted, `verification` is absent.\n */\n readonly trustedKeys?: Readonly<Record<string, string>>\n /**\n * Passthrough to `createNoydb` for every option beyond `store`/`user`/\n * `secret` (history/indexing/blobs/… strategies, `secretMode`, etc.).\n */\n readonly noydbOptions?: Omit<NoydbOptions, 'store' | 'user' | 'secret'>\n /**\n * Dev override for the generation-ahead fence (AC #4). Default `false`:\n * a pod whose schema manifest generation is ahead of this store's\n * pre-restore fence generation throws `MigrationRequiredError`. `true`\n * opens anyway, logging a console warning.\n */\n readonly allowGenerationAhead?: boolean\n}\n\nexport interface OpenPodResult {\n readonly db: Noydb\n readonly vault: Vault\n readonly header: NoydbPodHeader\n /** Present iff `opts.trustedKeys` was supplied. */\n readonly verification?: PodVerifyResult\n /** The pod's schema manifest, re-derived from the just-restored `_schemas/*`. */\n readonly manifest?: SchemaManifest\n}\n\n/**\n * Open a `.noydb` pod: verify its integrity (and, opt-in, its signature),\n * unlock + restore it into `opts.vault`, and re-derive its schema manifest.\n * See the module doc for the full flow and the errors each step can throw.\n */\nexport async function open(podFileOrBytes: Uint8Array, opts: OpenPodOptions): Promise<OpenPodResult> {\n const { header, dumpJson } = await readPod(podFileOrBytes)\n\n let verification: PodVerifyResult | undefined\n if (opts.trustedKeys !== undefined) {\n verification = await verifyPodHeader(podFileOrBytes, opts.trustedKeys)\n if (verification.status === 'untrusted' || verification.status === 'tampered') {\n throw new PodHeaderVerificationError(verification.status, verification.keyId)\n }\n }\n\n // Reader's pre-restore generation snapshot (see module doc, step 5) —\n // must be read from the raw store BEFORE vault.load() overwrites it.\n const readerGeneration = (await loadFence(opts.store, opts.vault)).currentSchemaVersion\n\n const db = await createNoydb({ ...opts.noydbOptions, store: opts.store, user: opts.user, secret: opts.secret })\n const vault = await db.openVault(opts.vault)\n await vault.load(dumpJson)\n\n // #941 review fix: a NON-MINTING lookup, not `ensureCollectionDEK` (which\n // mints+persists a fresh DEK for any collection absent from the keyring).\n // open() is a READ path — deriveSchemaManifest only ever iterates\n // collections that already have a `_schemas` envelope, so an absent DEK\n // here means \"this principal cannot decrypt this sibling,\" never \"new\n // collection.\" The old minting call polluted a scoped principal's just-\n // restored `_keyring/<user>` file with garbage sibling DEKs on every\n // open(). See `derive.ts`'s `LookupDEK` doc for the full rationale.\n const keyring = await loadKeyring(opts.store, opts.vault, { userId: opts.user, secret: opts.secret })\n const lookupDEK: LookupDEK = async (name) => keyring.deks.get(name)\n const { manifest, undecodableCollections } = await deriveSchemaManifest(opts.store, opts.vault, lookupDEK)\n\n // A scoped principal's `manifest` is legitimately their own visible\n // slice (see `sync.ts`'s module doc) — `open()` is a per-principal read,\n // not an assertion of pod-wide completeness. `undecodableCollections` is\n // intentionally not surfaced on `OpenPodResult` (out of this fix's\n // scope); callers that need it can call `deriveSchemaManifest` directly.\n void undecodableCollections\n\n // See module doc, step 5 — the pod's generation signal is the highest\n // per-collection stamp, not the (locally re-derived, fence-driven)\n // top-level `manifest.generation`.\n const podGeneration = Object.values(manifest.collections)\n .reduce((max, entry) => Math.max(max, entry.generation), 0)\n\n if (podGeneration > readerGeneration) {\n if (!opts.allowGenerationAhead) {\n throw new MigrationRequiredError(\n `open(): pod's schema generation (${podGeneration}) is ahead of vault ` +\n `\"${opts.vault}\"'s local generation (${readerGeneration}). Pass ` +\n `\\`allowGenerationAhead: true\\` to open anyway, or reconcile the schema first.`,\n )\n }\n console.warn(\n `[noy-db] open(): vault \"${opts.vault}\" opened with allowGenerationAhead — pod schema ` +\n `generation ${podGeneration} is ahead of the local generation ${readerGeneration}.`,\n )\n } else if (podGeneration < readerGeneration) {\n // #941 review (Important 3, AC #4): divergence in EITHER direction\n // should be observable, not just the ahead-bypass case above. The\n // reader being ahead of the pod is non-fatal (the pod is simply older\n // content) but silent coexistence divergence is exactly what AC #4\n // asks to surface — same `[noy-db]`-prefixed console.warn facility as\n // `sync.ts`'s cap-exhaustion warning.\n console.warn(\n `[noy-db] open(): vault \"${opts.vault}\"'s local schema generation (${readerGeneration}) is ` +\n `ahead of the pod's (${podGeneration}) — the pod reflects an earlier schema than this reader.`,\n )\n }\n\n return { db, vault, header, manifest, ...(verification !== undefined ? { verification } : {}) }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAM,uBAAuB;AA4C7B,IAAM,uBAAuB;AAwBtB,SAAS,aACd,QACA,SACsB;AACtB,QAAM,YAAY,SAAS,cAAc;AAGzC,QAAM,YAAY,oBAAI,IAA2B;AACjD,QAAM,WAAW,oBAAI,IAA2B;AAChD,QAAM,SAAS,oBAAI,IAAY;AAG/B,MAAI,aAAa;AAMjB,QAAM,UAAU,oBAAI,IAAoC;AAExD,iBAAe,KAAK,OAAuC;AACzD,QAAI,OAAO,IAAI,KAAK,EAAG,QAAO,UAAU,IAAI,KAAK;AAEjD,UAAM,WAAW,QAAQ,IAAI,KAAK;AAClC,QAAI,SAAU,QAAO;AAErB,UAAM,WAAW,YAAY;AAC3B,YAAM,SAAS,MAAM,OAAO,WAAW,KAAK;AAC5C,UAAI,QAAQ;AACV,cAAM,OAAO,IAAI,YAAY,EAAE,OAAO,OAAO,KAAK;AAClD,cAAM,SAAS,KAAK,MAAM,IAAI;AAC9B,kBAAU,IAAI,OAAO,OAAO,IAAI;AAChC,iBAAS,IAAI,OAAO,OAAO,OAAO;AAAA,MACpC,OAAO;AACL,kBAAU,IAAI,OAAO,CAAC,CAAC;AACvB,iBAAS,IAAI,OAAO,IAAI;AAAA,MAC1B;AAEA,aAAO,IAAI,KAAK;AAChB,aAAO,UAAU,IAAI,KAAK;AAAA,IAC5B,GAAG;AAEH,YAAQ,IAAI,OAAO,OAAO;AAC1B,QAAI;AACF,aAAO,MAAM;AAAA,IACf,UAAE;AAGA,cAAQ,OAAO,KAAK;AAAA,IACtB;AAAA,EACF;AAEA,iBAAe,MAAM,OAA8B;AACjD,UAAM,WAAW,UAAU,IAAI,KAAK,KAAK,CAAC;AAC1C,UAAM,SAA0B;AAAA,MAC9B,qBAAqB;AAAA,MACrB;AAAA,MACA,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,UAAU,GAAI,iBAAiB,SAAY,EAAE,aAAa,IAAI,CAAC,EAAG;AAChG;","names":[]}
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getAtPath
3
- } from "./chunk-7G6VDWXB.js";
3
+ } from "./chunk-EWTAUGAK.js";
4
4
  import {
5
5
  SearchNotEnabledError
6
- } from "./chunk-HNGSV2YC.js";
6
+ } from "./chunk-CT35TQV7.js";
7
7
 
8
8
  // src/with-lookup/search/tokenize.ts
9
9
  var WORD = /[\p{L}\p{N}]+/gu;
@@ -294,31 +294,31 @@ function buildBlobFieldEntries(filenamesByField) {
294
294
  function withSearch() {
295
295
  return {
296
296
  async search(ctx, field, query, opts) {
297
- const { search } = await import("./collection-facade-QEJIM6BC.js");
297
+ const { search } = await import("./collection-facade-FLXXGAPR.js");
298
298
  return search(ctx, field, query, opts);
299
299
  },
300
300
  async retrieve(ctx, query, opts) {
301
- const { retrieve } = await import("./collection-facade-QEJIM6BC.js");
301
+ const { retrieve } = await import("./collection-facade-FLXXGAPR.js");
302
302
  return retrieve(ctx, query, opts);
303
303
  },
304
304
  async similarTo(ctx, vector, opts) {
305
- const { similarTo } = await import("./collection-facade-QEJIM6BC.js");
305
+ const { similarTo } = await import("./collection-facade-FLXXGAPR.js");
306
306
  return similarTo(ctx, vector, opts);
307
307
  },
308
308
  async warmIndex(ctx) {
309
- const { warmIndex } = await import("./collection-facade-QEJIM6BC.js");
309
+ const { warmIndex } = await import("./collection-facade-FLXXGAPR.js");
310
310
  return warmIndex(ctx);
311
311
  },
312
312
  async flushIndex(ctx) {
313
- const { flushIndex } = await import("./collection-facade-QEJIM6BC.js");
313
+ const { flushIndex } = await import("./collection-facade-FLXXGAPR.js");
314
314
  return flushIndex(ctx);
315
315
  },
316
316
  async embedOnWrite(ctx, id, record, version) {
317
- const { embedOnWrite } = await import("./collection-facade-QEJIM6BC.js");
317
+ const { embedOnWrite } = await import("./collection-facade-FLXXGAPR.js");
318
318
  return embedOnWrite(ctx, id, record, version);
319
319
  },
320
320
  async rebuildEmbeddings(ctx) {
321
- const { rebuildEmbeddings } = await import("./collection-facade-QEJIM6BC.js");
321
+ const { rebuildEmbeddings } = await import("./collection-facade-FLXXGAPR.js");
322
322
  return rebuildEmbeddings(ctx);
323
323
  }
324
324
  };
@@ -364,4 +364,4 @@ export {
364
364
  buildBlobFieldEntries,
365
365
  withSearch
366
366
  };
367
- //# sourceMappingURL=chunk-3JVXVJ7L.js.map
367
+ //# sourceMappingURL=chunk-KOM2GMTW.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  assertTierAccess,
3
3
  dekKey
4
- } from "./chunk-AHLJSVRL.js";
4
+ } from "./chunk-37M5QBAS.js";
5
5
  import {
6
6
  liveRecordIsElevated,
7
7
  liveRecordTier
8
- } from "./chunk-3FSX6LDG.js";
8
+ } from "./chunk-C5N3ZWGJ.js";
9
9
  import {
10
10
  openEnvelopeJson,
11
11
  writeEnvelopeBody
12
- } from "./chunk-3URQC7EH.js";
12
+ } from "./chunk-EZYLQKHP.js";
13
13
  import {
14
14
  base64ToBuffer,
15
15
  bufferToBase64,
@@ -21,10 +21,10 @@ import {
21
21
  sha256Hex,
22
22
  unwrapCek,
23
23
  wrapCek
24
- } from "./chunk-VCETL77O.js";
24
+ } from "./chunk-WJD5VF2N.js";
25
25
  import {
26
26
  NOYDB_FORMAT_VERSION
27
- } from "./chunk-YPYHVOXP.js";
27
+ } from "./chunk-7GWC6RI5.js";
28
28
  import {
29
29
  BlobIntentPendingError,
30
30
  BlobOfflineError,
@@ -35,7 +35,7 @@ import {
35
35
  UnsupportedTierCompositionError,
36
36
  ValidationError,
37
37
  isConflictError
38
- } from "./chunk-HNGSV2YC.js";
38
+ } from "./chunk-CT35TQV7.js";
39
39
 
40
40
  // src/with-shape/blobs/blob-pinning.ts
41
41
  function memoryBlobPinStore() {
@@ -3070,4 +3070,4 @@ export {
3070
3070
  DEFAULT_CHUNK_SIZE,
3071
3071
  BlobSet
3072
3072
  };
3073
- //# sourceMappingURL=chunk-PL2GHSCM.js.map
3073
+ //# sourceMappingURL=chunk-KYIXANXU.js.map
@@ -5,7 +5,7 @@ import {
5
5
  buildStringFieldEntries,
6
6
  extractSnippet,
7
7
  searchScan
8
- } from "./chunk-3JVXVJ7L.js";
8
+ } from "./chunk-KOM2GMTW.js";
9
9
  import {
10
10
  fuseRetrieval
11
11
  } from "./chunk-AURFOK3D.js";
@@ -13,14 +13,14 @@ import {
13
13
  getAtPath,
14
14
  isStaticDictDescriptor,
15
15
  stripI18nFilled
16
- } from "./chunk-7G6VDWXB.js";
16
+ } from "./chunk-EWTAUGAK.js";
17
17
  import {
18
18
  liveRecordIsElevated
19
- } from "./chunk-3FSX6LDG.js";
19
+ } from "./chunk-C5N3ZWGJ.js";
20
20
  import {
21
21
  EmbeddingDimMismatchError,
22
22
  EmbeddingModelMismatchError
23
- } from "./chunk-HNGSV2YC.js";
23
+ } from "./chunk-CT35TQV7.js";
24
24
 
25
25
  // src/with-lookup/embeddings/cosine.ts
26
26
  function cosine(a, b) {
@@ -394,4 +394,4 @@ export {
394
394
  rebuildEmbeddings,
395
395
  syncTierSearch
396
396
  };
397
- //# sourceMappingURL=chunk-G6S5VVHP.js.map
397
+ //# sourceMappingURL=chunk-LOLK4EAT.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SatelliteConfigError
3
- } from "./chunk-HNGSV2YC.js";
3
+ } from "./chunk-CT35TQV7.js";
4
4
 
5
5
  // src/with-shape/satellites/validate.ts
6
6
  function validateSatelliteDeclaration(input) {
@@ -47,4 +47,4 @@ export {
47
47
  validateSatelliteDeclaration,
48
48
  hashFields
49
49
  };
50
- //# sourceMappingURL=chunk-HVQGCKY4.js.map
50
+ //# sourceMappingURL=chunk-LQEHLFFF.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  DanglingReferenceError,
6
6
  JoinTooLargeError
7
- } from "./chunk-HNGSV2YC.js";
7
+ } from "./chunk-CT35TQV7.js";
8
8
 
9
9
  // src/kernel/query/join.ts
10
10
  var DEFAULT_JOIN_MAX_ROWS = 5e4;
@@ -186,4 +186,4 @@ export {
186
186
  applyJoins,
187
187
  resetJoinWarnings
188
188
  };
189
- //# sourceMappingURL=chunk-H4YQSDOI.js.map
189
+ //# sourceMappingURL=chunk-LQFNJRMI.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NOYDB_FORMAT_VERSION
3
- } from "./chunk-YPYHVOXP.js";
3
+ } from "./chunk-7GWC6RI5.js";
4
4
 
5
5
  // src/kernel/enclave/record-keys/tombstone.ts
6
6
  function isTombstoneShape(envelope) {
@@ -42,4 +42,4 @@ export {
42
42
  isDeleteMarker,
43
43
  buildDeleteMarker
44
44
  };
45
- //# sourceMappingURL=chunk-7H73RIE3.js.map
45
+ //# sourceMappingURL=chunk-LVLXWIBF.js.map
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  freezeSnapshotOnly
3
- } from "./chunk-FZ6NYJ7L.js";
3
+ } from "./chunk-ZFO26ZZR.js";
4
4
  import {
5
5
  resolveManagedSecret
6
- } from "./chunk-XWX7GL56.js";
6
+ } from "./chunk-Z7PW63ZC.js";
7
7
  import {
8
8
  createOwnerKeyring
9
- } from "./chunk-JRKZTEZZ.js";
9
+ } from "./chunk-CFM6GBNF.js";
10
10
  import {
11
11
  wrapKey
12
- } from "./chunk-VCETL77O.js";
12
+ } from "./chunk-WJD5VF2N.js";
13
13
  import {
14
14
  NOYDB_FORMAT_VERSION
15
- } from "./chunk-YPYHVOXP.js";
15
+ } from "./chunk-7GWC6RI5.js";
16
16
  import {
17
17
  PermissionDeniedError
18
- } from "./chunk-HNGSV2YC.js";
18
+ } from "./chunk-CT35TQV7.js";
19
19
 
20
20
  // src/with-party/team/deed.ts
21
21
  var DEED_RECORD_ID = "deed";
@@ -131,4 +131,4 @@ export {
131
131
  isDeedVault,
132
132
  liberateVault
133
133
  };
134
- //# sourceMappingURL=chunk-NPP5R7FF.js.map
134
+ //# sourceMappingURL=chunk-LZHDIO64.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CargoNotEnabledError,
3
3
  QuiesceTimeoutError
4
- } from "./chunk-HNGSV2YC.js";
4
+ } from "./chunk-CT35TQV7.js";
5
5
 
6
6
  // src/with-cargo/strategy.ts
7
7
  var NO_CARGO = {
@@ -60,4 +60,4 @@ export {
60
60
  isQuorum,
61
61
  runDrainBarrier
62
62
  };
63
- //# sourceMappingURL=chunk-DG27IUVI.js.map
63
+ //# sourceMappingURL=chunk-M3VRXAVD.js.map
@@ -201,7 +201,7 @@ var engineCtx = (ctx) => ({
201
201
  function withClassified() {
202
202
  return {
203
203
  async reveal(ctx, id, field) {
204
- const { revealSealedField } = await import("./reveal-BW36KCOQ.js");
204
+ const { revealSealedField } = await import("./reveal-IN2ZBB5U.js");
205
205
  const value = await revealSealedField({
206
206
  collection: ctx.collection,
207
207
  encrypted: ctx.encrypted,
@@ -213,26 +213,26 @@ function withClassified() {
213
213
  return value;
214
214
  },
215
215
  async verify(ctx, id, field, candidate) {
216
- const { verifyDigestField } = await import("./verify-RO5RTZOJ.js");
216
+ const { verifyDigestField } = await import("./verify-GB7SBYC3.js");
217
217
  const verdict = await verifyDigestField(engineCtx(ctx), id, field, candidate, policyOf(ctx.spec));
218
218
  await ctx.onAccess?.("verify", id);
219
219
  return verdict;
220
220
  },
221
221
  async verifyText(ctx, id, field, candidate) {
222
- const { verifyTextField } = await import("./verify-RO5RTZOJ.js");
222
+ const { verifyTextField } = await import("./verify-GB7SBYC3.js");
223
223
  const verdict = await verifyTextField(engineCtx(ctx), id, field, candidate, ctx.spec.verifyNormalize ?? "password");
224
224
  await ctx.onAccess?.("verify", id);
225
225
  return verdict;
226
226
  },
227
227
  async matchGroup(ctx, id, answers, opts) {
228
- const { matchGroupFields } = await import("./verify-RO5RTZOJ.js");
228
+ const { matchGroupFields } = await import("./verify-GB7SBYC3.js");
229
229
  const members = (ctx.groupMembers ?? []).map((m) => ({ field: m.field, policy: policyOf(m.spec) }));
230
230
  const result = await matchGroupFields(engineCtx(ctx), id, answers, members, opts);
231
231
  await ctx.onAccess?.("verify", id);
232
232
  return result;
233
233
  },
234
234
  async computeTarget(ctx, field, candidate, costByte) {
235
- const { computeBidxTarget } = await import("./find-RBBYKXI7.js");
235
+ const { computeBidxTarget } = await import("./find-QJPVK6CY.js");
236
236
  const dek = await ctx.getDEK();
237
237
  return computeBidxTarget(candidate, policyOf(ctx.spec).normalize, dek, ctx.collection, field, costByte);
238
238
  }
@@ -244,4 +244,4 @@ export {
244
244
  classified,
245
245
  withClassified
246
246
  };
247
- //# sourceMappingURL=chunk-FMQJZH4R.js.map
247
+ //# sourceMappingURL=chunk-M3XBZPLU.js.map
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  linkCollectionName,
3
3
  linkRowKey
4
- } from "./chunk-HNHCQ556.js";
4
+ } from "./chunk-YVGJLRXN.js";
5
5
  import {
6
6
  openEnvelopeJson
7
- } from "./chunk-3URQC7EH.js";
7
+ } from "./chunk-EZYLQKHP.js";
8
8
  import {
9
9
  encrypt
10
- } from "./chunk-VCETL77O.js";
10
+ } from "./chunk-WJD5VF2N.js";
11
11
  import {
12
12
  NOYDB_FORMAT_VERSION
13
- } from "./chunk-YPYHVOXP.js";
13
+ } from "./chunk-7GWC6RI5.js";
14
14
  import {
15
15
  NoydbError
16
- } from "./chunk-HNGSV2YC.js";
16
+ } from "./chunk-CT35TQV7.js";
17
17
 
18
18
  // src/with-shape/links/link-set.ts
19
19
  var LinkSet = class {
@@ -127,4 +127,4 @@ export {
127
127
  LinkSet,
128
128
  LinkEndpointError
129
129
  };
130
- //# sourceMappingURL=chunk-PDLLCOGD.js.map
130
+ //# sourceMappingURL=chunk-M44ZBLL3.js.map
@@ -2,7 +2,7 @@ import {
2
2
  OverlayBaseIsVirtualError,
3
3
  OverlayCollectionUnavailableError,
4
4
  OverlayNameCollisionError
5
- } from "./chunk-HNGSV2YC.js";
5
+ } from "./chunk-CT35TQV7.js";
6
6
 
7
7
  // src/with-formula/overlay-views/registry.ts
8
8
  var OverlayedViewRegistry = class {
@@ -68,4 +68,4 @@ var OverlayedViewRegistry = class {
68
68
  export {
69
69
  OverlayedViewRegistry
70
70
  };
71
- //# sourceMappingURL=chunk-FNSMZQS4.js.map
71
+ //# sourceMappingURL=chunk-MLMDO4OQ.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  grant,
3
3
  revoke
4
- } from "./chunk-JRKZTEZZ.js";
4
+ } from "./chunk-CFM6GBNF.js";
5
5
  import {
6
6
  CustodyNotEnabledError
7
- } from "./chunk-HNGSV2YC.js";
7
+ } from "./chunk-CT35TQV7.js";
8
8
 
9
9
  // src/with-party/custody/active.ts
10
10
  function withCustody() {
@@ -16,7 +16,7 @@ function withCustody() {
16
16
  return host._revokeCustodianImpl(revoke, vault, options, factors);
17
17
  },
18
18
  async liberate(vault, opts) {
19
- const { liberateVault } = await import("./liberate-GFN4C7RR.js");
19
+ const { liberateVault } = await import("./liberate-ZJDLMKOW.js");
20
20
  return liberateVault(vault, opts);
21
21
  }
22
22
  };
@@ -74,4 +74,4 @@ export {
74
74
  withCustody,
75
75
  CustodyApi
76
76
  };
77
- //# sourceMappingURL=chunk-ADW22QSB.js.map
77
+ //# sourceMappingURL=chunk-MRDQ6HJS.js.map
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  liveRecordIsElevated
3
- } from "./chunk-3FSX6LDG.js";
3
+ } from "./chunk-C5N3ZWGJ.js";
4
4
  import {
5
5
  isRewrappedUnder,
6
6
  openEnvelopeJson,
7
7
  rewrapEnvelope
8
- } from "./chunk-3URQC7EH.js";
8
+ } from "./chunk-EZYLQKHP.js";
9
9
  import {
10
10
  isTombstone,
11
11
  isTombstoneShape
12
- } from "./chunk-7H73RIE3.js";
12
+ } from "./chunk-LVLXWIBF.js";
13
13
  import {
14
14
  NOYDB_FORMAT_VERSION
15
- } from "./chunk-YPYHVOXP.js";
15
+ } from "./chunk-7GWC6RI5.js";
16
16
  import {
17
17
  ReadOnlyAtInstantError
18
- } from "./chunk-HNGSV2YC.js";
18
+ } from "./chunk-CT35TQV7.js";
19
19
 
20
20
  // src/with-commit/history/history.ts
21
21
  var HISTORY_COLLECTION = "_history";
@@ -330,4 +330,4 @@ export {
330
330
  VaultInstant,
331
331
  CollectionInstant
332
332
  };
333
- //# sourceMappingURL=chunk-52JPHN5N.js.map
333
+ //# sourceMappingURL=chunk-MSCXCF4T.js.map