@noy-db/hub 0.2.0-pre.12 → 0.2.0-pre.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/aggregate/index.cjs.map +1 -1
  2. package/dist/aggregate/index.d.cts +2 -2
  3. package/dist/aggregate/index.d.ts +2 -2
  4. package/dist/aggregate/index.js +2 -2
  5. package/dist/attestation/index.cjs.map +1 -1
  6. package/dist/attestation/index.d.cts +3 -3
  7. package/dist/attestation/index.d.ts +3 -3
  8. package/dist/attestation/index.js +6 -6
  9. package/dist/blobs/index.cjs.map +1 -1
  10. package/dist/blobs/index.d.cts +4 -4
  11. package/dist/blobs/index.d.ts +4 -4
  12. package/dist/blobs/index.js +5 -5
  13. package/dist/bundle/index.cjs +551 -32
  14. package/dist/bundle/index.cjs.map +1 -1
  15. package/dist/bundle/index.d.cts +5 -5
  16. package/dist/bundle/index.d.ts +5 -5
  17. package/dist/bundle/index.js +9 -9
  18. package/dist/{chunk-P3Z5Y2TS.js → chunk-3OUCWHV6.js} +2 -2
  19. package/dist/{chunk-4BHFNKTP.js → chunk-3XZRRBFW.js} +2 -2
  20. package/dist/{chunk-XSIFXX54.js → chunk-4VCQH32J.js} +2 -2
  21. package/dist/{chunk-CHBXWJZQ.js → chunk-4YDZ7JPZ.js} +2 -2
  22. package/dist/{chunk-B7GGYNKQ.js → chunk-5NISHSBO.js} +2 -2
  23. package/dist/{chunk-O53RIZCC.js → chunk-7TEI2K2A.js} +5 -5
  24. package/dist/{chunk-ZCFS7U4J.js → chunk-AYNF7PVX.js} +2 -2
  25. package/dist/{chunk-GFPR7VJS.js → chunk-C3WRKABE.js} +4 -4
  26. package/dist/{chunk-EKNUBIIQ.js → chunk-CWFQTAD4.js} +4 -4
  27. package/dist/{chunk-P4EDT5ZP.js → chunk-D5Y3HIC6.js} +2 -2
  28. package/dist/{chunk-IUBHXEPJ.js → chunk-E3DIBDKA.js} +2 -2
  29. package/dist/{chunk-WNRGOVLG.js → chunk-FNVFT4HZ.js} +2 -2
  30. package/dist/{chunk-LYNNZEQD.js → chunk-GC4V7RU7.js} +1 -1
  31. package/dist/chunk-GC4V7RU7.js.map +1 -0
  32. package/dist/{chunk-5ARRXIVR.js → chunk-GL3Z7LH7.js} +2 -2
  33. package/dist/{chunk-WUG3E423.js → chunk-GZJ5JBED.js} +4 -4
  34. package/dist/{chunk-XHM2SARW.js → chunk-HHZ77DHM.js} +3 -3
  35. package/dist/{chunk-SJJQKNMP.js → chunk-HQXOEWLZ.js} +4 -4
  36. package/dist/{chunk-CILT6V3V.js → chunk-ILWQGTNH.js} +2 -2
  37. package/dist/{chunk-RRDWXNBQ.js → chunk-J67BP5EP.js} +3 -3
  38. package/dist/{chunk-HLGDYFWR.js → chunk-JPOQMXGT.js} +2 -2
  39. package/dist/{chunk-IEPT7HVP.js → chunk-JWFNOD2T.js} +2 -2
  40. package/dist/{chunk-BXOUVUES.js → chunk-KHQ3N5AB.js} +4 -4
  41. package/dist/{chunk-UA6G45ME.js → chunk-KJF7EPUE.js} +3 -3
  42. package/dist/{chunk-C2CIIQRG.js → chunk-KKB42D3Q.js} +2 -2
  43. package/dist/{chunk-M45IRXDM.js → chunk-M6KXHRIA.js} +3 -3
  44. package/dist/{chunk-VOXMU6LB.js → chunk-NIUXQDWD.js} +2 -2
  45. package/dist/{chunk-UOC7JMZO.js → chunk-NJMKHRQI.js} +135 -10
  46. package/dist/chunk-NJMKHRQI.js.map +1 -0
  47. package/dist/{chunk-AGRC7NQQ.js → chunk-NKGY3C53.js} +26 -1
  48. package/dist/chunk-NKGY3C53.js.map +1 -0
  49. package/dist/{chunk-LWSD4QPT.js → chunk-O2JW656W.js} +3 -3
  50. package/dist/{chunk-TMHJEYW7.js → chunk-P5MW7BG2.js} +302 -137
  51. package/dist/chunk-P5MW7BG2.js.map +1 -0
  52. package/dist/{chunk-LSEW3ZZ2.js → chunk-PW26DAXS.js} +3 -3
  53. package/dist/{chunk-HBAJDI2N.js → chunk-QAWCVWCX.js} +5 -5
  54. package/dist/{chunk-L6BYRCYB.js → chunk-QFYVGJLI.js} +2 -2
  55. package/dist/{chunk-6BYBVRZU.js → chunk-QIVFGU2M.js} +3 -3
  56. package/dist/{chunk-ZC7MNVYN.js → chunk-SJ24GHID.js} +2 -2
  57. package/dist/{chunk-SZ4N3IL5.js → chunk-SOU42FGB.js} +5 -5
  58. package/dist/{chunk-DLTU4M2I.js → chunk-SYSKC237.js} +6 -6
  59. package/dist/{chunk-6AD5TBF2.js → chunk-TDECYU4Y.js} +3 -3
  60. package/dist/{chunk-7JJE3OMJ.js → chunk-TEQGXA7L.js} +5 -5
  61. package/dist/{chunk-RHQYVHFH.js → chunk-UNQEWORI.js} +2 -2
  62. package/dist/{chunk-LOA2VCMS.js → chunk-VAK6NQAK.js} +5 -5
  63. package/dist/{chunk-7LVRIW4G.js → chunk-WQKZIQIL.js} +4 -4
  64. package/dist/{chunk-OPDTLHFA.js → chunk-YWBHS25M.js} +2 -2
  65. package/dist/chunk-ZC7J6ZYV.js +7 -0
  66. package/dist/chunk-ZC7J6ZYV.js.map +1 -0
  67. package/dist/consent/index.cjs.map +1 -1
  68. package/dist/consent/index.d.cts +4 -4
  69. package/dist/consent/index.d.ts +4 -4
  70. package/dist/consent/index.js +3 -3
  71. package/dist/{crypto-AJB72OKN.js → crypto-YXH6SAOW.js} +3 -3
  72. package/dist/{delegation-6FCWDRUS.js → delegation-K5ERUH6A.js} +5 -5
  73. package/dist/derivations/index.cjs.map +1 -1
  74. package/dist/derivations/index.d.cts +5 -5
  75. package/dist/derivations/index.d.ts +5 -5
  76. package/dist/derivations/index.js +4 -4
  77. package/dist/{dev-unlock-D3mpVFRc.d.ts → dev-unlock-BW0GNBEV.d.ts} +1 -1
  78. package/dist/{dev-unlock-ckqa_Nso.d.cts → dev-unlock-a7SOtaV0.d.cts} +1 -1
  79. package/dist/executor-AVJ7UEWA.js +8 -0
  80. package/dist/executor-IQO3KGXQ.js +11 -0
  81. package/dist/executor-VT7TKGE4.js +8 -0
  82. package/dist/{fanout-sidecar-ZSKEQ6NI.js → fanout-sidecar-N6OJX6QR.js} +2 -2
  83. package/dist/guards/index.cjs.map +1 -1
  84. package/dist/guards/index.d.cts +5 -5
  85. package/dist/guards/index.d.ts +5 -5
  86. package/dist/guards/index.js +3 -3
  87. package/dist/{hash-rDSSd_oW.d.cts → hash-B0cLQcq_.d.cts} +1 -1
  88. package/dist/{hash-CTZVkXLx.d.ts → hash-uMNIAAW8.d.ts} +1 -1
  89. package/dist/history/index.cjs.map +1 -1
  90. package/dist/history/index.d.cts +5 -5
  91. package/dist/history/index.d.ts +5 -5
  92. package/dist/history/index.js +5 -5
  93. package/dist/i18n/index.cjs.map +1 -1
  94. package/dist/i18n/index.d.cts +4 -4
  95. package/dist/i18n/index.d.ts +4 -4
  96. package/dist/i18n/index.js +6 -6
  97. package/dist/{immutable-guard-DyD0qg2k.d.ts → immutable-guard-B0h-ipLz.d.ts} +1 -1
  98. package/dist/{immutable-guard-C51vAHuh.d.cts → immutable-guard-BZIcYhYX.d.cts} +1 -1
  99. package/dist/{index-Cmop06zJ.d.cts → index-CUVOMtgg.d.cts} +28 -2
  100. package/dist/{index-CkFHr4OP.d.ts → index-Cqzp4tt9.d.ts} +28 -2
  101. package/dist/index.cjs +567 -35
  102. package/dist/index.cjs.map +1 -1
  103. package/dist/index.d.cts +22 -13
  104. package/dist/index.d.ts +22 -13
  105. package/dist/index.js +59 -40
  106. package/dist/index.js.map +1 -1
  107. package/dist/indexing/index.cjs.map +1 -1
  108. package/dist/indexing/index.js +2 -2
  109. package/dist/issue-ZH27C23Y.js +12 -0
  110. package/dist/{ledger-5JMVF7PY.js → ledger-64TTQMRS.js} +5 -5
  111. package/dist/materialized-views/index.cjs.map +1 -1
  112. package/dist/materialized-views/index.d.cts +5 -5
  113. package/dist/materialized-views/index.d.ts +5 -5
  114. package/dist/materialized-views/index.js +6 -6
  115. package/dist/noydb-O76SKBST.js +35 -0
  116. package/dist/overlay-views/index.cjs.map +1 -1
  117. package/dist/overlay-views/index.d.cts +5 -5
  118. package/dist/overlay-views/index.d.ts +5 -5
  119. package/dist/overlay-views/index.js +4 -4
  120. package/dist/periods/index.cjs.map +1 -1
  121. package/dist/periods/index.d.cts +4 -4
  122. package/dist/periods/index.d.ts +4 -4
  123. package/dist/periods/index.js +5 -5
  124. package/dist/{public-envelope-PFLZI5MO.js → public-envelope-MHG6YVXW.js} +4 -4
  125. package/dist/query/index.cjs +89 -7
  126. package/dist/query/index.cjs.map +1 -1
  127. package/dist/query/index.d.cts +2 -2
  128. package/dist/query/index.d.ts +2 -2
  129. package/dist/query/index.js +3 -3
  130. package/dist/registry-2PKBQDCH.js +8 -0
  131. package/dist/registry-4VXFKCBJ.js +8 -0
  132. package/dist/{registry-NCY445U5.js → registry-PV4G3OPA.js} +3 -3
  133. package/dist/{revoke-7RLGQWZ7.js → revoke-5BOLVJ3N.js} +6 -6
  134. package/dist/session/index.cjs.map +1 -1
  135. package/dist/session/index.d.cts +5 -5
  136. package/dist/session/index.d.ts +5 -5
  137. package/dist/session/index.js +3 -3
  138. package/dist/shadow/index.cjs.map +1 -1
  139. package/dist/shadow/index.d.cts +4 -4
  140. package/dist/shadow/index.d.ts +4 -4
  141. package/dist/shadow/index.js +2 -2
  142. package/dist/{signer-6JF44I4A.js → signer-GRIYBA22.js} +5 -5
  143. package/dist/snapshots/index.cjs.map +1 -1
  144. package/dist/snapshots/index.d.cts +4 -4
  145. package/dist/snapshots/index.d.ts +4 -4
  146. package/dist/snapshots/index.js +4 -4
  147. package/dist/{stale-UBLP3RJ3.js → stale-LZYMMDDS.js} +2 -2
  148. package/dist/state-vault-QFJWU23A.js +147 -0
  149. package/dist/state-vault-QFJWU23A.js.map +1 -0
  150. package/dist/store/index.cjs.map +1 -1
  151. package/dist/store/index.d.cts +4 -4
  152. package/dist/store/index.d.ts +4 -4
  153. package/dist/store/index.js +2 -2
  154. package/dist/{strategy-rtpKDfTC.d.ts → strategy-CrS7PnbE.d.cts} +20 -1
  155. package/dist/{strategy-rtpKDfTC.d.cts → strategy-CrS7PnbE.d.ts} +20 -1
  156. package/dist/sync/index.cjs.map +1 -1
  157. package/dist/sync/index.d.cts +3 -3
  158. package/dist/sync/index.d.ts +3 -3
  159. package/dist/sync/index.js +4 -4
  160. package/dist/team/index.cjs.map +1 -1
  161. package/dist/team/index.d.cts +4 -4
  162. package/dist/team/index.d.ts +4 -4
  163. package/dist/team/index.js +8 -8
  164. package/dist/tx/index.cjs.map +1 -1
  165. package/dist/tx/index.d.cts +4 -4
  166. package/dist/tx/index.d.ts +4 -4
  167. package/dist/tx/index.js +3 -3
  168. package/dist/{types-BGwjsDef.d.cts → types-CDwSSXiI.d.cts} +290 -92
  169. package/dist/{types-DRdfwgTG.d.ts → types-pax34sec.d.ts} +290 -92
  170. package/dist/{ulid-D4d0Xto3.d.cts → ulid-7bCSgIgb.d.cts} +1 -1
  171. package/dist/{ulid-DOTPZ5_h.d.ts → ulid-C_t4hL3d.d.ts} +1 -1
  172. package/dist/util/index.cjs.map +1 -1
  173. package/dist/util/index.js +1 -1
  174. package/dist/{vault-group-Z4KB75ZH.js → vault-group-UO4YUZOG.js} +53 -10
  175. package/dist/vault-group-UO4YUZOG.js.map +1 -0
  176. package/dist/{with-derivation-B082Y_WQ.d.ts → with-derivation-BjdOxUBn.d.ts} +1 -1
  177. package/dist/{with-derivation-CB1EdcFF.d.cts → with-derivation-D8wFlb6V.d.cts} +1 -1
  178. package/dist/{with-materialized-view-CzRg1Dpr.d.cts → with-materialized-view-5QMF1rS_.d.cts} +1 -1
  179. package/dist/{with-materialized-view-Dw4SwjKl.d.ts → with-materialized-view-DJb-HO65.d.ts} +1 -1
  180. package/dist/{with-overlayed-view-CaCXeW26.d.ts → with-overlayed-view-CkqTefbz.d.ts} +1 -1
  181. package/dist/{with-overlayed-view-C9YFKXzn.d.cts → with-overlayed-view-DDNflPvC.d.cts} +1 -1
  182. package/package.json +3 -3
  183. package/dist/chunk-AGRC7NQQ.js.map +0 -1
  184. package/dist/chunk-LYNNZEQD.js.map +0 -1
  185. package/dist/chunk-TMHJEYW7.js.map +0 -1
  186. package/dist/chunk-UOC7JMZO.js.map +0 -1
  187. package/dist/executor-7KSCEIFA.js +0 -8
  188. package/dist/executor-D2QMNGRJ.js +0 -8
  189. package/dist/executor-O5AZK7UW.js +0 -11
  190. package/dist/issue-YIYG4OW5.js +0 -12
  191. package/dist/noydb-D5SLAJ6V.js +0 -34
  192. package/dist/registry-BVQ5ITMF.js +0 -8
  193. package/dist/registry-JLP3QOLD.js +0 -8
  194. package/dist/vault-group-Z4KB75ZH.js.map +0 -1
  195. /package/dist/{chunk-P3Z5Y2TS.js.map → chunk-3OUCWHV6.js.map} +0 -0
  196. /package/dist/{chunk-4BHFNKTP.js.map → chunk-3XZRRBFW.js.map} +0 -0
  197. /package/dist/{chunk-XSIFXX54.js.map → chunk-4VCQH32J.js.map} +0 -0
  198. /package/dist/{chunk-CHBXWJZQ.js.map → chunk-4YDZ7JPZ.js.map} +0 -0
  199. /package/dist/{chunk-B7GGYNKQ.js.map → chunk-5NISHSBO.js.map} +0 -0
  200. /package/dist/{chunk-O53RIZCC.js.map → chunk-7TEI2K2A.js.map} +0 -0
  201. /package/dist/{chunk-ZCFS7U4J.js.map → chunk-AYNF7PVX.js.map} +0 -0
  202. /package/dist/{chunk-GFPR7VJS.js.map → chunk-C3WRKABE.js.map} +0 -0
  203. /package/dist/{chunk-EKNUBIIQ.js.map → chunk-CWFQTAD4.js.map} +0 -0
  204. /package/dist/{chunk-P4EDT5ZP.js.map → chunk-D5Y3HIC6.js.map} +0 -0
  205. /package/dist/{chunk-IUBHXEPJ.js.map → chunk-E3DIBDKA.js.map} +0 -0
  206. /package/dist/{chunk-WNRGOVLG.js.map → chunk-FNVFT4HZ.js.map} +0 -0
  207. /package/dist/{chunk-5ARRXIVR.js.map → chunk-GL3Z7LH7.js.map} +0 -0
  208. /package/dist/{chunk-WUG3E423.js.map → chunk-GZJ5JBED.js.map} +0 -0
  209. /package/dist/{chunk-XHM2SARW.js.map → chunk-HHZ77DHM.js.map} +0 -0
  210. /package/dist/{chunk-SJJQKNMP.js.map → chunk-HQXOEWLZ.js.map} +0 -0
  211. /package/dist/{chunk-CILT6V3V.js.map → chunk-ILWQGTNH.js.map} +0 -0
  212. /package/dist/{chunk-RRDWXNBQ.js.map → chunk-J67BP5EP.js.map} +0 -0
  213. /package/dist/{chunk-HLGDYFWR.js.map → chunk-JPOQMXGT.js.map} +0 -0
  214. /package/dist/{chunk-IEPT7HVP.js.map → chunk-JWFNOD2T.js.map} +0 -0
  215. /package/dist/{chunk-BXOUVUES.js.map → chunk-KHQ3N5AB.js.map} +0 -0
  216. /package/dist/{chunk-UA6G45ME.js.map → chunk-KJF7EPUE.js.map} +0 -0
  217. /package/dist/{chunk-C2CIIQRG.js.map → chunk-KKB42D3Q.js.map} +0 -0
  218. /package/dist/{chunk-M45IRXDM.js.map → chunk-M6KXHRIA.js.map} +0 -0
  219. /package/dist/{chunk-VOXMU6LB.js.map → chunk-NIUXQDWD.js.map} +0 -0
  220. /package/dist/{chunk-LWSD4QPT.js.map → chunk-O2JW656W.js.map} +0 -0
  221. /package/dist/{chunk-LSEW3ZZ2.js.map → chunk-PW26DAXS.js.map} +0 -0
  222. /package/dist/{chunk-HBAJDI2N.js.map → chunk-QAWCVWCX.js.map} +0 -0
  223. /package/dist/{chunk-L6BYRCYB.js.map → chunk-QFYVGJLI.js.map} +0 -0
  224. /package/dist/{chunk-6BYBVRZU.js.map → chunk-QIVFGU2M.js.map} +0 -0
  225. /package/dist/{chunk-ZC7MNVYN.js.map → chunk-SJ24GHID.js.map} +0 -0
  226. /package/dist/{chunk-SZ4N3IL5.js.map → chunk-SOU42FGB.js.map} +0 -0
  227. /package/dist/{chunk-DLTU4M2I.js.map → chunk-SYSKC237.js.map} +0 -0
  228. /package/dist/{chunk-6AD5TBF2.js.map → chunk-TDECYU4Y.js.map} +0 -0
  229. /package/dist/{chunk-7JJE3OMJ.js.map → chunk-TEQGXA7L.js.map} +0 -0
  230. /package/dist/{chunk-RHQYVHFH.js.map → chunk-UNQEWORI.js.map} +0 -0
  231. /package/dist/{chunk-LOA2VCMS.js.map → chunk-VAK6NQAK.js.map} +0 -0
  232. /package/dist/{chunk-7LVRIW4G.js.map → chunk-WQKZIQIL.js.map} +0 -0
  233. /package/dist/{chunk-OPDTLHFA.js.map → chunk-YWBHS25M.js.map} +0 -0
  234. /package/dist/{crypto-AJB72OKN.js.map → crypto-YXH6SAOW.js.map} +0 -0
  235. /package/dist/{delegation-6FCWDRUS.js.map → delegation-K5ERUH6A.js.map} +0 -0
  236. /package/dist/{executor-7KSCEIFA.js.map → executor-AVJ7UEWA.js.map} +0 -0
  237. /package/dist/{executor-D2QMNGRJ.js.map → executor-IQO3KGXQ.js.map} +0 -0
  238. /package/dist/{executor-O5AZK7UW.js.map → executor-VT7TKGE4.js.map} +0 -0
  239. /package/dist/{fanout-sidecar-ZSKEQ6NI.js.map → fanout-sidecar-N6OJX6QR.js.map} +0 -0
  240. /package/dist/{issue-YIYG4OW5.js.map → issue-ZH27C23Y.js.map} +0 -0
  241. /package/dist/{ledger-5JMVF7PY.js.map → ledger-64TTQMRS.js.map} +0 -0
  242. /package/dist/{noydb-D5SLAJ6V.js.map → noydb-O76SKBST.js.map} +0 -0
  243. /package/dist/{public-envelope-PFLZI5MO.js.map → public-envelope-MHG6YVXW.js.map} +0 -0
  244. /package/dist/{registry-BVQ5ITMF.js.map → registry-2PKBQDCH.js.map} +0 -0
  245. /package/dist/{registry-JLP3QOLD.js.map → registry-4VXFKCBJ.js.map} +0 -0
  246. /package/dist/{registry-NCY445U5.js.map → registry-PV4G3OPA.js.map} +0 -0
  247. /package/dist/{revoke-7RLGQWZ7.js.map → revoke-5BOLVJ3N.js.map} +0 -0
  248. /package/dist/{signer-6JF44I4A.js.map → signer-GRIYBA22.js.map} +0 -0
  249. /package/dist/{stale-UBLP3RJ3.js.map → stale-LZYMMDDS.js.map} +0 -0
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-Z6FNBOTC.js";
7
7
  import {
8
8
  NOYDB_FORMAT_VERSION
9
- } from "./chunk-LYNNZEQD.js";
9
+ } from "./chunk-GC4V7RU7.js";
10
10
  import {
11
11
  decrypt,
12
12
  encrypt
13
- } from "./chunk-IUBHXEPJ.js";
13
+ } from "./chunk-E3DIBDKA.js";
14
14
  import {
15
15
  ConflictError,
16
16
  LedgerContentionError
17
- } from "./chunk-AGRC7NQQ.js";
17
+ } from "./chunk-NKGY3C53.js";
18
18
 
