@noy-db/hub 0.3.0 → 0.4.0-pre.0

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 (356) hide show
  1. package/dist/aggregate/index.js +4 -4
  2. package/dist/api-3A3S4SHH.js +20 -0
  3. package/dist/as/index.js +11 -11
  4. package/dist/attestation/index.js +18 -18
  5. package/dist/{backup-BJ57IKAO.js → backup-YPUEKIJC.js} +11 -11
  6. package/dist/blobs/index.js +12 -12
  7. package/dist/broker/index.js +12 -12
  8. package/dist/bundle/index.js +22 -22
  9. package/dist/by/index.js +2 -2
  10. package/dist/cargo/index.js +22 -22
  11. package/dist/{chunk-ZAJAVEXY.js → chunk-2PCAVW2I.js} +2 -2
  12. package/dist/{chunk-HTJQYHZP.js → chunk-3ELCWU56.js} +2 -2
  13. package/dist/{chunk-J2ZX2XUV.js → chunk-554KLAAN.js} +5 -5
  14. package/dist/{chunk-NR5LT5RY.js → chunk-5PFOMHTB.js} +7 -7
  15. package/dist/{chunk-B3HJYUOF.js → chunk-5WZXVULX.js} +2 -2
  16. package/dist/{chunk-ZJ2AK4V7.js → chunk-6HPG2YNX.js} +2 -2
  17. package/dist/{chunk-5M5DVGV7.js → chunk-6HY2X62D.js} +2 -2
  18. package/dist/{chunk-QRB7NAOJ.js → chunk-6NQMXTYC.js} +2 -2
  19. package/dist/{chunk-RIX4V2TB.js → chunk-6XE5TMPR.js} +3 -3
  20. package/dist/{chunk-7DSTRQIJ.js → chunk-A4FXFAKF.js} +2 -2
  21. package/dist/{chunk-454JXE57.js → chunk-A5BDDEXK.js} +10 -170
  22. package/dist/chunk-A5BDDEXK.js.map +1 -0
  23. package/dist/{chunk-EVVGJDRQ.js → chunk-ANATMTOA.js} +3 -3
  24. package/dist/{chunk-W22IKJE2.js → chunk-BOKIKJJB.js} +2 -2
  25. package/dist/{chunk-VZRODIM3.js → chunk-CJ5KKU6X.js} +4 -4
  26. package/dist/{chunk-CDUQTA3Z.js → chunk-CZTLE22N.js} +7 -7
  27. package/dist/{chunk-RCVJZMFE.js → chunk-DDHM2TLX.js} +4 -4
  28. package/dist/{chunk-PN2XMATY.js → chunk-DRWBEDYO.js} +2 -2
  29. package/dist/{chunk-EYZ6IQ6X.js → chunk-DSBQODMZ.js} +5 -5
  30. package/dist/{chunk-LASZKVMO.js → chunk-EO43ANYJ.js} +3 -3
  31. package/dist/{chunk-6QTNZJBS.js → chunk-EWPOHMN2.js} +3 -3
  32. package/dist/chunk-FH52K7EG.js +50 -0
  33. package/dist/chunk-FH52K7EG.js.map +1 -0
  34. package/dist/{chunk-FHS2HQSH.js → chunk-FXZDAV62.js} +11 -8
  35. package/dist/chunk-FXZDAV62.js.map +1 -0
  36. package/dist/{chunk-2NVOWNI3.js → chunk-GDG5VVYG.js} +4 -4
  37. package/dist/{chunk-6JTIAGHD.js → chunk-GULTLPFB.js} +3 -3
  38. package/dist/chunk-GULTLPFB.js.map +1 -0
  39. package/dist/{chunk-3B5VVCNY.js → chunk-GWKAVKHI.js} +2 -2
  40. package/dist/{chunk-BDVFPG6Y.js → chunk-H2KSZMIX.js} +5 -5
  41. package/dist/{chunk-CIE2BASH.js → chunk-HOONYZY2.js} +2 -2
  42. package/dist/{chunk-HDMEGAQE.js → chunk-HQBM64EE.js} +5 -5
  43. package/dist/{chunk-VFUPHI2Z.js → chunk-IAO54J4R.js} +6 -6
  44. package/dist/{chunk-5O3XF4DV.js → chunk-IFJTPAQQ.js} +4 -4
  45. package/dist/{chunk-OSDB5WW3.js → chunk-IK43HLDQ.js} +11 -11
  46. package/dist/{chunk-3QCRBHCY.js → chunk-ISMV2QVG.js} +2 -2
  47. package/dist/{chunk-HB3RFQSC.js → chunk-IY23KFNZ.js} +3 -3
  48. package/dist/{chunk-6CRIV7DE.js → chunk-JBBSYJHP.js} +2 -2
  49. package/dist/{chunk-IU6SNYX6.js → chunk-JFCV5QIK.js} +5 -5
  50. package/dist/{chunk-MEFJPTZ4.js → chunk-JRBNCUNT.js} +3 -3
  51. package/dist/{chunk-4VNQOLML.js → chunk-JVBO4SZL.js} +2 -2
  52. package/dist/{chunk-EQO2UVP4.js → chunk-KS6SAVCZ.js} +6 -6
  53. package/dist/{chunk-4CTHCN4J.js → chunk-LVGTA624.js} +4 -4
  54. package/dist/{chunk-K5IMOGHB.js → chunk-M75ZZHSR.js} +2 -2
  55. package/dist/{chunk-NJ4EOKMB.js → chunk-MT62YSPZ.js} +4 -4
  56. package/dist/{chunk-JKJOGPZN.js → chunk-N6WF5PKC.js} +2 -2
  57. package/dist/{chunk-4JBYV75E.js → chunk-NCCBLYEB.js} +5 -5
  58. package/dist/{chunk-SLFHQTTW.js → chunk-OCVM6KDH.js} +5 -5
  59. package/dist/{chunk-GKEWXIV5.js → chunk-ONTBCHCP.js} +2 -2
  60. package/dist/{chunk-X7QBD67R.js → chunk-PK6JIDQ4.js} +124 -104
  61. package/dist/{chunk-X7QBD67R.js.map → chunk-PK6JIDQ4.js.map} +1 -1
  62. package/dist/{chunk-EVX47VBM.js → chunk-QDPZWTN2.js} +2 -2
  63. package/dist/{chunk-IL6POWCW.js → chunk-R3BLCFD2.js} +6 -6
  64. package/dist/chunk-RA5VTXXG.js +173 -0
  65. package/dist/chunk-RA5VTXXG.js.map +1 -0
  66. package/dist/{chunk-QLWMEXCT.js → chunk-RDXW3OBQ.js} +2 -2
  67. package/dist/{chunk-3LQ2YKO4.js → chunk-RFI7GGFO.js} +2 -2
  68. package/dist/{chunk-FUG4SFN3.js → chunk-RJ6K6K5M.js} +2 -2
  69. package/dist/{chunk-T2FFWNPK.js → chunk-RNG4VRP4.js} +3 -3
  70. package/dist/{chunk-JZUV47FZ.js → chunk-RTEK4C4I.js} +2 -2
  71. package/dist/{chunk-KSKBRKGJ.js → chunk-S3BFKGET.js} +84 -6
  72. package/dist/chunk-S3BFKGET.js.map +1 -0
  73. package/dist/{chunk-5YOLBEQ6.js → chunk-S6Q37VGE.js} +2 -2
  74. package/dist/{chunk-E5ZQT5KX.js → chunk-SMIRGMS7.js} +2 -2
  75. package/dist/{chunk-6T2SCQRU.js → chunk-SV6EAJEP.js} +4 -4
  76. package/dist/chunk-T36RFODW.js +180 -0
  77. package/dist/chunk-T36RFODW.js.map +1 -0
  78. package/dist/{chunk-ERJ7FU55.js → chunk-T3GY65MA.js} +3 -3
  79. package/dist/{chunk-LXEXBTKL.js → chunk-TAGR72IR.js} +4 -4
  80. package/dist/{chunk-JIF24JPM.js → chunk-THVIPWRF.js} +9 -9
  81. package/dist/{chunk-ZUODRVHY.js → chunk-TIGPQDYP.js} +2 -2
  82. package/dist/{chunk-NWSGI5C7.js → chunk-U6JMEH2P.js} +3 -3
  83. package/dist/{chunk-ZICD77GM.js → chunk-UC2ETWF3.js} +2 -2
  84. package/dist/{chunk-VLFCJYTL.js → chunk-UDSR4X4L.js} +9 -9
  85. package/dist/{chunk-SNZ6URZZ.js → chunk-UHNGNKLV.js} +7 -7
  86. package/dist/{chunk-R4ROFEYC.js → chunk-VAIS3SOM.js} +2 -2
  87. package/dist/{chunk-VN3DBQAU.js → chunk-VCBHAE4R.js} +2 -2
  88. package/dist/{chunk-JNAI2HN2.js → chunk-VCTXU4AT.js} +1 -1
  89. package/dist/chunk-VCTXU4AT.js.map +1 -0
  90. package/dist/{chunk-M4CV6BRT.js → chunk-VEALDPHW.js} +2 -2
  91. package/dist/{chunk-AUSTCW2X.js → chunk-VKCADNMR.js} +8 -8
  92. package/dist/{chunk-XWZVFISC.js → chunk-VRBTNCM4.js} +6 -6
  93. package/dist/{chunk-BIOUI4HL.js → chunk-W2OG6JOL.js} +1 -1
  94. package/dist/{chunk-BIOUI4HL.js.map → chunk-W2OG6JOL.js.map} +1 -1
  95. package/dist/{chunk-XDYREZWE.js → chunk-W4TCUGQR.js} +8 -8
  96. package/dist/{chunk-FM3G3NOY.js → chunk-WG4QBZDN.js} +83 -6
  97. package/dist/chunk-WG4QBZDN.js.map +1 -0
  98. package/dist/{chunk-HDQIIUPH.js → chunk-WHXXI3W5.js} +3 -3
  99. package/dist/{chunk-F64IRYG3.js → chunk-WKGF2TJR.js} +2 -2
  100. package/dist/{chunk-CAF6WOK7.js → chunk-WNGGJWF7.js} +2 -2
  101. package/dist/{chunk-EXK7QRWF.js → chunk-WOM2HTML.js} +5 -5
  102. package/dist/{chunk-Q5VNKNE5.js → chunk-WQIYTNJV.js} +3 -3
  103. package/dist/{chunk-GTGPO5KW.js → chunk-WZSHL6DQ.js} +5 -5
  104. package/dist/{chunk-CRI4OUV4.js → chunk-XDIAFPUM.js} +2 -2
  105. package/dist/{chunk-RYCTDFUX.js → chunk-XJMBYYQK.js} +2 -2
  106. package/dist/{chunk-DLG74CNB.js → chunk-XTHCN77N.js} +4 -4
  107. package/dist/chunk-XUW3PXHU.js +248 -0
  108. package/dist/chunk-XUW3PXHU.js.map +1 -0
  109. package/dist/{chunk-I6GALP6E.js → chunk-YCH5GBN6.js} +6 -6
  110. package/dist/{chunk-RZ5SVOYR.js → chunk-YTGDPCPW.js} +2 -2
  111. package/dist/{chunk-UNFPPVNI.js → chunk-YZQOGE2L.js} +2 -2
  112. package/dist/{chunk-MV43JSJF.js → chunk-Z4PD65VQ.js} +4 -4
  113. package/dist/{chunk-YFXZEAYK.js → chunk-ZXEZCY6F.js} +6 -6
  114. package/dist/classified/index.js +5 -5
  115. package/dist/{classified-marker-CZKA6ITE.js → classified-marker-QWMASIT7.js} +3 -3
  116. package/dist/collection-facade-KMBWNCYP.js +44 -0
  117. package/dist/{computed-ZIQTYTDI.js → computed-DSMPXG2Y.js} +3 -3
  118. package/dist/consent/index.js +9 -9
  119. package/dist/{public-envelope-B4KNWVUA.js → cover-QJRXINN5.js} +25 -5
  120. package/dist/{dead-filter-ESOBZZP5.js → dead-filter-66VGI6JV.js} +2 -2
  121. package/dist/delegation-SU6CV3W7.js +25 -0
  122. package/dist/derivations/index.js +12 -12
  123. package/dist/derive-6RWU4EOA.js +21 -0
  124. package/dist/{enclave-AP3I5W7O.js → enclave-TKPN2G2U.js} +9 -9
  125. package/dist/executor-KGNLJD6M.js +9 -0
  126. package/dist/executor-UX4FASYZ.js +26 -0
  127. package/dist/executor-XGIS6CR7.js +9 -0
  128. package/dist/export-accessible-LKW3QV22.js +23 -0
  129. package/dist/extract-partition-UP2ARO75.js +38 -0
  130. package/dist/{fanout-sidecar-A765THMX.js → fanout-sidecar-B5LVUMQX.js} +9 -9
  131. package/dist/find-YS6XWB46.js +11 -0
  132. package/dist/forget/index.js +9 -9
  133. package/dist/guards/index.js +3 -3
  134. package/dist/history/index.js +12 -12
  135. package/dist/i18n/index.js +14 -14
  136. package/dist/index.d.ts +6 -3
  137. package/dist/index.js +110 -89
  138. package/dist/index.js.map +1 -1
  139. package/dist/indexing/index.js +2 -2
  140. package/dist/issue-3ACYX7LO.js +19 -0
  141. package/dist/kernel/errors.d.ts +10 -5
  142. package/dist/kernel/noydb.d.ts +21 -11
  143. package/dist/kernel/types.d.ts +12 -6
  144. package/dist/kernel/vault.d.ts +10 -6
  145. package/dist/{ledger-GFBKVPV4.js → ledger-PTK7XZYT.js} +11 -11
  146. package/dist/liberate-MQQXBUCY.js +24 -0
  147. package/dist/{link-set-Z7Q2ASFX.js → link-set-SLJHDNRB.js} +11 -11
  148. package/dist/materialized-views/index.js +19 -18
  149. package/dist/noydb-ANIW5FLE.js +69 -0
  150. package/dist/on/index.js +9 -9
  151. package/dist/overlay-views/index.js +4 -4
  152. package/dist/periods/index.js +12 -12
  153. package/dist/pod/index.js +13 -11
  154. package/dist/{policy-Z3RUAIY2.js → policy-YDLCOX4P.js} +5 -5
  155. package/dist/portability/index.js +8 -8
  156. package/dist/{post-register-JTH76BLY.js → post-register-2YHSADFI.js} +6 -6
  157. package/dist/query/index.js +10 -8
  158. package/dist/register-PAM3ASRZ.js +23 -0
  159. package/dist/registry-4S2U2TR4.js +19 -0
  160. package/dist/registry-NPOWJHC4.js +9 -0
  161. package/dist/registry-VZ3CCI2R.js +18 -0
  162. package/dist/request-withdrawal-DI3H5WUI.js +31 -0
  163. package/dist/{reveal-DIBHLUZX.js → reveal-HWO4YMTJ.js} +6 -6
  164. package/dist/revoke-R5CZSVUT.js +24 -0
  165. package/dist/satellites/index.js +1 -1
  166. package/dist/sealed-record/index.js +12 -12
  167. package/dist/{seed-Q6M2IZFL.js → seed-3ZMF5EQA.js} +11 -11
  168. package/dist/session/index.js +9 -9
  169. package/dist/shadow/index.js +2 -2
  170. package/dist/signer-MBVHW4WE.js +25 -0
  171. package/dist/snapshots/index.js +10 -10
  172. package/dist/{stale-OSQ7J3AA.js → stale-VZL4OGUB.js} +10 -10
  173. package/dist/storage-3MEJUENZ.js +23 -0
  174. package/dist/{store-coordination-provider-64OEZFGS.js → store-coordination-provider-FKX3F6TQ.js} +3 -3
  175. package/dist/sync/index.js +9 -9
  176. package/dist/team/index.js +15 -15
  177. package/dist/tiers/index.js +10 -10
  178. package/dist/to/index.js +1 -1
  179. package/dist/tx/index.js +3 -3
  180. package/dist/util/index.js +1 -1
  181. package/dist/{verify-ZASTRNPR.js → verify-26Y5GNMK.js} +5 -5
  182. package/dist/via/i18n/policy.d.ts +1 -1
  183. package/dist/{walk-SVNDIZ62.js → walk-IPLXE36W.js} +11 -11
  184. package/dist/with/index.js +11 -11
  185. package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +15 -0
  186. package/dist/with-formula/materialized-views/index.d.ts +1 -1
  187. package/dist/with-formula/materialized-views/registry.d.ts +29 -0
  188. package/dist/with-formula/materialized-views/types.d.ts +81 -0
  189. package/dist/with-formula/materialized-views/with-materialized-view.d.ts +9 -5
  190. package/dist/with-party/directory/cover/custom.d.ts +34 -0
  191. package/dist/with-party/directory/cover/index.d.ts +19 -0
  192. package/dist/with-party/directory/cover/schema.d.ts +39 -0
  193. package/dist/with-party/directory/cover/storage.d.ts +71 -0
  194. package/dist/with-party/directory/cover/types.d.ts +149 -0
  195. package/dist/with-party/team/noydb-facade.d.ts +1 -1
  196. package/dist/with-pod/bundle.d.ts +9 -7
  197. package/dist/with-pod/format.d.ts +8 -4
  198. package/dist/with-pod/index.d.ts +2 -1
  199. package/dist/withdraw-accessible-TZDATQVR.js +28 -0
  200. package/package.json +3 -3
  201. package/dist/api-ZGS6LCOF.js +0 -20
  202. package/dist/chunk-454JXE57.js.map +0 -1
  203. package/dist/chunk-4NXKCLLQ.js +0 -97
  204. package/dist/chunk-4NXKCLLQ.js.map +0 -1
  205. package/dist/chunk-6JTIAGHD.js.map +0 -1
  206. package/dist/chunk-FHS2HQSH.js.map +0 -1
  207. package/dist/chunk-FM3G3NOY.js.map +0 -1
  208. package/dist/chunk-JNAI2HN2.js.map +0 -1
  209. package/dist/chunk-KSKBRKGJ.js.map +0 -1
  210. package/dist/chunk-WXSYDNBT.js +0 -39
  211. package/dist/chunk-WXSYDNBT.js.map +0 -1
  212. package/dist/chunk-X3YYQWOQ.js +0 -155
  213. package/dist/chunk-X3YYQWOQ.js.map +0 -1
  214. package/dist/collection-facade-TLWIPI76.js +0 -44
  215. package/dist/delegation-W7ZV2322.js +0 -25
  216. package/dist/derive-H2BJTLUI.js +0 -21
  217. package/dist/executor-KGWTNEQD.js +0 -9
  218. package/dist/executor-OVEXR6RT.js +0 -9
  219. package/dist/executor-UNEH5ZYH.js +0 -25
  220. package/dist/export-accessible-PCMXSUZS.js +0 -23
  221. package/dist/extract-partition-SWHFSYJO.js +0 -38
  222. package/dist/find-N6345CNT.js +0 -11
  223. package/dist/issue-5OKB6I2R.js +0 -19
  224. package/dist/liberate-3VDOT4KO.js +0 -24
  225. package/dist/noydb-ZCJOYBDI.js +0 -68
  226. package/dist/register-VAHONCID.js +0 -23
  227. package/dist/registry-7MLVD3VO.js +0 -19
  228. package/dist/registry-EPKPD5SM.js +0 -18
  229. package/dist/registry-P5T7PS2U.js +0 -9
  230. package/dist/request-withdrawal-TI3A5WPS.js +0 -31
  231. package/dist/revoke-FDRD6GRW.js +0 -24
  232. package/dist/signer-MUWEIUI6.js +0 -25
  233. package/dist/storage-MVFCGEQE.js +0 -23
  234. package/dist/with-party/directory/public-envelope/index.d.ts +0 -12
  235. package/dist/with-party/directory/public-envelope/schema.d.ts +0 -24
  236. package/dist/with-party/directory/public-envelope/storage.d.ts +0 -59
  237. package/dist/with-party/directory/public-envelope/types.d.ts +0 -80
  238. package/dist/withdraw-accessible-WZIEVWSR.js +0 -28
  239. /package/dist/{api-ZGS6LCOF.js.map → api-3A3S4SHH.js.map} +0 -0
  240. /package/dist/{backup-BJ57IKAO.js.map → backup-YPUEKIJC.js.map} +0 -0
  241. /package/dist/{chunk-ZAJAVEXY.js.map → chunk-2PCAVW2I.js.map} +0 -0
  242. /package/dist/{chunk-HTJQYHZP.js.map → chunk-3ELCWU56.js.map} +0 -0
  243. /package/dist/{chunk-J2ZX2XUV.js.map → chunk-554KLAAN.js.map} +0 -0
  244. /package/dist/{chunk-NR5LT5RY.js.map → chunk-5PFOMHTB.js.map} +0 -0
  245. /package/dist/{chunk-B3HJYUOF.js.map → chunk-5WZXVULX.js.map} +0 -0
  246. /package/dist/{chunk-ZJ2AK4V7.js.map → chunk-6HPG2YNX.js.map} +0 -0
  247. /package/dist/{chunk-5M5DVGV7.js.map → chunk-6HY2X62D.js.map} +0 -0
  248. /package/dist/{chunk-QRB7NAOJ.js.map → chunk-6NQMXTYC.js.map} +0 -0
  249. /package/dist/{chunk-RIX4V2TB.js.map → chunk-6XE5TMPR.js.map} +0 -0
  250. /package/dist/{chunk-7DSTRQIJ.js.map → chunk-A4FXFAKF.js.map} +0 -0
  251. /package/dist/{chunk-EVVGJDRQ.js.map → chunk-ANATMTOA.js.map} +0 -0
  252. /package/dist/{chunk-W22IKJE2.js.map → chunk-BOKIKJJB.js.map} +0 -0
  253. /package/dist/{chunk-VZRODIM3.js.map → chunk-CJ5KKU6X.js.map} +0 -0
  254. /package/dist/{chunk-CDUQTA3Z.js.map → chunk-CZTLE22N.js.map} +0 -0
  255. /package/dist/{chunk-RCVJZMFE.js.map → chunk-DDHM2TLX.js.map} +0 -0
  256. /package/dist/{chunk-PN2XMATY.js.map → chunk-DRWBEDYO.js.map} +0 -0
  257. /package/dist/{chunk-EYZ6IQ6X.js.map → chunk-DSBQODMZ.js.map} +0 -0
  258. /package/dist/{chunk-LASZKVMO.js.map → chunk-EO43ANYJ.js.map} +0 -0
  259. /package/dist/{chunk-6QTNZJBS.js.map → chunk-EWPOHMN2.js.map} +0 -0
  260. /package/dist/{chunk-2NVOWNI3.js.map → chunk-GDG5VVYG.js.map} +0 -0
  261. /package/dist/{chunk-3B5VVCNY.js.map → chunk-GWKAVKHI.js.map} +0 -0
  262. /package/dist/{chunk-BDVFPG6Y.js.map → chunk-H2KSZMIX.js.map} +0 -0
  263. /package/dist/{chunk-CIE2BASH.js.map → chunk-HOONYZY2.js.map} +0 -0
  264. /package/dist/{chunk-HDMEGAQE.js.map → chunk-HQBM64EE.js.map} +0 -0
  265. /package/dist/{chunk-VFUPHI2Z.js.map → chunk-IAO54J4R.js.map} +0 -0
  266. /package/dist/{chunk-5O3XF4DV.js.map → chunk-IFJTPAQQ.js.map} +0 -0
  267. /package/dist/{chunk-OSDB5WW3.js.map → chunk-IK43HLDQ.js.map} +0 -0
  268. /package/dist/{chunk-3QCRBHCY.js.map → chunk-ISMV2QVG.js.map} +0 -0
  269. /package/dist/{chunk-HB3RFQSC.js.map → chunk-IY23KFNZ.js.map} +0 -0
  270. /package/dist/{chunk-6CRIV7DE.js.map → chunk-JBBSYJHP.js.map} +0 -0
  271. /package/dist/{chunk-IU6SNYX6.js.map → chunk-JFCV5QIK.js.map} +0 -0
  272. /package/dist/{chunk-MEFJPTZ4.js.map → chunk-JRBNCUNT.js.map} +0 -0
  273. /package/dist/{chunk-4VNQOLML.js.map → chunk-JVBO4SZL.js.map} +0 -0
  274. /package/dist/{chunk-EQO2UVP4.js.map → chunk-KS6SAVCZ.js.map} +0 -0
  275. /package/dist/{chunk-4CTHCN4J.js.map → chunk-LVGTA624.js.map} +0 -0
  276. /package/dist/{chunk-K5IMOGHB.js.map → chunk-M75ZZHSR.js.map} +0 -0
  277. /package/dist/{chunk-NJ4EOKMB.js.map → chunk-MT62YSPZ.js.map} +0 -0
  278. /package/dist/{chunk-JKJOGPZN.js.map → chunk-N6WF5PKC.js.map} +0 -0
  279. /package/dist/{chunk-4JBYV75E.js.map → chunk-NCCBLYEB.js.map} +0 -0
  280. /package/dist/{chunk-SLFHQTTW.js.map → chunk-OCVM6KDH.js.map} +0 -0
  281. /package/dist/{chunk-GKEWXIV5.js.map → chunk-ONTBCHCP.js.map} +0 -0
  282. /package/dist/{chunk-EVX47VBM.js.map → chunk-QDPZWTN2.js.map} +0 -0
  283. /package/dist/{chunk-IL6POWCW.js.map → chunk-R3BLCFD2.js.map} +0 -0
  284. /package/dist/{chunk-QLWMEXCT.js.map → chunk-RDXW3OBQ.js.map} +0 -0
  285. /package/dist/{chunk-3LQ2YKO4.js.map → chunk-RFI7GGFO.js.map} +0 -0
  286. /package/dist/{chunk-FUG4SFN3.js.map → chunk-RJ6K6K5M.js.map} +0 -0
  287. /package/dist/{chunk-T2FFWNPK.js.map → chunk-RNG4VRP4.js.map} +0 -0
  288. /package/dist/{chunk-JZUV47FZ.js.map → chunk-RTEK4C4I.js.map} +0 -0
  289. /package/dist/{chunk-5YOLBEQ6.js.map → chunk-S6Q37VGE.js.map} +0 -0
  290. /package/dist/{chunk-E5ZQT5KX.js.map → chunk-SMIRGMS7.js.map} +0 -0
  291. /package/dist/{chunk-6T2SCQRU.js.map → chunk-SV6EAJEP.js.map} +0 -0
  292. /package/dist/{chunk-ERJ7FU55.js.map → chunk-T3GY65MA.js.map} +0 -0
  293. /package/dist/{chunk-LXEXBTKL.js.map → chunk-TAGR72IR.js.map} +0 -0
  294. /package/dist/{chunk-JIF24JPM.js.map → chunk-THVIPWRF.js.map} +0 -0
  295. /package/dist/{chunk-ZUODRVHY.js.map → chunk-TIGPQDYP.js.map} +0 -0
  296. /package/dist/{chunk-NWSGI5C7.js.map → chunk-U6JMEH2P.js.map} +0 -0
  297. /package/dist/{chunk-ZICD77GM.js.map → chunk-UC2ETWF3.js.map} +0 -0
  298. /package/dist/{chunk-VLFCJYTL.js.map → chunk-UDSR4X4L.js.map} +0 -0
  299. /package/dist/{chunk-SNZ6URZZ.js.map → chunk-UHNGNKLV.js.map} +0 -0
  300. /package/dist/{chunk-R4ROFEYC.js.map → chunk-VAIS3SOM.js.map} +0 -0
  301. /package/dist/{chunk-VN3DBQAU.js.map → chunk-VCBHAE4R.js.map} +0 -0
  302. /package/dist/{chunk-M4CV6BRT.js.map → chunk-VEALDPHW.js.map} +0 -0
  303. /package/dist/{chunk-AUSTCW2X.js.map → chunk-VKCADNMR.js.map} +0 -0
  304. /package/dist/{chunk-XWZVFISC.js.map → chunk-VRBTNCM4.js.map} +0 -0
  305. /package/dist/{chunk-XDYREZWE.js.map → chunk-W4TCUGQR.js.map} +0 -0
  306. /package/dist/{chunk-HDQIIUPH.js.map → chunk-WHXXI3W5.js.map} +0 -0
  307. /package/dist/{chunk-F64IRYG3.js.map → chunk-WKGF2TJR.js.map} +0 -0
  308. /package/dist/{chunk-CAF6WOK7.js.map → chunk-WNGGJWF7.js.map} +0 -0
  309. /package/dist/{chunk-EXK7QRWF.js.map → chunk-WOM2HTML.js.map} +0 -0
  310. /package/dist/{chunk-Q5VNKNE5.js.map → chunk-WQIYTNJV.js.map} +0 -0
  311. /package/dist/{chunk-GTGPO5KW.js.map → chunk-WZSHL6DQ.js.map} +0 -0
  312. /package/dist/{chunk-CRI4OUV4.js.map → chunk-XDIAFPUM.js.map} +0 -0
  313. /package/dist/{chunk-RYCTDFUX.js.map → chunk-XJMBYYQK.js.map} +0 -0
  314. /package/dist/{chunk-DLG74CNB.js.map → chunk-XTHCN77N.js.map} +0 -0
  315. /package/dist/{chunk-I6GALP6E.js.map → chunk-YCH5GBN6.js.map} +0 -0
  316. /package/dist/{chunk-RZ5SVOYR.js.map → chunk-YTGDPCPW.js.map} +0 -0
  317. /package/dist/{chunk-UNFPPVNI.js.map → chunk-YZQOGE2L.js.map} +0 -0
  318. /package/dist/{chunk-MV43JSJF.js.map → chunk-Z4PD65VQ.js.map} +0 -0
  319. /package/dist/{chunk-YFXZEAYK.js.map → chunk-ZXEZCY6F.js.map} +0 -0
  320. /package/dist/{classified-marker-CZKA6ITE.js.map → classified-marker-QWMASIT7.js.map} +0 -0
  321. /package/dist/{collection-facade-TLWIPI76.js.map → collection-facade-KMBWNCYP.js.map} +0 -0
  322. /package/dist/{computed-ZIQTYTDI.js.map → computed-DSMPXG2Y.js.map} +0 -0
  323. /package/dist/{delegation-W7ZV2322.js.map → cover-QJRXINN5.js.map} +0 -0
  324. /package/dist/{dead-filter-ESOBZZP5.js.map → dead-filter-66VGI6JV.js.map} +0 -0
  325. /package/dist/{derive-H2BJTLUI.js.map → delegation-SU6CV3W7.js.map} +0 -0
  326. /package/dist/{enclave-AP3I5W7O.js.map → derive-6RWU4EOA.js.map} +0 -0
  327. /package/dist/{executor-KGWTNEQD.js.map → enclave-TKPN2G2U.js.map} +0 -0
  328. /package/dist/{executor-OVEXR6RT.js.map → executor-KGNLJD6M.js.map} +0 -0
  329. /package/dist/{executor-UNEH5ZYH.js.map → executor-UX4FASYZ.js.map} +0 -0
  330. /package/dist/{export-accessible-PCMXSUZS.js.map → executor-XGIS6CR7.js.map} +0 -0
  331. /package/dist/{extract-partition-SWHFSYJO.js.map → export-accessible-LKW3QV22.js.map} +0 -0
  332. /package/dist/{find-N6345CNT.js.map → extract-partition-UP2ARO75.js.map} +0 -0
  333. /package/dist/{fanout-sidecar-A765THMX.js.map → fanout-sidecar-B5LVUMQX.js.map} +0 -0
  334. /package/dist/{issue-5OKB6I2R.js.map → find-YS6XWB46.js.map} +0 -0
  335. /package/dist/{ledger-GFBKVPV4.js.map → issue-3ACYX7LO.js.map} +0 -0
  336. /package/dist/{liberate-3VDOT4KO.js.map → ledger-PTK7XZYT.js.map} +0 -0
  337. /package/dist/{link-set-Z7Q2ASFX.js.map → liberate-MQQXBUCY.js.map} +0 -0
  338. /package/dist/{noydb-ZCJOYBDI.js.map → link-set-SLJHDNRB.js.map} +0 -0
  339. /package/dist/{policy-Z3RUAIY2.js.map → noydb-ANIW5FLE.js.map} +0 -0
  340. /package/dist/{public-envelope-B4KNWVUA.js.map → policy-YDLCOX4P.js.map} +0 -0
  341. /package/dist/{post-register-JTH76BLY.js.map → post-register-2YHSADFI.js.map} +0 -0
  342. /package/dist/{register-VAHONCID.js.map → register-PAM3ASRZ.js.map} +0 -0
  343. /package/dist/{registry-7MLVD3VO.js.map → registry-4S2U2TR4.js.map} +0 -0
  344. /package/dist/{registry-EPKPD5SM.js.map → registry-NPOWJHC4.js.map} +0 -0
  345. /package/dist/{registry-P5T7PS2U.js.map → registry-VZ3CCI2R.js.map} +0 -0
  346. /package/dist/{request-withdrawal-TI3A5WPS.js.map → request-withdrawal-DI3H5WUI.js.map} +0 -0
  347. /package/dist/{reveal-DIBHLUZX.js.map → reveal-HWO4YMTJ.js.map} +0 -0
  348. /package/dist/{revoke-FDRD6GRW.js.map → revoke-R5CZSVUT.js.map} +0 -0
  349. /package/dist/{seed-Q6M2IZFL.js.map → seed-3ZMF5EQA.js.map} +0 -0
  350. /package/dist/{signer-MUWEIUI6.js.map → signer-MBVHW4WE.js.map} +0 -0
  351. /package/dist/{stale-OSQ7J3AA.js.map → stale-VZL4OGUB.js.map} +0 -0
  352. /package/dist/{storage-MVFCGEQE.js.map → storage-3MEJUENZ.js.map} +0 -0
  353. /package/dist/{store-coordination-provider-64OEZFGS.js.map → store-coordination-provider-FKX3F6TQ.js.map} +0 -0
  354. /package/dist/{verify-ZASTRNPR.js.map → verify-26Y5GNMK.js.map} +0 -0
  355. /package/dist/{walk-SVNDIZ62.js.map → walk-IPLXE36W.js.map} +0 -0
  356. /package/dist/{withdraw-accessible-WZIEVWSR.js.map → withdraw-accessible-TZDATQVR.js.map} +0 -0
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  isDeleteMarker,
3
3
  isTombstone
