@noy-db/hub 0.4.0-pre.5 → 0.4.0-pre.6

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 (330) hide show
  1. package/dist/{api-22ES33N3.js → api-5QVQX4HG.js} +6 -6
  2. package/dist/attestation/index.js +14 -14
  3. package/dist/{backup-YCHAC575.js → backup-USYSNCYM.js} +6 -6
  4. package/dist/blobs/index.js +8 -5
  5. package/dist/blobs/index.js.map +1 -1
  6. package/dist/broker/index.js +6 -6
  7. package/dist/cargo/index.js +26 -28
  8. package/dist/{chunk-RWW3I3PO.js → chunk-2BVW754E.js} +2 -2
  9. package/dist/{chunk-VEGQYPCP.js → chunk-2ZSC454H.js} +3 -3
  10. package/dist/{chunk-S4YERMGJ.js → chunk-32467U5J.js} +3 -3
  11. package/dist/{chunk-UVBHM7AK.js → chunk-3GXDB3NQ.js} +4 -4
  12. package/dist/{chunk-L2CAWCQL.js → chunk-3S2YNMUS.js} +53 -5
  13. package/dist/chunk-3S2YNMUS.js.map +1 -0
  14. package/dist/{chunk-HAPY7WFP.js → chunk-3TZUC4WS.js} +9 -9
  15. package/dist/{chunk-M6QA2KK2.js → chunk-44Y3P5U6.js} +2 -2
  16. package/dist/{chunk-WQN5SM7P.js → chunk-4B3DL75F.js} +2 -2
  17. package/dist/{chunk-XUFAFHQM.js → chunk-5ABOFAHN.js} +7 -4
  18. package/dist/chunk-5ABOFAHN.js.map +1 -0
  19. package/dist/chunk-5D2ALSM5.js +19 -0
  20. package/dist/chunk-5D2ALSM5.js.map +1 -0
  21. package/dist/{chunk-OHV6T5JB.js → chunk-6SSWOUUS.js} +2 -2
  22. package/dist/{chunk-6RPWILRH.js → chunk-7IQWHYL2.js} +3 -3
  23. package/dist/chunk-AFHQATY4.js +47 -0
  24. package/dist/chunk-AFHQATY4.js.map +1 -0
  25. package/dist/{chunk-I2XEBEEF.js → chunk-AZXEOEQK.js} +3 -3
  26. package/dist/{chunk-K7BADAOS.js → chunk-C2V7AJO2.js} +3 -3
  27. package/dist/chunk-CADUYBQD.js +151 -0
  28. package/dist/chunk-CADUYBQD.js.map +1 -0
  29. package/dist/{chunk-YTW6ZIPD.js → chunk-DOZFU7OZ.js} +1 -1
  30. package/dist/chunk-DOZFU7OZ.js.map +1 -0
  31. package/dist/{chunk-YCAJDK4O.js → chunk-E7FSBI6I.js} +3 -3
  32. package/dist/chunk-EP5L47XV.js +22 -0
  33. package/dist/chunk-EP5L47XV.js.map +1 -0
  34. package/dist/{chunk-YWZEDG7F.js → chunk-EPME33Y4.js} +4 -4
  35. package/dist/{chunk-EEZCB74X.js → chunk-EWPS35AR.js} +465 -393
  36. package/dist/chunk-EWPS35AR.js.map +1 -0
  37. package/dist/{chunk-BY5YBSXA.js → chunk-GQT6J4FJ.js} +14 -1
  38. package/dist/chunk-GQT6J4FJ.js.map +1 -0
  39. package/dist/{chunk-YXZNGHID.js → chunk-H5GMROCB.js} +2 -2
  40. package/dist/{chunk-QMMOMBH6.js → chunk-HA7P3BTB.js} +24 -175
  41. package/dist/chunk-HA7P3BTB.js.map +1 -0
  42. package/dist/{chunk-FTCGEUOY.js → chunk-HDF5R2K6.js} +4 -4
  43. package/dist/{chunk-R2N37AA6.js → chunk-HVPW6PCX.js} +2 -2
  44. package/dist/{chunk-YXIVUWDU.js → chunk-HXVRRJBD.js} +3 -3
  45. package/dist/{chunk-5ATANZSW.js → chunk-ICYC5YNI.js} +4 -4
  46. package/dist/{chunk-7ICV4ASA.js → chunk-IUATR5UE.js} +25 -3
  47. package/dist/chunk-IUATR5UE.js.map +1 -0
  48. package/dist/{chunk-QZJEYZ4I.js → chunk-JGOKAZNB.js} +3 -3
  49. package/dist/{chunk-JN3SGXJE.js → chunk-JOCMXSR2.js} +1 -1
  50. package/dist/{chunk-JN3SGXJE.js.map → chunk-JOCMXSR2.js.map} +1 -1
  51. package/dist/{chunk-7BIJS6II.js → chunk-JTIPVW4J.js} +3 -3
  52. package/dist/{chunk-SC4JLMZI.js → chunk-KCZAFDP5.js} +2 -2
  53. package/dist/{chunk-GP54LU5N.js → chunk-LG2GUYRX.js} +7 -7
  54. package/dist/{chunk-J5TEU77Q.js → chunk-LN3MQFUE.js} +54 -2
  55. package/dist/chunk-LN3MQFUE.js.map +1 -0
  56. package/dist/{chunk-FIP7KI2P.js → chunk-M4GO4ZJK.js} +205 -15
  57. package/dist/chunk-M4GO4ZJK.js.map +1 -0
  58. package/dist/{chunk-QMZ5A6FQ.js → chunk-M7W2KYTL.js} +2 -2
  59. package/dist/{chunk-K4BWPNJO.js → chunk-MLCTPWSO.js} +3 -3
  60. package/dist/{chunk-GEEJPID6.js → chunk-MMVQ3SUO.js} +3 -3
  61. package/dist/{chunk-HQKRZIX6.js → chunk-MPPWL64H.js} +24 -41
  62. package/dist/chunk-MPPWL64H.js.map +1 -0
  63. package/dist/{chunk-YZN6NRTR.js → chunk-MQBFT2OT.js} +11 -9
  64. package/dist/chunk-MQBFT2OT.js.map +1 -0
  65. package/dist/{chunk-TNJVDG2B.js → chunk-NA374QG7.js} +2 -2
  66. package/dist/chunk-NIKO2BBZ.js +23 -0
  67. package/dist/chunk-NIKO2BBZ.js.map +1 -0
  68. package/dist/chunk-PEOZ34EM.js +13 -0
  69. package/dist/chunk-PEOZ34EM.js.map +1 -0
  70. package/dist/chunk-PVEWA2DU.js +23 -0
  71. package/dist/chunk-PVEWA2DU.js.map +1 -0
  72. package/dist/{chunk-V5JUAW4M.js → chunk-QVIZDLAR.js} +5 -5
  73. package/dist/{chunk-DYZ5CCVM.js → chunk-RM5EXCFF.js} +1 -1
  74. package/dist/{chunk-DYZ5CCVM.js.map → chunk-RM5EXCFF.js.map} +1 -1
  75. package/dist/chunk-SMY5X46Z.js +14 -0
  76. package/dist/chunk-SMY5X46Z.js.map +1 -0
  77. package/dist/{chunk-2CRZOVDI.js → chunk-UNREYBZO.js} +2 -2
  78. package/dist/{chunk-KJTIAECI.js → chunk-V2R2VWER.js} +168 -9
  79. package/dist/chunk-V2R2VWER.js.map +1 -0
  80. package/dist/{chunk-CKUYQO2P.js → chunk-VDTWFN2P.js} +7 -5
  81. package/dist/chunk-VDTWFN2P.js.map +1 -0
  82. package/dist/chunk-VKQCVU2Z.js +21 -0
  83. package/dist/chunk-VKQCVU2Z.js.map +1 -0
  84. package/dist/{chunk-UTEATWHO.js → chunk-VNJMLOQS.js} +4 -4
  85. package/dist/{chunk-JAMDDLIM.js → chunk-WCJJQV2D.js} +2 -2
  86. package/dist/{chunk-OMSKGLYA.js → chunk-WWBC4KLB.js} +2 -2
  87. package/dist/{chunk-JIHH26WQ.js → chunk-XG7OZDOS.js} +3 -3
  88. package/dist/{chunk-QBOQI6PG.js → chunk-XONZGK6J.js} +2 -2
  89. package/dist/{chunk-YQQPNXNO.js → chunk-XSOGLHGY.js} +2 -2
  90. package/dist/{chunk-3OWYOECI.js → chunk-XY6MNSAF.js} +4 -4
  91. package/dist/chunk-XZHEOSQ2.js +16 -0
  92. package/dist/chunk-XZHEOSQ2.js.map +1 -0
  93. package/dist/{chunk-X3MWEFPT.js → chunk-YGMREQAK.js} +3 -3
  94. package/dist/chunk-YMUFFJCO.js +23 -0
  95. package/dist/chunk-YMUFFJCO.js.map +1 -0
  96. package/dist/{chunk-3LJYHE7S.js → chunk-ZDFU34XY.js} +9 -6
  97. package/dist/{chunk-3LJYHE7S.js.map → chunk-ZDFU34XY.js.map} +1 -1
  98. package/dist/{chunk-ILM6X6CP.js → chunk-ZF572E2M.js} +2 -2
  99. package/dist/{chunk-TNATF3HB.js → chunk-ZGEFBDPR.js} +2 -2
  100. package/dist/chunk-ZGEFBDPR.js.map +1 -0
  101. package/dist/{chunk-OGVE4IJW.js → chunk-ZHMUFYZF.js} +4 -4
  102. package/dist/{chunk-YFFEF6HR.js → chunk-ZHZ4PET5.js} +2 -2
  103. package/dist/{chunk-YZNKFYDC.js → chunk-ZM72UO3Y.js} +2 -2
  104. package/dist/classified/index.js +3 -3
  105. package/dist/{classified-marker-52P3D72W.js → classified-marker-SVDRXLD3.js} +3 -3
  106. package/dist/{collection-facade-XKCFHSLR.js → collection-facade-S5PPKZD5.js} +9 -9
  107. package/dist/consent/index.js +8 -4
  108. package/dist/consent/index.js.map +1 -1
  109. package/dist/{cover-5BSNJREH.js → cover-ADBCTIKN.js} +3 -3
  110. package/dist/crdt/index.js +4 -0
  111. package/dist/crdt/index.js.map +1 -1
  112. package/dist/{dead-filter-JXVCKS6W.js → dead-filter-HKDMTMVY.js} +2 -2
  113. package/dist/{delegation-WWZPEDK2.js → delegation-EV7LKJPH.js} +5 -5
  114. package/dist/derivations/index.js +3 -3
  115. package/dist/{derive-CWWFEQ4N.js → derive-5LDJW76F.js} +4 -4
  116. package/dist/{dispatch-PKQQFDBT.js → dispatch-SPMYNXNW.js} +12 -11
  117. package/dist/{dispatch-PKQQFDBT.js.map → dispatch-SPMYNXNW.js.map} +1 -1
  118. package/dist/{dispatch-SMXUO7W5.js → dispatch-V5MSMQYX.js} +5 -5
  119. package/dist/{enclave-I5H3GINP.js → enclave-ZA7C3H2L.js} +4 -4
  120. package/dist/executor-SVHAJZ4A.js +28 -0
  121. package/dist/{export-accessible-FBL6TDSK.js → export-accessible-S35YKIBL.js} +7 -7
  122. package/dist/{extract-partition-ZYIRYMTI.js → extract-partition-UVHAM5WZ.js} +10 -10
  123. package/dist/{fanout-sidecar-WWXVHHUH.js → fanout-sidecar-HRMHC34B.js} +4 -4
  124. package/dist/forget/index.js +4 -4
  125. package/dist/history/index.js +10 -6
  126. package/dist/history/index.js.map +1 -1
  127. package/dist/i18n/index.js +10 -8
  128. package/dist/i18n/index.js.map +1 -1
  129. package/dist/index.d.ts +4 -7
  130. package/dist/index.js +94 -151
  131. package/dist/index.js.map +1 -1
  132. package/dist/indexing/index.js +3 -1
  133. package/dist/indexing/index.js.map +1 -1
  134. package/dist/{issue-F76PAGIR.js → issue-5X3SMCF4.js} +6 -6
  135. package/dist/kernel/lazy.d.ts +30 -0
  136. package/dist/kernel/noydb.d.ts +21 -10
  137. package/dist/kernel/query/builder.d.ts +10 -10
  138. package/dist/kernel/query/index.d.ts +0 -6
  139. package/dist/kernel/query/scan-builder.d.ts +4 -4
  140. package/dist/kernel/types.d.ts +5 -5
  141. package/dist/{ledger-M2BKCNVS.js → ledger-K6JBFL3Z.js} +6 -6
  142. package/dist/liberate-NHTCKBU4.js +24 -0
  143. package/dist/{link-set-ZU4E5J5S.js → link-set-XVZY2ODC.js} +5 -5
  144. package/dist/materialized-views/index.js +15 -12
  145. package/dist/noydb-TI3RFU6M.js +78 -0
  146. package/dist/periods/index.js +9 -7
  147. package/dist/pod/index.js +5 -6
  148. package/dist/{policy-IY2YEA3A.js → policy-QWGJB7P7.js} +4 -4
  149. package/dist/port/with/collection-registries.d.ts +62 -0
  150. package/dist/port/with/strategies.d.ts +2 -2
  151. package/dist/port/with/team-strategy.d.ts +2 -1
  152. package/dist/portability/index.js +6 -6
  153. package/dist/{post-register-XIAHB6KF.js → post-register-5VHHVFJY.js} +4 -4
  154. package/dist/query/index.js +4 -44
  155. package/dist/{aggregate → reduce}/index.js +22 -15
  156. package/dist/reduce/index.js.map +1 -0
  157. package/dist/{register-HB4TQZSV.js → register-CEX7R7NE.js} +6 -6
  158. package/dist/{registry-6BMBFEXT.js → registry-DIKMRXUC.js} +5 -5
  159. package/dist/{registry-JOFO7RAH.js → registry-EWIB5NTI.js} +4 -4
  160. package/dist/{request-withdrawal-UN3TRHWI.js → request-withdrawal-AAG57QO4.js} +9 -9
  161. package/dist/{reveal-VWXRV2XU.js → reveal-7OOT5XPD.js} +3 -3
  162. package/dist/{revoke-OLO2OVR7.js → revoke-U5LCIJMF.js} +6 -6
  163. package/dist/sealed-record/index.js +6 -6
  164. package/dist/{seed-CDBFOTIK.js → seed-GVOI6QP6.js} +6 -6
  165. package/dist/session/index.js +7 -3
  166. package/dist/session/index.js.map +1 -1
  167. package/dist/shadow/index.js +4 -0
  168. package/dist/shadow/index.js.map +1 -1
  169. package/dist/{signer-MGGKPYAN.js → signer-NAA2OX7H.js} +5 -5
  170. package/dist/snapshots/index.js +9 -5
  171. package/dist/snapshots/index.js.map +1 -1
  172. package/dist/{stale-NBROTA66.js → stale-BJO2WIN7.js} +6 -5
  173. package/dist/{storage-3R37QZLA.js → storage-FL7XXZTN.js} +5 -5
  174. package/dist/{store-coordination-provider-P3IU5JHD.js → store-coordination-provider-DX5HECK3.js} +3 -3
  175. package/dist/sync/index.js +8 -4
  176. package/dist/sync/index.js.map +1 -1
  177. package/dist/team/index.js +15 -17
  178. package/dist/tiers/index.js +4 -4
  179. package/dist/tx/index.js +5 -1
  180. package/dist/tx/index.js.map +1 -1
  181. package/dist/via/blob/index.d.ts +2 -0
  182. package/dist/via/i18n/core.d.ts +1 -1
  183. package/dist/via/i18n/index.d.ts +2 -0
  184. package/dist/via/money/money-reducer.d.ts +2 -2
  185. package/dist/{walk-E3OVLBFR.js → walk-JXMWKKQW.js} +5 -5
  186. package/dist/with-audit/consent/index.d.ts +2 -0
  187. package/dist/with-audit/periods/index.d.ts +2 -0
  188. package/dist/with-cargo/floor.d.ts +3 -3
  189. package/dist/with-commit/crdt/index.d.ts +2 -0
  190. package/dist/with-commit/history/index.d.ts +2 -0
  191. package/dist/with-fork/shadow/index.d.ts +2 -0
  192. package/dist/with-fork/snapshots/index.d.ts +2 -0
  193. package/dist/with-formula/materialized-views/types.d.ts +7 -7
  194. package/dist/with-lookup/indexing/index.d.ts +2 -0
  195. package/dist/with-lookup/{aggregate → reduce}/active.d.ts +8 -8
  196. package/dist/with-lookup/{aggregate → reduce}/groupby.d.ts +21 -21
  197. package/dist/with-lookup/reduce/index.d.ts +34 -0
  198. package/dist/with-lookup/{aggregate → reduce}/reducers.d.ts +10 -10
  199. package/dist/with-lookup/{aggregate/aggregation.d.ts → reduce/reduction.d.ts} +21 -21
  200. package/dist/with-lookup/{aggregate → reduce}/strategy.d.ts +15 -15
  201. package/dist/with-party/session/index.d.ts +2 -0
  202. package/dist/with-party/sync/index.d.ts +2 -0
  203. package/dist/with-party/team/keyring.d.ts +20 -1
  204. package/dist/with-party/team/noydb-facade.d.ts +2 -1
  205. package/dist/{withdraw-accessible-Q2EMATCU.js → withdraw-accessible-GO6KQJVM.js} +8 -8
  206. package/package.json +6 -34
  207. package/dist/aggregate/index.js.map +0 -1
  208. package/dist/as/index.js +0 -30
  209. package/dist/at/index.js +0 -1
  210. package/dist/by/index.js +0 -11
  211. package/dist/chunk-2YELV6TV.js +0 -1
  212. package/dist/chunk-7ICV4ASA.js.map +0 -1
  213. package/dist/chunk-AFAPBZAA.js +0 -54
  214. package/dist/chunk-AFAPBZAA.js.map +0 -1
  215. package/dist/chunk-BY5YBSXA.js.map +0 -1
  216. package/dist/chunk-CJVEAVYH.js +0 -205
  217. package/dist/chunk-CJVEAVYH.js.map +0 -1
  218. package/dist/chunk-CKUYQO2P.js.map +0 -1
  219. package/dist/chunk-EEZCB74X.js.map +0 -1
  220. package/dist/chunk-FIP7KI2P.js.map +0 -1
  221. package/dist/chunk-HQKRZIX6.js.map +0 -1
  222. package/dist/chunk-IGLU4ME7.js +0 -255
  223. package/dist/chunk-IGLU4ME7.js.map +0 -1
  224. package/dist/chunk-J5TEU77Q.js.map +0 -1
  225. package/dist/chunk-KJTIAECI.js.map +0 -1
  226. package/dist/chunk-L2CAWCQL.js.map +0 -1
  227. package/dist/chunk-LB7FD65R.js +0 -163
  228. package/dist/chunk-LB7FD65R.js.map +0 -1
  229. package/dist/chunk-QMMOMBH6.js.map +0 -1
  230. package/dist/chunk-TNATF3HB.js.map +0 -1
  231. package/dist/chunk-XUFAFHQM.js.map +0 -1
  232. package/dist/chunk-YTW6ZIPD.js.map +0 -1
  233. package/dist/chunk-YZN6NRTR.js.map +0 -1
  234. package/dist/executor-SHYLIBOM.js +0 -26
  235. package/dist/in/index.js +0 -1
  236. package/dist/liberate-ZP7UB57K.js +0 -24
  237. package/dist/noydb-BNDGEK5X.js +0 -71
  238. package/dist/on/index.js +0 -17
  239. package/dist/port/as/index.d.ts +0 -26
  240. package/dist/port/at/index.d.ts +0 -18
  241. package/dist/port/in/index.d.ts +0 -21
  242. package/dist/port/on/index.d.ts +0 -27
  243. package/dist/port/ui/index.d.ts +0 -21
  244. package/dist/port/with/index.d.ts +0 -18
  245. package/dist/request-withdrawal-UN3TRHWI.js.map +0 -1
  246. package/dist/revoke-OLO2OVR7.js.map +0 -1
  247. package/dist/signer-MGGKPYAN.js.map +0 -1
  248. package/dist/stale-NBROTA66.js.map +0 -1
  249. package/dist/storage-3R37QZLA.js.map +0 -1
  250. package/dist/ui/index.js +0 -1
  251. package/dist/ui/index.js.map +0 -1
  252. package/dist/with/index.js +0 -31
  253. package/dist/with/index.js.map +0 -1
  254. package/dist/with-lookup/aggregate/index.d.ts +0 -23
  255. package/dist/withdraw-accessible-Q2EMATCU.js.map +0 -1
  256. /package/dist/{api-22ES33N3.js.map → api-5QVQX4HG.js.map} +0 -0
  257. /package/dist/{backup-YCHAC575.js.map → backup-USYSNCYM.js.map} +0 -0
  258. /package/dist/{chunk-RWW3I3PO.js.map → chunk-2BVW754E.js.map} +0 -0
  259. /package/dist/{chunk-VEGQYPCP.js.map → chunk-2ZSC454H.js.map} +0 -0
  260. /package/dist/{chunk-S4YERMGJ.js.map → chunk-32467U5J.js.map} +0 -0
  261. /package/dist/{chunk-UVBHM7AK.js.map → chunk-3GXDB3NQ.js.map} +0 -0
  262. /package/dist/{chunk-HAPY7WFP.js.map → chunk-3TZUC4WS.js.map} +0 -0
  263. /package/dist/{chunk-M6QA2KK2.js.map → chunk-44Y3P5U6.js.map} +0 -0
  264. /package/dist/{chunk-WQN5SM7P.js.map → chunk-4B3DL75F.js.map} +0 -0
  265. /package/dist/{chunk-OHV6T5JB.js.map → chunk-6SSWOUUS.js.map} +0 -0
  266. /package/dist/{chunk-6RPWILRH.js.map → chunk-7IQWHYL2.js.map} +0 -0
  267. /package/dist/{chunk-I2XEBEEF.js.map → chunk-AZXEOEQK.js.map} +0 -0
  268. /package/dist/{chunk-K7BADAOS.js.map → chunk-C2V7AJO2.js.map} +0 -0
  269. /package/dist/{chunk-YCAJDK4O.js.map → chunk-E7FSBI6I.js.map} +0 -0
  270. /package/dist/{chunk-YWZEDG7F.js.map → chunk-EPME33Y4.js.map} +0 -0
  271. /package/dist/{chunk-YXZNGHID.js.map → chunk-H5GMROCB.js.map} +0 -0
  272. /package/dist/{chunk-FTCGEUOY.js.map → chunk-HDF5R2K6.js.map} +0 -0
  273. /package/dist/{chunk-R2N37AA6.js.map → chunk-HVPW6PCX.js.map} +0 -0
  274. /package/dist/{chunk-YXIVUWDU.js.map → chunk-HXVRRJBD.js.map} +0 -0
  275. /package/dist/{chunk-5ATANZSW.js.map → chunk-ICYC5YNI.js.map} +0 -0
  276. /package/dist/{chunk-QZJEYZ4I.js.map → chunk-JGOKAZNB.js.map} +0 -0
  277. /package/dist/{chunk-7BIJS6II.js.map → chunk-JTIPVW4J.js.map} +0 -0
  278. /package/dist/{chunk-SC4JLMZI.js.map → chunk-KCZAFDP5.js.map} +0 -0
  279. /package/dist/{chunk-GP54LU5N.js.map → chunk-LG2GUYRX.js.map} +0 -0
  280. /package/dist/{chunk-QMZ5A6FQ.js.map → chunk-M7W2KYTL.js.map} +0 -0
  281. /package/dist/{chunk-K4BWPNJO.js.map → chunk-MLCTPWSO.js.map} +0 -0
  282. /package/dist/{chunk-GEEJPID6.js.map → chunk-MMVQ3SUO.js.map} +0 -0
  283. /package/dist/{chunk-TNJVDG2B.js.map → chunk-NA374QG7.js.map} +0 -0
  284. /package/dist/{chunk-V5JUAW4M.js.map → chunk-QVIZDLAR.js.map} +0 -0
  285. /package/dist/{chunk-2CRZOVDI.js.map → chunk-UNREYBZO.js.map} +0 -0
  286. /package/dist/{chunk-UTEATWHO.js.map → chunk-VNJMLOQS.js.map} +0 -0
  287. /package/dist/{chunk-JAMDDLIM.js.map → chunk-WCJJQV2D.js.map} +0 -0
  288. /package/dist/{chunk-OMSKGLYA.js.map → chunk-WWBC4KLB.js.map} +0 -0
  289. /package/dist/{chunk-JIHH26WQ.js.map → chunk-XG7OZDOS.js.map} +0 -0
  290. /package/dist/{chunk-QBOQI6PG.js.map → chunk-XONZGK6J.js.map} +0 -0
  291. /package/dist/{chunk-YQQPNXNO.js.map → chunk-XSOGLHGY.js.map} +0 -0
  292. /package/dist/{chunk-3OWYOECI.js.map → chunk-XY6MNSAF.js.map} +0 -0
  293. /package/dist/{chunk-X3MWEFPT.js.map → chunk-YGMREQAK.js.map} +0 -0
  294. /package/dist/{chunk-ILM6X6CP.js.map → chunk-ZF572E2M.js.map} +0 -0
  295. /package/dist/{chunk-OGVE4IJW.js.map → chunk-ZHMUFYZF.js.map} +0 -0
  296. /package/dist/{chunk-YFFEF6HR.js.map → chunk-ZHZ4PET5.js.map} +0 -0
  297. /package/dist/{chunk-YZNKFYDC.js.map → chunk-ZM72UO3Y.js.map} +0 -0
  298. /package/dist/{classified-marker-52P3D72W.js.map → classified-marker-SVDRXLD3.js.map} +0 -0
  299. /package/dist/{as/index.js.map → collection-facade-S5PPKZD5.js.map} +0 -0
  300. /package/dist/{at/index.js.map → cover-ADBCTIKN.js.map} +0 -0
  301. /package/dist/{dead-filter-JXVCKS6W.js.map → dead-filter-HKDMTMVY.js.map} +0 -0
  302. /package/dist/{by/index.js.map → delegation-EV7LKJPH.js.map} +0 -0
  303. /package/dist/{chunk-2YELV6TV.js.map → derive-5LDJW76F.js.map} +0 -0
  304. /package/dist/{dispatch-SMXUO7W5.js.map → dispatch-V5MSMQYX.js.map} +0 -0
  305. /package/dist/{collection-facade-XKCFHSLR.js.map → enclave-ZA7C3H2L.js.map} +0 -0
  306. /package/dist/{cover-5BSNJREH.js.map → executor-SVHAJZ4A.js.map} +0 -0
  307. /package/dist/{delegation-WWZPEDK2.js.map → export-accessible-S35YKIBL.js.map} +0 -0
  308. /package/dist/{derive-CWWFEQ4N.js.map → extract-partition-UVHAM5WZ.js.map} +0 -0
  309. /package/dist/{fanout-sidecar-WWXVHHUH.js.map → fanout-sidecar-HRMHC34B.js.map} +0 -0
  310. /package/dist/{enclave-I5H3GINP.js.map → issue-5X3SMCF4.js.map} +0 -0
  311. /package/dist/{executor-SHYLIBOM.js.map → ledger-K6JBFL3Z.js.map} +0 -0
  312. /package/dist/{export-accessible-FBL6TDSK.js.map → liberate-NHTCKBU4.js.map} +0 -0
  313. /package/dist/{extract-partition-ZYIRYMTI.js.map → link-set-XVZY2ODC.js.map} +0 -0
  314. /package/dist/{in/index.js.map → noydb-TI3RFU6M.js.map} +0 -0
  315. /package/dist/{issue-F76PAGIR.js.map → policy-QWGJB7P7.js.map} +0 -0
  316. /package/dist/{post-register-XIAHB6KF.js.map → post-register-5VHHVFJY.js.map} +0 -0
  317. /package/dist/{ledger-M2BKCNVS.js.map → register-CEX7R7NE.js.map} +0 -0
  318. /package/dist/{liberate-ZP7UB57K.js.map → registry-DIKMRXUC.js.map} +0 -0
  319. /package/dist/{link-set-ZU4E5J5S.js.map → registry-EWIB5NTI.js.map} +0 -0
  320. /package/dist/{noydb-BNDGEK5X.js.map → request-withdrawal-AAG57QO4.js.map} +0 -0
  321. /package/dist/{reveal-VWXRV2XU.js.map → reveal-7OOT5XPD.js.map} +0 -0
  322. /package/dist/{on/index.js.map → revoke-U5LCIJMF.js.map} +0 -0
  323. /package/dist/{seed-CDBFOTIK.js.map → seed-GVOI6QP6.js.map} +0 -0
  324. /package/dist/{policy-IY2YEA3A.js.map → signer-NAA2OX7H.js.map} +0 -0
  325. /package/dist/{register-HB4TQZSV.js.map → stale-BJO2WIN7.js.map} +0 -0
  326. /package/dist/{registry-6BMBFEXT.js.map → storage-FL7XXZTN.js.map} +0 -0
  327. /package/dist/{store-coordination-provider-P3IU5JHD.js.map → store-coordination-provider-DX5HECK3.js.map} +0 -0
  328. /package/dist/{walk-E3OVLBFR.js.map → walk-JXMWKKQW.js.map} +0 -0
  329. /package/dist/with-lookup/{aggregate → reduce}/canonical-key.d.ts +0 -0
  330. /package/dist/{registry-JOFO7RAH.js.map → withdraw-accessible-GO6KQJVM.js.map} +0 -0
