@noy-db/hub 0.3.0-pre.3 → 0.3.0-pre.5

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 (388) hide show
  1. package/dist/adapter/index.d.ts +2 -2
  2. package/dist/adapter/index.js +1 -1
  3. package/dist/aggregate/index.d.ts +3 -3
  4. package/dist/aggregate/index.js +4 -4
  5. package/dist/api-JOXUNSKP.js +20 -0
  6. package/dist/as/index.d.ts +4 -4
  7. package/dist/as/index.js +12 -9
  8. package/dist/at/index.d.ts +2 -2
  9. package/dist/attestation/index.d.ts +3 -3
  10. package/dist/attestation/index.js +21 -18
  11. package/dist/attestation/index.js.map +1 -1
  12. package/dist/{backup-NGRJ46SH.js → backup-OPONO6Q5.js} +12 -9
  13. package/dist/{backup-NGRJ46SH.js.map → backup-OPONO6Q5.js.map} +1 -1
  14. package/dist/blobs/index.d.ts +4 -4
  15. package/dist/blobs/index.js +11 -8
  16. package/dist/blobs/index.js.map +1 -1
  17. package/dist/bundle/index.d.ts +5 -5
  18. package/dist/bundle/index.js +21 -18
  19. package/dist/bundle/index.js.map +1 -1
  20. package/dist/{bundle-B-P3_Jvb.d.ts → bundle-Bs13EZtX.d.ts} +1 -1
  21. package/dist/by/index.js +2 -2
  22. package/dist/cargo/index.d.ts +4 -4
  23. package/dist/cargo/index.js +23 -20
  24. package/dist/{chunk-VBYVKOMJ.js → chunk-3QRQOBS7.js} +3 -3
  25. package/dist/{chunk-JFYIHLU3.js → chunk-3Y4QLJ6K.js} +2 -2
  26. package/dist/{chunk-BZIWKN74.js → chunk-43ISXURO.js} +2 -2
  27. package/dist/{chunk-PYWW4KLO.js → chunk-44UTIDE2.js} +9 -9
  28. package/dist/{chunk-7IP75FP2.js → chunk-4K3MQ5S3.js} +2 -2
  29. package/dist/chunk-5EWYUR5P.js +37 -0
  30. package/dist/chunk-5EWYUR5P.js.map +1 -0
  31. package/dist/{chunk-2KSPDSWI.js → chunk-5MRE3C4Q.js} +5 -5
  32. package/dist/{chunk-PUNJAEY6.js → chunk-6HNKCKFZ.js} +7 -7
  33. package/dist/{chunk-PJDK2PPQ.js → chunk-6RXPSMKR.js} +3 -3
  34. package/dist/{chunk-6DP5HBQD.js → chunk-6UOSONVI.js} +9 -9
  35. package/dist/{chunk-YN66UOXT.js → chunk-7SY3PTED.js} +25 -9
  36. package/dist/{chunk-YN66UOXT.js.map → chunk-7SY3PTED.js.map} +1 -1
  37. package/dist/{chunk-UP6EMMDI.js → chunk-A4DWPOP3.js} +10 -10
  38. package/dist/{chunk-MCJAUQGE.js → chunk-A5DYVMDR.js} +3 -3
  39. package/dist/{chunk-MIOLJG2R.js → chunk-AF5ZRTZ4.js} +5 -2
  40. package/dist/chunk-AF5ZRTZ4.js.map +1 -0
  41. package/dist/{chunk-TICO2I2O.js → chunk-BKGIWGCX.js} +2 -2
  42. package/dist/{chunk-O5DNEXQC.js → chunk-BMQOH7MM.js} +2 -2
  43. package/dist/{chunk-3UDPDRUC.js → chunk-EWR7HL3K.js} +4 -4
  44. package/dist/{chunk-CVXLJIAV.js → chunk-FH52CDEW.js} +5 -5
  45. package/dist/chunk-G4MGYGSS.js +130 -0
  46. package/dist/chunk-G4MGYGSS.js.map +1 -0
  47. package/dist/{chunk-FELHYKIO.js → chunk-G7RDYYTE.js} +2 -2
  48. package/dist/{chunk-N2FP26NH.js → chunk-GBTUANXF.js} +16 -297
  49. package/dist/chunk-GBTUANXF.js.map +1 -0
  50. package/dist/{chunk-DHIN36UC.js → chunk-GQOT6QJR.js} +8 -8
  51. package/dist/{chunk-DGUR3CC4.js → chunk-GXGK22QU.js} +2 -2
  52. package/dist/{chunk-YTIAXSUE.js → chunk-GZZL5R73.js} +4 -4
  53. package/dist/{chunk-E4YJUNPU.js → chunk-H5XRIJX3.js} +7 -7
  54. package/dist/{chunk-DA34OEZU.js → chunk-H7RYPVMJ.js} +2 -2
  55. package/dist/{chunk-2ZORB5RW.js → chunk-HBKDR7R3.js} +3 -3
  56. package/dist/{chunk-ZNI3RTFV.js → chunk-HMXLN43G.js} +2 -2
  57. package/dist/{chunk-BYW7EU5L.js → chunk-HY6ZGGEC.js} +2 -2
  58. package/dist/{chunk-ADBMJDBW.js → chunk-IEUIUSBO.js} +449 -1077
  59. package/dist/chunk-IEUIUSBO.js.map +1 -0
  60. package/dist/{chunk-OVIVYAQL.js → chunk-LEA7WJEZ.js} +25 -10
  61. package/dist/chunk-LEA7WJEZ.js.map +1 -0
  62. package/dist/{chunk-5Z3RNFJC.js → chunk-LIP6JWYK.js} +3 -3
  63. package/dist/{chunk-OCDUQUAP.js → chunk-LN22XH4B.js} +1 -1
  64. package/dist/chunk-LN22XH4B.js.map +1 -0
  65. package/dist/chunk-LP7BEXCT.js +32 -0
  66. package/dist/chunk-LP7BEXCT.js.map +1 -0
  67. package/dist/{chunk-IJW6K6UX.js → chunk-LPRPVCNY.js} +5 -5
  68. package/dist/{chunk-6EVZXETK.js → chunk-M66NAZA4.js} +3 -3
  69. package/dist/{chunk-HGQG3VIP.js → chunk-N5YVZHCB.js} +2 -2
  70. package/dist/chunk-NO272T7Q.js +194 -0
  71. package/dist/chunk-NO272T7Q.js.map +1 -0
  72. package/dist/{chunk-NIA5VQ7G.js → chunk-NQVZB3S7.js} +29 -11
  73. package/dist/chunk-NQVZB3S7.js.map +1 -0
  74. package/dist/{chunk-6OQ7NKMZ.js → chunk-O2DB4C3M.js} +6 -6
  75. package/dist/{chunk-LHYQE3BP.js → chunk-OFBFAVLI.js} +6 -6
  76. package/dist/{chunk-IWVWB7BZ.js → chunk-OJU3CPFA.js} +12 -12
  77. package/dist/{chunk-ZFME46HJ.js → chunk-OPTFANOX.js} +3 -3
  78. package/dist/chunk-OPTFANOX.js.map +1 -0
  79. package/dist/{chunk-5EZAJEES.js → chunk-OVO2RZAE.js} +81 -27
  80. package/dist/chunk-OVO2RZAE.js.map +1 -0
  81. package/dist/{chunk-6I2YPLAG.js → chunk-P27Z66EB.js} +7 -7
  82. package/dist/{chunk-7MHVHGQZ.js → chunk-P2LDXRGP.js} +2 -2
  83. package/dist/chunk-P3NGV5RV.js +41 -0
  84. package/dist/chunk-P3NGV5RV.js.map +1 -0
  85. package/dist/{chunk-NPVICKZE.js → chunk-P5WXDYMD.js} +8 -197
  86. package/dist/chunk-P5WXDYMD.js.map +1 -0
  87. package/dist/{chunk-CPAROOKP.js → chunk-PGFY7IRW.js} +12 -41
  88. package/dist/chunk-PGFY7IRW.js.map +1 -0
  89. package/dist/{chunk-Z44OY24N.js → chunk-PI5CG2OV.js} +9 -5
  90. package/dist/chunk-PI5CG2OV.js.map +1 -0
  91. package/dist/{chunk-6RASM2J4.js → chunk-QKVILR7N.js} +2 -2
  92. package/dist/{chunk-LKBLAUOB.js → chunk-QNTEDPWP.js} +3 -3
  93. package/dist/{chunk-P6UXDALK.js → chunk-RDHAGBEB.js} +3 -3
  94. package/dist/{chunk-XRE4JOEO.js → chunk-RTS23VIJ.js} +2 -2
  95. package/dist/{chunk-5ZPWVNL3.js → chunk-S2WKOCTU.js} +2 -2
  96. package/dist/chunk-SAJJWVNQ.js +135 -0
  97. package/dist/chunk-SAJJWVNQ.js.map +1 -0
  98. package/dist/{chunk-VHEEU4ZO.js → chunk-SW56GSYC.js} +2 -2
  99. package/dist/{chunk-46YGCU6Z.js → chunk-T2EGAXPM.js} +2 -2
  100. package/dist/{chunk-LES2Z7B4.js → chunk-T45LAT2Y.js} +2 -2
  101. package/dist/{chunk-4NMFWOS2.js → chunk-T65UZXR6.js} +3 -3
  102. package/dist/{chunk-2N4MUSF3.js → chunk-TB5RNNJ4.js} +7 -7
  103. package/dist/chunk-TCIUO62Z.js +29 -0
  104. package/dist/chunk-TCIUO62Z.js.map +1 -0
  105. package/dist/chunk-THNJ3IKU.js +17 -0
  106. package/dist/chunk-THNJ3IKU.js.map +1 -0
  107. package/dist/{chunk-U6OM4E67.js → chunk-TL7QR5T6.js} +20 -15
  108. package/dist/chunk-TL7QR5T6.js.map +1 -0
  109. package/dist/{chunk-L4IRFTIF.js → chunk-TLJOJBZD.js} +3 -23
  110. package/dist/chunk-TLJOJBZD.js.map +1 -0
  111. package/dist/chunk-TQ3REHVF.js +95 -0
  112. package/dist/chunk-TQ3REHVF.js.map +1 -0
  113. package/dist/{chunk-6CNLU4TO.js → chunk-TYGW5TOR.js} +7 -7
  114. package/dist/{chunk-BLZRNHMG.js → chunk-U23JUUPX.js} +8 -1
  115. package/dist/{chunk-BLZRNHMG.js.map → chunk-U23JUUPX.js.map} +1 -1
  116. package/dist/{chunk-U5DWHU3S.js → chunk-U24XHXNK.js} +2 -2
  117. package/dist/chunk-ULIHDPKL.js +94 -0
  118. package/dist/chunk-ULIHDPKL.js.map +1 -0
  119. package/dist/chunk-UOEWDCUX.js +69 -0
  120. package/dist/chunk-UOEWDCUX.js.map +1 -0
  121. package/dist/{chunk-NTHKOFVL.js → chunk-VFRNWE5P.js} +52 -8
  122. package/dist/chunk-VFRNWE5P.js.map +1 -0
  123. package/dist/{chunk-4DZGZ7II.js → chunk-VMJ5URU7.js} +8 -8
  124. package/dist/chunk-VMJ5URU7.js.map +1 -0
  125. package/dist/{chunk-YDP2SA5K.js → chunk-VPCMJ5Z4.js} +5 -5
  126. package/dist/{chunk-ZAWD6O46.js → chunk-VRPBEOWU.js} +2 -2
  127. package/dist/{chunk-AY4P6PHN.js → chunk-VWGCJUTV.js} +2 -2
  128. package/dist/{chunk-IIK7W3AN.js → chunk-XJR3COJO.js} +5 -5
  129. package/dist/{chunk-ZD4D7UM6.js → chunk-XYYW64LB.js} +2 -2
  130. package/dist/{chunk-4NZCZUGL.js → chunk-YFF2RP3X.js} +2 -2
  131. package/dist/{chunk-WVIIJPTJ.js → chunk-Z3FZC5GV.js} +7 -7
  132. package/dist/{chunk-55HDKLI3.js → chunk-Z5PIUYNB.js} +8 -8
  133. package/dist/{chunk-ZRDYQZYH.js → chunk-Z7KI4WHR.js} +2 -2
  134. package/dist/{chunk-BV7KNFJY.js → chunk-ZBDK7T6X.js} +9 -9
  135. package/dist/chunk-ZKF6HH7V.js +120 -0
  136. package/dist/chunk-ZKF6HH7V.js.map +1 -0
  137. package/dist/{chunk-P6DN5QU7.js → chunk-ZKYMKF2S.js} +8 -8
  138. package/dist/{chunk-NMRKAGHE.js → chunk-ZROMNP7Q.js} +2 -2
  139. package/dist/{chunk-5A6TC3RQ.js → chunk-ZT4GWVTX.js} +29 -14
  140. package/dist/chunk-ZT4GWVTX.js.map +1 -0
  141. package/dist/classified/index.d.ts +4 -4
  142. package/dist/classified/index.js +3 -3
  143. package/dist/collection-facade-THH4ASGX.js +39 -0
  144. package/dist/computed-BMMEFRFJ.js +11 -0
  145. package/dist/config-drift-3UIJVI5G.js +24 -0
  146. package/dist/config-drift-3UIJVI5G.js.map +1 -0
  147. package/dist/consent/index.d.ts +3 -3
  148. package/dist/consent/index.js +10 -7
  149. package/dist/consent/index.js.map +1 -1
  150. package/dist/crdt/index.d.ts +3 -3
  151. package/dist/delegation-BQNIEHZE.js +25 -0
  152. package/dist/derivations/index.d.ts +4 -4
  153. package/dist/derivations/index.js +12 -9
  154. package/dist/describe/index.d.ts +1 -1
  155. package/dist/{describe-0tiXAjoO.d.ts → describe-C6iHNlqJ.d.ts} +9 -0
  156. package/dist/{dev-unlock-B_s9DUWa.d.ts → dev-unlock-Cqd5Xv5J.d.ts} +1 -1
  157. package/dist/{enclave-IS7HZSQ7.js → enclave-YN6223OG.js} +21 -8
  158. package/dist/executor-CBTNU5VZ.js +9 -0
  159. package/dist/executor-DJHNSTIR.js +9 -0
  160. package/dist/executor-FGISLQIN.js +21 -0
  161. package/dist/export-accessible-P7SLRLK3.js +23 -0
  162. package/dist/extract-partition-6JGY3KYR.js +36 -0
  163. package/dist/{fanout-sidecar-DDKRG2MX.js → fanout-sidecar-WS22Q5WH.js} +12 -9
  164. package/dist/{fanout-sidecar-DDKRG2MX.js.map → fanout-sidecar-WS22Q5WH.js.map} +1 -1
  165. package/dist/fence-watcher-DHQ775JB.js +69 -0
  166. package/dist/fence-watcher-DHQ775JB.js.map +1 -0
  167. package/dist/find-RNBG7LBY.js +11 -0
  168. package/dist/forget/index.js +10 -7
  169. package/dist/forget/index.js.map +1 -1
  170. package/dist/guards/index.d.ts +4 -4
  171. package/dist/guards/index.js +3 -3
  172. package/dist/{hash-CWxn7sf6.d.ts → hash-D8Q5MJLA.d.ts} +1 -1
  173. package/dist/history/index.d.ts +4 -4
  174. package/dist/history/index.js +12 -9
  175. package/dist/history/index.js.map +1 -1
  176. package/dist/i18n/index.d.ts +3 -3
  177. package/dist/i18n/index.js +14 -11
  178. package/dist/i18n/index.js.map +1 -1
  179. package/dist/in/index.d.ts +2 -2
  180. package/dist/{index-D05bV0_g.d.ts → index-D4GQe1Rx.d.ts} +818 -49
  181. package/dist/{index-DTMUUwwW.d.ts → index-DRxk8q_7.d.ts} +3 -3
  182. package/dist/index.d.ts +54 -18
  183. package/dist/index.js +1022 -123
  184. package/dist/index.js.map +1 -1
  185. package/dist/indexing/index.d.ts +3 -3
  186. package/dist/indexing/index.js +4 -4
  187. package/dist/issue-W5QG53B5.js +19 -0
  188. package/dist/json-schema-I22JCYCG.js +44 -0
  189. package/dist/json-schema-I22JCYCG.js.map +1 -0
  190. package/dist/kernel/index.d.ts +3 -3
  191. package/dist/kernel/index.js +13 -10
  192. package/dist/lazy/index.d.ts +21 -0
  193. package/dist/lazy/index.js +12 -0
  194. package/dist/{ledger-YUAJUNFP.js → ledger-KZWBKAG5.js} +12 -9
  195. package/dist/liberate-AQ7OWBZZ.js +24 -0
  196. package/dist/link-set-UQEIYQAM.js +31 -0
  197. package/dist/materialized-views/index.d.ts +4 -4
  198. package/dist/materialized-views/index.js +16 -13
  199. package/dist/{mime-magic-Qr_4HjP6.d.ts → mime-magic-DmwT7OzZ.d.ts} +1 -1
  200. package/dist/noydb-WQZNAECY.js +60 -0
  201. package/dist/on/index.d.ts +2 -2
  202. package/dist/on/index.js +10 -7
  203. package/dist/overlay-views/index.d.ts +4 -4
  204. package/dist/overlay-views/index.js +4 -4
  205. package/dist/periods/index.d.ts +3 -3
  206. package/dist/periods/index.js +13 -10
  207. package/dist/pod/index.d.ts +3 -3
  208. package/dist/pod/index.js +12 -9
  209. package/dist/{policy-LRE6HTO5.js → policy-YIKUH4AD.js} +5 -5
  210. package/dist/portability/index.d.ts +3 -3
  211. package/dist/portability/index.js +8 -8
  212. package/dist/{public-envelope-WVRRUVAJ.js → public-envelope-MRN5YYZZ.js} +4 -4
  213. package/dist/query/index.d.ts +2 -2
  214. package/dist/query/index.js +6 -6
  215. package/dist/register-V5AQTXNI.js +21 -0
  216. package/dist/registry-IMNMHWTM.js +17 -0
  217. package/dist/registry-K6VUQXKV.js +19 -0
  218. package/dist/registry-ZVO3T4M5.js +9 -0
  219. package/dist/request-withdrawal-EHALV66Y.js +31 -0
  220. package/dist/request-withdrawal-EHALV66Y.js.map +1 -0
  221. package/dist/{reveal-WSUHXCSS.js → reveal-TBLTFWQ2.js} +6 -5
  222. package/dist/{reveal-WSUHXCSS.js.map → reveal-TBLTFWQ2.js.map} +1 -1
  223. package/dist/revoke-MHAUAESM.js +24 -0
  224. package/dist/revoke-MHAUAESM.js.map +1 -0
  225. package/dist/sealed-record/index.d.ts +3 -3
  226. package/dist/sealed-record/index.js +13 -10
  227. package/dist/sealed-record/index.js.map +1 -1
  228. package/dist/session/index.d.ts +4 -4
  229. package/dist/session/index.js +10 -7
  230. package/dist/session/index.js.map +1 -1
  231. package/dist/shadow/index.d.ts +3 -3
  232. package/dist/shadow/index.js +2 -2
  233. package/dist/signer-PQ74YXRY.js +25 -0
  234. package/dist/signer-PQ74YXRY.js.map +1 -0
  235. package/dist/snapshots/index.d.ts +3 -3
  236. package/dist/snapshots/index.js +11 -8
  237. package/dist/snapshots/index.js.map +1 -1
  238. package/dist/{stale-LX4BR43V.js → stale-7Q62KVI3.js} +2 -2
  239. package/dist/stale-7Q62KVI3.js.map +1 -0
  240. package/dist/storage-3FKGLQMC.js +23 -0
  241. package/dist/storage-3FKGLQMC.js.map +1 -0
  242. package/dist/{store-coordination-provider-KTRIC6PR.js → store-coordination-provider-JJCEMTAE.js} +3 -3
  243. package/dist/sync/index.d.ts +2 -2
  244. package/dist/sync/index.js +10 -7
  245. package/dist/sync/index.js.map +1 -1
  246. package/dist/team/index.d.ts +45 -6
  247. package/dist/team/index.js +25 -15
  248. package/dist/tiers/index.d.ts +2 -2
  249. package/dist/tiers/index.js +11 -8
  250. package/dist/to/index.d.ts +2 -2
  251. package/dist/to/index.js +1 -1
  252. package/dist/{transition-guard-C1Pyz8nH.d.ts → transition-guard-C4hvR-Ac.d.ts} +1 -1
  253. package/dist/tx/index.d.ts +3 -3
  254. package/dist/tx/index.js +3 -3
  255. package/dist/ui/index.d.ts +1 -1
  256. package/dist/util/index.js +1 -1
  257. package/dist/validators-Ctgkj5qd.d.ts +101 -0
  258. package/dist/{vault-diff-Fn0WeY2w.d.ts → vault-diff-B1Ir6EGs.d.ts} +1 -1
  259. package/dist/{verify-SW6J63Q2.js → verify-YB5LQHNA.js} +11 -7
  260. package/dist/{verify-SW6J63Q2.js.map → verify-YB5LQHNA.js.map} +1 -1
  261. package/dist/walk-T65TZDN2.js +241 -0
  262. package/dist/walk-T65TZDN2.js.map +1 -0
  263. package/dist/with/index.d.ts +3 -3
  264. package/dist/with/index.js +12 -9
  265. package/dist/{with-materialized-view-NKxs6iK5.d.ts → with-materialized-view-Bp65kKdQ.d.ts} +1 -1
  266. package/dist/{with-overlayed-view-B4fPYHwV.d.ts → with-overlayed-view-BRhdQNrK.d.ts} +1 -1
  267. package/dist/{with-rollup-Bl0sRFEt.d.ts → with-rollup-bQRPc3y1.d.ts} +1 -1
  268. package/dist/withdraw-accessible-JMX2TCPX.js +28 -0
  269. package/dist/withdraw-accessible-JMX2TCPX.js.map +1 -0
  270. package/package.json +7 -3
  271. package/dist/api-LORZ2EZU.js +0 -17
  272. package/dist/chunk-4DZGZ7II.js.map +0 -1
  273. package/dist/chunk-5A6TC3RQ.js.map +0 -1
  274. package/dist/chunk-5EZAJEES.js.map +0 -1
  275. package/dist/chunk-ADBMJDBW.js.map +0 -1
  276. package/dist/chunk-CPAROOKP.js.map +0 -1
  277. package/dist/chunk-L4IRFTIF.js.map +0 -1
  278. package/dist/chunk-MIOLJG2R.js.map +0 -1
  279. package/dist/chunk-N2FP26NH.js.map +0 -1
  280. package/dist/chunk-NIA5VQ7G.js.map +0 -1
  281. package/dist/chunk-NPVICKZE.js.map +0 -1
  282. package/dist/chunk-NTHKOFVL.js.map +0 -1
  283. package/dist/chunk-OCDUQUAP.js.map +0 -1
  284. package/dist/chunk-OVIVYAQL.js.map +0 -1
  285. package/dist/chunk-QLQS5A7X.js +0 -524
  286. package/dist/chunk-QLQS5A7X.js.map +0 -1
  287. package/dist/chunk-U6OM4E67.js.map +0 -1
  288. package/dist/chunk-Z44OY24N.js.map +0 -1
  289. package/dist/chunk-ZFME46HJ.js.map +0 -1
  290. package/dist/collection-facade-XPVRHBGU.js +0 -36
  291. package/dist/delegation-4HUHUE6T.js +0 -22
  292. package/dist/executor-ANFBCOYA.js +0 -9
  293. package/dist/executor-IKT47SH2.js +0 -9
  294. package/dist/executor-OIECZXTV.js +0 -18
  295. package/dist/export-accessible-NZWCFZHL.js +0 -20
  296. package/dist/extract-partition-52LX6RQH.js +0 -33
  297. package/dist/issue-F4SYPJGJ.js +0 -16
  298. package/dist/liberate-6LDETRIW.js +0 -21
  299. package/dist/noydb-WQNBVJIG.js +0 -54
  300. package/dist/registry-6HZ2JSQ7.js +0 -14
  301. package/dist/registry-GPXZQ7DT.js +0 -9
  302. package/dist/registry-USYD2ECC.js +0 -16
  303. package/dist/request-withdrawal-54V4L6CR.js +0 -28
  304. package/dist/revoke-JV26NTQD.js +0 -21
  305. package/dist/signer-AE56T5HE.js +0 -22
  306. package/dist/validators-Dzn7T-3x.d.ts +0 -62
  307. package/dist/withdraw-accessible-DGA4V2TP.js +0 -25
  308. /package/dist/{api-LORZ2EZU.js.map → api-JOXUNSKP.js.map} +0 -0
  309. /package/dist/{chunk-VBYVKOMJ.js.map → chunk-3QRQOBS7.js.map} +0 -0
  310. /package/dist/{chunk-JFYIHLU3.js.map → chunk-3Y4QLJ6K.js.map} +0 -0
  311. /package/dist/{chunk-BZIWKN74.js.map → chunk-43ISXURO.js.map} +0 -0
  312. /package/dist/{chunk-PYWW4KLO.js.map → chunk-44UTIDE2.js.map} +0 -0
  313. /package/dist/{chunk-7IP75FP2.js.map → chunk-4K3MQ5S3.js.map} +0 -0
  314. /package/dist/{chunk-2KSPDSWI.js.map → chunk-5MRE3C4Q.js.map} +0 -0
  315. /package/dist/{chunk-PUNJAEY6.js.map → chunk-6HNKCKFZ.js.map} +0 -0
  316. /package/dist/{chunk-PJDK2PPQ.js.map → chunk-6RXPSMKR.js.map} +0 -0
  317. /package/dist/{chunk-6DP5HBQD.js.map → chunk-6UOSONVI.js.map} +0 -0
  318. /package/dist/{chunk-UP6EMMDI.js.map → chunk-A4DWPOP3.js.map} +0 -0
  319. /package/dist/{chunk-MCJAUQGE.js.map → chunk-A5DYVMDR.js.map} +0 -0
  320. /package/dist/{chunk-TICO2I2O.js.map → chunk-BKGIWGCX.js.map} +0 -0
  321. /package/dist/{chunk-O5DNEXQC.js.map → chunk-BMQOH7MM.js.map} +0 -0
  322. /package/dist/{chunk-3UDPDRUC.js.map → chunk-EWR7HL3K.js.map} +0 -0
  323. /package/dist/{chunk-CVXLJIAV.js.map → chunk-FH52CDEW.js.map} +0 -0
  324. /package/dist/{chunk-FELHYKIO.js.map → chunk-G7RDYYTE.js.map} +0 -0
  325. /package/dist/{chunk-DHIN36UC.js.map → chunk-GQOT6QJR.js.map} +0 -0
  326. /package/dist/{chunk-DGUR3CC4.js.map → chunk-GXGK22QU.js.map} +0 -0
  327. /package/dist/{chunk-YTIAXSUE.js.map → chunk-GZZL5R73.js.map} +0 -0
  328. /package/dist/{chunk-E4YJUNPU.js.map → chunk-H5XRIJX3.js.map} +0 -0
  329. /package/dist/{chunk-DA34OEZU.js.map → chunk-H7RYPVMJ.js.map} +0 -0
  330. /package/dist/{chunk-2ZORB5RW.js.map → chunk-HBKDR7R3.js.map} +0 -0
  331. /package/dist/{chunk-ZNI3RTFV.js.map → chunk-HMXLN43G.js.map} +0 -0
  332. /package/dist/{chunk-BYW7EU5L.js.map → chunk-HY6ZGGEC.js.map} +0 -0
  333. /package/dist/{chunk-5Z3RNFJC.js.map → chunk-LIP6JWYK.js.map} +0 -0
  334. /package/dist/{chunk-IJW6K6UX.js.map → chunk-LPRPVCNY.js.map} +0 -0
  335. /package/dist/{chunk-6EVZXETK.js.map → chunk-M66NAZA4.js.map} +0 -0
  336. /package/dist/{chunk-HGQG3VIP.js.map → chunk-N5YVZHCB.js.map} +0 -0
  337. /package/dist/{chunk-6OQ7NKMZ.js.map → chunk-O2DB4C3M.js.map} +0 -0
  338. /package/dist/{chunk-LHYQE3BP.js.map → chunk-OFBFAVLI.js.map} +0 -0
  339. /package/dist/{chunk-IWVWB7BZ.js.map → chunk-OJU3CPFA.js.map} +0 -0
  340. /package/dist/{chunk-6I2YPLAG.js.map → chunk-P27Z66EB.js.map} +0 -0
  341. /package/dist/{chunk-7MHVHGQZ.js.map → chunk-P2LDXRGP.js.map} +0 -0
  342. /package/dist/{chunk-6RASM2J4.js.map → chunk-QKVILR7N.js.map} +0 -0
  343. /package/dist/{chunk-LKBLAUOB.js.map → chunk-QNTEDPWP.js.map} +0 -0
  344. /package/dist/{chunk-P6UXDALK.js.map → chunk-RDHAGBEB.js.map} +0 -0
  345. /package/dist/{chunk-XRE4JOEO.js.map → chunk-RTS23VIJ.js.map} +0 -0
  346. /package/dist/{chunk-5ZPWVNL3.js.map → chunk-S2WKOCTU.js.map} +0 -0
  347. /package/dist/{chunk-VHEEU4ZO.js.map → chunk-SW56GSYC.js.map} +0 -0
  348. /package/dist/{chunk-46YGCU6Z.js.map → chunk-T2EGAXPM.js.map} +0 -0
  349. /package/dist/{chunk-LES2Z7B4.js.map → chunk-T45LAT2Y.js.map} +0 -0
  350. /package/dist/{chunk-4NMFWOS2.js.map → chunk-T65UZXR6.js.map} +0 -0
  351. /package/dist/{chunk-2N4MUSF3.js.map → chunk-TB5RNNJ4.js.map} +0 -0
  352. /package/dist/{chunk-6CNLU4TO.js.map → chunk-TYGW5TOR.js.map} +0 -0
  353. /package/dist/{chunk-U5DWHU3S.js.map → chunk-U24XHXNK.js.map} +0 -0
  354. /package/dist/{chunk-YDP2SA5K.js.map → chunk-VPCMJ5Z4.js.map} +0 -0
  355. /package/dist/{chunk-ZAWD6O46.js.map → chunk-VRPBEOWU.js.map} +0 -0
  356. /package/dist/{chunk-AY4P6PHN.js.map → chunk-VWGCJUTV.js.map} +0 -0
  357. /package/dist/{chunk-IIK7W3AN.js.map → chunk-XJR3COJO.js.map} +0 -0
  358. /package/dist/{chunk-ZD4D7UM6.js.map → chunk-XYYW64LB.js.map} +0 -0
  359. /package/dist/{chunk-4NZCZUGL.js.map → chunk-YFF2RP3X.js.map} +0 -0
  360. /package/dist/{chunk-WVIIJPTJ.js.map → chunk-Z3FZC5GV.js.map} +0 -0
  361. /package/dist/{chunk-55HDKLI3.js.map → chunk-Z5PIUYNB.js.map} +0 -0
  362. /package/dist/{chunk-ZRDYQZYH.js.map → chunk-Z7KI4WHR.js.map} +0 -0
  363. /package/dist/{chunk-BV7KNFJY.js.map → chunk-ZBDK7T6X.js.map} +0 -0
  364. /package/dist/{chunk-P6DN5QU7.js.map → chunk-ZKYMKF2S.js.map} +0 -0
  365. /package/dist/{chunk-NMRKAGHE.js.map → chunk-ZROMNP7Q.js.map} +0 -0
  366. /package/dist/{collection-facade-XPVRHBGU.js.map → collection-facade-THH4ASGX.js.map} +0 -0
  367. /package/dist/{delegation-4HUHUE6T.js.map → computed-BMMEFRFJ.js.map} +0 -0
  368. /package/dist/{enclave-IS7HZSQ7.js.map → delegation-BQNIEHZE.js.map} +0 -0
  369. /package/dist/{executor-ANFBCOYA.js.map → enclave-YN6223OG.js.map} +0 -0
  370. /package/dist/{executor-IKT47SH2.js.map → executor-CBTNU5VZ.js.map} +0 -0
  371. /package/dist/{executor-OIECZXTV.js.map → executor-DJHNSTIR.js.map} +0 -0
  372. /package/dist/{export-accessible-NZWCFZHL.js.map → executor-FGISLQIN.js.map} +0 -0
  373. /package/dist/{extract-partition-52LX6RQH.js.map → export-accessible-P7SLRLK3.js.map} +0 -0
  374. /package/dist/{issue-F4SYPJGJ.js.map → extract-partition-6JGY3KYR.js.map} +0 -0
  375. /package/dist/{ledger-YUAJUNFP.js.map → find-RNBG7LBY.js.map} +0 -0
  376. /package/dist/{liberate-6LDETRIW.js.map → issue-W5QG53B5.js.map} +0 -0
  377. /package/dist/{noydb-WQNBVJIG.js.map → lazy/index.js.map} +0 -0
  378. /package/dist/{policy-LRE6HTO5.js.map → ledger-KZWBKAG5.js.map} +0 -0
  379. /package/dist/{public-envelope-WVRRUVAJ.js.map → liberate-AQ7OWBZZ.js.map} +0 -0
  380. /package/dist/{registry-6HZ2JSQ7.js.map → link-set-UQEIYQAM.js.map} +0 -0
  381. /package/dist/{registry-GPXZQ7DT.js.map → noydb-WQZNAECY.js.map} +0 -0
  382. /package/dist/{registry-USYD2ECC.js.map → policy-YIKUH4AD.js.map} +0 -0
  383. /package/dist/{request-withdrawal-54V4L6CR.js.map → public-envelope-MRN5YYZZ.js.map} +0 -0
  384. /package/dist/{revoke-JV26NTQD.js.map → register-V5AQTXNI.js.map} +0 -0
  385. /package/dist/{signer-AE56T5HE.js.map → registry-IMNMHWTM.js.map} +0 -0
  386. /package/dist/{stale-LX4BR43V.js.map → registry-K6VUQXKV.js.map} +0 -0
  387. /package/dist/{withdraw-accessible-DGA4V2TP.js.map → registry-ZVO3T4M5.js.map} +0 -0
  388. /package/dist/{store-coordination-provider-KTRIC6PR.js.map → store-coordination-provider-JJCEMTAE.js.map} +0 -0
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  withCargo
3
- } from "../chunk-5ZPWVNL3.js";
3
+ } from "../chunk-S2WKOCTU.js";
4
4
  import {
5
5
  CustodyApi,
6
6
  NO_CARGO
7
- } from "../chunk-Z44OY24N.js";
7
+ } from "../chunk-PI5CG2OV.js";
8
8
  import {
9
9
  createDeedOwner,
10
10
  isDeedVault,
11
11
  liberateVault,
12
12
  loadDeedMarker
13
- } from "../chunk-BV7KNFJY.js";
13
+ } from "../chunk-ZBDK7T6X.js";
14
14
  import {
15
15
  diffVault
16
16
  } from "../chunk-LB7FD65R.js";
