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

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 (534) hide show
  1. package/dist/api-3NKVNZPM.js +20 -0
  2. package/dist/attestation/index.js +20 -20
  3. package/dist/{backup-YCHAC575.js → backup-PTSVXDDW.js} +13 -13
  4. package/dist/blobs/index.js +15 -12
  5. package/dist/blobs/index.js.map +1 -1
  6. package/dist/broker/index.js +12 -12
  7. package/dist/cargo/index.js +36 -36
  8. package/dist/{chunk-5WLDZZ6S.js → chunk-35NMVJ7I.js} +3 -3
  9. package/dist/{chunk-TNATF3HB.js → chunk-3HUYRN24.js} +4 -4
  10. package/dist/chunk-3HUYRN24.js.map +1 -0
  11. package/dist/{chunk-TNJVDG2B.js → chunk-3XKESW5E.js} +3 -3
  12. package/dist/{chunk-MUPZ6IZX.js → chunk-4JQK3L4V.js} +2 -2
  13. package/dist/{chunk-Z4D3YGAB.js → chunk-4ZKNC6A6.js} +2 -2
  14. package/dist/{chunk-ONB627HU.js → chunk-55LX6FSX.js} +2 -2
  15. package/dist/{chunk-QMZ5A6FQ.js → chunk-56IIVAEO.js} +2 -2
  16. package/dist/chunk-5D2ALSM5.js +19 -0
  17. package/dist/chunk-5D2ALSM5.js.map +1 -0
  18. package/dist/{chunk-FHHYCBBP.js → chunk-5DRROK5W.js} +2 -2
  19. package/dist/{chunk-GTNRMJYH.js → chunk-5GQEU4DN.js} +2 -2
  20. package/dist/{chunk-YQQPNXNO.js → chunk-6L3DKWRY.js} +6 -6
  21. package/dist/chunk-6LJY7X5A.js +18 -0
  22. package/dist/chunk-6LJY7X5A.js.map +1 -0
  23. package/dist/{chunk-M6QA2KK2.js → chunk-6M2I3DKF.js} +2 -2
  24. package/dist/{chunk-FTCGEUOY.js → chunk-6R6Q3MRN.js} +7 -7
  25. package/dist/{chunk-ZUDAK436.js → chunk-6UBZ6I5Z.js} +2 -2
  26. package/dist/{chunk-SEU6QHH4.js → chunk-6ZNSB3H6.js} +5 -17
  27. package/dist/chunk-6ZNSB3H6.js.map +1 -0
  28. package/dist/chunk-AFHQATY4.js +47 -0
  29. package/dist/chunk-AFHQATY4.js.map +1 -0
  30. package/dist/{chunk-7U6AB7DZ.js → chunk-AKKRXT23.js} +2 -2
  31. package/dist/{chunk-2PDBYF2O.js → chunk-AT2JJEKJ.js} +4 -4
  32. package/dist/chunk-AT2JJEKJ.js.map +1 -0
  33. package/dist/{chunk-OWLZONGX.js → chunk-BLBAQRBM.js} +2 -2
  34. package/dist/{chunk-QBOQI6PG.js → chunk-BN4HRYAZ.js} +2 -2
  35. package/dist/{chunk-QVGEVZ5F.js → chunk-BQ6DHN4I.js} +3 -3
  36. package/dist/{chunk-GP54LU5N.js → chunk-BYFXLDVV.js} +9 -9
  37. package/dist/{chunk-FIP7KI2P.js → chunk-C25JXSOR.js} +337 -21
  38. package/dist/chunk-C25JXSOR.js.map +1 -0
  39. package/dist/chunk-CADUYBQD.js +151 -0
  40. package/dist/chunk-CADUYBQD.js.map +1 -0
  41. package/dist/{chunk-HAPY7WFP.js → chunk-CCDP6EPB.js} +13 -355
  42. package/dist/chunk-CCDP6EPB.js.map +1 -0
  43. package/dist/{chunk-QRHEAZ2Q.js → chunk-CUZLNGD5.js} +1 -1
  44. package/dist/{chunk-YXIVUWDU.js → chunk-DGBIHDVK.js} +5 -5
  45. package/dist/chunk-DSDXAKIP.js +50 -0
  46. package/dist/chunk-DSDXAKIP.js.map +1 -0
  47. package/dist/{chunk-QZJEYZ4I.js → chunk-DZAF24PG.js} +5 -5
  48. package/dist/chunk-DZFQVICS.js +23 -0
  49. package/dist/chunk-DZFQVICS.js.map +1 -0
  50. package/dist/chunk-E23UGFVC.js +63 -0
  51. package/dist/chunk-E23UGFVC.js.map +1 -0
  52. package/dist/{chunk-X3MWEFPT.js → chunk-EBKCYQ2D.js} +14 -14
  53. package/dist/chunk-EBKCYQ2D.js.map +1 -0
  54. package/dist/chunk-EP5L47XV.js +22 -0
  55. package/dist/chunk-EP5L47XV.js.map +1 -0
  56. package/dist/{chunk-TMR64XPL.js → chunk-EZNTORXE.js} +2 -2
  57. package/dist/{chunk-JAMDDLIM.js → chunk-FMNU7IUG.js} +3 -3
  58. package/dist/{chunk-YXZNGHID.js → chunk-FO6RNKKW.js} +8 -46
  59. package/dist/chunk-FO6RNKKW.js.map +1 -0
  60. package/dist/{chunk-YMUGBZN2.js → chunk-FQ5CHJR7.js} +1 -1
  61. package/dist/chunk-FQ5CHJR7.js.map +1 -0
  62. package/dist/{chunk-YZN6NRTR.js → chunk-FRMW23UK.js} +13 -11
  63. package/dist/chunk-FRMW23UK.js.map +1 -0
  64. package/dist/chunk-GJW4HX2O.js +1 -0
  65. package/dist/{chunk-7BIJS6II.js → chunk-GP3UWP22.js} +4 -4
  66. package/dist/{chunk-YTW6ZIPD.js → chunk-GZACYEOB.js} +1 -1
  67. package/dist/chunk-GZACYEOB.js.map +1 -0
  68. package/dist/{chunk-JIHH26WQ.js → chunk-HFUAFR6B.js} +6 -6
  69. package/dist/{chunk-J5TEU77Q.js → chunk-IF6WNGAK.js} +59 -4
  70. package/dist/chunk-IF6WNGAK.js.map +1 -0
  71. package/dist/{chunk-ZX5FNWH7.js → chunk-IG6KUWBX.js} +2 -2
  72. package/dist/chunk-IG6KUWBX.js.map +1 -0
  73. package/dist/{chunk-CKUYQO2P.js → chunk-IMRB2C4O.js} +7 -5
  74. package/dist/chunk-IMRB2C4O.js.map +1 -0
  75. package/dist/{chunk-RWW3I3PO.js → chunk-ISRKW4YN.js} +3 -3
  76. package/dist/{chunk-P4NUJVWL.js → chunk-IXNCZTWA.js} +2 -2
  77. package/dist/{chunk-YFFEF6HR.js → chunk-JIDLU57U.js} +3 -3
  78. package/dist/{chunk-PTT2NB46.js → chunk-JYJFGD2H.js} +2 -2
  79. package/dist/{chunk-3OWYOECI.js → chunk-JYV4JJV2.js} +5 -5
  80. package/dist/{chunk-OGVE4IJW.js → chunk-KBPU5M2E.js} +7 -7
  81. package/dist/{chunk-I2XEBEEF.js → chunk-KFRPNHWR.js} +4 -4
  82. package/dist/chunk-KFRPNHWR.js.map +1 -0
  83. package/dist/{chunk-3LJYHE7S.js → chunk-KPXM4WO6.js} +64 -57
  84. package/dist/chunk-KPXM4WO6.js.map +1 -0
  85. package/dist/{chunk-QMMOMBH6.js → chunk-KRCBZYTZ.js} +26 -177
  86. package/dist/chunk-KRCBZYTZ.js.map +1 -0
  87. package/dist/{chunk-UTEATWHO.js → chunk-KW42W6SV.js} +6 -6
  88. package/dist/{chunk-BY5YBSXA.js → chunk-L3YYLT4E.js} +15 -2
  89. package/dist/chunk-L3YYLT4E.js.map +1 -0
  90. package/dist/{chunk-UVBHM7AK.js → chunk-MANUDU7I.js} +6 -6
  91. package/dist/{chunk-YJ3TREAC.js → chunk-MHMLXJ3I.js} +2 -2
  92. package/dist/chunk-MHMLXJ3I.js.map +1 -0
  93. package/dist/{chunk-D4LAJ737.js → chunk-MSMJJB4J.js} +2 -2
  94. package/dist/chunk-MSMJJB4J.js.map +1 -0
  95. package/dist/{chunk-DYZ5CCVM.js → chunk-MXUT7FTE.js} +2 -2
  96. package/dist/chunk-MXUT7FTE.js.map +1 -0
  97. package/dist/{chunk-7ICV4ASA.js → chunk-N5PLUFH2.js} +27 -5
  98. package/dist/chunk-N5PLUFH2.js.map +1 -0
  99. package/dist/{chunk-K7BADAOS.js → chunk-NEX7JCMO.js} +4 -4
  100. package/dist/{chunk-5HSSTOOG.js → chunk-NFZGZ4AK.js} +2 -2
  101. package/dist/{chunk-XUFAFHQM.js → chunk-NJ4DYYO5.js} +7 -4
  102. package/dist/chunk-NJ4DYYO5.js.map +1 -0
  103. package/dist/{chunk-VEGQYPCP.js → chunk-NQSO4UAH.js} +8 -8
  104. package/dist/chunk-NQSO4UAH.js.map +1 -0
  105. package/dist/{chunk-GHEMAVTN.js → chunk-NYEFP7DY.js} +4 -4
  106. package/dist/chunk-NYEFP7DY.js.map +1 -0
  107. package/dist/{chunk-S4YERMGJ.js → chunk-OBPVWOSQ.js} +4 -4
  108. package/dist/{chunk-OHV6T5JB.js → chunk-OLIWCCFM.js} +2 -5
  109. package/dist/{chunk-2CRZOVDI.js → chunk-OLSARBZU.js} +2 -2
  110. package/dist/chunk-PEOZ34EM.js +13 -0
  111. package/dist/chunk-PEOZ34EM.js.map +1 -0
  112. package/dist/{chunk-KJTIAECI.js → chunk-PT4XLP6I.js} +171 -12
  113. package/dist/chunk-PT4XLP6I.js.map +1 -0
  114. package/dist/{chunk-LC7DSMHR.js → chunk-PTHKZWEH.js} +2 -14
  115. package/dist/{chunk-LC7DSMHR.js.map → chunk-PTHKZWEH.js.map} +1 -1
  116. package/dist/chunk-PVEWA2DU.js +23 -0
  117. package/dist/chunk-PVEWA2DU.js.map +1 -0
  118. package/dist/chunk-QADFHRQM.js +367 -0
  119. package/dist/chunk-QADFHRQM.js.map +1 -0
  120. package/dist/{chunk-7LP7FFJ2.js → chunk-QD46HPZG.js} +2 -2
  121. package/dist/{chunk-G4MFQXYX.js → chunk-QJNCB5SK.js} +2 -2
  122. package/dist/{chunk-6SYOHUHM.js → chunk-QZWTRENR.js} +2 -2
  123. package/dist/chunk-QZWTRENR.js.map +1 -0
  124. package/dist/{chunk-TSNRZSRC.js → chunk-RO5NM6UI.js} +2 -2
  125. package/dist/chunk-RO5NM6UI.js.map +1 -0
  126. package/dist/{chunk-GEEJPID6.js → chunk-RZPOZPZU.js} +8 -8
  127. package/dist/chunk-SGDPRCC4.js +1075 -0
  128. package/dist/chunk-SGDPRCC4.js.map +1 -0
  129. package/dist/{chunk-YCAJDK4O.js → chunk-SGQ4N5FS.js} +5 -5
  130. package/dist/{chunk-522MBPE5.js → chunk-SHEEBRZ4.js} +2 -2
  131. package/dist/{chunk-YWZEDG7F.js → chunk-SHYIA73K.js} +6 -6
  132. package/dist/{chunk-L2CAWCQL.js → chunk-SKM35Y4Q.js} +17 -26
  133. package/dist/chunk-SKM35Y4Q.js.map +1 -0
  134. package/dist/chunk-SMY5X46Z.js +14 -0
  135. package/dist/chunk-SMY5X46Z.js.map +1 -0
  136. package/dist/{chunk-K4BWPNJO.js → chunk-TE6LH6J2.js} +5 -5
  137. package/dist/{chunk-AFAPBZAA.js → chunk-TG634KCO.js} +11 -2
  138. package/dist/chunk-TG634KCO.js.map +1 -0
  139. package/dist/{chunk-V5JUAW4M.js → chunk-TIVK6PRK.js} +9 -10
  140. package/dist/chunk-TIVK6PRK.js.map +1 -0
  141. package/dist/{chunk-JN3SGXJE.js → chunk-UADPR6F4.js} +3 -3
  142. package/dist/{chunk-JN3SGXJE.js.map → chunk-UADPR6F4.js.map} +1 -1
  143. package/dist/{chunk-SBOHNJUD.js → chunk-V6UQZA2H.js} +2 -2
  144. package/dist/chunk-VG2ZSFYD.js +32 -0
  145. package/dist/chunk-VG2ZSFYD.js.map +1 -0
  146. package/dist/{chunk-SC4JLMZI.js → chunk-VH6SOCXH.js} +2 -2
  147. package/dist/chunk-VKQCVU2Z.js +21 -0
  148. package/dist/chunk-VKQCVU2Z.js.map +1 -0
  149. package/dist/chunk-VSRSQ2CR.js +654 -0
  150. package/dist/chunk-VSRSQ2CR.js.map +1 -0
  151. package/dist/{chunk-WQN5SM7P.js → chunk-W3G5REIU.js} +2 -2
  152. package/dist/{chunk-EGU4PWQW.js → chunk-W66AM5IB.js} +2 -2
  153. package/dist/chunk-W66AM5IB.js.map +1 -0
  154. package/dist/{chunk-HQKRZIX6.js → chunk-WBKZUO5V.js} +26 -43
  155. package/dist/chunk-WBKZUO5V.js.map +1 -0
  156. package/dist/{chunk-OMSKGLYA.js → chunk-WO4T4OD5.js} +2 -2
  157. package/dist/{chunk-6RPWILRH.js → chunk-WZ3NCMK6.js} +6 -5
  158. package/dist/{chunk-BAAUFCJK.js → chunk-X4MVWPHV.js} +3 -3
  159. package/dist/{chunk-R2N37AA6.js → chunk-XIDQKFZF.js} +3 -3
  160. package/dist/{chunk-EEZCB74X.js → chunk-XOBHRD2M.js} +575 -651
  161. package/dist/chunk-XOBHRD2M.js.map +1 -0
  162. package/dist/chunk-XZHEOSQ2.js +16 -0
  163. package/dist/chunk-XZHEOSQ2.js.map +1 -0
  164. package/dist/chunk-Y2NBBT6K.js +18 -0
  165. package/dist/chunk-Y2NBBT6K.js.map +1 -0
  166. package/dist/{chunk-OWOT7CFC.js → chunk-Y6B6HVKC.js} +2 -2
  167. package/dist/{chunk-5ATANZSW.js → chunk-Y6VZQGGH.js} +6 -6
  168. package/dist/chunk-YMUFFJCO.js +23 -0
  169. package/dist/chunk-YMUFFJCO.js.map +1 -0
  170. package/dist/{chunk-YZNKFYDC.js → chunk-ZFUFAHZ3.js} +4 -4
  171. package/dist/{chunk-PWWWMRT7.js → chunk-ZTLOXFPB.js} +2 -2
  172. package/dist/chunk-ZTLOXFPB.js.map +1 -0
  173. package/dist/{walk-E3OVLBFR.js → chunk-ZWBKDKXC.js} +4 -13
  174. package/dist/{walk-E3OVLBFR.js.map → chunk-ZWBKDKXC.js.map} +1 -1
  175. package/dist/classified/index.js +5 -5
  176. package/dist/{classified-marker-52P3D72W.js → classified-marker-EOOSMWFC.js} +3 -3
  177. package/dist/collection-facade-TTRF5NFJ.js +45 -0
  178. package/dist/{computed-33DRJDOC.js → computed-AB45PS4V.js} +3 -3
  179. package/dist/consent/index.js +13 -9
  180. package/dist/consent/index.js.map +1 -1
  181. package/dist/{cover-5BSNJREH.js → cover/index.js} +7 -6
  182. package/dist/crdt/index.js +4 -0
  183. package/dist/crdt/index.js.map +1 -1
  184. package/dist/custody/index.js +26 -0
  185. package/dist/{dead-filter-JXVCKS6W.js → dead-filter-6DYY7S64.js} +2 -2
  186. package/dist/{chunk-ILM6X6CP.js → delegation-ONOZVPIP.js} +12 -6
  187. package/dist/{chunk-ILM6X6CP.js.map → delegation-ONOZVPIP.js.map} +1 -1
  188. package/dist/derivations/index.js +12 -12
  189. package/dist/derive-IGGVSUPH.js +22 -0
  190. package/dist/directory/index.js +46 -0
  191. package/dist/{dispatch-PKQQFDBT.js → dispatch-7T45NN7C.js} +19 -18
  192. package/dist/{dispatch-PKQQFDBT.js.map → dispatch-7T45NN7C.js.map} +1 -1
  193. package/dist/{dispatch-SMXUO7W5.js → dispatch-RPTLK7LJ.js} +5 -5
  194. package/dist/{enclave-I5H3GINP.js → enclave-CLJVSDFG.js} +9 -9
  195. package/dist/executor-IEBLTBCW.js +9 -0
  196. package/dist/executor-RM7XWQDU.js +9 -0
  197. package/dist/executor-XZYM4KHT.js +28 -0
  198. package/dist/export-accessible-24XCCD3A.js +23 -0
  199. package/dist/extract-partition-H2TPEEOF.js +38 -0
  200. package/dist/{fanout-sidecar-WWXVHHUH.js → fanout-sidecar-TV7CXAJ6.js} +9 -9
  201. package/dist/find-OZMTRIK3.js +11 -0
  202. package/dist/forget/index.js +11 -11
  203. package/dist/forget/index.js.map +1 -1
  204. package/dist/guards/index.js +4 -4
  205. package/dist/history/index.js +16 -12
  206. package/dist/history/index.js.map +1 -1
  207. package/dist/i18n/index.js +16 -14
  208. package/dist/i18n/index.js.map +1 -1
  209. package/dist/index.d.ts +18 -24
  210. package/dist/index.js +212 -2045
  211. package/dist/index.js.map +1 -1
  212. package/dist/indexing/index.js +4 -2
  213. package/dist/indexing/index.js.map +1 -1
  214. package/dist/introspection/index.js +28 -0
  215. package/dist/issue-55HJE7JF.js +19 -0
  216. package/dist/kernel/collection-config.d.ts +1 -1
  217. package/dist/kernel/collection.d.ts +2 -2
  218. package/dist/kernel/errors.d.ts +2 -2
  219. package/dist/kernel/lazy.d.ts +30 -0
  220. package/dist/kernel/noydb.d.ts +22 -11
  221. package/dist/kernel/query/builder.d.ts +10 -10
  222. package/dist/kernel/query/index.d.ts +0 -6
  223. package/dist/kernel/query/scan-builder.d.ts +4 -4
  224. package/dist/kernel/types.d.ts +25 -25
  225. package/dist/kernel/vault.d.ts +10 -10
  226. package/dist/{ledger-M2BKCNVS.js → ledger-XY6NP3J2.js} +11 -11
  227. package/dist/liberate-LXOJ2EMB.js +24 -0
  228. package/dist/{link-set-ZU4E5J5S.js → link-set-POQB7BU5.js} +11 -11
  229. package/dist/materialized-views/index.js +22 -19
  230. package/dist/money/index.js +31 -0
  231. package/dist/noydb-KXS35UJS.js +82 -0
  232. package/dist/overlay-views/index.js +4 -4
  233. package/dist/periods/index.js +15 -13
  234. package/dist/pod/index.js +11 -12
  235. package/dist/{policy-IY2YEA3A.js → policy/index.js} +6 -6
  236. package/dist/port/with/blob-strategy.d.ts +15 -5
  237. package/dist/port/with/collection-registries.d.ts +62 -0
  238. package/dist/port/with/strategies.d.ts +11 -11
  239. package/dist/port/with/team-strategy.d.ts +2 -1
  240. package/dist/portability/index.js +8 -8
  241. package/dist/{post-register-XIAHB6KF.js → post-register-URQANI3B.js} +6 -6
  242. package/dist/query/index.js +6 -46
  243. package/dist/{aggregate → reduce}/index.js +24 -17
  244. package/dist/reduce/index.js.map +1 -0
  245. package/dist/register-5W6CG4RM.js +25 -0
  246. package/dist/registry-7Y5WF7GS.js +9 -0
  247. package/dist/{registry-VW6P6A3J.js → registry-BWD2ED52.js} +2 -2
  248. package/dist/registry-MCSGBZXI.js +18 -0
  249. package/dist/registry-UJFP3NWF.js +19 -0
  250. package/dist/request-withdrawal-IWYDM4SO.js +31 -0
  251. package/dist/{reveal-VWXRV2XU.js → reveal-BXZGWIOP.js} +6 -6
  252. package/dist/revoke-TINYPHYY.js +24 -0
  253. package/dist/satellites/index.js +1 -1
  254. package/dist/schema-update/index.js +26 -0
  255. package/dist/sealed-record/index.js +12 -12
  256. package/dist/search/index.js +36 -0
  257. package/dist/{seed-CDBFOTIK.js → seed-F7YYQTRC.js} +11 -11
  258. package/dist/sequence/index.js +30 -0
  259. package/dist/session/index.js +13 -9
  260. package/dist/session/index.js.map +1 -1
  261. package/dist/shadow/index.js +6 -2
  262. package/dist/shadow/index.js.map +1 -1
  263. package/dist/signer-WMZKCNKC.js +25 -0
  264. package/dist/snapshots/index.js +14 -10
  265. package/dist/snapshots/index.js.map +1 -1
  266. package/dist/{stale-NBROTA66.js → stale-JOE7GBAE.js} +11 -10
  267. package/dist/storage-B3WBKXKT.js +23 -0
  268. package/dist/store/index.js +22 -0
  269. package/dist/{store-coordination-provider-P3IU5JHD.js → store-coordination-provider-5LX2UFU2.js} +3 -3
  270. package/dist/sync/index.js +14 -10
  271. package/dist/sync/index.js.map +1 -1
  272. package/dist/team/index.js +36 -29
  273. package/dist/tiers/index.js +10 -10
  274. package/dist/to/index.js +1 -1
  275. package/dist/{tx → transactions}/index.js +7 -3
  276. package/dist/transactions/index.js.map +1 -0
  277. package/dist/util/index.js +1 -1
  278. package/dist/{verify-5X37OXRY.js → verify-7XWHJWUN.js} +5 -5
  279. package/dist/via/blob/active.d.ts +7 -18
  280. package/dist/via/blob/binding.d.ts +1 -1
  281. package/dist/via/blob/index.d.ts +4 -2
  282. package/dist/via/i18n/core.d.ts +1 -1
  283. package/dist/via/i18n/index.d.ts +2 -0
  284. package/dist/via/money/money-reducer.d.ts +2 -2
  285. package/dist/walk-6OHAWGBS.js +21 -0
  286. package/dist/with-audit/consent/index.d.ts +2 -0
  287. package/dist/with-audit/forget/active.d.ts +3 -3
  288. package/dist/with-audit/forget/index.d.ts +4 -4
  289. package/dist/with-audit/forget/strategy.d.ts +3 -3
  290. package/dist/with-audit/guards/executor.d.ts +4 -4
  291. package/dist/with-audit/guards/immutable-guard.d.ts +3 -3
  292. package/dist/with-audit/guards/index.d.ts +1 -1
  293. package/dist/with-audit/guards/registry.d.ts +3 -3
  294. package/dist/with-audit/guards/transition-guard.d.ts +3 -3
  295. package/dist/with-audit/guards/types.d.ts +10 -10
  296. package/dist/with-audit/guards/with-guard.d.ts +2 -2
  297. package/dist/with-audit/periods/index.d.ts +2 -0
  298. package/dist/with-cargo/floor.d.ts +3 -3
  299. package/dist/with-commit/crdt/index.d.ts +2 -0
  300. package/dist/with-commit/history/index.d.ts +2 -0
  301. package/dist/with-commit/numbering/descriptor.d.ts +16 -6
  302. package/dist/with-commit/tx/active.d.ts +5 -5
  303. package/dist/with-commit/tx/index.d.ts +2 -2
  304. package/dist/with-commit/tx/invariants.d.ts +1 -1
  305. package/dist/with-commit/tx/strategy.d.ts +3 -3
  306. package/dist/with-fork/shadow/index.d.ts +2 -0
  307. package/dist/with-fork/snapshots/active.d.ts +2 -2
  308. package/dist/with-fork/snapshots/index.d.ts +3 -1
  309. package/dist/with-fork/snapshots/noydb-facade.d.ts +3 -3
  310. package/dist/with-fork/snapshots/strategy.d.ts +2 -2
  311. package/dist/with-formula/derivations/executor.d.ts +2 -2
  312. package/dist/with-formula/derivations/index.d.ts +2 -1
  313. package/dist/with-formula/derivations/registry.d.ts +3 -3
  314. package/dist/with-formula/derivations/stale.d.ts +2 -2
  315. package/dist/with-formula/derivations/types.d.ts +3 -3
  316. package/dist/with-formula/derivations/with-derivation.d.ts +2 -2
  317. package/dist/with-formula/derivations/with-rollup.d.ts +15 -8
  318. package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +3 -3
  319. package/dist/with-formula/materialized-views/index.d.ts +1 -1
  320. package/dist/with-formula/materialized-views/registry.d.ts +4 -4
  321. package/dist/with-formula/materialized-views/types.d.ts +11 -11
  322. package/dist/with-formula/materialized-views/with-materialized-view.d.ts +2 -2
  323. package/dist/with-formula/overlay-views/index.d.ts +1 -1
  324. package/dist/with-formula/overlay-views/registry.d.ts +4 -4
  325. package/dist/with-formula/overlay-views/types.d.ts +3 -3
  326. package/dist/with-formula/overlay-views/virtual-collection.d.ts +2 -2
  327. package/dist/with-formula/overlay-views/with-overlayed-view.d.ts +2 -2
  328. package/dist/with-lookup/indexing/active.d.ts +5 -5
  329. package/dist/with-lookup/indexing/index.d.ts +3 -1
  330. package/dist/with-lookup/indexing/strategy.d.ts +3 -3
  331. package/dist/with-lookup/{aggregate → reduce}/active.d.ts +8 -8
  332. package/dist/with-lookup/{aggregate → reduce}/groupby.d.ts +21 -21
  333. package/dist/with-lookup/reduce/index.d.ts +34 -0
  334. package/dist/with-lookup/{aggregate → reduce}/reducers.d.ts +10 -10
  335. package/dist/with-lookup/{aggregate/aggregation.d.ts → reduce/reduction.d.ts} +21 -21
  336. package/dist/with-lookup/{aggregate → reduce}/strategy.d.ts +15 -15
  337. package/dist/with-lookup/search/build-docs.d.ts +7 -2
  338. package/dist/with-lookup/search/index.d.ts +1 -1
  339. package/dist/with-party/directory/cover/index.d.ts +1 -0
  340. package/dist/with-party/directory/index.d.ts +2 -0
  341. package/dist/with-party/session/index.d.ts +2 -0
  342. package/dist/with-party/sync/index.d.ts +2 -0
  343. package/dist/with-party/team/index.d.ts +2 -0
  344. package/dist/with-party/team/keyring.d.ts +68 -20
  345. package/dist/with-party/team/noydb-facade.d.ts +2 -1
  346. package/dist/with-shape/blobs/blob-set.d.ts +1 -1
  347. package/dist/with-shape/introspection/index.d.ts +6 -0
  348. package/dist/with-shape/schema-update/index.d.ts +1 -0
  349. package/dist/with-store/index.d.ts +3 -2
  350. package/dist/withdraw-accessible-DEUCOO4F.js +28 -0
  351. package/dist/withdraw-accessible-DEUCOO4F.js.map +1 -0
  352. package/package.json +42 -30
  353. package/dist/aggregate/index.js.map +0 -1
  354. package/dist/api-22ES33N3.js +0 -20
  355. package/dist/as/index.js +0 -30
  356. package/dist/at/index.js +0 -1
  357. package/dist/by/index.js +0 -11
  358. package/dist/chunk-2PDBYF2O.js.map +0 -1
  359. package/dist/chunk-2YELV6TV.js +0 -1
  360. package/dist/chunk-3LJYHE7S.js.map +0 -1
  361. package/dist/chunk-6SYOHUHM.js.map +0 -1
  362. package/dist/chunk-7ICV4ASA.js.map +0 -1
  363. package/dist/chunk-AFAPBZAA.js.map +0 -1
  364. package/dist/chunk-BY5YBSXA.js.map +0 -1
  365. package/dist/chunk-CJVEAVYH.js +0 -205
  366. package/dist/chunk-CJVEAVYH.js.map +0 -1
  367. package/dist/chunk-CKUYQO2P.js.map +0 -1
  368. package/dist/chunk-D4LAJ737.js.map +0 -1
  369. package/dist/chunk-DYZ5CCVM.js.map +0 -1
  370. package/dist/chunk-EEZCB74X.js.map +0 -1
  371. package/dist/chunk-EGU4PWQW.js.map +0 -1
  372. package/dist/chunk-FIP7KI2P.js.map +0 -1
  373. package/dist/chunk-GHEMAVTN.js.map +0 -1
  374. package/dist/chunk-HAPY7WFP.js.map +0 -1
  375. package/dist/chunk-HQKRZIX6.js.map +0 -1
  376. package/dist/chunk-I2XEBEEF.js.map +0 -1
  377. package/dist/chunk-IGLU4ME7.js +0 -255
  378. package/dist/chunk-IGLU4ME7.js.map +0 -1
  379. package/dist/chunk-J5TEU77Q.js.map +0 -1
  380. package/dist/chunk-KJTIAECI.js.map +0 -1
  381. package/dist/chunk-L2CAWCQL.js.map +0 -1
  382. package/dist/chunk-LB7FD65R.js +0 -163
  383. package/dist/chunk-LB7FD65R.js.map +0 -1
  384. package/dist/chunk-PWWWMRT7.js.map +0 -1
  385. package/dist/chunk-QMMOMBH6.js.map +0 -1
  386. package/dist/chunk-SEU6QHH4.js.map +0 -1
  387. package/dist/chunk-TNATF3HB.js.map +0 -1
  388. package/dist/chunk-TSNRZSRC.js.map +0 -1
  389. package/dist/chunk-V5JUAW4M.js.map +0 -1
  390. package/dist/chunk-VEGQYPCP.js.map +0 -1
  391. package/dist/chunk-X3MWEFPT.js.map +0 -1
  392. package/dist/chunk-XUFAFHQM.js.map +0 -1
  393. package/dist/chunk-YJ3TREAC.js.map +0 -1
  394. package/dist/chunk-YMUGBZN2.js.map +0 -1
  395. package/dist/chunk-YTW6ZIPD.js.map +0 -1
  396. package/dist/chunk-YXZNGHID.js.map +0 -1
  397. package/dist/chunk-YZN6NRTR.js.map +0 -1
  398. package/dist/chunk-ZX5FNWH7.js.map +0 -1
  399. package/dist/collection-facade-XKCFHSLR.js +0 -44
  400. package/dist/delegation-WWZPEDK2.js +0 -25
  401. package/dist/derive-CWWFEQ4N.js +0 -21
  402. package/dist/executor-FCJEH3FU.js +0 -9
  403. package/dist/executor-OHET7TF7.js +0 -9
  404. package/dist/executor-SHYLIBOM.js +0 -26
  405. package/dist/export-accessible-FBL6TDSK.js +0 -23
  406. package/dist/extract-partition-ZYIRYMTI.js +0 -38
  407. package/dist/find-LEBUXVL7.js +0 -11
  408. package/dist/in/index.js +0 -1
  409. package/dist/issue-F76PAGIR.js +0 -19
  410. package/dist/liberate-ZP7UB57K.js +0 -24
  411. package/dist/noydb-BNDGEK5X.js +0 -71
  412. package/dist/on/index.js +0 -17
  413. package/dist/port/as/index.d.ts +0 -26
  414. package/dist/port/at/index.d.ts +0 -18
  415. package/dist/port/in/index.d.ts +0 -21
  416. package/dist/port/on/index.d.ts +0 -27
  417. package/dist/port/ui/index.d.ts +0 -21
  418. package/dist/port/with/index.d.ts +0 -18
  419. package/dist/register-HB4TQZSV.js +0 -23
  420. package/dist/registry-6BMBFEXT.js +0 -19
  421. package/dist/registry-7CZWF3EQ.js +0 -9
  422. package/dist/registry-JOFO7RAH.js +0 -18
  423. package/dist/request-withdrawal-UN3TRHWI.js +0 -31
  424. package/dist/revoke-OLO2OVR7.js +0 -24
  425. package/dist/signer-MGGKPYAN.js +0 -25
  426. package/dist/storage-3R37QZLA.js +0 -23
  427. package/dist/tx/index.js.map +0 -1
  428. package/dist/ui/index.js +0 -1
  429. package/dist/with/index.js +0 -31
  430. package/dist/with-lookup/aggregate/index.d.ts +0 -23
  431. package/dist/withdraw-accessible-Q2EMATCU.js +0 -28
  432. /package/dist/{api-22ES33N3.js.map → api-3NKVNZPM.js.map} +0 -0
  433. /package/dist/{backup-YCHAC575.js.map → backup-PTSVXDDW.js.map} +0 -0
  434. /package/dist/{chunk-5WLDZZ6S.js.map → chunk-35NMVJ7I.js.map} +0 -0
  435. /package/dist/{chunk-TNJVDG2B.js.map → chunk-3XKESW5E.js.map} +0 -0
  436. /package/dist/{chunk-MUPZ6IZX.js.map → chunk-4JQK3L4V.js.map} +0 -0
  437. /package/dist/{chunk-Z4D3YGAB.js.map → chunk-4ZKNC6A6.js.map} +0 -0
  438. /package/dist/{chunk-ONB627HU.js.map → chunk-55LX6FSX.js.map} +0 -0
  439. /package/dist/{chunk-QMZ5A6FQ.js.map → chunk-56IIVAEO.js.map} +0 -0
  440. /package/dist/{chunk-FHHYCBBP.js.map → chunk-5DRROK5W.js.map} +0 -0
  441. /package/dist/{chunk-GTNRMJYH.js.map → chunk-5GQEU4DN.js.map} +0 -0
  442. /package/dist/{chunk-YQQPNXNO.js.map → chunk-6L3DKWRY.js.map} +0 -0
  443. /package/dist/{chunk-M6QA2KK2.js.map → chunk-6M2I3DKF.js.map} +0 -0
  444. /package/dist/{chunk-FTCGEUOY.js.map → chunk-6R6Q3MRN.js.map} +0 -0
  445. /package/dist/{chunk-ZUDAK436.js.map → chunk-6UBZ6I5Z.js.map} +0 -0
  446. /package/dist/{chunk-7U6AB7DZ.js.map → chunk-AKKRXT23.js.map} +0 -0
  447. /package/dist/{chunk-OWLZONGX.js.map → chunk-BLBAQRBM.js.map} +0 -0
  448. /package/dist/{chunk-QBOQI6PG.js.map → chunk-BN4HRYAZ.js.map} +0 -0
  449. /package/dist/{chunk-QVGEVZ5F.js.map → chunk-BQ6DHN4I.js.map} +0 -0
  450. /package/dist/{chunk-GP54LU5N.js.map → chunk-BYFXLDVV.js.map} +0 -0
  451. /package/dist/{chunk-QRHEAZ2Q.js.map → chunk-CUZLNGD5.js.map} +0 -0
  452. /package/dist/{chunk-YXIVUWDU.js.map → chunk-DGBIHDVK.js.map} +0 -0
  453. /package/dist/{chunk-QZJEYZ4I.js.map → chunk-DZAF24PG.js.map} +0 -0
  454. /package/dist/{chunk-TMR64XPL.js.map → chunk-EZNTORXE.js.map} +0 -0
  455. /package/dist/{chunk-JAMDDLIM.js.map → chunk-FMNU7IUG.js.map} +0 -0
  456. /package/dist/{as/index.js.map → chunk-GJW4HX2O.js.map} +0 -0
  457. /package/dist/{chunk-7BIJS6II.js.map → chunk-GP3UWP22.js.map} +0 -0
  458. /package/dist/{chunk-JIHH26WQ.js.map → chunk-HFUAFR6B.js.map} +0 -0
  459. /package/dist/{chunk-RWW3I3PO.js.map → chunk-ISRKW4YN.js.map} +0 -0
  460. /package/dist/{chunk-P4NUJVWL.js.map → chunk-IXNCZTWA.js.map} +0 -0
  461. /package/dist/{chunk-YFFEF6HR.js.map → chunk-JIDLU57U.js.map} +0 -0
  462. /package/dist/{chunk-PTT2NB46.js.map → chunk-JYJFGD2H.js.map} +0 -0
  463. /package/dist/{chunk-3OWYOECI.js.map → chunk-JYV4JJV2.js.map} +0 -0
  464. /package/dist/{chunk-OGVE4IJW.js.map → chunk-KBPU5M2E.js.map} +0 -0
  465. /package/dist/{chunk-UTEATWHO.js.map → chunk-KW42W6SV.js.map} +0 -0
  466. /package/dist/{chunk-UVBHM7AK.js.map → chunk-MANUDU7I.js.map} +0 -0
  467. /package/dist/{chunk-K7BADAOS.js.map → chunk-NEX7JCMO.js.map} +0 -0
  468. /package/dist/{chunk-5HSSTOOG.js.map → chunk-NFZGZ4AK.js.map} +0 -0
  469. /package/dist/{chunk-S4YERMGJ.js.map → chunk-OBPVWOSQ.js.map} +0 -0
  470. /package/dist/{chunk-OHV6T5JB.js.map → chunk-OLIWCCFM.js.map} +0 -0
  471. /package/dist/{chunk-2CRZOVDI.js.map → chunk-OLSARBZU.js.map} +0 -0
  472. /package/dist/{chunk-7LP7FFJ2.js.map → chunk-QD46HPZG.js.map} +0 -0
  473. /package/dist/{chunk-G4MFQXYX.js.map → chunk-QJNCB5SK.js.map} +0 -0
  474. /package/dist/{chunk-GEEJPID6.js.map → chunk-RZPOZPZU.js.map} +0 -0
  475. /package/dist/{chunk-YCAJDK4O.js.map → chunk-SGQ4N5FS.js.map} +0 -0
  476. /package/dist/{chunk-522MBPE5.js.map → chunk-SHEEBRZ4.js.map} +0 -0
  477. /package/dist/{chunk-YWZEDG7F.js.map → chunk-SHYIA73K.js.map} +0 -0
  478. /package/dist/{chunk-K4BWPNJO.js.map → chunk-TE6LH6J2.js.map} +0 -0
  479. /package/dist/{chunk-SBOHNJUD.js.map → chunk-V6UQZA2H.js.map} +0 -0
  480. /package/dist/{chunk-SC4JLMZI.js.map → chunk-VH6SOCXH.js.map} +0 -0
  481. /package/dist/{chunk-WQN5SM7P.js.map → chunk-W3G5REIU.js.map} +0 -0
  482. /package/dist/{chunk-OMSKGLYA.js.map → chunk-WO4T4OD5.js.map} +0 -0
  483. /package/dist/{chunk-6RPWILRH.js.map → chunk-WZ3NCMK6.js.map} +0 -0
  484. /package/dist/{chunk-BAAUFCJK.js.map → chunk-X4MVWPHV.js.map} +0 -0
  485. /package/dist/{chunk-R2N37AA6.js.map → chunk-XIDQKFZF.js.map} +0 -0
  486. /package/dist/{chunk-OWOT7CFC.js.map → chunk-Y6B6HVKC.js.map} +0 -0
  487. /package/dist/{chunk-5ATANZSW.js.map → chunk-Y6VZQGGH.js.map} +0 -0
  488. /package/dist/{chunk-YZNKFYDC.js.map → chunk-ZFUFAHZ3.js.map} +0 -0
  489. /package/dist/{classified-marker-52P3D72W.js.map → classified-marker-EOOSMWFC.js.map} +0 -0
  490. /package/dist/{at/index.js.map → collection-facade-TTRF5NFJ.js.map} +0 -0
  491. /package/dist/{by/index.js.map → computed-AB45PS4V.js.map} +0 -0
  492. /package/dist/{in → cover}/index.js.map +0 -0
  493. /package/dist/{on → custody}/index.js.map +0 -0
  494. /package/dist/{dead-filter-JXVCKS6W.js.map → dead-filter-6DYY7S64.js.map} +0 -0
  495. /package/dist/{chunk-2YELV6TV.js.map → derive-IGGVSUPH.js.map} +0 -0
  496. /package/dist/{ui → directory}/index.js.map +0 -0
  497. /package/dist/{dispatch-SMXUO7W5.js.map → dispatch-RPTLK7LJ.js.map} +0 -0
  498. /package/dist/{collection-facade-XKCFHSLR.js.map → enclave-CLJVSDFG.js.map} +0 -0
  499. /package/dist/{computed-33DRJDOC.js.map → executor-IEBLTBCW.js.map} +0 -0
  500. /package/dist/{cover-5BSNJREH.js.map → executor-RM7XWQDU.js.map} +0 -0
  501. /package/dist/{delegation-WWZPEDK2.js.map → executor-XZYM4KHT.js.map} +0 -0
  502. /package/dist/{derive-CWWFEQ4N.js.map → export-accessible-24XCCD3A.js.map} +0 -0
  503. /package/dist/{enclave-I5H3GINP.js.map → extract-partition-H2TPEEOF.js.map} +0 -0
  504. /package/dist/{fanout-sidecar-WWXVHHUH.js.map → fanout-sidecar-TV7CXAJ6.js.map} +0 -0
  505. /package/dist/{executor-FCJEH3FU.js.map → find-OZMTRIK3.js.map} +0 -0
  506. /package/dist/{with → introspection}/index.js.map +0 -0
  507. /package/dist/{executor-OHET7TF7.js.map → issue-55HJE7JF.js.map} +0 -0
  508. /package/dist/{executor-SHYLIBOM.js.map → ledger-XY6NP3J2.js.map} +0 -0
  509. /package/dist/{export-accessible-FBL6TDSK.js.map → liberate-LXOJ2EMB.js.map} +0 -0
  510. /package/dist/{extract-partition-ZYIRYMTI.js.map → link-set-POQB7BU5.js.map} +0 -0
  511. /package/dist/{find-LEBUXVL7.js.map → money/index.js.map} +0 -0
  512. /package/dist/{issue-F76PAGIR.js.map → noydb-KXS35UJS.js.map} +0 -0
  513. /package/dist/{ledger-M2BKCNVS.js.map → policy/index.js.map} +0 -0
  514. /package/dist/{post-register-XIAHB6KF.js.map → post-register-URQANI3B.js.map} +0 -0
  515. /package/dist/{liberate-ZP7UB57K.js.map → register-5W6CG4RM.js.map} +0 -0
  516. /package/dist/{link-set-ZU4E5J5S.js.map → registry-7Y5WF7GS.js.map} +0 -0
  517. /package/dist/{noydb-BNDGEK5X.js.map → registry-BWD2ED52.js.map} +0 -0
  518. /package/dist/{policy-IY2YEA3A.js.map → registry-MCSGBZXI.js.map} +0 -0
  519. /package/dist/{register-HB4TQZSV.js.map → registry-UJFP3NWF.js.map} +0 -0
  520. /package/dist/{registry-6BMBFEXT.js.map → request-withdrawal-IWYDM4SO.js.map} +0 -0
  521. /package/dist/{reveal-VWXRV2XU.js.map → reveal-BXZGWIOP.js.map} +0 -0
  522. /package/dist/{registry-7CZWF3EQ.js.map → revoke-TINYPHYY.js.map} +0 -0
  523. /package/dist/{registry-JOFO7RAH.js.map → schema-update/index.js.map} +0 -0
  524. /package/dist/{registry-VW6P6A3J.js.map → search/index.js.map} +0 -0
  525. /package/dist/{seed-CDBFOTIK.js.map → seed-F7YYQTRC.js.map} +0 -0
  526. /package/dist/{request-withdrawal-UN3TRHWI.js.map → sequence/index.js.map} +0 -0
  527. /package/dist/{revoke-OLO2OVR7.js.map → signer-WMZKCNKC.js.map} +0 -0
  528. /package/dist/{signer-MGGKPYAN.js.map → stale-JOE7GBAE.js.map} +0 -0
  529. /package/dist/{stale-NBROTA66.js.map → storage-B3WBKXKT.js.map} +0 -0
  530. /package/dist/{storage-3R37QZLA.js.map → store/index.js.map} +0 -0
  531. /package/dist/{store-coordination-provider-P3IU5JHD.js.map → store-coordination-provider-5LX2UFU2.js.map} +0 -0
  532. /package/dist/{verify-5X37OXRY.js.map → verify-7XWHJWUN.js.map} +0 -0
  533. /package/dist/{withdraw-accessible-Q2EMATCU.js.map → walk-6OHAWGBS.js.map} +0 -0
  534. /package/dist/with-lookup/{aggregate → reduce}/canonical-key.d.ts +0 -0
