@noy-db/hub 0.7.0-pre.8 → 0.7.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 (447) hide show
  1. package/CHANGELOG.md +1379 -0
  2. package/README.md +7 -6
  3. package/dist/api-TXFOVOXX.js +19 -0
  4. package/dist/as/index.js +14 -14
  5. package/dist/at/index.js +9 -10
  6. package/dist/attestation/index.js +18 -19
  7. package/dist/attestation/index.js.map +1 -1
  8. package/dist/{backup-SZBDQQSL.js → backup-IJTB4S4M.js} +14 -15
  9. package/dist/{backup-SZBDQQSL.js.map → backup-IJTB4S4M.js.map} +1 -1
  10. package/dist/blobs/index.js +13 -14
  11. package/dist/blobs/index.js.map +1 -1
  12. package/dist/broker/index.js +12 -13
  13. package/dist/broker/index.js.map +1 -1
  14. package/dist/by/index.js +2 -3
  15. package/dist/cargo/index.js +33 -34
  16. package/dist/{chunk-X6TBQKHW.js → chunk-2577DKXB.js} +2 -2
  17. package/dist/chunk-2C3AQB46.js +1652 -0
  18. package/dist/chunk-2C3AQB46.js.map +1 -0
  19. package/dist/{chunk-L3FHEWA3.js → chunk-2N4GY74U.js} +6 -6
  20. package/dist/{chunk-626TSARM.js → chunk-2Y4IMKA6.js} +4 -4
  21. package/dist/{chunk-7CWII4BL.js → chunk-3RCJJBNR.js} +10 -10
  22. package/dist/{chunk-M7UC2QPT.js → chunk-453F654R.js} +2 -2
  23. package/dist/{chunk-2QNKXGUS.js → chunk-4GVM6QZA.js} +2 -2
  24. package/dist/{chunk-AB5P32RE.js → chunk-4OZNXTO4.js} +2 -2
  25. package/dist/{chunk-L3HDEHGM.js → chunk-5VCRVKOZ.js} +4 -4
  26. package/dist/{chunk-6AQIFBSP.js → chunk-5WDXHNSW.js} +5 -5
  27. package/dist/chunk-66TQOPFM.js +37 -0
  28. package/dist/chunk-66TQOPFM.js.map +1 -0
  29. package/dist/{chunk-BOFRKAUS.js → chunk-6GMZ7HEE.js} +6 -6
  30. package/dist/{chunk-PRHCMEUK.js → chunk-6GOE5PGN.js} +168 -1328
  31. package/dist/chunk-6GOE5PGN.js.map +1 -0
  32. package/dist/{chunk-XBFEKTIY.js → chunk-6I2RQCET.js} +4 -4
  33. package/dist/{chunk-PUJTKLPL.js → chunk-6X6SEMEE.js} +6 -4
  34. package/dist/{chunk-PUJTKLPL.js.map → chunk-6X6SEMEE.js.map} +1 -1
  35. package/dist/{chunk-UCUALOSM.js → chunk-6YXCPL4T.js} +2 -2
  36. package/dist/{chunk-BYBB4ABD.js → chunk-77K4PG6P.js} +8 -8
  37. package/dist/{chunk-S2VG3ABP.js → chunk-7MG2LHO5.js} +3 -3
  38. package/dist/{chunk-GU3LQYW2.js → chunk-7MG7SJT7.js} +1 -1
  39. package/dist/chunk-7MG7SJT7.js.map +1 -0
  40. package/dist/{chunk-JBIV4FLR.js → chunk-7O3Y4PPD.js} +5 -1
  41. package/dist/chunk-7O3Y4PPD.js.map +1 -0
  42. package/dist/{chunk-EO2KGKEJ.js → chunk-7V4TP3AF.js} +4 -4
  43. package/dist/{chunk-LFDMKZIP.js → chunk-ANATMFIO.js} +5 -5
  44. package/dist/{chunk-T3PHCEN4.js → chunk-ANSIZYEG.js} +3 -3
  45. package/dist/{chunk-ZKRRBRSZ.js → chunk-AO42KJO6.js} +7 -7
  46. package/dist/{chunk-VFIWDPXZ.js → chunk-BLN54W3L.js} +3 -3
  47. package/dist/{chunk-ZQ2UUHSL.js → chunk-BM5TWITZ.js} +7 -7
  48. package/dist/{chunk-WLFABTZ6.js → chunk-BOET4NA4.js} +3 -3
  49. package/dist/{chunk-FOG7YEJP.js → chunk-BOWNCWZT.js} +3 -3
  50. package/dist/{chunk-7XODKGTW.js → chunk-BSFNRLK2.js} +5 -5
  51. package/dist/{chunk-YPSOHDNC.js → chunk-BUE2D7PX.js} +26 -3
  52. package/dist/chunk-BUE2D7PX.js.map +1 -0
  53. package/dist/{chunk-J4MN6XIU.js → chunk-BZ3534YM.js} +2 -2
  54. package/dist/chunk-CARABLSQ.js +176 -0
  55. package/dist/chunk-CARABLSQ.js.map +1 -0
  56. package/dist/{chunk-4MZEZ37W.js → chunk-CHJBLCOG.js} +10 -8
  57. package/dist/{chunk-4MZEZ37W.js.map → chunk-CHJBLCOG.js.map} +1 -1
  58. package/dist/{chunk-IF56DYJK.js → chunk-CPWQB3N5.js} +7 -7
  59. package/dist/{chunk-SHILAQH5.js → chunk-DGOZ4UZD.js} +2 -2
  60. package/dist/{chunk-BWWUXE3L.js → chunk-ELNXJMGB.js} +6 -6
  61. package/dist/{chunk-44C2URL7.js → chunk-EQEYOJBM.js} +3 -3
  62. package/dist/{chunk-Y3XWRDAM.js → chunk-EYBQEIUY.js} +3 -3
  63. package/dist/{chunk-Z7ZXZL6Y.js → chunk-FAHMLERK.js} +2 -2
  64. package/dist/chunk-FFWI7UH7.js +53 -0
  65. package/dist/chunk-FFWI7UH7.js.map +1 -0
  66. package/dist/{chunk-EXDIHWFO.js → chunk-FMZY5Q6L.js} +3 -3
  67. package/dist/{chunk-H6WXKZL7.js → chunk-FXBIP2WD.js} +6 -6
  68. package/dist/{chunk-ZTYG36DH.js → chunk-G56KBWFY.js} +67 -22
  69. package/dist/chunk-G56KBWFY.js.map +1 -0
  70. package/dist/{chunk-672U6STZ.js → chunk-GPEQUXHL.js} +4 -4
  71. package/dist/{chunk-Z2PWOSCJ.js → chunk-GY4WYNNG.js} +2 -2
  72. package/dist/{chunk-RDHUZ674.js → chunk-HDOU6I2Y.js} +80 -8
  73. package/dist/chunk-HDOU6I2Y.js.map +1 -0
  74. package/dist/{chunk-OMHHGOG4.js → chunk-J6FXAEUG.js} +15 -13
  75. package/dist/chunk-J6FXAEUG.js.map +1 -0
  76. package/dist/{chunk-4A4TYISP.js → chunk-JBDFMYKQ.js} +2 -2
  77. package/dist/{chunk-POS53FG6.js → chunk-JMGDHKQF.js} +2 -2
  78. package/dist/{chunk-Q7GEDVHC.js → chunk-K6LHRFBL.js} +7 -7
  79. package/dist/{chunk-4JDIRUTT.js → chunk-K7NTTA6P.js} +2 -2
  80. package/dist/{chunk-26W5VETY.js → chunk-KG7TZKZG.js} +5 -5
  81. package/dist/{chunk-RJ7RIIX6.js → chunk-KJIMGIWO.js} +8 -8
  82. package/dist/{chunk-F7ZFRPGQ.js → chunk-KTFRCC5C.js} +2 -2
  83. package/dist/{chunk-HSGEIMJS.js → chunk-KUJDV5QH.js} +5 -5
  84. package/dist/{chunk-XWNLKG6R.js → chunk-KUX3OB6D.js} +7 -5
  85. package/dist/{chunk-XWNLKG6R.js.map → chunk-KUX3OB6D.js.map} +1 -1
  86. package/dist/{chunk-UPJMBMCR.js → chunk-L742JPKZ.js} +6 -6
  87. package/dist/{chunk-4TZUFNXL.js → chunk-L7CIOOBW.js} +2 -2
  88. package/dist/{chunk-7LYUJNU3.js → chunk-LWBCUYZW.js} +2 -2
  89. package/dist/{chunk-JHLJQUXU.js → chunk-MUM7IANK.js} +3 -3
  90. package/dist/{chunk-2GXEQUEX.js → chunk-MVMXZYXT.js} +2 -2
  91. package/dist/{chunk-XLPXGN66.js → chunk-NA2NIJZI.js} +8 -8
  92. package/dist/{chunk-S6YB5ZRP.js → chunk-NKHRDYOR.js} +4 -4
  93. package/dist/{chunk-XJ3FEKEY.js → chunk-NQKIUNW5.js} +2 -2
  94. package/dist/{chunk-6NRVFD55.js → chunk-PT43Y56J.js} +6 -6
  95. package/dist/{chunk-5ACAVJUI.js → chunk-Q2PU57HC.js} +2 -2
  96. package/dist/{chunk-E6YA6UAP.js → chunk-Q7HZX3IF.js} +2 -2
  97. package/dist/{chunk-4ZPE6SKS.js → chunk-QIBVIOXO.js} +3 -3
  98. package/dist/{chunk-WLLUM35R.js → chunk-QIZPZMUI.js} +2 -2
  99. package/dist/{chunk-P6ASQOZR.js → chunk-REDOOY2Q.js} +3 -3
  100. package/dist/chunk-REDOOY2Q.js.map +1 -0
  101. package/dist/{chunk-LKFKXS5K.js → chunk-RMF67KCG.js} +2 -2
  102. package/dist/{chunk-YCSM3GZU.js → chunk-RMS3NEA3.js} +2 -2
  103. package/dist/{chunk-4FPEWQKF.js → chunk-RRNRNANG.js} +27 -17
  104. package/dist/chunk-RRNRNANG.js.map +1 -0
  105. package/dist/chunk-RTBJ5IOO.js +87 -0
  106. package/dist/chunk-RTBJ5IOO.js.map +1 -0
  107. package/dist/chunk-RXLYKVTF.js +17 -0
  108. package/dist/chunk-RXLYKVTF.js.map +1 -0
  109. package/dist/{chunk-OPXR4PB2.js → chunk-SFAWCTEM.js} +2 -2
  110. package/dist/{chunk-3QARDAYW.js → chunk-SKGMN35F.js} +2 -2
  111. package/dist/{chunk-W5LHQXZU.js → chunk-SL3JAAKN.js} +2 -2
  112. package/dist/chunk-SMH6SRX7.js +87 -0
  113. package/dist/chunk-SMH6SRX7.js.map +1 -0
  114. package/dist/{chunk-JJZIIJSA.js → chunk-SPXXX5E4.js} +12 -82
  115. package/dist/chunk-SPXXX5E4.js.map +1 -0
  116. package/dist/{chunk-UALOYGCP.js → chunk-SPYWXKJN.js} +3 -3
  117. package/dist/{chunk-QU3YUP2X.js → chunk-SZJ3DLZA.js} +2 -2
  118. package/dist/chunk-TFMM5DBB.js +20 -0
  119. package/dist/chunk-TFMM5DBB.js.map +1 -0
  120. package/dist/{chunk-225O5CXQ.js → chunk-TFR7DSOV.js} +2 -2
  121. package/dist/{chunk-X67FCULK.js → chunk-TRGTKX5E.js} +3 -3
  122. package/dist/{chunk-JVLSU7S2.js → chunk-TUFM4UZP.js} +2 -2
  123. package/dist/{chunk-VVAVTSTR.js → chunk-U4FOQDY4.js} +5 -172
  124. package/dist/chunk-U4FOQDY4.js.map +1 -0
  125. package/dist/{chunk-HTGRQZFB.js → chunk-UGTBXF5U.js} +3 -3
  126. package/dist/{chunk-THNJ3IKU.js → chunk-ULUMAZ5S.js} +2 -2
  127. package/dist/{chunk-XDVVBETV.js → chunk-UXVWEX5L.js} +2 -2
  128. package/dist/{chunk-FKFIEEY6.js → chunk-UXWB3FPF.js} +10 -10
  129. package/dist/{chunk-NO272T7Q.js → chunk-V4PXLYWM.js} +2 -31
  130. package/dist/chunk-V4PXLYWM.js.map +1 -0
  131. package/dist/{chunk-CBRS2NEK.js → chunk-VTFVLCUH.js} +2 -2
  132. package/dist/{chunk-TOV6VMHF.js → chunk-VXANTWBJ.js} +3 -3
  133. package/dist/{chunk-VSLUSXVK.js → chunk-VXGSWL6L.js} +6 -6
  134. package/dist/{chunk-KHKKD62N.js → chunk-VYYM3MEN.js} +2 -16
  135. package/dist/chunk-VYYM3MEN.js.map +1 -0
  136. package/dist/{chunk-HQINBNHM.js → chunk-WEQEYLCS.js} +7 -7
  137. package/dist/{chunk-U6GCYG2T.js → chunk-X2DLENDQ.js} +3 -3
  138. package/dist/{chunk-XVU7J43V.js → chunk-XLMEZIAJ.js} +2 -2
  139. package/dist/{chunk-ILSR22WM.js → chunk-XTXOCYOJ.js} +5 -5
  140. package/dist/{chunk-KDJGJR7F.js → chunk-YSRUYAVU.js} +2 -2
  141. package/dist/{chunk-NLKLXXTO.js → chunk-YYP7WSEB.js} +2 -2
  142. package/dist/{chunk-4G25SDQL.js → chunk-ZN4FD4PE.js} +4 -4
  143. package/dist/{chunk-XSN63FUS.js → chunk-ZORTV6NH.js} +2 -2
  144. package/dist/{chunk-S3I7VKID.js → chunk-ZVO4QVPD.js} +5 -5
  145. package/dist/classified/index.js +5 -6
  146. package/dist/{classified-marker-KL4YXUXD.js → classified-marker-LI2SF2E4.js} +3 -5
  147. package/dist/{classified-marker-KL4YXUXD.js.map → classified-marker-LI2SF2E4.js.map} +1 -1
  148. package/dist/collection-facade-4GRREZ6C.js +45 -0
  149. package/dist/computed-VPOKQK4N.js +10 -0
  150. package/dist/consent/index.js +9 -10
  151. package/dist/consent/index.js.map +1 -1
  152. package/dist/cover/index.js +9 -10
  153. package/dist/crdt/index.js +0 -1
  154. package/dist/crdt/index.js.map +1 -1
  155. package/dist/custody/index.js +12 -13
  156. package/dist/{dead-filter-ZGRFZKYE.js → dead-filter-TSWZQRR5.js} +2 -3
  157. package/dist/{dead-filter-ZGRFZKYE.js.map → dead-filter-TSWZQRR5.js.map} +1 -1
  158. package/dist/debug/index.js +1 -2
  159. package/dist/debug/index.js.map +1 -1
  160. package/dist/{delegation-2DO3VI5E.js → delegation-OVIFFPG4.js} +11 -12
  161. package/dist/{delegation-2DO3VI5E.js.map → delegation-OVIFFPG4.js.map} +1 -1
  162. package/dist/derivations/index.js +30 -16
  163. package/dist/derive-6O5SWQKN.js +21 -0
  164. package/dist/directory/index.js +10 -11
  165. package/dist/dispatch-S73TK3IY.js +302 -0
  166. package/dist/dispatch-S73TK3IY.js.map +1 -0
  167. package/dist/{dispatch-M62IAL2S.js → dispatch-WC6X2M6C.js} +5 -7
  168. package/dist/{dispatch-M62IAL2S.js.map → dispatch-WC6X2M6C.js.map} +1 -1
  169. package/dist/{enclave-4P4KH5ZW.js → enclave-KJOTOH7X.js} +9 -10
  170. package/dist/executor-5NIMLSKZ.js +8 -0
  171. package/dist/executor-AQVXV5GZ.js +8 -0
  172. package/dist/executor-PUAO6AKJ.js +29 -0
  173. package/dist/export-accessible-72EQNBMR.js +22 -0
  174. package/dist/extract-partition-PUYNU3UF.js +37 -0
  175. package/dist/{fanout-sidecar-BRQHWTZQ.js → fanout-sidecar-WUFXNYP4.js} +9 -10
  176. package/dist/{fanout-sidecar-BRQHWTZQ.js.map → fanout-sidecar-WUFXNYP4.js.map} +1 -1
  177. package/dist/{fence-watcher-ZVSMLKQD.js → fence-watcher-U2PW6JU5.js} +1 -3
  178. package/dist/{fence-watcher-ZVSMLKQD.js.map → fence-watcher-U2PW6JU5.js.map} +1 -1
  179. package/dist/find-2ABFCZX4.js +10 -0
  180. package/dist/forget/index.js +9 -10
  181. package/dist/forget/index.js.map +1 -1
  182. package/dist/guards/index.js +4 -5
  183. package/dist/history/index.js +13 -14
  184. package/dist/history/index.js.map +1 -1
  185. package/dist/i18n/index.js +14 -15
  186. package/dist/i18n/index.js.map +1 -1
  187. package/dist/index.d.ts +20 -4
  188. package/dist/index.js +122 -115
  189. package/dist/index.js.map +1 -1
  190. package/dist/indexing/index.js +2 -3
  191. package/dist/indexing/index.js.map +1 -1
  192. package/dist/introspection/index.js +13 -13
  193. package/dist/issue-SIDORTSZ.js +18 -0
  194. package/dist/{json-schema-I22JCYCG.js → json-schema-V3M5MUCM.js} +1 -3
  195. package/dist/{json-schema-I22JCYCG.js.map → json-schema-V3M5MUCM.js.map} +1 -1
  196. package/dist/kernel/collection-config.d.ts +34 -0
  197. package/dist/kernel/collection.d.ts +11 -6
  198. package/dist/kernel/errors.d.ts +45 -0
  199. package/dist/kernel/match-pairs.d.ts +30 -0
  200. package/dist/kernel/types.d.ts +66 -0
  201. package/dist/lazy/index.js +3 -3
  202. package/dist/{ledger-4X5ZH43X.js → ledger-F33ZVMTK.js} +11 -12
  203. package/dist/liberate-LCDPNAG2.js +24 -0
  204. package/dist/link-set-FKNWAYKS.js +30 -0
  205. package/dist/{managed-secret-CXALLEUB.js → managed-secret-PQYKSR6T.js} +10 -11
  206. package/dist/materialized-views/index.js +21 -21
  207. package/dist/{migrate-cek-LBRKYUZZ.js → migrate-cek-5ENH64AA.js} +2 -3
  208. package/dist/{migrate-cek-LBRKYUZZ.js.map → migrate-cek-5ENH64AA.js.map} +1 -1
  209. package/dist/money/index.js +4 -5
  210. package/dist/noydb-DUXZPKSN.js +90 -0
  211. package/dist/overlay-views/index.js +4 -5
  212. package/dist/periods/index.js +12 -13
  213. package/dist/pod/index.js +64 -60
  214. package/dist/{pod-handle-DHEYBTJ2.js → pod-handle-Q736KYON.js} +10 -11
  215. package/dist/{pod-handle-DHEYBTJ2.js.map → pod-handle-Q736KYON.js.map} +1 -1
  216. package/dist/policy/index.js +10 -11
  217. package/dist/port/to/index.d.ts +40 -0
  218. package/dist/portability/index.js +8 -9
  219. package/dist/portability/index.js.map +1 -1
  220. package/dist/{post-register-4DXRYGTU.js → post-register-LNE2FE2A.js} +6 -7
  221. package/dist/{post-register-4DXRYGTU.js.map → post-register-LNE2FE2A.js.map} +1 -1
  222. package/dist/{purge-scope-FGNNLWHD.js → purge-scope-4HEFPDOW.js} +1 -3
  223. package/dist/{purge-scope-FGNNLWHD.js.map → purge-scope-4HEFPDOW.js.map} +1 -1
  224. package/dist/query/index.js +3 -4
  225. package/dist/{read-only-facade-CHCKSEPD.js → read-only-facade-BIGO37U3.js} +1 -2
  226. package/dist/reduce/index.js +4 -5
  227. package/dist/reduce/index.js.map +1 -1
  228. package/dist/register-I2DZXGAR.js +31 -0
  229. package/dist/registry-23WF3TGH.js +8 -0
  230. package/dist/registry-4AYVUNXK.js +8 -0
  231. package/dist/registry-VSSQPIGF.js +18 -0
  232. package/dist/registry-YLEWMGAC.js +32 -0
  233. package/dist/request-withdrawal-KFQHEZ25.js +30 -0
  234. package/dist/{reveal-X2QMWOVX.js → reveal-67RDQRIN.js} +6 -7
  235. package/dist/{reveal-X2QMWOVX.js.map → reveal-67RDQRIN.js.map} +1 -1
  236. package/dist/revoke-DQDZAZZM.js +23 -0
  237. package/dist/satellites/index.js +1 -2
  238. package/dist/schema-update/index.js +2 -3
  239. package/dist/sealed-record/index.js +12 -13
  240. package/dist/sealed-record/index.js.map +1 -1
  241. package/dist/search/index.js +4 -5
  242. package/dist/{seed-IX5NFSH5.js → seed-G42JYN56.js} +12 -13
  243. package/dist/{seed-IX5NFSH5.js.map → seed-G42JYN56.js.map} +1 -1
  244. package/dist/sequence/index.js +9 -10
  245. package/dist/session/index.js +9 -10
  246. package/dist/session/index.js.map +1 -1
  247. package/dist/shadow/index.js +2 -3
  248. package/dist/shadow/index.js.map +1 -1
  249. package/dist/share-link/index.js +0 -1
  250. package/dist/share-link/index.js.map +1 -1
  251. package/dist/signer-WAMDZHEN.js +24 -0
  252. package/dist/snapshots/index.js +10 -11
  253. package/dist/snapshots/index.js.map +1 -1
  254. package/dist/{stale-5I36LPVK.js → stale-DDL7WQEZ.js} +10 -11
  255. package/dist/storage-FLR73HHF.js +22 -0
  256. package/dist/store/index.js +0 -1
  257. package/dist/{store-coordination-provider-OLPNRMFO.js → store-coordination-provider-MEQ2MJQG.js} +10 -11
  258. package/dist/{store-coordination-provider-OLPNRMFO.js.map → store-coordination-provider-MEQ2MJQG.js.map} +1 -1
  259. package/dist/sync/index.js +10 -11
  260. package/dist/sync/index.js.map +1 -1
  261. package/dist/team/index.js +15 -16
  262. package/dist/tiers/index.js +11 -12
  263. package/dist/to/index.js +2 -3
  264. package/dist/to/index.js.map +1 -1
  265. package/dist/transactions/index.js +3 -4
  266. package/dist/transactions/index.js.map +1 -1
  267. package/dist/{ulid-VQW6ERQN.js → ulid-4MKXG325.js} +1 -2
  268. package/dist/util/index.js +1 -2
  269. package/dist/util/index.js.map +1 -1
  270. package/dist/{vault-diff-FE5J35NJ.js → vault-diff-C6WUJFNP.js} +1 -2
  271. package/dist/vault-head/index.js +8 -9
  272. package/dist/vault-head/index.js.map +1 -1
  273. package/dist/{verify-WYOFLSNA.js → verify-KOV2G5D6.js} +5 -6
  274. package/dist/{verify-WYOFLSNA.js.map → verify-KOV2G5D6.js.map} +1 -1
  275. package/dist/walk-3UQBRMDV.js +21 -0
  276. package/dist/with-formula/derivations/dispatch.d.ts +16 -1
  277. package/dist/with-formula/derivations/registry.d.ts +20 -0
  278. package/dist/with-formula/derivations/trigger-match.d.ts +104 -0
  279. package/dist/with-formula/derivations/types.d.ts +61 -0
  280. package/dist/with-party/team/roster-epoch.d.ts +71 -0
  281. package/dist/with-party/team/roster-tag.d.ts +1 -1
  282. package/dist/with-shape/introspection/behaviors.d.ts +7 -0
  283. package/dist/with-shape/introspection/describe.d.ts +10 -1
  284. package/dist/with-shape/introspection/field-meta.d.ts +86 -0
  285. package/dist/withdraw-accessible-EL5GXZBS.js +27 -0
  286. package/package.json +8 -3
  287. package/dist/api-OAZLPNVV.js +0 -20
  288. package/dist/chunk-4FPEWQKF.js.map +0 -1
  289. package/dist/chunk-5263OEM3.js +0 -344
  290. package/dist/chunk-5263OEM3.js.map +0 -1
  291. package/dist/chunk-GU3LQYW2.js.map +0 -1
  292. package/dist/chunk-JBIV4FLR.js.map +0 -1
  293. package/dist/chunk-JJZIIJSA.js.map +0 -1
  294. package/dist/chunk-KHKKD62N.js.map +0 -1
  295. package/dist/chunk-NO272T7Q.js.map +0 -1
  296. package/dist/chunk-OMHHGOG4.js.map +0 -1
  297. package/dist/chunk-P6ASQOZR.js.map +0 -1
  298. package/dist/chunk-PRHCMEUK.js.map +0 -1
  299. package/dist/chunk-PZ5AY32C.js +0 -10
  300. package/dist/chunk-RDHUZ674.js.map +0 -1
  301. package/dist/chunk-VAG47QHV.js +0 -81
  302. package/dist/chunk-VAG47QHV.js.map +0 -1
  303. package/dist/chunk-VVAVTSTR.js.map +0 -1
  304. package/dist/chunk-YPSOHDNC.js.map +0 -1
  305. package/dist/chunk-ZTYG36DH.js.map +0 -1
  306. package/dist/collection-facade-6IY2LW6W.js +0 -45
  307. package/dist/computed-ASBNTLOK.js +0 -11
  308. package/dist/derive-TCTS7ULE.js +0 -22
  309. package/dist/dispatch-FNCCONFK.js +0 -194
  310. package/dist/dispatch-FNCCONFK.js.map +0 -1
  311. package/dist/executor-AFHQYRAU.js +0 -9
  312. package/dist/executor-CDIMJVE2.js +0 -29
  313. package/dist/executor-YYDW6XQI.js +0 -9
  314. package/dist/export-accessible-WADNWX35.js +0 -23
  315. package/dist/extract-partition-SHQYQSWE.js +0 -38
  316. package/dist/find-SZBL2HPB.js +0 -11
  317. package/dist/issue-2DGG7NKE.js +0 -19
  318. package/dist/liberate-7NEPRE52.js +0 -25
  319. package/dist/link-set-WHTYVTOV.js +0 -31
  320. package/dist/noydb-BQ3ZTN2Z.js +0 -86
  321. package/dist/register-GLCOH73C.js +0 -32
  322. package/dist/registry-GWGHZWGP.js +0 -19
  323. package/dist/registry-IWFMXCHX.js +0 -9
  324. package/dist/registry-Q3FG3OAX.js +0 -9
  325. package/dist/registry-T346IZCF.js +0 -18
  326. package/dist/request-withdrawal-2RERJECX.js +0 -31
  327. package/dist/revoke-4NRSCPNW.js +0 -24
  328. package/dist/signer-HJHTGX7X.js +0 -25
  329. package/dist/storage-ZYYAB3J3.js +0 -23
  330. package/dist/walk-LTV7LOCN.js +0 -21
  331. package/dist/withdraw-accessible-V4XCPH7U.js +0 -28
  332. package/dist/withdraw-accessible-V4XCPH7U.js.map +0 -1
  333. package/dist/zod-HAJM7LMS.js +0 -14763
  334. package/dist/zod-HAJM7LMS.js.map +0 -1
  335. /package/dist/{api-OAZLPNVV.js.map → api-TXFOVOXX.js.map} +0 -0
  336. /package/dist/{chunk-X6TBQKHW.js.map → chunk-2577DKXB.js.map} +0 -0
  337. /package/dist/{chunk-L3FHEWA3.js.map → chunk-2N4GY74U.js.map} +0 -0
  338. /package/dist/{chunk-626TSARM.js.map → chunk-2Y4IMKA6.js.map} +0 -0
  339. /package/dist/{chunk-7CWII4BL.js.map → chunk-3RCJJBNR.js.map} +0 -0
  340. /package/dist/{chunk-M7UC2QPT.js.map → chunk-453F654R.js.map} +0 -0
  341. /package/dist/{chunk-2QNKXGUS.js.map → chunk-4GVM6QZA.js.map} +0 -0
  342. /package/dist/{chunk-AB5P32RE.js.map → chunk-4OZNXTO4.js.map} +0 -0
  343. /package/dist/{chunk-L3HDEHGM.js.map → chunk-5VCRVKOZ.js.map} +0 -0
  344. /package/dist/{chunk-6AQIFBSP.js.map → chunk-5WDXHNSW.js.map} +0 -0
  345. /package/dist/{chunk-BOFRKAUS.js.map → chunk-6GMZ7HEE.js.map} +0 -0
  346. /package/dist/{chunk-XBFEKTIY.js.map → chunk-6I2RQCET.js.map} +0 -0
  347. /package/dist/{chunk-UCUALOSM.js.map → chunk-6YXCPL4T.js.map} +0 -0
  348. /package/dist/{chunk-BYBB4ABD.js.map → chunk-77K4PG6P.js.map} +0 -0
  349. /package/dist/{chunk-S2VG3ABP.js.map → chunk-7MG2LHO5.js.map} +0 -0
  350. /package/dist/{chunk-EO2KGKEJ.js.map → chunk-7V4TP3AF.js.map} +0 -0
  351. /package/dist/{chunk-LFDMKZIP.js.map → chunk-ANATMFIO.js.map} +0 -0
  352. /package/dist/{chunk-T3PHCEN4.js.map → chunk-ANSIZYEG.js.map} +0 -0
  353. /package/dist/{chunk-ZKRRBRSZ.js.map → chunk-AO42KJO6.js.map} +0 -0
  354. /package/dist/{chunk-VFIWDPXZ.js.map → chunk-BLN54W3L.js.map} +0 -0
  355. /package/dist/{chunk-ZQ2UUHSL.js.map → chunk-BM5TWITZ.js.map} +0 -0
  356. /package/dist/{chunk-WLFABTZ6.js.map → chunk-BOET4NA4.js.map} +0 -0
  357. /package/dist/{chunk-FOG7YEJP.js.map → chunk-BOWNCWZT.js.map} +0 -0
  358. /package/dist/{chunk-7XODKGTW.js.map → chunk-BSFNRLK2.js.map} +0 -0
  359. /package/dist/{chunk-J4MN6XIU.js.map → chunk-BZ3534YM.js.map} +0 -0
  360. /package/dist/{chunk-IF56DYJK.js.map → chunk-CPWQB3N5.js.map} +0 -0
  361. /package/dist/{chunk-SHILAQH5.js.map → chunk-DGOZ4UZD.js.map} +0 -0
  362. /package/dist/{chunk-BWWUXE3L.js.map → chunk-ELNXJMGB.js.map} +0 -0
  363. /package/dist/{chunk-44C2URL7.js.map → chunk-EQEYOJBM.js.map} +0 -0
  364. /package/dist/{chunk-Y3XWRDAM.js.map → chunk-EYBQEIUY.js.map} +0 -0
  365. /package/dist/{chunk-Z7ZXZL6Y.js.map → chunk-FAHMLERK.js.map} +0 -0
  366. /package/dist/{chunk-EXDIHWFO.js.map → chunk-FMZY5Q6L.js.map} +0 -0
  367. /package/dist/{chunk-H6WXKZL7.js.map → chunk-FXBIP2WD.js.map} +0 -0
  368. /package/dist/{chunk-672U6STZ.js.map → chunk-GPEQUXHL.js.map} +0 -0
  369. /package/dist/{chunk-Z2PWOSCJ.js.map → chunk-GY4WYNNG.js.map} +0 -0
  370. /package/dist/{chunk-4A4TYISP.js.map → chunk-JBDFMYKQ.js.map} +0 -0
  371. /package/dist/{chunk-POS53FG6.js.map → chunk-JMGDHKQF.js.map} +0 -0
  372. /package/dist/{chunk-Q7GEDVHC.js.map → chunk-K6LHRFBL.js.map} +0 -0
  373. /package/dist/{chunk-4JDIRUTT.js.map → chunk-K7NTTA6P.js.map} +0 -0
  374. /package/dist/{chunk-26W5VETY.js.map → chunk-KG7TZKZG.js.map} +0 -0
  375. /package/dist/{chunk-RJ7RIIX6.js.map → chunk-KJIMGIWO.js.map} +0 -0
  376. /package/dist/{chunk-F7ZFRPGQ.js.map → chunk-KTFRCC5C.js.map} +0 -0
  377. /package/dist/{chunk-HSGEIMJS.js.map → chunk-KUJDV5QH.js.map} +0 -0
  378. /package/dist/{chunk-UPJMBMCR.js.map → chunk-L742JPKZ.js.map} +0 -0
  379. /package/dist/{chunk-4TZUFNXL.js.map → chunk-L7CIOOBW.js.map} +0 -0
  380. /package/dist/{chunk-7LYUJNU3.js.map → chunk-LWBCUYZW.js.map} +0 -0
  381. /package/dist/{chunk-JHLJQUXU.js.map → chunk-MUM7IANK.js.map} +0 -0
  382. /package/dist/{chunk-2GXEQUEX.js.map → chunk-MVMXZYXT.js.map} +0 -0
  383. /package/dist/{chunk-XLPXGN66.js.map → chunk-NA2NIJZI.js.map} +0 -0
  384. /package/dist/{chunk-S6YB5ZRP.js.map → chunk-NKHRDYOR.js.map} +0 -0
  385. /package/dist/{chunk-XJ3FEKEY.js.map → chunk-NQKIUNW5.js.map} +0 -0
  386. /package/dist/{chunk-6NRVFD55.js.map → chunk-PT43Y56J.js.map} +0 -0
  387. /package/dist/{chunk-5ACAVJUI.js.map → chunk-Q2PU57HC.js.map} +0 -0
  388. /package/dist/{chunk-E6YA6UAP.js.map → chunk-Q7HZX3IF.js.map} +0 -0
  389. /package/dist/{chunk-4ZPE6SKS.js.map → chunk-QIBVIOXO.js.map} +0 -0
  390. /package/dist/{chunk-WLLUM35R.js.map → chunk-QIZPZMUI.js.map} +0 -0
  391. /package/dist/{chunk-LKFKXS5K.js.map → chunk-RMF67KCG.js.map} +0 -0
  392. /package/dist/{chunk-YCSM3GZU.js.map → chunk-RMS3NEA3.js.map} +0 -0
  393. /package/dist/{chunk-OPXR4PB2.js.map → chunk-SFAWCTEM.js.map} +0 -0
  394. /package/dist/{chunk-3QARDAYW.js.map → chunk-SKGMN35F.js.map} +0 -0
  395. /package/dist/{chunk-W5LHQXZU.js.map → chunk-SL3JAAKN.js.map} +0 -0
  396. /package/dist/{chunk-UALOYGCP.js.map → chunk-SPYWXKJN.js.map} +0 -0
  397. /package/dist/{chunk-QU3YUP2X.js.map → chunk-SZJ3DLZA.js.map} +0 -0
  398. /package/dist/{chunk-225O5CXQ.js.map → chunk-TFR7DSOV.js.map} +0 -0
  399. /package/dist/{chunk-X67FCULK.js.map → chunk-TRGTKX5E.js.map} +0 -0
  400. /package/dist/{chunk-JVLSU7S2.js.map → chunk-TUFM4UZP.js.map} +0 -0
  401. /package/dist/{chunk-HTGRQZFB.js.map → chunk-UGTBXF5U.js.map} +0 -0
  402. /package/dist/{chunk-THNJ3IKU.js.map → chunk-ULUMAZ5S.js.map} +0 -0
  403. /package/dist/{chunk-XDVVBETV.js.map → chunk-UXVWEX5L.js.map} +0 -0
  404. /package/dist/{chunk-FKFIEEY6.js.map → chunk-UXWB3FPF.js.map} +0 -0
  405. /package/dist/{chunk-CBRS2NEK.js.map → chunk-VTFVLCUH.js.map} +0 -0
  406. /package/dist/{chunk-TOV6VMHF.js.map → chunk-VXANTWBJ.js.map} +0 -0
  407. /package/dist/{chunk-VSLUSXVK.js.map → chunk-VXGSWL6L.js.map} +0 -0
  408. /package/dist/{chunk-HQINBNHM.js.map → chunk-WEQEYLCS.js.map} +0 -0
  409. /package/dist/{chunk-U6GCYG2T.js.map → chunk-X2DLENDQ.js.map} +0 -0
  410. /package/dist/{chunk-XVU7J43V.js.map → chunk-XLMEZIAJ.js.map} +0 -0
  411. /package/dist/{chunk-ILSR22WM.js.map → chunk-XTXOCYOJ.js.map} +0 -0
  412. /package/dist/{chunk-KDJGJR7F.js.map → chunk-YSRUYAVU.js.map} +0 -0
  413. /package/dist/{chunk-NLKLXXTO.js.map → chunk-YYP7WSEB.js.map} +0 -0
  414. /package/dist/{chunk-4G25SDQL.js.map → chunk-ZN4FD4PE.js.map} +0 -0
  415. /package/dist/{chunk-XSN63FUS.js.map → chunk-ZORTV6NH.js.map} +0 -0
  416. /package/dist/{chunk-S3I7VKID.js.map → chunk-ZVO4QVPD.js.map} +0 -0
  417. /package/dist/{chunk-PZ5AY32C.js.map → collection-facade-4GRREZ6C.js.map} +0 -0
  418. /package/dist/{collection-facade-6IY2LW6W.js.map → computed-VPOKQK4N.js.map} +0 -0
  419. /package/dist/{computed-ASBNTLOK.js.map → derive-6O5SWQKN.js.map} +0 -0
  420. /package/dist/{derive-TCTS7ULE.js.map → enclave-KJOTOH7X.js.map} +0 -0
  421. /package/dist/{enclave-4P4KH5ZW.js.map → executor-5NIMLSKZ.js.map} +0 -0
  422. /package/dist/{executor-AFHQYRAU.js.map → executor-AQVXV5GZ.js.map} +0 -0
  423. /package/dist/{executor-CDIMJVE2.js.map → executor-PUAO6AKJ.js.map} +0 -0
  424. /package/dist/{executor-YYDW6XQI.js.map → export-accessible-72EQNBMR.js.map} +0 -0
  425. /package/dist/{export-accessible-WADNWX35.js.map → extract-partition-PUYNU3UF.js.map} +0 -0
  426. /package/dist/{extract-partition-SHQYQSWE.js.map → find-2ABFCZX4.js.map} +0 -0
  427. /package/dist/{find-SZBL2HPB.js.map → issue-SIDORTSZ.js.map} +0 -0
  428. /package/dist/{issue-2DGG7NKE.js.map → ledger-F33ZVMTK.js.map} +0 -0
  429. /package/dist/{ledger-4X5ZH43X.js.map → liberate-LCDPNAG2.js.map} +0 -0
  430. /package/dist/{liberate-7NEPRE52.js.map → link-set-FKNWAYKS.js.map} +0 -0
  431. /package/dist/{link-set-WHTYVTOV.js.map → managed-secret-PQYKSR6T.js.map} +0 -0
  432. /package/dist/{managed-secret-CXALLEUB.js.map → noydb-DUXZPKSN.js.map} +0 -0
  433. /package/dist/{noydb-BQ3ZTN2Z.js.map → read-only-facade-BIGO37U3.js.map} +0 -0
  434. /package/dist/{read-only-facade-CHCKSEPD.js.map → register-I2DZXGAR.js.map} +0 -0
  435. /package/dist/{register-GLCOH73C.js.map → registry-23WF3TGH.js.map} +0 -0
  436. /package/dist/{registry-GWGHZWGP.js.map → registry-4AYVUNXK.js.map} +0 -0
  437. /package/dist/{registry-IWFMXCHX.js.map → registry-VSSQPIGF.js.map} +0 -0
  438. /package/dist/{registry-Q3FG3OAX.js.map → registry-YLEWMGAC.js.map} +0 -0
  439. /package/dist/{registry-T346IZCF.js.map → request-withdrawal-KFQHEZ25.js.map} +0 -0
  440. /package/dist/{request-withdrawal-2RERJECX.js.map → revoke-DQDZAZZM.js.map} +0 -0
  441. /package/dist/{revoke-4NRSCPNW.js.map → signer-WAMDZHEN.js.map} +0 -0
  442. /package/dist/{signer-HJHTGX7X.js.map → stale-DDL7WQEZ.js.map} +0 -0
  443. /package/dist/{stale-5I36LPVK.js.map → storage-FLR73HHF.js.map} +0 -0
  444. /package/dist/{storage-ZYYAB3J3.js.map → ulid-4MKXG325.js.map} +0 -0
  445. /package/dist/{ulid-VQW6ERQN.js.map → vault-diff-C6WUJFNP.js.map} +0 -0
  446. /package/dist/{vault-diff-FE5J35NJ.js.map → walk-3UQBRMDV.js.map} +0 -0
  447. /package/dist/{walk-LTV7LOCN.js.map → withdraw-accessible-EL5GXZBS.js.map} +0 -0
