@noy-db/hub 0.4.0-pre.9 → 0.5.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 (375) hide show
  1. package/dist/api-M7REIE7H.js +20 -0
  2. package/dist/attestation/index.js +18 -18
  3. package/dist/{backup-PTSVXDDW.js → backup-ENTZYW37.js} +11 -11
  4. package/dist/blobs/index.js +13 -13
  5. package/dist/broker/index.js +12 -12
  6. package/dist/cargo/index.js +31 -31
  7. package/dist/{chunk-6ZNSB3H6.js → chunk-3LYMOSY7.js} +2 -2
  8. package/dist/{chunk-OLSARBZU.js → chunk-4DGBZEV6.js} +2 -2
  9. package/dist/{chunk-GP3UWP22.js → chunk-4MSNAB64.js} +4 -4
  10. package/dist/{chunk-MXUT7FTE.js → chunk-4SG5TOXK.js} +2 -2
  11. package/dist/{chunk-W66AM5IB.js → chunk-4TXO442D.js} +2 -2
  12. package/dist/{chunk-MTJLOC3Y.js → chunk-55LKVALY.js} +106 -10
  13. package/dist/chunk-55LKVALY.js.map +1 -0
  14. package/dist/{chunk-UADPR6F4.js → chunk-5EKL6BXI.js} +3 -3
  15. package/dist/{chunk-OW5Y6HA6.js → chunk-5UKUOMO6.js} +417 -202
  16. package/dist/chunk-5UKUOMO6.js.map +1 -0
  17. package/dist/{chunk-RZPOZPZU.js → chunk-623QEHDB.js} +8 -8
  18. package/dist/{chunk-FRMW23UK.js → chunk-653KOQ7A.js} +7 -7
  19. package/dist/{chunk-WZ3NCMK6.js → chunk-6PFST3FC.js} +5 -5
  20. package/dist/{chunk-CCDP6EPB.js → chunk-6RDTG6E5.js} +5 -5
  21. package/dist/{chunk-GZACYEOB.js → chunk-77AEMXFA.js} +1 -1
  22. package/dist/chunk-77AEMXFA.js.map +1 -0
  23. package/dist/{chunk-ZFUFAHZ3.js → chunk-7P4LL3JH.js} +4 -4
  24. package/dist/{chunk-FO6RNKKW.js → chunk-AJAOXFCF.js} +8 -8
  25. package/dist/chunk-AJAOXFCF.js.map +1 -0
  26. package/dist/{chunk-L3YYLT4E.js → chunk-ALUVACKT.js} +2 -2
  27. package/dist/{chunk-QZWTRENR.js → chunk-AR5D76T2.js} +5 -1
  28. package/dist/chunk-AR5D76T2.js.map +1 -0
  29. package/dist/{chunk-5DRROK5W.js → chunk-BFG7LD6Z.js} +2 -2
  30. package/dist/{chunk-OLIWCCFM.js → chunk-CLE3TMIS.js} +2 -2
  31. package/dist/{chunk-6UBZ6I5Z.js → chunk-DDB626I7.js} +2 -2
  32. package/dist/{chunk-W3G5REIU.js → chunk-EAN4TAPC.js} +2 -2
  33. package/dist/{chunk-4JQK3L4V.js → chunk-EBETHILL.js} +2 -2
  34. package/dist/{chunk-ZWBKDKXC.js → chunk-ECGDJU5R.js} +3 -3
  35. package/dist/{chunk-VH6SOCXH.js → chunk-EFJAAFBW.js} +2 -2
  36. package/dist/{chunk-NQSO4UAH.js → chunk-ELJOLQIG.js} +15 -14
  37. package/dist/chunk-ELJOLQIG.js.map +1 -0
  38. package/dist/{chunk-N5PLUFH2.js → chunk-F2WWHKO7.js} +5 -5
  39. package/dist/{chunk-NJ4DYYO5.js → chunk-F5UWVF6Z.js} +2 -2
  40. package/dist/{chunk-JIDLU57U.js → chunk-FHK6WWUE.js} +3 -3
  41. package/dist/{chunk-SHEEBRZ4.js → chunk-FT5Y4VSP.js} +2 -2
  42. package/dist/{chunk-BN4HRYAZ.js → chunk-FUECZSRM.js} +2 -2
  43. package/dist/{chunk-KPXM4WO6.js → chunk-FZAP4JNC.js} +5 -5
  44. package/dist/{chunk-TE6LH6J2.js → chunk-G3ORJ3IQ.js} +5 -5
  45. package/dist/{chunk-KW42W6SV.js → chunk-G7ZIMGPQ.js} +6 -6
  46. package/dist/{chunk-QJNCB5SK.js → chunk-GIGLOQL7.js} +2 -2
  47. package/dist/{chunk-TIVK6PRK.js → chunk-GTQF32TP.js} +7 -7
  48. package/dist/{chunk-JYJFGD2H.js → chunk-GYJRDALN.js} +2 -2
  49. package/dist/{chunk-MANUDU7I.js → chunk-HGDXJVK2.js} +6 -6
  50. package/dist/{chunk-C25JXSOR.js → chunk-IHYSIPEK.js} +8 -8
  51. package/dist/{chunk-5GQEU4DN.js → chunk-IJV56FWY.js} +2 -2
  52. package/dist/{chunk-XIDQKFZF.js → chunk-IM2KST7E.js} +3 -3
  53. package/dist/{chunk-IMRB2C4O.js → chunk-IQ423YMK.js} +3 -3
  54. package/dist/{chunk-WO4T4OD5.js → chunk-J7YVY7TW.js} +2 -2
  55. package/dist/{chunk-Y6VZQGGH.js → chunk-JLBCK7XM.js} +9 -9
  56. package/dist/chunk-JLBCK7XM.js.map +1 -0
  57. package/dist/{chunk-Y6B6HVKC.js → chunk-K5OFKXUG.js} +42 -18
  58. package/dist/chunk-K5OFKXUG.js.map +1 -0
  59. package/dist/{chunk-SGQ4N5FS.js → chunk-KDWBVCIX.js} +5 -5
  60. package/dist/{chunk-6L3DKWRY.js → chunk-KJNMTE2W.js} +6 -6
  61. package/dist/{chunk-NFZGZ4AK.js → chunk-L67H6FAQ.js} +2 -2
  62. package/dist/{chunk-DGBIHDVK.js → chunk-LQVRK2XJ.js} +5 -5
  63. package/dist/{chunk-MHMLXJ3I.js → chunk-LXRVTJ5D.js} +2 -2
  64. package/dist/{chunk-2NMEGSFV.js → chunk-MDRCEA56.js} +11 -11
  65. package/dist/{chunk-KRCBZYTZ.js → chunk-MFW466PX.js} +4 -4
  66. package/dist/{chunk-RO5NM6UI.js → chunk-MGXUAID4.js} +2 -2
  67. package/dist/{chunk-NEX7JCMO.js → chunk-MPW6AHTC.js} +4 -4
  68. package/dist/{chunk-35NMVJ7I.js → chunk-MYSNNMJ3.js} +3 -3
  69. package/dist/{chunk-JYV4JJV2.js → chunk-NG4AQIYJ.js} +5 -5
  70. package/dist/{chunk-BLBAQRBM.js → chunk-NIKQQXI2.js} +2 -2
  71. package/dist/{chunk-55LX6FSX.js → chunk-NJHQE4LT.js} +2 -2
  72. package/dist/{chunk-SKM35Y4Q.js → chunk-NMYH55MW.js} +4 -4
  73. package/dist/{chunk-NGSJZFGL.js → chunk-NWK6SVBM.js} +87 -25
  74. package/dist/chunk-NWK6SVBM.js.map +1 -0
  75. package/dist/{chunk-DZAF24PG.js → chunk-NZEGQWQ5.js} +5 -5
  76. package/dist/{chunk-FMNU7IUG.js → chunk-ODCEOSJF.js} +3 -3
  77. package/dist/{chunk-NYEFP7DY.js → chunk-OKBNFUUX.js} +2 -2
  78. package/dist/{chunk-SGDPRCC4.js → chunk-OKRXXFZZ.js} +3 -3
  79. package/dist/{chunk-IG6KUWBX.js → chunk-P6UIVLZK.js} +2 -2
  80. package/dist/{chunk-V6UQZA2H.js → chunk-PKBONLCP.js} +2 -2
  81. package/dist/{chunk-MSMJJB4J.js → chunk-PTSVGKSR.js} +2 -2
  82. package/dist/{chunk-IXNCZTWA.js → chunk-PWEMRXPO.js} +2 -2
  83. package/dist/{chunk-PTHKZWEH.js → chunk-PZRYKOKP.js} +2 -2
  84. package/dist/{chunk-56IIVAEO.js → chunk-Q2SEJMP2.js} +2 -2
  85. package/dist/{chunk-OBPVWOSQ.js → chunk-Q6MXHDSE.js} +4 -4
  86. package/dist/{chunk-6R6Q3MRN.js → chunk-QITP2JGX.js} +7 -7
  87. package/dist/{chunk-WBKZUO5V.js → chunk-QMCWYN6O.js} +3 -3
  88. package/dist/{chunk-4ZKNC6A6.js → chunk-QQL6XPPG.js} +2 -2
  89. package/dist/{chunk-TG634KCO.js → chunk-QTMZDMJ6.js} +2 -2
  90. package/dist/{chunk-AT2JJEKJ.js → chunk-RM4FIXY2.js} +4 -4
  91. package/dist/{chunk-AKKRXT23.js → chunk-RPWMDIGK.js} +2 -2
  92. package/dist/{chunk-EBKCYQ2D.js → chunk-RQILGK3N.js} +9 -9
  93. package/dist/chunk-RQILGK3N.js.map +1 -0
  94. package/dist/{chunk-EZNTORXE.js → chunk-SBGXQK5I.js} +2 -2
  95. package/dist/chunk-SBGXQK5I.js.map +1 -0
  96. package/dist/{chunk-3XKESW5E.js → chunk-SL3PLML2.js} +3 -3
  97. package/dist/{chunk-BYFXLDVV.js → chunk-TJOUKMWF.js} +9 -9
  98. package/dist/{chunk-QD46HPZG.js → chunk-U2ID5A2I.js} +2 -2
  99. package/dist/{chunk-X4MVWPHV.js → chunk-UC5Y7OEJ.js} +3 -3
  100. package/dist/chunk-US2AR4BI.js +25 -0
  101. package/dist/chunk-US2AR4BI.js.map +1 -0
  102. package/dist/{chunk-ISRKW4YN.js → chunk-V3EGXDFN.js} +3 -3
  103. package/dist/{chunk-KFRPNHWR.js → chunk-V4O6YZSP.js} +4 -4
  104. package/dist/{chunk-3HUYRN24.js → chunk-W7C7MMIS.js} +3 -3
  105. package/dist/{chunk-BXHMZ2XW.js → chunk-WFYKIDCS.js} +51 -22
  106. package/dist/chunk-WFYKIDCS.js.map +1 -0
  107. package/dist/{chunk-6M2I3DKF.js → chunk-WK7ULBTP.js} +2 -2
  108. package/dist/{chunk-HFUAFR6B.js → chunk-XID22NOA.js} +6 -6
  109. package/dist/{chunk-E23UGFVC.js → chunk-XVK7TULT.js} +2 -2
  110. package/dist/{chunk-IF6WNGAK.js → chunk-XX7YB5BI.js} +5 -5
  111. package/dist/{chunk-ZTLOXFPB.js → chunk-Y2PTKKIN.js} +2 -2
  112. package/dist/{chunk-QADFHRQM.js → chunk-YA7Y3EZP.js} +10 -10
  113. package/dist/classified/index.js +5 -5
  114. package/dist/{classified-marker-EOOSMWFC.js → classified-marker-ZALWKOBC.js} +3 -3
  115. package/dist/collection-facade-KI53O6QB.js +45 -0
  116. package/dist/{computed-AB45PS4V.js → computed-YOQCGUCS.js} +3 -3
  117. package/dist/consent/index.js +9 -9
  118. package/dist/cover/index.js +3 -3
  119. package/dist/custody/index.js +11 -11
  120. package/dist/{dead-filter-6DYY7S64.js → dead-filter-6DVWST6U.js} +2 -2
  121. package/dist/debug/index.js +29 -0
  122. package/dist/debug/index.js.map +1 -0
  123. package/dist/{delegation-ONOZVPIP.js → delegation-WMO3Q3O5.js} +10 -10
  124. package/dist/derivations/index.js +12 -12
  125. package/dist/derive-P2NXWUNB.js +22 -0
  126. package/dist/directory/index.js +10 -10
  127. package/dist/{dispatch-7T45NN7C.js → dispatch-TKV4UCKB.js} +18 -18
  128. package/dist/{dispatch-RPTLK7LJ.js → dispatch-VNR3TLBX.js} +5 -5
  129. package/dist/{enclave-CLJVSDFG.js → enclave-YWP3QAIQ.js} +9 -9
  130. package/dist/executor-M4ZZNX6S.js +28 -0
  131. package/dist/executor-TI64S4LE.js +9 -0
  132. package/dist/executor-YBK3I2OT.js +9 -0
  133. package/dist/export-accessible-GBLYLGW4.js +23 -0
  134. package/dist/extract-partition-SFV35U2R.js +38 -0
  135. package/dist/{fanout-sidecar-TV7CXAJ6.js → fanout-sidecar-WYXO6QQT.js} +9 -9
  136. package/dist/find-HUSSZRBR.js +11 -0
  137. package/dist/forget/index.js +9 -9
  138. package/dist/guards/index.js +5 -5
  139. package/dist/history/index.js +12 -12
  140. package/dist/i18n/index.js +14 -14
  141. package/dist/index.d.ts +8 -8
  142. package/dist/index.js +188 -134
  143. package/dist/index.js.map +1 -1
  144. package/dist/indexing/index.js +2 -2
  145. package/dist/introspection/index.js +11 -11
  146. package/dist/issue-6TIJYWKS.js +19 -0
  147. package/dist/kernel/collection-config.d.ts +4 -0
  148. package/dist/kernel/collection.d.ts +113 -8
  149. package/dist/kernel/debug.d.ts +11 -0
  150. package/dist/kernel/errors.d.ts +15 -0
  151. package/dist/kernel/noydb.d.ts +3 -3
  152. package/dist/kernel/prepared-write.d.ts +70 -0
  153. package/dist/kernel/put-many-atomic.d.ts +45 -0
  154. package/dist/kernel/sync-policy.d.ts +75 -3
  155. package/dist/kernel/types.d.ts +27 -8
  156. package/dist/kernel/vault.d.ts +14 -0
  157. package/dist/{ledger-XY6NP3J2.js → ledger-BLYDYRTQ.js} +11 -11
  158. package/dist/liberate-TSOW7IG5.js +24 -0
  159. package/dist/{link-set-POQB7BU5.js → link-set-7F5ZPDEB.js} +11 -11
  160. package/dist/materialized-views/index.js +19 -19
  161. package/dist/money/index.js +3 -3
  162. package/dist/noydb-KFN6M6UJ.js +81 -0
  163. package/dist/overlay-views/index.js +4 -4
  164. package/dist/periods/index.js +13 -13
  165. package/dist/pod/index.js +11 -11
  166. package/dist/policy/index.js +4 -4
  167. package/dist/port/with/strategies.d.ts +1 -1
  168. package/dist/port/with/write-hooks.d.ts +6 -0
  169. package/dist/portability/index.js +8 -8
  170. package/dist/{post-register-URQANI3B.js → post-register-PQSY544J.js} +6 -6
  171. package/dist/query/index.js +3 -3
  172. package/dist/reduce/index.js +4 -4
  173. package/dist/register-S3ECUZPV.js +25 -0
  174. package/dist/registry-FZOHKUME.js +18 -0
  175. package/dist/registry-RISV7IDZ.js +19 -0
  176. package/dist/registry-ZE35A7WC.js +9 -0
  177. package/dist/request-withdrawal-KXVTQKR5.js +31 -0
  178. package/dist/{reveal-BXZGWIOP.js → reveal-HY7DZST4.js} +6 -6
  179. package/dist/revoke-J473JJ22.js +24 -0
  180. package/dist/satellites/index.js +1 -1
  181. package/dist/schema-update/index.js +2 -2
  182. package/dist/sealed-record/index.js +12 -12
  183. package/dist/search/index.js +4 -4
  184. package/dist/{seed-F7YYQTRC.js → seed-ALU3BHFS.js} +15 -15
  185. package/dist/seed-ALU3BHFS.js.map +1 -0
  186. package/dist/sequence/index.js +9 -9
  187. package/dist/session/index.js +9 -9
  188. package/dist/shadow/index.js +2 -2
  189. package/dist/signer-XLUKCCH3.js +25 -0
  190. package/dist/snapshots/index.js +10 -10
  191. package/dist/{stale-JOE7GBAE.js → stale-U3WO5MYN.js} +10 -10
  192. package/dist/storage-IQONEOYY.js +23 -0
  193. package/dist/{store-coordination-provider-5LX2UFU2.js → store-coordination-provider-AHGFEMFA.js} +3 -3
  194. package/dist/sync/index.js +14 -15
  195. package/dist/sync/index.js.map +1 -1
  196. package/dist/team/index.js +14 -36
  197. package/dist/tiers/index.js +10 -10
  198. package/dist/to/index.js +1 -1
  199. package/dist/transactions/index.js +3 -3
  200. package/dist/util/index.js +1 -1
  201. package/dist/{verify-7XWHJWUN.js → verify-JEIXSK5U.js} +5 -5
  202. package/dist/walk-BF36V4SR.js +21 -0
  203. package/dist/with-commit/tx/atomic-eligibility.d.ts +49 -0
  204. package/dist/with-commit/tx/transaction.d.ts +22 -9
  205. package/dist/with-party/broker/seed.d.ts +1 -1
  206. package/dist/with-party/team/index.d.ts +0 -5
  207. package/dist/{with-party/team/sync-active.d.ts → with-sync/active.d.ts} +1 -1
  208. package/dist/{with-party/team/sync-credentials.d.ts → with-sync/credentials.d.ts} +3 -3
  209. package/dist/{with-party/team/sync.d.ts → with-sync/engine.d.ts} +18 -5
  210. package/dist/{with-party/sync → with-sync}/index.d.ts +3 -3
  211. package/dist/{with-party/team/sync-period-scope.d.ts → with-sync/period-scope.d.ts} +2 -2
  212. package/dist/{with-party/team → with-sync}/presence.d.ts +2 -2
  213. package/dist/{with-party/team/sync-strategy.d.ts → with-sync/strategy.d.ts} +6 -6
  214. package/dist/{with-party/team/sync-transaction.d.ts → with-sync/transaction.d.ts} +3 -3
  215. package/dist/withdraw-accessible-TYTA23XH.js +28 -0
  216. package/package.json +8 -4
  217. package/dist/api-3NKVNZPM.js +0 -20
  218. package/dist/chunk-BXHMZ2XW.js.map +0 -1
  219. package/dist/chunk-EBKCYQ2D.js.map +0 -1
  220. package/dist/chunk-EP5L47XV.js +0 -22
  221. package/dist/chunk-EP5L47XV.js.map +0 -1
  222. package/dist/chunk-EZNTORXE.js.map +0 -1
  223. package/dist/chunk-FO6RNKKW.js.map +0 -1
  224. package/dist/chunk-GZACYEOB.js.map +0 -1
  225. package/dist/chunk-MTJLOC3Y.js.map +0 -1
  226. package/dist/chunk-NGSJZFGL.js.map +0 -1
  227. package/dist/chunk-NQSO4UAH.js.map +0 -1
  228. package/dist/chunk-OW5Y6HA6.js.map +0 -1
  229. package/dist/chunk-QZWTRENR.js.map +0 -1
  230. package/dist/chunk-SHYIA73K.js +0 -99
  231. package/dist/chunk-SHYIA73K.js.map +0 -1
  232. package/dist/chunk-Y6B6HVKC.js.map +0 -1
  233. package/dist/chunk-Y6VZQGGH.js.map +0 -1
  234. package/dist/collection-facade-TTRF5NFJ.js +0 -45
  235. package/dist/derive-IGGVSUPH.js +0 -22
  236. package/dist/executor-IEBLTBCW.js +0 -9
  237. package/dist/executor-RM7XWQDU.js +0 -9
  238. package/dist/executor-XZYM4KHT.js +0 -28
  239. package/dist/export-accessible-24XCCD3A.js +0 -23
  240. package/dist/extract-partition-H2TPEEOF.js +0 -38
  241. package/dist/find-OZMTRIK3.js +0 -11
  242. package/dist/issue-55HJE7JF.js +0 -19
  243. package/dist/liberate-LXOJ2EMB.js +0 -24
  244. package/dist/noydb-MGPOYDOD.js +0 -82
  245. package/dist/register-5W6CG4RM.js +0 -25
  246. package/dist/registry-7Y5WF7GS.js +0 -9
  247. package/dist/registry-MCSGBZXI.js +0 -18
  248. package/dist/registry-UJFP3NWF.js +0 -19
  249. package/dist/request-withdrawal-IWYDM4SO.js +0 -31
  250. package/dist/revoke-TINYPHYY.js +0 -24
  251. package/dist/seed-F7YYQTRC.js.map +0 -1
  252. package/dist/signer-WMZKCNKC.js +0 -25
  253. package/dist/storage-B3WBKXKT.js +0 -23
  254. package/dist/walk-6OHAWGBS.js +0 -21
  255. package/dist/withdraw-accessible-DEUCOO4F.js +0 -28
  256. /package/dist/{api-3NKVNZPM.js.map → api-M7REIE7H.js.map} +0 -0
  257. /package/dist/{backup-PTSVXDDW.js.map → backup-ENTZYW37.js.map} +0 -0
  258. /package/dist/{chunk-6ZNSB3H6.js.map → chunk-3LYMOSY7.js.map} +0 -0
  259. /package/dist/{chunk-OLSARBZU.js.map → chunk-4DGBZEV6.js.map} +0 -0
  260. /package/dist/{chunk-GP3UWP22.js.map → chunk-4MSNAB64.js.map} +0 -0
  261. /package/dist/{chunk-MXUT7FTE.js.map → chunk-4SG5TOXK.js.map} +0 -0
  262. /package/dist/{chunk-W66AM5IB.js.map → chunk-4TXO442D.js.map} +0 -0
  263. /package/dist/{chunk-UADPR6F4.js.map → chunk-5EKL6BXI.js.map} +0 -0
  264. /package/dist/{chunk-RZPOZPZU.js.map → chunk-623QEHDB.js.map} +0 -0
  265. /package/dist/{chunk-FRMW23UK.js.map → chunk-653KOQ7A.js.map} +0 -0
  266. /package/dist/{chunk-WZ3NCMK6.js.map → chunk-6PFST3FC.js.map} +0 -0
  267. /package/dist/{chunk-CCDP6EPB.js.map → chunk-6RDTG6E5.js.map} +0 -0
  268. /package/dist/{chunk-ZFUFAHZ3.js.map → chunk-7P4LL3JH.js.map} +0 -0
  269. /package/dist/{chunk-L3YYLT4E.js.map → chunk-ALUVACKT.js.map} +0 -0
  270. /package/dist/{chunk-5DRROK5W.js.map → chunk-BFG7LD6Z.js.map} +0 -0
  271. /package/dist/{chunk-OLIWCCFM.js.map → chunk-CLE3TMIS.js.map} +0 -0
  272. /package/dist/{chunk-6UBZ6I5Z.js.map → chunk-DDB626I7.js.map} +0 -0
  273. /package/dist/{chunk-W3G5REIU.js.map → chunk-EAN4TAPC.js.map} +0 -0
  274. /package/dist/{chunk-4JQK3L4V.js.map → chunk-EBETHILL.js.map} +0 -0
  275. /package/dist/{chunk-ZWBKDKXC.js.map → chunk-ECGDJU5R.js.map} +0 -0
  276. /package/dist/{chunk-VH6SOCXH.js.map → chunk-EFJAAFBW.js.map} +0 -0
  277. /package/dist/{chunk-N5PLUFH2.js.map → chunk-F2WWHKO7.js.map} +0 -0
  278. /package/dist/{chunk-NJ4DYYO5.js.map → chunk-F5UWVF6Z.js.map} +0 -0
  279. /package/dist/{chunk-JIDLU57U.js.map → chunk-FHK6WWUE.js.map} +0 -0
  280. /package/dist/{chunk-SHEEBRZ4.js.map → chunk-FT5Y4VSP.js.map} +0 -0
  281. /package/dist/{chunk-BN4HRYAZ.js.map → chunk-FUECZSRM.js.map} +0 -0
  282. /package/dist/{chunk-KPXM4WO6.js.map → chunk-FZAP4JNC.js.map} +0 -0
  283. /package/dist/{chunk-TE6LH6J2.js.map → chunk-G3ORJ3IQ.js.map} +0 -0
  284. /package/dist/{chunk-KW42W6SV.js.map → chunk-G7ZIMGPQ.js.map} +0 -0
  285. /package/dist/{chunk-QJNCB5SK.js.map → chunk-GIGLOQL7.js.map} +0 -0
  286. /package/dist/{chunk-TIVK6PRK.js.map → chunk-GTQF32TP.js.map} +0 -0
  287. /package/dist/{chunk-JYJFGD2H.js.map → chunk-GYJRDALN.js.map} +0 -0
  288. /package/dist/{chunk-MANUDU7I.js.map → chunk-HGDXJVK2.js.map} +0 -0
  289. /package/dist/{chunk-C25JXSOR.js.map → chunk-IHYSIPEK.js.map} +0 -0
  290. /package/dist/{chunk-5GQEU4DN.js.map → chunk-IJV56FWY.js.map} +0 -0
  291. /package/dist/{chunk-XIDQKFZF.js.map → chunk-IM2KST7E.js.map} +0 -0
  292. /package/dist/{chunk-IMRB2C4O.js.map → chunk-IQ423YMK.js.map} +0 -0
  293. /package/dist/{chunk-WO4T4OD5.js.map → chunk-J7YVY7TW.js.map} +0 -0
  294. /package/dist/{chunk-SGQ4N5FS.js.map → chunk-KDWBVCIX.js.map} +0 -0
  295. /package/dist/{chunk-6L3DKWRY.js.map → chunk-KJNMTE2W.js.map} +0 -0
  296. /package/dist/{chunk-NFZGZ4AK.js.map → chunk-L67H6FAQ.js.map} +0 -0
  297. /package/dist/{chunk-DGBIHDVK.js.map → chunk-LQVRK2XJ.js.map} +0 -0
  298. /package/dist/{chunk-MHMLXJ3I.js.map → chunk-LXRVTJ5D.js.map} +0 -0
  299. /package/dist/{chunk-2NMEGSFV.js.map → chunk-MDRCEA56.js.map} +0 -0
  300. /package/dist/{chunk-KRCBZYTZ.js.map → chunk-MFW466PX.js.map} +0 -0
  301. /package/dist/{chunk-RO5NM6UI.js.map → chunk-MGXUAID4.js.map} +0 -0
  302. /package/dist/{chunk-NEX7JCMO.js.map → chunk-MPW6AHTC.js.map} +0 -0
  303. /package/dist/{chunk-35NMVJ7I.js.map → chunk-MYSNNMJ3.js.map} +0 -0
  304. /package/dist/{chunk-JYV4JJV2.js.map → chunk-NG4AQIYJ.js.map} +0 -0
  305. /package/dist/{chunk-BLBAQRBM.js.map → chunk-NIKQQXI2.js.map} +0 -0
  306. /package/dist/{chunk-55LX6FSX.js.map → chunk-NJHQE4LT.js.map} +0 -0
  307. /package/dist/{chunk-SKM35Y4Q.js.map → chunk-NMYH55MW.js.map} +0 -0
  308. /package/dist/{chunk-DZAF24PG.js.map → chunk-NZEGQWQ5.js.map} +0 -0
  309. /package/dist/{chunk-FMNU7IUG.js.map → chunk-ODCEOSJF.js.map} +0 -0
  310. /package/dist/{chunk-NYEFP7DY.js.map → chunk-OKBNFUUX.js.map} +0 -0
  311. /package/dist/{chunk-SGDPRCC4.js.map → chunk-OKRXXFZZ.js.map} +0 -0
  312. /package/dist/{chunk-IG6KUWBX.js.map → chunk-P6UIVLZK.js.map} +0 -0
  313. /package/dist/{chunk-V6UQZA2H.js.map → chunk-PKBONLCP.js.map} +0 -0
  314. /package/dist/{chunk-MSMJJB4J.js.map → chunk-PTSVGKSR.js.map} +0 -0
  315. /package/dist/{chunk-IXNCZTWA.js.map → chunk-PWEMRXPO.js.map} +0 -0
  316. /package/dist/{chunk-PTHKZWEH.js.map → chunk-PZRYKOKP.js.map} +0 -0
  317. /package/dist/{chunk-56IIVAEO.js.map → chunk-Q2SEJMP2.js.map} +0 -0
  318. /package/dist/{chunk-OBPVWOSQ.js.map → chunk-Q6MXHDSE.js.map} +0 -0
  319. /package/dist/{chunk-6R6Q3MRN.js.map → chunk-QITP2JGX.js.map} +0 -0
  320. /package/dist/{chunk-WBKZUO5V.js.map → chunk-QMCWYN6O.js.map} +0 -0
  321. /package/dist/{chunk-4ZKNC6A6.js.map → chunk-QQL6XPPG.js.map} +0 -0
  322. /package/dist/{chunk-TG634KCO.js.map → chunk-QTMZDMJ6.js.map} +0 -0
  323. /package/dist/{chunk-AT2JJEKJ.js.map → chunk-RM4FIXY2.js.map} +0 -0
  324. /package/dist/{chunk-AKKRXT23.js.map → chunk-RPWMDIGK.js.map} +0 -0
  325. /package/dist/{chunk-3XKESW5E.js.map → chunk-SL3PLML2.js.map} +0 -0
  326. /package/dist/{chunk-BYFXLDVV.js.map → chunk-TJOUKMWF.js.map} +0 -0
  327. /package/dist/{chunk-QD46HPZG.js.map → chunk-U2ID5A2I.js.map} +0 -0
  328. /package/dist/{chunk-X4MVWPHV.js.map → chunk-UC5Y7OEJ.js.map} +0 -0
  329. /package/dist/{chunk-ISRKW4YN.js.map → chunk-V3EGXDFN.js.map} +0 -0
  330. /package/dist/{chunk-KFRPNHWR.js.map → chunk-V4O6YZSP.js.map} +0 -0
  331. /package/dist/{chunk-3HUYRN24.js.map → chunk-W7C7MMIS.js.map} +0 -0
  332. /package/dist/{chunk-6M2I3DKF.js.map → chunk-WK7ULBTP.js.map} +0 -0
  333. /package/dist/{chunk-HFUAFR6B.js.map → chunk-XID22NOA.js.map} +0 -0
  334. /package/dist/{chunk-E23UGFVC.js.map → chunk-XVK7TULT.js.map} +0 -0
  335. /package/dist/{chunk-IF6WNGAK.js.map → chunk-XX7YB5BI.js.map} +0 -0
  336. /package/dist/{chunk-ZTLOXFPB.js.map → chunk-Y2PTKKIN.js.map} +0 -0
  337. /package/dist/{chunk-QADFHRQM.js.map → chunk-YA7Y3EZP.js.map} +0 -0
  338. /package/dist/{classified-marker-EOOSMWFC.js.map → classified-marker-ZALWKOBC.js.map} +0 -0
  339. /package/dist/{collection-facade-TTRF5NFJ.js.map → collection-facade-KI53O6QB.js.map} +0 -0
  340. /package/dist/{computed-AB45PS4V.js.map → computed-YOQCGUCS.js.map} +0 -0
  341. /package/dist/{dead-filter-6DYY7S64.js.map → dead-filter-6DVWST6U.js.map} +0 -0
  342. /package/dist/{delegation-ONOZVPIP.js.map → delegation-WMO3Q3O5.js.map} +0 -0
  343. /package/dist/{derive-IGGVSUPH.js.map → derive-P2NXWUNB.js.map} +0 -0
  344. /package/dist/{dispatch-7T45NN7C.js.map → dispatch-TKV4UCKB.js.map} +0 -0
  345. /package/dist/{dispatch-RPTLK7LJ.js.map → dispatch-VNR3TLBX.js.map} +0 -0
  346. /package/dist/{enclave-CLJVSDFG.js.map → enclave-YWP3QAIQ.js.map} +0 -0
  347. /package/dist/{executor-IEBLTBCW.js.map → executor-M4ZZNX6S.js.map} +0 -0
  348. /package/dist/{executor-RM7XWQDU.js.map → executor-TI64S4LE.js.map} +0 -0
  349. /package/dist/{executor-XZYM4KHT.js.map → executor-YBK3I2OT.js.map} +0 -0
  350. /package/dist/{export-accessible-24XCCD3A.js.map → export-accessible-GBLYLGW4.js.map} +0 -0
  351. /package/dist/{extract-partition-H2TPEEOF.js.map → extract-partition-SFV35U2R.js.map} +0 -0
  352. /package/dist/{fanout-sidecar-TV7CXAJ6.js.map → fanout-sidecar-WYXO6QQT.js.map} +0 -0
  353. /package/dist/{find-OZMTRIK3.js.map → find-HUSSZRBR.js.map} +0 -0
  354. /package/dist/{issue-55HJE7JF.js.map → issue-6TIJYWKS.js.map} +0 -0
  355. /package/dist/{ledger-XY6NP3J2.js.map → ledger-BLYDYRTQ.js.map} +0 -0
  356. /package/dist/{liberate-LXOJ2EMB.js.map → liberate-TSOW7IG5.js.map} +0 -0
  357. /package/dist/{link-set-POQB7BU5.js.map → link-set-7F5ZPDEB.js.map} +0 -0
  358. /package/dist/{noydb-MGPOYDOD.js.map → noydb-KFN6M6UJ.js.map} +0 -0
  359. /package/dist/{post-register-URQANI3B.js.map → post-register-PQSY544J.js.map} +0 -0
  360. /package/dist/{register-5W6CG4RM.js.map → register-S3ECUZPV.js.map} +0 -0
  361. /package/dist/{registry-7Y5WF7GS.js.map → registry-FZOHKUME.js.map} +0 -0
  362. /package/dist/{registry-MCSGBZXI.js.map → registry-RISV7IDZ.js.map} +0 -0
  363. /package/dist/{registry-UJFP3NWF.js.map → registry-ZE35A7WC.js.map} +0 -0
  364. /package/dist/{request-withdrawal-IWYDM4SO.js.map → request-withdrawal-KXVTQKR5.js.map} +0 -0
  365. /package/dist/{reveal-BXZGWIOP.js.map → reveal-HY7DZST4.js.map} +0 -0
  366. /package/dist/{revoke-TINYPHYY.js.map → revoke-J473JJ22.js.map} +0 -0
  367. /package/dist/{signer-WMZKCNKC.js.map → signer-XLUKCCH3.js.map} +0 -0
  368. /package/dist/{stale-JOE7GBAE.js.map → stale-U3WO5MYN.js.map} +0 -0
  369. /package/dist/{storage-B3WBKXKT.js.map → storage-IQONEOYY.js.map} +0 -0
  370. /package/dist/{store-coordination-provider-5LX2UFU2.js.map → store-coordination-provider-AHGFEMFA.js.map} +0 -0
  371. /package/dist/{verify-7XWHJWUN.js.map → verify-JEIXSK5U.js.map} +0 -0
  372. /package/dist/{walk-6OHAWGBS.js.map → walk-BF36V4SR.js.map} +0 -0
  373. /package/dist/{with-party → with-sync}/tab-coordination.d.ts +0 -0
  374. /package/dist/{with-party → with-sync}/tab-write-relay.d.ts +0 -0
  375. /package/dist/{withdraw-accessible-DEUCOO4F.js.map → withdraw-accessible-TYTA23XH.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-commit/sequence/active.ts","../src/with-commit/sequence/strategy.ts","../src/with-commit/sequence/index.ts"],"sourcesContent":["/**\n * Enable the atomic-sequence capability.\n * Pass to `createNoydb({ sequenceStrategy: withSequence() })` to make\n * `vault.sequence('name').next()` / `.peek()` / `.seedTo()` live. The\n * {@link SequenceStore} CAS engine is statically imported here, so it is pulled\n * into the bundle only when `withSequence()` is referenced (the floor never\n * imports it).\n */\nimport type { SequenceStrategy } from './strategy.js'\nimport { SequenceStore } from './index.js'\n\nexport function withSequence(): SequenceStrategy {\n return {\n createStore(opts) {\n return new SequenceStore(opts)\n },\n }\n}\n","/**\n * Sequence capability strategy — the single on-demand factory the vault routes\n * `vault.sequence()` through to build its atomic-CAS {@link SequenceStore}. The\n * active engine ({@link withSequence}) constructs the real store (kept out of\n * the floor bundle — the store class is reached only via the opt-in\n * `active.ts` chunk); {@link NO_SEQUENCE} throws. The vault always assembles the\n * per-call {@link SequenceStoreOptions} and delegates here, so an un-opted-in\n * caller hits `NO_SEQUENCE`'s throw at `vault.sequence()`.\n *\n * Note: `vault.sequence()` is synchronous, so the factory is a plain (sync)\n * constructor — the engine is tree-shaken by reachability (only `withSequence()`\n * pulls `active.ts`, which statically imports the store), not by a dynamic\n * import. Deferred-numbering series (`withDeferredNumbering`) are a distinct\n * capability and are NOT routed through this strategy.\n * @internal\n */\nimport type { SequenceStore, SequenceStoreOptions } from './index.js'\nimport { SequenceNotEnabledError } from '../../kernel/errors.js'\n\nexport interface SequenceStrategy {\n createStore(opts: SequenceStoreOptions): SequenceStore\n}\n\n/**\n * No-op stub — the floor default. The capability factory throws\n * {@link SequenceNotEnabledError}; opt in with `sequenceStrategy: withSequence()`\n * in createNoydb. @internal\n */\nexport const NO_SEQUENCE: SequenceStrategy = {\n createStore(): SequenceStore {\n throw new SequenceNotEnabledError()\n },\n}\n","/**\n * Atomic sequence primitive — online-coordinated gap-free numbering.\n *\n * `vault.sequence('invoice-2026').next()` returns 1, 2, 3, … with no\n * gaps and no duplicates, even under concurrent callers. Each named\n * sequence is an independent counter record at `_sequences/<name>`,\n * incremented with an optimistic compare-and-swap retry loop — the same\n * proven pattern as the ledger head (`history/ledger/store.ts`).\n *\n * **Explicitly online-only.** Gap-free numbering requires single-authority\n * serialization, which an offline / non-CAS store cannot provide. `next()`\n * throws {@link SequenceOfflineError} unless the backing store advertises\n * `capabilities.casAtomic`. This is a deliberate, honest wall — an offline\n * writer cannot safely allocate a global sequence number.\n *\n * Note on \"gap-free\": the *sequence* is gap-free (each `next()` yields a\n * unique, +1 value). If a caller discards a value without using it, that\n * is a gap in *usage*, not in the sequence — assign each `next()` result\n * to its record in the same operation.\n */\n\nimport type { NoydbStore, EncryptedEnvelope } from '../../kernel/types.js'\nimport { NOYDB_FORMAT_VERSION } from '../../kernel/types.js'\nimport { encrypt, openEnvelopeJson, type EnclaveKey } from '../../kernel/enclave/index.js'\nimport type { ConflictError} from '../../kernel/errors.js';\nimport { isConflictError, SequenceContentionError, SequenceOfflineError, ValidationError } from '../../kernel/errors.js'\n\n// Capability opt-in seam (S4): `vault.sequence()` builds its CAS store through\n// the sequenceStrategy, so it throws SequenceNotEnabledError unless opted in.\nexport { withSequence } from './active.js'\nexport { NO_SEQUENCE, type SequenceStrategy } from './strategy.js'\nexport { SequenceNotEnabledError } from '../../kernel/errors.js'\n\nexport const SEQUENCE_COLLECTION = '_sequences'\n// A sequence is a single hot CAS row — higher contention than a ledger\n// append. A larger budget + jittered backoff absorbs moderate concurrency;\n// a genuine burst beyond this surfaces SequenceContentionError so the\n// caller can retry / queue (the honest online-only contract).\nconst MAX_NEXT_ATTEMPTS = 16\n\ninterface SequenceState {\n value: number\n}\n\n/** Options for `SequenceHandle.next`. Deferred-numbering series use `for`; the CAS counter ignores all of these. */\nexport interface NextOptions {\n /** Deferred mode: the record id to number. Ignored by the CAS counter. */\n readonly for?: string\n /** Deferred mode: reject after this many ms if still unsealed (reserved; not yet enforced in this slice). */\n readonly timeoutMs?: number\n}\n\n/**\n * Partitioning for a CAS sequence. A partitioned sequence is an\n * independent counter scoped to one tuple of values — e.g.\n * `sequence('invoice', { partition: [2026, 'EU'] })` numbers EU-2026 invoices\n * separately from `[2026, 'US']` and from the bare `invoice` series.\n *\n * Partition components are URI-encoded (so `/`, null bytes and other\n * separators in a value can never collide with the structural separators) and\n * `'/'`-joined, then appended to the series with a null-byte (`\\x00`)\n * separator. The null byte is illegal in a plain series name, which guarantees\n * a partitioned key is always disjoint from any unpartitioned series.\n */\nexport interface SequenceOptions {\n /** Partition tuple. Each component is URI-encoded and `'/'`-joined. */\n readonly partition?: readonly (string | number)[]\n /**\n * Render template for the serial string. When set, `vault.sequence`\n * returns a {@link FormattedSequenceHandle} whose `next()` resolves to\n * `{ serial, formatted }`. Tokens:\n * - `{seq}` — the allocated integer\n * - `{seq:0N}` — zero-padded to width N (e.g. `{seq:04}` → `0001`)\n * - `{partition.i}` — the i-th `partition` component (original value)\n *\n * Any other token, or a `{partition.i}` index beyond the supplied\n * `partition`, throws `ValidationError` at `vault.sequence()` construction.\n * Per-partition reset is inherent: a new partition tuple starts at 1.\n */\n readonly format?: string\n}\n\n/**\n * A formatted sequence handle. Identical to {@link SequenceHandle}\n * except `next()` also returns the rendered `formatted` string. `peek()` /\n * `seedTo()` operate on the underlying integer counter, unchanged.\n */\nexport interface FormattedSequenceHandle {\n /** Allocate the next value and return it with its rendered serial string. */\n next(opts?: NextOptions): Promise<{ serial: number; formatted: string }>\n /** Read the current integer value without allocating. Returns 0 if never used. */\n peek(): Promise<number>\n /** Set-if-greater on the underlying integer counter. See {@link SequenceHandle.seedTo}. */\n seedTo(n: number): Promise<void>\n}\n\n// Matches a single `{...}` token with no nested braces.\nconst SEQ_FORMAT_TOKEN = /\\{([^{}]*)\\}/g\nconst SEQ_PAD_TOKEN = /^seq:0(\\d+)$/\nconst SEQ_PARTITION_TOKEN = /^partition\\.(\\d+)$/\n\n/**\n * Validate a sequence `format` against the supplied partition and return a\n * pure `(serial) => string` renderer. Eager validation: every token is\n * checked now, so a bad pattern throws `ValidationError` at construction —\n * never at `next()` time.\n */\nexport function compileSequenceFormat(\n format: string,\n series: string,\n partition: readonly (string | number)[] | undefined,\n): (serial: number) => string {\n const parts = partition ?? []\n for (const m of format.matchAll(SEQ_FORMAT_TOKEN)) {\n const token = m[1] ?? ''\n if (token === 'seq') continue\n if (SEQ_PAD_TOKEN.test(token)) continue\n const partMatch = SEQ_PARTITION_TOKEN.exec(token)\n if (partMatch) {\n const idx = Number(partMatch[1])\n if (idx >= parts.length) {\n throw new ValidationError(\n `sequence(\"${series}\"): format token \"{${token}}\" references partition index ${idx}, ` +\n `but only ${parts.length} partition component(s) were supplied.`,\n )\n }\n continue\n }\n throw new ValidationError(\n `sequence(\"${series}\"): format contains unknown token \"{${token}}\". ` +\n `Accepted tokens: {seq}, {seq:0N}, {partition.i}.`,\n )\n }\n return (serial: number): string =>\n format.replace(SEQ_FORMAT_TOKEN, (full, token: string) => {\n if (token === 'seq') return String(serial)\n const padMatch = SEQ_PAD_TOKEN.exec(token)\n if (padMatch) return String(serial).padStart(Number(padMatch[1]), '0')\n const partMatch = SEQ_PARTITION_TOKEN.exec(token)\n if (partMatch) return String(parts[Number(partMatch[1])])\n return full // unreachable — validated above\n })\n}\n\n/**\n * Resolve the CAS storage key for a (series, partition) pair.\n *\n * With no partition the key is `series` verbatim. With a partition the key is\n * `${series}\\x00${parts}` where `parts` is each component passed through\n * `encodeURIComponent(String(part))` and `'/'`-joined. The null-byte separator\n * is illegal in a plain series name, so partitioned keys never collide with\n * unpartitioned ones; URI-encoding keeps any component containing `/` distinct\n * from a multi-component partition.\n *\n * @throws {ValidationError} if any partition component is empty after `String()`\n * or is a non-finite number (`NaN`, `±Infinity`).\n */\nexport function resolveSequenceKey(series: string, opts?: SequenceOptions): string {\n const partition = opts?.partition\n if (!partition || partition.length === 0) return series\n const parts = partition.map((p) => {\n if (typeof p === 'number' && !Number.isFinite(p)) {\n throw new ValidationError(`sequence partition component must be a finite number, got ${p}`)\n }\n const s = String(p)\n if (s === '') {\n throw new ValidationError('sequence partition component must not be empty')\n }\n return encodeURIComponent(s)\n })\n return `${series}\\x00${parts.join('/')}`\n}\n\nexport interface SequenceHandle {\n /** Atomically allocate and return the next value (1, 2, 3, …). Deferred series resolve at the next pass. */\n next(opts?: NextOptions): Promise<number>\n /** Read the current value without allocating. Returns 0 if never used. */\n peek(): Promise<number>\n /**\n * Set-if-greater: advance the counter to at least `n`. A no-op if the\n * current value is already `>= n` (so it never rewinds), and `seedTo(0)` is\n * a no-op. Idempotent and CAS-safe under concurrent `next()` / `seedTo()`.\n *\n * Use after a bundle / CSV import to fast-forward the counter past the\n * highest imported serial, so subsequent `next()` calls cannot re-use a\n * number that is already on a record.\n *\n * Online-only: throws {@link SequenceOfflineError} on a non-CAS store.\n */\n seedTo(n: number): Promise<void>\n}\n\nasync function sleepBackoff(attempt: number): Promise<void> {\n // Exponential backoff with full jitter to break the thundering herd\n // when many writers contend on the same counter row.\n const ceil = Math.min(2 ** attempt, 32)\n const ms = Math.floor(Math.random() * ceil)\n await new Promise((r) => setTimeout(r, ms))\n}\n\n/** Per-call context the vault assembles to build a {@link SequenceStore}. */\nexport interface SequenceStoreOptions {\n adapter: NoydbStore\n vault: string\n encrypted: boolean\n getDEK: (collectionName: string) => Promise<EnclaveKey>\n actor: string\n}\n\nexport class SequenceStore {\n private readonly adapter: NoydbStore\n private readonly vault: string\n private readonly encrypted: boolean\n private readonly getDEK: (collectionName: string) => Promise<EnclaveKey>\n private readonly actor: string\n /**\n * Memoized DEK promise. The `_sequences` collection DEK is created on\n * first access; without sharing one promise, a burst of concurrent\n * `next()` calls would each trigger DEK creation and diverge (one\n * writer's ciphertext unreadable by another). One shared promise → one\n * DEK.\n */\n private dekPromise: Promise<EnclaveKey> | null = null\n\n constructor(opts: SequenceStoreOptions) {\n this.adapter = opts.adapter\n this.vault = opts.vault\n this.encrypted = opts.encrypted\n this.getDEK = opts.getDEK\n this.actor = opts.actor\n }\n\n /** A handle bound to one sequence name. */\n handle(name: string): SequenceHandle {\n return {\n next: () => this.next(name),\n peek: () => this.peek(name),\n seedTo: (n) => this.seedTo(name, n),\n }\n }\n\n private assertOnline(): void {\n if (this.adapter.capabilities?.casAtomic !== true) {\n throw new SequenceOfflineError()\n }\n }\n\n private dek(): Promise<EnclaveKey> {\n if (!this.dekPromise) this.dekPromise = this.getDEK(SEQUENCE_COLLECTION)\n return this.dekPromise\n }\n\n private async read(name: string): Promise<{ env: EncryptedEnvelope | null; value: number }> {\n const env = await this.adapter.get(this.vault, SEQUENCE_COLLECTION, name)\n if (!env) return { env: null, value: 0 }\n const json = this.encrypted ? await openEnvelopeJson(env, await this.dek()) : env._data\n const state = JSON.parse(json) as SequenceState\n return { env, value: state.value }\n }\n\n private async encryptState(state: SequenceState, version: number): Promise<EncryptedEnvelope> {\n const json = JSON.stringify(state)\n if (!this.encrypted) {\n return { _noydb: NOYDB_FORMAT_VERSION, _v: version, _ts: new Date().toISOString(), _iv: '', _data: json, _by: this.actor }\n }\n const { iv, data } = await encrypt(json, await this.dek())\n return { _noydb: NOYDB_FORMAT_VERSION, _v: version, _ts: new Date().toISOString(), _iv: iv, _data: data, _by: this.actor }\n }\n\n async peek(name: string): Promise<number> {\n return (await this.read(name)).value\n }\n\n async next(name: string): Promise<number> {\n this.assertOnline()\n let lastConflict: ConflictError | undefined\n for (let attempt = 0; attempt < MAX_NEXT_ATTEMPTS; attempt++) {\n const { env, value } = await this.read(name)\n const nextValue = value + 1\n const expectedVersion = env?._v ?? 0 // 0 ≡ \"must not yet exist\" (create)\n const envelope = await this.encryptState({ value: nextValue }, expectedVersion + 1)\n try {\n await this.adapter.put(this.vault, SEQUENCE_COLLECTION, name, envelope, expectedVersion)\n return nextValue\n } catch (err) {\n if (isConflictError(err)) {\n lastConflict = err\n if (attempt < MAX_NEXT_ATTEMPTS - 1) await sleepBackoff(attempt)\n continue\n }\n throw err\n }\n }\n void lastConflict\n throw new SequenceContentionError(name, MAX_NEXT_ATTEMPTS)\n }\n\n async seedTo(name: string, n: number): Promise<void> {\n this.assertOnline()\n if (n <= 0) return // set-if-greater: 0 (and any non-positive seed) is a no-op\n let lastConflict: ConflictError | undefined\n for (let attempt = 0; attempt < MAX_NEXT_ATTEMPTS; attempt++) {\n const { env, value } = await this.read(name)\n if (value >= n) return // already at or past the floor — no write, idempotent\n const expectedVersion = env?._v ?? 0 // 0 ≡ \"must not yet exist\" (create)\n const envelope = await this.encryptState({ value: n }, expectedVersion + 1)\n try {\n await this.adapter.put(this.vault, SEQUENCE_COLLECTION, name, envelope, expectedVersion)\n return\n } catch (err) {\n if (isConflictError(err)) {\n lastConflict = err\n if (attempt < MAX_NEXT_ATTEMPTS - 1) await sleepBackoff(attempt)\n continue\n }\n throw err\n }\n }\n void lastConflict\n throw new SequenceContentionError(name, MAX_NEXT_ATTEMPTS)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAW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-audit/periods/window.ts
6
6
  var PERIODS_COLLECTION = "_periods";
@@ -21,4 +21,4 @@ export {
21
21
  PERIOD_TARGET_PURGES_COLLECTION,
22
22
  periodExclusiveUpperBound
23
23
  };
24
- //# sourceMappingURL=chunk-EZNTORXE.js.map
24
+ //# sourceMappingURL=chunk-SBGXQK5I.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-audit/periods/window.ts"],"sourcesContent":["/**\n * Pure period-window primitives — the reserved collection names and the\n * exclusive-upper-bound computation shared by freeze (#604), archive (#613),\n * target-purge (#615) and the period-scoped sync pull (#807).\n *\n * Deliberately dependency-light (kernel errors only): the sync engine\n * (`with-sync/period-scope.ts`) imports THIS module, not\n * `periods.ts`, so a period-scoped pull never drags the ledger hash-chain\n * machinery (`sha256Hex`/`canonicalJson`) into a bundle that opted out of\n * the periods service.\n */\nimport { ValidationError } from '../../kernel/errors.js'\n\n/** The reserved collection name holding closed-period metadata. */\nexport const PERIODS_COLLECTION = '_periods'\n\n/** Sibling of {@link PERIODS_COLLECTION} holding freeze companions (#604). */\nexport const PERIOD_FREEZES_COLLECTION = '_period_freezes'\n\n/** Sibling of {@link PERIODS_COLLECTION} holding archive companions (#613). */\nexport const PERIOD_ARCHIVES_COLLECTION = '_period_archives'\n\n/** Sibling of {@link PERIODS_COLLECTION} holding target-purge companions (#615). */\nexport const PERIOD_TARGET_PURGES_COLLECTION = '_period_target_purges'\n\n/**\n * Exclusive upper bound for a period's delete-marker purge window (#604).\n * Markers carry no business date (empty body), only write-time `_ts`, so freeze\n * purges markers with `_ts < bound`, `bound` being the instant just after the\n * period's inclusive `endDate`: a date-only `endDate` seals through end-of-day\n * → next midnight; a full-timestamp `endDate` seals through that instant → +1ms.\n */\nexport function periodExclusiveUpperBound(endDate: string): string {\n const ms = Date.parse(endDate)\n if (Number.isNaN(ms)) throw new ValidationError(`freezePeriod: unparseable period endDate \"${endDate}\".`)\n const dateOnly = /^\\d{4}-\\d{2}-\\d{2}$/.test(endDate)\n return new Date(ms + (dateOnly ? 86_400_000 : 1)).toISOString()\n}\n"],"mappings":";;;;;AAcO,IAAM,qBAAqB;AAG3B,IAAM,4BAA4B;AAGlC,IAAM,6BAA6B;AAGnC,IAAM,kCAAkC;AASxC,SAAS,0BAA0B,SAAyB;AACjE,QAAM,KAAK,KAAK,MAAM,OAAO;AAC7B,MAAI,OAAO,MAAM,EAAE,EAAG,OAAM,IAAI,gBAAgB,6CAA6C,OAAO,IAAI;AACxG,QAAM,WAAW,sBAAsB,KAAK,OAAO;AACnD,SAAO,IAAI,KAAK,MAAM,WAAW,QAAa,EAAE,EAAE,YAAY;AAChE;","names":[]}
@@ -4,10 +4,10 @@ import {
4
4
  persistUserVisibility,
5
5
  readUserVisibility,
6
6
  saveUserEnvelope
7
- } from "./chunk-WZ3NCMK6.js";
7
+ } from "./chunk-6PFST3FC.js";
8
8
  import {
9
9
  PolicyDeniedError
10
- } from "./chunk-QZWTRENR.js";
10
+ } from "./chunk-AR5D76T2.js";
11
11
 
