@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-party/broker/seed.ts"],"sourcesContent":["/**\n * `_broker` reserved-collection seed lifecycle (#479, credential-broker\n * spec §2/§3). Modeled on `with-sync/credentials.ts`: a\n * `_`-prefixed reserved collection, record id = `brokerId`, encrypted under\n * the collection's own DEK, `requireAdminAccess` role gate (owner/admin\n * only — custodian intentionally excluded, same rationale as\n * `_sync_credentials`: this is transport-auth material, not the\n * custodian's operational scope).\n *\n * Three operations, each a free function taking a {@link BrokerSeedCtx}\n * (the {@link BrokerCtx} threaded through `with-party/broker/active.ts`,\n * augmented there with the `config` its closure was built with):\n *\n * - {@link enrollSeed} — two-phase commit (I9): create-if-absent CAS the\n * seed (I4), then register its derived proof key with the broker host,\n * then (only on a 2xx) mark the record `registered: true`. A seed\n * persisted whose `/enroll` POST failed stays `registered: false` so a\n * later `credentialSource()` fails fast instead of degrading into an\n * opaque `BrokerProofError` (I9/V23).\n * - {@link rotateSeed} — quiesce-then-swap (I5): mint a fresh seed,\n * register-new-first, THEN overwrite the local record — closing the\n * torn-proof window a naive local-overwrite-then-register order would\n * open. The single-flight cache quiesce itself (await in-flight, bump\n * epoch) is the caller's job (`with-party/broker/active.ts`) since the\n * cache lives in that closure, not here.\n * - {@link mintStoreCredentials} — the challenge/response round trip\n * (`/challenge` then `/credentials`) that produces one `StoreCredentials`\n * value; the single-flight cache wrapping it lives in `active.ts`.\n *\n * First-seed creation calls `ensureCollectionDEK`, which throws\n * (`ValidationError`) when the keyring's KEK is `null` (PIN quick-resume /\n * session-restore) — this module intercepts that and re-surfaces it as\n * {@link BrokerEnrolmentError} (R-B8/I3): *enrol* needs the KEK; *use* of an\n * already-enrolled seed needs only the DEK.\n *\n * @module\n */\nimport type { NoydbStore, EncryptedEnvelope, StoreCredentials } from '../../kernel/types.js'\nimport { NOYDB_FORMAT_VERSION } from '../../kernel/types.js'\nimport type { UnlockedKeyring } from '../../with-party/team/keyring.js'\nimport { ensureCollectionDEK } from '../../with-party/team/keyring.js'\nimport { BROKER_COLLECTION } from '../../with-party/team/reserved-secret-collections.js'\nimport {\n openEnvelopeJson,\n writeEnvelopeBody,\n bufferToBase64,\n base64ToBuffer,\n deriveBrokerProofBits,\n computeBrokerProof,\n} from '../../kernel/enclave/index.js'\nimport type { EnclaveKey } from '../../kernel/enclave/index.js'\nimport {\n PermissionDeniedError,\n ValidationError,\n isConflictError,\n NetworkError,\n BrokerEnrolmentError,\n BrokerProofError,\n} from '../../kernel/errors.js'\nimport type { BrokerSeedCtx, BrokerConfig } from '../../port/with/broker-strategy.js'\n\n/** The `_broker/<brokerId>` record payload (spec §3). */\nexport interface BrokerSeedRecord {\n readonly brokerId: string\n /** base64(32 random bytes). */\n readonly seed: string\n readonly endpoint: string\n readonly createdAt: string\n /** `true` only once `/enroll` has returned a 2xx for this seed (I9). */\n readonly registered: boolean\n}\n\nfunction requireAdminAccess(keyring: UnlockedKeyring): void {\n // Custodian is INTENTIONALLY excluded — the _broker seed is transport-auth\n // material (mints cloud store credentials), not the custodian's\n // operational data scope. Same rationale as _sync_credentials' FR-6 note.\n if (keyring.role !== 'owner' && keyring.role !== 'admin') {\n throw new PermissionDeniedError(\n `Credential-broker operations require owner or admin role. Current role: \"${keyring.role}\"`,\n )\n }\n}\n\n// `ensureCollectionDEK` only dedupes concurrent first-time DEK creates WITHIN one\n// closure instance — since every call site here asks for a fresh closure, two\n// concurrent `enrollSeed()` calls sharing the same (store, vault, keyring) would\n// otherwise each mint a DIFFERENT `_broker` DEK and race `persistKeyring`, leaving\n// the seed record encrypted under a DEK the keyring no longer holds (TamperedError\n// on the next read). Dedupe across calls here, keyed by store identity + vault\n// (V20 — the CAS enrol vector actually exercises this).\nconst inFlightDekByStore = new WeakMap<NoydbStore, Map<string, Promise<EnclaveKey>>>()\n\nasync function brokerDek(store: NoydbStore, vault: string, keyring: UnlockedKeyring): Promise<EnclaveKey> {\n const existing = keyring.deks.get(BROKER_COLLECTION)\n if (existing) return existing\n\n let perStore = inFlightDekByStore.get(store)\n if (!perStore) { perStore = new Map(); inFlightDekByStore.set(store, perStore) }\n const pending = perStore.get(vault)\n if (pending) return pending\n\n const promise = (async () => {\n try {\n const getDek = await ensureCollectionDEK(store, vault, keyring)\n return await getDek(BROKER_COLLECTION)\n } catch (err) {\n if (err instanceof ValidationError) {\n throw new BrokerEnrolmentError(\n 'enroll()/rotate() need the KEK to provision the _broker DEK on first use — ' +\n 're-authenticate at tier 1 (secret) before enrolling. Using an already-' +\n 'enrolled seed (credentialSource()) needs only the DEK.',\n )\n }\n throw err\n }\n })()\n perStore.set(vault, promise)\n try {\n return await promise\n } finally {\n perStore.delete(vault)\n }\n}\n\nasync function readRecord(\n store: NoydbStore,\n vault: string,\n brokerId: string,\n dek: EnclaveKey,\n): Promise<{ envelope: EncryptedEnvelope; record: BrokerSeedRecord } | null> {\n const envelope = await store.get(vault, BROKER_COLLECTION, brokerId)\n if (!envelope) return null\n const record = JSON.parse(await openEnvelopeJson(envelope, dek)) as BrokerSeedRecord\n return { envelope, record }\n}\n\nasync function persistRecord(\n store: NoydbStore,\n vault: string,\n keyring: UnlockedKeyring,\n dek: EnclaveKey,\n record: BrokerSeedRecord,\n expectedVersion: number,\n): Promise<void> {\n const body = await writeEnvelopeBody(JSON.stringify(record), dek)\n const envelope: EncryptedEnvelope = {\n _noydb: NOYDB_FORMAT_VERSION,\n _v: expectedVersion + 1,\n _ts: new Date().toISOString(),\n ...body,\n _by: keyring.userId,\n }\n await store.put(vault, BROKER_COLLECTION, record.brokerId, envelope, expectedVersion)\n}\n\ninterface SeedState {\n readonly seedBytes: Uint8Array\n readonly record: BrokerSeedRecord\n readonly dek: EnclaveKey\n readonly version: number\n}\n\n/** Create-if-absent CAS (I4/V20): a concurrent enrol that loses the race\n * re-reads the winner's seed instead of persisting a second one. */\nasync function ensureSeedRecord(store: NoydbStore, vault: string, keyring: UnlockedKeyring, config: BrokerConfig): Promise<SeedState> {\n requireAdminAccess(keyring)\n const dek = await brokerDek(store, vault, keyring)\n\n const existing = await readRecord(store, vault, config.brokerId, dek)\n if (existing) {\n return { seedBytes: base64ToBuffer(existing.record.seed), record: existing.record, dek, version: existing.envelope._v }\n }\n\n const seedBytes = globalThis.crypto.getRandomValues(new Uint8Array(32))\n const record: BrokerSeedRecord = {\n brokerId: config.brokerId,\n seed: bufferToBase64(seedBytes),\n endpoint: config.endpoint,\n createdAt: new Date().toISOString(),\n registered: false,\n }\n try {\n await persistRecord(store, vault, keyring, dek, record, 0)\n return { seedBytes, record, dek, version: 1 }\n } catch (err) {\n if (!(isConflictError(err))) throw err\n const winner = await readRecord(store, vault, config.brokerId, dek)\n if (!winner) throw err\n return { seedBytes: base64ToBuffer(winner.record.seed), record: winner.record, dek, version: winner.envelope._v }\n }\n}\n\nasync function postEnroll(config: BrokerConfig, vault: string, proofBits: Uint8Array): Promise<void> {\n const fetchFn = config.fetch ?? globalThis.fetch\n const attestation = config.attestation ? await config.attestation() : undefined\n let res: Response\n try {\n res = await fetchFn(`${config.endpoint}/enroll`, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n ...(attestation !== undefined ? { authorization: `Bearer ${attestation}` } : {}),\n },\n body: JSON.stringify({ vaultId: vault, brokerId: config.brokerId, proofKey: bufferToBase64(proofBits) }),\n })\n } catch (err) {\n throw new BrokerEnrolmentError(`broker /enroll request failed: ${(err as Error).message}`)\n }\n if (!res.ok) {\n throw new BrokerEnrolmentError(`broker refused enrolment (status ${res.status}) — attestation likely missing or invalid`)\n }\n}\n\n/**\n * Enrol (idempotent, two-phase commit — I9): create-if-absent the `_broker`\n * seed (I4), derive+register its proof key with the broker host, and only\n * on a 2xx mark the record `registered: true`. Requires owner/admin role\n * and (for first-seed creation only) the KEK.\n */\nexport async function enrollSeed(ctx: BrokerSeedCtx): Promise<void> {\n const { store, vault, keyring, config } = ctx\n const { seedBytes, record, dek, version } = await ensureSeedRecord(store, vault, keyring, config)\n if (record.registered) {\n seedBytes.fill(0)\n return\n }\n\n const proofBits = await deriveBrokerProofBits(seedBytes, vault, config.brokerId)\n seedBytes.fill(0)\n try {\n await postEnroll(config, vault, proofBits)\n } finally {\n proofBits.fill(0)\n }\n\n try {\n await persistRecord(store, vault, keyring, dek, { ...record, registered: true }, version)\n } catch (err) {\n if (isConflictError(err)) {\n const latest = await readRecord(store, vault, config.brokerId, dek)\n if (latest?.record.registered) return // a concurrent enrol already committed the same outcome\n }\n throw err\n }\n}\n\n/**\n * Rotate (quiesce-then-swap — I5): mint a fresh seed, register its proof\n * key with the broker host FIRST, then overwrite the local `_broker`\n * record. The broker host is expected to accept both the old and new\n * registration for a short grace window, so an in-flight proof computed\n * under the old key (from before rotation started) still verifies. Cache\n * quiescing (awaiting any in-flight round-trip, bumping the refresh-cache\n * epoch) is the caller's job — `with-party/broker/active.ts` — since the\n * cache lives in that closure, not here.\n */\nexport async function rotateSeed(ctx: BrokerSeedCtx): Promise<void> {\n const { store, vault, keyring, config } = ctx\n requireAdminAccess(keyring)\n const dek = await brokerDek(store, vault, keyring)\n\n const existing = await readRecord(store, vault, config.brokerId, dek)\n if (!existing) {\n // Nothing to rotate yet — behaves like a first enrol.\n await enrollSeed(ctx)\n return\n }\n\n const newSeedBytes = globalThis.crypto.getRandomValues(new Uint8Array(32))\n const newProofBits = await deriveBrokerProofBits(newSeedBytes, vault, config.brokerId)\n try {\n await postEnroll(config, vault, newProofBits)\n } finally {\n newProofBits.fill(0)\n }\n\n const record: BrokerSeedRecord = {\n brokerId: config.brokerId,\n seed: bufferToBase64(newSeedBytes),\n endpoint: config.endpoint,\n createdAt: new Date().toISOString(),\n registered: true,\n }\n newSeedBytes.fill(0)\n await persistRecord(store, vault, keyring, dek, record, existing.envelope._v)\n}\n\n/**\n * The challenge/response round trip: `POST /challenge`, derive+sign the\n * proof from the decrypted seed, `POST /credentials`. One network round\n * trip per call — the single-flight/cache wrapping lives in `active.ts`.\n *\n * Fails fast with {@link BrokerEnrolmentError} if the seed hasn't completed\n * enrolment yet (`registered !== true` — I9/V23), never degrading into an\n * opaque {@link BrokerProofError}.\n */\nexport async function mintStoreCredentials(ctx: BrokerSeedCtx, profile?: string): Promise<StoreCredentials> {\n const { store, vault, keyring, config } = ctx\n requireAdminAccess(keyring)\n const dek = await brokerDek(store, vault, keyring)\n\n const found = await readRecord(store, vault, config.brokerId, dek)\n if (!found) throw new BrokerEnrolmentError(`No _broker seed enrolled for brokerId \"${config.brokerId}\" — call enroll() first.`)\n if (!found.record.registered) {\n throw new BrokerEnrolmentError(\n `The _broker seed for \"${config.brokerId}\" has not completed enrolment with the broker host — call enroll() again.`,\n )\n }\n\n const fetchFn = config.fetch ?? globalThis.fetch\n const endpointOrigin = new URL(config.endpoint).origin\n\n let challengeRes: Response\n try {\n challengeRes = await fetchFn(`${config.endpoint}/challenge`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ vaultId: vault, brokerId: config.brokerId }),\n })\n } catch (err) {\n throw new NetworkError(`broker /challenge request failed: ${(err as Error).message}`)\n }\n if (!challengeRes.ok) throw new NetworkError(`broker /challenge failed with status ${challengeRes.status}`)\n const { challenge, expiresAt } = (await challengeRes.json()) as { challenge: string; expiresAt: string }\n\n const seedBytes = base64ToBuffer(found.record.seed)\n const proof = await computeBrokerProof(seedBytes, vault, config.brokerId, { endpointOrigin, profile, challenge, expiresAt })\n\n let credsRes: Response\n try {\n credsRes = await fetchFn(`${config.endpoint}/credentials`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ vaultId: vault, brokerId: config.brokerId, challenge, proof, ...(profile !== undefined ? { profile } : {}) }),\n })\n } catch (err) {\n throw new NetworkError(`broker /credentials request failed: ${(err as Error).message}`)\n }\n if (credsRes.status === 401 || credsRes.status === 403) throw new BrokerProofError('broker rejected the challenge proof')\n if (!credsRes.ok) throw new NetworkError(`broker /credentials failed with status ${credsRes.status}`)\n return (await credsRes.json()) as StoreCredentials\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,SAAS,mBAAmB,SAAgC;AAI1D,MAAI,QAAQ,SAAS,WAAW,QAAQ,SAAS,SAAS;AACxD,UAAM,IAAI;AAAA,MACR,4EAA4E,QAAQ,IAAI;AAAA,IAC1F;AAAA,EACF;AACF;AASA,IAAM,qBAAqB,oBAAI,QAAsD;AAErF,eAAe,UAAU,OAAmB,OAAe,SAA+C;AACxG,QAAM,WAAW,QAAQ,KAAK,IAAI,iBAAiB;AACnD,MAAI,SAAU,QAAO;AAErB,MAAI,WAAW,mBAAmB,IAAI,KAAK;AAC3C,MAAI,CAAC,UAAU;AAAE,eAAW,oBAAI,IAAI;AAAG,uBAAmB,IAAI,OAAO,QAAQ;AAAA,EAAE;AAC/E,QAAM,UAAU,SAAS,IAAI,KAAK;AAClC,MAAI,QAAS,QAAO;AAEpB,QAAM,WAAW,YAAY;AAC3B,QAAI;AACF,YAAM,SAAS,MAAM,oBAAoB,OAAO,OAAO,OAAO;AAC9D,aAAO,MAAM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UAAU,EAAE,gBAAgB,SAAS,WAAW,UAAU,CAAC;AAE3H,MAAI;AACJ,MAAI;AACF,eAAW,MAAM,QAAQ,GAAG,OAAO,QAAQ,gBAAgB;AAAA,MACzD,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,MAC9C,MAAM,KAAK,UAAU,EAAE,SAAS,OAAO,UAAU,OAAO,UAAU,WAAW,OAAO,GAAI,YAAY,SAAY,EAAE,QAAQ,IAAI,CAAC,EAAG,CAAC;AAAA,IACrI,CAAC;AAAA,EACH,SAAS,KAAK;AACZ,UAAM,IAAI,aAAa,uCAAwC,IAAc,OAAO,EAAE;AAAA,EACxF;AACA,MAAI,SAAS,WAAW,OAAO,SAAS,WAAW,IAAK,OAAM,IAAI,iBAAiB,qCAAqC;AACxH,MAAI,CAAC,SAAS,GAAI,OAAM,IAAI,aAAa,0CAA0C,SAAS,MAAM,EAAE;AACpG,SAAQ,MAAM,SAAS,KAAK;AAC9B;","names":[]}
@@ -5,18 +5,18 @@ import {
5
5
  compileSequenceFormat,
6
6
  resolveSequenceKey,
7
7
  withSequence
8
- } from "../chunk-EBKCYQ2D.js";
9
- import "../chunk-RZPOZPZU.js";
10
- import "../chunk-VH6SOCXH.js";
11
- import "../chunk-35NMVJ7I.js";
12
- import "../chunk-NFZGZ4AK.js";
13
- import "../chunk-QJNCB5SK.js";
8
+ } from "../chunk-RQILGK3N.js";
9
+ import "../chunk-623QEHDB.js";
10
+ import "../chunk-EFJAAFBW.js";
11
+ import "../chunk-MYSNNMJ3.js";
12
+ import "../chunk-L67H6FAQ.js";
13
+ import "../chunk-GIGLOQL7.js";
14
14
  import "../chunk-LP7BEXCT.js";