4
- } from "./chunk-7DSTRQIJ.js";
4
+ } from "./chunk-A4FXFAKF.js";
5
5
  import {
6
6
  blindedEqual,
7
7
  openVdigPayload,
8
8
  sealVdigPayload
9
- } from "./chunk-HB3RFQSC.js";
9
+ } from "./chunk-IY23KFNZ.js";
10
10
  import {
11
11
  dualReadSealedSlot,
12
12
  parseSealedSlot
13
- } from "./chunk-JKJOGPZN.js";
13
+ } from "./chunk-N6WF5PKC.js";
14
14
  import {
15
15
  mintBidxTag
16
- } from "./chunk-5M5DVGV7.js";
16
+ } from "./chunk-6HY2X62D.js";
17
17
  import {
18
18
  VDIG_ITERATIONS,
19
19
  normalizeForVerify,
@@ -32,11 +32,11 @@ import {
32
32
  generateSalt,
33
33
  unwrapCek,
34
34
  wrapCek
35
- } from "./chunk-CIE2BASH.js";
35
+ } from "./chunk-HOONYZY2.js";
36
36
  import {
37
37
  NOYDB_FORMAT_VERSION,
38
38
  SealedHandle
39
- } from "./chunk-JNAI2HN2.js";
39
+ } from "./chunk-VCTXU4AT.js";
40
40
  import {
41
41
  ClassifiedConfigError,
42
42
  ClassifiedRotationError,
@@ -45,7 +45,7 @@ import {
45
45
  SchemaValidationError,
46
46
  TamperedError,
47
47
  ValidationError
48
- } from "./chunk-BIOUI4HL.js";
48
+ } from "./chunk-W2OG6JOL.js";
49
49
 