@@ -1,20 +1,19 @@
1
1
  import {
2
2
  buildRecordAad,
3
3
  openEnvelopeJson
4
- } from "./chunk-BYBB4ABD.js";
4
+ } from "./chunk-77K4PG6P.js";
5
5
  import {
6
6
  buildRecordEnvelope
7
- } from "./chunk-QU3YUP2X.js";
8
- import "./chunk-FOG7YEJP.js";
9
- import "./chunk-KDJGJR7F.js";
10
- import "./chunk-LKFKXS5K.js";
7
+ } from "./chunk-SZJ3DLZA.js";
8
+ import "./chunk-BOWNCWZT.js";
9
+ import "./chunk-YSRUYAVU.js";
10
+ import "./chunk-RMF67KCG.js";
11
11
  import "./chunk-LP7BEXCT.js";
12
12
  import {
13
13
  encrypt
14
- } from "./chunk-W5LHQXZU.js";
15
- import "./chunk-GU3LQYW2.js";
16
- import "./chunk-JBIV4FLR.js";
17
- import "./chunk-PZ5AY32C.js";
14
+ } from "./chunk-SL3JAAKN.js";
15
+ import "./chunk-7MG7SJT7.js";
16
+ import "./chunk-7O3Y4PPD.js";
18
17
 