17
- import "../chunk-6CNLU4TO.js";
18
- import "../chunk-7MHVHGQZ.js";
17
+ import "../chunk-TYGW5TOR.js";
18
+ import "../chunk-P2LDXRGP.js";
19
19
  import "../chunk-BGIZAFY7.js";
20
20
  import {
21
21
  fuseRetrieval
@@ -23,31 +23,34 @@ import {
23
23
  import {
24
24
  isQuorum,
25
25
  runDrainBarrier
26
- } from "../chunk-JFYIHLU3.js";
27
- import "../chunk-AY4P6PHN.js";
28
- import "../chunk-3UDPDRUC.js";
29
- import "../chunk-VBYVKOMJ.js";
30
- import "../chunk-5A6TC3RQ.js";
31
- import "../chunk-2N4MUSF3.js";
26
+ } from "../chunk-3Y4QLJ6K.js";
27
+ import "../chunk-VWGCJUTV.js";
28
+ import "../chunk-EWR7HL3K.js";
29
+ import "../chunk-3QRQOBS7.js";
30
+ import "../chunk-ZT4GWVTX.js";
31
+ import "../chunk-TB5RNNJ4.js";
32
32
  import {
33
33
  generateULID
34
34
  } from "../chunk-ZJADGNYF.js";
35
35
  import "../chunk-SVLR4POP.js";
36
- import "../chunk-5EZAJEES.js";
37
- import "../chunk-6RASM2J4.js";
38
- import "../chunk-CPAROOKP.js";
36
+ import "../chunk-OVO2RZAE.js";
37
+ import "../chunk-QKVILR7N.js";
38
+ import "../chunk-LN22XH4B.js";
39
+ import "../chunk-PGFY7IRW.js";
40
+ import "../chunk-TCIUO62Z.js";
41
+ import "../chunk-UOEWDCUX.js";
42
+ import "../chunk-LP7BEXCT.js";
39
43
  import {
40
44
  sha256Hex
41
- } from "../chunk-L4IRFTIF.js";
42
- import "../chunk-OCDUQUAP.js";
45
+ } from "../chunk-TLJOJBZD.js";
43
46
  import {
44
47
  groupAndReduce,
45
48
  reduceRecords
46
- } from "../chunk-NPVICKZE.js";
49
+ } from "../chunk-P5WXDYMD.js";
47
50
  import {
48
51
  readPath
49
- } from "../chunk-QLQS5A7X.js";
50
- import "../chunk-7IP75FP2.js";
52
+ } from "../chunk-ZKF6HH7V.js";
53
+ import "../chunk-4K3MQ5S3.js";
51
54
  import {
52
55
  CargoNotEnabledError,
53
56
  CrossShardJoinError,
@@ -59,7 +62,7 @@ import {
59
62
  UnknownShardError,
60
63
  ValidationError,
61
64
  VaultTemplateNotFoundError
62
- } from "../chunk-BLZRNHMG.js";
65
+ } from "../chunk-U23JUUPX.js";
63
66
  import "../chunk-PZ5AY32C.js";