12
12
  // src/with-party/directory/user-envelope/api.ts
13
13
  var UserApi = class {
@@ -379,4 +379,4 @@ export {
379
379
  UserApi,
380
380
  createUserApi
381
381
  };
382
- //# sourceMappingURL=chunk-3XKESW5E.js.map
382
+ //# sourceMappingURL=chunk-SL3PLML2.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SCHEMAS_COLLECTION
3
- } from "./chunk-OBPVWOSQ.js";
3
+ } from "./chunk-Q6MXHDSE.js";
4
4
  import {
5
5
  BLOB_CHUNKS_COLLECTION,
6
6
  BLOB_COLLECTION,
@@ -8,11 +8,11 @@ import {
8
8
  BLOB_INTENT_COLLECTION,
9
9
  BLOB_SLOTS_PREFIX,
10
10
  BLOB_VERSIONS_PREFIX
11
- } from "./chunk-NQSO4UAH.js";
11
+ } from "./chunk-ELJOLQIG.js";
12
12
  import {
13
13
  assembleBundleContainer,
14
14
  buildExtractedPartitionWrapper
15
- } from "./chunk-SGQ4N5FS.js";
15
+ } from "./chunk-KDWBVCIX.js";
16
16
  import {
17
17
  generateULID
18
18
  } from "./chunk-ZJADGNYF.js";