@@ -4,15 +4,15 @@ import {
4
4
  SIGNER_RECORD_ID,
5
5
  loadOrCreateSigner,
6
6
  loadSigner
7
- } from "./chunk-QZJEYZ4I.js";
8
- import "./chunk-GEEJPID6.js";
9
- import "./chunk-SC4JLMZI.js";
7
+ } from "./chunk-JGOKAZNB.js";
8
+ import "./chunk-MMVQ3SUO.js";
9
+ import "./chunk-KCZAFDP5.js";
10
10
  import "./chunk-5WLDZZ6S.js";
11
11
  import "./chunk-5HSSTOOG.js";
12
12
  import "./chunk-G4MFQXYX.js";
13
13
  import "./chunk-LP7BEXCT.js";
14
14
  import "./chunk-7U6AB7DZ.js";
15
- import "./chunk-YTW6ZIPD.js";
15
+ import "./chunk-DOZFU7OZ.js";
16
16
  import "./chunk-6SYOHUHM.js";
17
17
  import "./chunk-PZ5AY32C.js";
18
18
  export {
@@ -22,4 +22,4 @@ export {
22
22
  loadOrCreateSigner,
23
23
  loadSigner
24
24
  };
25
- //# sourceMappingURL=signer-MGGKPYAN.js.map
25
+ //# sourceMappingURL=signer-NAA2OX7H.js.map
@@ -1,16 +1,19 @@
1
+ import {
2
+ NO_SNAPSHOTS
3
+ } from "../chunk-NIKO2BBZ.js";
1
4
  import {
2
5
  readPod,
3
6
  writePod
4
- } from "../chunk-YCAJDK4O.js";
5
- import "../chunk-YFFEF6HR.js";
6
- import "../chunk-GEEJPID6.js";
7
- import "../chunk-SC4JLMZI.js";
7
+ } from "../chunk-E7FSBI6I.js";
8
+ import "../chunk-ZHZ4PET5.js";
9
+ import "../chunk-MMVQ3SUO.js";
10
+ import "../chunk-KCZAFDP5.js";
8
11
  import "../chunk-5WLDZZ6S.js";