@@ -1,93 +1,59 @@
1
1
  import {
2
- loadVaultPolicy
3
- } from "./chunk-QMZ5A6FQ.js";
4
- import {
5
- jsonSchemaToFields
6
- } from "./chunk-VYYM3MEN.js";
7
- import {
8
- NO_SEQUENCE,
9
- SEQUENCE_COLLECTION,
10
- compileSequenceFormat,
11
- resolveSequenceKey
12
- } from "./chunk-X3MWEFPT.js";
2
+ resolveStaleOnRead
3
+ } from "./chunk-NJ4DYYO5.js";
13
4
  import {
14
5
  LinkIntegrityError,
15
6
  isLinkCollectionName,
16
7
  linkCollectionName,
17
8
  linkRowKey
18
- } from "./chunk-MUPZ6IZX.js";
9
+ } from "./chunk-4JQK3L4V.js";
19
10
  import {
20
11
  hashFields,
21
12
  validateSatelliteDeclaration
22
- } from "./chunk-522MBPE5.js";
23
- import {
24
- resolveStaleOnRead
25
- } from "./chunk-XUFAFHQM.js";
13
+ } from "./chunk-SHEEBRZ4.js";
26
14
  import {
27
15
  loadFence
28
- } from "./chunk-M6QA2KK2.js";
16
+ } from "./chunk-6M2I3DKF.js";
29
17
  import {
30
- InvertedIndex,
31
- MemoryIndexStore,
32
- NO_SEARCH,
33
18
  VectorSet,
34
19
  buildPersistedIndexCallbacks,
35
20
  encodeVecId,
36
21
  syncTierSearch
37
- } from "./chunk-HAPY7WFP.js";
22
+ } from "./chunk-CCDP6EPB.js";
38
23
  import {
39
- derivePersistedSchema,
40
- isZod4Schema
41
- } from "./chunk-SEU6QHH4.js";
24
+ SchemaUpdateGate
25
+ } from "./chunk-6LJY7X5A.js";
42
26
  import {
43
27
  isBaseLive,
44
28
  liveBaseIdSet
45
29
  } from "./chunk-GYGLAVCX.js";