@@ -23,11 +23,11 @@ import {
23
23
  canonicalJson,
24
24
  envelopePayloadHash,
25
25
  hashEntry
26
- } from "./chunk-ISRKW4YN.js";
26
+ } from "./chunk-V3EGXDFN.js";
27
27
  import {
28
28
  openEnvelopeJson,
29
29
  writeEnvelopeBody
30
- } from "./chunk-RZPOZPZU.js";
30
+ } from "./chunk-623QEHDB.js";
31
31
  import {
32
32
  bufferToBase64,
33
33
  decrypt,
@@ -37,14 +37,14 @@ import {
37
37
  generateDEK,
38
38
  unwrapCek,
39
39
  wrapCek
40
- } from "./chunk-AKKRXT23.js";
40
+ } from "./chunk-RPWMDIGK.js";
41
41
  import {
42
42
  NOYDB_BACKUP_VERSION,
43
43
  NOYDB_FORMAT_VERSION
44
- } from "./chunk-GZACYEOB.js";
44
+ } from "./chunk-77AEMXFA.js";
45
45
  import {
46
46
  PartitionExtractionError
47
- } from "./chunk-QZWTRENR.js";
47
+ } from "./chunk-AR5D76T2.js";
48
48
 
49
49
  // src/with-cargo/walk-closure.ts