15
- import "../chunk-AKKRXT23.js";
16
- import "../chunk-GZACYEOB.js";
15
+ import "../chunk-RPWMDIGK.js";
16
+ import "../chunk-77AEMXFA.js";
17
17
  import {
18
18
  SequenceNotEnabledError
19
- } from "../chunk-QZWTRENR.js";
19
+ } from "../chunk-AR5D76T2.js";
20
20
  import "../chunk-PZ5AY32C.js";
21
21
  export {
22
22
  NO_SEQUENCE,
@@ -12,24 +12,24 @@ import {
12
12
  revokeAllSessions,
13
13
  revokeSession,
14
14
  validateSessionPolicy
15
- } from "../chunk-X4MVWPHV.js";
15
+ } from "../chunk-UC5Y7OEJ.js";
16
16
  import {
17
17
  NO_SESSION
18
18
  } from "../chunk-VKQCVU2Z.js";
19
19
  import "../chunk-ZJADGNYF.js";
20
- import "../chunk-RZPOZPZU.js";
21
- import "../chunk-VH6SOCXH.js";
22
- import "../chunk-35NMVJ7I.js";
23
- import "../chunk-NFZGZ4AK.js";
24
- import "../chunk-QJNCB5SK.js";
20
+ import "../chunk-623QEHDB.js";
21
+ import "../chunk-EFJAAFBW.js";
22
+ import "../chunk-MYSNNMJ3.js";
23
+ import "../chunk-L67H6FAQ.js";
24
+ import "../chunk-GIGLOQL7.js";
25
25
  import "../chunk-LP7BEXCT.js";