64
67
  export {
65
68
  CargoNotEnabledError,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  NOYDB_FORMAT_VERSION
3
- } from "./chunk-OCDUQUAP.js";
3
+ } from "./chunk-LN22XH4B.js";
4
4
  import {
5
5
  ValidationError
6
- } from "./chunk-BLZRNHMG.js";
6
+ } from "./chunk-U23JUUPX.js";
7
7
 
8
8
  // src/with-party/directory/public-envelope/schema.ts
9
9
  var DATA_URL_PREFIX = /^data:([a-zA-Z0-9.+-]+\/[a-zA-Z0-9.+-]+);base64,/;
@@ -152,4 +152,4 @@ export {
152
152
  resolveLocale,
153
153
  pickLocale
154
154
  };
155
- //# sourceMappingURL=chunk-VBYVKOMJ.js.map
155
+ //# sourceMappingURL=chunk-3QRQOBS7.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  QuiesceTimeoutError
3
- } from "./chunk-BLZRNHMG.js";
3
+ } from "./chunk-U23JUUPX.js";
4
4
 
5
5
  // src/port/by/types.ts
6
6
  function isQuorum(writers, generation, excludeWriterId) {
@@ -51,4 +51,4 @@ export {
51
51
  isQuorum,
52
52
  runDrainBarrier
53
53
  };
54
- //# sourceMappingURL=chunk-JFYIHLU3.js.map
54
+ //# sourceMappingURL=chunk-3Y4QLJ6K.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ReadOnlyFrameError
3
- } from "./chunk-BLZRNHMG.js";
3
+ } from "./chunk-U23JUUPX.js";
4
4
 