19
19
  // src/history/ledger/patch.ts
20
20
  function computePatch(prev, next) {
@@ -683,4 +683,4 @@ export {
683
683
  LEDGER_DELTAS_COLLECTION,
684
684
  LedgerStore
685
685
  };
686
- //# sourceMappingURL=chunk-SJJQKNMP.js.map
686
+ //# sourceMappingURL=chunk-HQXOEWLZ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ReadOnlyFrameError
3
- } from "./chunk-AGRC7NQQ.js";
3
+ } from "./chunk-NKGY3C53.js";
4
4
 
5
5
  // src/shadow/vault-frame.ts
6
6
  var VaultFrame = class {
@@ -76,4 +76,4 @@ export {
76
76
  VaultFrame,
77
77
  CollectionFrame
78
78
  };
79
- //# sourceMappingURL=chunk-CILT6V3V.js.map
79
+ //# sourceMappingURL=chunk-ILWQGTNH.js.map
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  PeriodClosedError,
7
7
  ValidationError
8
- } from "./chunk-AGRC7NQQ.js";
8
+ } from "./chunk-NKGY3C53.js";
9
9
 
10
10
  // src/periods/periods.ts
11
11
  var PERIODS_COLLECTION = "_periods";
@@ -56,7 +56,7 @@ function validatePeriodName(name, existing) {
56
56
  }