46
- import {
47
- CustodyApi,
48
- NO_CARGO,
49
- NO_CUSTODY
50
- } from "./chunk-L2CAWCQL.js";
51
- import {
52
- resolveManagedSecret,
53
- saveSealedSecret
54
- } from "./chunk-OHV6T5JB.js";
55
- import {
56
- ServiceBus,
57
- WriteHookRegistry,
58
- assertCanExport,
59
- assertCanImport,
60
- canExport,
61
- canImport
62
- } from "./chunk-IGLU4ME7.js";
63
- import {
64
- runDrainBarrier
65
- } from "./chunk-AFAPBZAA.js";
66
- import {
67
- NO_ATTESTATION
68
- } from "./chunk-GTNRMJYH.js";
69
- import {
70
- NO_CLASSIFIED,
71
- guardClassifiedCompat,
72
- resolveClassifiedFields
73
- } from "./chunk-YZNKFYDC.js";
74
30
  import {
75
31
  NO_TIERS,
76
32
  classifySealedShred,
77
33
  syncDerivedOutputs
78
- } from "./chunk-FTCGEUOY.js";
34
+ } from "./chunk-6R6Q3MRN.js";
79
35
  import {
80
36
  NO_PORTABILITY
81
- } from "./chunk-OWLZONGX.js";
37
+ } from "./chunk-BLBAQRBM.js";
82
38
  import {
83
- TxContext,
84
- bestEffortRevert,
85
- revertExecuted
86
- } from "./chunk-QVGEVZ5F.js";
39
+ NO_CARGO,
40
+ runDrainBarrier
41
+ } from "./chunk-TG634KCO.js";
42
+ import {
43
+ resolveManagedSecret,
44
+ saveSealedSecret
45
+ } from "./chunk-OLIWCCFM.js";
46
+ import {
47
+ jsonSchemaToFields
48
+ } from "./chunk-VYYM3MEN.js";
49
+ import {
50
+ derivePersistedSchema,
51
+ isZod4Schema
52
+ } from "./chunk-6ZNSB3H6.js";
87
53
  import {
88
54
  DEFAULT_POSTURE,
89
55
  ViaGraph
90
- } from "./chunk-Z4D3YGAB.js";
56
+ } from "./chunk-4ZKNC6A6.js";
91
57
  import {
92
58
  buildLookupAltIndex,
93
59
  buildLookupSnapshotRows,
@@ -111,25 +77,69 @@ import {
111
77
  selfWriteFieldEqual,
112
78
  touchFor,
113
79
  updateReferencingRecords
114
- } from "./chunk-7BIJS6II.js";
80
+ } from "./chunk-GP3UWP22.js";
115
81
  import {
116
82
  OverlayedCollection
117
- } from "./chunk-PWWWMRT7.js";
83
+ } from "./chunk-ZTLOXFPB.js";
84
+ import {
85
+ NO_SYNC
86
+ } from "./chunk-EP5L47XV.js";
87
+ import {
88
+ NO_ATTESTATION
89
+ } from "./chunk-5GQEU4DN.js";
90
+ import {
91
+ NO_CLASSIFIED,
92
+ guardClassifiedCompat,
93
+ resolveClassifiedFields
94
+ } from "./chunk-ZFUFAHZ3.js";
95
+ import {
96
+ NO_PERIODS
97
+ } from "./chunk-N5PLUFH2.js";
98
+ import {
99
+ NO_SHADOW
100
+ } from "./chunk-SMY5X46Z.js";
101
+ import {
102
+ NO_SNAPSHOTS
103
+ } from "./chunk-DZFQVICS.js";
104
+ import {
105
+ TxContext,
106
+ bestEffortRevert,
107
+ revertExecuted
108
+ } from "./chunk-BQ6DHN4I.js";
109
+ import {
110
+ lazy
111
+ } from "./chunk-5D2ALSM5.js";
112
+ import {
113
+ InvertedIndex,
114
+ MemoryIndexStore,
115
+ NO_SEARCH
116
+ } from "./chunk-QADFHRQM.js";
117
+ import {
118
+ NO_SEQUENCE,
119
+ SEQUENCE_COLLECTION,
120
+ compileSequenceFormat,
121
+ resolveSequenceKey
122
+ } from "./chunk-EBKCYQ2D.js";
123
+ import {
124
+ CustodyApi,
125
+ NO_CUSTODY
126
+ } from "./chunk-SKM35Y4Q.js";
118
127
  import {
119
- NO_AGGREGATE,
120
128
  Query,
121
129
  ScanBuilder
122
- } from "./chunk-HQKRZIX6.js";
130
+ } from "./chunk-WBKZUO5V.js";
123
131
  import {
124
132
  EXPORT_AUDIT_COLLECTION,
133
+ NO_BLOBS,
125
134
  createExportBlobsHandle,
126
135
  runCompaction
127
- } from "./chunk-J5TEU77Q.js";
136
+ } from "./chunk-IF6WNGAK.js";
128
137
  import {
129
138
  LazyQuery,
139
+ NO_INDEXING,
130
140
  decodeIdxId,
131
141
  encodeIdxId
132
- } from "./chunk-BY5YBSXA.js";
142
+ } from "./chunk-L3YYLT4E.js";
133
143
  import {
134
144
  IMPLICIT_LAZY,
135
145
  Lru,
@@ -137,13 +147,22 @@ import {
137
147
  } from "./chunk-NO272T7Q.js";
138
148
  import {
139
149
  canonicalGroupKey
140
- } from "./chunk-QMMOMBH6.js";
150
+ } from "./chunk-XZHEOSQ2.js";
151
+ import {
152
+ NO_REDUCE
153
+ } from "./chunk-YMUFFJCO.js";
141
154
  import {
142
155
  readPath
143
156
  } from "./chunk-IGJCYUT5.js";