5
5
  // src/with-fork/shadow/vault-frame.ts
6
6
  var VaultFrame = class {
@@ -71,4 +71,4 @@ export {
71
71
  VaultFrame,
72
72
  CollectionFrame
73
73
  };
74
- //# sourceMappingURL=chunk-BZIWKN74.js.map
74
+ //# sourceMappingURL=chunk-43ISXURO.js.map
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  ensureCollectionDEK
3
- } from "./chunk-5A6TC3RQ.js";
3
+ } from "./chunk-ZT4GWVTX.js";
4
4
  import {
5
5
  envelopePayloadHash
6
- } from "./chunk-6EVZXETK.js";
6
+ } from "./chunk-M66NAZA4.js";
7
7
  import {
8
8
  openEnvelopeJson
9
- } from "./chunk-5EZAJEES.js";
10
- import {
11
- encrypt
12
- } from "./chunk-L4IRFTIF.js";
9
+ } from "./chunk-OVO2RZAE.js";
13
10
  import {
14
11
  NOYDB_FORMAT_VERSION
15
- } from "./chunk-OCDUQUAP.js";
12
+ } from "./chunk-LN22XH4B.js";
13
+ import {
14
+ encrypt
15
+ } from "./chunk-TLJOJBZD.js";
16
16
  import {
17
17
  DictKeyMissingError,
18
18
  PermissionDeniedError
19
- } from "./chunk-BLZRNHMG.js";
19
+ } from "./chunk-U23JUUPX.js";
20
20
 
21
21
  // src/with-shape/i18n/dictionary.ts
22
22
  var DICT_COLLECTION_PREFIX = "_dict_";
@@ -413,4 +413,4 @@ export {
413
413
  isStaticDictDescriptor,
414
414
  DictionaryHandle
415
415
  };
416
- //# sourceMappingURL=chunk-PYWW4KLO.js.map
416
+ //# sourceMappingURL=chunk-44UTIDE2.js.map
@@ -2,7 +2,7 @@ import {
2
2
  LocaleNotSpecifiedError,
3
3
  MissingTranslationError,
4
4
  ScriptViolationError
5
- } from "./chunk-BLZRNHMG.js";
5
+ } from "./chunk-U23JUUPX.js";
6
6
 
7
7
  // src/with-shape/i18n/policy.ts
8
8
  function resolvePolicy(onMissing, layer) {
@@ -377,4 +377,4 @@ export {
377
377
  applyI18nLocale,
378
378
  stripI18nFilled
379
379
  };
380
- //# sourceMappingURL=chunk-7IP75FP2.js.map
380
+ //# sourceMappingURL=chunk-4K3MQ5S3.js.map
@@ -0,0 +1,37 @@
1
+ import {
2
+ NoydbError
3
+ } from "./chunk-U23JUUPX.js";
4
+
5
+ // src/with-formula/computed/index.ts
6
+ var ComputedFieldError = class extends NoydbError {
7
+ constructor(field, id, cause) {
8
+ super(
9
+ "COMPUTED_FIELD",
10
+ `computed field "${field}" threw for record "${id}": ` + (cause instanceof Error ? cause.message : String(cause))
11
+ );
12
+ this.field = field;
13
+ this.id = id;
14
+ this.cause = cause;
15
+ this.name = "ComputedFieldError";
16
+ }
17
+ field;
18
+ id;
19
+ cause;
20
+ };
21
+ function evalComputedFields(record, computed, id) {
22
+ const out = { ...record };
23
+ for (const [field, fn] of Object.entries(computed)) {
24
+ try {
25
+ out[field] = fn(out);
26
+ } catch (cause) {
27
+ throw new ComputedFieldError(field, id, cause);
28
+ }
29
+ }
30
+ return out;
31
+ }
32
+
33
+ export {
34
+ ComputedFieldError,
35
+ evalComputedFields
36
+ };
37
+ //# sourceMappingURL=chunk-5EWYUR5P.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-formula/computed/index.ts"],"sourcesContent":["/**\n * Computed scalar fields — schema-owned derived values evaluated on\n * write and materialized onto the record.\n *\n * A `computed` map declares pure, synchronous functions keyed by field\n * path. {@link evalComputedFields} runs them in declaration order — each\n * function sees the record with all prior computed fields already\n * injected, so a later field can read an earlier one (`total` reads\n * `netAmount`). The result is stored like any field: queryable,\n * indexable, and `aggregate(sum())`-able (exactly, when the field is also\n * a `money()` field).\n *\n * Computed evaluation is the FIRST stage of the write pipeline (before\n * schema validation), so the user need not supply computed fields and the\n * schema validates the computed result. Cross-record / async derivation\n * is out of scope here — see the validation service.\n */\n\nimport { NoydbError } from '../../kernel/errors.js'\n\nexport type ComputedFn<T = Record<string, unknown>> = (record: T) => unknown\n\nexport type ComputedFields<T = Record<string, unknown>> = Record<string, ComputedFn<T>>\n\n/** Raised when a computed function throws during a write. */\nexport class ComputedFieldError extends NoydbError {\n constructor(\n public readonly field: string,\n public readonly id: string,\n public readonly cause: unknown,\n ) {\n super(\n 'COMPUTED_FIELD',\n `computed field \"${field}\" threw for record \"${id}\": ` +\n (cause instanceof Error ? cause.message : String(cause)),\n )\n this.name = 'ComputedFieldError'\n }\n}\n\n/**\n * Evaluate every computed field in declaration order, injecting each\n * result into a shallow clone. A computed field overwrites any\n * user-supplied value of the same name — the field is schema-owned.\n * Returns the new record; the input is not mutated.\n */\nexport function evalComputedFields<T extends Record<string, unknown>>(\n record: T,\n computed: ComputedFields,\n id: string,\n): T {\n const out: Record<string, unknown> = { ...record }\n for (const [field, fn] of Object.entries(computed)) {\n try {\n out[field] = fn(out)\n } catch (cause) {\n throw new ComputedFieldError(field, id, cause)\n }\n }\n return out as T\n}\n"],"mappings":";;;;;AAyBO,IAAM,qBAAN,cAAiC,WAAW;AAAA,EACjD,YACkB,OACA,IACA,OAChB;AACA;AAAA,MACE;AAAA,MACA,mBAAmB,KAAK,uBAAuB,EAAE,SAC9C,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,IAC1D;AARgB;AACA;AACA;AAOhB,SAAK,OAAO;AAAA,EACd;AAAA,EAVkB;AAAA,EACA;AAAA,EACA;AASpB;AAQO,SAAS,mBACd,QACA,UACA,IACG;AACH,QAAM,MAA+B,EAAE,GAAG,OAAO;AACjD,aAAW,CAAC,OAAO,EAAE,KAAK,OAAO,QAAQ,QAAQ,GAAG;AAClD,QAAI;AACF,UAAI,KAAK,IAAI,GAAG,GAAG;AAAA,IACrB,SAAS,OAAO;AACd,YAAM,IAAI,mBAAmB,OAAO,IAAI,KAAK;AAAA,IAC/C;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -1,9 +1,9 @@
1
- import {
2
- encrypt
3
- } from "./chunk-L4IRFTIF.js";
4
1
  import {
5
2
  NOYDB_FORMAT_VERSION
6
- } from "./chunk-OCDUQUAP.js";
3
+ } from "./chunk-LN22XH4B.js";
4
+ import {
5
+ encrypt
6
+ } from "./chunk-TLJOJBZD.js";
7
7
 
8
8
  // src/with-shape/blobs/export-blobs.ts