57
57
  async function appendPeriodLedgerEntry(ledger, actor, envelope, name) {
58
58
  if (!ledger) return;
59
- const { envelopePayloadHash } = await import("./ledger-5JMVF7PY.js");
59
+ const { envelopePayloadHash } = await import("./ledger-64TTQMRS.js");
60
60
  await ledger.append({
61
61
  op: "put",
62
62
  collection: PERIODS_COLLECTION,
@@ -87,4 +87,4 @@ export {
87
87
  appendPeriodLedgerEntry,
88
88
  withPeriods
89
89
  };
90
- //# sourceMappingURL=chunk-RRDWXNBQ.js.map
90
+ //# sourceMappingURL=chunk-J67BP5EP.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FieldFrozenError,
3
3
  InvariantError
4
- } from "./chunk-AGRC7NQQ.js";
4
+ } from "./chunk-NKGY3C53.js";
5
5
 
6
6
  // src/guards/executor.ts
7
7
  var GuardExecutor = {
@@ -77,4 +77,4 @@ function deepEqual(a, b) {
77
77
  export {
78
78
  GuardExecutor
79
79
  };
80
- //# sourceMappingURL=chunk-HLGDYFWR.js.map
80
+ //# sourceMappingURL=chunk-JPOQMXGT.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  BundleVersionConflictError,
3
3
  ConflictError
4
- } from "./chunk-AGRC7NQQ.js";
4
+ } from "./chunk-NKGY3C53.js";
5
5
 
6
6
  // src/store/bundle-store.ts
7
7
  var BUNDLE_STORE_VERSION = 1;
@@ -790,4 +790,4 @@ export {
790
790
  withCache,
791
791
  withHealthCheck
792
792
  };
793
- //# sourceMappingURL=chunk-IEPT7HVP.js.map
793
+ //# sourceMappingURL=chunk-JWFNOD2T.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  dekKey
3
- } from "./chunk-ZC7MNVYN.js";
3
+ } from "./chunk-SJ24GHID.js";
4
4
  import {
5
5
  generateULID
6
6
  } from "./chunk-FZU343FL.js";