9
12
  import "../chunk-5HSSTOOG.js";
10
13
  import "../chunk-G4MFQXYX.js";
11
14
  import "../chunk-LP7BEXCT.js";
12
15
  import "../chunk-7U6AB7DZ.js";
13
- import "../chunk-YTW6ZIPD.js";
16
+ import "../chunk-DOZFU7OZ.js";
14
17
  import {
15
18
  SnapshotNotFoundError
16
19
  } from "../chunk-6SYOHUHM.js";
@@ -154,6 +157,7 @@ function withSnapshots(opts) {
154
157
  };
155
158
  }
156
159
  export {
160
+ NO_SNAPSHOTS,
157
161
  SnapshotNotFoundError,
158
162
  withSnapshots
159
163
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/with-fork/snapshots/engine.ts","../../src/with-fork/snapshots/active.ts"],"sourcesContent":["import { writePod, readPod } from '../../with-pod/bundle.js'\nimport { SnapshotNotFoundError } from '../../kernel/errors.js'\nimport type { NoydbPodStore } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { SnapshotMeta, RetentionPolicy, SnapshotIndex } from './strategy.js'\n\nexport class SnapshotEngine {\n constructor(\n private readonly store: NoydbPodStore,\n private readonly retention: RetentionPolicy,\n ) {}\n\n private indexKey(vaultName: string): string {\n return `${vaultName}__index`\n }\n\n private snapKey(vaultName: string, n: number): string {\n return `${vaultName}__snap_${n.toString().padStart(6, '0')}`\n }\n\n private autoKey(vaultName: string): string {\n return `${vaultName}__auto`\n }\n\n private async readIndex(\n vaultName: string,\n ): Promise<{ index: SnapshotIndex; indexVersion: string | null }> {\n const result = await this.store.readBundle(this.indexKey(vaultName))\n if (!result) return { index: { snapshots: [], nextCounter: 1 }, indexVersion: null }\n const text = new TextDecoder().decode(result.bytes)\n return { index: JSON.parse(text) as SnapshotIndex, indexVersion: result.version }\n }\n\n private async writeIndex(\n vaultName: string,\n index: SnapshotIndex,\n expectedVersion: string | null,\n ): Promise<void> {\n const bytes = new TextEncoder().encode(JSON.stringify(index))\n await this.store.writeBundle(this.indexKey(vaultName), bytes, expectedVersion)\n }\n\n async snapshot(\n vault: Vault,\n by: string,\n opts?: { label?: string; note?: string },\n ): Promise<SnapshotMeta> {\n const bytes = await writePod(vault, {})\n const { index, indexVersion } = await this.readIndex(vault.name)\n const key = this.snapKey(vault.name, index.nextCounter)\n\n // Write blob first. If the subsequent index write fails, the next snapshot()\n // call will re-derive the same key (counter not persisted) and overwrite this blob.\n // This is an accepted v1 trade-off: failure window is narrow and requires a store\n // error between the two writes. A retry produces a fresh snapshot at the same key.\n await this.store.writeBundle(key, bytes, null)\n\n const meta: SnapshotMeta = {\n version: key,\n ...(opts?.label !== undefined ? { label: opts.label } : {}),\n ...(opts?.note !== undefined ? { note: opts.note } : {}),\n exportedAt: new Date().toISOString(),\n exportedBy: by,\n size: bytes.length,\n integrity: 'verified',\n }\n\n const newIndex: SnapshotIndex = {\n snapshots: [...index.snapshots, meta],\n nextCounter: index.nextCounter + 1,\n // Preserve the rolling auto slot — on-demand snapshots never touch it.\n ...(index.auto ? { auto: index.auto } : {}),\n }\n const toDelete = this.applyRetention(newIndex)\n await this.writeIndex(vault.name, newIndex, indexVersion)\n\n for (const k of toDelete) {\n await this.store.deleteBundle(k)\n }\n\n return meta\n }\n\n /**\n * Rolling auto-snapshot. Overwrites the single fixed `<vault>__auto` key and\n * stores its meta in `index.auto`, separate from the immutable `snapshots`\n * pool — retention never prunes it. Used by the cadence scheduler.\n */\n async autoSnapshot(\n vault: Vault,\n by: string,\n opts?: { label?: string; note?: string },\n ): Promise<SnapshotMeta> {\n const bytes = await writePod(vault, {})\n const { index, indexVersion } = await this.readIndex(vault.name)\n const key = this.autoKey(vault.name)\n\n // Unconditional overwrite of the rolling slot.\n await this.store.writeBundle(key, bytes, null)\n\n const meta: SnapshotMeta = {\n version: key,\n label: opts?.label ?? 'auto',\n ...(opts?.note !== undefined ? { note: opts.note } : {}),\n exportedAt: new Date().toISOString(),\n exportedBy: by,\n size: bytes.length,\n integrity: 'verified',\n auto: true,\n }\n\n index.auto = meta\n await this.writeIndex(vault.name, index, indexVersion)\n return meta\n }\n\n async listSnapshots(vaultId: string): Promise<SnapshotMeta[]> {\n const { index } = await this.readIndex(vaultId)\n const immutable = [...index.snapshots].reverse()\n return index.auto ? [index.auto, ...immutable] : immutable\n }\n\n async restoreSnapshot(vault: Vault, version: string): Promise<void> {\n if (!version.startsWith(`${vault.name}__`)) throw new SnapshotNotFoundError(version)\n const result = await this.store.readBundle(version)\n if (!result) throw new SnapshotNotFoundError(version)\n const { dumpJson } = await readPod(result.bytes)\n await vault.load(dumpJson)\n }\n\n /**\n * Applies the configured retention policy to `index`, mutating `index.snapshots`\n * in place and returning the blob keys that should be deleted from the store.\n * Called by `snapshot()` before the index is written.\n *\n * @internal — public for direct testing only\n */\n applyRetention(index: SnapshotIndex): string[] {\n const prune = this.retention.prune ?? true\n if (!prune) return []\n\n const toDelete: string[] = []\n let remaining = index.snapshots.slice()\n\n if (this.retention.keepLast !== undefined && remaining.length > this.retention.keepLast) {\n const excess = remaining.splice(0, remaining.length - this.retention.keepLast)\n toDelete.push(...excess.map(m => m.version))\n }\n\n if (this.retention.maxAgeDays !== undefined) {\n const cutoffMs = this.retention.maxAgeDays * 86_400_000\n const now = Date.now()\n const fresh = remaining.filter(m => now - new Date(m.exportedAt).getTime() <= cutoffMs)\n toDelete.push(...remaining.filter(m => !fresh.includes(m)).map(m => m.version))\n remaining = fresh\n }\n\n index.snapshots = remaining\n return toDelete\n }\n}\n","import { SnapshotEngine } from './engine.js'\nimport type { SnapshotStrategy, RetentionPolicy } from './strategy.js'\nimport type { SnapshotPolicy } from './policy.js'\nimport type { NoydbPodStore } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\n\nexport interface WithSnapshotsOptions {\n /** Bundle store where snapshot blobs and the sidecar index are written. */\n store: NoydbPodStore\n /**\n * Declarative retention policy. Enforced eagerly after each on-demand `snapshot()`.\n * Defaults to no retention (all on-demand snapshots kept forever). Never affects\n * the rolling auto-snapshot.\n */\n retention?: RetentionPolicy\n /**\n * Automatic-snapshot cadence. Default `mode:'manual'` ⇒ no timers; snapshots\n * stay on-demand. Set `mode:'debounce'`/`'interval'` to enable auto-snapshots\n * to the rolling `<vault>__auto` key.\n */\n snapshotPolicy?: SnapshotPolicy\n}\n\nexport function withSnapshots(opts: WithSnapshotsOptions): SnapshotStrategy {\n const engine = new SnapshotEngine(opts.store, opts.retention ?? {})\n return {\n snapshot(vault, by, snapOpts) {\n return engine.snapshot(vault as Vault, by, snapOpts)\n },\n listSnapshots(vaultId) {\n return engine.listSnapshots(vaultId)\n },\n restoreSnapshot(vault, version) {\n return engine.restoreSnapshot(vault as Vault, version)\n },\n autoSnapshot(vault, by, snapOpts) {\n return engine.autoSnapshot(vault as Vault, by, snapOpts)\n },\n ...(opts.snapshotPolicy ? { policy: opts.snapshotPolicy } : {}),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAMO,IAAM,iBAAN,MAAqB;AAAA,EAC1B,YACmB,OACA,WACjB;AAFiB;AACA;AAAA,EAChB;AAAA,EAFgB;AAAA,EACA;AAAA,EAGX,SAAS,WAA2B;AAC1C,WAAO,GAAG,SAAS;AAAA,EACrB;AAAA,EAEQ,QAAQ,WAAmB,GAAmB;AACpD,WAAO,GAAG,SAAS,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC;AAAA,EAC5D;AAAA,EAEQ,QAAQ,WAA2B;AACzC,WAAO,GAAG,SAAS;AAAA,EACrB;AAAA,EAEA,MAAc,UACZ,WACgE;AAChE,UAAM,SAAS,MAAM,KAAK,MAAM,WAAW,KAAK,SAAS,SAAS,CAAC;AACnE,QAAI,CAAC,OAAQ,QAAO,EAAE,OAAO,EAAE,WAAW,CAAC,GAAG,aAAa,EAAE,GAAG,cAAc,KAAK;AACnF,UAAM,OAAO,IAAI,YAAY,EAAE,OAAO,OAAO,KAAK;AAClD,WAAO,EAAE,OAAO,KAAK,MAAM,IAAI,GAAoB,cAAc,OAAO,QAAQ;AAAA,EAClF;AAAA,EAEA,MAAc,WACZ,WACA,OACA,iBACe;AACf,UAAM,QAAQ,IAAI,YAAY,EAAE,OAAO,KAAK,UAAU,KAAK,CAAC;AAC5D,UAAM,KAAK,MAAM,YAAY,KAAK,SAAS,SAAS,GAAG,OAAO,eAAe;AAAA,EAC/E;AAAA,EAEA,MAAM,SACJ,OACA,IACA,MACuB;A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;AAAA,IAC7C;AAEA,QAAI,KAAK,UAAU,eAAe,QAAW;AAC3C,YAAM,WAAW,KAAK,UAAU,aAAa;AAC7C,YAAM,MAAM,KAAK,IAAI;AACrB,YAAM,QAAQ,UAAU,OAAO,OAAK,MAAM,IAAI,KAAK,EAAE,UAAU,EAAE,QAAQ,KAAK,QAAQ;AACtF,eAAS,KAAK,GAAG,UAAU,OAAO,OAAK,CAAC,MAAM,SAAS,CAAC,CAAC,EAAE,IAAI,OAAK,EAAE,OAAO,CAAC;AAC9E,kBAAY;AAAA,IACd;AAEA,UAAM,YAAY;AAClB,WAAO;AAAA,EACT;AACF;;;ACzIO,SAAS,cAAc,MAA8C;AAC1E,QAAM,SAAS,IAAI,eAAe,KAAK,OAAO,KAAK,aAAa,CAAC,CAAC;AAClE,SAAO;AAAA,IACL,SAAS,OAAO,IAAI,UAAU;AAC5B,aAAO,OAAO,SAAS,OAAgB,IAAI,QAAQ;AAAA,IACrD;AAAA,IACA,cAAc,SAAS;AACrB,aAAO,OAAO,cAAc,OAAO;AAAA,IACrC;AAAA,IACA,gBAAgB,OAAO,SAAS;AAC9B,aAAO,OAAO,gBAAgB,OAAgB,OAAO;AAAA,IACvD;AAAA,IACA,aAAa,OAAO,IAAI,UAAU;AAChC,aAAO,OAAO,aAAa,OAAgB,IAAI,QAAQ;AAAA,IACzD;AAAA,IACA,GAAI,KAAK,iBAAiB,EAAE,QAAQ,KAAK,eAAe,IAAI,CAAC;AAAA,EAC/D;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/with-fork/snapshots/engine.ts","../../src/with-fork/snapshots/active.ts"],"sourcesContent":["import { writePod, readPod } from '../../with-pod/bundle.js'\nimport { SnapshotNotFoundError } from '../../kernel/errors.js'\nimport type { NoydbPodStore } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { SnapshotMeta, RetentionPolicy, SnapshotIndex } from './strategy.js'\n\nexport class SnapshotEngine {\n constructor(\n private readonly store: NoydbPodStore,\n private readonly retention: RetentionPolicy,\n ) {}\n\n private indexKey(vaultName: string): string {\n return `${vaultName}__index`\n }\n\n private snapKey(vaultName: string, n: number): string {\n return `${vaultName}__snap_${n.toString().padStart(6, '0')}`\n }\n\n private autoKey(vaultName: string): string {\n return `${vaultName}__auto`\n }\n\n private async readIndex(\n vaultName: string,\n ): Promise<{ index: SnapshotIndex; indexVersion: string | null }> {\n const result = await this.store.readBundle(this.indexKey(vaultName))\n if (!result) return { index: { snapshots: [], nextCounter: 1 }, indexVersion: null }\n const text = new TextDecoder().decode(result.bytes)\n return { index: JSON.parse(text) as SnapshotIndex, indexVersion: result.version }\n }\n\n private async writeIndex(\n vaultName: string,\n index: SnapshotIndex,\n expectedVersion: string | null,\n ): Promise<void> {\n const bytes = new TextEncoder().encode(JSON.stringify(index))\n await this.store.writeBundle(this.indexKey(vaultName), bytes, expectedVersion)\n }\n\n async snapshot(\n vault: Vault,\n by: string,\n opts?: { label?: string; note?: string },\n ): Promise<SnapshotMeta> {\n const bytes = await writePod(vault, {})\n const { index, indexVersion } = await this.readIndex(vault.name)\n const key = this.snapKey(vault.name, index.nextCounter)\n\n // Write blob first. If the subsequent index write fails, the next snapshot()\n // call will re-derive the same key (counter not persisted) and overwrite this blob.\n // This is an accepted v1 trade-off: failure window is narrow and requires a store\n // error between the two writes. A retry produces a fresh snapshot at the same key.\n await this.store.writeBundle(key, bytes, null)\n\n const meta: SnapshotMeta = {\n version: key,\n ...(opts?.label !== undefined ? { label: opts.label } : {}),\n ...(opts?.note !== undefined ? { note: opts.note } : {}),\n exportedAt: new Date().toISOString(),\n exportedBy: by,\n size: bytes.length,\n integrity: 'verified',\n }\n\n const newIndex: SnapshotIndex = {\n snapshots: [...index.snapshots, meta],\n nextCounter: index.nextCounter + 1,\n // Preserve the rolling auto slot — on-demand snapshots never touch it.\n ...(index.auto ? { auto: index.auto } : {}),\n }\n const toDelete = this.applyRetention(newIndex)\n await this.writeIndex(vault.name, newIndex, indexVersion)\n\n for (const k of toDelete) {\n await this.store.deleteBundle(k)\n }\n\n return meta\n }\n\n /**\n * Rolling auto-snapshot. Overwrites the single fixed `<vault>__auto` key and\n * stores its meta in `index.auto`, separate from the immutable `snapshots`\n * pool — retention never prunes it. Used by the cadence scheduler.\n */\n async autoSnapshot(\n vault: Vault,\n by: string,\n opts?: { label?: string; note?: string },\n ): Promise<SnapshotMeta> {\n const bytes = await writePod(vault, {})\n const { index, indexVersion } = await this.readIndex(vault.name)\n const key = this.autoKey(vault.name)\n\n // Unconditional overwrite of the rolling slot.\n await this.store.writeBundle(key, bytes, null)\n\n const meta: SnapshotMeta = {\n version: key,\n label: opts?.label ?? 'auto',\n ...(opts?.note !== undefined ? { note: opts.note } : {}),\n exportedAt: new Date().toISOString(),\n exportedBy: by,\n size: bytes.length,\n integrity: 'verified',\n auto: true,\n }\n\n index.auto = meta\n await this.writeIndex(vault.name, index, indexVersion)\n return meta\n }\n\n async listSnapshots(vaultId: string): Promise<SnapshotMeta[]> {\n const { index } = await this.readIndex(vaultId)\n const immutable = [...index.snapshots].reverse()\n return index.auto ? [index.auto, ...immutable] : immutable\n }\n\n async restoreSnapshot(vault: Vault, version: string): Promise<void> {\n if (!version.startsWith(`${vault.name}__`)) throw new SnapshotNotFoundError(version)\n const result = await this.store.readBundle(version)\n if (!result) throw new SnapshotNotFoundError(version)\n const { dumpJson } = await readPod(result.bytes)\n await vault.load(dumpJson)\n }\n\n /**\n * Applies the configured retention policy to `index`, mutating `index.snapshots`\n * in place and returning the blob keys that should be deleted from the store.\n * Called by `snapshot()` before the index is written.\n *\n * @internal — public for direct testing only\n */\n applyRetention(index: SnapshotIndex): string[] {\n const prune = this.retention.prune ?? true\n if (!prune) return []\n\n const toDelete: string[] = []\n let remaining = index.snapshots.slice()\n\n if (this.retention.keepLast !== undefined && remaining.length > this.retention.keepLast) {\n const excess = remaining.splice(0, remaining.length - this.retention.keepLast)\n toDelete.push(...excess.map(m => m.version))\n }\n\n if (this.retention.maxAgeDays !== undefined) {\n const cutoffMs = this.retention.maxAgeDays * 86_400_000\n const now = Date.now()\n const fresh = remaining.filter(m => now - new Date(m.exportedAt).getTime() <= cutoffMs)\n toDelete.push(...remaining.filter(m => !fresh.includes(m)).map(m => m.version))\n remaining = fresh\n }\n\n index.snapshots = remaining\n return toDelete\n }\n}\n","import { SnapshotEngine } from './engine.js'\nimport type { SnapshotStrategy, RetentionPolicy } from './strategy.js'\nimport type { SnapshotPolicy } from './policy.js'\nimport type { NoydbPodStore } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\n\nexport interface WithSnapshotsOptions {\n /** Bundle store where snapshot blobs and the sidecar index are written. */\n store: NoydbPodStore\n /**\n * Declarative retention policy. Enforced eagerly after each on-demand `snapshot()`.\n * Defaults to no retention (all on-demand snapshots kept forever). Never affects\n * the rolling auto-snapshot.\n */\n retention?: RetentionPolicy\n /**\n * Automatic-snapshot cadence. Default `mode:'manual'` ⇒ no timers; snapshots\n * stay on-demand. Set `mode:'debounce'`/`'interval'` to enable auto-snapshots\n * to the rolling `<vault>__auto` key.\n */\n snapshotPolicy?: SnapshotPolicy\n}\n\nexport function withSnapshots(opts: WithSnapshotsOptions): SnapshotStrategy {\n const engine = new SnapshotEngine(opts.store, opts.retention ?? {})\n return {\n snapshot(vault, by, snapOpts) {\n return engine.snapshot(vault as Vault, by, snapOpts)\n },\n listSnapshots(vaultId) {\n return engine.listSnapshots(vaultId)\n },\n restoreSnapshot(vault, version) {\n return engine.restoreSnapshot(vault as Vault, version)\n },\n autoSnapshot(vault, by, snapOpts) {\n return engine.autoSnapshot(vault as Vault, by, snapOpts)\n },\n ...(opts.snapshotPolicy ? { policy: opts.snapshotPolicy } : {}),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAMO,IAAM,iBAAN,MAAqB;AAAA,EAC1B,YACmB,OACA,WACjB;AAFiB;AACA;AAAA,EAChB;AAAA,EAFgB;AAAA,EACA;AAAA,EAGX,SAAS,WAA2B;AAC1C,WAAO,GAA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AAa,CAAC,CAAC;AAClE,SAAO;AAAA,IACL,SAAS,OAAO,IAAI,UAAU;AAC5B,aAAO,OAAO,SAAS,OAAgB,IAAI,QAAQ;AAAA,IACrD;AAAA,IACA,cAAc,SAAS;AACrB,aAAO,OAAO,cAAc,OAAO;AAAA,IACrC;AAAA,IACA,gBAAgB,OAAO,SAAS;AAC9B,aAAO,OAAO,gBAAgB,OAAgB,OAAO;AAAA,IACvD;AAAA,IACA,aAAa,OAAO,IAAI,UAAU;AAChC,aAAO,OAAO,aAAa,OAAgB,IAAI,QAAQ;AAAA,IACzD;AAAA,IACA,GAAI,KAAK,iBAAiB,EAAE,QAAQ,KAAK,eAAe,IAAI,CAAC;AAAA,EAC/D;AACF;","names":[]}
@@ -6,15 +6,16 @@ import {
6
6
  isMVStale,
7
7
  markMVStale,
8
8
  resolveStaleMVOnRead
9
- } from "./chunk-CKUYQO2P.js";
10
- import "./chunk-GEEJPID6.js";
11
- import "./chunk-SC4JLMZI.js";
9
+ } from "./chunk-VDTWFN2P.js";
10
+ import "./chunk-5D2ALSM5.js";
11
+ import "./chunk-MMVQ3SUO.js";
12
+ import "./chunk-KCZAFDP5.js";
12
13
  import "./chunk-5WLDZZ6S.js";
13
14
  import "./chunk-5HSSTOOG.js";
14
15
  import "./chunk-G4MFQXYX.js";
15
16
  import "./chunk-LP7BEXCT.js";
16
17
  import "./chunk-7U6AB7DZ.js";
17
- import "./chunk-YTW6ZIPD.js";
18
+ import "./chunk-DOZFU7OZ.js";
18
19
  import "./chunk-6SYOHUHM.js";
19
20
  import "./chunk-PZ5AY32C.js";
20
21
  export {
@@ -26,4 +27,4 @@ export {
26
27
  markMVStale,
27
28
  resolveStaleMVOnRead
28
29
  };
29
- //# sourceMappingURL=stale-NBROTA66.js.map
30
+ //# sourceMappingURL=stale-BJO2WIN7.js.map
@@ -3,15 +3,15 @@ import {
3
3
  loadPersistedSchema,
4
4
  loadPersistedSchemaEntry,
5
5
  savePersistedSchema
6
- } from "./chunk-S4YERMGJ.js";
7
- import "./chunk-GEEJPID6.js";
8
- import "./chunk-SC4JLMZI.js";
6
+ } from "./chunk-32467U5J.js";
7
+ import "./chunk-MMVQ3SUO.js";
8
+ import "./chunk-KCZAFDP5.js";
9
9
  import "./chunk-5WLDZZ6S.js";
10
10
  import "./chunk-5HSSTOOG.js";
11
11
  import "./chunk-G4MFQXYX.js";
12
12
  import "./chunk-LP7BEXCT.js";
13
13
  import "./chunk-7U6AB7DZ.js";
14
- import "./chunk-YTW6ZIPD.js";
14
+ import "./chunk-DOZFU7OZ.js";
15
15
  import "./chunk-6SYOHUHM.js";
16
16
  import "./chunk-PZ5AY32C.js";
17
17
  export {
@@ -20,4 +20,4 @@ export {
20
20
  loadPersistedSchemaEntry,
21
21
  savePersistedSchema
22
22
  };
23
- //# sourceMappingURL=storage-3R37QZLA.js.map
23
+ //# sourceMappingURL=storage-FL7XXZTN.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  loadFence,
3
3
  saveFence
4
- } from "./chunk-M6QA2KK2.js";
4
+ } from "./chunk-44Y3P5U6.js";
5
5
  import {
6
6
  NOYDB_FORMAT_VERSION
7
- } from "./chunk-YTW6ZIPD.js";
7
+ } from "./chunk-DOZFU7OZ.js";
8
8
  import "./chunk-PZ5AY32C.js";