26
- import "../chunk-AKKRXT23.js";
27
- import "../chunk-GZACYEOB.js";
26
+ import "../chunk-RPWMDIGK.js";
27
+ import "../chunk-77AEMXFA.js";
28
28
  import {
29
29
  SessionExpiredError,
30
30
  SessionNotFoundError,
31
31
  SessionPolicyError
32
- } from "../chunk-QZWTRENR.js";
32
+ } from "../chunk-AR5D76T2.js";
33
33
  import "../chunk-PZ5AY32C.js";
34
34
 
35
35
  // src/with-party/session/active.ts
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  CollectionFrame,
3
3
  VaultFrame
4
- } from "../chunk-55LX6FSX.js";
4
+ } from "../chunk-NJHQE4LT.js";
5
5
  import {
6
6
  NO_SHADOW
7
7
  } from "../chunk-SMY5X46Z.js";
8
- import "../chunk-QZWTRENR.js";
8
+ import "../chunk-AR5D76T2.js";
9
9
  import "../chunk-PZ5AY32C.js";
10
10
 
11
11
  // src/with-fork/shadow/active.ts
@@ -0,0 +1,25 @@
1
+ import {
2
+ ATTESTATIONS_COLLECTION,
3
+ REVOKED_RECORD_ID,
4
+ SIGNER_RECORD_ID,
5
+ loadOrCreateSigner,
6
+ loadSigner
7
+ } from "./chunk-NZEGQWQ5.js";
8
+ import "./chunk-623QEHDB.js";
9
+ import "./chunk-EFJAAFBW.js";
10
+ import "./chunk-MYSNNMJ3.js";
11
+ import "./chunk-L67H6FAQ.js";
12
+ import "./chunk-GIGLOQL7.js";
13
+ import "./chunk-LP7BEXCT.js";
14
+ import "./chunk-RPWMDIGK.js";
15
+ import "./chunk-77AEMXFA.js";
16
+ import "./chunk-AR5D76T2.js";
17
+ import "./chunk-PZ5AY32C.js";
18
+ export {
19
+ ATTESTATIONS_COLLECTION,
20
+ REVOKED_RECORD_ID,
21
+ SIGNER_RECORD_ID,
22
+ loadOrCreateSigner,
23
+ loadSigner
24
+ };
25
+ //# sourceMappingURL=signer-XLUKCCH3.js.map
@@ -4,19 +4,19 @@ import {
4
4
  import {
5
5
  readPod,
6
6
  writePod
7
- } from "../chunk-SGQ4N5FS.js";
8
- import "../chunk-JIDLU57U.js";
9
- import "../chunk-RZPOZPZU.js";
10
- import "../chunk-VH6SOCXH.js";
11
- import "../chunk-35NMVJ7I.js";
12
- import "../chunk-NFZGZ4AK.js";
13
- import "../chunk-QJNCB5SK.js";
7
+ } from "../chunk-KDWBVCIX.js";
8
+ import "../chunk-FHK6WWUE.js";
9
+ import "../chunk-623QEHDB.js";
10
+ import "../chunk-EFJAAFBW.js";
11
+ import "../chunk-MYSNNMJ3.js";
12
+ import "../chunk-L67H6FAQ.js";
13
+ import "../chunk-GIGLOQL7.js";
14
14
  import "../chunk-LP7BEXCT.js";