50
50
  // src/kernel/enclave/record-keys/lifecycle.ts
51
51
  async function resolveStableCek(deps, id) {
@@ -1125,4 +1125,4 @@ export {
1125
1125
  issueChallenge,
1126
1126
  verifyBrokerProof
1127
1127
  };
1128
- //# sourceMappingURL=chunk-XDYREZWE.js.map
1128
+ //# sourceMappingURL=chunk-W4TCUGQR.js.map
@@ -1,20 +1,25 @@
1
1
  import {
2
2
  putDerivedOutput
3
- } from "./chunk-4CTHCN4J.js";
3
+ } from "./chunk-LVGTA624.js";
4
4
  import {
5
5
  wrapDbWithPredicates
6
- } from "./chunk-KSKBRKGJ.js";
6
+ } from "./chunk-S3BFKGET.js";
7
+ import {
8
+ DEFAULT_JOIN_MAX_ROWS
9
+ } from "./chunk-RA5VTXXG.js";
7
10
  import {
8
11
  canonicalGroupKey,
9
12
  groupAndReduce
10
- } from "./chunk-LXEXBTKL.js";
13
+ } from "./chunk-TAGR72IR.js";
11
14
  import {
12
15
  applyI18nLocale
13
- } from "./chunk-6JTIAGHD.js";
16
+ } from "./chunk-GULTLPFB.js";
14
17
  import {
18
+ JoinTooLargeError,
15
19
  LocaleNotSpecifiedError,
20
+ MaterializedViewConfigError,
16
21
  MaterializedViewTooLargeError
17
- } from "./chunk-BIOUI4HL.js";
22
+ } from "./chunk-W2OG6JOL.js";
18
23
 