9
9
  var ExportBlobsAbortedError = class extends Error {
@@ -258,4 +258,4 @@ export {
258
258
  BLOB_EVICTION_AUDIT_COLLECTION,
259
259
  runCompaction
260
260
  };
261
- //# sourceMappingURL=chunk-2KSPDSWI.js.map
261
+ //# sourceMappingURL=chunk-5MRE3C4Q.js.map
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  ATTESTATIONS_COLLECTION,
3
3
  loadOrCreateSigner
4
- } from "./chunk-E4YJUNPU.js";
4
+ } from "./chunk-H5XRIJX3.js";
5
5
  import {
6
6
  generateULID
7
7
  } from "./chunk-ZJADGNYF.js";
8
- import {
9
- encrypt
10
- } from "./chunk-L4IRFTIF.js";
11
8
  import {
12
9
  NOYDB_FORMAT_VERSION
13
- } from "./chunk-OCDUQUAP.js";
10
+ } from "./chunk-LN22XH4B.js";
11
+ import {
12
+ encrypt
13
+ } from "./chunk-TLJOJBZD.js";
14
14
  import {
15
15
  AttestationError
16
- } from "./chunk-BLZRNHMG.js";
16
+ } from "./chunk-U23JUUPX.js";
17
17
 
18
18
  // src/with-audit/attestation/issue.ts
19
19
  import {
@@ -56,4 +56,4 @@ async function issueAttestationCore(ctx, args) {
56
56
  export {
57
57
  issueAttestationCore
58
58
  };
59
- //# sourceMappingURL=chunk-PUNJAEY6.js.map
59
+ //# sourceMappingURL=chunk-6HNKCKFZ.js.map
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  base64ToBuffer,
6
6
  bufferToBase64
7
- } from "./chunk-L4IRFTIF.js";
7
+ } from "./chunk-TLJOJBZD.js";
8
8
  import {
9
9
  SessionExpiredError,
10
10
  SessionNotFoundError,
11
11
  SessionPolicyError,
12
12
  ValidationError
13
- } from "./chunk-BLZRNHMG.js";
13
+ } from "./chunk-U23JUUPX.js";
14
14
 
15
15
  // src/with-party/session/session.ts
16
16
  var subtle = globalThis.crypto.subtle;
@@ -364,4 +364,4 @@ export {
364
364
  clearDevUnlock,
365
365
  isDevUnlockActive
366
366
  };
367
- //# sourceMappingURL=chunk-PJDK2PPQ.js.map
367
+ //# sourceMappingURL=chunk-6RXPSMKR.js.map
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  resolveManagedSecret
3
- } from "./chunk-AY4P6PHN.js";
3
+ } from "./chunk-VWGCJUTV.js";
4
4
  import {
5
5
  parseExtractedPartitionBody,
6
6
  readPod,
7
7
  readPodHeader
8
- } from "./chunk-3UDPDRUC.js";
8
+ } from "./chunk-EWR7HL3K.js";
9
9
  import {
10
10
  createOwnerKeyring
11
- } from "./chunk-5A6TC3RQ.js";
11
+ } from "./chunk-ZT4GWVTX.js";
12
12
  import {
13
13
  LedgerStore
14
- } from "./chunk-DHIN36UC.js";
14
+ } from "./chunk-GQOT6QJR.js";
15
15
  import {
16
16
  LEDGER_COLLECTION
17
17
  } from "./chunk-I7FD46FF.js";
18
18
  import {
19
19
  openEnvelopeJson
20
- } from "./chunk-5EZAJEES.js";
20
+ } from "./chunk-OVO2RZAE.js";
21
21
  import {
22
22
  base64ToBuffer,
23
23
  wrapKey
24
- } from "./chunk-L4IRFTIF.js";
24
+ } from "./chunk-TLJOJBZD.js";
25
25
  import {
26
26
  AdoptionStateError,
27
27
  TransferSealError,
28
28
  ValidationError
29
- } from "./chunk-BLZRNHMG.js";
29
+ } from "./chunk-U23JUUPX.js";
30
30
 
31
31
  // src/with-cargo/adopt-partition.ts
32
32
  async function unsealDeks(seal, transferKey) {
@@ -179,7 +179,7 @@ async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
179
179
  }
180
180
  }
181
181
  if (isManaged(opts)) {
182
- const { createNoydb } = await import("./noydb-WQNBVJIG.js");
182
+ const { createNoydb } = await import("./noydb-WQZNAECY.js");
183
183
  const db = await createNoydb({
184
184
  store,
185
185
  user: userId,
@@ -232,4 +232,4 @@ export {
232
232
  createOwnerOnAdoptedPartition,
233
233
  decryptExtractedPartition
234
234
  };
235
- //# sourceMappingURL=chunk-6DP5HBQD.js.map
235
+ //# sourceMappingURL=chunk-6UOSONVI.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  hasExportCapability,
3
3
  hasImportCapability
4
- } from "./chunk-5A6TC3RQ.js";
4
+ } from "./chunk-ZT4GWVTX.js";
5
5
  import {
6
6
  ExportCapabilityError,
7
7
  ImportCapabilityError
8
- } from "./chunk-BLZRNHMG.js";
8
+ } from "./chunk-U23JUUPX.js";
9
9
 
10
10
  // src/port/with/capabilities.ts
11
11
  function assertCanExport(keyring, tier, format) {
@@ -185,18 +185,23 @@ var ServiceBus = class {
185
185
  this.#depth--;
186
186
  }
187
187
  }