50
50
  async function walkClosure(vault, opts) {
@@ -492,4 +492,4 @@ export {
492
492
  extractPartition,
493
493
  extractPartitionCore
494
494
  };
495
- //# sourceMappingURL=chunk-BYFXLDVV.js.map
495
+ //# sourceMappingURL=chunk-TJOUKMWF.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SealedRecordNotEnabledError
3
- } from "./chunk-QZWTRENR.js";
3
+ } from "./chunk-AR5D76T2.js";
4
4
 
5
5
  // src/with-audit/sealed-record/strategy.ts
6
6
  var NO_SEALED_RECORD = {
@@ -18,4 +18,4 @@ var NO_SEALED_RECORD = {
18
18
  export {
19
19
  NO_SEALED_RECORD
20
20
  };
21
- //# sourceMappingURL=chunk-QD46HPZG.js.map
21
+ //# sourceMappingURL=chunk-U2ID5A2I.js.map
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  base64ToBuffer,
6
6
  bufferToBase64
7
- } from "./chunk-AKKRXT23.js";
7
+ } from "./chunk-RPWMDIGK.js";
8
8
  import {
9
9
  SessionExpiredError,
10
10
  SessionNotFoundError,
11
11
  SessionPolicyError,
12
12
  ValidationError
13
- } from "./chunk-QZWTRENR.js";
13
+ } from "./chunk-AR5D76T2.js";
14
14
 