19
24
  // src/with-formula/materialized-views/executor.ts
20
25
  var DEFAULT_MAX_ROWS = 1e5;
@@ -51,6 +56,9 @@ async function materializeUnionResult(spec, db) {
51
56
  unified.push(mapped);
52
57
  }
53
58
  }
59
+ return finalizeMappedRows(spec, unified);
60
+ }
61
+ function finalizeMappedRows(spec, unified) {
54
62
  if (!spec.groupBy) return unified;
55
63
  const groupFields = typeof spec.groupBy === "string" ? [spec.groupBy] : spec.groupBy;
56
64
  if (spec.i18nLocale !== void 0 && spec.i18nFields !== void 0) {
@@ -86,6 +94,73 @@ async function materializeUnionResult(spec, db) {
86
94
  }
87
95
  return groupAndReduce(unified, groupFields, spec.aggregate, spec.moneyFields);
88
96
  }
97
+ async function materializeProjectionResult(spec, db) {
98
+ const projection = spec.projection;
99
+ const coll = db.collection(projection.source);
100
+ let q = coll.query();
101
+ for (const leg of projection.joins) {
102
+ if ("collect" in leg) continue;
103
+ q = q.join(leg.field, { as: leg.as, maxRows: leg.maxRows, strategy: leg.strategy });
104
+ }
105
+ let rows = q.toArray();
106
+ for (const leg of projection.joins) {
107
+ if (!("collect" in leg)) continue;
108
+ rows = applyCollectLeg(rows, leg, spec.name, projection.source, db);
109
+ }
110
+ const mapped = [];
111
+ for (const r of rows) {
112
+ const m = projection.map(r);
113
+ if (m == null) continue;
114
+ mapped.push(m);
115
+ }
116
+ return finalizeMappedRows(spec, mapped);
117
+ }
118
+ function applyCollectLeg(primaryRows, leg, mvName, source, db) {
119
+ const childColl = db.collection(leg.collect);
120
+ const childQ = childColl.query();
121
+ const refDesc = childQ._joinContext?.()?.resolveRef(leg.on);
122
+ if (refDesc == null) {
123
+ throw new MaterializedViewConfigError(
124
+ `"${mvName}": projection collect leg "${leg.as}" requires a ref() on field "${leg.on}" of collection "${leg.collect}" targeting "${source}" \u2014 declare refs: { ${leg.on}: ref('${source}') } on collection "${leg.collect}", then retry`
125
+ );
126
+ }
127
+ if (refDesc.target !== source) {
128
+ throw new MaterializedViewConfigError(
129
+ `"${mvName}": projection collect leg "${leg.as}" expects field "${leg.on}" of collection "${leg.collect}" to reference the projection source "${source}", but its ref() targets "${refDesc.target}"`
130
+ );
131
+ }
132
+ const maxRows = leg.maxRows ?? DEFAULT_JOIN_MAX_ROWS;
133
+ const groups = /* @__PURE__ */ new Map();
134
+ for (const child of childQ.toArray()) {
135
+ const key = coerceCollectKey(child[leg.on]);
136
+ if (key === null) continue;
137
+ const bucket = groups.get(key);
138
+ if (bucket) bucket.push(child);
139
+ else groups.set(key, [child]);
140
+ }
141
+ const out = [];
142
+ for (const row of primaryRows) {
143
+ const key = coerceCollectKey(row.id);
144
+ const children = key === null ? [] : groups.get(key) ?? [];
145
+ if (children.length > maxRows) {
146
+ throw new JoinTooLargeError({
147
+ leftRows: primaryRows.length,
148
+ rightRows: children.length,
149
+ maxRows,
150
+ side: "right",
151
+ message: `projection MV "${mvName}": collect leg "${leg.as}" gathered ${children.length} "${leg.collect}" rows for one "${source}" record, exceeding the ${maxRows}-row per-primary-row ceiling. Raise the ceiling via { maxRows } on the leg if the fan-out genuinely fits in memory, or restructure the child collection.`
152
+ });
153
+ }
154
+ out.push({ ...row, [leg.as]: children });
155
+ }
156
+ return out;
157
+ }
158
+ function coerceCollectKey(value) {
159
+ if (value === null || value === void 0) return null;
160
+ if (typeof value === "string") return value;
161
+ if (typeof value === "number" || typeof value === "bigint") return String(value);
162
+ return null;
163
+ }
89
164
  var MaterializedViewExecutor = {
90
165
  async refresh(reg, accessor) {
91
166
  const spec = reg.spec;
@@ -98,6 +173,8 @@ var MaterializedViewExecutor = {
98
173
  let rows;
99
174
  if (spec.unionSources) {
100
175
  rows = await materializeUnionResult(spec, ctxForQuery);
176
+ } else if (spec.projection) {
177
+ rows = await materializeProjectionResult(spec, ctxForQuery);
101
178
  } else {
102
179
  const q = spec.query(ctxForQuery);
103
180
  rows = await materializeQueryResult(q, spec.name, spec.i18nLocale, spec.i18nFields);
@@ -203,4 +280,4 @@ async function listOutputIds(outputColl) {
203
280
  export {
204
281
  MaterializedViewExecutor
205
282
  };
206
- //# sourceMappingURL=chunk-FM3G3NOY.js.map
283
+ //# sourceMappingURL=chunk-WG4QBZDN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-formula/materialized-views/executor.ts"],"sourcesContent":["import type { Collection } from '../../kernel/collection.js'\nimport type { TxContext } from '../../with-commit/tx/transaction.js'\nimport type { EncryptedEnvelope } from '../../kernel/types.js'\nimport { MaterializedViewTooLargeError, MaterializedViewConfigError, LocaleNotSpecifiedError, JoinTooLargeError } from '../../kernel/errors.js'\nimport { DEFAULT_JOIN_MAX_ROWS } from '../../kernel/query/join.js'\nimport type { MaterializedFromMeta, MVQueryContext, MaterializedViewStrategy } from './types.js'\nimport type { RegisteredMV } from './registry.js'\nimport { wrapDbWithPredicates } from './registry.js'\nimport { groupAndReduce } from '../../with-lookup/aggregate/groupby.js'\nimport { canonicalGroupKey } from '../../with-lookup/aggregate/canonical-key.js'\nimport { applyI18nLocale, type I18nTextDescriptor } from '../../via/i18n/core.js'\nimport { putDerivedOutput, type PutDerivedOutputCtx } from '../../kernel/via/dispatch.js'\n\n/**\n * Accessor shape passed in from the owning Vault. Mirrors v1's\n * `DerivationStaleAccessor` — provides the per-collection resolver\n * and the active TxContext so refresh writes/tombstones register on\n * `_executed` for rollback symmetry.\n */\nexport interface MVExecutorAccessor {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getCollection(name: string): Collection<any>\n getActiveTxContext(): TxContext | null\n /**\n * Vault-shaped accessor passed to the MV's `query()` callback at\n * each refresh. Same instance the registry used at registration\n * time; threading through the executor lets the refresh path\n * re-evaluate the closure against the live vault state.\n */\n getQueryContext(): MVQueryContext\n /**\n * #638 Task 5 — ctx for `putDerivedOutput`'s frozen-period skip+audit. #641: the lazy\n * resolve-on-read caller (`stale.ts#resolveStaleMVOnRead`) now supplies one too — built at\n * the `Collection.get()`/`list()` entry point with a `'resolve-on-read'` sentinel id (no\n * real \"reacting write\" for a read-triggered materialize, mirroring `refreshView()`'s\n * `'refreshView'` sentinel). Still declared optional here since `MVExecutorAccessor` is a\n * general shape and a future caller could reasonably omit it.\n */\n dispatchCtx?: PutDerivedOutputCtx\n}\n\nexport interface RefreshResult {\n /** Rows newly written / overwritten. */\n written: number\n /** Rows tombstoned via `_internalDelete` (only when `onEmpty: 'delete'`). */\n deleted: number\n /** Failed row writes (non-strict mode). */\n failed: number\n /** #782/#785 — `outputCollection:id` entries from the tombstone pass whose ownership stamp\n * couldn't be decoded under the collection's default DEK (undecodable, mirroring\n * `invalidateMVAtRest`'s #776 posture) — ownership UNCONFIRMED. Only populated when\n * `onEmpty: 'delete'`. */\n residueUndecodable: string[]\n /** #782/#785 — `outputCollection:id` entries that decoded, stamp-matched this MV, but\n * `_internalDelete` declined (the #718 tier-elevation gate) — ownership CONFIRMED, a real\n * silent survival, surfaced rather than dropped. Only populated when `onEmpty: 'delete'`. */\n residueDeclined: string[]\n}\n\n/** Default cost ceiling — overridable per-MV via `spec.maxRows`. */\nconst DEFAULT_MAX_ROWS = 100_000\n\n/**\n * Materialize a query terminal that may be a `Query<T>` (call\n * `.toArray()`), an `Aggregation<R>` (call `.run()` returning a\n * single object — wrap as a one-row array), or a `GroupedAggregation<R>`\n * (call `.run()` returning an array of grouped rows). Branches on\n * available terminal at runtime — no type-discrimination at registration.\n */\nasync function materializeQueryResult(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n q: any,\n mvName: string,\n i18nLocale?: string,\n i18nFields?: Record<string, I18nTextDescriptor>,\n): Promise<ReadonlyArray<Record<string, unknown>>> {\n if (typeof q?.toArray === 'function') {\n // Query<T> — non-aggregate path. `.toArray()` returns Promise<T[]>.\n return await q.toArray()\n }\n if (typeof q?.run === 'function') {\n // Aggregation<R> or GroupedAggregation<R>. `.run()` is synchronous\n // and returns either a single object (Aggregation) or an array of\n // rows (GroupedAggregation). Promise.resolve() normalizes both\n // sync and async (future) variants.\n // Query-form MV grouping: when the MV declares i18nLocale, pass it +\n // i18nFields so a GroupedAggregation resolves i18n group keys before\n // bucketing (the Aggregation path ignores the extra arg).\n const runOpts = i18nLocale !== undefined ? { locale: i18nLocale, i18nFields } : undefined\n const result: unknown = await Promise.resolve(q.run(runOpts))\n if (Array.isArray(result)) {\n return result as ReadonlyArray<Record<string, unknown>>\n }\n // Single-aggregate result — wrap as one-row array. The consumer's\n // `rowKey()` should return a stable identity (often a literal\n // constant like `'total'`) since there's only one row.\n return [result as Record<string, unknown>]\n }\n throw new Error(\n `MV \"${mvName}\": query() must return a Query<T>, Aggregation, or GroupedAggregation. ` +\n `Got something without a .toArray() or .run() terminal.`,\n )\n}\n\n/**\n * Materialize a UNION-form MV: read every arm's source\n * collection, apply each arm's `map` to project rows into the unified\n * MV row shape, concatenate the mapped streams, then optionally run\n * `groupBy` + `aggregate` over the result.\n *\n * Modes (driven by `spec.groupBy` / `spec.aggregate`):\n *\n * - No `groupBy` → return the concatenated mapped rows unchanged.\n * - `groupBy` without `aggregate` → dedupe by composite group key,\n * keep the first row seen per key (later arms don't overwrite\n * earlier arms — Map insertion order rules).\n * - `groupBy` + `aggregate` → delegate to the shared `groupAndReduce`\n * pipeline used by `Query.groupBy().aggregate()`.\n *\n * Per-arm `map` is the schema-unification boundary; the strategy's\n * `TRow` type parameter enforces that every arm projects into the\n * same shape at compile time.\n *\n * @internal\n */\nasync function materializeUnionResult<TRow extends Record<string, unknown>>(\n spec: MaterializedViewStrategy<TRow>,\n db: MVQueryContext,\n): Promise<ReadonlyArray<Record<string, unknown>>> {\n const unified: TRow[] = []\n for (const arm of spec.unionSources!) {\n const coll = db.collection<Record<string, unknown>>(arm.collection)\n // Optional per-arm FK joins: chain `.join(field, { as, ... })` for\n // each declared leg before terminating. The aliased right-side\n // record lands at `sourceRow[leg.as]`, where the arm's `map` reads\n // it. Cast to `any` because the chained join widens the row type but\n // the executor treats every row as `Record<string, unknown>` — same\n // pattern the query-form join path uses.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let q: any = coll.query()\n if (arm.join?.length) {\n for (const leg of arm.join) {\n q = q.join(leg.field, { as: leg.as, maxRows: leg.maxRows, strategy: leg.strategy })\n }\n }\n const sourceRows = q.toArray() as ReadonlyArray<Record<string, unknown>>\n for (const r of sourceRows) {\n const mapped = arm.map(r)\n // null / undefined means \"omit this source row\" — skip without\n // pushing so groupBy/aggregate never see a null entry.\n if (mapped == null) continue\n unified.push(mapped)\n }\n }\n\n return finalizeMappedRows(spec, unified)\n}\n\n/**\n * Shared post-map tail for the UNION and projection (#810) forms:\n * optional `groupBy` (+ `aggregate`) over the mapped-row stream.\n * Extracted verbatim from `materializeUnionResult` so both forms feed\n * the identical grouping pipeline — i18n group-key resolution, the\n * object-group-key guard, dedup-without-aggregate, and the shared\n * `groupAndReduce` delegate.\n *\n * @internal\n */\nfunction finalizeMappedRows<TRow extends Record<string, unknown>>(\n spec: MaterializedViewStrategy<TRow>,\n unified: TRow[],\n): ReadonlyArray<Record<string, unknown>> {\n if (!spec.groupBy) return unified\n\n const groupFields: readonly string[] =\n typeof spec.groupBy === 'string' ? [spec.groupBy] : spec.groupBy\n\n // i18n-aware group keys. An `i18nText` group field carries a raw\n // `{ locale: string }` map, an unstable object key. When `i18nLocale` is\n // declared (with `i18nFields` describing those fields), resolve the declared\n // group-key i18n fields to it at the `mv` layer FIRST — the same unified-rows\n // boundary where money is threaded — so buckets are stable strings and the\n // `mv`-layer `onMissing` policy fires here.\n if (spec.i18nLocale !== undefined && spec.i18nFields !== undefined) {\n const groupI18n: Record<string, I18nTextDescriptor> = {}\n for (const f of groupFields) {\n const d = spec.i18nFields[f]\n if (d !== undefined) groupI18n[f] = d\n }\n if (Object.keys(groupI18n).length > 0) {\n for (let i = 0; i < unified.length; i++) {\n unified[i] = applyI18nLocale(unified[i] as Record<string, unknown>, groupI18n, spec.i18nLocale, undefined, 'mv') as TRow\n }\n }\n }\n // Guard (always): a remaining object-valued group key — an undeclared i18n\n // field or a locale-less MV — would bucket on a map. Refuse, don't bucket wrong.\n for (const f of groupFields) {\n for (const row of unified) {\n const v = (row as Record<string, unknown>)[f]\n if (v !== null && typeof v === 'object') {\n throw new LocaleNotSpecifiedError(\n f,\n `Materialized view \"${spec.name}\" groups by \"${f}\", whose value is a raw i18n locale map — ` +\n `an unstable object group key. Declare { i18nLocale, i18nFields } on the MV to resolve it at ` +\n `the 'mv' layer, or group by a dictKey/staticDict code (the stable key) and resolve the label at read time.`,\n )\n }\n }\n }\n\n // groupBy without aggregate — dedupe by composite key, keep first\n // seen row per key. Useful for cross-arm uniqueness (e.g. unify two\n // sibling collections, keeping one row per natural key).\n if (!spec.aggregate) {\n const seen = new Map<string, TRow>()\n for (const row of unified) {\n const k = canonicalGroupKey(groupFields, row as Record<string, unknown>)\n if (!seen.has(k)) seen.set(k, row)\n }\n return [...seen.values()]\n }\n\n // groupBy + aggregate — delegate to the shared pipeline used by\n // `Query.groupBy().aggregate()`. Result rows carry each grouped\n // field in declaration order followed by the spec's reducer outputs.\n return groupAndReduce<Record<string, unknown>>(unified, groupFields, spec.aggregate, spec.moneyFields)\n}\n\n/**\n * Materialize a projection-form MV (#810): hydrate the primary source\n * rows, resolve forward FK legs through the same `.join()` machinery\n * the UNION arms use, attach reverse \"collect\" legs via one\n * hash-grouped snapshot pass per leg, then run the projection `map`\n * (null / undefined omits the primary row) and the shared post-map\n * grouping tail.\n *\n * @internal\n */\nasync function materializeProjectionResult<TRow extends Record<string, unknown>>(\n spec: MaterializedViewStrategy<TRow>,\n db: MVQueryContext,\n): Promise<ReadonlyArray<Record<string, unknown>>> {\n const projection = spec.projection!\n const coll = db.collection<Record<string, unknown>>(projection.source)\n // Forward legs chain through the query builder exactly like UNION arm\n // joins — ref() resolution, dangling-mode semantics, presentation\n // dressing, and ceilings all ride the existing `.join()` path. Cast to\n // `any` for the same reason `materializeUnionResult` does.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let q: any = coll.query()\n for (const leg of projection.joins) {\n if ('collect' in leg) continue\n q = q.join(leg.field, { as: leg.as, maxRows: leg.maxRows, strategy: leg.strategy })\n }\n let rows = q.toArray() as Array<Record<string, unknown>>\n for (const leg of projection.joins) {\n if (!('collect' in leg)) continue\n rows = applyCollectLeg(rows, leg, spec.name, projection.source, db)\n }\n const mapped: TRow[] = []\n for (const r of rows) {\n const m = projection.map(r)\n // null / undefined means \"omit this primary row\" — same contract\n // as the UNION arm `map`.\n if (m == null) continue\n mapped.push(m)\n }\n return finalizeMappedRows(spec, mapped)\n}\n\n/**\n * Attach one reverse \"collect\" leg (#810): every row of `leg.collect`\n * whose `leg.on` field references a primary record's id lands in a\n * possibly-empty ARRAY under `leg.as` on that primary row. One\n * snapshot pass over the collect collection, hash-grouped by the `on`\n * FK — O(N+M), mirroring the forward hash-join fallback.\n *\n * Semantic check (first materialization, not factory time — parity\n * with join-time ref errors): `leg.on` must carry a `ref()` declared\n * on the collect collection targeting the projection `source`.\n *\n * @internal\n */\nfunction applyCollectLeg(\n primaryRows: ReadonlyArray<Record<string, unknown>>,\n leg: { readonly collect: string; readonly on: string; readonly as: string; readonly maxRows?: number },\n mvName: string,\n source: string,\n db: MVQueryContext,\n): Array<Record<string, unknown>> {\n const childColl = db.collection<Record<string, unknown>>(leg.collect)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const childQ = childColl.query() as any\n const refDesc = childQ._joinContext?.()?.resolveRef(leg.on) as { target: string } | null | undefined\n if (refDesc == null) {\n throw new MaterializedViewConfigError(\n `\"${mvName}\": projection collect leg \"${leg.as}\" requires a ref() on field \"${leg.on}\" of `\n + `collection \"${leg.collect}\" targeting \"${source}\" — declare `\n + `refs: { ${leg.on}: ref('${source}') } on collection \"${leg.collect}\", then retry`,\n )\n }\n if (refDesc.target !== source) {\n throw new MaterializedViewConfigError(\n `\"${mvName}\": projection collect leg \"${leg.as}\" expects field \"${leg.on}\" of collection `\n + `\"${leg.collect}\" to reference the projection source \"${source}\", but its ref() targets `\n + `\"${refDesc.target}\"`,\n )\n }\n const maxRows = leg.maxRows ?? DEFAULT_JOIN_MAX_ROWS\n const groups = new Map<string, Array<Record<string, unknown>>>()\n for (const child of childQ.toArray() as Array<Record<string, unknown>>) {\n const key = coerceCollectKey(child[leg.on])\n // Nullish / non-scalar FK values mean \"no reference\" — same\n // narrowing as the forward join path's key coercion.\n if (key === null) continue\n const bucket = groups.get(key)\n if (bucket) bucket.push(child)\n else groups.set(key, [child])\n }\n const out: Array<Record<string, unknown>> = []\n for (const row of primaryRows) {\n const key = coerceCollectKey(row.id)\n const children = key === null ? [] : groups.get(key) ?? []\n if (children.length > maxRows) {\n throw new JoinTooLargeError({\n leftRows: primaryRows.length,\n rightRows: children.length,\n maxRows,\n side: 'right',\n message:\n `projection MV \"${mvName}\": collect leg \"${leg.as}\" gathered ${children.length} ` +\n `\"${leg.collect}\" rows for one \"${source}\" record, exceeding the ${maxRows}-row ` +\n `per-primary-row ceiling. Raise the ceiling via { maxRows } on the leg if the ` +\n `fan-out genuinely fits in memory, or restructure the child collection.`,\n })\n }\n out.push({ ...row, [leg.as]: children })\n }\n return out\n}\n\n/**\n * Coerce an unknown FK value into a collect-grouping key. Same\n * narrowing as the join path's `coerceRefKey` (not exported from\n * there): strings and numbers are legitimate ref values; anything\n * else is \"no reference\" and returns `null`.\n *\n * @internal\n */\nfunction coerceCollectKey(value: unknown): string | null {\n if (value === null || value === undefined) return null\n if (typeof value === 'string') return value\n if (typeof value === 'number' || typeof value === 'bigint') return String(value)\n return null\n}\n\n/**\n * Run an MV's `query()` and write the result rows to the output\n * collection. Same-DEK encryption: routes through the standard\n * `Collection.put` pipeline, so the output collection's DEK is what\n * gets used (matches the v2 spec's \"same DEK as the left-most source\"\n * invariant — `Collection.put` looks up the DEK by collection name,\n * and the output collection IS the MV's owned collection).\n *\n * Stamps `_materializedFrom` onto every emitted row.\n *\n * **Tombstoning:** when `spec.onEmpty: 'delete'` (default), rows\n * that existed in a prior refresh but no longer appear in the new\n * materialized result are deleted via `Collection._internalDelete` —\n * the housekeeping bypass primitive prevents user\n * `onDelete` guards on the output collection from firing on these\n * system-internal deletes. `onEmpty: 'keep'` opts out (rows from\n * prior refreshes linger even when the new result lacks them).\n *\n * **Cost ceiling:** if the materialized row count exceeds\n * `spec.maxRows` (default 100k), throws `MaterializedViewTooLargeError`\n * before any writes hit the store — so strict-mode rollback is\n * clean.\n *\n * **Strict mode:** `spec.strict === true` re-throws on any\n * row-write failure; the active TxContext registration means the\n * source-write rolls back atomically via `revertExecuted`.\n *\n * @internal\n */\nexport const MaterializedViewExecutor = {\n async refresh(\n reg: RegisteredMV,\n accessor: MVExecutorAccessor,\n ): Promise<RefreshResult> {\n const spec = reg.spec\n const outputColl = accessor.getCollection(reg.outputCollection)\n const maxRows = spec.maxRows ?? DEFAULT_MAX_ROWS\n const onEmpty = spec.onEmpty ?? 'delete'\n const strict = spec.strict ?? false\n\n // 1. Materialize the query (branches on terminal shape). If the\n // MV declared predicates, wrap the query context the same way\n // the registry did at registration time so `.wherePredicate()`\n // calls resolve to the registered functions.\n const baseCtx = accessor.getQueryContext()\n const ctxForQuery: MVQueryContext = spec.predicates\n ? wrapDbWithPredicates(baseCtx, spec.predicates)\n : baseCtx\n // UNION-form strategies: read every arm, map to the unified\n // row shape, concatenate, then optionally groupBy + aggregate.\n // Projection-form strategies (#810): hydrate the primary source,\n // attach forward + collect legs, map, then the same optional\n // grouping tail. The single-source `query()` path is untouched.\n let rows: ReadonlyArray<Record<string, unknown>>\n if (spec.unionSources) {\n rows = await materializeUnionResult(spec, ctxForQuery)\n } else if (spec.projection) {\n rows = await materializeProjectionResult(spec, ctxForQuery)\n } else {\n const q = spec.query!(ctxForQuery)\n rows = await materializeQueryResult(q, spec.name, spec.i18nLocale, spec.i18nFields)\n }\n\n // #777 — exclude this MV's OWN previously-stamped output rows from the\n // input scan. A same-collection Query-form MV copies the whole source row\n // verbatim into its output, so a stale output row can itself satisfy the\n // MV's own input filter (when the filter is on a field disjoint from the\n // partition field) and get re-selected as if it were live source — the\n // row self-perpetuates after its true source is gone. Prior output is\n // never this MV's own source.\n rows = rows.filter((row) => {\n const stamp = row._materializedFrom as { mvName?: string } | undefined\n return stamp?.mvName !== spec.name\n })\n\n // 2. Cost ceiling check BEFORE any writes — keeps the rollback\n // clean if the source-write is wrapped in a transaction.\n if (rows.length > maxRows) {\n throw new MaterializedViewTooLargeError(spec.name, rows.length, maxRows)\n }\n\n const txCtx = accessor.getActiveTxContext()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const adapter = (outputColl as any).adapter as {\n get(v: string, c: string, i: string): Promise<EncryptedEnvelope | null>\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const vaultName = (outputColl as any).vault as string\n\n // 3. Compute the post-refresh id set so we can diff against the\n // prior-emitted id set for tombstoning (when onEmpty === 'delete').\n const newIds = new Set<string>()\n const enrichedRows: Array<{ id: string; record: Record<string, unknown> }> = []\n for (const row of rows) {\n const id = spec.rowKey(row)\n newIds.add(id)\n const meta: MaterializedFromMeta = {\n mvName: spec.name,\n queryHash: reg.queryHash,\n sourceVersions: {},\n materializedAt: new Date().toISOString(),\n }\n enrichedRows.push({ id, record: { ...row, _materializedFrom: meta } })\n }\n\n // 4. Write the new rows.\n let written = 0\n let failed = 0\n for (const { id, record } of enrichedRows) {\n try {\n if (txCtx !== null) {\n const prior = await adapter.get(vaultName, reg.outputCollection, id)\n txCtx._executed.push({\n op: { type: 'put', vaultName, collectionName: reg.outputCollection, id },\n priorEnvelope: prior,\n })\n }\n if (accessor.dispatchCtx) {\n if (await putDerivedOutput(outputColl, id, record, accessor.dispatchCtx) === 'written') written++\n } else {\n await outputColl.put(id, record)\n written++\n }\n } catch (err) {\n failed++\n if (strict) throw err\n \n console.warn(`[mv] \"${spec.name}\" row write failed:`, err)\n }\n }\n\n // 5. Tombstone rows that existed before but don't appear now.\n // `onEmpty: 'keep'` skips this pass entirely. Uses\n // `_internalDelete` so a user-registered `onDelete` on the\n // output collection does NOT fire on housekeeping (composition fix).\n let deleted = 0\n const residueUndecodable: string[] = []\n const residueDeclined: string[] = []\n if (onEmpty === 'delete') {\n const priorIds = await listOutputIds(outputColl)\n for (const priorId of priorIds) {\n if (newIds.has(priorId)) continue\n // #762 — a same-collection partition MV (`output: { collection: <source>, partition }`,\n // the DERIV-PP30-001 shape) writes INTO its own source collection, so `listOutputIds`\n // also returns untouched USER source rows here. Decode each candidate and only\n // tombstone rows THIS MV stamped via `_materializedFrom.mvName` — the exact discipline\n // `invalidateMVAtRest` uses (stale.ts:151-162). An unstamped row, or one stamped by a\n // different MV, is never this MV's to delete.\n const priorEnvelope = await adapter.get(vaultName, reg.outputCollection, priorId)\n if (priorEnvelope === null) continue\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const priorDecoded = await (outputColl as any)._decodeEnvelope(priorEnvelope, priorId)\n if (priorDecoded === null) {\n // #782 part a — ownership unknown (undecodable, e.g. elevated above tier 0 on a\n // tiered output collection): can't rule out this being THIS MV's own stamped row.\n // Surface it rather than silently skip (mirrors invalidateMVAtRest's #776 posture —\n // previously this leg had NO residue channel at all).\n residueUndecodable.push(`${reg.outputCollection}:${priorId}`)\n continue\n }\n const priorStampedBy =\n typeof priorDecoded === 'object'\n ? (priorDecoded as Record<string, unknown>)._materializedFrom as { mvName?: string } | undefined\n : undefined\n if (priorStampedBy?.mvName !== spec.name) continue\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const outAny = outputColl as any\n if (typeof outAny._internalDelete === 'function') {\n // #776 part b — gate on the boolean, matching invalidateMVAtRest's discipline\n // (stale.ts): `_internalDelete` returns `false` for a #718 elevated-skip (no\n // erasure happened), and that must not inflate the tombstone count.\n if (await outAny._internalDelete(priorId, txCtx)) {\n deleted++\n } else {\n // #782 part b — decoded AND stamp-owned, but erasure was declined (#718\n // tier-elevation gate). Ownership IS confirmed here — a real silent survival,\n // not a legit stamp-mismatch skip. Surface it too.\n residueDeclined.push(`${reg.outputCollection}:${priorId}`)\n }\n } else {\n // Defensive fallback — should never hit in real flow since\n // every Collection has `_internalDelete`.\n await outputColl.delete(priorId)\n deleted++\n }\n } catch (err) {\n failed++\n if (strict) throw err\n\n console.warn(`[mv] \"${spec.name}\" tombstone failed for id=\"${priorId}\":`, err)\n }\n }\n }\n\n return { written, deleted, failed, residueUndecodable, residueDeclined }\n },\n}\n\n/**\n * List ids currently present in the MV's output collection via the\n * adapter directly (avoids triggering the lazy resolve-on-read path\n * we're INSIDE). Returns an empty array if the collection doesn't\n * exist or the adapter doesn't surface a list method.\n *\n * @internal\n */\nasync function listOutputIds(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n outputColl: Collection<any>,\n): Promise<string[]> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const cAny = outputColl as any\n const adapter = cAny.adapter as { list?: (v: string, c: string) => Promise<readonly string[]> }\n const vault = cAny.vault as string\n const name = cAny.name as string\n if (typeof adapter?.list !== 'function') return []\n try {\n const ids = await adapter.list(vault, name)\n return [...ids]\n } catch {\n return []\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA4DA,IAAM,mBAAmB;AASzB,eAAe,uBAEb,GACA,QACA,YACA,YACiD;AACjD,MAAI,OAAO,GAAG,YAAY,YAAY;AAEpC,WAAO,MAAM,EAAE,QAAQ;AAAA,EACzB;AACA,MAAI,OAAO,GAAG,QAAQ,YAAY;AAQhC,UAAM,UAAU,eAAe,SAAY,EAAE,QAAQ,YAAY,WAAW,IAAI;AAChF,UAAM,S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;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RecordCodec
3
- } from "./chunk-XDYREZWE.js";
3
+ } from "./chunk-W4TCUGQR.js";
4
4
 
5
5
  // src/with-formula/materialized-views/stale.ts
6
6
  var _staleByRegistry = /* @__PURE__ */ new WeakMap();
@@ -100,7 +100,7 @@ async function resolveStaleMVOnRead(accessor, outputCollection, dispatchCtx) {
100
100
  continue;
101
101
  }
102
102
  if (executor === null) {
103
- ({ MaterializedViewExecutor: executor } = await import("./executor-UNEH5ZYH.js"));
103
+ ({ MaterializedViewExecutor: executor } = await import("./executor-UX4FASYZ.js"));
104
104
  }
105
105
  for (const dep of reg.dependencies) {
106
106
  await accessor.getCollection(dep).ensureHydrated();
@@ -132,4 +132,4 @@ export {
132
132
  clearMVStale,
133
133
  clearMVStaleFully
134
134
  };
135
- //# sourceMappingURL=chunk-HDQIIUPH.js.map
135
+ //# sourceMappingURL=chunk-WHXXI3W5.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writePod
3
- } from "./chunk-FHS2HQSH.js";
3
+ } from "./chunk-FXZDAV62.js";
4
4
 
5
5
  // src/with-audit/portability/export-accessible.ts
6
6
  function resolveAccessibleCollections(keyring, scope, writableOnly = false) {
@@ -42,4 +42,4 @@ export {
42
42
  buildAccessibleBundle,
43
43
  exportAccessibleData
44
44
  };
45
- //# sourceMappingURL=chunk-F64IRYG3.js.map
45
+ //# sourceMappingURL=chunk-WKGF2TJR.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ValidationError
3
- } from "./chunk-BIOUI4HL.js";
3
+ } from "./chunk-W2OG6JOL.js";
4
4
 
5
5
  // src/with-formula/overlay-views/with-overlayed-view.ts
6
6
  function withOverlayedView(spec) {
@@ -33,4 +33,4 @@ function withOverlayedView(spec) {
33
33
  export {
34
34
  withOverlayedView
35
35
  };
36
- //# sourceMappingURL=chunk-CAF6WOK7.js.map
36
+ //# sourceMappingURL=chunk-WNGGJWF7.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  openEnvelopeJson
3
- } from "./chunk-XDYREZWE.js";
3
+ } from "./chunk-W4TCUGQR.js";
4
4
  import {
5
5
  encrypt
6
- } from "./chunk-CIE2BASH.js";
6
+ } from "./chunk-HOONYZY2.js";
7
7
  import {
8
8
  NOYDB_FORMAT_VERSION
9
- } from "./chunk-JNAI2HN2.js";
9
+ } from "./chunk-VCTXU4AT.js";
10
10
  import {
11
11
  ConflictError
12
- } from "./chunk-BIOUI4HL.js";
12
+ } from "./chunk-W2OG6JOL.js";
13
13
 