@@ -9,10 +9,10 @@ import {
9
9
  encrypt,
10
10
  unwrapKey,
11
11
  wrapKey
12
- } from "./chunk-IUBHXEPJ.js";
12
+ } from "./chunk-E3DIBDKA.js";
13
13
  import {
14
14
  DelegationTargetMissingError
15
- } from "./chunk-AGRC7NQQ.js";
15
+ } from "./chunk-NKGY3C53.js";
16
16
 
17
17
  // src/team/delegation.ts
18
18
  var DELEGATIONS_COLLECTION = "_delegations";
@@ -94,4 +94,4 @@ export {
94
94
  loadActiveDelegations,
95
95
  revokeDelegation
96
96
  };
97
- //# sourceMappingURL=chunk-BXOUVUES.js.map
97
+ //# sourceMappingURL=chunk-KHQ3N5AB.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  NOYDB_FORMAT_VERSION
3
- } from "./chunk-LYNNZEQD.js";
3
+ } from "./chunk-GC4V7RU7.js";
4
4
  import {
5
5
  ValidationError
6
- } from "./chunk-AGRC7NQQ.js";
6
+ } from "./chunk-NKGY3C53.js";
7
7
 
8
8
  // src/meta/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-UA6G45ME.js.map
155
+ //# sourceMappingURL=chunk-KJF7EPUE.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MaterializedViewCycleError,
3
3
  MaterializedViewSourceUnknownError