15
- import "../chunk-AKKRXT23.js";
16
- import "../chunk-GZACYEOB.js";
15
+ import "../chunk-RPWMDIGK.js";
16
+ import "../chunk-77AEMXFA.js";
17
17
  import {
18
18
  SnapshotNotFoundError
19
- } from "../chunk-QZWTRENR.js";
19
+ } from "../chunk-AR5D76T2.js";
20
20
  import "../chunk-PZ5AY32C.js";
21
21
 
22
22
  // src/with-fork/snapshots/engine.ts
@@ -6,17 +6,17 @@ import {
6
6
  isMVStale,
7
7
  markMVStale,
8
8
  resolveStaleMVOnRead
9
- } from "./chunk-IMRB2C4O.js";
9
+ } from "./chunk-IQ423YMK.js";
10
10
  import "./chunk-5D2ALSM5.js";
11
- import "./chunk-RZPOZPZU.js";
12
- import "./chunk-VH6SOCXH.js";
13
- import "./chunk-35NMVJ7I.js";
14
- import "./chunk-NFZGZ4AK.js";
15
- import "./chunk-QJNCB5SK.js";
11
+ import "./chunk-623QEHDB.js";
12
+ import "./chunk-EFJAAFBW.js";
13
+ import "./chunk-MYSNNMJ3.js";
14
+ import "./chunk-L67H6FAQ.js";
15
+ import "./chunk-GIGLOQL7.js";
16
16
  import "./chunk-LP7BEXCT.js";
17
- import "./chunk-AKKRXT23.js";
18
- import "./chunk-GZACYEOB.js";
19
- import "./chunk-QZWTRENR.js";
17
+ import "./chunk-RPWMDIGK.js";
18
+ import "./chunk-77AEMXFA.js";
19
+ import "./chunk-AR5D76T2.js";
20
20
  import "./chunk-PZ5AY32C.js";