15
15
  // src/with-party/session/session.ts
16
16
  var subtle = globalThis.crypto.subtle;
@@ -364,4 +364,4 @@ export {
364
364
  clearDevUnlock,
365
365
  isDevUnlockActive
366
366
  };
367
- //# sourceMappingURL=chunk-X4MVWPHV.js.map
367
+ //# sourceMappingURL=chunk-UC5Y7OEJ.js.map
@@ -0,0 +1,25 @@
1
+ import {
2
+ grant,
3
+ revoke,
4
+ rotateKeys
5
+ } from "./chunk-FZAP4JNC.js";
6
+
7
+ // src/with-party/team/active.ts
8
+ function withTeam() {
9
+ return {
10
+ async grant(team, vault, options, factors) {
11
+ return team.runGrant(grant, vault, options, factors);
12
+ },
13
+ async revoke(team, vault, options, factors) {
14
+ return team.runRevoke(revoke, vault, options, factors);
15
+ },
16
+ async rotate(team, vault, collections) {
17
+ return team.runRotate(rotateKeys, vault, collections);
18
+ }
19
+ };
20
+ }
21
+
22
+ export {
23
+ withTeam
24
+ };
25
+ //# sourceMappingURL=chunk-US2AR4BI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-party/team/active.ts"],"sourcesContent":["/**\n * Enable the multi-user team capability (#267 Track A tail).\n *\n * Pass to `createNoydb({ teamStrategy: withTeam() })` to make `db.grant` /\n * `db.revoke` / `db.rotate` live. The keyring grant/revoke/rotate engines\n * are statically imported HERE — this module is reachable only through the\n * `@noy-db/hub/team` subpath (and the root barrel's tree-shakeable\n * re-export), so a single-user floor bundle never carries them. The facade\n * (`TeamFacade.runGrant` / `runRevoke` / `runRotate`) owns the policy-gate +\n * keyring plumbing and receives the engine as an argument.\n */\nimport type { TeamStrategy } from './strategy.js'\nimport { grant as grantEngine, revoke as revokeEngine, rotateKeys as rotateEngine } from './keyring.js'\n\nexport function withTeam(): TeamStrategy {\n return {\n async grant(team, vault, options, factors) {\n return team.runGrant(grantEngine, vault, options, factors)\n },\n async revoke(team, vault, options, factors) {\n return team.runRevoke(revokeEngine, vault, options, factors)\n },\n async rotate(team, vault, collections) {\n return team.runRotate(rotateEngine, vault, collections)\n },\n }\n}\n"],"mappings":";;;;;;;AAcO,SAAS,WAAyB;AACvC,SAAO;AAAA,IACL,MAAM,MAAM,MAAM,OAAO,SAAS,SAAS;AACzC,aAAO,KAAK,SAAS,OAAa,OAAO,SAAS,OAAO;AAAA,IAC3D;AAAA,IACA,MAAM,OAAO,MAAM,OAAO,SAAS,SAAS;AAC1C,aAAO,KAAK,UAAU,QAAc,OAAO,SAAS,OAAO;AAAA,IAC7D;AAAA,IACA,MAAM,OAAO,MAAM,OAAO,aAAa;AACrC,aAAO,KAAK,UAAU,YAAc,OAAO,WAAW;AAAA,IACxD;AAAA,EACF;AACF;","names":[]}
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  envelopeBodyForHash
3
- } from "./chunk-RZPOZPZU.js";
3
+ } from "./chunk-623QEHDB.js";
4
4
  import {
5
5
  sha256Hex
6
- } from "./chunk-AKKRXT23.js";
6
+ } from "./chunk-RPWMDIGK.js";
7
7
 