4
- } from "./chunk-AGRC7NQQ.js";
4
+ } from "./chunk-NKGY3C53.js";
5
5
 
6
6
  // src/materialized-views/dependency-analyzer.ts
7
7
  function analyzeDependencies(query) {
@@ -310,4 +310,4 @@ export {
310
310
  MaterializedViewRegistry,
311
311
  wrapDbWithPredicates
312
312
  };
313
- //# sourceMappingURL=chunk-C2CIIQRG.js.map
313
+ //# sourceMappingURL=chunk-KKB42D3Q.js.map
@@ -6,7 +6,7 @@ import {
6
6
  ConflictError,
7
7
  InvariantError,
8
8
  ValidationError
9
- } from "./chunk-AGRC7NQQ.js";
9
+ } from "./chunk-NKGY3C53.js";
10
10
 
11
11
  // src/tx/transaction.ts
12
12
  var TxContext = class {
@@ -209,7 +209,7 @@ async function runTransaction(db, fn, options) {
209
209
  db._clearActiveTxContext(ctx);
210
210
  }
211
211
  if (ctx._amendment) {
212
- const { GuardExecutor } = await import("./executor-7KSCEIFA.js");
212
+ const { GuardExecutor } = await import("./executor-VT7TKGE4.js");
213
213
  try {
214
214
  for (const [vaultName, v] of ctx._amendmentVaults) {
215
215
  const registry = v._getGuardRegistry();
@@ -293,4 +293,4 @@ export {
293
293
  runTransaction,
294
294
  revertExecuted
295
295
  };
296
- //# sourceMappingURL=chunk-M45IRXDM.js.map
296
+ //# sourceMappingURL=chunk-M6KXHRIA.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ValidationError
3
- } from "./chunk-AGRC7NQQ.js";
3
+ } from "./chunk-NKGY3C53.js";
4
4
 
5
5
  // src/derivations/with-derivation.ts
6
6
  function withDerivation(spec) {
@@ -48,4 +48,4 @@ function withDerivation(spec) {
48
48
  export {
49
49
  withDerivation
50
50
  };
51
- //# sourceMappingURL=chunk-VOXMU6LB.js.map
51
+ //# sourceMappingURL=chunk-NIUXQDWD.js.map
@@ -1,6 +1,9 @@
1
1
  import {
2
+ MoneyPrecisionError,
3
+ formatScaledInt,
4
+ parseToScaledInt,
2
5
  wrapMoneyReducers
3
- } from "./chunk-OPDTLHFA.js";
6
+ } from "./chunk-YWBHS25M.js";
4
7
  import {
5
8
  evaluateClause,
6
9
  readPath
@@ -10,7 +13,7 @@ import {
10
13
  CrossJoinTooLargeError,
11
14
  DanglingReferenceError,
12
15
  JoinTooLargeError
13
- } from "./chunk-AGRC7NQQ.js";
16
+ } from "./chunk-NKGY3C53.js";
14
17
 
15
18
  // src/query/join.ts
16
19
  var DEFAULT_JOIN_MAX_ROWS = 5e4;
@@ -257,6 +260,88 @@ var NO_AGGREGATE = {
257
260
  }
258
261
  };
259
262
 
263
+ // src/money/normalize.ts
264
+ function isMoneyValueObject(v) {
265
+ return typeof v === "object" && v !== null && "currency" in v;
266
+ }
267
+ function quantizeAmount(field, input, scale, rounding) {
268
+ const r = parseToScaledInt(input, scale, rounding);
269
+ if (!r.ok) {
270
+ if (r.reason === "precision") throw new MoneyPrecisionError(field, input, scale);
271
+ throw new TypeError(`money: field "${field}" value ${JSON.stringify(input)} is not a finite decimal`);
272
+ }
273
+ return r.value.toString();
274
+ }
275
+ function quantizeMoneyFields(record, moneyFields) {
276
+ const out = { ...record };
277
+ for (const [field, desc] of Object.entries(moneyFields)) {
278
+ const raw = out[field];
279
+ if (raw === null || raw === void 0) continue;
280
+ if (desc.mode === "fixed") {
281
+ const currency2 = desc.fixedCurrency;
282
+ out[field] = quantizeAmount(field, raw, desc.scaleFor(currency2), desc.rounding);
283
+ continue;
284
+ }
285
+ let amount;
286
+ let currency;
287
+ if (isMoneyValueObject(raw)) {
288
+ currency = String(raw.currency);
289
+ amount = raw.amount;
290
+ } else {
291
+ const sole = desc.soleCurrency();
292
+ if (sole === void 0) {
293
+ throw new TypeError(
294
+ `money: field "${field}" is multi-currency \u2014 write { amount, currency }, not a bare amount`
295
+ );
296
+ }
297
+ currency = sole;
298
+ amount = raw;
299
+ }
300
+ const scale = desc.scaleFor(currency);
301
+ out[field] = { amount: quantizeAmount(field, amount, scale, desc.rounding), currency };
302
+ }
303
+ return out;
304
+ }
305
+ function formatCurrency(decimal, currency, scale, locale) {
306
+ const fmt = new Intl.NumberFormat(locale, {
307
+ style: "currency",
308
+ currency,
309
+ minimumFractionDigits: scale,
310
+ maximumFractionDigits: scale
311
+ });
312
+ return fmt.format(decimal);
313
+ }
314
+ function decodeMoneyFields(record, moneyFields, locale) {
315
+ const out = { ...record };
316
+ const format = locale !== "raw";
317
+ const fmtLocale = typeof locale === "string" && locale !== "raw" ? locale : "en-US";
318
+ for (const [field, desc] of Object.entries(moneyFields)) {
319
+ const stored = out[field];
320
+ if (stored === null || stored === void 0) continue;
321
+ let currency;
322
+ let scaledIntString;
323
+ if (desc.mode === "fixed") {
324
+ if (typeof stored !== "string" && typeof stored !== "number") continue;
325
+ currency = desc.fixedCurrency;
326
+ scaledIntString = String(stored);
327
+ } else {
328
+ if (!isMoneyValueObject(stored)) continue;
329
+ const amount = stored.amount;
330
+ if (typeof stored.currency !== "string" || typeof amount !== "string" && typeof amount !== "number") continue;
331
+ currency = stored.currency;
332
+ scaledIntString = String(amount);
333
+ }
334
+ const scale = desc.scaleFor(currency);
335
+ const decimal = formatScaledInt(BigInt(scaledIntString), scale);
336
+ out[field] = desc.mode === "fixed" ? decimal : { amount: decimal, currency };
337
+ if (format) {
338
+ out[`${field}Formatted`] = formatCurrency(decimal, currency, scale, fmtLocale);
339
+ out[`${field}Number`] = Number(decimal);
340
+ }
341
+ }
342
+ return out;
343
+ }
344
+
260
345
  // src/query/builder.ts
261
346
  var EMPTY_PLAN = {
262
347
  clauses: [],
@@ -626,7 +711,7 @@ var Query = class _Query {
626
711
  * for the ordering rationale.
627
712
  */
628
713
  toArray() {
629
- const base = executePlanWithSource(this.source, this.plan, this.joinContext);
714
+ const base = this.decodeMoney(executePlanWithSource(this.source, this.plan, this.joinContext));
630
715
  if (this.plan.joins.length === 0) return base;
631
716
  if (!this.joinContext) {
632
717
  throw new Error(
@@ -635,6 +720,23 @@ var Query = class _Query {
635
720
  }
636
721
  return applyJoins(base, this.plan.joins, this.joinContext);
637
722
  }
723
+ /**
724
+ * Decode this source's money fields on read (stored scaled-int → canonical
725
+ * decimal), so `query().toArray()` agrees with `get()`/`sum()` on the value.
726
+ * No-op when the source declares no money fields.
727
+ *
728
+ * The query layer carries no locale context, so we decode with `'raw'` —
729
+ * canonical decimal, WITHOUT fabricating locale-formatted `<field>Formatted`
730
+ * / `<field>Number` virtuals. Producing a guessed-locale string here would
731
+ * just reintroduce #322's "two read paths disagree" failure on the virtual
732
+ * field (e.g. it-IT via `get()` vs en-US here). Consumers who need formatted
733
+ * money read through `get()`/`list()` with a locale.
734
+ */
735
+ decodeMoney(records) {
736
+ const moneyFields = this.source.moneyFields;
737
+ if (!moneyFields || Object.keys(moneyFields).length === 0) return records;
738
+ return records.map((r) => decodeMoneyFields(r, moneyFields, "raw"));
739
+ }
638
740
  /** Return the first matching record, or null. Joins are applied. */
639
741
  first() {
640
742
  const arr = this.limit(1).toArray();
@@ -1191,12 +1293,29 @@ var ScanBuilder = class _ScanBuilder {
1191
1293
  * context throws with an actionable error.
1192
1294
  */
1193
1295
  joinContext;
1194
- constructor(pageProvider, pageSize = DEFAULT_SCAN_PAGE_SIZE, clauses = [], joins = [], joinContext) {
1296
+ /**
1297
+ * Money field descriptors for the backing collection. When present, yielded
1298
+ * records are decoded (stored scaled-int → canonical decimal) so `scan()`
1299
+ * agrees with `get()`/`list()`/`query().toArray()` — #322. Decoded with
1300
+ * `'raw'` (canonical decimal, no locale-formatted virtuals) since the scan
1301
+ * stream carries no locale context, mirroring `Query.toArray()`.
1302
+ */
1303
+ moneyFields;
1304
+ constructor(pageProvider, pageSize = DEFAULT_SCAN_PAGE_SIZE, clauses = [], joins = [], joinContext, moneyFields) {
1195
1305
  this.pageProvider = pageProvider;
1196
1306
  this.pageSize = pageSize;
1197
1307
  this.clauses = clauses;
1198
1308
  this.joins = joins;
1199
1309
  this.joinContext = joinContext;
1310
+ this.moneyFields = moneyFields;
1311
+ }
1312
+ /**
1313
+ * Decode this scan's money fields on a record (stored scaled-int → canonical
1314
+ * decimal). No-op when no money fields are declared. See {@link moneyFields}.
1315
+ */
1316
+ decodeMoney(record) {
1317
+ if (!this.moneyFields || Object.keys(this.moneyFields).length === 0) return record;
1318
+ return decodeMoneyFields(record, this.moneyFields, "raw");
1200
1319
  }
1201
1320
  /**
1202
1321
  * Add a field comparison. Runs per record as the scan stream
@@ -1218,7 +1337,8 @@ var ScanBuilder = class _ScanBuilder {
1218
1337
  this.pageSize,
1219
1338
  [...this.clauses, clause],
1220
1339
  this.joins,
1221
- this.joinContext
1340
+ this.joinContext,
1341
+ this.moneyFields
1222
1342
  );
1223
1343
  }
1224
1344
  /**
@@ -1237,7 +1357,8 @@ var ScanBuilder = class _ScanBuilder {
1237
1357
  this.pageSize,
1238
1358
  [...this.clauses, clause],
1239
1359
  this.joins,
1240
- this.joinContext
1360
+ this.joinContext,
1361
+ this.moneyFields
1241
1362
  );
1242
1363
  }
1243
1364
  /**
@@ -1348,7 +1469,8 @@ var ScanBuilder = class _ScanBuilder {
1348
1469
  this.pageSize,
1349
1470
  this.clauses,
1350
1471
  [...this.joins, leg],
1351
- this.joinContext
1472
+ this.joinContext,
1473
+ this.moneyFields
1352
1474
  );
1353
1475
  }
1354
1476
  /**
@@ -1365,10 +1487,11 @@ var ScanBuilder = class _ScanBuilder {
1365
1487
  while (true) {
1366
1488
  for (const record of page.items) {
1367
1489
  if (!this.recordMatches(record)) continue;
1490
+ const decoded = this.decodeMoney(record);
1368
1491
  if (joinResolvers === null) {
1369
- yield record;
1492
+ yield decoded;
1370
1493
  } else {
1371
- let attached = record;
1494
+ let attached = decoded;
1372
1495
  for (const resolver of joinResolvers) {
1373
1496
  attached = this.applyOneJoinStreaming(attached, resolver);
1374
1497
  }
@@ -1568,6 +1691,8 @@ function coerceRefKey2(value) {
1568
1691
  }
1569
1692
 
1570
1693
  export {
1694
+ quantizeMoneyFields,
1695
+ decodeMoneyFields,
1571
1696
  DEFAULT_JOIN_MAX_ROWS,
1572
1697
  applyJoins,
1573
1698
  resetJoinWarnings,
@@ -1578,4 +1703,4 @@ export {
1578
1703
  executePlan,
1579
1704
  ScanBuilder
1580
1705
  };
1581
- //# sourceMappingURL=chunk-UOC7JMZO.js.map
1706
+ //# sourceMappingURL=chunk-NJMKHRQI.js.map