21
21
  export {
22
22
  MV_STALE_COLLECTION,
@@ -27,4 +27,4 @@ export {
27
27
  markMVStale,
28
28
  resolveStaleMVOnRead
29
29
  };
30
- //# sourceMappingURL=stale-JOE7GBAE.js.map
30
+ //# sourceMappingURL=stale-U3WO5MYN.js.map
@@ -0,0 +1,23 @@
1
+ import {
2
+ SCHEMAS_COLLECTION,
3
+ loadPersistedSchema,
4
+ loadPersistedSchemaEntry,
5
+ savePersistedSchema
6
+ } from "./chunk-Q6MXHDSE.js";
7
+ import "./chunk-623QEHDB.js";
8
+ import "./chunk-EFJAAFBW.js";
9
+ import "./chunk-MYSNNMJ3.js";
10
+ import "./chunk-L67H6FAQ.js";
11
+ import "./chunk-GIGLOQL7.js";
12
+ import "./chunk-LP7BEXCT.js";
13
+ import "./chunk-RPWMDIGK.js";
14
+ import "./chunk-77AEMXFA.js";
15
+ import "./chunk-AR5D76T2.js";
16
+ import "./chunk-PZ5AY32C.js";
17
+ export {
18
+ SCHEMAS_COLLECTION,
19
+ loadPersistedSchema,
20
+ loadPersistedSchemaEntry,
21
+ savePersistedSchema
22
+ };
23
+ //# sourceMappingURL=storage-IQONEOYY.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  loadFence,
3
3
  saveFence
4
- } from "./chunk-6M2I3DKF.js";
4
+ } from "./chunk-WK7ULBTP.js";
5
5
  import {
6
6
  NOYDB_FORMAT_VERSION
7
- } from "./chunk-GZACYEOB.js";
7
+ } from "./chunk-77AEMXFA.js";
8
8
  import "./chunk-PZ5AY32C.js";
9
9
 
10
10
  // src/with-shape/schema-update/client-registry.ts
@@ -139,4 +139,4 @@ function unref(timer) {
139
139
  export {
140
140
  StoreCoordinationProvider
141
141
  };
142
- //# sourceMappingURL=store-coordination-provider-5LX2UFU2.js.map
142
+ //# sourceMappingURL=store-coordination-provider-AHGFEMFA.js.map
@@ -1,25 +1,24 @@
1
- import {
2
- NO_SYNC
3
- } from "../chunk-EP5L47XV.js";
4
1
  import {
5
2
  PresenceHandle,
6
3
  SyncEngine,
7
4
  SyncTransaction
8
- } from "../chunk-BXHMZ2XW.js";
9
- import "../chunk-MTJLOC3Y.js";
10
- import "../chunk-EZNTORXE.js";
11
- import "../chunk-RZPOZPZU.js";
12
- import "../chunk-VH6SOCXH.js";
13
- import "../chunk-35NMVJ7I.js";
14
- import "../chunk-NFZGZ4AK.js";
15
- import "../chunk-QJNCB5SK.js";
5
+ } from "../chunk-WFYKIDCS.js";
6
+ import {
7
+ NO_SYNC
8
+ } from "../chunk-55LKVALY.js";
9
+ import "../chunk-SBGXQK5I.js";
10
+ import "../chunk-623QEHDB.js";
11
+ import "../chunk-EFJAAFBW.js";
12
+ import "../chunk-MYSNNMJ3.js";
13
+ import "../chunk-L67H6FAQ.js";
14
+ import "../chunk-GIGLOQL7.js";
16
15
  import "../chunk-LP7BEXCT.js";
17
- import "../chunk-AKKRXT23.js";
18
- import "../chunk-GZACYEOB.js";
19
- import "../chunk-QZWTRENR.js";
16
+ import "../chunk-RPWMDIGK.js";
17
+ import "../chunk-77AEMXFA.js";
18
+ import "../chunk-AR5D76T2.js";
20
19
  import "../chunk-PZ5AY32C.js";
21
20
 