8
8
  // src/with-commit/history/ledger/entry.ts
9
9
  function canonicalJson(value) {
@@ -67,4 +67,4 @@ export {
67
67
  parseIndex,
68
68
  envelopePayloadHash
69
69
  };
70
- //# sourceMappingURL=chunk-ISRKW4YN.js.map
70
+ //# sourceMappingURL=chunk-V3EGXDFN.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  openEnvelopeJson
3
- } from "./chunk-RZPOZPZU.js";
3
+ } from "./chunk-623QEHDB.js";
4
4
  import {
5
5
  encrypt,
6
6
  hmacSha256Hex,
7
7
  sha256Hex
8
- } from "./chunk-AKKRXT23.js";
8
+ } from "./chunk-RPWMDIGK.js";
9
9
  import {
10
10
  NOYDB_FORMAT_VERSION
11
- } from "./chunk-GZACYEOB.js";
11
+ } from "./chunk-77AEMXFA.js";
12
12
 
13
13
  // src/with-audit/forget/strategy.ts
14
14
  var NO_FORGET = { subjects: {} };
@@ -147,4 +147,4 @@ export {
147
147
  coerceSubjectId,
148
148
  readDottedPath
149
149
  };
150
- //# sourceMappingURL=chunk-KFRPNHWR.js.map
150
+ //# sourceMappingURL=chunk-V4O6YZSP.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  sha256Hex
3
- } from "./chunk-AKKRXT23.js";
3
+ } from "./chunk-RPWMDIGK.js";
4
4
  import {
5
5
  MaterializedViewSourceUnknownError
6
- } from "./chunk-QZWTRENR.js";
6
+ } from "./chunk-AR5D76T2.js";
7
7
 