19
18
  // src/with-formula/derivations/fanout-sidecar.ts
20
19
  var FANOUT_DEK_COLLECTION = "_meta";
@@ -62,4 +61,4 @@ export {
62
61
  loadFanoutSidecar,
63
62
  saveFanoutSidecar
64
63
  };
65
- //# sourceMappingURL=fanout-sidecar-BRQHWTZQ.js.map
64
+ //# sourceMappingURL=fanout-sidecar-WUFXNYP4.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/with-formula/derivations/fanout-sidecar.ts"],"sourcesContent":["/**\n * Per-source-row fanout sidecar for `shape: 'array'` derivations.\n *\n * Each `(sourceCollection, sourceId, outputKey)` triple gets its own\n * envelope at:\n *\n * _meta/derivations-fanout/<sourceCollection>/<sourceId>/<outputKey>\n *\n * The envelope records the last-emitted derived row ids so the\n * dispatcher can compute the diff on every source-row update in O(1):\n * read prior keys, compute `toDelete = prev \\ new`, write new, persist\n * back.\n *\n * The body is encrypted (AES-GCM under the `_meta` collection DEK) when\n * the vault is encrypted — the `keys[]` are derived-row ids produced by a\n * user-supplied key extractor and can be content-bearing (SKU, tag, email),\n * so a ciphertext-only store must not read them, the derivation graph, or\n * `emittedAt`. Back-compat: sidecars written before this fix are plaintext\n * (`_iv === ''`); `loadFanoutSidecar` dual-reads them.\n *\n * @module\n */\nimport type { NoydbStore, EncryptedEnvelope } from '../../kernel/types.js'\nimport { buildRecordAad, buildRecordEnvelope, encrypt, openEnvelopeJson, type EnclaveKey } from '../../kernel/enclave/index.js'\n\ntype GetDEK = (collectionName: string) => Promise<EnclaveKey>\n\n/** The `_meta` collection name whose DEK encrypts the sidecar body. */\nconst FANOUT_DEK_COLLECTION = '_meta'\n\n/** Magic-prefixed JSON payload at `_meta/<recordId>`. */\nexport interface FanoutSidecar {\n readonly _noydb_fanout: 1\n /** Source collection name. */\n readonly source: string\n /** Source record id. */\n readonly sourceId: string\n /** Strategy output key (the key in `strategy.outputs`). */\n readonly outputKey: string\n /** Output collection name (audit / forensics). */\n readonly outputCollection: string\n /** Derived-row ids last emitted for this (source, output) pair. */\n readonly keys: ReadonlyArray<string>\n /** ISO timestamp of last dispatch. */\n readonly emittedAt: string\n}\n\n/**\n * Build the canonical `_meta` record id for a fanout sidecar.\n *\n * The full path inside the store is `_meta/<this-string>`. We pack the\n * full triple into the id so a single `_meta` collection holds all\n * sidecars (collection-per-source would proliferate names; the\n * existing `_meta` flat namespace is cheaper).\n */\nfunction recordId(source: string, sourceId: string, outputKey: string): string {\n // Use `/` as a separator. None of the components is supposed to\n // contain it (collection names + output keys are bare identifiers;\n // source ids are typically ULIDs / UUIDs / app-chosen strings\n // without slashes). If a future source carries `/` in its id, we'd\n // need an escape; deferred until that's a real case.\n return `derivations-fanout/${source}/${sourceId}/${outputKey}`\n}\n\n/**\n * Read the sidecar; returns `undefined` only when it's legitimately absent\n * (no envelope at that id) — the correct signal for callers to skip\n * orphan-row reconciliation because there's nothing to reconcile against.\n *\n * A PRESENT envelope that fails to decrypt or parse is a data-integrity\n * problem, not an absence, and is deliberately NOT caught here: swallowing\n * it to `undefined` would look identical to \"no sidecar\" and make callers\n * (the array-derivation dispatch in `vault.ts`/`collection.ts`) silently\n * skip deleting stale derived rows on a shrink. Let `openEnvelopeJson`'s\n * `DecryptionError`/`TamperedError` and `JSON.parse` failures propagate,\n * matching the no-catch convention of sibling decrypt call-sites (e.g.\n * `with-audit/consent/consent.ts`'s `decryptEntry`).\n *\n * Dual-reads for back-compat: an envelope with `_iv === ''` is a legacy\n * plaintext sidecar (parse `_data` directly); otherwise the body was\n * encrypted under the `_meta` DEK and is decrypted first.\n */\nexport async function loadFanoutSidecar(\n store: NoydbStore,\n vault: string,\n source: string,\n sourceId: string,\n outputKey: string,\n getDEK: GetDEK,\n encrypted: boolean,\n): Promise<FanoutSidecar | undefined> {\n const envelope = await store.get(vault, '_meta', recordId(source, sourceId, outputKey))\n if (!envelope) return undefined\n // Legacy plaintext (`_iv === ''`) reads directly; encrypted bodies decrypt.\n const json = (!encrypted || envelope._iv === '')\n ? envelope._data\n : await openEnvelopeJson({ collection: '_meta', id: recordId(source, sourceId, outputKey) }, envelope, await getDEK(FANOUT_DEK_COLLECTION))\n const parsed = JSON.parse(json) as FanoutSidecar\n if (parsed._noydb_fanout !== 1) return undefined\n if (!Array.isArray(parsed.keys)) return undefined\n return parsed\n}\n\n/**\n * Persist (insert/replace) the sidecar with a fresh key set. The body is\n * encrypted under the `_meta` DEK when the vault is encrypted (the `keys[]`\n * can be content-bearing); plaintext only in debug/unencrypted vaults.\n */\nexport async function saveFanoutSidecar(\n store: NoydbStore,\n vault: string,\n payload: {\n readonly source: string\n readonly sourceId: string\n readonly outputKey: string\n readonly outputCollection: string\n readonly keys: ReadonlyArray<string>\n },\n getDEK: GetDEK,\n encrypted: boolean,\n): Promise<void> {\n const doc: FanoutSidecar = {\n _noydb_fanout: 1,\n source: payload.source,\n sourceId: payload.sourceId,\n outputKey: payload.outputKey,\n outputCollection: payload.outputCollection,\n keys: payload.keys,\n emittedAt: new Date().toISOString(),\n }\n const id = recordId(payload.source, payload.sourceId, payload.outputKey)\n const prior = await store.get(vault, '_meta', id)\n const json = JSON.stringify(doc)\n const version = (prior?._v ?? 0) + 1\n const identity = { collection: '_meta', id, version }\n let envelope: EncryptedEnvelope\n if (!encrypted) {\n envelope = buildRecordEnvelope(identity, { iv: '', data: json })\n } else {\n const { iv, data } = await encrypt(json, await getDEK(FANOUT_DEK_COLLECTION), buildRecordAad(identity))\n envelope = buildRecordEnvelope(identity, { iv, data })\n }\n await store.put(vault, '_meta', id, envelope)\n}\n\n/** Delete the sidecar (used on source-row delete cascade). */\nexport async function deleteFanoutSidecar(\n store: NoydbStore,\n vault: string,\n source: string,\n sourceId: string,\n outputKey: string,\n): Promise<void> {\n await store.delete(vault, '_meta', recordId(source, sourceId, outputKey))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4BA,IAAM,wBAAwB;AA2B9B,SAAS,SAAS,QAAgB,UAAkB,WAA2B;AAM7E,SAAO,sBAAsB,MAAM,IAAI,QAAQ,IAAI,SAAS;AAC9D;AAoBA,eAAsB,kBACpB,OACA,OACA,QACA,UACA,WACA,QACA,WACoC;AACpC,QAAM,WAAW,MAAM,MAAM,IAAI,OAAO,SAAS,SAAS,QAAQ,UAAU,SAAS,CAAC;AACtF,MAAI,CAAC,SAAU,QAAO;AAEtB,QAAM,OAAQ,CAAC,aAAa,SAAS,QAAQ,KACzC,SAAS,QACT,MAAM,iBAAiB,EAAE,YAAY,SAAS,IAAI,SAAS,QAAQ,UAAU,SAAS,EAAE,GAAG,UAAU,MAAM,OAAO,qBAAqB,CAAC;AAC5I,QAAM,SAAS,KAAK,MAAM,IAAI;AAC9B,MAAI,OAAO,kBAAkB,EAAG,QAAO;AACvC,MAAI,CAAC,MAAM,QAAQ,OAAO,IAAI,EAAG,QAAO;AACxC,SAAO;AACT;AAOA,eAAsB,kBACpB,OACA,OACA,SAOA,QACA,WACe;AACf,QAAM,MAAqB;AAAA,IACzB,eAAe;AAAA,IACf,QAAQ,QAAQ;AAAA,IAChB,UAAU,QAAQ;AAAA,IAClB,WAAW,QAAQ;AAAA,IACnB,kBAAkB,QAAQ;AAAA,IAC1B,MAAM,QAAQ;AAAA,IACd,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,EACpC;AACA,QAAM,KAAK,SAAS,QAAQ,QAAQ,QAAQ,UAAU,QAAQ,SAAS;AACvE,QAAM,QAAQ,MAAM,MAAM,IAAI,OAAO,SAAS,EAAE;AAChD,QAAM,OAAO,KAAK,UAAU,GAAG;AAC/B,QAAM,WAAW,OAAO,MAAM,KAAK;AACnC,QAAM,WAAW,EAAE,YAAY,SAAS,IAAI,QAAQ;AACpD,MAAI;AACJ,MAAI,CAAC,WAAW;AACd,eAAW,oBAAoB,UAAU,EAAE,IAAI,IAAI,MAAM,KAAK,CAAC;AAAA,EACjE,OAAO;AACL,UAAM,EAAE,IAAI,KAAK,IAAI,MAAM,QAAQ,MAAM,MAAM,OAAO,qBAAqB,GAAG,eAAe,QAAQ,CAAC;AACtG,eAAW,oBAAoB,UAAU,EAAE,IAAI,KAAK,CAAC;AAAA,EACvD;AACA,QAAM,MAAM,IAAI,OAAO,SAAS,IAAI,QAAQ;AAC9C;AAGA,eAAsB,oBACpB,OACA,OACA,QACA,UACA,WACe;AACf,QAAM,MAAM,OAAO,OAAO,SAAS,SAAS,QAAQ,UAAU,SAAS,CAAC;AAC1E;","names":[]}
1
+ {"version":3,"sources":["../src/with-formula/derivations/fanout-sidecar.ts"],"sourcesContent":["/**\n * Per-source-row fanout sidecar for `shape: 'array'` derivations.\n *\n * Each `(sourceCollection, sourceId, outputKey)` triple gets its own\n * envelope at:\n *\n * _meta/derivations-fanout/<sourceCollection>/<sourceId>/<outputKey>\n *\n * The envelope records the last-emitted derived row ids so the\n * dispatcher can compute the diff on every source-row update in O(1):\n * read prior keys, compute `toDelete = prev \\ new`, write new, persist\n * back.\n *\n * The body is encrypted (AES-GCM under the `_meta` collection DEK) when\n * the vault is encrypted — the `keys[]` are derived-row ids produced by a\n * user-supplied key extractor and can be content-bearing (SKU, tag, email),\n * so a ciphertext-only store must not read them, the derivation graph, or\n * `emittedAt`. Back-compat: sidecars written before this fix are plaintext\n * (`_iv === ''`); `loadFanoutSidecar` dual-reads them.\n *\n * @module\n */\nimport type { NoydbStore, EncryptedEnvelope } from '../../kernel/types.js'\nimport { buildRecordAad, buildRecordEnvelope, encrypt, openEnvelopeJson, type EnclaveKey } from '../../kernel/enclave/index.js'\n\ntype GetDEK = (collectionName: string) => Promise<EnclaveKey>\n\n/** The `_meta` collection name whose DEK encrypts the sidecar body. */\nconst FANOUT_DEK_COLLECTION = '_meta'\n\n/** Magic-prefixed JSON payload at `_meta/<recordId>`. */\nexport interface FanoutSidecar {\n readonly _noydb_fanout: 1\n /** Source collection name. */\n readonly source: string\n /** Source record id. */\n readonly sourceId: string\n /** Strategy output key (the key in `strategy.outputs`). */\n readonly outputKey: string\n /** Output collection name (audit / forensics). */\n readonly outputCollection: string\n /** Derived-row ids last emitted for this (source, output) pair. */\n readonly keys: ReadonlyArray<string>\n /** ISO timestamp of last dispatch. */\n readonly emittedAt: string\n}\n\n/**\n * Build the canonical `_meta` record id for a fanout sidecar.\n *\n * The full path inside the store is `_meta/<this-string>`. We pack the\n * full triple into the id so a single `_meta` collection holds all\n * sidecars (collection-per-source would proliferate names; the\n * existing `_meta` flat namespace is cheaper).\n */\nfunction recordId(source: string, sourceId: string, outputKey: string): string {\n // Use `/` as a separator. None of the components is supposed to\n // contain it (collection names + output keys are bare identifiers;\n // source ids are typically ULIDs / UUIDs / app-chosen strings\n // without slashes). If a future source carries `/` in its id, we'd\n // need an escape; deferred until that's a real case.\n return `derivations-fanout/${source}/${sourceId}/${outputKey}`\n}\n\n/**\n * Read the sidecar; returns `undefined` only when it's legitimately absent\n * (no envelope at that id) — the correct signal for callers to skip\n * orphan-row reconciliation because there's nothing to reconcile against.\n *\n * A PRESENT envelope that fails to decrypt or parse is a data-integrity\n * problem, not an absence, and is deliberately NOT caught here: swallowing\n * it to `undefined` would look identical to \"no sidecar\" and make callers\n * (the array-derivation dispatch in `vault.ts`/`collection.ts`) silently\n * skip deleting stale derived rows on a shrink. Let `openEnvelopeJson`'s\n * `DecryptionError`/`TamperedError` and `JSON.parse` failures propagate,\n * matching the no-catch convention of sibling decrypt call-sites (e.g.\n * `with-audit/consent/consent.ts`'s `decryptEntry`).\n *\n * Dual-reads for back-compat: an envelope with `_iv === ''` is a legacy\n * plaintext sidecar (parse `_data` directly); otherwise the body was\n * encrypted under the `_meta` DEK and is decrypted first.\n */\nexport async function loadFanoutSidecar(\n store: NoydbStore,\n vault: string,\n source: string,\n sourceId: string,\n outputKey: string,\n getDEK: GetDEK,\n encrypted: boolean,\n): Promise<FanoutSidecar | undefined> {\n const envelope = await store.get(vault, '_meta', recordId(source, sourceId, outputKey))\n if (!envelope) return undefined\n // Legacy plaintext (`_iv === ''`) reads directly; encrypted bodies decrypt.\n const json = (!encrypted || envelope._iv === '')\n ? envelope._data\n : await openEnvelopeJson({ collection: '_meta', id: recordId(source, sourceId, outputKey) }, envelope, await getDEK(FANOUT_DEK_COLLECTION))\n const parsed = JSON.parse(json) as FanoutSidecar\n if (parsed._noydb_fanout !== 1) return undefined\n if (!Array.isArray(parsed.keys)) return undefined\n return parsed\n}\n\n/**\n * Persist (insert/replace) the sidecar with a fresh key set. The body is\n * encrypted under the `_meta` DEK when the vault is encrypted (the `keys[]`\n * can be content-bearing); plaintext only in debug/unencrypted vaults.\n */\nexport async function saveFanoutSidecar(\n store: NoydbStore,\n vault: string,\n payload: {\n readonly source: string\n readonly sourceId: string\n readonly outputKey: string\n readonly outputCollection: string\n readonly keys: ReadonlyArray<string>\n },\n getDEK: GetDEK,\n encrypted: boolean,\n): Promise<void> {\n const doc: FanoutSidecar = {\n _noydb_fanout: 1,\n source: payload.source,\n sourceId: payload.sourceId,\n outputKey: payload.outputKey,\n outputCollection: payload.outputCollection,\n keys: payload.keys,\n emittedAt: new Date().toISOString(),\n }\n const id = recordId(payload.source, payload.sourceId, payload.outputKey)\n const prior = await store.get(vault, '_meta', id)\n const json = JSON.stringify(doc)\n const version = (prior?._v ?? 0) + 1\n const identity = { collection: '_meta', id, version }\n let envelope: EncryptedEnvelope\n if (!encrypted) {\n envelope = buildRecordEnvelope(identity, { iv: '', data: json })\n } else {\n const { iv, data } = await encrypt(json, await getDEK(FANOUT_DEK_COLLECTION), buildRecordAad(identity))\n envelope = buildRecordEnvelope(identity, { iv, data })\n }\n await store.put(vault, '_meta', id, envelope)\n}\n\n/** Delete the sidecar (used on source-row delete cascade). */\nexport async function deleteFanoutSidecar(\n store: NoydbStore,\n vault: string,\n source: string,\n sourceId: string,\n outputKey: string,\n): Promise<void> {\n await store.delete(vault, '_meta', recordId(source, sourceId, outputKey))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,IAAM,wBAAwB;AA2B9B,SAAS,SAAS,QAAgB,UAAkB,WAA2B;AAM7E,SAAO,sBAAsB,MAAM,IAAI,QAAQ,IAAI,SAAS;AAC9D;AAoBA,eAAsB,kBACpB,OACA,OACA,QACA,UACA,WACA,QACA,WACoC;AACpC,QAAM,WAAW,MAAM,MAAM,IAAI,OAAO,SAAS,SAAS,QAAQ,UAAU,SAAS,CAAC;AACtF,MAAI,CAAC,SAAU,QAAO;AAEtB,QAAM,OAAQ,CAAC,aAAa,SAAS,QAAQ,KACzC,SAAS,QACT,MAAM,iBAAiB,EAAE,YAAY,SAAS,IAAI,SAAS,QAAQ,UAAU,SAAS,EAAE,GAAG,UAAU,MAAM,OAAO,qBAAqB,CAAC;AAC5I,QAAM,SAAS,KAAK,MAAM,IAAI;AAC9B,MAAI,OAAO,kBAAkB,EAAG,QAAO;AACvC,MAAI,CAAC,MAAM,QAAQ,OAAO,IAAI,EAAG,QAAO;AACxC,SAAO;AACT;AAOA,eAAsB,kBACpB,OACA,OACA,SAOA,QACA,WACe;AACf,QAAM,MAAqB;AAAA,IACzB,eAAe;AAAA,IACf,QAAQ,QAAQ;AAAA,IAChB,UAAU,QAAQ;AAAA,IAClB,WAAW,QAAQ;AAAA,IACnB,kBAAkB,QAAQ;AAAA,IAC1B,MAAM,QAAQ;AAAA,IACd,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,EACpC;AACA,QAAM,KAAK,SAAS,QAAQ,QAAQ,QAAQ,UAAU,QAAQ,SAAS;AACvE,QAAM,QAAQ,MAAM,MAAM,IAAI,OAAO,SAAS,EAAE;AAChD,QAAM,OAAO,KAAK,UAAU,GAAG;AAC/B,QAAM,WAAW,OAAO,MAAM,KAAK;AACnC,QAAM,WAAW,EAAE,YAAY,SAAS,IAAI,QAAQ;AACpD,MAAI;AACJ,MAAI,CAAC,WAAW;AACd,eAAW,oBAAoB,UAAU,EAAE,IAAI,IAAI,MAAM,KAAK,CAAC;AAAA,EACjE,OAAO;AACL,UAAM,EAAE,IAAI,KAAK,IAAI,MAAM,QAAQ,MAAM,MAAM,OAAO,qBAAqB,GAAG,eAAe,QAAQ,CAAC;AACtG,eAAW,oBAAoB,UAAU,EAAE,IAAI,KAAK,CAAC;AAAA,EACvD;AACA,QAAM,MAAM,IAAI,OAAO,SAAS,IAAI,QAAQ;AAC9C;AAGA,eAAsB,oBACpB,OACA,OACA,QACA,UACA,WACe;AACf,QAAM,MAAM,OAAO,OAAO,SAAS,SAAS,QAAQ,UAAU,SAAS,CAAC;AAC1E;","names":[]}
@@ -1,5 +1,3 @@
1
- import "./chunk-PZ5AY32C.js";
2
-
3
1
  // src/with-shape/schema-update/fence-watcher.ts
4
2
  var FenceWatcher = class {
5
3
  #coordination;
@@ -66,4 +64,4 @@ var FenceWatcher = class {
66
64
  export {
67
65
  FenceWatcher
68
66
  };
69
- //# sourceMappingURL=fence-watcher-ZVSMLKQD.js.map
67
+ //# sourceMappingURL=fence-watcher-U2PW6JU5.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/with-shape/schema-update/fence-watcher.ts"],"sourcesContent":["/**\n * Per-client schema-fence watcher. Watches the fence via the injected\n * {@link NoydbMesh}; on `draining` it drains in-flight writes\n * and reports presence (its ack); emits a same-instance signal on every\n * state transition (for UI). Driven by an interval in production and by\n * explicit `check()`/`beat()` in tests.\n *\n * The transport is the coordination port: the default\n * {@link StoreMesh} maps `reportPresence` →\n * `_meta/schema-fence:client:<id>` and `readFence` → `_meta/schema-fence`,\n * so behavior is byte-for-byte the same; `by-tabs` / `by-peer` swap in\n * real-time push transports.\n */\nimport { type FenceState } from './fence.js'\nimport type { NoydbMesh } from '../../port/by/index.js'\n\nexport interface FenceWatcherEvent {\n readonly currentSchemaVersion: number\n readonly fenceState: FenceState\n}\n\nexport class FenceWatcher {\n readonly #coordination: NoydbMesh\n readonly #vault: string\n readonly #writerId: string\n readonly #sessionId: string\n readonly #onFlush: () => Promise<void>\n readonly #now: () => number\n readonly #emit: (e: FenceWatcherEvent) => void\n #lastState: FenceState | null = null\n #quiescedAtVersion: number | null = null\n #timer: ReturnType<typeof setInterval> | undefined\n\n constructor(opts: {\n coordination: NoydbMesh\n vault: string\n clientId: string\n sessionId?: string\n onFlush: () => Promise<void>\n now?: () => number\n emit?: (e: FenceWatcherEvent) => void\n }) {\n this.#coordination = opts.coordination\n this.#vault = opts.vault\n this.#writerId = opts.clientId\n this.#sessionId = opts.sessionId ?? opts.clientId\n this.#onFlush = opts.onFlush\n this.#now = opts.now ?? (() => Date.now())\n this.#emit = opts.emit ?? (() => {})\n }\n\n /** Publish liveness (and the current ack) without changing quiesce state. */\n async beat(): Promise<void> {\n await this.#coordination.reportPresence(this.#vault, {\n writerId: this.#writerId,\n sessionId: this.#sessionId,\n lastSeen: this.#now(),\n quiescedAtVersion: this.#quiescedAtVersion,\n })\n }\n\n /** Poll the fence; quiesce on draining; emit on transitions. */\n async check(): Promise<void> {\n const fence = await this.#coordination.readFence(this.#vault)\n if (fence.fenceState !== this.#lastState) {\n this.#lastState = fence.fenceState\n this.#emit({ currentSchemaVersion: fence.currentSchemaVersion, fenceState: fence.fenceState })\n }\n if (fence.fenceState === 'draining' && this.#quiescedAtVersion !== fence.currentSchemaVersion) {\n await this.#onFlush()\n this.#quiescedAtVersion = fence.currentSchemaVersion\n await this.beat()\n }\n if (fence.fenceState === 'normal') {\n this.#quiescedAtVersion = null\n }\n }\n\n start(intervalMs: number): void {\n if (this.#timer) return\n this.#timer = setInterval(() => { void this.beat(); void this.check() }, intervalMs)\n const timer = this.#timer as unknown as { unref?: () => void }\n if (typeof timer.unref === 'function') timer.unref() // don't keep the process alive\n }\n\n stop(): void {\n if (this.#timer) { clearInterval(this.#timer); this.#timer = undefined }\n }\n}\n"],"mappings":";;;AAqBO,IAAM,eAAN,MAAmB;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACT,aAAgC;AAAA,EAChC,qBAAoC;AAAA,EACpC;AAAA,EAEA,YAAY,MAQT;AACD,SAAK,gBAAgB,KAAK;AAC1B,SAAK,SAAS,KAAK;AACnB,SAAK,YAAY,KAAK;AACtB,SAAK,aAAa,KAAK,aAAa,KAAK;AACzC,SAAK,WAAW,KAAK;AACrB,SAAK,OAAO,KAAK,QAAQ,MAAM,KAAK,IAAI;AACxC,SAAK,QAAQ,KAAK,SAAS,MAAM;AAAA,IAAC;AAAA,EACpC;AAAA;AAAA,EAGA,MAAM,OAAsB;AAC1B,UAAM,KAAK,cAAc,eAAe,KAAK,QAAQ;AAAA,MACnD,UAAU,KAAK;AAAA,MACf,WAAW,KAAK;AAAA,MAChB,UAAU,KAAK,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,IAC1B,CAAC;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,QAAuB;AAC3B,UAAM,QAAQ,MAAM,KAAK,cAAc,UAAU,KAAK,MAAM;AAC5D,QAAI,MAAM,eAAe,KAAK,YAAY;AACxC,WAAK,aAAa,MAAM;AACxB,WAAK,MAAM,EAAE,sBAAsB,MAAM,sBAAsB,YAAY,MAAM,WAAW,CAAC;AAAA,IAC/F;AACA,QAAI,MAAM,eAAe,cAAc,KAAK,uBAAuB,MAAM,sBAAsB;AAC7F,YAAM,KAAK,SAAS;AACpB,WAAK,qBAAqB,MAAM;AAChC,YAAM,KAAK,KAAK;AAAA,IAClB;AACA,QAAI,MAAM,eAAe,UAAU;AACjC,WAAK,qBAAqB;AAAA,IAC5B;AAAA,EACF;AAAA,EAEA,MAAM,YAA0B;AAC9B,QAAI,KAAK,OAAQ;AACjB,SAAK,SAAS,YAAY,MAAM;AAAE,WAAK,KAAK,KAAK;AAAG,WAAK,KAAK,MAAM;AAAA,IAAE,GAAG,UAAU;AACnF,UAAM,QAAQ,KAAK;AACnB,QAAI,OAAO,MAAM,UAAU,WAAY,OAAM,MAAM;AAAA,EACrD;AAAA,EAEA,OAAa;AACX,QAAI,KAAK,QAAQ;AAAE,oBAAc,KAAK,MAAM;AAAG,WAAK,SAAS;AAAA,IAAU;AAAA,EACzE;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/with-shape/schema-update/fence-watcher.ts"],"sourcesContent":["/**\n * Per-client schema-fence watcher. Watches the fence via the injected\n * {@link NoydbMesh}; on `draining` it drains in-flight writes\n * and reports presence (its ack); emits a same-instance signal on every\n * state transition (for UI). Driven by an interval in production and by\n * explicit `check()`/`beat()` in tests.\n *\n * The transport is the coordination port: the default\n * {@link StoreMesh} maps `reportPresence` →\n * `_meta/schema-fence:client:<id>` and `readFence` → `_meta/schema-fence`,\n * so behavior is byte-for-byte the same; `by-tabs` / `by-peer` swap in\n * real-time push transports.\n */\nimport { type FenceState } from './fence.js'\nimport type { NoydbMesh } from '../../port/by/index.js'\n\nexport interface FenceWatcherEvent {\n readonly currentSchemaVersion: number\n readonly fenceState: FenceState\n}\n\nexport class FenceWatcher {\n readonly #coordination: NoydbMesh\n readonly #vault: string\n readonly #writerId: string\n readonly #sessionId: string\n readonly #onFlush: () => Promise<void>\n readonly #now: () => number\n readonly #emit: (e: FenceWatcherEvent) => void\n #lastState: FenceState | null = null\n #quiescedAtVersion: number | null = null\n #timer: ReturnType<typeof setInterval> | undefined\n\n constructor(opts: {\n coordination: NoydbMesh\n vault: string\n clientId: string\n sessionId?: string\n onFlush: () => Promise<void>\n now?: () => number\n emit?: (e: FenceWatcherEvent) => void\n }) {\n this.#coordination = opts.coordination\n this.#vault = opts.vault\n this.#writerId = opts.clientId\n this.#sessionId = opts.sessionId ?? opts.clientId\n this.#onFlush = opts.onFlush\n this.#now = opts.now ?? (() => Date.now())\n this.#emit = opts.emit ?? (() => {})\n }\n\n /** Publish liveness (and the current ack) without changing quiesce state. */\n async beat(): Promise<void> {\n await this.#coordination.reportPresence(this.#vault, {\n writerId: this.#writerId,\n sessionId: this.#sessionId,\n lastSeen: this.#now(),\n quiescedAtVersion: this.#quiescedAtVersion,\n })\n }\n\n /** Poll the fence; quiesce on draining; emit on transitions. */\n async check(): Promise<void> {\n const fence = await this.#coordination.readFence(this.#vault)\n if (fence.fenceState !== this.#lastState) {\n this.#lastState = fence.fenceState\n this.#emit({ currentSchemaVersion: fence.currentSchemaVersion, fenceState: fence.fenceState })\n }\n if (fence.fenceState === 'draining' && this.#quiescedAtVersion !== fence.currentSchemaVersion) {\n await this.#onFlush()\n this.#quiescedAtVersion = fence.currentSchemaVersion\n await this.beat()\n }\n if (fence.fenceState === 'normal') {\n this.#quiescedAtVersion = null\n }\n }\n\n start(intervalMs: number): void {\n if (this.#timer) return\n this.#timer = setInterval(() => { void this.beat(); void this.check() }, intervalMs)\n const timer = this.#timer as unknown as { unref?: () => void }\n if (typeof timer.unref === 'function') timer.unref() // don't keep the process alive\n }\n\n stop(): void {\n if (this.#timer) { clearInterval(this.#timer); this.#timer = undefined }\n }\n}\n"],"mappings":";AAqBO,IAAM,eAAN,MAAmB;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACT,aAAgC;AAAA,EAChC,qBAAoC;AAAA,EACpC;AAAA,EAEA,YAAY,MAQT;AACD,SAAK,gBAAgB,KAAK;AAC1B,SAAK,SAAS,KAAK;AACnB,SAAK,YAAY,KAAK;AACtB,SAAK,aAAa,KAAK,aAAa,KAAK;AACzC,SAAK,WAAW,KAAK;AACrB,SAAK,OAAO,KAAK,QAAQ,MAAM,KAAK,IAAI;AACxC,SAAK,QAAQ,KAAK,SAAS,MAAM;AAAA,IAAC;AAAA,EACpC;AAAA;AAAA,EAGA,MAAM,OAAsB;AAC1B,UAAM,KAAK,cAAc,eAAe,KAAK,QAAQ;AAAA,MACnD,UAAU,KAAK;AAAA,MACf,WAAW,KAAK;AAAA,MAChB,UAAU,KAAK,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,IAC1B,CAAC;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,QAAuB;AAC3B,UAAM,QAAQ,MAAM,KAAK,cAAc,UAAU,KAAK,MAAM;AAC5D,QAAI,MAAM,eAAe,KAAK,YAAY;AACxC,WAAK,aAAa,MAAM;AACxB,WAAK,MAAM,EAAE,sBAAsB,MAAM,sBAAsB,YAAY,MAAM,WAAW,CAAC;AAAA,IAC/F;AACA,QAAI,MAAM,eAAe,cAAc,KAAK,uBAAuB,MAAM,sBAAsB;AAC7F,YAAM,KAAK,SAAS;AACpB,WAAK,qBAAqB,MAAM;AAChC,YAAM,KAAK,KAAK;AAAA,IAClB;AACA,QAAI,MAAM,eAAe,UAAU;AACjC,WAAK,qBAAqB;AAAA,IAC5B;AAAA,EACF;AAAA,EAEA,MAAM,YAA0B;AAC9B,QAAI,KAAK,OAAQ;AACjB,SAAK,SAAS,YAAY,MAAM;AAAE,WAAK,KAAK,KAAK;AAAG,WAAK,KAAK,MAAM;AAAA,IAAE,GAAG,UAAU;AACnF,UAAM,QAAQ,KAAK;AACnB,QAAI,OAAO,MAAM,UAAU,WAAY,OAAM,MAAM;AAAA,EACrD;AAAA,EAEA,OAAa;AACX,QAAI,KAAK,QAAQ;AAAE,oBAAc,KAAK,MAAM;AAAG,WAAK,SAAS;AAAA,IAAU;AAAA,EACzE;AACF;","names":[]}
@@ -0,0 +1,10 @@
1
+ import {
2
+ computeBidxTarget
3
+ } from "./chunk-RMF67KCG.js";
4
+ import "./chunk-LP7BEXCT.js";
5
+ import "./chunk-SL3JAAKN.js";
6
+ import "./chunk-7O3Y4PPD.js";
7
+ export {
8
+ computeBidxTarget
9
+ };
10
+ //# sourceMappingURL=find-2ABFCZX4.js.map
@@ -1,17 +1,16 @@
1
1
  import {
2
2
  NO_FORGET,
3
3
  SUBJECT_INDEX_COLLECTION
4
- } from "../chunk-EO2KGKEJ.js";
5
- import "../chunk-BYBB4ABD.js";
6
- import "../chunk-QU3YUP2X.js";
7
- import "../chunk-FOG7YEJP.js";
8
- import "../chunk-KDJGJR7F.js";
9
- import "../chunk-LKFKXS5K.js";
4
+ } from "../chunk-7V4TP3AF.js";
5
+ import "../chunk-77K4PG6P.js";
6
+ import "../chunk-SZJ3DLZA.js";
7
+ import "../chunk-BOWNCWZT.js";
8
+ import "../chunk-YSRUYAVU.js";
9
+ import "../chunk-RMF67KCG.js";
10
10
  import "../chunk-LP7BEXCT.js";
11
- import "../chunk-W5LHQXZU.js";
12
- import "../chunk-GU3LQYW2.js";
13
- import "../chunk-JBIV4FLR.js";
14
- import "../chunk-PZ5AY32C.js";
11
+ import "../chunk-SL3JAAKN.js";
12
+ import "../chunk-7MG7SJT7.js";
13
+ import "../chunk-7O3Y4PPD.js";
15
14
 
16
15
  // src/with-audit/forget/active.ts
17
16
  function withForget(opts) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/with-audit/forget/active.ts"],"sourcesContent":["/**\n * `withForget` — the active factory for GDPR right-to-erasure via\n * per-record CEK crypto-shred. Mirrors the canonical\n * `strategy.ts` (type + `NO_FORGET` sentinel) / `active.ts` (factory) split\n * used by the other services.\n *\n * @module\n */\nimport type { SubjectDeclaration, ForgetStrategy } from './strategy.js'\n\n/**\n * Declare GDPR crypto-shred for one or more collections.\n *\n * Each declared collection is forced to `perRecordKeys: true` (a shred can\n * only guarantee erasure of a record whose body is keyed off a per-record\n * CEK). On write, Noydb extracts `record[subjectField]` and maintains an\n * encrypted `_subject_index` mapping `subject → [{collection, id}]`, so\n * `vault.forget(subjectId)` can find every record for a subject and rewrite\n * each to a tombstone (body + history permanently undecryptable) while the\n * collection DEK and every other record stay intact.\n *\n * @example\n * ```ts\n * createNoydb({\n * secret, user,\n * forgetStrategy: withForget({ subjects: { invoices: 'buyerId' } }),\n * })\n * const result = await vault.forget('buyer-123')\n * // → { subject, recordsShredded, historyVersionsShredded, collections, … }\n * ```\n */\nexport function withForget(opts: SubjectDeclaration): ForgetStrategy {\n return { subjects: { ...opts.subjects }, ...(opts.scopedPurge !== undefined ? { scopedPurge: opts.scopedPurge } : {}) }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+BO,SAAS,WAAW,MAA0C;AACnE,SAAO,EAAE,UAAU,EAAE,GAAG,KAAK,SAAS,GAAG,GAAI,KAAK,gBAAgB,SAAY,EAAE,aAAa,KAAK,YAAY,IAAI,CAAC,EAAG;AACxH;","names":[]}
1
+ {"version":3,"sources":["../../src/with-audit/forget/active.ts"],"sourcesContent":["/**\n * `withForget` — the active factory for GDPR right-to-erasure via\n * per-record CEK crypto-shred. Mirrors the canonical\n * `strategy.ts` (type + `NO_FORGET` sentinel) / `active.ts` (factory) split\n * used by the other services.\n *\n * @module\n */\nimport type { SubjectDeclaration, ForgetStrategy } from './strategy.js'\n\n/**\n * Declare GDPR crypto-shred for one or more collections.\n *\n * Each declared collection is forced to `perRecordKeys: true` (a shred can\n * only guarantee erasure of a record whose body is keyed off a per-record\n * CEK). On write, Noydb extracts `record[subjectField]` and maintains an\n * encrypted `_subject_index` mapping `subject → [{collection, id}]`, so\n * `vault.forget(subjectId)` can find every record for a subject and rewrite\n * each to a tombstone (body + history permanently undecryptable) while the\n * collection DEK and every other record stay intact.\n *\n * @example\n * ```ts\n * createNoydb({\n * secret, user,\n * forgetStrategy: withForget({ subjects: { invoices: 'buyerId' } }),\n * })\n * const result = await vault.forget('buyer-123')\n * // → { subject, recordsShredded, historyVersionsShredded, collections, … }\n * ```\n */\nexport function withForget(opts: SubjectDeclaration): ForgetStrategy {\n return { subjects: { ...opts.subjects }, ...(opts.scopedPurge !== undefined ? { scopedPurge: opts.scopedPurge } : {}) }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+BO,SAAS,WAAW,MAA0C;AACnE,SAAO,EAAE,UAAU,EAAE,GAAG,KAAK,SAAS,GAAG,GAAI,KAAK,gBAAgB,SAAY,EAAE,aAAa,KAAK,YAAY,IAAI,CAAC,EAAG;AACxH;","names":[]}
@@ -2,13 +2,13 @@ import {
2
2
  immutableGuard,
3
3
  transitionGuard,
4
4
  withGuard
5
- } from "../chunk-NLKLXXTO.js";
5
+ } from "../chunk-YYP7WSEB.js";
6
6
  import {
7
7
  GuardExecutor
8
- } from "../chunk-AB5P32RE.js";
8
+ } from "../chunk-4OZNXTO4.js";
9
9
  import {
10
10
  GuardRegistry
11
- } from "../chunk-SHILAQH5.js";
11
+ } from "../chunk-DGOZ4UZD.js";
12
12
  import {
13
13
  ReadOnlyVaultFacade
14
14
  } from "../chunk-JK733I5V.js";
@@ -18,8 +18,7 @@ import {
18
18
  IllegalTransitionError,
19
19
  InvariantError,
20
20
  RecordLockedError
21
- } from "../chunk-JBIV4FLR.js";
22
- import "../chunk-PZ5AY32C.js";
21
+ } from "../chunk-7O3Y4PPD.js";
23
22
  export {
24
23
  AmendmentForbiddenError,
25
24
  FieldFrozenError,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CollectionInstant,
3
3
  VaultInstant
4
- } from "../chunk-HSGEIMJS.js";
4
+ } from "../chunk-KUJDV5QH.js";
5
5
  import {
6
6
  diff,
7
7
  formatDiff
@@ -16,12 +16,12 @@ import {
16
16
  rewrapHistory,
17
17
  saveHistory,
18
18
  tombstoneHistory
19
- } from "../chunk-U6GCYG2T.js";
19
+ } from "../chunk-X2DLENDQ.js";
20
20
  import {
21
21
  LedgerStore,
22
22
  applyPatch,
23
23
  computePatch
24
- } from "../chunk-UPJMBMCR.js";
24
+ } from "../chunk-L742JPKZ.js";
25
25
  import {
26
26
  LEDGER_COLLECTION,
27
27
  LEDGER_DELTAS_COLLECTION
@@ -33,18 +33,17 @@ import {
33
33
  paddedIndex,
34
34
  parseIndex,
35
35
  sha256Hex
36
- } from "../chunk-WLFABTZ6.js";
37
- import "../chunk-POS53FG6.js";
38
- import "../chunk-BYBB4ABD.js";
39
- import "../chunk-QU3YUP2X.js";
40
- import "../chunk-FOG7YEJP.js";
41
- import "../chunk-KDJGJR7F.js";
42
- import "../chunk-LKFKXS5K.js";
36
+ } from "../chunk-BOET4NA4.js";
37
+ import "../chunk-JMGDHKQF.js";
38
+ import "../chunk-77K4PG6P.js";
39
+ import "../chunk-SZJ3DLZA.js";
40
+ import "../chunk-BOWNCWZT.js";
41
+ import "../chunk-YSRUYAVU.js";
42
+ import "../chunk-RMF67KCG.js";
43
43
  import "../chunk-LP7BEXCT.js";