22
- // src/with-party/team/sync-active.ts
21
+ // src/with-sync/active.ts
23
22
  function withSync() {
24
23
  return {
25
24
  buildSyncEngine(opts) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/with-party/team/sync-active.ts"],"sourcesContent":["/**\n * Active sync strategy — `withSync()` returns the real implementation\n * that wires the `SyncEngine`, `SyncTransaction`, and `PresenceHandle`\n * constructors into the Noydb / Vault / Collection hot paths.\n *\n * Consumers opt in by:\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withSync } from '@noy-db/hub/sync'\n *\n * const db = await createNoydb({\n * store: localStore,\n * sync: remoteStore,\n * user: ...,\n * syncStrategy: withSync(),\n * })\n * ```\n *\n * The factory delegates to the existing `sync.ts`,\n * `sync-transaction.ts`, and `presence.ts` modules. Splitting the\n * import chain through this file is what lets tsup tree-shake the\n * ~856 LOC of replication + presence machinery out of the default\n * bundle when no `withSync()` import is present.\n *\n * Keyring + grant/revoke/magic-link/delegation stay in the always-on\n * core (or tree-shake via direct named imports) — those are required\n * for any multi-user vault, even purely local ones.\n *\n * @public\n */\n\nimport type { SyncStrategy, BuildSyncEngineOptions } from './sync-strategy.js'\nimport type { PresenceHandleOpts } from './presence.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport { SyncEngine } from './sync.js'\nimport { SyncTransaction } from './sync-transaction.js'\nimport { PresenceHandle } from './presence.js'\n\nexport function withSync(): SyncStrategy {\n return {\n buildSyncEngine(opts: BuildSyncEngineOptions): SyncEngine {\n return new SyncEngine(opts)\n },\n buildSyncTransaction(vault: Vault, engine: SyncEngine): SyncTransaction {\n return new SyncTransaction(vault, engine)\n },\n buildPresence<P>(opts: PresenceHandleOpts): PresenceHandle<P> {\n return new PresenceHandle<P>(opts)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCO,SAAS,WAAyB;AACvC,SAAO;AAAA,IACL,gBAAgB,MAA0C;AACxD,aAAO,IAAI,WAAW,IAAI;AAAA,IAC5B;AAAA,IACA,qBAAqB,OAAc,QAAqC;AACtE,aAAO,IAAI,gBAAgB,OAAO,MAAM;AAAA,IAC1C;AAAA,IACA,cAAiB,MAA6C;AAC5D,aAAO,IAAI,eAAkB,IAAI;AAAA,IACnC;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/with-sync/active.ts"],"sourcesContent":["/**\n * Active sync strategy — `withSync()` returns the real implementation\n * that wires the `SyncEngine`, `SyncTransaction`, and `PresenceHandle`\n * constructors into the Noydb / Vault / Collection hot paths.\n *\n * Consumers opt in by:\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withSync } from '@noy-db/hub/sync'\n *\n * const db = await createNoydb({\n * store: localStore,\n * sync: remoteStore,\n * user: ...,\n * syncStrategy: withSync(),\n * })\n * ```\n *\n * The factory delegates to the existing `sync.ts`,\n * `sync-transaction.ts`, and `presence.ts` modules. Splitting the\n * import chain through this file is what lets tsup tree-shake the\n * ~856 LOC of replication + presence machinery out of the default\n * bundle when no `withSync()` import is present.\n *\n * Keyring + grant/revoke/magic-link/delegation stay in the always-on\n * core (or tree-shake via direct named imports) — those are required\n * for any multi-user vault, even purely local ones.\n *\n * @public\n */\n\nimport type { SyncStrategy, BuildSyncEngineOptions } from './strategy.js'\nimport type { PresenceHandleOpts } from './presence.js'\nimport type { Vault } from '../kernel/vault.js'\nimport { SyncEngine } from './engine.js'\nimport { SyncTransaction } from './transaction.js'\nimport { PresenceHandle } from './presence.js'\n\nexport function withSync(): SyncStrategy {\n return {\n buildSyncEngine(opts: BuildSyncEngineOptions): SyncEngine {\n return new SyncEngine(opts)\n },\n buildSyncTransaction(vault: Vault, engine: SyncEngine): SyncTransaction {\n return new SyncTransaction(vault, engine)\n },\n buildPresence<P>(opts: PresenceHandleOpts): PresenceHandle<P> {\n return new PresenceHandle<P>(opts)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuCO,SAAS,WAAyB;AACvC,SAAO;AAAA,IACL,gBAAgB,MAA0C;AACxD,aAAO,IAAI,WAAW,IAAI;AAAA,IAC5B;AAAA,IACA,qBAAqB,OAAc,QAAqC;AACtE,aAAO,IAAI,gBAAgB,OAAO,MAAM;AAAA,IAC1C;AAAA,IACA,cAAiB,MAA6C;AAC5D,aAAO,IAAI,eAAkB,IAAI;AAAA,IACnC;AAAA,EACF;AACF;","names":[]}
@@ -1,11 +1,6 @@
1
1
  import {
2
- credentialStatus,
3
- deleteCredential,
4
- getCredential,
5
- listCredentials,
6
- putCredential,
7
2
  withTeam
8
- } from "../chunk-SHYIA73K.js";
3
+ } from "../chunk-US2AR4BI.js";
9
4
  import {
10
5
  NO_TEAM,
11
6
  burnPaperRecoveryEntry,
@@ -34,17 +29,9 @@ import {
34
29
  unwrapMagicLinkGrant,
35
30
  updateAuthenticator,
36
31
  writeMagicLinkGrant
37
- } from "../chunk-C25JXSOR.js";
38
- import "../chunk-56IIVAEO.js";
32
+ } from "../chunk-IHYSIPEK.js";
33
+ import "../chunk-Q2SEJMP2.js";
39
34
  import {
40
- PresenceHandle,
41
- SyncEngine,
42
- SyncTransaction
43
- } from "../chunk-BXHMZ2XW.js";
44
- import "../chunk-MTJLOC3Y.js";
45
- import "../chunk-EZNTORXE.js";
46
- import {
47
- SYNC_CREDENTIALS_COLLECTION,
48
35
  buildRecipientKeyringFile,
49
36
  changeSecret,
50
37
  createOwnerKeyring,
@@ -60,34 +47,28 @@ import {
60
47
  persistKeyring,
61
48
  revoke,
62
49
  updateKeyringIdentity
63
- } from "../chunk-KPXM4WO6.js";
64
- import "../chunk-WZ3NCMK6.js";
65
- import "../chunk-PTHKZWEH.js";
66
- import "../chunk-RZPOZPZU.js";
67
- import "../chunk-VH6SOCXH.js";
68
- import "../chunk-35NMVJ7I.js";
69
- import "../chunk-NFZGZ4AK.js";
70
- import "../chunk-QJNCB5SK.js";
50
+ } from "../chunk-FZAP4JNC.js";
51
+ import "../chunk-6PFST3FC.js";
52
+ import "../chunk-PZRYKOKP.js";
53
+ import "../chunk-623QEHDB.js";
54
+ import "../chunk-EFJAAFBW.js";
55
+ import "../chunk-MYSNNMJ3.js";
56
+ import "../chunk-L67H6FAQ.js";
57
+ import "../chunk-GIGLOQL7.js";
71
58
  import "../chunk-LP7BEXCT.js";
72
- import "../chunk-AKKRXT23.js";
73
- import "../chunk-GZACYEOB.js";
59
+ import "../chunk-RPWMDIGK.js";
60
+ import "../chunk-77AEMXFA.js";
74
61
  import {
75
62
  TeamNotEnabledError
76
- } from "../chunk-QZWTRENR.js";
63
+ } from "../chunk-AR5D76T2.js";
77
64
  import "../chunk-PZ5AY32C.js";