8
8
  // src/with-formula/materialized-views/dependency-analyzer.ts
9
9
  function analyzeDependencies(query) {
@@ -366,4 +366,4 @@ export {
366
366
  MaterializedViewRegistry,
367
367
  wrapDbWithPredicates
368
368
  };
369
- //# sourceMappingURL=chunk-3HUYRN24.js.map
369
+ //# sourceMappingURL=chunk-W7C7MMIS.js.map
@@ -1,36 +1,36 @@
1
1
  import {
2
2
  SyncScheduler
3
- } from "./chunk-MTJLOC3Y.js";
3
+ } from "./chunk-55LKVALY.js";
4
4
  import {
5
5
  PERIODS_COLLECTION,
6
6
  PERIOD_ARCHIVES_COLLECTION,
7
7
  PERIOD_FREEZES_COLLECTION,
8
8
  PERIOD_TARGET_PURGES_COLLECTION,
9
9
  periodExclusiveUpperBound
10
- } from "./chunk-EZNTORXE.js";
10
+ } from "./chunk-SBGXQK5I.js";
11
11
  import {
12
12
  envelopeBodySize
13
- } from "./chunk-RZPOZPZU.js";
13
+ } from "./chunk-623QEHDB.js";
14
14
  import {
15
15
  isDeleteMarker,
16
16
  isTombstoneShape
17
- } from "./chunk-VH6SOCXH.js";
17
+ } from "./chunk-EFJAAFBW.js";
18
18
  import {
19
19
  bufferToBase64,
20
20
  decrypt,
21
21
  derivePresenceKey,
22
22
  encrypt,
23
23
  generateIV
24
- } from "./chunk-AKKRXT23.js";
24
+ } from "./chunk-RPWMDIGK.js";
25
25
  import {
26
26
  NOYDB_SYNC_VERSION
27
- } from "./chunk-GZACYEOB.js";
27
+ } from "./chunk-77AEMXFA.js";
28
28
  import {
29
- ConflictError,
30
- ValidationError
31
- } from "./chunk-QZWTRENR.js";
29
+ ValidationError,
30
+ isConflictError
31
+ } from "./chunk-AR5D76T2.js";
32
32
 