14
14
  // src/with-audit/attestation/signer.ts
15
15
  import { generateDocSigningKeyPair } from "@noy-db/attestation";
@@ -56,4 +56,4 @@ export {
56
56
  loadSigner,
57
57
  loadOrCreateSigner
58
58
  };
59
- //# sourceMappingURL=chunk-EXK7QRWF.js.map
59
+ //# sourceMappingURL=chunk-WOM2HTML.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  envelopeBodyForHash
3
- } from "./chunk-XDYREZWE.js";
3
+ } from "./chunk-W4TCUGQR.js";
4
4
  import {
5
5
  sha256Hex
6
- } from "./chunk-CIE2BASH.js";
6
+ } from "./chunk-HOONYZY2.js";
7
7
 
8
8
  // src/with-commit/history/ledger/entry.ts
9
9
  function canonicalJson(value) {
@@ -67,4 +67,4 @@ export {
67
67
  parseIndex,
68
68
  envelopePayloadHash
69
69
  };
70
- //# sourceMappingURL=chunk-Q5VNKNE5.js.map
70
+ //# sourceMappingURL=chunk-WQIYTNJV.js.map
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  ATTESTATIONS_COLLECTION,
3
3
  loadOrCreateSigner
4
- } from "./chunk-EXK7QRWF.js";
4
+ } from "./chunk-WOM2HTML.js";
5
5
  import {
6
6
  generateULID
7
7
  } from "./chunk-ZJADGNYF.js";