44
- import "../chunk-W5LHQXZU.js";
45
- import "../chunk-GU3LQYW2.js";
46
- import "../chunk-JBIV4FLR.js";
47
- import "../chunk-PZ5AY32C.js";
44
+ import "../chunk-SL3JAAKN.js";
45
+ import "../chunk-7MG7SJT7.js";
46
+ import "../chunk-7O3Y4PPD.js";
48
47
 
49
48
  // src/with-commit/history/active.ts
50
49
  function withHistory() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/with-commit/history/active.ts"],"sourcesContent":["/**\n * Active history strategy — `withHistory()` returns the real\n * implementation that wires per-record snapshots, the hash-chained\n * audit ledger, JSON-patch deltas, and time-machine reads into the\n * core write/read paths.\n *\n * Consumers opt in by:\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withHistory } from '@noy-db/hub/history'\n *\n * const db = await createNoydb({\n * store: ...,\n * user: ...,\n * historyStrategy: withHistory(),\n * })\n * ```\n *\n * The factory is a thin wrapper that delegates to the existing\n * `history.ts`, `diff.ts`, `ledger/store.ts`, `ledger/patch.ts`, and\n * `time-machine.ts` modules. Splitting the import chain through this\n * file is what lets `tsup` tree-shake the heavy modules out of the\n * default `@noy-db/hub` bundle when no `withHistory()` import is\n * present in the consumer.\n *\n * @public\n */\n\nimport type { HistoryStrategy, BuildLedgerOptions } from './strategy.js'\nimport {\n saveHistory,\n historyIdentity,\n getHistory,\n getVersionEnvelope,\n pruneHistory,\n clearHistory,\n tombstoneHistory,\n rewrapHistory,\n} from './history.js'\nimport { diff as computeDiff } from './diff.js'\nimport { LedgerStore, envelopePayloadHash } from './ledger/store.js'\nimport { computePatch } from './ledger/patch.js'\nimport { VaultInstant } from './time-machine.js'\n\n/**\n * Build the active history strategy. Today the factory takes no\n * options; per-collection retention tuning still flows through\n * `HistoryConfig` on `Vault.collection()` / `vault.openVault()`.\n *\n * Future option slots (kept off the LTS surface for now):\n * - global maxVersions cap\n * - global beforeDate prune cadence\n * - ledger encryption toggle (today inferred from vault.encrypted)\n */\nexport function withHistory(): HistoryStrategy {\n return {\n saveHistory,\n historyIdentity,\n getHistoryEntries: getHistory,\n getVersionEnvelope,\n pruneHistory,\n clearHistory,\n tombstoneHistory,\n rewrapHistory,\n envelopePayloadHash,\n computePatch,\n diff: computeDiff,\n buildLedger(opts: BuildLedgerOptions): LedgerStore {\n return new LedgerStore({\n adapter: opts.adapter,\n vault: opts.vault,\n encrypted: opts.encrypted,\n getDEK: opts.getDEK,\n actor: opts.actor,\n })\n },\n buildVaultInstant(engine, timestamp): VaultInstant {\n return new VaultInstant(engine, timestamp)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDO,SAAS,cAA+B;AAC7C,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,MAAuC;AACjD,aAAO,IAAI,YAAY;AAAA,QACrB,SAAS,KAAK;AAAA,QACd,OAAO,KAAK;AAAA,QACZ,WAAW,KAAK;AAAA,QAChB,QAAQ,KAAK;AAAA,QACb,OAAO,KAAK;AAAA,MACd,CAAC;AAAA,IACH;AAAA,IACA,kBAAkB,QAAQ,WAAyB;AACjD,aAAO,IAAI,aAAa,QAAQ,SAAS;AAAA,IAC3C;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/with-commit/history/active.ts"],"sourcesContent":["/**\n * Active history strategy — `withHistory()` returns the real\n * implementation that wires per-record snapshots, the hash-chained\n * audit ledger, JSON-patch deltas, and time-machine reads into the\n * core write/read paths.\n *\n * Consumers opt in by:\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withHistory } from '@noy-db/hub/history'\n *\n * const db = await createNoydb({\n * store: ...,\n * user: ...,\n * historyStrategy: withHistory(),\n * })\n * ```\n *\n * The factory is a thin wrapper that delegates to the existing\n * `history.ts`, `diff.ts`, `ledger/store.ts`, `ledger/patch.ts`, and\n * `time-machine.ts` modules. Splitting the import chain through this\n * file is what lets `tsup` tree-shake the heavy modules out of the\n * default `@noy-db/hub` bundle when no `withHistory()` import is\n * present in the consumer.\n *\n * @public\n */\n\nimport type { HistoryStrategy, BuildLedgerOptions } from './strategy.js'\nimport {\n saveHistory,\n historyIdentity,\n getHistory,\n getVersionEnvelope,\n pruneHistory,\n clearHistory,\n tombstoneHistory,\n rewrapHistory,\n} from './history.js'\nimport { diff as computeDiff } from './diff.js'\nimport { LedgerStore, envelopePayloadHash } from './ledger/store.js'\nimport { computePatch } from './ledger/patch.js'\nimport { VaultInstant } from './time-machine.js'\n\n/**\n * Build the active history strategy. Today the factory takes no\n * options; per-collection retention tuning still flows through\n * `HistoryConfig` on `Vault.collection()` / `vault.openVault()`.\n *\n * Future option slots (kept off the LTS surface for now):\n * - global maxVersions cap\n * - global beforeDate prune cadence\n * - ledger encryption toggle (today inferred from vault.encrypted)\n */\nexport function withHistory(): HistoryStrategy {\n return {\n saveHistory,\n historyIdentity,\n getHistoryEntries: getHistory,\n getVersionEnvelope,\n pruneHistory,\n clearHistory,\n tombstoneHistory,\n rewrapHistory,\n envelopePayloadHash,\n computePatch,\n diff: computeDiff,\n buildLedger(opts: BuildLedgerOptions): LedgerStore {\n return new LedgerStore({\n adapter: opts.adapter,\n vault: opts.vault,\n encrypted: opts.encrypted,\n getDEK: opts.getDEK,\n actor: opts.actor,\n })\n },\n buildVaultInstant(engine, timestamp): VaultInstant {\n return new VaultInstant(engine, timestamp)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDO,SAAS,cAA+B;AAC7C,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,MAAuC;AACjD,aAAO,IAAI,YAAY;AAAA,QACrB,SAAS,KAAK;AAAA,QACd,OAAO,KAAK;AAAA,QACZ,WAAW,KAAK;AAAA,QAChB,QAAQ,KAAK;AAAA,QACb,OAAO,KAAK;AAAA,MACd,CAAC;AAAA,IACH;AAAA,IACA,kBAAkB,QAAQ,WAAyB;AACjD,aAAO,IAAI,aAAa,QAAQ,SAAS;AAAA,IAC3C;AAAA,EACF;AACF;","names":[]}
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  withLookup
3
- } from "../chunk-4JDIRUTT.js";
3
+ } from "../chunk-K7NTTA6P.js";
4
4
  import {
5
5
  dictKey,
6
6
  staticDict
7
- } from "../chunk-2GXEQUEX.js";
7
+ } from "../chunk-MVMXZYXT.js";
8
8
  import {
9
9
  DICT_COLLECTION_PREFIX,
10
10
  LookupHandle,
11
11
  dictCollectionName
12
- } from "../chunk-XBFEKTIY.js";
12
+ } from "../chunk-6I2RQCET.js";
13
13
  import {
14
14
  NO_I18N,
15
15
  applyI18nLocale,
@@ -26,17 +26,17 @@ import {
26
26
  resolvePolicy,
27
27
  stripI18nFilled,
28
28
  validateI18nTextValue
29
- } from "../chunk-X67FCULK.js";
30
- import "../chunk-XDVVBETV.js";
31
- import "../chunk-WLFABTZ6.js";
32
- import "../chunk-BYBB4ABD.js";
33
- import "../chunk-QU3YUP2X.js";
34
- import "../chunk-FOG7YEJP.js";
35
- import "../chunk-KDJGJR7F.js";
36
- import "../chunk-LKFKXS5K.js";
29
+ } from "../chunk-TRGTKX5E.js";
30
+ import "../chunk-UXVWEX5L.js";
31
+ import "../chunk-BOET4NA4.js";
32
+ import "../chunk-77K4PG6P.js";
33
+ import "../chunk-SZJ3DLZA.js";
34
+ import "../chunk-BOWNCWZT.js";
35
+ import "../chunk-YSRUYAVU.js";
36
+ import "../chunk-RMF67KCG.js";
37
37
  import "../chunk-LP7BEXCT.js";
38
- import "../chunk-W5LHQXZU.js";
39
- import "../chunk-GU3LQYW2.js";
38
+ import "../chunk-SL3JAAKN.js";
39
+ import "../chunk-7MG7SJT7.js";
40
40
  import {
41
41
  DictKeyInUseError,
42
42
  DictKeyMissingError,
@@ -47,8 +47,7 @@ import {
47
47
  StaticDictReadonlyError,
48
48
  TranslatorNotConfiguredError,
49
49
  UnknownDictCodeError
50
- } from "../chunk-JBIV4FLR.js";
51
- import "../chunk-PZ5AY32C.js";
50
+ } from "../chunk-7O3Y4PPD.js";
52
51
 
53
52
  // src/via/i18n/densify.ts
54
53
  var MARKER = "_i18nFilled";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/via/i18n/densify.ts","../../src/via/i18n/active.ts"],"sourcesContent":["/**\n * `densifyOnWrite` — eager-fill empty i18n slots from each field's\n * substitute chain at write time, recording provenance in the internal\n * `_i18nFilled` marker (decision A: dense map + prior-read).\n *\n * Pure functions over plain records; all DB wiring lives in collection.ts.\n * Only single-leaf i18n fields are supported (array-wildcard paths are\n * skipped, mirroring auto-translate).\n */\nimport { getAtPath, resolveI18nText } from './core.js'\nimport type { I18nTextDescriptor } from './core.js'\n\nconst MARKER = '_i18nFilled'\n\ntype Leaf = Record<string, string>\n\n/** Locales recorded as densify-filled on the prior record for `field`. */\nfunction priorFilled(prior: Record<string, unknown> | undefined, field: string): Set<string> {\n if (!prior) return new Set()\n const marker = prior[MARKER] as Record<string, string[]> | undefined\n return new Set(marker?.[field] ?? [])\n}\n\n/** The single leaf map for `field`, or undefined for absent / array-wildcard / non-object. */\nfunction singleLeaf(record: Record<string, unknown>, field: string): Leaf | undefined {\n const leaves = getAtPath(record, field)\n if (leaves.length !== 1) return undefined\n const leaf = leaves[0]\n if (!leaf || typeof leaf !== 'object' || Array.isArray(leaf)) return undefined\n return leaf as Leaf\n}\n\n/**\n * Per field, the locales that are UNCHANGED round-tripped densify fills — i.e.\n * marked filled on the prior record AND identical in the incoming record.\n * These are exempt from write-time script enforcement (they are derived copies,\n * not authored text). Slots the user changed are NOT exempt (validated as authored).\n */\nexport function computeExemptFills(\n prior: Record<string, unknown> | undefined,\n incoming: Record<string, unknown>,\n fields: Record<string, I18nTextDescriptor>,\n): Map<string, Set<string>> {\n const out = new Map<string, Set<string>>()\n if (!prior) return out\n for (const field of Object.keys(fields)) {\n const filled = priorFilled(prior, field)\n if (filled.size === 0) continue\n const priorLeaf = singleLeaf(prior, field)\n const incLeaf = singleLeaf(incoming, field)\n if (!priorLeaf || !incLeaf) continue\n const exempt = new Set<string>()\n for (const loc of filled) {\n if (incLeaf[loc] !== undefined && incLeaf[loc] !== '' && incLeaf[loc] === priorLeaf[loc]) {\n exempt.add(loc)\n }\n }\n if (exempt.size > 0) out.set(field, exempt)\n }\n return out\n}\n\n/**\n * Mutate `record` in place: fill empty declared-language slots for each\n * densify-enabled field from the field's substitute chain, recompute unchanged\n * prior fills, clear marks for slots that became authored, and write the\n * resulting `_i18nFilled` marker (removed when empty).\n *\n * `prior` is read-only — it is never mutated.\n *\n * Provenance uses value-equality (decision A): a slot counts as an unchanged\n * fill when it was prior-marked AND its value still equals the prior value. A\n * consequence is that re-authoring a value byte-identical to the existing fill\n * keeps it classified as a fill (the visible value is unchanged either way; the\n * slot stays script-exempt and will auto-refresh if its source later changes).\n * This is inherent to value-equality provenance, not a bug.\n */\nexport function densify(\n record: Record<string, unknown>,\n prior: Record<string, unknown> | undefined,\n fields: Record<string, I18nTextDescriptor>,\n): void {\n let marker = record[MARKER] as Record<string, string[]> | undefined\n\n for (const [field, descriptor] of Object.entries(fields)) {\n const leaf = singleLeaf(record, field)\n if (!leaf) continue\n const { languages, substitute, smartSubstitute } = descriptor.options\n const filledSet = priorFilled(prior, field)\n const priorLeaf = singleLeaf(prior ?? {}, field)\n const isUnchangedFill = (loc: string): boolean =>\n filledSet.has(loc) && priorLeaf?.[loc] !== undefined && leaf[loc] === priorLeaf[loc]\n\n // Authored source = present, non-empty, NOT an unchanged prior fill.\n const authored: Leaf = {}\n for (const [loc, val] of Object.entries(leaf)) {\n if (typeof val === 'string' && val !== '' && !isUnchangedFill(loc)) authored[loc] = val\n }\n\n const filled: string[] = []\n for (const loc of languages) {\n if (authored[loc] !== undefined) continue // real value present → not a fill\n const sub = resolveI18nText(authored, loc, undefined, field, {\n policy: 'substitute',\n substitute: substitute ?? ['any'],\n ...(smartSubstitute ? { smartSubstitute } : {}),\n })\n if (typeof sub === 'string' && sub !== '') {\n leaf[loc] = sub\n filled.push(loc)\n } else if (isUnchangedFill(loc)) {\n delete leaf[loc] // stale fill with no source left → drop it\n }\n }\n\n if (filled.length > 0) {\n marker ??= {}\n marker[field] = filled\n } else if (marker) {\n delete marker[field]\n }\n }\n\n if (marker && Object.keys(marker).length > 0) {\n record[MARKER] = marker\n } else {\n delete record[MARKER]\n }\n}\n","/**\n * Active i18n strategy — `withI18n()` returns the real implementation\n * that wires multi-locale resolution, i18nText validation, and the\n * `DictionaryHandle` for `dictKey` fields into the core read/write\n * paths.\n *\n * Consumers opt in by:\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withI18n } from '@noy-db/hub/i18n'\n *\n * const db = await createNoydb({\n * store: ...,\n * user: ...,\n * i18nStrategy: withI18n(),\n * })\n * ```\n *\n * The factory delegates to the existing `core.ts` and `dictionary.ts`\n * modules. Splitting the import chain through this file is what lets\n * tsup tree-shake the `~854 LOC` of dictionary + locale resolution\n * out of the default bundle when no `withI18n()` import is present.\n *\n * @public\n */\n\nimport type { I18nStrategy, BuildDictionaryHandleOptions } from './strategy.js'\nimport { applyI18nLocale, validateI18nTextValue } from './core.js'\nimport { enforceScript } from './script.js'\nimport { computeExemptFills, densify } from './densify.js'\nimport type { DictionaryHandle } from './dictionary.js'\nimport { withLookup } from '../lookup/active.js'\n\nexport function withI18n(): I18nStrategy {\n // #650 Task 1: the handle-construction logic moved to\n // via/lookup/active.ts (LookupHandle, renamed from\n // DictionaryHandle, new home). buildDictionaryHandle below is now a\n // thin field-name translator over buildLookupHandle — same handle.\n const lookup = withLookup()\n return {\n applyI18nLocale,\n validateI18nTextValue,\n enforceScript,\n computeExemptFills,\n densify,\n buildDictionaryHandle<Keys extends string = string>(\n opts: BuildDictionaryHandleOptions<Keys>,\n ): DictionaryHandle<Keys> {\n return lookup.buildLookupHandle<Keys>({\n adapter: opts.adapter,\n compartmentName: opts.compartmentName,\n dimensionName: opts.dictionaryName,\n keyring: opts.keyring,\n reservedEnvelopes: opts.reservedEnvelopes,\n encrypted: opts.encrypted,\n ledger: opts.ledger,\n options: opts.options,\n findAndUpdateReferences: opts.findAndUpdateReferences,\n emitter: opts.emitter,\n buildDeleteMarker: opts.buildDeleteMarker, // #647 fix wave 1\n onDirty: opts.onDirty, // #650 Task 4\n onRecordMutated: opts.onRecordMutated, // #650 Task 4\n checkReferencesOnDelete: opts.checkReferencesOnDelete, // #650 Task 5\n })\n },\n }\n}\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../src/via/i18n/densify.ts","../../src/via/i18n/active.ts"],"sourcesContent":["/**\n * `densifyOnWrite` — eager-fill empty i18n slots from each field's\n * substitute chain at write time, recording provenance in the internal\n * `_i18nFilled` marker (decision A: dense map + prior-read).\n *\n * Pure functions over plain records; all DB wiring lives in collection.ts.\n * Only single-leaf i18n fields are supported (array-wildcard paths are\n * skipped, mirroring auto-translate).\n */\nimport { getAtPath, resolveI18nText } from './core.js'\nimport type { I18nTextDescriptor } from './core.js'\n\nconst MARKER = '_i18nFilled'\n\ntype Leaf = Record<string, string>\n\n/** Locales recorded as densify-filled on the prior record for `field`. */\nfunction priorFilled(prior: Record<string, unknown> | undefined, field: string): Set<string> {\n if (!prior) return new Set()\n const marker = prior[MARKER] as Record<string, string[]> | undefined\n return new Set(marker?.[field] ?? [])\n}\n\n/** The single leaf map for `field`, or undefined for absent / array-wildcard / non-object. */\nfunction singleLeaf(record: Record<string, unknown>, field: string): Leaf | undefined {\n const leaves = getAtPath(record, field)\n if (leaves.length !== 1) return undefined\n const leaf = leaves[0]\n if (!leaf || typeof leaf !== 'object' || Array.isArray(leaf)) return undefined\n return leaf as Leaf\n}\n\n/**\n * Per field, the locales that are UNCHANGED round-tripped densify fills — i.e.\n * marked filled on the prior record AND identical in the incoming record.\n * These are exempt from write-time script enforcement (they are derived copies,\n * not authored text). Slots the user changed are NOT exempt (validated as authored).\n */\nexport function computeExemptFills(\n prior: Record<string, unknown> | undefined,\n incoming: Record<string, unknown>,\n fields: Record<string, I18nTextDescriptor>,\n): Map<string, Set<string>> {\n const out = new Map<string, Set<string>>()\n if (!prior) return out\n for (const field of Object.keys(fields)) {\n const filled = priorFilled(prior, field)\n if (filled.size === 0) continue\n const priorLeaf = singleLeaf(prior, field)\n const incLeaf = singleLeaf(incoming, field)\n if (!priorLeaf || !incLeaf) continue\n const exempt = new Set<string>()\n for (const loc of filled) {\n if (incLeaf[loc] !== undefined && incLeaf[loc] !== '' && incLeaf[loc] === priorLeaf[loc]) {\n exempt.add(loc)\n }\n }\n if (exempt.size > 0) out.set(field, exempt)\n }\n return out\n}\n\n/**\n * Mutate `record` in place: fill empty declared-language slots for each\n * densify-enabled field from the field's substitute chain, recompute unchanged\n * prior fills, clear marks for slots that became authored, and write the\n * resulting `_i18nFilled` marker (removed when empty).\n *\n * `prior` is read-only — it is never mutated.\n *\n * Provenance uses value-equality (decision A): a slot counts as an unchanged\n * fill when it was prior-marked AND its value still equals the prior value. A\n * consequence is that re-authoring a value byte-identical to the existing fill\n * keeps it classified as a fill (the visible value is unchanged either way; the\n * slot stays script-exempt and will auto-refresh if its source later changes).\n * This is inherent to value-equality provenance, not a bug.\n */\nexport function densify(\n record: Record<string, unknown>,\n prior: Record<string, unknown> | undefined,\n fields: Record<string, I18nTextDescriptor>,\n): void {\n let marker = record[MARKER] as Record<string, string[]> | undefined\n\n for (const [field, descriptor] of Object.entries(fields)) {\n const leaf = singleLeaf(record, field)\n if (!leaf) continue\n const { languages, substitute, smartSubstitute } = descriptor.options\n const filledSet = priorFilled(prior, field)\n const priorLeaf = singleLeaf(prior ?? {}, field)\n const isUnchangedFill = (loc: string): boolean =>\n filledSet.has(loc) && priorLeaf?.[loc] !== undefined && leaf[loc] === priorLeaf[loc]\n\n // Authored source = present, non-empty, NOT an unchanged prior fill.\n const authored: Leaf = {}\n for (const [loc, val] of Object.entries(leaf)) {\n if (typeof val === 'string' && val !== '' && !isUnchangedFill(loc)) authored[loc] = val\n }\n\n const filled: string[] = []\n for (const loc of languages) {\n if (authored[loc] !== undefined) continue // real value present → not a fill\n const sub = resolveI18nText(authored, loc, undefined, field, {\n policy: 'substitute',\n substitute: substitute ?? ['any'],\n ...(smartSubstitute ? { smartSubstitute } : {}),\n })\n if (typeof sub === 'string' && sub !== '') {\n leaf[loc] = sub\n filled.push(loc)\n } else if (isUnchangedFill(loc)) {\n delete leaf[loc] // stale fill with no source left → drop it\n }\n }\n\n if (filled.length > 0) {\n marker ??= {}\n marker[field] = filled\n } else if (marker) {\n delete marker[field]\n }\n }\n\n if (marker && Object.keys(marker).length > 0) {\n record[MARKER] = marker\n } else {\n delete record[MARKER]\n }\n}\n","/**\n * Active i18n strategy — `withI18n()` returns the real implementation\n * that wires multi-locale resolution, i18nText validation, and the\n * `DictionaryHandle` for `dictKey` fields into the core read/write\n * paths.\n *\n * Consumers opt in by:\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withI18n } from '@noy-db/hub/i18n'\n *\n * const db = await createNoydb({\n * store: ...,\n * user: ...,\n * i18nStrategy: withI18n(),\n * })\n * ```\n *\n * The factory delegates to the existing `core.ts` and `dictionary.ts`\n * modules. Splitting the import chain through this file is what lets\n * tsup tree-shake the `~854 LOC` of dictionary + locale resolution\n * out of the default bundle when no `withI18n()` import is present.\n *\n * @public\n */\n\nimport type { I18nStrategy, BuildDictionaryHandleOptions } from './strategy.js'\nimport { applyI18nLocale, validateI18nTextValue } from './core.js'\nimport { enforceScript } from './script.js'\nimport { computeExemptFills, densify } from './densify.js'\nimport type { DictionaryHandle } from './dictionary.js'\nimport { withLookup } from '../lookup/active.js'\n\nexport function withI18n(): I18nStrategy {\n // #650 Task 1: the handle-construction logic moved to\n // via/lookup/active.ts (LookupHandle, renamed from\n // DictionaryHandle, new home). buildDictionaryHandle below is now a\n // thin field-name translator over buildLookupHandle — same handle.\n const lookup = withLookup()\n return {\n applyI18nLocale,\n validateI18nTextValue,\n enforceScript,\n computeExemptFills,\n densify,\n buildDictionaryHandle<Keys extends string = string>(\n opts: BuildDictionaryHandleOptions<Keys>,\n ): DictionaryHandle<Keys> {\n return lookup.buildLookupHandle<Keys>({\n adapter: opts.adapter,\n compartmentName: opts.compartmentName,\n dimensionName: opts.dictionaryName,\n keyring: opts.keyring,\n reservedEnvelopes: opts.reservedEnvelopes,\n encrypted: opts.encrypted,\n ledger: opts.ledger,\n options: opts.options,\n findAndUpdateReferences: opts.findAndUpdateReferences,\n emitter: opts.emitter,\n buildDeleteMarker: opts.buildDeleteMarker, // #647 fix wave 1\n onDirty: opts.onDirty, // #650 Task 4\n onRecordMutated: opts.onRecordMutated, // #650 Task 4\n checkReferencesOnDelete: opts.checkReferencesOnDelete, // #650 Task 5\n })\n },\n }\n}\n"],"mappings":"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","names":[]}
package/dist/index.d.ts CHANGED
@@ -24,8 +24,12 @@
24
24
  * import { createNoydb } from '@noy-db/hub'
25
25
  * import { toFile } from '@noy-db/to-file'
26
26
  *
27
- * const db = await createNoydb({ store: toFile({ dir: './data' }) })
28
- * const acme = await db.openVault('acme', { secret: 'hunter2' })
27
+ * const db = await createNoydb({
28
+ * store: toFile({ dir: './data' }),
29
+ * user: 'alice',
30
+ * secret: 'correct horse battery staple',
31
+ * })
32
+ * const acme = await db.openVault('acme')
29
33
  * const invoices = acme.collection<Invoice>('invoices')
30
34
  *
31
35
  * await invoices.put('inv-001', { amount: 1200, client: 'Acme Corp' })
@@ -221,6 +225,18 @@ export { loadPaperRecoveryEntries, savePaperRecoveryEntries, burnPaperRecoveryEn
221
225
  export type { PaperRecoveryEntry } from './with-party/team/recovery.js';
222
226
  export { mintWrappedDeksBlob, unwrapDeksFromBlob } from './with-party/team/wrapped-deks.js';
223
227
  export { assertRosterAuthenticated } from './with-party/team/roster-tag.js';
228
+ /**
229
+ * #1097 — the caller-side roster-epoch floor check.
230
+ *
231
+ * Exported HERE and not only from `/team`, because the comparison is the one
232
+ * part of the mechanism that application code performs: hub stamps and binds
233
+ * the epoch, but the expectation arrives by a second channel hub does not
234
+ * carry, so only the caller can supply it. A check the consumer cannot import
235
+ * is not a check — `0.7.0-pre.9` shipped this function in `dist/**` and
236
+ * exported it from no entry point at all, which is #1224's class one step
237
+ * worse: that one was reachable from the wrong seam, this one from none.
238
+ */
239
+ export { assertRosterEpochCurrent, nextRosterEpoch } from './with-party/team/roster-epoch.js';
224
240
  export type { WrappedDeksBlob } from './with-party/team/wrapped-deks.js';
225
241
  export type { NoydbSealer, RecipientHint, RecipientSealer } from './with-party/team/managed-secret.js';
226
242
  export type { NoydbShamir } from './with-party/team/noydb-shamir.js';
@@ -258,8 +274,8 @@ export type { ImmutableGuardConfig } from './with-audit/guards/index.js';
258
274
  export { transitionGuard } from './with-audit/guards/index.js';
259
275
  export type { TransitionGuardConfig } from './with-audit/guards/index.js';
260
276
  export type { GuardSpec, GuardStrategy, GuardContext, GuardChange, } from './with-audit/guards/index.js';
261
- export { withDerivation } from './with-formula/derivations/index.js';
262
- export { withRollup } from './with-formula/derivations/index.js';
277
+ export { withDerivation } from './with-formula/derivations/with-derivation.js';
278
+ export { withRollup } from './with-formula/derivations/with-rollup.js';
263
279
  export type { WithRollupOptions } from './with-formula/derivations/index.js';
264
280
  export type { DerivationSpec, DerivationStrategy, DerivedFromMeta, OutputSpec, RecordOutputSpec, ArrayOutputSpec, } from './with-formula/derivations/index.js';
265
281
  export { DerivationCycleError, DerivationDepthError, DerivationOutputUnknownError, DerivationOutputShapeError, DerivationCapExceededError, DuplicateBehaviorNameError, } from './kernel/errors.js';