188
- /** Register a write-gating handler. A throw from the handler ABORTS the write. Returns an unsubscribe fn. */
189
- registerGate(point, handler) {
188
+ /**
189
+ * Register a write-gating handler. A throw from the handler ABORTS the
190
+ * write. Returns an unsubscribe fn. See {@link GateRegisterOptions} for
191
+ * the `needsPrior` prior-read declaration (#267).
192
+ */
193
+ registerGate(point, handler, opts) {
190
194
  let arr = this.#gateHandlers.get(point);
191
195
  if (!arr) {
192
196
  arr = [];
193
197
  this.#gateHandlers.set(point, arr);
194
198
  }
195
- arr.push(handler);
199
+ const entry = { fn: handler, needsPrior: opts?.needsPrior !== false };
200
+ arr.push(entry);
196
201
  return () => {
197
202
  const a = this.#gateHandlers.get(point);
198
203
  if (!a) return;
199
- const i = a.indexOf(handler);
204
+ const i = a.indexOf(entry);
200
205
  if (i >= 0) a.splice(i, 1);
201
206
  };
202
207
  }
@@ -205,6 +210,17 @@ var ServiceBus = class {
205
210
  const a = this.#gateHandlers.get(point);
206
211
  return a !== void 0 && a.length > 0;
207
212
  }
213
+ /**
214
+ * True when at least one gate handler at `point` needs the prior record
215
+ * (the default). False when the point has no handlers or every handler
216
+ * registered with `needsPrior: false` — the write path then skips the
217
+ * prior-read before dispatching (#267 prior-read elision).
218
+ */
219
+ gateNeedsPrior(point) {
220
+ const a = this.#gateHandlers.get(point);
221
+ if (!a) return false;
222
+ return a.some((e) => e.needsPrior);
223
+ }
208
224
  /**
209
225
  * Run gate handlers in registration order, awaited. Unlike `dispatch`
210
226
  * (observe), a handler throw is NOT swallowed — it PROPAGATES, aborting the
@@ -220,8 +236,8 @@ var ServiceBus = class {
220
236
  async dispatchGate(point, event) {
221
237
  const a = this.#gateHandlers.get(point);
222
238
  if (!a || a.length === 0) return;
223
- for (const h of a.slice()) {
224
- await h(event);
239
+ for (const e of a.slice()) {
240
+ await e.fn(event);
225
241
  }
226
242
  }
227
243
  };
@@ -236,4 +252,4 @@ export {
236
252
  ServiceBus,
237
253
  SubsystemBus
238
254
  };
239
- //# sourceMappingURL=chunk-YN66UOXT.js.map
255
+ //# sourceMappingURL=chunk-7SY3PTED.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/port/with/capabilities.ts","../src/port/with/write-hooks.ts","../src/port/with/service-bus.ts"],"sourcesContent":["/**\n * Export/import capability gating.\n *\n * Pure predicates over a keyring's `exportCapability` / `importCapability`: the\n * `assert*` variants throw {@link ExportCapabilityError} / {@link ImportCapabilityError}\n * when the invoking keyring is not authorised; the `can*` variants return a\n * boolean for UI affordances. They wrap the role-default resolution in\n * {@link hasExportCapability} / {@link hasImportCapability}. Behaviour is\n * byte-identical to the inline `Vault` methods they replaced — every dependency\n * is the unlocked keyring, passed in. `Vault` keeps the typed (overloaded)\n * public methods and delegates here.\n *\n * Internal — reached through `vault.assertCanExport(...)` etc.\n */\nimport { ExportCapabilityError, ImportCapabilityError } from '../../kernel/errors.js'\nimport { hasExportCapability, hasImportCapability } from '../../with-party/team/keyring.js'\nimport type { UnlockedKeyring } from '../../with-party/team/keyring.js'\nimport type { ExportFormat } from '../../kernel/types.js'\n\n/**\n * Authorize an `@noy-db/as-*` export against the keyring's `exportCapability`.\n * Throws `ExportCapabilityError` if the keyring is not authorised.\n *\n * - plaintext tier requires a `format`; defaults to empty for every role.\n * - bundle tier defaults to on for owner/admin, off for others.\n */\nexport function assertCanExport(keyring: UnlockedKeyring, tier: 'plaintext' | 'bundle', format?: ExportFormat): void {\n if (tier === 'plaintext') {\n if (format === undefined) {\n throw new Error('vault.assertCanExport: plaintext tier requires a format')\n }\n if (!hasExportCapability(keyring, 'plaintext', format)) {\n throw new ExportCapabilityError({\n tier: 'plaintext',\n userId: keyring.userId,\n format,\n })\n }\n return\n }\n if (!hasExportCapability(keyring, 'bundle')) {\n throw new ExportCapabilityError({\n tier: 'bundle',\n userId: keyring.userId,\n })\n }\n}\n\n/**\n * Authorize an `@noy-db/as-*` import against the keyring's `importCapability`.\n * Throws `ImportCapabilityError` if the keyring is not authorised.\n *\n * - plaintext tier requires a `format`; default-closed for every role.\n * - bundle tier is default-closed for every role, including owner — import is\n * more dangerous than export (corrupts vs leaks).\n */\nexport function assertCanImport(keyring: UnlockedKeyring, tier: 'plaintext' | 'bundle', format?: ExportFormat): void {\n if (tier === 'plaintext') {\n if (format === undefined) {\n throw new Error('vault.assertCanImport: plaintext tier requires a format')\n }\n if (!hasImportCapability(keyring, 'plaintext', format)) {\n throw new ImportCapabilityError({\n tier: 'plaintext',\n userId: keyring.userId,\n format,\n })\n }\n return\n }\n if (!hasImportCapability(keyring, 'bundle')) {\n throw new ImportCapabilityError({\n tier: 'bundle',\n userId: keyring.userId,\n })\n }\n}\n\n/**\n * Read-only accessor for the keyring's export capability, with role-based\n * defaults resolved. Useful for UI affordances (grey out the export button if\n * no capability) without throwing.\n */\nexport function canExport(keyring: UnlockedKeyring, tier: 'plaintext' | 'bundle', format?: ExportFormat): boolean {\n if (tier === 'plaintext') {\n if (format === undefined) return false\n return hasExportCapability(keyring, 'plaintext', format)\n }\n return hasExportCapability(keyring, 'bundle')\n}\n\n/**\n * Read-only accessor for the keyring's import capability. UI affordance —\n * returns false in every default-closed case (every role with no explicit\n * `importCapability` grant).\n */\nexport function canImport(keyring: UnlockedKeyring, tier: 'plaintext' | 'bundle', format?: ExportFormat): boolean {\n if (tier === 'plaintext') {\n if (format === undefined) return false\n return hasImportCapability(keyring, 'plaintext', format)\n }\n return hasImportCapability(keyring, 'bundle')\n}\n","/**\n * Hub-level write lifecycle hooks. `onBeforeWrite` may abort (throw);\n * `onAfterWrite` is awaited and its errors are warned, not thrown. A\n * re-entrancy flag suppresses nested firing so a handler that writes can't\n * loop. Held on the Noydb instance, threaded into every Collection.\n */\nexport interface WriteEvent {\n readonly op: 'create' | 'update' | 'delete'\n readonly vault: string\n readonly collection: string\n readonly docId: string\n readonly before: unknown // decrypted prior record; null on 'create'\n readonly after: unknown // the record written; null on 'delete'\n readonly baseVersion: number // version the writer started from (0 on create)\n readonly version: number // version the writer wrote (baseVersion + 1)\n readonly userId: string\n readonly timestamp: number\n readonly txId: string\n}\n\nexport type WriteHook = (event: WriteEvent) => void | Promise<void>\nexport type Unsubscribe = () => void\n\nexport class WriteHookRegistry {\n readonly #before: WriteHook[] = []\n readonly #after: WriteHook[] = []\n #suppressed = false\n\n /** True while handlers are running — used by the write path to skip nested firing. */\n get suppressed(): boolean { return this.#suppressed }\n\n /** True when any hook is registered (cheap gate for the write path). */\n get hasHandlers(): boolean { return this.#before.length > 0 || this.#after.length > 0 }\n\n onBeforeWrite(handler: WriteHook): Unsubscribe {\n this.#before.push(handler)\n return () => { const i = this.#before.indexOf(handler); if (i >= 0) this.#before.splice(i, 1) }\n }\n\n onAfterWrite(handler: WriteHook): Unsubscribe {\n this.#after.push(handler)\n return () => { const i = this.#after.indexOf(handler); if (i >= 0) this.#after.splice(i, 1) }\n }\n\n /** Run before-hooks (awaited, in order). A throw propagates and aborts the write. */\n async runBefore(event: WriteEvent): Promise<void> {\n if (this.#before.length === 0) return\n this.#suppressed = true\n try {\n for (const h of this.#before.slice()) await h(event)\n } finally {\n this.#suppressed = false\n }\n }\n\n /** Run after-hooks (awaited, in order). Per-handler errors are warned, not thrown. */\n async runAfter(event: WriteEvent): Promise<void> {\n if (this.#after.length === 0) return\n this.#suppressed = true\n try {\n for (const h of this.#after.slice()) {\n try {\n await h(event)\n } catch (err) {\n console.warn(\n `[noy-db] onAfterWrite handler failed for ${event.collection}/${event.docId}: ` +\n (err instanceof Error ? err.message : String(err)),\n )\n }\n }\n } finally {\n this.#suppressed = false\n }\n }\n}\n","/**\n * Generic per-instance **observe** bus. Observe-class\n * services (devtools inspector, audit, sync-dirty notification) register\n * handlers against named lifecycle points instead of the kernel naming each\n * service. Mirrors the registry pattern of {@link WriteHookRegistry} but is\n * internal and keyed by lifecycle point.\n *\n * OBSERVE SEMANTICS: handlers react to a write that already happened. A\n * handler throw is warned, not propagated — it can never abort a write. Write-\n * *gating* services (guards, periods) need a throw-propagating gate bus.\n * Add observe points by extending {@link LifecycleEventMap}. Write-*gating*\n * services use the sibling gate API on this same class\n * (`registerGate`/`dispatchGate`, throw-propagating); see {@link GateEventMap}.\n *\n * @module\n */\nimport type { WriteEvent } from './write-hooks.js'\nimport type { Role } from '../../kernel/types.js'\n\n/** Typed map of OBSERVE lifecycle point → event payload. Extend by adding keys. */\nexport interface LifecycleEventMap {\n afterPut: WriteEvent\n afterDelete: WriteEvent\n}\n\nexport type LifecyclePoint = keyof LifecycleEventMap\nexport type BusHandler<P extends LifecyclePoint> = (event: LifecycleEventMap[P]) => void | Promise<void>\nexport type Unsubscribe = () => void\n\ntype AnyHandler = (event: unknown) => void | Promise<void>\n\n/** Payload for a `beforePut` gate — carries the data guards and periods need to validate or reject a write. */\nexport interface GatePutEvent {\n readonly op: 'create' | 'update'\n readonly vault: string\n readonly collection: string\n readonly docId: string\n /**\n * The record about to be written (pre schema-validation). Money fields\n * are presented in their canonical decoded form — equal on both\n * sides for an unchanged value, regardless of how the caller wrote them.\n */\n readonly incoming: unknown\n /**\n * Decrypted prior record, or null on create / when prior is unreadable.\n * Money fields are decoded to the canonical decimal `get()` shape, NOT\n * the stored scaled-int — `incoming[f] === existing[f]` holds\n * for an unchanged money field.\n */\n readonly existing: unknown\n /** Prior envelope version, or 0 when none. */\n readonly existingVersion: number\n /** Prior envelope timestamp (`_ts` ISO string), or undefined when none — periods compares against this. */\n readonly existingTs: string | undefined\n readonly userId: string\n readonly role: Role\n /**\n * Names of fields whose values are schema-owned computed fields for this\n * collection. Gate handlers (e.g. `frozenFields`) must skip these: the\n * incoming record is the raw user input (computed fields not yet evaluated),\n * so comparing `existing[computedField]` vs `incoming[computedField]`\n * would always see a change even when the computed result is unchanged.\n */\n readonly computedFieldNames?: ReadonlySet<string>\n}\n\n/** Payload for a `beforeDelete` gate. Like {@link GatePutEvent} without `incoming`. */\nexport interface GateDeleteEvent {\n readonly vault: string\n readonly collection: string\n readonly docId: string\n /** True for system-internal (housekeeping) deletes — handlers branch on this. */\n readonly internal: boolean\n /** Decrypted prior record; money fields decoded to the canonical `get()` shape. */\n readonly existing: unknown\n readonly existingVersion: number\n readonly existingTs: string | undefined\n readonly userId: string\n readonly role: Role\n}\n\n/** Typed map of GATE lifecycle point → event payload. Extend by adding keys. */\nexport interface GateEventMap {\n beforePut: GatePutEvent\n beforeDelete: GateDeleteEvent\n}\n\nexport type GatePoint = keyof GateEventMap\nexport type GateHandler<P extends GatePoint> = (event: GateEventMap[P]) => void | Promise<void>\n\nexport class ServiceBus {\n readonly #handlers = new Map<LifecyclePoint, AnyHandler[]>()\n readonly #gateHandlers = new Map<GatePoint, AnyHandler[]>()\n #depth = 0\n\n /** Register a handler for an observe point. Returns an unsubscribe fn. */\n register<P extends LifecyclePoint>(point: P, handler: BusHandler<P>): Unsubscribe {\n let arr = this.#handlers.get(point)\n if (!arr) { arr = []; this.#handlers.set(point, arr) }\n arr.push(handler as AnyHandler)\n return () => {\n const a = this.#handlers.get(point)\n if (!a) return\n const i = a.indexOf(handler as AnyHandler)\n if (i >= 0) a.splice(i, 1)\n }\n }\n\n /** Cheap gate for the write path — true when any handler is registered for the point. */\n hasHandlers(point: LifecyclePoint): boolean {\n const a = this.#handlers.get(point)\n return a !== undefined && a.length > 0\n }\n\n /**\n * True while one or more dispatches are in flight. Backed by a depth counter\n * so that two concurrent async dispatches (`Promise.all([put('a'), put('b')])`\n * each captured `busAfterPut=true` at their respective put() tops while depth\n * was 0) both proceed independently — the counter stays > 0 until BOTH finish,\n * so any nested write attempted by a handler still sees `dispatching === true`\n * and is suppressed by the write-path gate in `collection.ts`\n * (`busAfterPut = hasHandlers('afterPut') && !dispatching`). Re-entrancy\n * suppression lives exclusively on that write-path gate; concurrent independent\n * dispatches must not drop each other's events.\n */\n get dispatching(): boolean { return this.#depth > 0 }\n\n /**\n * Dispatch in registration order, awaited. Per-handler errors are warned, not\n * thrown — an observe handler must never abort a completed write. A\n * re-entrancy guard suppresses nested firing so a handler that itself writes\n * cannot loop (same rationale as WriteHookRegistry.#suppressed).\n */\n async dispatch<P extends LifecyclePoint>(point: P, event: LifecycleEventMap[P]): Promise<void> {\n const a = this.#handlers.get(point)\n if (!a || a.length === 0) return\n this.#depth++\n try {\n for (const h of a.slice()) {\n try {\n await h(event)\n } catch (err) {\n console.warn(\n `[noy-db] service observe handler failed at ${point}: ` +\n (err instanceof Error ? err.message : String(err)),\n )\n }\n }\n } finally {\n this.#depth--\n }\n }\n\n /** Register a write-gating handler. A throw from the handler ABORTS the write. Returns an unsubscribe fn. */\n registerGate<P extends GatePoint>(point: P, handler: GateHandler<P>): Unsubscribe {\n let arr = this.#gateHandlers.get(point)\n if (!arr) { arr = []; this.#gateHandlers.set(point, arr) }\n arr.push(handler as AnyHandler)\n return () => {\n const a = this.#gateHandlers.get(point)\n if (!a) return\n const i = a.indexOf(handler as AnyHandler)\n if (i >= 0) a.splice(i, 1)\n }\n }\n\n /** Cheap gate for the write path — true when any gate handler is registered for the point. */\n hasGateHandlers(point: GatePoint): boolean {\n const a = this.#gateHandlers.get(point)\n return a !== undefined && a.length > 0\n }\n\n /**\n * Run gate handlers in registration order, awaited. Unlike `dispatch`\n * (observe), a handler throw is NOT swallowed — it PROPAGATES, aborting the\n * write before it reaches the store. The first throw stops the remaining\n * handlers (fail-fast). This is the seam guards/periods migrate onto.\n *\n * Note: gate handlers are validators that read, not write. A gate handler\n * that writes back into the same collection would re-enter the write path\n * and re-dispatch this point; loop-suppression for that case is deferred to\n * the migration slice (contract: gate handlers must not perform writes that\n * re-trigger their own point).\n */\n async dispatchGate<P extends GatePoint>(point: P, event: GateEventMap[P]): Promise<void> {\n const a = this.#gateHandlers.get(point)\n if (!a || a.length === 0) return\n for (const h of a.slice()) {\n await h(event) // throw propagates → aborts the write\n }\n }\n}\n\n/** @deprecated Use ServiceBus. */\nexport const SubsystemBus = ServiceBus\n/** @deprecated Use ServiceBus. */\nexport type SubsystemBus = ServiceBus\n"],"mappings":";;;;;;;;;;AA0BO,SAAS,gBAAgB,SAA0B,MAA8B,QAA6B;AACnH,MAAI,SAAS,aAAa;AACxB,QAAI,WAAW,QAAW;AACxB,YAAM,IAAI,MAAM,yDAAyD;AAAA,IAC3E;AACA,QAAI,CAAC,oBAAoB,SAAS,aAAa,MAAM,GAAG;AACtD,YAAM,IAAI,sBAAsB;AAAA,QAC9B,MAAM;AAAA,QACN,QAAQ,QAAQ;AAAA,QAChB;AAAA,MACF,CAAC;AAAA,IACH;AACA;AAAA,EACF;AACA,MAAI,CAAC,oBAAoB,SAAS,QAAQ,GAAG;AAC3C,UAAM,IAAI,sBAAsB;AAAA,MAC9B,MAAM;AAAA,MACN,QAAQ,QAAQ;AAAA,IAClB,CAAC;AAAA,EACH;AACF;AAUO,SAAS,gBAAgB,SAA0B,MAA8B,QAA6B;AACnH,MAAI,SAAS,aAAa;AACxB,QAAI,WAAW,QAAW;AACxB,YAAM,IAAI,MAAM,yDAAyD;AAAA,IAC3E;AACA,QAAI,CAAC,oBAAoB,SAAS,aAAa,MAAM,GAAG;AACtD,YAAM,IAAI,sBAAsB;AAAA,QAC9B,MAAM;AAAA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kC,OAAU,OAAuC;AACvF,UAAM,IAAI,KAAK,cAAc,IAAI,KAAK;AACtC,QAAI,CAAC,KAAK,EAAE,WAAW,EAAG;AAC1B,eAAW,KAAK,EAAE,MAAM,GAAG;AACzB,YAAM,EAAE,KAAK;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,eAAe;","names":[]}
1
+ {"version":3,"sources":["../src/port/with/capabilities.ts","../src/port/with/write-hooks.ts","../src/port/with/service-bus.ts"],"sourcesContent":["/**\n * Export/import capability gating.\n *\n * Pure predicates over a keyring's `exportCapability` / `importCapability`: the\n * `assert*` variants throw {@link ExportCapabilityError} / {@link ImportCapabilityError}\n * when the invoking keyring is not authorised; the `can*` variants return a\n * boolean for UI affordances. They wrap the role-default resolution in\n * {@link hasExportCapability} / {@link hasImportCapability}. Behaviour is\n * byte-identical to the inline `Vault` methods they replaced — every dependency\n * is the unlocked keyring, passed in. `Vault` keeps the typed (overloaded)\n * public methods and delegates here.\n *\n * Internal — reached through `vault.assertCanExport(...)` etc.\n */\nimport { ExportCapabilityError, ImportCapabilityError } from '../../kernel/errors.js'\nimport { hasExportCapability, hasImportCapability } from '../../with-party/team/keyring.js'\nimport type { UnlockedKeyring } from '../../with-party/team/keyring.js'\nimport type { ExportFormat } from '../../kernel/types.js'\n\n/**\n * Authorize an `@noy-db/as-*` export against the keyring's `exportCapability`.\n * Throws `ExportCapabilityError` if the keyring is not authorised.\n *\n * - plaintext tier requires a `format`; defaults to empty for every role.\n * - bundle tier defaults to on for owner/admin, off for others.\n */\nexport function assertCanExport(keyring: UnlockedKeyring, tier: 'plaintext' | 'bundle', format?: ExportFormat): void {\n if (tier === 'plaintext') {\n if (format === undefined) {\n throw new Error('vault.assertCanExport: plaintext tier requires a format')\n }\n if (!hasExportCapability(keyring, 'plaintext', format)) {\n throw new ExportCapabilityError({\n tier: 'plaintext',\n userId: keyring.userId,\n format,\n })\n }\n return\n }\n if (!hasExportCapability(keyring, 'bundle')) {\n throw new ExportCapabilityError({\n tier: 'bundle',\n userId: keyring.userId,\n })\n }\n}\n\n/**\n * Authorize an `@noy-db/as-*` import against the keyring's `importCapability`.\n * Throws `ImportCapabilityError` if the keyring is not authorised.\n *\n * - plaintext tier requires a `format`; default-closed for every role.\n * - bundle tier is default-closed for every role, including owner — import is\n * more dangerous than export (corrupts vs leaks).\n */\nexport function assertCanImport(keyring: UnlockedKeyring, tier: 'plaintext' | 'bundle', format?: ExportFormat): void {\n if (tier === 'plaintext') {\n if (format === undefined) {\n throw new Error('vault.assertCanImport: plaintext tier requires a format')\n }\n if (!hasImportCapability(keyring, 'plaintext', format)) {\n throw new ImportCapabilityError({\n tier: 'plaintext',\n userId: keyring.userId,\n format,\n })\n }\n return\n }\n if (!hasImportCapability(keyring, 'bundle')) {\n throw new ImportCapabilityError({\n tier: 'bundle',\n userId: keyring.userId,\n })\n }\n}\n\n/**\n * Read-only accessor for the keyring's export capability, with role-based\n * defaults resolved. Useful for UI affordances (grey out the export button if\n * no capability) without throwing.\n */\nexport function canExport(keyring: UnlockedKeyring, tier: 'plaintext' | 'bundle', format?: ExportFormat): boolean {\n if (tier === 'plaintext') {\n if (format === undefined) return false\n return hasExportCapability(keyring, 'plaintext', format)\n }\n return hasExportCapability(keyring, 'bundle')\n}\n\n/**\n * Read-only accessor for the keyring's import capability. UI affordance —\n * returns false in every default-closed case (every role with no explicit\n * `importCapability` grant).\n */\nexport function canImport(keyring: UnlockedKeyring, tier: 'plaintext' | 'bundle', format?: ExportFormat): boolean {\n if (tier === 'plaintext') {\n if (format === undefined) return false\n return hasImportCapability(keyring, 'plaintext', format)\n }\n return hasImportCapability(keyring, 'bundle')\n}\n","/**\n * Hub-level write lifecycle hooks. `onBeforeWrite` may abort (throw);\n * `onAfterWrite` is awaited and its errors are warned, not thrown. A\n * re-entrancy flag suppresses nested firing so a handler that writes can't\n * loop. Held on the Noydb instance, threaded into every Collection.\n */\nexport interface WriteEvent {\n readonly op: 'create' | 'update' | 'delete'\n readonly vault: string\n readonly collection: string\n readonly docId: string\n readonly before: unknown // decrypted prior record; null on 'create'\n readonly after: unknown // the record written; null on 'delete'\n readonly baseVersion: number // version the writer started from (0 on create)\n readonly version: number // version the writer wrote (baseVersion + 1)\n readonly userId: string\n readonly timestamp: number\n readonly txId: string\n}\n\nexport type WriteHook = (event: WriteEvent) => void | Promise<void>\nexport type Unsubscribe = () => void\n\nexport class WriteHookRegistry {\n readonly #before: WriteHook[] = []\n readonly #after: WriteHook[] = []\n #suppressed = false\n\n /** True while handlers are running — used by the write path to skip nested firing. */\n get suppressed(): boolean { return this.#suppressed }\n\n /** True when any hook is registered (cheap gate for the write path). */\n get hasHandlers(): boolean { return this.#before.length > 0 || this.#after.length > 0 }\n\n onBeforeWrite(handler: WriteHook): Unsubscribe {\n this.#before.push(handler)\n return () => { const i = this.#before.indexOf(handler); if (i >= 0) this.#before.splice(i, 1) }\n }\n\n onAfterWrite(handler: WriteHook): Unsubscribe {\n this.#after.push(handler)\n return () => { const i = this.#after.indexOf(handler); if (i >= 0) this.#after.splice(i, 1) }\n }\n\n /** Run before-hooks (awaited, in order). A throw propagates and aborts the write. */\n async runBefore(event: WriteEvent): Promise<void> {\n if (this.#before.length === 0) return\n this.#suppressed = true\n try {\n for (const h of this.#before.slice()) await h(event)\n } finally {\n this.#suppressed = false\n }\n }\n\n /** Run after-hooks (awaited, in order). Per-handler errors are warned, not thrown. */\n async runAfter(event: WriteEvent): Promise<void> {\n if (this.#after.length === 0) return\n this.#suppressed = true\n try {\n for (const h of this.#after.slice()) {\n try {\n await h(event)\n } catch (err) {\n console.warn(\n `[noy-db] onAfterWrite handler failed for ${event.collection}/${event.docId}: ` +\n (err instanceof Error ? err.message : String(err)),\n )\n }\n }\n } finally {\n this.#suppressed = false\n }\n }\n}\n","/**\n * Generic per-instance **observe** bus. Observe-class\n * services (devtools inspector, audit, sync-dirty notification) register\n * handlers against named lifecycle points instead of the kernel naming each\n * service. Mirrors the registry pattern of {@link WriteHookRegistry} but is\n * internal and keyed by lifecycle point.\n *\n * OBSERVE SEMANTICS: handlers react to a write that already happened. A\n * handler throw is warned, not propagated — it can never abort a write. Write-\n * *gating* services (guards, periods) need a throw-propagating gate bus.\n * Add observe points by extending {@link LifecycleEventMap}. Write-*gating*\n * services use the sibling gate API on this same class\n * (`registerGate`/`dispatchGate`, throw-propagating); see {@link GateEventMap}.\n *\n * @module\n */\nimport type { WriteEvent } from './write-hooks.js'\nimport type { Role } from '../../kernel/types.js'\n\n/** Typed map of OBSERVE lifecycle point → event payload. Extend by adding keys. */\nexport interface LifecycleEventMap {\n afterPut: WriteEvent\n afterDelete: WriteEvent\n}\n\nexport type LifecyclePoint = keyof LifecycleEventMap\nexport type BusHandler<P extends LifecyclePoint> = (event: LifecycleEventMap[P]) => void | Promise<void>\nexport type Unsubscribe = () => void\n\ntype AnyHandler = (event: unknown) => void | Promise<void>\n\n/** Payload for a `beforePut` gate — carries the data guards and periods need to validate or reject a write. */\nexport interface GatePutEvent {\n readonly op: 'create' | 'update'\n readonly vault: string\n readonly collection: string\n readonly docId: string\n /**\n * The record about to be written (pre schema-validation). Money fields\n * are presented in their canonical decoded form — equal on both\n * sides for an unchanged value, regardless of how the caller wrote them.\n */\n readonly incoming: unknown\n /**\n * Decrypted prior record, or null on create / when prior is unreadable.\n * Money fields are decoded to the canonical decimal `get()` shape, NOT\n * the stored scaled-int — `incoming[f] === existing[f]` holds\n * for an unchanged money field.\n */\n readonly existing: unknown\n /** Prior envelope version, or 0 when none. */\n readonly existingVersion: number\n /** Prior envelope timestamp (`_ts` ISO string), or undefined when none — periods compares against this. */\n readonly existingTs: string | undefined\n readonly userId: string\n readonly role: Role\n /**\n * Names of fields whose values are schema-owned computed fields for this\n * collection. Gate handlers (e.g. `frozenFields`) must skip these: the\n * incoming record is the raw user input (computed fields not yet evaluated),\n * so comparing `existing[computedField]` vs `incoming[computedField]`\n * would always see a change even when the computed result is unchanged.\n */\n readonly computedFieldNames?: ReadonlySet<string>\n}\n\n/** Payload for a `beforeDelete` gate. Like {@link GatePutEvent} without `incoming`. */\nexport interface GateDeleteEvent {\n readonly vault: string\n readonly collection: string\n readonly docId: string\n /** True for system-internal (housekeeping) deletes — handlers branch on this. */\n readonly internal: boolean\n /** Decrypted prior record; money fields decoded to the canonical `get()` shape. */\n readonly existing: unknown\n readonly existingVersion: number\n readonly existingTs: string | undefined\n readonly userId: string\n readonly role: Role\n}\n\n/** Typed map of GATE lifecycle point → event payload. Extend by adding keys. */\nexport interface GateEventMap {\n beforePut: GatePutEvent\n beforeDelete: GateDeleteEvent\n}\n\nexport type GatePoint = keyof GateEventMap\nexport type GateHandler<P extends GatePoint> = (event: GateEventMap[P]) => void | Promise<void>\n\n/**\n * Registration options for a gate handler.\n *\n * `needsPrior` (default `true`) declares whether the handler reads the\n * prior-derived event fields — `existing`, `existingVersion`, `existingTs`,\n * and (on `beforePut`) `op`. When EVERY handler registered at a point set\n * `needsPrior: false`, the write path skips the prior-read (store get +\n * decrypt) entirely and dispatches the event with `existing: null`,\n * `existingVersion: 0`, `existingTs: undefined` (and `op: 'create'` on\n * `beforePut`; a `beforeDelete` gate then also fires for delete-of-absent).\n * A handler that opts out MUST NOT rely on those fields. (#267 prior-read\n * elision — pure perf; one prior-needing handler restores the old behavior\n * for the whole point.)\n */\nexport interface GateRegisterOptions {\n readonly needsPrior?: boolean\n}\n\ntype GateEntry = { readonly fn: AnyHandler; readonly needsPrior: boolean }\n\nexport class ServiceBus {\n readonly #handlers = new Map<LifecyclePoint, AnyHandler[]>()\n readonly #gateHandlers = new Map<GatePoint, GateEntry[]>()\n #depth = 0\n\n /** Register a handler for an observe point. Returns an unsubscribe fn. */\n register<P extends LifecyclePoint>(point: P, handler: BusHandler<P>): Unsubscribe {\n let arr = this.#handlers.get(point)\n if (!arr) { arr = []; this.#handlers.set(point, arr) }\n arr.push(handler as AnyHandler)\n return () => {\n const a = this.#handlers.get(point)\n if (!a) return\n const i = a.indexOf(handler as AnyHandler)\n if (i >= 0) a.splice(i, 1)\n }\n }\n\n /** Cheap gate for the write path — true when any handler is registered for the point. */\n hasHandlers(point: LifecyclePoint): boolean {\n const a = this.#handlers.get(point)\n return a !== undefined && a.length > 0\n }\n\n /**\n * True while one or more dispatches are in flight. Backed by a depth counter\n * so that two concurrent async dispatches (`Promise.all([put('a'), put('b')])`\n * each captured `busAfterPut=true` at their respective put() tops while depth\n * was 0) both proceed independently — the counter stays > 0 until BOTH finish,\n * so any nested write attempted by a handler still sees `dispatching === true`\n * and is suppressed by the write-path gate in `collection.ts`\n * (`busAfterPut = hasHandlers('afterPut') && !dispatching`). Re-entrancy\n * suppression lives exclusively on that write-path gate; concurrent independent\n * dispatches must not drop each other's events.\n */\n get dispatching(): boolean { return this.#depth > 0 }\n\n /**\n * Dispatch in registration order, awaited. Per-handler errors are warned, not\n * thrown — an observe handler must never abort a completed write. A\n * re-entrancy guard suppresses nested firing so a handler that itself writes\n * cannot loop (same rationale as WriteHookRegistry.#suppressed).\n */\n async dispatch<P extends LifecyclePoint>(point: P, event: LifecycleEventMap[P]): Promise<void> {\n const a = this.#handlers.get(point)\n if (!a || a.length === 0) return\n this.#depth++\n try {\n for (const h of a.slice()) {\n try {\n await h(event)\n } catch (err) {\n console.warn(\n `[noy-db] service observe handler failed at ${point}: ` +\n (err instanceof Error ? err.message : String(err)),\n )\n }\n }\n } finally {\n this.#depth--\n }\n }\n\n /**\n * Register a write-gating handler. A throw from the handler ABORTS the\n * write. Returns an unsubscribe fn. See {@link GateRegisterOptions} for\n * the `needsPrior` prior-read declaration (#267).\n */\n registerGate<P extends GatePoint>(point: P, handler: GateHandler<P>, opts?: GateRegisterOptions): Unsubscribe {\n let arr = this.#gateHandlers.get(point)\n if (!arr) { arr = []; this.#gateHandlers.set(point, arr) }\n const entry: GateEntry = { fn: handler as AnyHandler, needsPrior: opts?.needsPrior !== false }\n arr.push(entry)\n return () => {\n const a = this.#gateHandlers.get(point)\n if (!a) return\n const i = a.indexOf(entry)\n if (i >= 0) a.splice(i, 1)\n }\n }\n\n /** Cheap gate for the write path — true when any gate handler is registered for the point. */\n hasGateHandlers(point: GatePoint): boolean {\n const a = this.#gateHandlers.get(point)\n return a !== undefined && a.length > 0\n }\n\n /**\n * True when at least one gate handler at `point` needs the prior record\n * (the default). False when the point has no handlers or every handler\n * registered with `needsPrior: false` — the write path then skips the\n * prior-read before dispatching (#267 prior-read elision).\n */\n gateNeedsPrior(point: GatePoint): boolean {\n const a = this.#gateHandlers.get(point)\n if (!a) return false\n return a.some((e) => e.needsPrior)\n }\n\n /**\n * Run gate handlers in registration order, awaited. Unlike `dispatch`\n * (observe), a handler throw is NOT swallowed — it PROPAGATES, aborting the\n * write before it reaches the store. The first throw stops the remaining\n * handlers (fail-fast). This is the seam guards/periods migrate onto.\n *\n * Note: gate handlers are validators that read, not write. A gate handler\n * that writes back into the same collection would re-enter the write path\n * and re-dispatch this point; loop-suppression for that case is deferred to\n * the migration slice (contract: gate handlers must not perform writes that\n * re-trigger their own point).\n */\n async dispatchGate<P extends GatePoint>(point: P, event: GateEventMap[P]): Promise<void> {\n const a = this.#gateHandlers.get(point)\n if (!a || a.length === 0) return\n for (const e of a.slice()) {\n await e.fn(event) // throw propagates → aborts the write\n }\n }\n}\n\n/** @deprecated Use ServiceBus. */\nexport const SubsystemBus = ServiceBus\n/** @deprecated Use ServiceBus. */\nexport type SubsystemBus = ServiceBus\n"],"mappings":";;;;;;;;;;AA0BO,SAAS,gBAAgB,SAA0B,MAA8B,QAA6B;AACnH,MAAI,SAAS,aAAa;AACxB,QAAI,WAAW,QAAW;AACxB,YAAM,IAAI,MAAM,yDAAyD;AAAA,IAC3E;AACA,QAAI,CAAC,oBAAoB,SAAS,aAAa,MAAM,GAAG;AACtD,YAAM,IAAI,sBAAsB;AAAA,QAC9B,MAAM;AAAA,QACN,QAAQ,QAAQ;AAAA,QAChB;AAAA,MACF,CAAC;AAAA,IACH;AACA;AAAA,EACF;AACA,MAAI,CAAC,oBAAoB,SAAS,QAAQ,GAAG;AAC3C,UAAM,IAAI,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AAK;AACd,WAAO,MAAM;AACX,YAAM,IAAI,KAAK,cAAc,IAAI,KAAK;AACtC,UAAI,CAAC,EAAG;AACR,YAAM,IAAI,EAAE,QAAQ,KAAK;AACzB,UAAI,KAAK,EAAG,GAAE,OAAO,GAAG,CAAC;AAAA,IAC3B;AAAA,EACF;AAAA;AAAA,EAGA,gBAAgB,OAA2B;AACzC,UAAM,IAAI,KAAK,cAAc,IAAI,KAAK;AACtC,WAAO,MAAM,UAAa,EAAE,SAAS;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,eAAe,OAA2B;AACxC,UAAM,IAAI,KAAK,cAAc,IAAI,KAAK;AACtC,QAAI,CAAC,EAAG,QAAO;AACf,WAAO,EAAE,KAAK,CAAC,MAAM,EAAE,UAAU;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,MAAM,aAAkC,OAAU,OAAuC;AACvF,UAAM,IAAI,KAAK,cAAc,IAAI,KAAK;AACtC,QAAI,CAAC,KAAK,EAAE,WAAW,EAAG;AAC1B,eAAW,KAAK,EAAE,MAAM,GAAG;AACzB,YAAM,EAAE,GAAG,KAAK;AAAA,IAClB;AAAA,EACF;AACF;AAGO,IAAM,eAAe;","names":[]}
@@ -3,16 +3,16 @@ import {
3
3
  } from "./chunk-AURFOK3D.js";
4
4
  import {
5
5
  isStaticDictDescriptor
6
- } from "./chunk-PYWW4KLO.js";
6
+ } from "./chunk-44UTIDE2.js";
7
7
  import {
8
8
  getAtPath,
9
9
  stripI18nFilled
10
- } from "./chunk-7IP75FP2.js";
10
+ } from "./chunk-4K3MQ5S3.js";
11
11
  import {
12
12
  EmbeddingDimMismatchError,
13
13
  EmbeddingModelMismatchError,
14
14
  SearchNotEnabledError
15
- } from "./chunk-BLZRNHMG.js";
15
+ } from "./chunk-U23JUUPX.js";
16
16
 