9
9
 
10
10
  // src/with-shape/schema-update/client-registry.ts
@@ -139,4 +139,4 @@ function unref(timer) {
139
139
  export {
140
140
  StoreCoordinationProvider
141
141
  };
142
- //# sourceMappingURL=store-coordination-provider-P3IU5JHD.js.map
142
+ //# sourceMappingURL=store-coordination-provider-DX5HECK3.js.map
@@ -1,18 +1,21 @@
1
+ import {
2
+ NO_SYNC
3
+ } from "../chunk-EP5L47XV.js";
1
4
  import {
2
5
  PresenceHandle,
3
6
  SyncEngine,
4
7
  SyncTransaction
5
- } from "../chunk-OGVE4IJW.js";
8
+ } from "../chunk-ZHMUFYZF.js";
6
9
  import "../chunk-VQNJ7UZL.js";
7
10
  import "../chunk-TMR64XPL.js";
8
- import "../chunk-GEEJPID6.js";
9
- import "../chunk-SC4JLMZI.js";
11
+ import "../chunk-MMVQ3SUO.js";
12
+ import "../chunk-KCZAFDP5.js";
10
13
  import "../chunk-5WLDZZ6S.js";
11
14
  import "../chunk-5HSSTOOG.js";
12
15
  import "../chunk-G4MFQXYX.js";