33
- // src/with-party/team/presence.ts
33
+ // src/with-sync/presence.ts
34
34
  var PresenceHandle = class {
35
35
  adapter;
36
36
  syncAdapter;
@@ -237,7 +237,7 @@ var PresenceHandle = class {
237
237
  }
238
238
  };
239
239
 
240
- // src/with-party/team/sync-period-scope.ts
240
+ // src/with-sync/period-scope.ts
241
241
  var PERIOD_SUMMARY_COLLECTIONS = [
242
242
  PERIODS_COLLECTION,
243
243
  PERIOD_FREEZES_COLLECTION,
@@ -282,7 +282,7 @@ function buildPeriodScope(option, records) {
282
282
  };
283
283
  }
284
284
 
285
- // src/with-party/team/sync.ts
285
+ // src/with-sync/engine.ts
286
286
  var SyncEngine = class {
287
287
  local;
288
288
  remote;
@@ -367,12 +367,20 @@ var SyncEngine = class {
367
367
  this.role = opts.role ?? "sync-peer";
368
368
  this.label = opts.label;
369
369
  const policy = opts.syncPolicy;
370
- if (policy && policy.push.mode !== "manual") {
370
+ if (policy && (policy.push.mode !== "manual" || policy.pull.mode !== "manual")) {
371
371
  this.scheduler = new SyncScheduler(policy, {
372
372
  push: () => this.push().then(() => {
373
373
  }),
374
- pull: () => this.pull().then(() => {
375
- }),
374
+ // #618 role-gate the SCHEDULER-INITIATED pull. The Noydb layer gates
375
+ // pull-from-sink for explicit calls, but the scheduler calls the engine
376
+ // directly and would bypass it: a backup/archive-only primary with an
377
+ // `interval`/`on-focus` pull policy would pull ungated, reintroducing
378
+ // #616. This guards the engine self-initiating on a timer; an explicit
379
+ // `engine.pull()` still pulls for every role.
380
+ // `collections` is set by a 'phased' sequence — one collection per phase.
381
+ // A role-gated skip reports 'incomplete': nothing was pulled, so the
382
+ // phase must not mark its collection ready.
383
+ pull: (collections) => this.role === "sync-peer" ? this.pull(collections ? { collections: [...collections] } : void 0).then((r) => r.errors.length === 0 ? "complete" : "incomplete") : Promise.resolve("incomplete"),
376
384
  getDirtyCount: () => this.dirty.length
377
385
  });
378
386
  } else {
@@ -494,7 +502,7 @@ var SyncEngine = class {
494
502
  completed.push(i);
495
503
  pushed++;
496
504
  } catch (err) {
497
- if (err instanceof ConflictError) {
505
+ if (isConflictError(err)) {
498
506
  const remoteEnvelope = await this.remote.get(this.vault, entry.collection, entry.id);
499
507
  if (remoteEnvelope) {
500
508
  if (isTombstoneShape(remoteEnvelope)) {
@@ -520,7 +528,9 @@ var SyncEngine = class {
520
528
  );
521
529
  conflicts.push(conflict);
522
530
  if (handled === "local") {
523
- await this.remote.put(this.vault, entry.collection, entry.id, conflict.local);
531
+ const winner = this.advancePastRemote(conflict.local, remoteEnvelope);
532
+ await this.remote.put(this.vault, entry.collection, entry.id, winner);
533
+ if (winner !== conflict.local) await this.applyRemote(entry.collection, entry.id, winner);
524
534
  completed.push(i);
525
535
  pushed++;
526
536
  } else if (handled === "remote") {
@@ -779,7 +789,7 @@ var SyncEngine = class {
779
789
  completed.push(i);
780
790
  pushed++;
781
791
  } catch (err) {
782
- if (err instanceof ConflictError) {
792
+ if (isConflictError(err)) {
783
793
  const remoteEnvelope = await this.remote.get(this.vault, entry.collection, entry.id);
784
794
  if (remoteEnvelope) {
785
795
  if (isTombstoneShape(remoteEnvelope)) {
@@ -805,7 +815,9 @@ var SyncEngine = class {
805
815
  );
806
816
  conflicts.push(conflict);
807
817
  if (handled === "local") {
808
- await this.remote.put(this.vault, entry.collection, entry.id, conflict.local);
818
+ const winner = this.advancePastRemote(conflict.local, remoteEnvelope);
819
+ await this.remote.put(this.vault, entry.collection, entry.id, winner);
820
+ if (winner !== conflict.local) await this.applyRemote(entry.collection, entry.id, winner);
809
821
  completed.push(i);
810
822
  pushed++;
811
823
  } else if (handled === "remote") {
@@ -840,11 +852,13 @@ var SyncEngine = class {
840
852
  }
841
853
  /** Get current sync status. */
842
854
  status() {
855
+ const scheduled = this.scheduler?.status;
843
856
  return {
844
857
  dirty: this.dirty.length,
845
858
  lastPush: this.lastPush,
846
859
  lastPull: this.lastPull,
847
- online: this.isOnline
860
+ online: this.isOnline,
861
+ ...scheduled && scheduled.readiness.size > 0 ? { readiness: scheduled.readiness, phase: scheduled.phase } : {}
848
862
  };
849
863
  }
850
864
  // ─── Auto-Sync ───────────────────────────────────────────────────
@@ -889,6 +903,21 @@ var SyncEngine = class {
889
903
  * ordinary put. `isTombstoneShape` covers a forgotten-elsewhere record arriving as a shred;
890
904
  * `isDeleteMarker` covers an ordinary (#589) delete — both route to the SAME 'delete' action
891
905
  * (sync delete ≠ forget: freshness only, no shred/residue channel on the receiving side). */
906
+ /**
907
+ * #936 — a local-wins resolution write must SUPERSEDE the remote, never
908
+ * overwrite it in place: when the winner's `_v` does not already exceed
909
+ * the remote's (the same-`_v` push tie), re-stamp it at `remote._v + 1`.
910
+ * Without this the loser's next pull sees no delta (`_v`-based
911
+ * detection) and the peers stay silently diverged at the same version.
912
+ * `_v` is envelope metadata — AEAD-unbound, and `_vdig` is deliberately
913
+ * `_v`-independent — so the engine may restamp ciphertext. Callers must
914
+ * mirror the advanced envelope locally (`applyRemote`) so both sides
915
+ * agree. The 'merged' branch needs none of this: resolver output is
916
+ * already stamped `max(local, remote) + 1`.
917
+ */
918
+ advancePastRemote(winner, remote) {
919
+ return winner._v > remote._v ? winner : { ...winner, _v: remote._v + 1 };
920
+ }
892
921
  async applyRemote(collection, id, envelope) {
893
922
  await this.local.put(this.vault, collection, id, envelope);
894
923
  if (this.pullByteSink !== null) {
@@ -1010,7 +1039,7 @@ var SyncEngine = class {
1010
1039
  }
1011
1040
  };
1012
1041
 
1013
- // src/with-party/team/sync-transaction.ts
1042
+ // src/with-sync/transaction.ts
1014
1043
  var SyncTransaction = class {
1015
1044
  comp;
1016
1045
  engine;
@@ -1073,4 +1102,4 @@ export {
1073
1102
  SyncEngine,
1074
1103
  SyncTransaction
1075
1104
  };
1076
- //# sourceMappingURL=chunk-BXHMZ2XW.js.map
1105
+ //# sourceMappingURL=chunk-WFYKIDCS.js.map