17
17
  // src/with-lookup/embeddings/cosine.ts
18
18
  function cosine(a, b) {
@@ -357,27 +357,27 @@ function buildBlobFieldEntries(filenamesByField) {
357
357
  function withSearch() {
358
358
  return {
359
359
  async search(ctx, field, query, opts) {
360
- const { search: search2 } = await import("./collection-facade-XPVRHBGU.js");
360
+ const { search: search2 } = await import("./collection-facade-THH4ASGX.js");
361
361
  return search2(ctx, field, query, opts);
362
362
  },
363
363
  async retrieve(ctx, query, opts) {
364
- const { retrieve: retrieve2 } = await import("./collection-facade-XPVRHBGU.js");
364
+ const { retrieve: retrieve2 } = await import("./collection-facade-THH4ASGX.js");
365
365
  return retrieve2(ctx, query, opts);
366
366
  },
367
367
  async similarTo(ctx, vector, opts) {
368
- const { similarTo: similarTo2 } = await import("./collection-facade-XPVRHBGU.js");
368
+ const { similarTo: similarTo2 } = await import("./collection-facade-THH4ASGX.js");
369
369
  return similarTo2(ctx, vector, opts);
370
370
  },
371
371
  async warmIndex(ctx) {
372
- const { warmIndex: warmIndex2 } = await import("./collection-facade-XPVRHBGU.js");
372
+ const { warmIndex: warmIndex2 } = await import("./collection-facade-THH4ASGX.js");
373
373
  return warmIndex2(ctx);
374
374
  },
375
375
  async flushIndex(ctx) {
376
- const { flushIndex: flushIndex2 } = await import("./collection-facade-XPVRHBGU.js");
376
+ const { flushIndex: flushIndex2 } = await import("./collection-facade-THH4ASGX.js");
377
377
  return flushIndex2(ctx);
378
378
  },
379
379
  async embedOnWrite(ctx, id, record, version) {
380
- const { embedOnWrite: embedOnWrite2 } = await import("./collection-facade-XPVRHBGU.js");
380
+ const { embedOnWrite: embedOnWrite2 } = await import("./collection-facade-THH4ASGX.js");
381
381
  return embedOnWrite2(ctx, id, record, version);
382
382
  }
383
383
  };
@@ -661,4 +661,4 @@ export {
661
661
  similarTo,
662
662
  embedOnWrite
663
663
  };
664
- //# sourceMappingURL=chunk-UP6EMMDI.js.map
664
+ //# sourceMappingURL=chunk-A4DWPOP3.js.map
@@ -4,10 +4,10 @@ import {
4
4
  persistUserVisibility,
5
5
  readUserVisibility,
6
6
  saveUserEnvelope
7
- } from "./chunk-2N4MUSF3.js";
7
+ } from "./chunk-TB5RNNJ4.js";
8
8
  import {
9
9
  PolicyDeniedError
10
- } from "./chunk-BLZRNHMG.js";
10
+ } from "./chunk-U23JUUPX.js";
11
11
 
12
12
  // src/with-party/directory/user-envelope/api.ts
13
13
  var UserApi = class {
@@ -379,4 +379,4 @@ export {
379
379
  UserApi,
380
380
  createUserApi
381
381
  };
382
- //# sourceMappingURL=chunk-MCJAUQGE.js.map
382
+ //# sourceMappingURL=chunk-A5DYVMDR.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ClassifiedConfigError,
3
3
  ClassifiedNotEnabledError
4
- } from "./chunk-BLZRNHMG.js";
4
+ } from "./chunk-U23JUUPX.js";
5
5
 
6
6
  // src/with-shape/classified/descriptor.ts
7
7
  function isClassifiedFieldSpec(x) {
@@ -90,6 +90,9 @@ var NO_CLASSIFIED = {
90
90
  },
91
91
  async matchGroup() {
92
92
  throw new ClassifiedNotEnabledError();
93
+ },
94
+ async computeTarget() {
95
+ throw new ClassifiedNotEnabledError();
93
96
  }
94
97
  };
95
98
 
@@ -102,4 +105,4 @@ export {
102
105
  enforceClassifiedWrite,
103
106
  NO_CLASSIFIED
104
107
  };
105
- //# sourceMappingURL=chunk-MIOLJG2R.js.map
108
+ //# sourceMappingURL=chunk-AF5ZRTZ4.js.map