13
16
  import "../chunk-LP7BEXCT.js";
14
17
  import "../chunk-7U6AB7DZ.js";
15
- import "../chunk-YTW6ZIPD.js";
18
+ import "../chunk-DOZFU7OZ.js";
16
19
  import "../chunk-6SYOHUHM.js";
17
20
  import "../chunk-PZ5AY32C.js";
18
21
 
@@ -31,6 +34,7 @@ function withSync() {
31
34
  };
32
35
  }
33
36
  export {
37
+ NO_SYNC,
34
38
  withSync
35
39
  };
36
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/with-party/team/sync-active.ts"],"sourcesContent":["/**\n * Active sync strategy — `withSync()` returns the real implementation\n * that wires the `SyncEngine`, `SyncTransaction`, and `PresenceHandle`\n * constructors into the Noydb / Vault / Collection hot paths.\n *\n * Consumers opt in by:\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withSync } from '@noy-db/hub/sync'\n *\n * const db = await createNoydb({\n * store: localStore,\n * sync: remoteStore,\n * user: ...,\n * syncStrategy: withSync(),\n * })\n * ```\n *\n * The factory delegates to the existing `sync.ts`,\n * `sync-transaction.ts`, and `presence.ts` modules. Splitting the\n * import chain through this file is what lets tsup tree-shake the\n * ~856 LOC of replication + presence machinery out of the default\n * bundle when no `withSync()` import is present.\n *\n * Keyring + grant/revoke/magic-link/delegation stay in the always-on\n * core (or tree-shake via direct named imports) — those are required\n * for any multi-user vault, even purely local ones.\n *\n * @public\n */\n\nimport type { SyncStrategy, BuildSyncEngineOptions } from './sync-strategy.js'\nimport type { PresenceHandleOpts } from './presence.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport { SyncEngine } from './sync.js'\nimport { SyncTransaction } from './sync-transaction.js'\nimport { PresenceHandle } from './presence.js'\n\nexport function withSync(): SyncStrategy {\n return {\n buildSyncEngine(opts: BuildSyncEngineOptions): SyncEngine {\n return new SyncEngine(opts)\n },\n buildSyncTransaction(vault: Vault, engine: SyncEngine): SyncTransaction {\n return new SyncTransaction(vault, engine)\n },\n buildPresence<P>(opts: PresenceHandleOpts): PresenceHandle<P> {\n return new PresenceHandle<P>(opts)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCO,SAAS,WAAyB;AACvC,SAAO;AAAA,IACL,gBAAgB,MAA0C;AACxD,aAAO,IAAI,WAAW,IAAI;AAAA,IAC5B;AAAA,IACA,qBAAqB,OAAc,QAAqC;AACtE,aAAO,IAAI,gBAAgB,OAAO,MAAM;AAAA,IAC1C;AAAA,IACA,cAAiB,MAA6C;AAC5D,aAAO,IAAI,eAAkB,IAAI;AAAA,IACnC;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/with-party/team/sync-active.ts"],"sourcesContent":["/**\n * Active sync strategy — `withSync()` returns the real implementation\n * that wires the `SyncEngine`, `SyncTransaction`, and `PresenceHandle`\n * constructors into the Noydb / Vault / Collection hot paths.\n *\n * Consumers opt in by:\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withSync } from '@noy-db/hub/sync'\n *\n * const db = await createNoydb({\n * store: localStore,\n * sync: remoteStore,\n * user: ...,\n * syncStrategy: withSync(),\n * })\n * ```\n *\n * The factory delegates to the existing `sync.ts`,\n * `sync-transaction.ts`, and `presence.ts` modules. Splitting the\n * import chain through this file is what lets tsup tree-shake the\n * ~856 LOC of replication + presence machinery out of the default\n * bundle when no `withSync()` import is present.\n *\n * Keyring + grant/revoke/magic-link/delegation stay in the always-on\n * core (or tree-shake via direct named imports) — those are required\n * for any multi-user vault, even purely local ones.\n *\n * @public\n */\n\nimport type { SyncStrategy, BuildSyncEngineOptions } from './sync-strategy.js'\nimport type { PresenceHandleOpts } from './presence.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport { SyncEngine } from './sync.js'\nimport { SyncTransaction } from './sync-transaction.js'\nimport { PresenceHandle } from './presence.js'\n\nexport function withSync(): SyncStrategy {\n return {\n buildSyncEngine(opts: BuildSyncEngineOptions): SyncEngine {\n return new SyncEngine(opts)\n },\n buildSyncTransaction(vault: Vault, engine: SyncEngine): SyncTransaction {\n return new SyncTransaction(vault, engine)\n },\n buildPresence<P>(opts: PresenceHandleOpts): PresenceHandle<P> {\n return new PresenceHandle<P>(opts)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCO,SAAS,WAAyB;AACvC,SAAO;AAAA,IACL,gBAAgB,MAA0C;AACxD,aAAO,IAAI,WAAW,IAAI;AAAA,IAC5B;AAAA,IACA,qBAAqB,OAAc,QAAqC;AACtE,aAAO,IAAI,gBAAgB,OAAO,MAAM;AAAA,IAC1C;AAAA,IACA,cAAiB,MAA6C;AAC5D,aAAO,IAAI,eAAkB,IAAI;AAAA,IACnC;AAAA,EACF;AACF;","names":[]}
@@ -5,25 +5,32 @@ import {
5
5
  listCredentials,
6
6
  putCredential,
7
7
  withTeam
8
- } from "../chunk-YWZEDG7F.js";
8
+ } from "../chunk-EPME33Y4.js";
9
9
  import {
10
10
  NO_TEAM,
11
+ burnPaperRecoveryEntry,
11
12
  deriveMagicLinkContentKey,
12
13
  enrollAuthenticator,
13
14
  findAuthenticator,
14
15
  isMagicLinkGrantExpired,
15
16
  listMagicLinkGrants,
17
+ loadPaperRecoveryEntries,
16
18
  magicLinkGrantRecordId,
19
+ mintPaperRecoveryEntry,
20
+ mintWrappedDeksBlob,
17
21
  readMagicLinkGrantRecord,
18
22
  recoverSecret,
19
23
  recoverUser,
20
24
  removeAuthenticator,
21
25
  revokeMagicLinkGrant,
22
26
  rotateSecret,
27
+ savePaperRecoveryEntries,
28
+ unwrapDeksFromBlob,
29
+ unwrapDeksFromPaperEntry,
23
30
  unwrapMagicLinkGrant,
24
31
  updateAuthenticator,
25
32
  writeMagicLinkGrant
26
- } from "../chunk-FIP7KI2P.js";
33
+ } from "../chunk-M4GO4ZJK.js";
27
34
  import {
28
35
  SYNC_CREDENTIALS_COLLECTION,
29
36
  buildRecipientKeyringFile,
@@ -41,33 +48,24 @@ import {
41
48
  persistKeyring,
42
49
  revoke,
43
50
  updateKeyringIdentity
44
- } from "../chunk-3LJYHE7S.js";
45
- import "../chunk-6RPWILRH.js";
46
- import {
47
- burnPaperRecoveryEntry,
48
- loadPaperRecoveryEntries,
49
- mintPaperRecoveryEntry,
50
- mintWrappedDeksBlob,
51
- savePaperRecoveryEntries,
52
- unwrapDeksFromBlob,
53
- unwrapDeksFromPaperEntry
54
- } from "../chunk-CJVEAVYH.js";
51
+ } from "../chunk-ZDFU34XY.js";
52
+ import "../chunk-7IQWHYL2.js";
55
53
  import {
56
54
  PresenceHandle,
57
55
  SyncEngine,
58
56
  SyncTransaction
59
- } from "../chunk-OGVE4IJW.js";
57
+ } from "../chunk-ZHMUFYZF.js";
60
58
  import "../chunk-VQNJ7UZL.js";