157
+ import {
158
+ NO_CRDT
159
+ } from "./chunk-PVEWA2DU.js";
160
+ import {
161
+ NO_CONSENT
162
+ } from "./chunk-PEOZ34EM.js";
144
163
  import {
145
164
  dictCollectionName
146
- } from "./chunk-K7BADAOS.js";
165
+ } from "./chunk-NEX7JCMO.js";
147
166
  import {
148
167
  NO_I18N,
149
168
  getAtPath,
@@ -151,23 +170,44 @@ import {
151
170
  isDictKeyDescriptor,
152
171
  isI18nTextDescriptor,
153
172
  isStaticDictDescriptor
154
- } from "./chunk-JN3SGXJE.js";
173
+ } from "./chunk-UADPR6F4.js";
155
174
  import {
156
- installViaBinder,
157
175
  isViaInstalled,
158
176
  viaBinder
159
- } from "./chunk-ZUDAK436.js";
177
+ } from "./chunk-6UBZ6I5Z.js";
160
178
  import {
161
179
  NO_TEAM,
180
+ describeAllUsersAuth,
181
+ describeAuthConfig,
182
+ describeUserAuth,
183
+ diagramAuthConfig,
162
184
  enrollAuthenticator,
163
185
  findAuthenticator,
186
+ hasRecoveryEnrolled,
187
+ hasStrongRecoveryEnrolled,
188
+ loadPaperRecoveryEntries,
189
+ loadShamirRecoveryEntries,
190
+ mintPaperRecoveryEntry,
191
+ mintShamirRecoveryEntry,
164
192
  recoverSecret,
165
193
  recoverUser,
166
194
  removeAuthenticator,
167
195
  rotateSecret,
196
+ savePaperRecoveryEntries,
197
+ saveShamirRecoveryEntries,
168
198
  updateAuthenticator,
169
199
  writeMagicLinkGrant
170
- } from "./chunk-FIP7KI2P.js";
200
+ } from "./chunk-C25JXSOR.js";
201
+ import {
202
+ INDEXED_STORE_POLICY
203
+ } from "./chunk-VQNJ7UZL.js";
204
+ import {
205
+ PERIODS_COLLECTION,
206
+ PERIOD_ARCHIVES_COLLECTION,
207
+ PERIOD_FREEZES_COLLECTION,
208
+ PERIOD_TARGET_PURGES_COLLECTION,
209
+ periodExclusiveUpperBound
210
+ } from "./chunk-EZNTORXE.js";
171
211
  import {
172
212
  assertKeyringOpenAllowed,
173
213
  buildRecipientKeyringFile,
@@ -175,51 +215,39 @@ import {
175
215
  createOwnerKeyring,
176
216
  ensureCollectionDEK,
177
217
  hasAccess,
218
+ hasExportCapability,
219
+ hasImportCapability,
178
220
  hasWritePermission,
179
221
  isSecretBearingReservedCollection,
180
222
  listUsers,
181
223
  loadKeyring,
182
224
  updateKeyringIdentity
183
- } from "./chunk-3LJYHE7S.js";
225
+ } from "./chunk-KPXM4WO6.js";
184
226
  import {
185
227
  persistDirectoryConfig,
186
228
  readDirectoryConfig
187
- } from "./chunk-6RPWILRH.js";
188
- import {
189
- hasRecoveryEnrolled,
190
- hasStrongRecoveryEnrolled,
191
- loadPaperRecoveryEntries,
192
- loadShamirRecoveryEntries,
193
- mintPaperRecoveryEntry,
194
- mintShamirRecoveryEntry,
195
- savePaperRecoveryEntries,
196
- saveShamirRecoveryEntries
197
- } from "./chunk-CJVEAVYH.js";
198
- import {
199
- INDEXED_STORE_POLICY
200
- } from "./chunk-VQNJ7UZL.js";
201
- import {
202
- PERIODS_COLLECTION,
203
- PERIOD_ARCHIVES_COLLECTION,
204
- PERIOD_FREEZES_COLLECTION,
205
- PERIOD_TARGET_PURGES_COLLECTION,
206
- periodExclusiveUpperBound
207
- } from "./chunk-TMR64XPL.js";
229
+ } from "./chunk-WZ3NCMK6.js";
208
230
  import {
209
231
  NO_BROKER,
210
232
  buildCredentialBrokerHandle
211
- } from "./chunk-P4NUJVWL.js";
233
+ } from "./chunk-IXNCZTWA.js";
234
+ import {
235
+ NO_SESSION
236
+ } from "./chunk-VKQCVU2Z.js";
212
237
  import {
213
238
  generateULID
214
239
  } from "./chunk-ZJADGNYF.js";