78
65
  export {
79
66
  NO_TEAM,
80
- PresenceHandle,
81
- SYNC_CREDENTIALS_COLLECTION,
82
- SyncEngine,
83
- SyncTransaction,
84
67
  TeamNotEnabledError,
85
68
  buildRecipientKeyringFile,
86
69
  burnPaperRecoveryEntry,
87
70
  changeSecret,
88
71
  createOwnerKeyring,
89
- credentialStatus,
90
- deleteCredential,
91
72
  deriveMagicLinkContentKey,
92
73
  describeAllUsersAuth,
93
74
  describeAuthConfig,
@@ -98,12 +79,10 @@ export {
98
79
  evaluateExportCapability,
99
80
  evaluateImportCapability,
100
81
  findAuthenticator,
101
- getCredential,
102
82
  grant,
103
83
  hasExportCapability,
104
84
  hasImportCapability,
105
85
  isMagicLinkGrantExpired,
106
- listCredentials,
107
86
  listMagicLinkGrants,
108
87
  listUsers,
109
88
  listUsersWithEnvelopes,
@@ -113,7 +92,6 @@ export {
113
92
  mintPaperRecoveryEntry,
114
93
  mintWrappedDeksBlob,
115
94
  persistKeyring,
116
- putCredential,
117
95
  readMagicLinkGrantRecord,
118
96
  recoverSecret,
119
97
  recoverUser,
@@ -11,19 +11,19 @@ import {
11
11
  putAtTier,
12
12
  syncDerivedOutputs,
13
13
  withTiers
14
- } from "../chunk-6R6Q3MRN.js";
15
- import "../chunk-PTHKZWEH.js";
16
- import "../chunk-RZPOZPZU.js";
17
- import "../chunk-VH6SOCXH.js";
18
- import "../chunk-35NMVJ7I.js";
19
- import "../chunk-NFZGZ4AK.js";
20
- import "../chunk-QJNCB5SK.js";
14
+ } from "../chunk-QITP2JGX.js";
15
+ import "../chunk-PZRYKOKP.js";
16
+ import "../chunk-623QEHDB.js";
17
+ import "../chunk-EFJAAFBW.js";
18
+ import "../chunk-MYSNNMJ3.js";
19
+ import "../chunk-L67H6FAQ.js";
20
+ import "../chunk-GIGLOQL7.js";
21
21
  import "../chunk-LP7BEXCT.js";
22
- import "../chunk-AKKRXT23.js";
23
- import "../chunk-GZACYEOB.js";
22
+ import "../chunk-RPWMDIGK.js";
23
+ import "../chunk-77AEMXFA.js";
24
24
  import {
25
25
  TiersNotEnabledError
26
- } from "../chunk-QZWTRENR.js";
26
+ } from "../chunk-AR5D76T2.js";
27
27
  import "../chunk-PZ5AY32C.js";
28
28
  export {
29
29
  NO_TIERS,
package/dist/to/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  NetworkError,
5
5
  PodVersionConflictError,
6
6
  StoreCapabilityError
7
- } from "../chunk-QZWTRENR.js";
7
+ } from "../chunk-AR5D76T2.js";
8
8
  import "../chunk-PZ5AY32C.js";
9
9
  export {
10
10
  BundleVersionConflictError,
@@ -3,16 +3,16 @@ import {
3
3
  TxContext,
4
4
  TxVault,
5
5
  runTransaction
6
- } from "../chunk-NGSJZFGL.js";
6
+ } from "../chunk-NWK6SVBM.js";
7
7
  import {
8
8
  lazy
9
9
  } from "../chunk-5D2ALSM5.js";
10
10
  import "../chunk-ZJADGNYF.js";
11
- import "../chunk-QZWTRENR.js";
11
+ import "../chunk-AR5D76T2.js";
12
12
  import "../chunk-PZ5AY32C.js";
13
13
 
14
14
  // src/with-commit/tx/dry-run.ts
15
- var loadGuardExecutor = lazy(() => import("../executor-RM7XWQDU.js"));
15
+ var loadGuardExecutor = lazy(() => import("../executor-YBK3I2OT.js"));
16
16
  var SEP = " ";
17
17
  var keyOf = (op) => `${op.vaultName}${SEP}${op.collectionName}${SEP}${op.id}`;
18
18
  async function runDryRun(db, fn) {
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-PY4KJPYU.js";
4
4
  import {
5
5
  FilenameSanitizationError
6
- } from "../chunk-QZWTRENR.js";
6
+ } from "../chunk-AR5D76T2.js";
7
7
  import "../chunk-PZ5AY32C.js";
8
8
 
9
9
  // src/kernel/util/sanitize-filename.ts
@@ -2,10 +2,10 @@ import {
2
2
  blindedEqual,
3
3
  evaluateKofN,
4
4
  openVdigPayload
5
- } from "./chunk-35NMVJ7I.js";
5
+ } from "./chunk-MYSNNMJ3.js";
6
6
  import {
7
7
  dualReadSealedSlot
8
- } from "./chunk-NFZGZ4AK.js";
8
+ } from "./chunk-L67H6FAQ.js";
9
9
  import {
10
10
  VDIG_ITERATIONS,
11
11
  normalizeForVerify,
@@ -14,11 +14,11 @@ import {
14
14
  import {
15
15
  base64ToBuffer,
16
16
  generateSalt
17
- } from "./chunk-AKKRXT23.js";
17
+ } from "./chunk-RPWMDIGK.js";
18
18
  import {
19
19
  ClassifiedConfigError,
20
20
  ClassifiedVerifyError
21
- } from "./chunk-QZWTRENR.js";
21
+ } from "./chunk-AR5D76T2.js";
22
22
  import "./chunk-PZ5AY32C.js";
23
23
 
24
24
  // src/kernel/enclave/classify/verify.ts
@@ -137,4 +137,4 @@ export {
137
137
  verifyDigestField,
138
138
  verifyTextField
139
139
  };