61
59
  import "../chunk-TMR64XPL.js";
62
60
  import "../chunk-LC7DSMHR.js";
63
- import "../chunk-GEEJPID6.js";
64
- import "../chunk-SC4JLMZI.js";
61
+ import "../chunk-MMVQ3SUO.js";
62
+ import "../chunk-KCZAFDP5.js";
65
63
  import "../chunk-5WLDZZ6S.js";
66
64
  import "../chunk-5HSSTOOG.js";
67
65
  import "../chunk-G4MFQXYX.js";
68
66
  import "../chunk-LP7BEXCT.js";
69
67
  import "../chunk-7U6AB7DZ.js";
70
- import "../chunk-YTW6ZIPD.js";
68
+ import "../chunk-DOZFU7OZ.js";
71
69
  import {
72
70
  TeamNotEnabledError
73
71
  } from "../chunk-6SYOHUHM.js";
@@ -11,16 +11,16 @@ import {
11
11
  putAtTier,
12
12
  syncDerivedOutputs,
13
13
  withTiers
14
- } from "../chunk-FTCGEUOY.js";
14
+ } from "../chunk-HDF5R2K6.js";
15
15
  import "../chunk-LC7DSMHR.js";
16
- import "../chunk-GEEJPID6.js";
17
- import "../chunk-SC4JLMZI.js";
16
+ import "../chunk-MMVQ3SUO.js";
17
+ import "../chunk-KCZAFDP5.js";
18
18
  import "../chunk-5WLDZZ6S.js";
19
19
  import "../chunk-5HSSTOOG.js";
20
20
  import "../chunk-G4MFQXYX.js";
21
21
  import "../chunk-LP7BEXCT.js";
22
22
  import "../chunk-7U6AB7DZ.js";
23
- import "../chunk-YTW6ZIPD.js";
23
+ import "../chunk-DOZFU7OZ.js";
24
24
  import {
25
25
  TiersNotEnabledError
26
26
  } from "../chunk-6SYOHUHM.js";
package/dist/tx/index.js CHANGED
@@ -4,11 +4,15 @@ import {
4
4
  TxVault,
5
5
  runTransaction
6
6
  } from "../chunk-QVGEVZ5F.js";
7
+ import {
8
+ lazy
9
+ } from "../chunk-5D2ALSM5.js";
7
10
  import "../chunk-ZJADGNYF.js";
8
11
  import "../chunk-6SYOHUHM.js";
9
12
  import "../chunk-PZ5AY32C.js";
10
13
 
11
14
  // src/with-commit/tx/dry-run.ts
15
+ var loadGuardExecutor = lazy(() => import("../executor-OHET7TF7.js"));
12
16
  var SEP = " ";
13
17
  var keyOf = (op) => `${op.vaultName}${SEP}${op.collectionName}${SEP}${op.id}`;