240
+ import {
241
+ NO_HISTORY
242
+ } from "./chunk-AFHQATY4.js";
215
243
  import {
216
244
  assertCutoverTierSafe,
217
245
  assertTierWritable,
218
246
  liveRecordIsElevated
219
- } from "./chunk-PTT2NB46.js";
247
+ } from "./chunk-JYJFGD2H.js";
220
248
  import {
221
249
  sha256Hex
222
- } from "./chunk-RWW3I3PO.js";
250
+ } from "./chunk-ISRKW4YN.js";
223
251
  import {
224
252
  NO_FORGET,
225
253
  addSubjectRef,
@@ -228,10 +256,10 @@ import {
228
256
  readDottedPath,
229
257
  rebuildSubjectIndex,
230
258
  removeSubjectRef
231
- } from "./chunk-I2XEBEEF.js";
259
+ } from "./chunk-KFRPNHWR.js";
232
260
  import {
233
261
  NO_SEALED_RECORD
234
- } from "./chunk-7LP7FFJ2.js";
262
+ } from "./chunk-QD46HPZG.js";
235
263
  import {
236
264
  RecordCodec,
237
265
  SEALED_CEK_NS,
@@ -242,20 +270,20 @@ import {
242
270
  queryByDet,
243
271
  resolveStableCek,
244
272
  validateSchemaInput
245
- } from "./chunk-GEEJPID6.js";
273
+ } from "./chunk-RZPOZPZU.js";
246
274
  import {
247
275
  buildDeleteMarker,
248
276
  buildTombstone,
249
277
  isDeleteMarker,
250
278
  isTombstone
251
- } from "./chunk-SC4JLMZI.js";
279
+ } from "./chunk-VH6SOCXH.js";
252
280
  import {
253
281
  encrypt
254
- } from "./chunk-7U6AB7DZ.js";
282
+ } from "./chunk-AKKRXT23.js";
255
283
  import {
256
284
  NOYDB_FORMAT_VERSION,
257
285
  SealedHandle
258
- } from "./chunk-YTW6ZIPD.js";
286
+ } from "./chunk-GZACYEOB.js";
259
287
  import {
260
288
  AlreadyElevatedError,
261
289
  AttestationError,
@@ -266,8 +294,10 @@ import {
266
294
  DebugPlaintextError,
267
295
  DictKeyInUseError,
268
296
  ElevationExpiredError,
297
+ ExportCapabilityError,
269
298
  FieldNotQueryableError,
270
299
  ForgetStrategyNotConfiguredError,
300
+ ImportCapabilityError,
271
301
  IndexWriteFailureError,
272
302
  InvalidKeyError,
273
303
  KeyringCorruptError,
@@ -294,234 +324,18 @@ import {
294
324
  UnsupportedIndexOptionError,
295
325
  UnsupportedTierCompositionError,
296
326
  ValidationError
297
- } from "./chunk-6SYOHUHM.js";
298
-
299
- // src/via/blob/binding.ts
300
- async function eraseBlobs(ctx, cfg) {
301
- if (cfg.purgeBlobsForRecord) return cfg.purgeBlobsForRecord(ctx.id);
302
- return { shredded: 0, residue: [] };
303
- }
304
- function buildBlobDescribeFragment(fields) {
305
- return {
306
- blobFields: Object.fromEntries(
307
- Object.entries(fields).map(([field, p]) => [field, {
308
- ...p.retainDays !== void 0 ? { retainDays: p.retainDays } : {},
309
- ...p.evictWhen !== void 0 ? { evictWhen: true } : {},
310
- ...p.legalHold !== void 0 ? { legalHold: true } : {},
311
- ...p.retainUntil !== void 0 ? { retainUntil: true } : {},
312
- ...p.external === true ? { external: true } : {},
313
- ...p.public === true ? { public: true } : {},
314
- ...p.backlink !== void 0 ? { backlink: p.backlink } : {}
315
- }])
316
- )
317
- };
318
- }
319
- function blobBinding(cfg) {
320
- return {
321
- brand: "blob",
322
- // encryptedAtRest: 'envelope' — blob chunks are AEAD-encrypted envelopes
323
- // in `_blob_chunks` (service-side), not sealed record fields; queryable:
324
- // 'none' — nothing indexes blob content; exportable — vault.exportBlobs()
325
- // is a first-class door; forgettable — shredAllForRecord participates in
326
- // vault.forget().
327
- posture: { encryptedAtRest: "envelope", queryable: "none", exportable: true, forgettable: true },
328
- covers: (field) => field in cfg.fields,
329
- erase: (ctx) => eraseBlobs(ctx, cfg),
330
- describeFragment: () => buildBlobDescribeFragment(cfg.fields)
331
- };
332
- }
333
- function linkBlobVia() {
334
- installViaBinder("blob", (c) => blobBinding(c));
335
- }
336
-
337
- // src/port/with/blob-strategy.ts
338
- linkBlobVia();
339
- var NO_BLOBS = {
340
- openSlot() {
341
- throw new Error(
342
- 'Blob storage is not enabled on this Noydb instance. Import `{ withBlobs }` from "@noy-db/hub/blobs" and pass `withBlobs()` to `createNoydb({ blobStrategy: withBlobs() })`.'
343
- );
344
- }
345
- };
346
-
347
- // src/with-audit/consent/strategy.ts
348
- var NO_CONSENT = {
349
- async write() {
350
- },
351
- async read() {
352
- return [];
353
- }
354
- };
355
-
356
- // src/with-commit/crdt/strategy.ts
357
- var NOT_ENABLED = new Error(
358
- 'CRDT mode requires the CRDT strategy. Import `{ withCrdt }` from "@noy-db/hub/crdt" and pass it to `createNoydb({ crdtStrategy: withCrdt() })`.'
359
- );
360
- var NO_CRDT = {
361
- buildLwwMapState() {
362
- throw NOT_ENABLED;
363
- },
364
- buildRgaState() {
365
- throw NOT_ENABLED;
366
- },
367
- mergeCrdtStates() {
368
- throw NOT_ENABLED;
369
- },
370
- resolveCrdtSnapshot() {
371
- throw NOT_ENABLED;
372
- }
373
- };
374
-
375
- // src/with-commit/history/strategy.ts
376
- function notEnabled(op) {
377
- return new Error(
378
- `${op} requires the history strategy. Import \`{ withHistory }\` from "@noy-db/hub/history" and pass it to \`createNoydb({ historyStrategy: withHistory() })\`.`
379
- );
380
- }
381
- var NO_HISTORY = {
382
- async saveHistory() {
383
- },
384
- async getHistoryEntries() {
385
- throw notEnabled("collection.history()");
386
- },
387
- async getVersionEnvelope() {
388
- throw notEnabled("collection.getVersion()");
389
- },
390
- async pruneHistory() {
391
- return 0;
392
- },
393
- async clearHistory() {
394
- return 0;
395
- },
396
- async tombstoneHistory() {
397
- return 0;
398
- },
399
- async rewrapHistory() {
400
- },
401
- async envelopePayloadHash() {
402
- return "";
403
- },
404
- computePatch() {
405
- return [];
406
- },
407
- diff() {
408
- throw notEnabled("collection.diff()");
409
- },
410
- buildLedger() {
411
- return null;
412
- },
413
- buildVaultInstant() {
414
- throw notEnabled("vault.at() / vault.timeMachine()");
415
- }
416
- };
417
-
418
- // src/with-lookup/indexing/strategy.ts
419
- var NO_INDEXING = {
420
- createState() {
421
- return DISABLED_STATE;
422
- }
423
- };
424
- var DISABLED_STATE = {
425
- isEnabled: false,
426
- getEagerIndexes: () => null,
427
- getPersistedIndexes: () => null
428
- };
429
-
430
- // src/with-audit/periods/strategy.ts
431
- var NOT_ENABLED2 = new Error(
432
- 'Accounting periods require the periods strategy. Import `{ withPeriods }` from "@noy-db/hub/periods" and pass it to `createNoydb({ periodsStrategy: withPeriods() })`.'
433
- );
434
- var NO_PERIODS = {
435
- async loadPeriods() {
436
- return [];
437
- },
438
- async chainAnchor() {
439
- return { priorPeriodHash: "" };
440
- },
441
- assertTsWritable() {
442
- },
443
- validatePeriodName() {
444
- throw NOT_ENABLED2;
445
- },
446
- async appendPeriodLedgerEntry() {
447
- throw NOT_ENABLED2;
448
- }
449
- };
450
-
451
- // src/with-party/session/strategy.ts
452
- function notEnabled2(op) {
453
- return new Error(
454
- `${op} requires the session strategy. Import \`{ withSession }\` from "@noy-db/hub/session" and pass it to \`createNoydb({ sessionStrategy: withSession() })\`.`
455
- );
456
- }
457
- var NO_SESSION = {
458
- validateSessionPolicy() {
459
- throw notEnabled2("sessionPolicy");
460
- },
461
- createEnforcer() {
462
- throw notEnabled2("session policy enforcement");
463
- },
464
- revokeAllSessions() {
465
- }
466
- };
467
-
468
- // src/with-fork/shadow/strategy.ts
469
- var NOT_ENABLED3 = new Error(
470
- 'VaultFrame requires the shadow strategy. Import `{ withShadow }` from "@noy-db/hub/shadow" and pass it to `createNoydb({ shadowStrategy: withShadow() })`.'
471
- );
472
- var NO_SHADOW = {
473
- buildFrame() {
474
- throw NOT_ENABLED3;
475
- }
476
- };
477
-
478
- // src/with-fork/snapshots/strategy.ts
479
- var NOT_ENABLED4 = new Error(
480
- 'Snapshots require the snapshot strategy. Import `{ withSnapshots }` from "@noy-db/hub/snapshots" and pass it to `createNoydb({ snapshotStrategy: withSnapshots({ store }) })`.'
481
- );
482
- var NO_SNAPSHOTS = {
483
- async snapshot() {
484
- throw NOT_ENABLED4;
485
- },
486
- async listSnapshots() {
487
- throw NOT_ENABLED4;
488
- },
489
- async restoreSnapshot() {
490
- throw NOT_ENABLED4;
491
- },
492
- async autoSnapshot() {
493
- throw NOT_ENABLED4;
494
- }
495
- };
496
-
497
- // src/with-party/team/sync-strategy.ts
498
- function notEnabled3(op) {
499
- return new Error(
500
- `${op} requires the sync strategy. Import \`{ withSync }\` from "@noy-db/hub/sync" and pass it to \`createNoydb({ syncStrategy: withSync() })\`.`
501
- );
502
- }
503
- var NO_SYNC = {
504
- buildSyncEngine() {
505
- throw notEnabled3("SyncEngine");
506
- },
507
- buildSyncTransaction() {
508
- throw notEnabled3("SyncTransaction");
509
- },
510
- buildPresence() {
511
- throw notEnabled3("collection.presence()");
512
- }
513
- };
327
+ } from "./chunk-QZWTRENR.js";
514
328
 
515
329
  // src/with-commit/tx/strategy.ts
516
- var NOT_ENABLED5 = new Error(
517
- 'Multi-record transactions require the tx strategy. Import `{ withTransactions }` from "@noy-db/hub/tx" and pass it to `createNoydb({ txStrategy: withTransactions() })`.'
330
+ var NOT_ENABLED = new Error(
331
+ 'Multi-record transactions require the tx strategy. Import `{ withTransactions }` from "@noy-db/hub/transactions" and pass it to `createNoydb({ transactionsStrategy: withTransactions() })`.'
518
332
  );
519
- var NO_TX = {
333
+ var NO_TRANSACTIONS = {
520
334
  async runTransaction(_db, _fn, _options, _txInvariants) {
521
- throw NOT_ENABLED5;
335
+ throw NOT_ENABLED;
522
336
  },
523
337
  async runDryRun() {
524
- throw NOT_ENABLED5;
338
+ throw NOT_ENABLED;
525
339
  }
526
340
  };
527
341
 
@@ -535,10 +349,10 @@ var NO_ARCHIVE = {
535
349
 
536
350
  // src/port/with/strategies.ts
537
351
  var STRATEGY_DEFAULTS = {
538
- aggregate: NO_AGGREGATE,
352
+ reduce: NO_REDUCE,
539
353
  archive: NO_ARCHIVE,
540
354
  attestation: NO_ATTESTATION,
541
- blob: NO_BLOBS,
355
+ blobs: NO_BLOBS,
542
356
  broker: NO_BROKER,
543
357
  cargo: NO_CARGO,
544
358
  classified: NO_CLASSIFIED,
@@ -548,7 +362,7 @@ var STRATEGY_DEFAULTS = {
548
362
  forget: NO_FORGET,
549
363
  history: NO_HISTORY,
550
364
  i18n: NO_I18N,
551
- index: NO_INDEXING,
365
+ indexing: NO_INDEXING,
552
366
  lazy: IMPLICIT_LAZY,
553
367
  periods: NO_PERIODS,
554
368
  portability: NO_PORTABILITY,
@@ -557,11 +371,11 @@ var STRATEGY_DEFAULTS = {
557
371
  sequence: NO_SEQUENCE,
558
372
  session: NO_SESSION,
559
373
  shadow: NO_SHADOW,
560
- snapshot: NO_SNAPSHOTS,
374
+ snapshots: NO_SNAPSHOTS,
561
375
  sync: NO_SYNC,
562
376
  team: NO_TEAM,
563
377
  tiers: NO_TIERS,
564
- tx: NO_TX
378
+ transactions: NO_TRANSACTIONS
565
379
  };
566
380
  var STRATEGY_KEYS = Object.keys(STRATEGY_DEFAULTS);
567
381
  function resolveStrategies(options) {
@@ -576,10 +390,61 @@ function resolveStrategies(options) {
576
390
 
577
391
  // src/port/by/default-provider.ts
578
392
  async function createDefaultCoordinationProvider(store) {
579
- const { StoreCoordinationProvider } = await import("./store-coordination-provider-P3IU5JHD.js");
393
+ const { StoreCoordinationProvider } = await import("./store-coordination-provider-5LX2UFU2.js");
580
394
  return new StoreCoordinationProvider(store);
581
395
  }
582
396
 
397
+ // src/port/with/collection-registries.ts
398
+ function populateCollectionRegistries(r, collectionName, options, effectiveViaFields) {
399
+ if (options?.refs) {
400
+ r.refRegistry.register(collectionName, options.refs);
401
+ }
402
+ if (effectiveViaFields.i18nFields) {
403
+ r.i18nFieldRegistry.set(collectionName, effectiveViaFields.i18nFields);
404
+ }
405
+ if (options?.blobFields) {
406
+ r.blobFieldsRegistry.set(collectionName, options.blobFields);
407
+ }
408
+ if (options?.archive) {
409
+ r.archiveRegistry.set(collectionName, options.archive);
410
+ }
411
+ if (options?.attestation !== void 0) {
412
+ r.attestation.register(collectionName, options.attestation);
413
+ }
414
+ if (effectiveViaFields.dictKeyFields || effectiveViaFields.lookupFields) {
415
+ const dictFieldMap = {};
416
+ const staticFieldMap = {};
417
+ for (const [field, desc] of Object.entries(effectiveViaFields.dictKeyFields ?? {})) {
418
+ if (isStaticDictDescriptor(desc)) {
419
+ staticFieldMap[field] = desc;
420
+ r.staticDictNames.add(desc.name);
421
+ r.staticByName.set(desc.name, desc);
422
+ } else {
423
+ dictFieldMap[field] = desc.name;
424
+ }
425
+ }
426
+ const lookupCompat = collectLookupDictCompat(effectiveViaFields.lookupFields);
427
+ Object.assign(dictFieldMap, lookupCompat.dictFieldMap);
428
+ for (const [field, desc] of lookupCompat.staticEntries) {
429
+ staticFieldMap[field] = desc;
430
+ r.staticDictNames.add(desc.name);
431
+ r.staticByName.set(desc.name, desc);
432
+ }
433
+ if (Object.keys(dictFieldMap).length > 0) {
434
+ r.dictKeyFieldRegistry.set(collectionName, dictFieldMap);
435
+ for (const dictName of new Set(Object.values(dictFieldMap))) {
436
+ r.reservedLookupCollections.set(dictCollectionName(dictName), dictName);
437
+ }
438
+ }
439
+ if (Object.keys(staticFieldMap).length > 0) {
440
+ r.staticDescriptorByField.set(collectionName, staticFieldMap);
441
+ }
442
+ }
443
+ if ((options?.schemaUpdate?.length ?? 0) > 0) {
444
+ r.schemaUpdateNames.set(collectionName, (options.schemaUpdate ?? []).map((s) => s.name));
445
+ }
446
+ }
447
+
583
448
  // src/kernel/via/pipeline.ts
584
449
  var ViaPipeline = class _ViaPipeline {
585
450
  constructor(bindings, taint) {
@@ -1073,7 +938,7 @@ async function reconcileIndex(ctx, field, opts = {}) {
1073
938
  const persisted = ctx.persistedIndexes;
1074
939
  if (!persisted) {
1075
940
  throw new Error(
1076
- `Collection "${ctx.name}": indexing is disabled on this Noydb instance. Pass \`withIndexing()\` from "@noy-db/hub/indexing" to \`createNoydb({ indexStrategy })\`.`
941
+ `Collection "${ctx.name}": indexing is disabled on this Noydb instance. Pass \`withIndexing()\` from "@noy-db/hub/indexing" to \`createNoydb({ indexingStrategy })\`.`
1077
942
  );
1078
943
  }
1079
944
  if (!persisted.has(field)) {
@@ -2311,10 +2176,9 @@ function resolveCollectionConfig(opts) {
2311
2176
  }
2312
2177
 
2313
2178
  // src/with-formula/computed/lazy.ts
2314
- var fn = null;
2179
+ var loadComputed = lazy(() => import("./computed-AB45PS4V.js"));
2315
2180
  async function loadEvalComputedFields() {
2316
- fn ??= (await import("./computed-33DRJDOC.js")).evalComputedFields;
2317
- return fn;
2181
+ return (await loadComputed()).evalComputedFields;
2318
2182
  }
2319
2183
 
2320
2184
  // src/kernel/collection.ts
@@ -2356,7 +2220,7 @@ var Collection = class {
2356
2220
  * `NO_*` stub — a tiny module that throws with an actionable message —
2357
2221
  * so, for example, none of the BlobSet / chunk / MIME-magic machinery
2358
2222
  * reaches the bundle unless the consumer imports `@noy-db/hub/blobs` and
2359
- * passes `blobStrategy: blobs()` to `createNoydb`.
2223
+ * passes `blobsStrategy: blobs()` to `createNoydb`.
2360
2224
  */
2361
2225
  strategies;
2362
2226
  objectStore;
@@ -2398,7 +2262,7 @@ var Collection = class {
2398
2262
  lru;
2399
2263
  /**
2400
2264
  * tree-shake seam — per-Collection indexing state. Owned by the
2401
- * `IndexStrategy` passed through from `createNoydb({ indexStrategy })`.
2265
+ * `IndexingStrategy` passed through from `createNoydb({ indexingStrategy })`.
2402
2266
  * Defaults to a disabled state (both accessors return null) so the
2403
2267
  * `CollectionIndexes` / `PersistedCollectionIndex` / `LazyQuery`
2404
2268
  * classes never reach the bundle when indexing is unused.
@@ -2838,7 +2702,7 @@ var Collection = class {
2838
2702
  } else {
2839
2703
  this.lru = null;
2840
2704
  }
2841
- const strategy = opts.strategies.index;
2705
+ const strategy = opts.strategies.indexing;
2842
2706
  this.indexState = strategy.createState({
2843
2707
  defs: opts.indexes ?? [],
2844
2708
  lazy: this.lazy
@@ -3090,7 +2954,7 @@ var Collection = class {
3090
2954
  }
3091
2955
  await this.onAccess?.("find", "*");
3092
2956
  if (hits.length === 0) return [];
3093
- const { verifyDigestField } = await import("./verify-5X37OXRY.js");
2957
+ const { verifyDigestField } = await import("./verify-7XWHJWUN.js");
3094
2958
  const policy = {
3095
2959
  normalize: spec.verifyNormalize ?? "password",
3096
2960
  notLastN: spec.notLastN ?? 0,
@@ -3296,7 +3160,7 @@ var Collection = class {
3296
3160
  }
3297
3161
  }
3298
3162
  if (this.materializedViewSource !== void 0) {
3299
- const { resolveStaleMVOnRead } = await import("./stale-NBROTA66.js");
3163
+ const { resolveStaleMVOnRead } = await import("./stale-JOE7GBAE.js");
3300
3164
  await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
3301
3165
  }
3302
3166
  let record;
@@ -3782,7 +3646,7 @@ var Collection = class {
3782
3646
  */
3783
3647
  async dispatchMaterializedViews(id, record, wave) {
3784
3648
  if (this.materializedViewSource === void 0) return;
3785
- const { dispatchMaterializedViews } = await import("./dispatch-SMXUO7W5.js");
3649
+ const { dispatchMaterializedViews } = await import("./dispatch-RPTLK7LJ.js");
3786
3650
  return dispatchMaterializedViews(this.#mvDispatchCtx(this.materializedViewSource), id, record, wave);
3787
3651
  }
3788
3652
  /**
@@ -3955,7 +3819,7 @@ var Collection = class {
3955
3819
  * dispatch wave's per-target dedup; `undefined` on the local-write path (byte-identical). */
3956
3820
  async dispatchDerivations(id, record, version, wave) {
3957
3821
  if (this.derivationSource === void 0) return;
3958
- const { dispatchDerivations } = await import("./dispatch-PKQQFDBT.js");
3822
+ const { dispatchDerivations } = await import("./dispatch-7T45NN7C.js");
3959
3823
  return dispatchDerivations({
3960
3824
  ...this.#derivationDeleteCtx(this.derivationSource),
3961
3825
  via: this.via,
@@ -4232,7 +4096,7 @@ var Collection = class {
4232
4096
  */
4233
4097
  async dispatchArrayDerivationsOnDelete(id, eraseRecordShapeToo = false) {
4234
4098
  if (this.derivationSource === void 0) return 0;
4235
- const { dispatchArrayDerivationsOnDelete } = await import("./dispatch-PKQQFDBT.js");
4099
+ const { dispatchArrayDerivationsOnDelete } = await import("./dispatch-7T45NN7C.js");
4236
4100
  return dispatchArrayDerivationsOnDelete(this.#derivationDeleteCtx(this.derivationSource), id, eraseRecordShapeToo);
4237
4101
  }
4238
4102
  /**
@@ -4246,7 +4110,7 @@ var Collection = class {
4246
4110
  */
4247
4111
  async dispatchMaterializedViewsOnDelete(id) {
4248
4112
  if (this.materializedViewSource === void 0) return { deleted: 0, residueUndecodable: [], residueDeclined: [] };
4249
- const { dispatchMaterializedViewsOnDelete } = await import("./dispatch-SMXUO7W5.js");
4113
+ const { dispatchMaterializedViewsOnDelete } = await import("./dispatch-RPTLK7LJ.js");
4250
4114
  return dispatchMaterializedViewsOnDelete(this.#mvDispatchCtx(this.materializedViewSource), id);
4251
4115
  }
4252
4116
  /**
@@ -4266,7 +4130,7 @@ var Collection = class {
4266
4130
  );
4267
4131
  }
4268
4132
  if (this.materializedViewSource !== void 0) {
4269
- const { resolveStaleMVOnRead } = await import("./stale-NBROTA66.js");
4133
+ const { resolveStaleMVOnRead } = await import("./stale-JOE7GBAE.js");
4270
4134
  await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
4271
4135
  }
4272
4136
  await this.ensureHydrated();
@@ -4518,7 +4382,7 @@ var Collection = class {
4518
4382
  ...this.defaultLocale !== void 0 ? { defaultLocale: this.defaultLocale } : {},
4519
4383
  ...resolver.resolveDictSource ? { resolveDictSource: (field) => resolver.resolveDictSource(leftCollection, field) } : {}
4520
4384
  } : void 0;
4521
- return new Query(source, void 0, joinContext, this.strategies.aggregate);
4385
+ return new Query(source, void 0, joinContext, this.strategies.reduce);
4522
4386
  }
4523
4387
  /**
4524
4388
  * Subscribe to every put/delete on this collection. Returns an
@@ -5147,7 +5011,7 @@ var Collection = class {
5147
5011
  * vault-shared `_blob` DEK (enabling cross-collection deduplication).
5148
5012
  */
5149
5013
  blob(id) {
5150
- return this.strategies.blob.openSlot({
5014
+ return this.strategies.blobs.openSlot({
5151
5015
  store: this.adapter,
5152
5016
  vault: this.vault,
5153
5017
  collection: this.name,
@@ -5380,7 +5244,7 @@ var Collection = class {
5380
5244
  const persisted = this.persistedIndexes;
5381
5245
  if (!persisted) {
5382
5246
  throw new Error(
5383
- `Collection "${this.name}": lazyQuery() requires indexing to be enabled. Pass \`withIndexing()\` from "@noy-db/hub/indexing" to \`createNoydb({ indexStrategy: withIndexing() })\`.`
5247
+ `Collection "${this.name}": lazyQuery() requires indexing to be enabled. Pass \`withIndexing()\` from "@noy-db/hub/indexing" to \`createNoydb({ indexingStrategy: withIndexing() })\`.`
5384
5248
  );
5385
5249
  }
5386
5250
  if (persisted.fields().length === 0) {
@@ -5419,14 +5283,14 @@ var Collection = class {
5419
5283
  /** C-A/R10: persist the classified marker once per classified handle (store I/O in config-drift.ts). */
5420
5284
  async _ensureClassifiedMarker() {
5421
5285
  if (this._markerPersisted || this.vdigFields === null) return;
5422
- const { persistClassifiedMarkerForFields } = await import("./classified-marker-52P3D72W.js");
5286
+ const { persistClassifiedMarkerForFields } = await import("./classified-marker-EOOSMWFC.js");
5423
5287
  await persistClassifiedMarkerForFields(this.adapter, this.vault, this.name, this.vdigFields, await this.getDEK(this.name));
5424
5288
  this._markerPersisted = true;
5425
5289
  }
5426
5290
  /** C-A/R10 drift signal — the marker's declared digest-only set, memoized to one store read per handle (see config-drift.ts). */
5427
5291
  async _classifiedMarkerDigestOnly() {
5428
5292
  if (this._markerDigestOnlyCache !== void 0) return this._markerDigestOnlyCache;
5429
- const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-52P3D72W.js");
5293
+ const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-EOOSMWFC.js");
5430
5294
  this._markerDigestOnlyCache = await readClassifiedMarkerDigestOnly(this.adapter, this.vault, this.name, await this.getDEK(this.name));
5431
5295
  return this._markerDigestOnlyCache;
5432
5296
  }
@@ -5554,7 +5418,7 @@ var Collection = class {
5554
5418
  },
5555
5419
  historyEnabled: this.historyConfig.enabled !== false && this.strategies.history !== NO_HISTORY,
5556
5420
  // #728/#737: lets putAtTier skip decrypting `existing` when no real history strategy is wired
5557
- syncBlobs: (id, fromTier, toTier) => this.strategies.blob !== NO_BLOBS ? this.blob(id).syncTierMove(fromTier, toTier, this.blobTierPolicy) : Promise.resolve(),
5421
+ syncBlobs: (id, fromTier, toTier) => this.strategies.blobs !== NO_BLOBS ? this.blob(id).syncTierMove(fromTier, toTier, this.blobTierPolicy) : Promise.resolve(),
5558
5422
  // #724 I1: gate on blob storage enabled (not on declared blobFields) so undeclared-field blobs still rehome; #746: syncTierMove mints/resumes the rehome journal marker; self-no-ops on an empty slot map
5559
5423
  syncLedger: async (id) => {
5560
5424
  await this.ledger?.purgeRecordDeltas(this.name, id);
@@ -5597,6 +5461,64 @@ var Collection = class {
5597
5461
  }
5598
5462
  };
5599
5463
 
5464
+ // src/port/with/capabilities.ts
5465
+ function assertCanExport(keyring, tier, format) {
5466
+ if (tier === "plaintext") {
5467
+ if (format === void 0) {
5468
+ throw new Error("vault.assertCanExport: plaintext tier requires a format");
5469
+ }
5470
+ if (!hasExportCapability(keyring, "plaintext", format)) {
5471
+ throw new ExportCapabilityError({
5472
+ tier: "plaintext",
5473
+ userId: keyring.userId,
5474
+ format
5475
+ });
5476
+ }
5477
+ return;
5478
+ }
5479
+ if (!hasExportCapability(keyring, "bundle")) {
5480
+ throw new ExportCapabilityError({
5481
+ tier: "bundle",
5482
+ userId: keyring.userId
5483
+ });
5484
+ }
5485
+ }
5486
+ function assertCanImport(keyring, tier, format) {
5487
+ if (tier === "plaintext") {
5488
+ if (format === void 0) {
5489
+ throw new Error("vault.assertCanImport: plaintext tier requires a format");
5490
+ }
5491
+ if (!hasImportCapability(keyring, "plaintext", format)) {
5492
+ throw new ImportCapabilityError({
5493
+ tier: "plaintext",
5494
+ userId: keyring.userId,
5495
+ format
5496
+ });
5497
+ }
5498
+ return;
5499
+ }
5500
+ if (!hasImportCapability(keyring, "bundle")) {
5501
+ throw new ImportCapabilityError({
5502
+ tier: "bundle",
5503
+ userId: keyring.userId
5504
+ });
5505
+ }
5506
+ }
5507
+ function canExport(keyring, tier, format) {
5508
+ if (tier === "plaintext") {
5509
+ if (format === void 0) return false;
5510
+ return hasExportCapability(keyring, "plaintext", format);
5511
+ }
5512
+ return hasExportCapability(keyring, "bundle");
5513
+ }
5514
+ function canImport(keyring, tier, format) {
5515
+ if (tier === "plaintext") {
5516
+ if (format === void 0) return false;
5517
+ return hasImportCapability(keyring, "plaintext", format);
5518
+ }
5519
+ return hasImportCapability(keyring, "bundle");
5520
+ }
5521
+
5600
5522
  // src/with-commit/tx/elevated-handle.ts
5601
5523
  var ELEVATION_AUDIT_COLLECTION = "_elevation_audit";
5602
5524
  var ElevatedHandle = class {
@@ -6811,7 +6733,7 @@ var VaultLinks = class {
6811
6733
  // src/with-shape/links/lazy-handle.ts
6812
6734
  function makeLazyLinkSetHandle(d) {
6813
6735
  let engine = null;
6814
- const load = () => engine ??= import("./link-set-ZU4E5J5S.js").then(
6736
+ const load = () => engine ??= import("./link-set-POQB7BU5.js").then(
6815
6737
  ({ LinkSet }) => new LinkSet(d.adapter, d.vault, d.name, d.spec, d.encrypted, d.getDEK, d.actor, d.emitter, d.endpointExists)
6816
6738
  );
6817
6739
  return {
@@ -7294,7 +7216,7 @@ var SatelliteRegistry = class {
7294
7216
  if (reason !== void 0) throw new SatelliteConfigError(reason);
7295
7217
  }
7296
7218
  /** Per-base async mutex: chains sections on a stored promise tail. */
7297
- async withPairLock(base, fn2) {
7219
+ async withPairLock(base, fn) {
7298
7220
  const tail = this.locks.get(base) ?? Promise.resolve();
7299
7221
  let release;
7300
7222
  const gate = new Promise((res) => {
@@ -7303,7 +7225,7 @@ var SatelliteRegistry = class {
7303
7225
  this.locks.set(base, tail.then(() => gate));
7304
7226
  await tail;
7305
7227
  try {
7306
- return await fn2();
7228
+ return await fn();
7307
7229
  } finally {
7308
7230
  release();
7309
7231
  }
@@ -7349,7 +7271,7 @@ function declareSatellite(ctx, collectionName, options, existingRegistry) {
7349
7271
  ctx.forEachSyncEngine((e) => e.remirrorPairResolvers([spec.base, spec.satellite]));
7350
7272
  const registry = reg;
7351
7273
  const baseSchema = ctx.getBaseSchema(spec.base);
7352
- void import("./post-register-XIAHB6KF.js").then((m) => m.postRegister(ctx.adapter, ctx.vaultName, spec, ctx.getDEK, baseSchema, registry)).catch(() => {
7274
+ void import("./post-register-URQANI3B.js").then((m) => m.postRegister(ctx.adapter, ctx.vaultName, spec, ctx.getDEK, baseSchema, registry)).catch(() => {
7353
7275
  });
7354
7276
  return reg;
7355
7277
  }
@@ -7680,20 +7602,6 @@ async function migrateSatelliteCek(name, coll) {
7680
7602
  return { migrated };
7681
7603
  }
7682
7604
 
7683
- // src/with-shape/schema-update/gate.ts
7684
- var SchemaUpdateGate = class {
7685
- #decision;
7686
- constructor(decision) {
7687
- this.#decision = decision.catch(() => null);
7688
- }
7689
- async assertWritable() {
7690
- const decision = await this.#decision;
7691
- if (decision && decision.action === "reject") {
7692
- throw decision.error;
7693
- }
7694
- }
7695
- };
7696
-
7697
7605
  // src/with-shape/schema-update/fence-controller.ts
7698
7606
  var SchemaFenceController = class {
7699
7607
  #coordination;
@@ -8245,6 +8153,22 @@ var Vault = class {
8245
8153
  enforceStaticDictOnPut: (collectionName, record) => this.enforceStaticDictOnPut(collectionName, record)
8246
8154
  };
8247
8155
  }
8156
+ /** The registries `populateCollectionRegistries` writes into (#841). */
8157
+ #registries() {
8158
+ return {
8159
+ refRegistry: this.refRegistry,
8160
+ i18nFieldRegistry: this.i18nFieldRegistry,
8161
+ blobFieldsRegistry: this.blobFieldsRegistry,
8162
+ archiveRegistry: this.archiveRegistry,
8163
+ attestation: this.attestation,
8164
+ dictKeyFieldRegistry: this.dictKeyFieldRegistry,
8165
+ staticDictNames: this.staticDictNames,
8166
+ staticByName: this.staticByName,
8167
+ staticDescriptorByField: this.staticDescriptorByField,
8168
+ reservedLookupCollections: this.reservedLookupCollections,
8169
+ schemaUpdateNames: this.#schemaUpdateNames
8170
+ };
8171
+ }
8248
8172
  collection(collectionName, options) {
8249
8173
  const overlayRegistry = this.overlayedViewRegistry;
8250
8174
  if (overlayRegistry !== null && overlayRegistry.isOverlay(collectionName)) {
@@ -8278,8 +8202,8 @@ var Vault = class {
8278
8202
  registerPoisonHook: (hook) => {
8279
8203
  this.noydb._writeHooks.onBeforeWrite(hook);
8280
8204
  },
8281
- forEachSyncEngine: (fn2) => {
8282
- this.noydb._forEachSyncEngine(this.name, fn2);
8205
+ forEachSyncEngine: (fn) => {
8206
+ this.noydb._forEachSyncEngine(this.name, fn);
8283
8207
  }
8284
8208
  }, collectionName, { ...options, satelliteOf: options.satelliteOf }, this.satelliteRegistry);
8285
8209
  }
@@ -8296,60 +8220,14 @@ var Vault = class {
8296
8220
  });
8297
8221
  }
8298
8222
  if (!coll) {
8299
- if (options?.refs) {
8300
- this.refRegistry.register(collectionName, options.refs);
8301
- }
8302
- if (effectiveViaFields.i18nFields) {
8303
- this.i18nFieldRegistry.set(collectionName, effectiveViaFields.i18nFields);
8304
- }
8305
- if (options?.blobFields) {
8306
- this.blobFieldsRegistry.set(collectionName, options.blobFields);
8307
- }
8308
- if (options?.archive) {
8309
- this.archiveRegistry.set(collectionName, options.archive);
8310
- }
8311
- if (options?.attestation !== void 0) {
8312
- this.attestation.register(collectionName, options.attestation);
8313
- }
8314
- if (effectiveViaFields.dictKeyFields || effectiveViaFields.lookupFields) {
8315
- const dictFieldMap = {};
8316
- const staticFieldMap = {};
8317
- for (const [field, desc] of Object.entries(effectiveViaFields.dictKeyFields ?? {})) {
8318
- if (isStaticDictDescriptor(desc)) {
8319
- staticFieldMap[field] = desc;
8320
- this.staticDictNames.add(desc.name);
8321
- this.staticByName.set(desc.name, desc);
8322
- } else {
8323
- dictFieldMap[field] = desc.name;
8324
- }
8325
- }
8326
- const lookupCompat = collectLookupDictCompat(effectiveViaFields.lookupFields);
8327
- Object.assign(dictFieldMap, lookupCompat.dictFieldMap);
8328
- for (const [field, desc] of lookupCompat.staticEntries) {
8329
- staticFieldMap[field] = desc;
8330
- this.staticDictNames.add(desc.name);
8331
- this.staticByName.set(desc.name, desc);
8332
- }
8333
- if (Object.keys(dictFieldMap).length > 0) {
8334
- this.dictKeyFieldRegistry.set(collectionName, dictFieldMap);
8335
- for (const dictName of new Set(Object.values(dictFieldMap))) {
8336
- this.reservedLookupCollections.set(dictCollectionName(dictName), dictName);
8337
- }
8338
- }
8339
- if (Object.keys(staticFieldMap).length > 0) {
8340
- this.staticDescriptorByField.set(collectionName, staticFieldMap);
8341
- }
8342
- }
8343
- if ((options?.schemaUpdate?.length ?? 0) > 0) {
8344
- this.#schemaUpdateNames.set(collectionName, (options.schemaUpdate ?? []).map((s) => s.name));
8345
- }
8223
+ populateCollectionRegistries(this.#registries(), collectionName, options, effectiveViaFields);
8346
8224
  let schemaUpdateGate;
8347
8225
  if (options?.persistJsonSchema === true && options.schema !== void 0 && (options.schemaUpdate?.length ?? 0) > 0) {
8348
8226
  const validator = options.schema;
8349
8227
  const strategies = options.schemaUpdate ?? [];
8350
8228
  const work = (async () => {
8351
8229
  const dek = await this.getDEK(collectionName);
8352
- const { persistSchemaIfNeeded } = await import("./register-HB4TQZSV.js");
8230
+ const { persistSchemaIfNeeded } = await import("./register-5W6CG4RM.js");
8353
8231
  const result = await persistSchemaIfNeeded({
8354
8232
  store: this.adapter,
8355
8233
  vault: this.name,
@@ -8435,7 +8313,7 @@ var Vault = class {
8435
8313
  if (subjectKey !== void 0) {
8436
8314
  if (options?.perRecordKeys === false) {
8437
8315
  console.warn(
8438
- `[noy-db] Collection "${collectionName}" is declared in withForgetCascade but opened with perRecordKeys: false. Forcing perRecordKeys: true \u2014 GDPR crypto-shred requires per-record CEKs.`
8316
+ `[noy-db] Collection "${collectionName}" is declared in withForget but opened with perRecordKeys: false. Forcing perRecordKeys: true \u2014 GDPR crypto-shred requires per-record CEKs.`
8439
8317
  );
8440
8318
  }
8441
8319
  collOpts.perRecordKeys = true;
@@ -8498,7 +8376,7 @@ var Vault = class {
8498
8376
  const work = (async () => {
8499
8377
  try {
8500
8378
  const dek = await this.getDEK(collectionName);
8501
- await (await import("./register-HB4TQZSV.js")).persistSchemaIfNeeded({
8379
+ await (await import("./register-5W6CG4RM.js")).persistSchemaIfNeeded({
8502
8380
  store: this.adapter,
8503
8381
  vault: this.name,
8504
8382
  collectionName,
@@ -9368,7 +9246,7 @@ var Vault = class {
9368
9246
  * stay decryptable; migrate, then re-forget) and `blobResidueCollections` (blob attachments, keyed
9369
9247
  * off a separate `_blob` DEK, out of scope here).
9370
9248
  *
9371
- * @throws ForgetStrategyNotConfiguredError when no `withForgetCascade` was set.
9249
+ * @throws ForgetStrategyNotConfiguredError when no `withForget` was set.
9372
9250
  */
9373
9251
  async forget(subjectId) {
9374
9252
  if (Object.keys(this.strategies.forget.subjects).length === 0) {
@@ -9393,7 +9271,7 @@ var Vault = class {
9393
9271
  const sealedResidue = [];
9394
9272
  const indexResidue = [];
9395
9273
  const ledgerDeltaResidue = [];
9396
- const blobsEnabled = this.strategies.blob !== NO_BLOBS;
9274
+ const blobsEnabled = this.strategies.blobs !== NO_BLOBS;
9397
9275
  const actor = this.keyring.userId;
9398
9276
  const fanoutStats = { recordsErased: 0, aggregatesRecomputed: 0, residueFrozen: [], lookupReferencesCascaded: 0, lookupReferencesNullified: 0, lookupReferencesResidue: [], derivedResidueUndecodable: [], derivedResidueDeclined: [] };
9399
9277
  const { partitionSealedCekKeys, shouldSkipBlobScan, bumpResidueCount, residueNoticesFromMap } = await import("./purge-scope-FGNNLWHD.js");
@@ -9657,7 +9535,7 @@ var Vault = class {
9657
9535
  async _initGuards(handles) {
9658
9536
  if (handles.length === 0) return;
9659
9537
  const [{ GuardRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
9660
- import("./registry-VW6P6A3J.js"),
9538
+ import("./registry-BWD2ED52.js"),
9661
9539
  import("./read-only-facade-CHCKSEPD.js")
9662
9540
  ]);
9663
9541
  const registry = new GuardRegistry();
@@ -9685,7 +9563,7 @@ var Vault = class {
9685
9563
  async _initDerivations(handles) {
9686
9564
  if (handles.length === 0) return;
9687
9565
  const [{ DerivationRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
9688
- import("./registry-JOFO7RAH.js"),
9566
+ import("./registry-MCSGBZXI.js"),
9689
9567
  import("./read-only-facade-CHCKSEPD.js")
9690
9568
  ]);
9691
9569
  const registry = new DerivationRegistry();
@@ -9717,7 +9595,7 @@ var Vault = class {
9717
9595
  */
9718
9596
  async _initMaterializedViews(handles) {
9719
9597
  if (handles.length === 0) return;
9720
- const { MaterializedViewRegistry } = await import("./registry-6BMBFEXT.js");
9598
+ const { MaterializedViewRegistry } = await import("./registry-UJFP3NWF.js");
9721
9599
  const registry = new MaterializedViewRegistry();
9722
9600
  this.materializedViewRegistry = registry;
9723
9601
  const db = this;
@@ -9742,7 +9620,7 @@ var Vault = class {
9742
9620
  */
9743
9621
  async _initOverlayedViews(handles) {
9744
9622
  if (handles.length === 0) return;
9745
- const { OverlayedViewRegistry } = await import("./registry-7CZWF3EQ.js");
9623
+ const { OverlayedViewRegistry } = await import("./registry-7Y5WF7GS.js");
9746
9624
  const registry = new OverlayedViewRegistry();
9747
9625
  const mvRegistry = this.materializedViewRegistry;
9748
9626
  const overlayNames = /* @__PURE__ */ new Set();
@@ -9789,14 +9667,14 @@ var Vault = class {
9789
9667
  if (!reg) {
9790
9668
  throw new Error(`refreshView: no MV registered with name "${name}"`);
9791
9669
  }
9792
- const { MaterializedViewExecutor } = await import("./executor-SHYLIBOM.js");
9670
+ const { MaterializedViewExecutor } = await import("./executor-XZYM4KHT.js");
9793
9671
  const result = await MaterializedViewExecutor.refresh(reg, {
9794
9672
  getCollection: (n) => this.collection(n),
9795
9673
  getActiveTxContext: () => this.noydb._activeTxContextOrNull,
9796
9674
  getQueryContext: () => this,
9797
9675
  dispatchCtx: this._dispatchCtx({ collection: name, id: "refreshView" })
9798
9676
  });
9799
- const { clearMVStaleFully } = await import("./stale-NBROTA66.js");
9677
+ const { clearMVStaleFully } = await import("./stale-JOE7GBAE.js");
9800
9678
  await clearMVStaleFully(this.adapter, this.name, registry, name);
9801
9679
  return result;
9802
9680
  }
@@ -9809,7 +9687,7 @@ var Vault = class {
9809
9687
  if (registry === null) return { derived: 0, failed: 0, skippedFrozen: 0 };
9810
9688
  const strategies = registry.strategiesForSource(sourceCollection);
9811
9689
  if (strategies.length === 0) return { derived: 0, failed: 0, skippedFrozen: 0 };
9812
- const { DerivationExecutor } = await import("./executor-FCJEH3FU.js");
9690
+ const { DerivationExecutor } = await import("./executor-IEBLTBCW.js");
9813
9691
  const sourceColl = this.collection(sourceCollection);
9814
9692
  const records = await sourceColl.list();
9815
9693
  const ctx = { vault: this.derivationFacade ?? new (await import("./read-only-facade-CHCKSEPD.js")).ReadOnlyVaultFacade(this, "derivation") };
@@ -9836,7 +9714,7 @@ var Vault = class {
9836
9714
  if (!outSpec) continue;
9837
9715
  const outputColl = this.collection(outSpec.collection);
9838
9716
  if (out.kind === "array") {
9839
- const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-WWXVHHUH.js");
9717
+ const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-TV7CXAJ6.js");
9840
9718
  const prior = await loadFanoutSidecar(this.adapter, this.name, spec.source, id, key, this.getDEK, this.encrypted);
9841
9719
  const prevKeys = new Set(prior?.keys ?? []);
9842
9720
  const newKeysList = out.entries.map((e) => e.key);
@@ -9991,11 +9869,11 @@ var Vault = class {
9991
9869
  *
9992
9870
  *.
9993
9871
  */
9994
- async withConsent(ctx, fn2) {
9872
+ async withConsent(ctx, fn) {
9995
9873
  const prior = this.consentContext;
9996
9874
  this.consentContext = ctx;
9997
9875
  try {
9998
- return await fn2();
9876
+ return await fn();
9999
9877
  } finally {
10000
9878
  this.consentContext = prior;
10001
9879
  }
@@ -10063,7 +9941,7 @@ var Vault = class {
10063
9941
  * collection.
10064
9942
  */
10065
9943
  async delegate(opts) {
10066
- const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-WWZPEDK2.js");
9944
+ const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-ONOZVPIP.js");
10067
9945
  if (!this.keyring.kek) {
10068
9946
  throw new ValidationError(
10069
9947
  "issueDelegation: keyring.kek is null \u2014 issuing a delegation requires a tier-1 unlock. Re-authenticate at tier 1 (secret) first."
@@ -10085,7 +9963,7 @@ var Vault = class {
10085
9963
  * if the id does not exist.
10086
9964
  */
10087
9965
  async revokeDelegation(id) {
10088
- const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-WWZPEDK2.js");
9966
+ const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-ONOZVPIP.js");
10089
9967
  await revokeDelegation(this.adapter, this.name, id);
10090
9968
  void DELEGATIONS_COLLECTION;
10091
9969
  }
@@ -10333,7 +10211,7 @@ var Vault = class {
10333
10211
  * @see docs/superpowers/specs/2026-05-22-schema-dump-design.md
10334
10212
  */
10335
10213
  async dumpSchema(opts = {}) {
10336
- const { dumpVaultSchema } = await import("./walk-E3OVLBFR.js");
10214
+ const { dumpVaultSchema } = await import("./walk-6OHAWGBS.js");
10337
10215
  return dumpVaultSchema(this, opts);
10338
10216
  }
10339
10217
  /**
@@ -10468,7 +10346,7 @@ var Vault = class {
10468
10346
  * @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/public-envelope.md
10469
10347
  */
10470
10348
  async getCover(opts = {}) {
10471
- const { readCover } = await import("./cover-5BSNJREH.js");
10349
+ const { readCover } = await import("./cover/index.js");
10472
10350
  return readCover(this.adapter, this.name, opts);
10473
10351
  }
10474
10352
  /**
@@ -10483,7 +10361,7 @@ var Vault = class {
10483
10361
  * both modes round-trip cleanly.
10484
10362
  */
10485
10363
  async dump() {
10486
- const { dumpVault } = await import("./backup-YCHAC575.js");
10364
+ const { dumpVault } = await import("./backup-PTSVXDDW.js");
10487
10365
  return dumpVault(this.backupContext());
10488
10366
  }
10489
10367
  /**
@@ -10535,7 +10413,7 @@ var Vault = class {
10535
10413
  * — there's no chain to verify against.
10536
10414
  */
10537
10415
  async load(backupJson) {
10538
- const { loadVault } = await import("./backup-YCHAC575.js");
10416
+ const { loadVault } = await import("./backup-PTSVXDDW.js");
10539
10417
  return loadVault(this.backupContext(), backupJson);
10540
10418
  }
10541
10419
  /**
@@ -10567,7 +10445,7 @@ var Vault = class {
10567
10445
  * way to detect tampering of an in-place vault.
10568
10446
  */
10569
10447
  async verifyBackupIntegrity() {
10570
- const { verifyBackupIntegrity } = await import("./backup-YCHAC575.js");
10448
+ const { verifyBackupIntegrity } = await import("./backup-PTSVXDDW.js");
10571
10449
  return verifyBackupIntegrity(this.backupContext());
10572
10450
  }
10573
10451
  /**
@@ -10785,7 +10663,7 @@ var Vault = class {
10785
10663
  * is the live validator object, not a serialization of it).
10786
10664
  */
10787
10665
  async exportJSON(opts = {}) {
10788
- const { exportVaultJSON } = await import("./backup-YCHAC575.js");
10666
+ const { exportVaultJSON } = await import("./backup-PTSVXDDW.js");
10789
10667
  return exportVaultJSON(this.backupContext(), opts);
10790
10668
  }
10791
10669
  };
@@ -10862,10 +10740,10 @@ var WriteQueueTracker = class {
10862
10740
  * (success or failure). The fn's resolved value is returned; a thrown
10863
10741
  * error is re-thrown after the queue is decremented.
10864
10742
  */
10865
- async track(fn2) {
10743
+ async track(fn) {
10866
10744
  this.begin();
10867
10745
  try {
10868
- const value = await fn2();
10746
+ const value = await fn();
10869
10747
  this.settle();
10870
10748
  return value;
10871
10749
  } catch (error) {
@@ -10888,6 +10766,183 @@ var WriteQueueTracker = class {
10888
10766
  }
10889
10767
  };
10890
10768
 
10769
+ // src/port/with/write-hooks.ts
10770
+ var WriteHookRegistry = class {
10771
+ #before = [];
10772
+ #after = [];
10773
+ #suppressed = false;
10774
+ /** True while handlers are running — used by the write path to skip nested firing. */
10775
+ get suppressed() {
10776
+ return this.#suppressed;
10777
+ }
10778
+ /** True when any hook is registered (cheap gate for the write path). */
10779
+ get hasHandlers() {
10780
+ return this.#before.length > 0 || this.#after.length > 0;
10781
+ }
10782
+ onBeforeWrite(handler) {
10783
+ this.#before.push(handler);
10784
+ return () => {
10785
+ const i = this.#before.indexOf(handler);
10786
+ if (i >= 0) this.#before.splice(i, 1);
10787
+ };
10788
+ }
10789
+ onAfterWrite(handler) {
10790
+ this.#after.push(handler);
10791
+ return () => {
10792
+ const i = this.#after.indexOf(handler);
10793
+ if (i >= 0) this.#after.splice(i, 1);
10794
+ };
10795
+ }
10796
+ /** Run before-hooks (awaited, in order). A throw propagates and aborts the write. */
10797
+ async runBefore(event) {
10798
+ if (this.#before.length === 0) return;
10799
+ this.#suppressed = true;
10800
+ try {
10801
+ for (const h of this.#before.slice()) await h(event);
10802
+ } finally {
10803
+ this.#suppressed = false;
10804
+ }
10805
+ }
10806
+ /** Run after-hooks (awaited, in order). Per-handler errors are warned, not thrown. */
10807
+ async runAfter(event) {
10808
+ if (this.#after.length === 0) return;
10809
+ this.#suppressed = true;
10810
+ try {
10811
+ for (const h of this.#after.slice()) {
10812
+ try {
10813
+ await h(event);
10814
+ } catch (err) {
10815
+ console.warn(
10816
+ `[noy-db] onAfterWrite handler failed for ${event.collection}/${event.docId}: ` + (err instanceof Error ? err.message : String(err))
10817
+ );
10818
+ }
10819
+ }
10820
+ } finally {
10821
+ this.#suppressed = false;
10822
+ }
10823
+ }
10824
+ };
10825
+
10826
+ // src/port/with/service-bus.ts
10827
+ var ServiceBus = class {
10828
+ #handlers = /* @__PURE__ */ new Map();
10829
+ #gateHandlers = /* @__PURE__ */ new Map();
10830
+ #depth = 0;
10831
+ /** Register a handler for an observe point. Returns an unsubscribe fn. */
10832
+ register(point, handler) {
10833
+ let arr = this.#handlers.get(point);
10834
+ if (!arr) {
10835
+ arr = [];
10836
+ this.#handlers.set(point, arr);
10837
+ }
10838
+ arr.push(handler);
10839
+ return () => {
10840
+ const a = this.#handlers.get(point);
10841
+ if (!a) return;
10842
+ const i = a.indexOf(handler);
10843
+ if (i >= 0) a.splice(i, 1);
10844
+ };
10845
+ }
10846
+ /** Cheap gate for the write path — true when any handler is registered for the point. */
10847
+ hasHandlers(point) {
10848
+ const a = this.#handlers.get(point);
10849
+ return a !== void 0 && a.length > 0;
10850
+ }
10851
+ /**
10852
+ * True while one or more dispatches are in flight. Backed by a depth counter
10853
+ * so that two concurrent async dispatches (`Promise.all([put('a'), put('b')])`
10854
+ * each captured `busAfterPut=true` at their respective put() tops while depth
10855
+ * was 0) both proceed independently — the counter stays > 0 until BOTH finish,
10856
+ * so any nested write attempted by a handler still sees `dispatching === true`
10857
+ * and is suppressed by the write-path gate in `collection.ts`
10858
+ * (`busAfterPut = hasHandlers('afterPut') && !dispatching`). Re-entrancy
10859
+ * suppression lives exclusively on that write-path gate; concurrent independent
10860
+ * dispatches must not drop each other's events.
10861
+ */
10862
+ get dispatching() {
10863
+ return this.#depth > 0;
10864
+ }
10865
+ /**
10866
+ * Dispatch in registration order, awaited. Per-handler errors are warned, not
10867
+ * thrown — an observe handler must never abort a completed write. A
10868
+ * re-entrancy guard suppresses nested firing so a handler that itself writes
10869
+ * cannot loop (same rationale as WriteHookRegistry.#suppressed).
10870
+ */
10871
+ async dispatch(point, event) {
10872
+ const a = this.#handlers.get(point);
10873
+ if (!a || a.length === 0) return;
10874
+ this.#depth++;
10875
+ try {
10876
+ for (const h of a.slice()) {
10877
+ try {
10878
+ await h(event);
10879
+ } catch (err) {
10880
+ console.warn(
10881
+ `[noy-db] service observe handler failed at ${point}: ` + (err instanceof Error ? err.message : String(err))
10882
+ );
10883
+ }
10884
+ }
10885
+ } finally {
10886
+ this.#depth--;
10887
+ }
10888
+ }
10889
+ /**
10890
+ * Register a write-gating handler. A throw from the handler ABORTS the
10891
+ * write. Returns an unsubscribe fn. See {@link GateRegisterOptions} for
10892
+ * the `needsPrior` prior-read declaration (#267).
10893
+ */
10894
+ registerGate(point, handler, opts) {
10895
+ let arr = this.#gateHandlers.get(point);
10896
+ if (!arr) {
10897
+ arr = [];
10898
+ this.#gateHandlers.set(point, arr);
10899
+ }
10900
+ const entry = { fn: handler, needsPrior: opts?.needsPrior !== false };
10901
+ arr.push(entry);
10902
+ return () => {
10903
+ const a = this.#gateHandlers.get(point);
10904
+ if (!a) return;
10905
+ const i = a.indexOf(entry);
10906
+ if (i >= 0) a.splice(i, 1);
10907
+ };
10908
+ }
10909
+ /** Cheap gate for the write path — true when any gate handler is registered for the point. */
10910
+ hasGateHandlers(point) {
10911
+ const a = this.#gateHandlers.get(point);
10912
+ return a !== void 0 && a.length > 0;
10913
+ }
10914
+ /**
10915
+ * True when at least one gate handler at `point` needs the prior record
10916
+ * (the default). False when the point has no handlers or every handler
10917
+ * registered with `needsPrior: false` — the write path then skips the
10918
+ * prior-read before dispatching (#267 prior-read elision).
10919
+ */
10920
+ gateNeedsPrior(point) {
10921
+ const a = this.#gateHandlers.get(point);
10922
+ if (!a) return false;
10923
+ return a.some((e) => e.needsPrior);
10924
+ }
10925
+ /**
10926
+ * Run gate handlers in registration order, awaited. Unlike `dispatch`
10927
+ * (observe), a handler throw is NOT swallowed — it PROPAGATES, aborting the
10928
+ * write before it reaches the store. The first throw stops the remaining
10929
+ * handlers (fail-fast). This is the seam guards/periods migrate onto.
10930
+ *
10931
+ * Note: gate handlers are validators that read, not write. A gate handler
10932
+ * that writes back into the same collection would re-enter the write path
10933
+ * and re-dispatch this point; loop-suppression for that case is deferred to
10934
+ * the migration slice (contract: gate handlers must not perform writes that
10935
+ * re-trigger their own point).
10936
+ */
10937
+ async dispatchGate(point, event) {
10938
+ const a = this.#gateHandlers.get(point);
10939
+ if (!a || a.length === 0) return;
10940
+ for (const e of a.slice()) {
10941
+ await e.fn(event);
10942
+ }
10943
+ }
10944
+ };
10945
+
10891
10946
  // src/with-party/tab-coordination.ts
10892
10947
  var TabCoordinator = class {
10893
10948
  tabId;
@@ -10950,13 +11005,13 @@ var TabCoordinator = class {
10950
11005
  const out = [self, ...[...this.#peers.values()].filter((p) => p.lastSeen >= cutoff)];
10951
11006
  return out.sort((a, b) => a.tabId.localeCompare(b.tabId));
10952
11007
  }
10953
- onTabRoleChange(fn2) {
10954
- this.#roleHandlers.add(fn2);
10955
- return () => this.#roleHandlers.delete(fn2);
11008
+ onTabRoleChange(fn) {
11009
+ this.#roleHandlers.add(fn);
11010
+ return () => this.#roleHandlers.delete(fn);
10956
11011
  }
10957
- onActiveTabsChange(fn2) {
10958
- this.#tabsHandlers.add(fn2);
10959
- return () => this.#tabsHandlers.delete(fn2);
11012
+ onActiveTabsChange(fn) {
11013
+ this.#tabsHandlers.add(fn);
11014
+ return () => this.#tabsHandlers.delete(fn);
10960
11015
  }
10961
11016
  dispose() {
10962
11017
  if (this.#disposed) return;
@@ -11304,7 +11359,7 @@ var NoydbSnapshots = class {
11304
11359
  dirtyVaults = /* @__PURE__ */ new Set();
11305
11360
  /**
11306
11361
  * Take an on-demand checkpoint of the given vault.
11307
- * Requires `snapshotStrategy: withSnapshots({ store })` in `createNoydb`.
11362
+ * Requires `snapshotsStrategy: withSnapshots({ store })` in `createNoydb`.
11308
11363
  * @throws ValidationError when the vault is not open
11309
11364
  */
11310
11365
  async snapshot(vault, opts) {
@@ -11466,129 +11521,6 @@ function memoryStore() {
11466
11521
  };
11467
11522
  }
11468
11523
 
11469
- // src/with-party/auth-introspection/index.ts
11470
- async function describeAuthConfig(store, vault) {
11471
- const policy = await loadVaultPolicy(store, vault) ?? defaultPolicySnapshot();
11472
- const recoveryProfiles = await listRecoveryProfilesEnrolled(store, vault);
11473
- const lines = [];
11474
- lines.push(`Vault "${vault}" \u2014 three-tier authentication`);
11475
- lines.push("");
11476
- lines.push("Tier 1 \u2014 Secret (master)");
11477
- lines.push(` Phrase format: ${policy.secret?.minWords ?? 6}+ words, lowercase letters, \u2265${policy.secret?.minWordLength ?? 3} chars/word`);
11478
- lines.push(" Strength validator: enforced (override available for tests only)");
11479
- lines.push("");
11480
- lines.push("Tier 2 \u2014 Authenticate (routine login)");
11481
- lines.push(" Allowed methods: WebAuthn (passkey), OIDC, Password");
11482
- lines.push(" Slots per user: unlimited");
11483
- lines.push("");
11484
- lines.push("Tier 3 \u2014 Unlock (quick resume)");
11485
- lines.push(" Method: PIN (per-app configurable)");
11486
- lines.push("");
11487
- lines.push(`Recovery profiles enrolled: ${recoveryProfiles.length === 0 ? "none" : recoveryProfiles.join(", ")}`);
11488
- lines.push("Managed-secret mode: off (post-1.0)");
11489
- lines.push("");
11490
- lines.push("Sensitive-action gates:");
11491
- for (const [gate, gp] of Object.entries(policy.gates)) {
11492
- lines.push(` ${gate} \u2014 ${describeGatePolicy(gp)}`);
11493
- }
11494
- return lines.join("\n");
11495
- }
11496
- async function diagramAuthConfig(store, vault) {
11497
- const policy = await loadVaultPolicy(store, vault) ?? defaultPolicySnapshot();
11498
- const lines = [];
11499
- lines.push("flowchart TB");
11500
- lines.push(` vault["Vault: ${escapeMermaid(vault)}"]`);
11501
- lines.push(' tier1["Tier 1<br/>Secret"]');
11502
- lines.push(' tier2["Tier 2<br/>Multi-slot Authenticate"]');
11503
- lines.push(' tier3["Tier 3<br/>PIN / Quick-resume"]');
11504
- lines.push(" vault --> tier1");
11505
- lines.push(" tier1 --> tier2");
11506
- lines.push(" tier2 --> tier3");
11507
- for (const [gateName, gp] of Object.entries(policy.gates)) {
11508
- if (gp.enabled === false) continue;
11509
- const id = sanitizeId(gateName);
11510
- const label = `${gateName}<br/>tier \u2265 ${gp.minTier}`;
11511
- lines.push(` ${id}["${escapeMermaid(label)}"]`);
11512
- const tierNode = gp.minTier === 1 ? "tier1" : gp.minTier === 2 ? "tier2" : "tier3";
11513
- lines.push(` ${tierNode} --> ${id}`);
11514
- }
11515
- return lines.join("\n");
11516
- }
11517
- async function describeUserAuth(store, vault, userId) {
11518
- const env = await store.get(vault, "_keyring", userId);
11519
- if (!env) return "";
11520
- const file = JSON.parse(env._data);
11521
- const lines = [];
11522
- lines.push(
11523
- `User: ${file.user_id} (joined ${file.created_at.slice(0, 10)}, role: ${file.role})`
11524
- );
11525
- lines.push("");
11526
- lines.push("Tier 2 enrollments:");
11527
- if (!file.authenticators || file.authenticators.length === 0) {
11528
- lines.push(" (none enrolled)");
11529
- } else {
11530
- for (const slot of file.authenticators) {
11531
- lines.push(` - ${describeSlot(slot)}`);
11532
- }
11533
- }
11534
- return lines.join("\n");
11535
- }
11536
- async function describeAllUsersAuth(store, vault) {
11537
- const ids = await store.list(vault, "_keyring");
11538
- const results = [];
11539
- for (const userId of ids) {
11540
- const description = await describeUserAuth(store, vault, userId);
11541
- if (description !== "") results.push({ userId, description });
11542
- }
11543
- return results;
11544
- }
11545
- var SLOT_FIELD_ALLOWLIST = [
11546
- "id",
11547
- "method",
11548
- "enrolled_at",
11549
- "enrolled_via_tier"
11550
- ];
11551
- function describeSlot(slot) {
11552
- const sanitized = {};
11553
- for (const key of SLOT_FIELD_ALLOWLIST) {
11554
- if (key in slot) {
11555
- sanitized[key] = slot[key];
11556
- }
11557
- }
11558
- const date = (sanitized.enrolled_at ?? "").slice(0, 10);
11559
- return `${sanitized.method ?? "?"} (id=${sanitized.id ?? "?"}, enrolled ${date}, via tier ${sanitized.enrolled_via_tier ?? "?"})`;
11560
- }
11561
- function describeGatePolicy(gp) {
11562
- if (gp.enabled === false) return "disabled";
11563
- const parts = [];
11564
- parts.push(`tier ${gp.minTier}`);
11565
- if (gp.factors && gp.factors.length > 0) {
11566
- for (const f of gp.factors) {
11567
- parts.push(`+ ${f.count ?? 1}\xD7 ${f.anyOf.join("|")}`);
11568
- }
11569
- }
11570
- if (gp.warn?.sharedDevice === "block") parts.push("block-on-shared-device");
11571
- return parts.join(" ");
11572
- }
11573
- function defaultPolicySnapshot() {
11574
- return {
11575
- secret: { minWords: 6, minWordLength: 3, rejectRepeatedAdjacent: true },
11576
- gates: {}
11577
- };
11578
- }
11579
- async function listRecoveryProfilesEnrolled(store, vault) {
11580
- const enrolled = [];
11581
- const paper = await loadPaperRecoveryEntries(store, vault);
11582
- if (paper.length > 0) enrolled.push(`paper (${paper.length} codes)`);
11583
- return enrolled;
11584
- }
11585
- function escapeMermaid(s) {
11586
- return s.replace(/"/g, '\\"').replace(/\n/g, " ");
11587
- }
11588
- function sanitizeId(s) {
11589
- return s.replace(/[^a-zA-Z0-9]/g, "_");
11590
- }
11591
-
11592
11524
  // src/with-party/team/noydb-facade.ts
11593
11525
  var TeamFacade = class {
11594
11526
  constructor(deps) {
@@ -11630,8 +11562,9 @@ var TeamFacade = class {
11630
11562
  async runRotate(engine, vault, collections) {
11631
11563
  this.deps.checkPolicyOperation(vault, "rotate");
11632
11564
  const keyring = await this.deps.getKeyringInternal(vault);
11633
- await engine(this.deps.options.store, vault, keyring, collections);
11565
+ const result = await engine(this.deps.options.store, vault, keyring, { collections });
11634
11566
  this.deps.keyringCache.set(vault, keyring);
11567
+ return result;
11635
11568
  }
11636
11569
  // ─── Tier-2 enroll / remove ─────────────────────────────────────
11637
11570
  /**
@@ -12496,7 +12429,7 @@ var Noydb = class {
12496
12429
  this.policyCheckGate = options.policyCheckGateFn;
12497
12430
  this.strategies = resolveStrategies(options);
12498
12431
  this.snapshots = new NoydbSnapshots({
12499
- strategy: this.strategies.snapshot,
12432
+ strategy: this.strategies.snapshots,
12500
12433
  user: options.user,
12501
12434
  isClosed: () => this.closed,
12502
12435
  getVault: (name) => this.vaultCache.get(name),
@@ -12544,7 +12477,7 @@ var Noydb = class {
12544
12477
  get _forgetStrategy() {
12545
12478
  return this.strategies.forget;
12546
12479
  }
12547
- // GDPR subject-index maintenance. When `withForgetCascade` declares
12480
+ // GDPR subject-index maintenance. When `withForget` declares
12548
12481
  // any subject fields, keep the encrypted `_subject_index` in lock-step with
12549
12482
  // writes so `vault.forget(subjectId)` can find every record for a subject.
12550
12483
  //
@@ -12619,7 +12552,7 @@ var Noydb = class {
12619
12552
  if (!facade) return;
12620
12553
  const ctx = { existing, vault: facade, userId: e.userId, role: e.role };
12621
12554
  await registry.runChecks(e.collection, incoming, ctx);
12622
- const { GuardExecutor } = await import("./executor-OHET7TF7.js");
12555
+ const { GuardExecutor } = await import("./executor-RM7XWQDU.js");
12623
12556
  for (const g of guards) {
12624
12557
  await GuardExecutor.checkFrozenFields(g, e.docId, existing, incoming, e.computedFieldNames);
12625
12558
  }
@@ -12810,12 +12743,10 @@ var Noydb = class {
12810
12743
  // compartments leave it null and load() skips the refresh.
12811
12744
  reloadKeyring: this.options.encrypt !== false && this.options.secret ? async () => {
12812
12745
  this.keyringCache.delete(name);
12813
- const refreshed = await loadKeyring(
12814
- this.options.store,
12815
- name,
12816
- this.options.user,
12817
- this.options.secret
12818
- );
12746
+ const refreshed = await loadKeyring(this.options.store, name, {
12747
+ userId: this.options.user,
12748
+ secret: this.options.secret
12749
+ });
12819
12750
  this.keyringCache.set(name, refreshed);
12820
12751
  return refreshed;
12821
12752
  } : void 0
@@ -12974,16 +12905,26 @@ var Noydb = class {
12974
12905
  /**
12975
12906
  * Rotate the DEKs for the given collections in a vault.
12976
12907
  *
12977
- * Generates fresh DEKs, re-encrypts every record in each collection,
12978
- * and re-wraps the new DEKs into every remaining user's keyring. The
12979
- * old DEKs become unreachable — useful as a defense-in-depth measure
12980
- * after a suspected key leak, or as the scheduled half of a
12981
- * key-rotation policy.
12908
+ * Generates fresh DEKs and re-encrypts every record in each collection.
12909
+ * The old DEKs become unreachable — useful as a defense-in-depth measure
12910
+ * after a suspected key leak, or as the scheduled half of a key-rotation
12911
+ * policy.
12912
+ *
12913
+ * ## Other members LOSE access to the rotated collections (#854)
12914
+ *
12915
+ * A member's DEKs are wrapped under that member's KEK, and a KEK derives
12916
+ * only from that member's secret. The caller cannot derive anyone else's
12917
+ * KEK, so re-wrapping a fresh DEK for them is impossible — that is the
12918
+ * zero-knowledge property working as designed. Rotation therefore DROPS
12919
+ * the rotated collections from every other member's keyring.
12982
12920
  *
12983
- * Unlike `revoke({ rotateKeys: true })`, this call does NOT remove
12984
- * any users — every current member keeps access, but with fresh
12985
- * keys. This is the "just rotate" path; the "revoke and rotate"
12986
- * path still lives in `revoke()`.
12921
+ * The returned {@link RotateResult.needsRegrant} names each (member,
12922
+ * collection) pair that was dropped. Re-run `grant()` for those pairs, or
12923
+ * they stay locked out.
12924
+ *
12925
+ * Unlike `revoke({ rotateKeys: true })`, this call does not REMOVE any
12926
+ * user from the vault — they keep membership and their other collections.
12927
+ * This is the "just rotate" path; "revoke and rotate" lives in `revoke()`.
12987
12928
  *
12988
12929
  * Exposed on Noydb (rather than only on the lower-level keyring
12989
12930
  * module) so CLI and admin tooling can trigger rotation without
@@ -13085,12 +13026,10 @@ var Noydb = class {
13085
13026
  for (const vault of universe) {
13086
13027
  let keyring;
13087
13028
  try {
13088
- keyring = await loadKeyring(
13089
- adapter,
13090
- vault,
13091
- this.options.user,
13092
- this.options.secret
13093
- );
13029
+ keyring = await loadKeyring(adapter, vault, {
13030
+ userId: this.options.user,
13031
+ secret: this.options.secret
13032
+ });
13094
13033
  } catch (err) {
13095
13034
  if (err instanceof NoAccessError || err instanceof InvalidKeyError || err instanceof KeyringCorruptError) {
13096
13035
  continue;
@@ -13151,7 +13090,7 @@ var Noydb = class {
13151
13090
  * })
13152
13091
  * ```
13153
13092
  */
13154
- async queryAcross(vaultIds, fn2, options = {}) {
13093
+ async queryAcross(vaultIds, fn, options = {}) {
13155
13094
  if (this.closed) throw new ValidationError("Instance is closed");
13156
13095
  this.resetSessionTimer();
13157
13096
  const concurrency = Math.max(1, options.concurrency ?? 1);
@@ -13165,7 +13104,7 @@ var Noydb = class {
13165
13104
  const task = (async () => {
13166
13105
  try {
13167
13106
  const comp = await this.openVault(vaultId, { create: options.create !== false });
13168
- const result = await fn2(comp);
13107
+ const result = await fn(comp);
13169
13108
  results[idx] = { vault: vaultId, result };
13170
13109
  } catch (err) {
13171
13110
  results[idx] = {
@@ -13225,13 +13164,10 @@ var Noydb = class {
13225
13164
  async changeSecret(vault, newSecret, options) {
13226
13165
  this.checkPolicyOperation(vault, "changeSecret");
13227
13166
  const keyring = await this._getKeyringInternal(vault);
13228
- const updated = await changeSecret(
13229
- this.options.store,
13230
- vault,
13231
- keyring,
13232
- newSecret,
13233
- options
13234
- );
13167
+ const updated = await changeSecret(this.options.store, vault, keyring, {
13168
+ ...options,
13169
+ newSecret
13170
+ });
13235
13171
  this.keyringCache.set(vault, updated);
13236
13172
  }
13237
13173
  // ─── Sync ──────────────────────────────────────────────────────
@@ -13281,7 +13217,7 @@ var Noydb = class {
13281
13217
  }
13282
13218
  transaction(arg, maybeFn) {
13283
13219
  if (typeof arg === "function") {
13284
- return this.strategies.tx.runTransaction(this, arg);
13220
+ return this.strategies.transactions.runTransaction(this, arg);
13285
13221
  }
13286
13222
  if (typeof arg === "object" && arg !== null && arg.dryRun === true) {
13287
13223
  if (typeof maybeFn !== "function") {
@@ -13289,7 +13225,7 @@ var Noydb = class {
13289
13225
  "db.transaction({ dryRun: true }, fn) requires the callback as the second argument."
13290
13226
  );
13291
13227
  }
13292
- return this.strategies.tx.runDryRun(this, maybeFn);
13228
+ return this.strategies.transactions.runDryRun(this, maybeFn);
13293
13229
  }
13294
13230
  if (typeof arg === "object" && arg !== null && arg.amendment === true) {
13295
13231
  if (typeof maybeFn !== "function") {
@@ -13297,7 +13233,7 @@ var Noydb = class {
13297
13233
  "db.transaction({ amendment: true }, fn) requires the callback as the second argument."
13298
13234
  );
13299
13235
  }
13300
- return this.strategies.tx.runTransaction(this, maybeFn, arg);
13236
+ return this.strategies.transactions.runTransaction(this, maybeFn, arg);
13301
13237
  }
13302
13238
  const vault = arg;
13303
13239
  const comp = this.vaultCache.get(vault);
@@ -13387,8 +13323,8 @@ var Noydb = class {
13387
13323
  }
13388
13324
  return engine;
13389
13325
  }
13390
- _forEachSyncEngine(vault, fn2) {
13391
- for (const [key, engine] of this.syncEngines) if (key === vault || key.startsWith(`${vault}::`)) fn2(engine);
13326
+ _forEachSyncEngine(vault, fn) {
13327
+ for (const [key, engine] of this.syncEngines) if (key === vault || key.startsWith(`${vault}::`)) fn(engine);
13392
13328
  }
13393
13329
  // ─── Events ────────────────────────────────────────────────────
13394
13330
  on(event, handler) {
@@ -13432,9 +13368,9 @@ var Noydb = class {
13432
13368
  return this.writeHooks.onAfterWrite(handler);
13433
13369
  }
13434
13370
  /** Subscribe to cross-tab write conflicts. Returns an unsubscribe. */
13435
- onWriteConflict(fn2) {
13436
- this.on("write:conflict", fn2);
13437
- return () => this.off("write:conflict", fn2);
13371
+ onWriteConflict(fn) {
13372
+ this.on("write:conflict", fn);
13373
+ return () => this.off("write:conflict", fn);
13438
13374
  }
13439
13375
  /**
13440
13376
  * Enable same-device multi-tab coordination: primary/secondary
@@ -13508,12 +13444,12 @@ var Noydb = class {
13508
13444
  activeTabs() {
13509
13445
  return this.tabCoordinator?.activeTabs() ?? [];
13510
13446
  }
13511
- onTabRoleChange(fn2) {
13512
- return this.tabCoordinator?.onTabRoleChange(fn2) ?? (() => {
13447
+ onTabRoleChange(fn) {
13448
+ return this.tabCoordinator?.onTabRoleChange(fn) ?? (() => {
13513
13449
  });
13514
13450
  }
13515
- onActiveTabsChange(fn2) {
13516
- return this.tabCoordinator?.onActiveTabsChange(fn2) ?? (() => {
13451
+ onActiveTabsChange(fn) {
13452
+ return this.tabCoordinator?.onActiveTabsChange(fn) ?? (() => {
13517
13453
  });
13518
13454
  }
13519
13455
  /** @internal The write-hook registry, threaded into each Collection. */
@@ -13799,7 +13735,7 @@ var Noydb = class {
13799
13735
  "setCover: the cover feature is not enabled. Pass `cover: true` (or a schema object) to `createNoydb`."
13800
13736
  );
13801
13737
  }
13802
- const { loadCover, saveCover, resolveSchema, validateCoverInput, mergeCustom, validateCoverSize } = await import("./cover-5BSNJREH.js");
13738
+ const { loadCover, saveCover, resolveSchema, validateCoverInput, mergeCustom, validateCoverSize } = await import("./cover/index.js");
13803
13739
  const schema = resolveSchema(coverOption);
13804
13740
  validateCoverInput(input, schema);
13805
13741
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -13831,7 +13767,7 @@ var Noydb = class {
13831
13767
  * regardless).
13832
13768
  */
13833
13769
  async getCover(vault, opts = {}) {
13834
- const { readCover } = await import("./cover-5BSNJREH.js");
13770
+ const { readCover } = await import("./cover/index.js");
13835
13771
  return readCover(this.options.store, vault, opts);
13836
13772
  }
13837
13773
  // ─── Auth introspection ─────────────────────────────────────────
@@ -13871,33 +13807,25 @@ var Noydb = class {
13871
13807
  }
13872
13808
  let keyring;
13873
13809
  try {
13874
- keyring = await loadKeyring(this.options.store, vault, this.options.user, effectiveSecret);
13810
+ keyring = await loadKeyring(this.options.store, vault, { userId: this.options.user, secret: effectiveSecret });
13875
13811
  } catch (err) {
13876
13812
  if (err instanceof NoAccessError) {
13877
- keyring = await createOwnerKeyring(
13878
- this.options.store,
13879
- vault,
13880
- this.options.user,
13881
- effectiveSecret,
13882
- {
13883
- // Managed mode generates 256-bit base64 strings that don't satisfy
13884
- // the human-secret strength rules (no spaces, no "words").
13885
- // Skip validation in managed mode — the entropy floor is already
13886
- // 256 bits by construction.
13887
- validate: this.options.secretMode === "managed" ? false : this.options.validateSecret === true
13888
- }
13889
- );
13813
+ keyring = await createOwnerKeyring(this.options.store, vault, {
13814
+ userId: this.options.user,
13815
+ secret: effectiveSecret,
13816
+ // Managed mode generates 256-bit base64 strings that don't satisfy
13817
+ // the human-secret strength rules (no spaces, no "words").
13818
+ // Skip validation in managed mode — the entropy floor is already
13819
+ // 256 bits by construction.
13820
+ validate: this.options.secretMode === "managed" ? false : this.options.validateSecret === true
13821
+ });
13890
13822
  } else if (err instanceof InvalidKeyError && this.options.onInvalidKey === "reset") {
13891
13823
  await this.options.store.delete(vault, "_keyring", this.options.user);
13892
- keyring = await createOwnerKeyring(
13893
- this.options.store,
13894
- vault,
13895
- this.options.user,
13896
- effectiveSecret,
13897
- {
13898
- validate: this.options.secretMode === "managed" ? false : this.options.validateSecret === true
13899
- }
13900
- );
13824
+ keyring = await createOwnerKeyring(this.options.store, vault, {
13825
+ userId: this.options.user,
13826
+ secret: effectiveSecret,
13827
+ validate: this.options.secretMode === "managed" ? false : this.options.validateSecret === true
13828
+ });
13901
13829
  } else {
13902
13830
  throw err;
13903
13831
  }
@@ -13907,7 +13835,7 @@ var Noydb = class {
13907
13835
  }
13908
13836
  /**
13909
13837
  * Take an on-demand checkpoint of the given vault.
13910
- * Requires `snapshotStrategy: withSnapshots({ store })` in `createNoydb`.
13838
+ * Requires `snapshotsStrategy: withSnapshots({ store })` in `createNoydb`.
13911
13839
  * @throws ValidationError when the vault is not open
13912
13840
  */
13913
13841
  async snapshot(vault, opts) {
@@ -13958,9 +13886,9 @@ async function createNoydb(options) {
13958
13886
  throw new ValidationError("A secret (secret) or getKeyring callback is required when encryption is enabled");
13959
13887
  }
13960
13888
  if (!options.coordinationStrategy) options = { ...options, coordinationStrategy: await createDefaultCoordinationProvider(options.store) };
13961
- if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-22ES33N3.js")).createUserApi };
13889
+ if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-3NKVNZPM.js")).createUserApi };
13962
13890
  if (!options.policyFactory) {
13963
- const policyModule = await import("./policy-IY2YEA3A.js");
13891
+ const policyModule = await import("./policy/index.js");
13964
13892
  options = { ...options, policyFactory: policyModule.createNoydbPolicy, policyCheckGateFn: policyModule.checkGate };
13965
13893
  }
13966
13894
  return new Noydb(options);
@@ -13990,11 +13918,7 @@ export {
13990
13918
  RefRegistry,
13991
13919
  Vault,
13992
13920
  QuickUnlockStore,
13993
- describeAuthConfig,
13994
- diagramAuthConfig,
13995
- describeUserAuth,
13996
- describeAllUsersAuth,
13997
13921
  Noydb,
13998
13922
  createNoydb
13999
13923
  };
14000
- //# sourceMappingURL=chunk-EEZCB74X.js.map
13924
+ //# sourceMappingURL=chunk-XOBHRD2M.js.map