8
8
  import {
9
9
  encrypt
10
- } from "./chunk-CIE2BASH.js";
10
+ } from "./chunk-HOONYZY2.js";
11
11
  import {
12
12
  NOYDB_FORMAT_VERSION
13
- } from "./chunk-JNAI2HN2.js";
13
+ } from "./chunk-VCTXU4AT.js";
14
14
  import {
15
15
  AttestationError
16
- } from "./chunk-BIOUI4HL.js";
16
+ } from "./chunk-W2OG6JOL.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-GTGPO5KW.js.map
59
+ //# sourceMappingURL=chunk-WZSHL6DQ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NOYDB_FORMAT_VERSION
3
- } from "./chunk-JNAI2HN2.js";
3
+ } from "./chunk-VCTXU4AT.js";
4
4
 
5
5
  // src/with-party/policy/storage.ts
6
6
  var META_COLLECTION = "_meta";
@@ -39,4 +39,4 @@ export {
39
39
  loadVaultPolicy,
40
40
  saveVaultPolicy
41
41
  };
42
- //# sourceMappingURL=chunk-CRI4OUV4.js.map
42
+ //# sourceMappingURL=chunk-XDIAFPUM.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NOYDB_FORMAT_VERSION
3
- } from "./chunk-JNAI2HN2.js";
3
+ } from "./chunk-VCTXU4AT.js";
4
4
 