140
- //# sourceMappingURL=verify-7XWHJWUN.js.map
140
+ //# sourceMappingURL=verify-JEIXSK5U.js.map
@@ -0,0 +1,21 @@
1
+ import {
2
+ dumpVaultSchema
3
+ } from "./chunk-ECGDJU5R.js";
4
+ import "./chunk-VYYM3MEN.js";
5
+ import "./chunk-3LYMOSY7.js";
6
+ import "./chunk-Y2NBBT6K.js";
7
+ import "./chunk-Q6MXHDSE.js";
8
+ import "./chunk-623QEHDB.js";
9
+ import "./chunk-EFJAAFBW.js";
10
+ import "./chunk-MYSNNMJ3.js";
11
+ import "./chunk-L67H6FAQ.js";
12
+ import "./chunk-GIGLOQL7.js";
13
+ import "./chunk-LP7BEXCT.js";
14
+ import "./chunk-RPWMDIGK.js";
15
+ import "./chunk-77AEMXFA.js";
16
+ import "./chunk-AR5D76T2.js";
17
+ import "./chunk-PZ5AY32C.js";
18
+ export {
19
+ dumpVaultSchema
20
+ };
21
+ //# sourceMappingURL=walk-BF36V4SR.js.map
@@ -0,0 +1,49 @@
1
+ /**
2
+ * #893/#906-prep — the atomic-commit eligibility gate.
3
+ *
4
+ * `runTransaction` (Task 5) consults `canCommitAtomically` right after the
5
+ * body returns, to decide whether the whole staged batch can be prepared and
6
+ * submitted as ONE `store.tx(ops)` call instead of the per-op abortable
7
+ * path (Phase 1 pre-flight + Phase 2 Collection-layer execute + Phase 3
8
+ * best-effort revert — see `transaction.ts`'s module doc).
9
+ *
10
+ * Pure decision logic: no side effects, no store reads. Every input is
11
+ * already sitting on `db` / `ctx`.
12
+ *
13
+ * ALL of the following must hold. (Commit-time changeset invariants are NOT a
14
+ * condition: that phase lives after Phase 2 in `runTransaction` and runs
15
+ * unchanged on either path — a failing invariant reverts the atomic batch
16
+ * through the same `ctx._executed` plan.)
17
+ *
18
+ * 1. The store declares `capabilities.txAtomic === true` AND implements
19
+ * `tx()`. Both — mirrors the pairing rule `bestEffortRevert` already
20
+ * enforces (`kernel/best-effort-revert.ts:78`): an undeclared `tx()` is
21
+ * never used, even if present.
22
+ * 2. Not an amendment transaction (`ctx._amendment === false`) — amendments
23
+ * need the guard-registry change-set + invariant machinery the atomic
24
+ * path skips entirely.
25
+ * 3. No `(vault, collection, id)` is touched twice in the batch. The
26
+ * abortable path's Phase 1 snapshots each key once and Phase 2 replays
27
+ * every op against that same snapshot in order; a single `store.tx()`
28
+ * write set can't express "this key changes twice in sequence."
29
+ * 4. Every touched collection reports `_txAtomicSafe(op.type)` — see that
30
+ * method's doc comment on `Collection` for what it excludes and why.
31
+ * #931: of the wrapper-level write signals, only a live `onBeforeWrite`
32
+ * hook still excludes — it may REFUSE a write, which only
33
+ * `Collection.put()`/`.delete()` honors. After-hooks and the
34
+ * `afterPut`/`afterDelete` observe bus are refusal-free observers, so
35
+ * the atomic path fires them itself per leg post-finalize
36
+ * (`Collection._fireAtomicAfterWrite`) instead of forfeiting the batch.
37
+ * Delete gates on the enforcer's `_deleteCascadesPossible(name)` (#922):
38
+ * `Vault.enforceRefsOnDelete` cascades from THREE sources (lookup-ref
39
+ * edges, classic inbound refs, managed-link `onDelete`), and the Vault
40
+ * predicate unions exactly those three — a `getInbound`-only check would
41
+ * be narrower and wrongly admit unsafe atomic deletes, because
42
+ * `_prepareDelete` runs the cascades DURING prepare (see
43
+ * `with-shape/links/vault-facade.ts` `enforceRefsOnDelete`).
44
+ *
45
+ * @internal
46
+ */
47
+ import type { Noydb } from '../../kernel/noydb.js';
48
+ import type { TxContext } from './transaction.js';
49
+ export declare function canCommitAtomically(db: Noydb, ctx: TxContext): boolean;
@@ -32,15 +32,26 @@
32
32
  * ledger is NOT rewritten — audit history preserves the partial
33
33
  * commit and the revert.
34
34
  *
35
- * **Crash window.** Steps 2–3 are not a storage-layer transaction —
36
- * if the process dies between two executed ops, the on-disk state is
37
- * partial. True all-or-nothing atomicity requires a store that
38
- * implements `NoydbStore.tx()` (DynamoDB `TransactWriteItems`,
39
- * IndexedDB `readwrite` transaction, …). This executor declares
40
- * that future integration point via the `tx?()` method + the
41
- * `StoreCapabilities.txAtomic` bit, but does not yet delegate
42
- * to it the cascade into `Fork · Stores` tracks the per-adapter
43
- * wire-up.
35
+ * **Atomic delegation (#906).** Steps 1–3 above describe the OCC
36
+ * fallback. When the store declares `StoreCapabilities.txAtomic` AND
37
+ * implements `tx()`, AND the staged batch is statically safe
38
+ * (`canCommitAtomically` — see `atomic-eligibility.ts`), the commit
39
+ * instead: prepares every op through `Collection._preparePut` /
40
+ * `_prepareDelete` (encrypt, resolve the prior version, mint the #589
41
+ * marker — no observable side effect), submits the whole write set as
42
+ * ONE `store.tx(ops)` call with a per-leg `expectedVersion`, then
43
+ * finalizes each op in staged order. The visible difference: history
44
+ * snapshots, ledger entries and change events all fire AFTER the bytes
45
+ * are durable, instead of interleaving per op.
46
+ *
47
+ * **Crash window.** On the OCC fallback, steps 2–3 are not a
48
+ * storage-layer transaction — if the process dies between two executed
49
+ * ops, the on-disk state is partial. The atomic path above closes that
50
+ * window for the write set itself (`to-memory` and the SQL stores in
51
+ * `noy-db-to` implement `tx()`); a crash between the batch landing and
52
+ * the finalize loop finishing still leaves per-op side effects (history,
53
+ * ledger, cache) incomplete. Stores that cannot commit a batch
54
+ * atomically (file, S3) omit `tx()` and keep the fallback.
44
55
  *
45
56
  * ## Not covered
46
57
  *
@@ -210,3 +221,5 @@ export declare function runTransaction<T>(db: Noydb, fn: (tx: TxContext) => Prom
210
221
  * combined list in reverse on rollback.
211
222
  */
212
223
  export declare function revertExecuted(executed: ReadonlyArray<ExecutedOp>, store: Noydb['_store'], db?: Noydb): Promise<void>;
224
+ /** @internal — shared (vault, collection, id) key shape; also used by `atomic-eligibility.ts`'s duplicate-key scan. */
225
+ export declare function keyOf(op: StagedOp): string;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * `_broker` reserved-collection seed lifecycle (#479, credential-broker
3
- * spec §2/§3). Modeled on `with-party/team/sync-credentials.ts`: a
3
+ * spec §2/§3). Modeled on `with-sync/credentials.ts`: a
4
4
  * `_`-prefixed reserved collection, record id = `brokerId`, encrypted under
5
5
  * the collection's own DEK, `requireAdminAccess` role gate (owner/admin
6
6
  * only — custodian intentionally excluded, same rationale as