14
18
  async function runDryRun(db, fn) {
@@ -44,7 +48,7 @@ async function runDryRun(db, fn) {
44
48
  const gctx = { existing: before, vault: facade, userId: v.userId, role: v.role };
45
49
  try {
46
50
  await registry.runChecks(op.collectionName, after, gctx);
47
- const { GuardExecutor } = await import("../executor-OHET7TF7.js");
51
+ const { GuardExecutor } = await loadGuardExecutor();
48
52
  for (const g of guards) {
49
53
  await GuardExecutor.checkFrozenFields(g, op.id, before, after);
50
54
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/with-commit/tx/dry-run.ts","../../src/with-commit/tx/active.ts"],"sourcesContent":["/**\n * Dry-run transactions. Runs the tx body to STAGE ops, then builds\n * the directly-affected diff (before = current committed via collection.get,\n * after = staged record) and collects guard violations — without executing\n * phase 2. No adapter writes, no write-hooks, no commit. MV/derivation\n * cascade is NOT simulated (v2). Mirrors the guard loop in\n * `Collection._putInternal` — keep the two in sync.\n */\nimport type { Noydb } from '../../kernel/noydb.js'\nimport { TxContext, type StagedOp } from './transaction.js'\nimport type { GuardExecutor as GuardExecutorType } from '../../with-audit/guards/executor.js'\n\nexport interface AffectedDocument {\n readonly vault: string\n readonly op: 'create' | 'update' | 'delete'\n readonly collection: string\n readonly docId: string\n readonly before: unknown // current committed record; null when creating\n readonly after: unknown // staged record; null when deleting\n}\n\nexport interface GuardViolation {\n readonly vault: string\n readonly collection: string\n readonly docId: string\n readonly message: string\n}\n\nexport interface DryRunResult {\n readonly affected: ReadonlyArray<AffectedDocument>\n readonly guardViolations: ReadonlyArray<GuardViolation>\n}\n\nconst SEP = ' '\nconst keyOf = (op: StagedOp) => `${op.vaultName}${SEP}${op.collectionName}${SEP}${op.id}`\n\nexport async function runDryRun(\n db: Noydb,\n fn: (tx: TxContext) => unknown,\n): Promise<DryRunResult> {\n const ctx = new TxContext(db)\n await fn(ctx) // stage ops (reads see staged writes via TxCollection); nothing committed\n\n // Dedup by (vault, collection, id) — last staged op wins.\n const lastOp = new Map<string, StagedOp>()\n for (const op of ctx._ops) lastOp.set(keyOf(op), op)\n\n const affected: AffectedDocument[] = []\n const guardViolations: GuardViolation[] = []\n\n for (const op of lastOp.values()) {\n const v = db.vault(op.vaultName)\n const coll = v.collection(op.collectionName)\n const before = await coll.get(op.id)\n\n if (op.type === 'delete') {\n affected.push({ vault: op.vaultName, op: 'delete', collection: op.collectionName, docId: op.id, before, after: null })\n continue\n }\n\n const after = op.record ?? null\n affected.push({\n vault: op.vaultName,\n op: before === null ? 'create' : 'update',\n collection: op.collectionName,\n docId: op.id,\n before,\n after,\n })\n\n // Guard violations — run the SAME checks Collection._putInternal does,\n // with the SAME ctx (existing + read-only facade + userId + role), but\n // collect the first thrown error instead of aborting.\n const registry = v._getGuardRegistry()\n if (!registry) continue\n const guards = registry.guardsFor(op.collectionName)\n if (guards.length === 0) continue\n const facade = v._getReadOnlyFacade()\n if (!facade) continue\n const gctx = { existing: before as Record<string, unknown> | null, vault: facade, userId: v.userId, role: v.role }\n try {\n await registry.runChecks(op.collectionName, after as Record<string, unknown>, gctx)\n const { GuardExecutor } = (await import('../../with-audit/guards/executor.js')) as { GuardExecutor: typeof GuardExecutorType }\n for (const g of guards) {\n await GuardExecutor.checkFrozenFields(g, op.id, before as Record<string, unknown> | null, after as Record<string, unknown>)\n }\n } catch (err) {\n guardViolations.push({\n vault: op.vaultName,\n collection: op.collectionName,\n docId: op.id,\n message: err instanceof Error ? err.message : String(err),\n })\n }\n }\n\n return { affected, guardViolations }\n}\n","/**\n * Active transactions strategy. Only reachable via `@noy-db/hub/tx`.\n */\n\nimport { runTransaction } from './transaction.js'\nimport { runDryRun } from './dry-run.js'\nimport type { TxStrategy } from './strategy.js'\nimport type { TransactionInvariant } from './invariants.js'\n\n/**\n * Options for {@link withTransactions}. Currently only commit-time\n * changeset `invariants` (see {@link TransactionInvariant}).\n */\nexport interface TransactionStrategyOptions {\n /**\n * Commit-time set-level invariants run over the changeset on every\n * commit (ordinary AND amendment). See {@link TransactionInvariant}.\n */\n invariants?: ReadonlyArray<TransactionInvariant>\n}\n\n/**\n * Build the default transactions strategy. Pass into\n * `createNoydb({ txStrategy: withTransactions() })` to enable\n * `db.transaction(fn)` (and `db.transaction({ dryRun: true }, fn)`).\n *\n * Supply `{ invariants }` to register commit-time changeset invariants —\n * set-level constraints that fire after the writes commit and revert the\n * transaction on a throw. Unlike `amendment.invariant`, these run for\n * ordinary `db.transaction(fn)` calls (and amendments) with no role gate.\n */\nexport function withTransactions(opts?: TransactionStrategyOptions): TxStrategy {\n const invariants = opts?.invariants ?? []\n return {\n runTransaction: (db, fn, options) => runTransaction(db, fn, options, invariants),\n runDryRun,\n }\n}\n"],"mappings":";;;;;;;;;;;AAiCA,IAAM,MAAM;AACZ,IAAM,QAAQ,CAAC,OAAiB,GAAG,GAAG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AAC7E,iBAAW,KAAK,QAAQ;AACtB,cAAM,cAAc,kBAAkB,GAAG,GAAG,IAAI,QAA0C,KAAgC;AAAA,MAC5H;AAAA,IACF,SAAS,KAAK;AACZ,sBAAgB,KAAK;AAAA,QACnB,OAAO,GAAG;AAAA,QACV,YAAY,GAAG;AAAA,QACf,OAAO,GAAG;AAAA,QACV,SAAS,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAAA,MAC1D,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO,EAAE,UAAU,gBAAgB;AACrC;;;AClEO,SAAS,iBAAiB,MAA+C;AAC9E,QAAM,aAAa,MAAM,cAAc,CAAC;AACxC,SAAO;AAAA,IACL,gBAAgB,CAAC,IAAI,IAAI,YAAY,eAAe,IAAI,IAAI,SAAS,UAAU;AAAA,IAC/E;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/with-commit/tx/dry-run.ts","../../src/with-commit/tx/active.ts"],"sourcesContent":["/**\n * Dry-run transactions. Runs the tx body to STAGE ops, then builds\n * the directly-affected diff (before = current committed via collection.get,\n * after = staged record) and collects guard violations — without executing\n * phase 2. No adapter writes, no write-hooks, no commit. MV/derivation\n * cascade is NOT simulated (v2). Mirrors the guard loop in\n * `Collection._putInternal` — keep the two in sync.\n */\nimport type { Noydb } from '../../kernel/noydb.js'\nimport { TxContext, type StagedOp } from './transaction.js'\n\nimport { lazy } from '../../kernel/lazy.js'\n\n/** #846c — one memoized binding instead of a cast at the call site. */\nconst loadGuardExecutor = lazy(() => import('../../with-audit/guards/executor.js'))\n\nexport interface AffectedDocument {\n readonly vault: string\n readonly op: 'create' | 'update' | 'delete'\n readonly collection: string\n readonly docId: string\n readonly before: unknown // current committed record; null when creating\n readonly after: unknown // staged record; null when deleting\n}\n\nexport interface GuardViolation {\n readonly vault: string\n readonly collection: string\n readonly docId: string\n readonly message: string\n}\n\nexport interface DryRunResult {\n readonly affected: ReadonlyArray<AffectedDocument>\n readonly guardViolations: ReadonlyArray<GuardViolation>\n}\n\nconst SEP = ' '\nconst keyOf = (op: StagedOp) => `${op.vaultName}${SEP}${op.collectionName}${SEP}${op.id}`\n\nexport async function runDryRun(\n db: Noydb,\n fn: (tx: TxContext) => unknown,\n): Promise<DryRunResult> {\n const ctx = new TxContext(db)\n await fn(ctx) // stage ops (reads see staged writes via TxCollection); nothing committed\n\n // Dedup by (vault, collection, id) — last staged op wins.\n const lastOp = new Map<string, StagedOp>()\n for (const op of ctx._ops) lastOp.set(keyOf(op), op)\n\n const affected: AffectedDocument[] = []\n const guardViolations: GuardViolation[] = []\n\n for (const op of lastOp.values()) {\n const v = db.vault(op.vaultName)\n const coll = v.collection(op.collectionName)\n const before = await coll.get(op.id)\n\n if (op.type === 'delete') {\n affected.push({ vault: op.vaultName, op: 'delete', collection: op.collectionName, docId: op.id, before, after: null })\n continue\n }\n\n const after = op.record ?? null\n affected.push({\n vault: op.vaultName,\n op: before === null ? 'create' : 'update',\n collection: op.collectionName,\n docId: op.id,\n before,\n after,\n })\n\n // Guard violations — run the SAME checks Collection._putInternal does,\n // with the SAME ctx (existing + read-only facade + userId + role), but\n // collect the first thrown error instead of aborting.\n const registry = v._getGuardRegistry()\n if (!registry) continue\n const guards = registry.guardsFor(op.collectionName)\n if (guards.length === 0) continue\n const facade = v._getReadOnlyFacade()\n if (!facade) continue\n const gctx = { existing: before as Record<string, unknown> | null, vault: facade, userId: v.userId, role: v.role }\n try {\n await registry.runChecks(op.collectionName, after as Record<string, unknown>, gctx)\n const { GuardExecutor } = await loadGuardExecutor()\n for (const g of guards) {\n await GuardExecutor.checkFrozenFields(g, op.id, before as Record<string, unknown> | null, after as Record<string, unknown>)\n }\n } catch (err) {\n guardViolations.push({\n vault: op.vaultName,\n collection: op.collectionName,\n docId: op.id,\n message: err instanceof Error ? err.message : String(err),\n })\n }\n }\n\n return { affected, guardViolations }\n}\n","/**\n * Active transactions strategy. Only reachable via `@noy-db/hub/tx`.\n */\n\nimport { runTransaction } from './transaction.js'\nimport { runDryRun } from './dry-run.js'\nimport type { TxStrategy } from './strategy.js'\nimport type { TransactionInvariant } from './invariants.js'\n\n/**\n * Options for {@link withTransactions}. Currently only commit-time\n * changeset `invariants` (see {@link TransactionInvariant}).\n */\nexport interface TransactionStrategyOptions {\n /**\n * Commit-time set-level invariants run over the changeset on every\n * commit (ordinary AND amendment). See {@link TransactionInvariant}.\n */\n invariants?: ReadonlyArray<TransactionInvariant>\n}\n\n/**\n * Build the default transactions strategy. Pass into\n * `createNoydb({ txStrategy: withTransactions() })` to enable\n * `db.transaction(fn)` (and `db.transaction({ dryRun: true }, fn)`).\n *\n * Supply `{ invariants }` to register commit-time changeset invariants —\n * set-level constraints that fire after the writes commit and revert the\n * transaction on a throw. Unlike `amendment.invariant`, these run for\n * ordinary `db.transaction(fn)` calls (and amendments) with no role gate.\n */\nexport function withTransactions(opts?: TransactionStrategyOptions): TxStrategy {\n const invariants = opts?.invariants ?? []\n return {\n runTransaction: (db, fn, options) => runTransaction(db, fn, options, invariants),\n runDryRun,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAcA,IAAM,oBAAoB,KAAK,MAAM,OAAO,yBAAqC,CAAC;AAuBlF,IAAM,MAAM;AACZ,IAAM,QAAQ,CAAC,OAAiB,GAAG,GAAG,SAAS,GAAG,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,GAAG,EAAE;AAEvF,eAAsB,UACpB,IACA,IACuB;AACvB,QAAM,MAAM,IAAI,UAAU,EAAE;AAC5B,QAAM,GAAG,GAAG;AAGZ,QAAM,SAAS,oBAAI,IAAsB;AACzC,aAAW,MAAM,IAAI,KAAM,QAAO,IAAI,MAAM,EAAE,GAAG,EAAE;AAEnD,QAAM,WAA+B,CAAC;AACtC,QAAM,kBAAoC,CAAC;AAE3C,aAAW,MAAM,OAAO,OAAO,GAAG;AAChC,UAAM,IAAI,GAAG,MAAM,GAAG,SAAS;AAC/B,UAAM,OAAO,EAAE,WAAW,GAAG,cAAc;AAC3C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AC,IAAI,IAAI,YAAY,eAAe,IAAI,IAAI,SAAS,UAAU;AAAA,IAC/E;AAAA,EACF;AACF;","names":[]}
@@ -36,3 +36,5 @@ export { runCompaction, BLOB_EVICTION_AUDIT_COLLECTION } from '../../with-shape/
36
36
  export type { BlobFieldsConfig, BlobFieldPolicy, BlobEvictionEntry, CompactRunOptions, CompactionResult, CompactionContext, } from '../../with-shape/blobs/blob-compaction.js';
37
37
  export { createExportBlobsHandle, ExportBlobsAbortedError, EXPORT_AUDIT_COLLECTION, } from '../../with-shape/blobs/export-blobs.js';
38
38
  export type { ExportBlobsOptions, ExportedBlob, ExportBlobsHandle, ExportBlobsAuditEntry, } from '../../with-shape/blobs/export-blobs.js';
39
+ /** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
40
+ export { NO_BLOBS } from '../../port/with/blob-strategy.js';
@@ -110,7 +110,7 @@ export interface I18nTextOptions {
110
110
  * the lenient `'substitute'`). The `mv` layer fires for materialized views
111
111
  * that declare `{ i18nLocale, i18nFields }` — UNION (group-key i18n fields
112
112
  * resolve before the unified-row bucketing) and query-form (resolved in
113
- * `GroupedAggregation.run` before `groupAndReduce`); grouping a raw i18n field
113
+ * `GroupedReduction.run` before `groupAndReduce`); grouping a raw i18n field
114
114
  * without a locale throws. The `join` layer resolves a joined right-side i18n
115
115
  * field to the query locale (`toArray({ locale })` or the vault default; raw
116
116
  * when locale-less). The `export` layer fires for
@@ -19,3 +19,5 @@ export type { ScriptWarning } from './script.js';
19
19
  export { withI18n } from './active.js';
20
20
  export type { I18nStrategy } from './strategy.js';
21
21
  export { ReservedCollectionNameError, DictKeyMissingError, DictKeyInUseError, MissingTranslationError, LocaleNotSpecifiedError, TranslatorNotConfiguredError, ScriptViolationError, StaticDictReadonlyError, UnknownDictCodeError, } from '../../kernel/errors.js';
22
+ /** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
23
+ export { NO_I18N } from '../../port/with/i18n-strategy.js';
@@ -22,7 +22,7 @@
22
22
  * exactly like the generic reducers they replace.
23
23
  */
24
24
  import type { MoneyDescriptor } from './descriptor.js';
25
- import type { AggregateSpec } from '../../with-lookup/aggregate/aggregation.js';
25
+ import type { ReduceSpec } from '../../with-lookup/reduce/reduction.js';
26
26
  export type FxRates = Record<string, number | string>;
27
27
  /**
28
28
  * Rewrite any `sum` / `min` / `max` reducer over a declared money field
@@ -30,4 +30,4 @@ export type FxRates = Record<string, number | string>;
30
30
  * reducers over non-money fields) pass through unchanged. Returns a new
31
31
  * spec; the input is not mutated.
32
32
  */
33
- export declare function wrapMoneyReducers(spec: AggregateSpec, moneyFields: Record<string, MoneyDescriptor>): AggregateSpec;
33
+ export declare function wrapMoneyReducers(spec: ReduceSpec, moneyFields: Record<string, MoneyDescriptor>): ReduceSpec;
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-SEU6QHH4.js";
7
7
  import {
8
8
  loadPersistedSchema
9
- } from "./chunk-S4YERMGJ.js";
10
- import "./chunk-GEEJPID6.js";
11
- import "./chunk-SC4JLMZI.js";
9
+ } from "./chunk-32467U5J.js";
10
+ import "./chunk-MMVQ3SUO.js";
11
+ import "./chunk-KCZAFDP5.js";
12
12
  import "./chunk-5WLDZZ6S.js";
13
13
  import "./chunk-5HSSTOOG.js";
14
14
  import "./chunk-G4MFQXYX.js";
15
15
  import "./chunk-LP7BEXCT.js";
16
16
  import "./chunk-7U6AB7DZ.js";
17
- import "./chunk-YTW6ZIPD.js";
17
+ import "./chunk-DOZFU7OZ.js";
18
18
  import "./chunk-6SYOHUHM.js";
19
19
  import "./chunk-PZ5AY32C.js";
20
20
 
@@ -238,4 +238,4 @@ function summariseAggregateOp(value) {
238
238
  export {
239
239
  dumpVaultSchema
240
240
  };
241
- //# sourceMappingURL=walk-E3OVLBFR.js.map
241
+ //# sourceMappingURL=walk-JXMWKKQW.js.map
@@ -12,3 +12,5 @@ export { withConsent } from './active.js';
12
12
  export type { ConsentStrategy } from './strategy.js';
13
13
  export { CONSENT_AUDIT_COLLECTION, writeConsentEntry, loadConsentEntries, } from './consent.js';
14
14
  export type { ConsentContext, ConsentOp, ConsentAuditEntry, ConsentAuditFilter, } from './consent.js';
15
+ /** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
16
+ export { NO_CONSENT } from './strategy.js';
@@ -16,3 +16,5 @@ export { withPeriods } from './active.js';
16
16
  export type { PeriodsStrategy } from './strategy.js';
17
17
  export { PERIODS_COLLECTION, PERIOD_FREEZES_COLLECTION, PERIOD_ARCHIVES_COLLECTION, PERIOD_TARGET_PURGES_COLLECTION, periodExclusiveUpperBound, loadPeriods, chainAnchor, assertTsWritable, validatePeriodName, appendPeriodLedgerEntry, } from './periods.js';
18
18
  export type { PeriodRecord, PeriodFreezeRecord, PeriodArchiveRecord, PeriodTargetPurgeRecord, TargetPurgeCount, ClosePeriodOptions, OpenPeriodOptions, CarryForwardContext, ReadOnlyCollection, } from './periods.js';
19
+ /** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
20
+ export { NO_PERIODS } from './strategy.js';
@@ -10,8 +10,8 @@
10
10
  * @packageDocumentation
11
11
  */
12
12
  export { readPath } from '../kernel/query/predicate.js';
13
- export { reduceRecords } from '../with-lookup/aggregate/aggregation.js';
14
- export { groupAndReduce } from '../with-lookup/aggregate/groupby.js';
13
+ export { reduceRecords } from '../with-lookup/reduce/reduction.js';
14
+ export { groupAndReduce } from '../with-lookup/reduce/groupby.js';
15
15
  export { generateULID } from '../with-pod/ulid.js';
16
16
  export { sha256Hex } from '../kernel/enclave/index.js';
17
17
  export { isQuorum, runDrainBarrier } from '../port/by/index.js';
@@ -26,7 +26,7 @@ export type { Operator } from '../kernel/query/predicate.js';
26
26
  export type { Query } from '../kernel/query/builder.js';
27
27
  export type { JoinStrategy } from '../kernel/query/join.js';
28
28
  export type { LiveQuery } from '../kernel/query/live.js';
29
- export type { AggregateResult, AggregateSpec, LiveAggregation, } from '../with-lookup/aggregate/aggregation.js';
29
+ export type { ReduceResult, ReduceSpec, LiveReduction, } from '../with-lookup/reduce/reduction.js';
30
30
  export type { IndexDef } from '../with-lookup/indexing/eager-indexes.js';
31
31
  export type { FuseOptions } from '../with-lookup/search/fuse.js';
32
32
  export type { RetrieveHit, RetrieveOptions } from '../with-lookup/search/retrieve-types.js';
@@ -14,3 +14,5 @@ export { withCrdt } from './active.js';
14
14
  export type { CrdtStrategy } from './strategy.js';
15
15
  export { resolveCrdtSnapshot, mergeCrdtStates, buildLwwMapState, buildRgaState, } from './crdt.js';
16
16
  export type { CrdtMode, CrdtState, LwwMapState, RgaState, YjsState, } from './crdt.js';
17
+ /** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
18
+ export { NO_CRDT } from './strategy.js';
@@ -28,3 +28,5 @@ export { computePatch, applyPatch } from './ledger/patch.js';
28
28
  export type { JsonPatch, JsonPatchOp } from './ledger/patch.js';
29
29
  export { VaultInstant, CollectionInstant } from './time-machine.js';
30
30
  export type { VaultEngine } from './time-machine.js';
31
+ /** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
32
+ export { NO_HISTORY } from './strategy.js';
@@ -12,3 +12,5 @@
12
12
  export { withShadow } from './active.js';
13
13
  export type { ShadowStrategy } from './strategy.js';
14
14
  export { VaultFrame, CollectionFrame } from './vault-frame.js';
15
+ /** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
16
+ export { NO_SHADOW } from './strategy.js';
@@ -3,3 +3,5 @@ export type { WithSnapshotsOptions } from './active.js';
3
3
  export type { SnapshotStrategy, SnapshotMeta, RetentionPolicy } from './strategy.js';
4
4
  export type { SnapshotPolicy, SnapshotMode } from './policy.js';
5
5
  export { SnapshotNotFoundError } from '../../kernel/errors.js';
6
+ /** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
7
+ export { NO_SNAPSHOTS } from './strategy.js';
@@ -1,7 +1,7 @@
1
1
  import type { Query } from '../../kernel/query/builder.js';
2
2
  import type { Collection } from '../../kernel/collection.js';
3
- import type { AggregateSpec, Aggregation } from '../../with-lookup/aggregate/aggregation.js';
4
- import type { GroupedAggregation } from '../../with-lookup/aggregate/groupby.js';
3
+ import type { ReduceSpec, Reduction } from '../../with-lookup/reduce/reduction.js';
4
+ import type { GroupedReduction } from '../../with-lookup/reduce/groupby.js';
5
5
  import type { JoinStrategy } from '../../kernel/query/join.js';
6
6
  import type { MoneyDescriptor } from '../../via/money/descriptor.js';
7
7
  import type { I18nTextDescriptor } from '../../via/i18n/core.js';
@@ -207,7 +207,7 @@ export interface MaterializedViewStrategy<TRow extends Record<string, unknown>>
207
207
  * (multi-source UNION). Registration throws
208
208
  * `MaterializedViewConfigError` if both are set or neither is set.
209
209
  */
210
- query?: (db: MVQueryContext) => Query<TRow> | Aggregation<TRow> | GroupedAggregation<TRow>;
210
+ query?: (db: MVQueryContext) => Query<TRow> | Reduction<TRow> | GroupedReduction<TRow>;
211
211
  /**
212
212
  * UNION-form sources: an explicit list of sibling collections
213
213
  * that contribute rows to a single MV. Each arm's `map` projects a
@@ -261,14 +261,14 @@ export interface MaterializedViewStrategy<TRow extends Record<string, unknown>>
261
261
  */
262
262
  groupBy?: string | ReadonlyArray<string>;
263
263
  /**
264
- * Aggregation spec for UNION mode. Applied per-group after
264
+ * Reduction spec for UNION mode. Applied per-group after
265
265
  * {@link groupBy} buckets the concatenated mapped-row stream from
266
- * {@link unionSources}. Same shape as the `AggregateSpec` passed to
266
+ * {@link unionSources}. Same shape as the `ReduceSpec` passed to
267
267
  * `Query.aggregate()`.
268
268
  *
269
269
  * UNION-mode only. Ignored if {@link query} is set.
270
270
  */
271
- aggregate?: AggregateSpec;
271
+ aggregate?: ReduceSpec;
272
272
  /**
273
273
  * Money descriptors for the UNION-mode aggregate, keyed by the
274
274
  * OUTPUT/intermediate field name as it appears in the mapped row and
@@ -325,7 +325,7 @@ export interface MaterializedViewStrategy<TRow extends Record<string, unknown>>
325
325
  rowKey: (row: TRow) => string;
326
326
  /**
327
327
  * Explicit source collections. Required when `query()` returns
328
- * an `Aggregation` or `GroupedAggregation` rather than a `Query<T>`
328
+ * an `Reduction` or `GroupedReduction` rather than a `Query<T>`
329
329
  * — the dependency analyzer can't introspect through `groupBy().aggregate()`
330
330
  * back to the source. Optional for plain `Query<T>` results — the
331
331
  * analyzer extracts dependencies automatically from the query plan.
@@ -25,3 +25,5 @@ export { PersistedCollectionIndex, IDX_PREFIX, COMPOSITE_DELIMITER, encodeIdxId,
25
25
  export type { OrderedEntry, IngestRow, PersistedIndexDef, } from './persisted-indexes.js';
26
26
  export { LazyQuery } from './lazy-builder.js';
27
27
  export type { LazyQuerySource, LazyOrderBy } from './lazy-builder.js';
28
+ /** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
29
+ export { NO_INDEXING } from './strategy.js';
@@ -1,26 +1,26 @@
1
1
  /**
2
- * Active aggregate strategy factory. Calling `withAggregate()` returns
3
- * an `AggregateStrategy` whose methods construct real `Aggregation` /
2
+ * Active aggregate strategy factory. Calling `withReduce()` returns
3
+ * an `ReduceStrategy` whose methods construct real `Reduction` /
4
4
  * `GroupedQuery` instances and run the streaming reducer protocol.
5
5
  *
6
- * This module is only reachable through the `@noy-db/hub/aggregate`
6
+ * This module is only reachable through the `@noy-db/hub/reduce`
7
7
  * subpath — a consumer that never imports the subpath ships none of
8
8
  * this (ESM tree-shaking + hub's `"sideEffects": false`).
9
9
  */
10
- import type { AggregateStrategy } from './strategy.js';
10
+ import type { ReduceStrategy } from './strategy.js';
11
11
  /**
12
12
  * Build the default aggregate strategy. Pass into
13
- * `createNoydb({ aggregateStrategy: withAggregate() })` to light up
13
+ * `createNoydb({ reduceStrategy: withReduce() })` to light up
14
14
  * `.aggregate()` and `.groupBy()` on `Query` and `ScanBuilder`.
15
15
  *
16
16
  * @example
17
17
  * ```ts
18
18
  * import { createNoydb } from '@noy-db/hub'
19
- * import { withAggregate, sum, count } from '@noy-db/hub/aggregate'
19
+ * import { withReduce, sum, count } from '@noy-db/hub/reduce'
20
20
  *
21
21
  * const db = await createNoydb({
22
22
  * store, user, secret,
23
- * aggregateStrategy: withAggregate(),
23
+ * reduceStrategy: withReduce(),
24
24
  * })
25
25
  *
26
26
  * const totals = invoices.query()
@@ -30,4 +30,4 @@ import type { AggregateStrategy } from './strategy.js';
30
30
  * .run()
31
31
  * ```
32
32
  */
33
- export declare function withAggregate(): AggregateStrategy;
33
+ export declare function withReduce(): ReduceStrategy;