5
5
  // src/with-shape/schema-update/fence.ts
6
6
  var FENCE_RECORD_ID = "schema-fence";
@@ -37,4 +37,4 @@ export {
37
37
  loadFence,
38
38
  saveFence
39
39
  };
40
- //# sourceMappingURL=chunk-RYCTDFUX.js.map
40
+ //# sourceMappingURL=chunk-XJMBYYQK.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  canonicalJson,
3
3
  sha256Hex
4
- } from "./chunk-Q5VNKNE5.js";
4
+ } from "./chunk-WQIYTNJV.js";
5
5
  import {
6
6
  PeriodClosedError,
7
7
  ValidationError
8
- } from "./chunk-BIOUI4HL.js";
8
+ } from "./chunk-W2OG6JOL.js";
9
9
 
10
10
  // src/with-audit/periods/periods.ts
11
11
  var PERIODS_COLLECTION = "_periods";
@@ -65,7 +65,7 @@ function validatePeriodName(name, existing) {
65
65
  }
66
66
  async function appendPeriodLedgerEntry(ledger, actor, envelope, name, collection = PERIODS_COLLECTION) {
67
67
  if (!ledger) return;
68
- const { envelopePayloadHash } = await import("./ledger-GFBKVPV4.js");
68
+ const { envelopePayloadHash } = await import("./ledger-PTK7XZYT.js");
69
69
  await ledger.append({
70
70
  op: "put",
71
71
  collection,
@@ -88,4 +88,4 @@ export {
88
88
  validatePeriodName,
89
89
  appendPeriodLedgerEntry
90
90
  };
91
- //# sourceMappingURL=chunk-DLG74CNB.js.map
91
+ //# sourceMappingURL=chunk-XTHCN77N.js.map