@noy-db/hub 0.9.0-pre.0 → 0.9.0-pre.2

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 (465) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/api-H4B7ZQXP.js +18 -0
  3. package/dist/as/index.js +10 -10
  4. package/dist/at/index.js +8 -8
  5. package/dist/attestation/index.js +18 -18
  6. package/dist/{backup-7RKNZMQO.js → backup-E3GBMNDA.js} +92 -31
  7. package/dist/backup-E3GBMNDA.js.map +1 -0
  8. package/dist/blobs/index.js +12 -12
  9. package/dist/broker/index.js +13 -13
  10. package/dist/by/index.js +2 -2
  11. package/dist/capsule/contract.js +6 -6
  12. package/dist/capsule/enclave-aes/crypto.d.ts +18 -0
  13. package/dist/capsule/enclave-aes/index.d.ts +2 -2
  14. package/dist/capsule/enclave-aes/index.js +14 -8
  15. package/dist/capsule/enclave-aes/index.js.map +1 -1
  16. package/dist/capsule/index.d.ts +1 -1
  17. package/dist/{capsule-57BDK7LG.js → capsule-YQKQZPH7.js} +14 -8
  18. package/dist/cargo/index.js +35 -35
  19. package/dist/{chunk-AJFPAHMW.js → chunk-27NCEPKM.js} +3 -3
  20. package/dist/{chunk-PGC35KXE.js → chunk-2IASHJPS.js} +2 -2
  21. package/dist/{chunk-NYJBYVBG.js → chunk-2ODEFG6K.js} +4 -4
  22. package/dist/{chunk-7BMOS4JQ.js → chunk-2QH3I7QC.js} +11 -11
  23. package/dist/{chunk-VSUQI5Q6.js → chunk-2RH5SEY7.js} +16 -2
  24. package/dist/chunk-2RH5SEY7.js.map +1 -0
  25. package/dist/{chunk-IVMFIKNA.js → chunk-2T2TGRWE.js} +6 -6
  26. package/dist/{chunk-G66YXUTY.js → chunk-35CNOVQE.js} +3 -3
  27. package/dist/{chunk-OJU67C23.js → chunk-3EXQXOQ2.js} +4 -4
  28. package/dist/{chunk-BJH77UY2.js → chunk-4KYKRYRT.js} +2 -2
  29. package/dist/{chunk-RDOEOPOI.js → chunk-4N4OIVK3.js} +5 -5
  30. package/dist/{chunk-WHOKGHJ3.js → chunk-4WLI37WK.js} +7 -7
  31. package/dist/{chunk-RNACRT5H.js → chunk-52ZFNK46.js} +2 -2
  32. package/dist/{chunk-CB4467G3.js → chunk-5A3HOTP5.js} +33 -7
  33. package/dist/chunk-5A3HOTP5.js.map +1 -0
  34. package/dist/{chunk-QDHHHI5Q.js → chunk-5SMCBPJ2.js} +5 -5
  35. package/dist/{chunk-EMAWOGVH.js → chunk-654RE5YC.js} +3 -3
  36. package/dist/{chunk-FZXRLNJO.js → chunk-6BEBWHNL.js} +3 -3
  37. package/dist/{chunk-EUD3HQM4.js → chunk-6WEPFEMJ.js} +4 -4
  38. package/dist/{chunk-YFFMPZPY.js → chunk-6WIFF46H.js} +2 -2
  39. package/dist/{chunk-ZVSKSUGI.js → chunk-7C7OF26T.js} +5 -5
  40. package/dist/{chunk-QXJXG7DN.js → chunk-7IV7GVOS.js} +5 -5
  41. package/dist/{chunk-MQ7YWBQ5.js → chunk-7JRLCP2J.js} +2 -2
  42. package/dist/{chunk-QSHATAXJ.js → chunk-7ONMS7QI.js} +2 -2
  43. package/dist/{chunk-JBMMWYOH.js → chunk-7UHLO4ZN.js} +35 -2
  44. package/dist/chunk-7UHLO4ZN.js.map +1 -0
  45. package/dist/{chunk-6WS35E6X.js → chunk-A52BK5AY.js} +2 -2
  46. package/dist/{chunk-GOJQ5DZA.js → chunk-AI35LNWQ.js} +4 -4
  47. package/dist/chunk-AI35LNWQ.js.map +1 -0
  48. package/dist/{chunk-XXQ5XIYY.js → chunk-AMSSAOOB.js} +2 -2
  49. package/dist/{chunk-3V6LZHUO.js → chunk-AYOQZJDB.js} +2 -2
  50. package/dist/{chunk-DL6BZKP3.js → chunk-B3B6HV5S.js} +2 -2
  51. package/dist/{chunk-5XONHAFD.js → chunk-B6EWMGFX.js} +2 -2
  52. package/dist/{chunk-6Y5E4SJU.js → chunk-BMAXBTYH.js} +5 -5
  53. package/dist/{chunk-LGGIFKJP.js → chunk-BNYDOF2Q.js} +4 -4
  54. package/dist/{chunk-XXNWU5QZ.js → chunk-BQJ5ORU5.js} +2 -2
  55. package/dist/{chunk-Z3ZXVB2Y.js → chunk-BSEPI3HD.js} +12 -12
  56. package/dist/chunk-BSEPI3HD.js.map +1 -0
  57. package/dist/{chunk-BYHCKX73.js → chunk-CLOSXHR4.js} +3 -3
  58. package/dist/{chunk-5HNW4ZTA.js → chunk-CSAN22QG.js} +6 -6
  59. package/dist/{chunk-TZYTMZZY.js → chunk-DL4GCSTS.js} +10 -10
  60. package/dist/{chunk-EA4VDI5D.js → chunk-DYIR6RC3.js} +4 -4
  61. package/dist/{chunk-PUBI455O.js → chunk-EPPAEGH5.js} +2 -2
  62. package/dist/{chunk-2A56DSRI.js → chunk-EQ6C2ZPT.js} +17 -51
  63. package/dist/chunk-EQ6C2ZPT.js.map +1 -0
  64. package/dist/{chunk-BNFNQNEP.js → chunk-F7X7MPK4.js} +2 -2
  65. package/dist/{chunk-SNM7LSYG.js → chunk-FUHUGKDN.js} +4 -4
  66. package/dist/{chunk-72XBVN4J.js → chunk-FVKQ5QUC.js} +2 -2
  67. package/dist/chunk-FVKQ5QUC.js.map +1 -0
  68. package/dist/{chunk-D4V5JJAK.js → chunk-GHMINSER.js} +4 -4
  69. package/dist/{chunk-APFFJN5T.js → chunk-GLSCL74M.js} +31 -34
  70. package/dist/chunk-GLSCL74M.js.map +1 -0
  71. package/dist/{chunk-XKBTJGFP.js → chunk-GU6QXHPZ.js} +3 -3
  72. package/dist/chunk-GU6QXHPZ.js.map +1 -0
  73. package/dist/{chunk-QGFEBNHO.js → chunk-GZISWBCJ.js} +4 -4
  74. package/dist/{chunk-OM3SEDI4.js → chunk-HTRLQ4ZZ.js} +4 -4
  75. package/dist/{chunk-SWXLZ4HX.js → chunk-ICHHNI5E.js} +8 -8
  76. package/dist/{chunk-K673OO6B.js → chunk-ID4ZBC3X.js} +4 -4
  77. package/dist/{chunk-H3YM66EI.js → chunk-IF2M43G4.js} +2 -2
  78. package/dist/{chunk-QGSNJD3B.js → chunk-IFUYLIEY.js} +2 -2
  79. package/dist/{chunk-D5A3GCZ4.js → chunk-IPF5ORDI.js} +3 -3
  80. package/dist/{delegation-ONLM4JFI.js → chunk-JQMEXCUZ.js} +59 -16
  81. package/dist/chunk-JQMEXCUZ.js.map +1 -0
  82. package/dist/{chunk-TFWFPZRU.js → chunk-K5JNK63R.js} +11 -11
  83. package/dist/{chunk-TFWFPZRU.js.map → chunk-K5JNK63R.js.map} +1 -1
  84. package/dist/{chunk-BVF3SXD7.js → chunk-KBIS64X4.js} +5 -5
  85. package/dist/chunk-L4UL4IAR.js +55 -0
  86. package/dist/chunk-L4UL4IAR.js.map +1 -0
  87. package/dist/{chunk-RIZTZJX6.js → chunk-LJ744WXU.js} +2 -2
  88. package/dist/{chunk-XITHENBI.js → chunk-LMC5L3MM.js} +7 -7
  89. package/dist/{chunk-XITHENBI.js.map → chunk-LMC5L3MM.js.map} +1 -1
  90. package/dist/{chunk-L5A3KR7R.js → chunk-LUQBG637.js} +3 -3
  91. package/dist/{chunk-6QLCS7ET.js → chunk-LZN6DTFI.js} +2 -2
  92. package/dist/{chunk-NIXRB5BP.js → chunk-MMWX5OT5.js} +2 -2
  93. package/dist/{chunk-JA25QG5M.js → chunk-N6EWQ5VB.js} +622 -119
  94. package/dist/chunk-N6EWQ5VB.js.map +1 -0
  95. package/dist/{chunk-UOZOWN73.js → chunk-ND6S2DKC.js} +2 -2
  96. package/dist/{chunk-WFWFXDNS.js → chunk-NHEKQWFI.js} +2 -2
  97. package/dist/{chunk-2ZFD2UJC.js → chunk-NIUHKKMM.js} +9 -9
  98. package/dist/{chunk-XA34THLF.js → chunk-NK4LGBGQ.js} +4 -4
  99. package/dist/{chunk-JSWKVZCR.js → chunk-NUZ7ROUZ.js} +2 -2
  100. package/dist/{chunk-DHU2AQ6T.js → chunk-O3NGOHXQ.js} +2 -2
  101. package/dist/{chunk-ZBUAX4EF.js → chunk-O6VOR4NH.js} +2 -2
  102. package/dist/{chunk-JZ4EDEIP.js → chunk-ODBOHPZU.js} +3 -3
  103. package/dist/{chunk-5UUJE4FP.js → chunk-OK44MD3C.js} +2 -2
  104. package/dist/{chunk-ECGXA4LT.js → chunk-OR3OHKU6.js} +2 -2
  105. package/dist/{chunk-ZWF3EWZA.js → chunk-P6FATPXQ.js} +2 -2
  106. package/dist/{chunk-PCYPXLEX.js → chunk-PBEHTFUG.js} +6 -6
  107. package/dist/{chunk-7CT6SX4M.js → chunk-PFHDQY5L.js} +3 -3
  108. package/dist/{chunk-PTJY5R3O.js → chunk-PIO6NW7O.js} +2 -2
  109. package/dist/{chunk-TMIJAR2X.js → chunk-PREYKC76.js} +3 -3
  110. package/dist/{chunk-ZHQJAV6D.js → chunk-PU5ZEV65.js} +2 -2
  111. package/dist/{chunk-UNSQZSZP.js → chunk-PWAMX5KU.js} +2 -2
  112. package/dist/{chunk-GETUTTZU.js → chunk-PZN76MMV.js} +4 -4
  113. package/dist/{chunk-ABU6A4Z5.js → chunk-Q4DBU5RM.js} +2 -2
  114. package/dist/{chunk-2WJKJZSO.js → chunk-QHG7GQKM.js} +2 -2
  115. package/dist/{chunk-UAKY6E4N.js → chunk-QNOWNCZS.js} +2 -2
  116. package/dist/{chunk-JPSL5GIZ.js → chunk-QQLXKDGC.js} +3 -3
  117. package/dist/{chunk-45VHWE4C.js → chunk-QVUMKG3Z.js} +271 -69
  118. package/dist/chunk-QVUMKG3Z.js.map +1 -0
  119. package/dist/{chunk-OK57EATL.js → chunk-R4GLRJ55.js} +2 -2
  120. package/dist/{chunk-B65CC6Z6.js → chunk-RF5WDM25.js} +2 -2
  121. package/dist/{chunk-G46JSSVX.js → chunk-RKBCUP5D.js} +7 -7
  122. package/dist/{chunk-GCUMOKTN.js → chunk-S2ORTQGS.js} +3 -3
  123. package/dist/{chunk-MRJDLXI3.js → chunk-SVXFCCSX.js} +8 -8
  124. package/dist/{chunk-BUE7R3B5.js → chunk-SXPLIRQH.js} +2 -2
  125. package/dist/{chunk-5LMCVBMY.js → chunk-T5EXREMW.js} +5 -5
  126. package/dist/{chunk-PT2YCQVK.js → chunk-TBVDI3LY.js} +4 -4
  127. package/dist/{chunk-BMHQHH7Q.js → chunk-TLIFNRU5.js} +2 -2
  128. package/dist/{chunk-YKGJ44Z7.js → chunk-TU6ZJTYT.js} +3 -3
  129. package/dist/{chunk-FSQNGPHH.js → chunk-U277K5GR.js} +612 -175
  130. package/dist/chunk-U277K5GR.js.map +1 -0
  131. package/dist/{chunk-55P6OBB7.js → chunk-U43RSPPX.js} +2 -2
  132. package/dist/{chunk-K7RW7FI4.js → chunk-UADW5NOU.js} +5 -5
  133. package/dist/{chunk-GRS2HIV6.js → chunk-UMV5GBTJ.js} +2 -2
  134. package/dist/{chunk-4UIP3QNW.js → chunk-UNAMWK2Q.js} +2 -2
  135. package/dist/{chunk-J4KAPKBJ.js → chunk-UORWAG7K.js} +2 -2
  136. package/dist/{chunk-V55JASXO.js → chunk-UQRKAM2R.js} +3 -3
  137. package/dist/{chunk-2ELOCEXE.js → chunk-URGHKZPL.js} +1 -1
  138. package/dist/chunk-URGHKZPL.js.map +1 -0
  139. package/dist/{chunk-ZMVSKYTJ.js → chunk-VLRY2UH4.js} +10 -10
  140. package/dist/{chunk-SPPOUJLN.js → chunk-VZFTON37.js} +2 -2
  141. package/dist/{chunk-CAD7N6HQ.js → chunk-WIUH6EJ7.js} +10 -10
  142. package/dist/chunk-WIUH6EJ7.js.map +1 -0
  143. package/dist/{chunk-YQFBH5ZJ.js → chunk-WQUIJPN4.js} +3 -3
  144. package/dist/{chunk-4J3MNVVX.js → chunk-WRLWEYHY.js} +7 -1
  145. package/dist/{chunk-4J3MNVVX.js.map → chunk-WRLWEYHY.js.map} +1 -1
  146. package/dist/{chunk-NZULV7LK.js → chunk-WVQDY3UM.js} +4 -4
  147. package/dist/{chunk-3Y5JLSXS.js → chunk-X5RGG3ZW.js} +2 -2
  148. package/dist/{chunk-PFCTSXHU.js → chunk-X6Z2SIRF.js} +2 -2
  149. package/dist/{chunk-UHFGK6YA.js → chunk-XQGKS4OW.js} +3 -3
  150. package/dist/{chunk-L2F3CFCH.js → chunk-Y22JWHCP.js} +4 -4
  151. package/dist/{chunk-C53ER7AG.js → chunk-YVA6UPRN.js} +2 -2
  152. package/dist/{chunk-226V6XXJ.js → chunk-Z2KP6PNF.js} +6 -6
  153. package/dist/{chunk-G5EDYVSE.js → chunk-ZK2WT532.js} +5 -5
  154. package/dist/{chunk-SFCD6OU7.js → chunk-ZNVBCKMV.js} +2 -2
  155. package/dist/{chunk-BU2ABHFW.js → chunk-ZOFNZLAA.js} +4 -4
  156. package/dist/{chunk-X2RP4TO5.js → chunk-ZVJKHGE5.js} +7 -7
  157. package/dist/classified/index.js +5 -5
  158. package/dist/{classified-marker-KHDOYIJB.js → classified-marker-7HXDMYHI.js} +3 -3
  159. package/dist/collection-facade-V63BEBGU.js +41 -0
  160. package/dist/{computed-XMFTHAXV.js → computed-LZLSYOPG.js} +3 -3
  161. package/dist/consent/index.js +8 -8
  162. package/dist/cover/index.js +8 -8
  163. package/dist/custody/index.js +12 -12
  164. package/dist/{dead-filter-CXV5NS67.js → dead-filter-PZIJ4F4G.js} +10 -10
  165. package/dist/debug/index.js +7 -7
  166. package/dist/delegation-7SSGIETH.js +26 -0
  167. package/dist/derivations/index.js +22 -22
  168. package/dist/derive-IMI3BMDS.js +20 -0
  169. package/dist/directory/index.js +9 -9
  170. package/dist/{dispatch-2MQFMEGY.js → dispatch-4BUYPWMJ.js} +19 -19
  171. package/dist/{dispatch-OFDA4WQV.js → dispatch-KOPDDPEQ.js} +5 -5
  172. package/dist/executor-7SY3M6TZ.js +8 -0
  173. package/dist/executor-SNHW4ELF.js +35 -0
  174. package/dist/executor-Z3IKK7G3.js +8 -0
  175. package/dist/export-accessible-O7DIVFUO.js +22 -0
  176. package/dist/extract-partition-ELZEJKXM.js +35 -0
  177. package/dist/{fanout-sidecar-BO67PCPO.js → fanout-sidecar-FYDRL7F3.js} +8 -8
  178. package/dist/find-KWB2RYWJ.js +10 -0
  179. package/dist/forget/index.js +8 -8
  180. package/dist/guards/index.js +4 -4
  181. package/dist/history/index.js +15 -13
  182. package/dist/history/index.js.map +1 -1
  183. package/dist/i18n/index.js +13 -13
  184. package/dist/index.d.ts +3 -2
  185. package/dist/index.js +111 -107
  186. package/dist/index.js.map +1 -1
  187. package/dist/indexing/index.js +5 -5
  188. package/dist/introspection/index.js +10 -10
  189. package/dist/issue-5ZHXK4HJ.js +19 -0
  190. package/dist/kernel/collection.d.ts +85 -6
  191. package/dist/kernel/constants.d.ts +7 -0
  192. package/dist/kernel/errors.d.ts +9 -0
  193. package/dist/kernel/merge-authority.d.ts +5 -1
  194. package/dist/kernel/noydb.d.ts +116 -21
  195. package/dist/kernel/rejection-seal.d.ts +13 -0
  196. package/dist/kernel/sync-wiring.d.ts +55 -0
  197. package/dist/kernel/types.d.ts +366 -8
  198. package/dist/kernel/vault.d.ts +39 -5
  199. package/dist/{ledger-MSJGWKGW.js → ledger-UFJCB6T5.js} +10 -10
  200. package/dist/liberate-OEOSNNFH.js +25 -0
  201. package/dist/{link-set-QXXSPPHL.js → link-set-KMUBFN2L.js} +10 -10
  202. package/dist/{managed-secret-VSK7ANQI.js → managed-secret-H5WYSJ46.js} +9 -9
  203. package/dist/materialized-views/index.js +25 -25
  204. package/dist/{migrate-cek-GEBFYBDC.js → migrate-cek-SPESQAAO.js} +2 -2
  205. package/dist/money/index.js +5 -5
  206. package/dist/noydb-QDZ4QIKO.js +100 -0
  207. package/dist/on/index.js +12 -12
  208. package/dist/overlay-views/index.js +4 -4
  209. package/dist/periods/index.js +11 -11
  210. package/dist/pod/index.js +66 -64
  211. package/dist/{pod-handle-YE7CT66T.js → pod-handle-GJLCOUGK.js} +8 -8
  212. package/dist/policy/index.js +9 -9
  213. package/dist/port/at/index.d.ts +1 -1
  214. package/dist/port/by/index.d.ts +1 -1
  215. package/dist/port/on/index.d.ts +1 -1
  216. package/dist/port/with/admission-authority.d.ts +34 -0
  217. package/dist/port/with/broker-strategy.d.ts +10 -0
  218. package/dist/port/with/rejection-courier.d.ts +37 -0
  219. package/dist/port/with/restore-host.d.ts +33 -0
  220. package/dist/port/with/service-bus.d.ts +18 -0
  221. package/dist/port/with/team-strategy.d.ts +2 -2
  222. package/dist/port/with/write-hooks.d.ts +2 -0
  223. package/dist/portability/index.js +8 -8
  224. package/dist/{post-register-QC5TEAW3.js → post-register-2AC2STHC.js} +6 -6
  225. package/dist/query/all/index.js +15 -15
  226. package/dist/query/index.js +7 -7
  227. package/dist/query/live/index.js +7 -7
  228. package/dist/query/reduce/index.js +10 -10
  229. package/dist/query/relate/index.js +9 -9
  230. package/dist/reduce/index.js +8 -8
  231. package/dist/register-PIORIMMR.js +30 -0
  232. package/dist/registry-BIMICFUH.js +23 -0
  233. package/dist/registry-JGWLW53D.js +35 -0
  234. package/dist/registry-SELCBYEQ.js +8 -0
  235. package/dist/registry-W327UNYH.js +8 -0
  236. package/dist/request-withdrawal-K3SXXODI.js +28 -0
  237. package/dist/restore-to-OOPKLAPU.js +66 -0
  238. package/dist/restore-to-OOPKLAPU.js.map +1 -0
  239. package/dist/{reveal-YQTRNQFH.js → reveal-UAPBG743.js} +7 -7
  240. package/dist/revoke-6AFVXTWF.js +24 -0
  241. package/dist/satellites/index.js +1 -1
  242. package/dist/schema-update/index.js +2 -2
  243. package/dist/sealed-record/index.js +11 -11
  244. package/dist/search/index.js +4 -4
  245. package/dist/{seed-JMQTRKRE.js → seed-BVYDPVIW.js} +33 -18
  246. package/dist/seed-BVYDPVIW.js.map +1 -0
  247. package/dist/sequence/index.js +8 -8
  248. package/dist/session/index.js +8 -8
  249. package/dist/shadow/index.js +2 -2
  250. package/dist/signer-TW5MAQJP.js +23 -0
  251. package/dist/snapshots/index.js +9 -9
  252. package/dist/{stale-SKV33PBU.js → stale-CROGJBIJ.js} +9 -9
  253. package/dist/storage-SO2L2Z5J.js +21 -0
  254. package/dist/{store-coordination-provider-Z6HKPOGM.js → store-coordination-provider-2YD2PTTP.js} +9 -9
  255. package/dist/sync/index.js +16 -16
  256. package/dist/sync/index.js.map +1 -1
  257. package/dist/team/index.js +15 -15
  258. package/dist/tiers/index.js +10 -10
  259. package/dist/to/index.js +2 -2
  260. package/dist/transactions/index.js +3 -3
  261. package/dist/util/index.js +1 -1
  262. package/dist/vault-head/index.js +7 -7
  263. package/dist/{verify-KWQIWLGH.js → verify-QWO5UKD6.js} +7 -7
  264. package/dist/walk-3KEOL7BY.js +20 -0
  265. package/dist/with-audit/guards/types.d.ts +2 -0
  266. package/dist/with-audit/tiers/index.d.ts +5 -5
  267. package/dist/with-commit/history/history.d.ts +16 -0
  268. package/dist/with-commit/history/restore-to.d.ts +40 -0
  269. package/dist/with-party/broker/seed.d.ts +4 -0
  270. package/dist/with-party/custody/strategy.d.ts +2 -2
  271. package/dist/with-party/team/delegation.d.ts +41 -11
  272. package/dist/with-party/team/index.d.ts +2 -0
  273. package/dist/with-party/team/keyring.d.ts +133 -3
  274. package/dist/with-party/team/managed-secret.d.ts +1 -1
  275. package/dist/with-party/team/noydb-facade.d.ts +14 -2
  276. package/dist/with-party/team/roster-tag.d.ts +1 -1
  277. package/dist/with-pod/backup.d.ts +9 -17
  278. package/dist/with-sync/active.d.ts +28 -1
  279. package/dist/with-sync/engine.d.ts +59 -2
  280. package/dist/with-sync/index.d.ts +1 -0
  281. package/dist/with-sync/reserved-mirror.d.ts +27 -4
  282. package/dist/with-sync/strategy.d.ts +2 -0
  283. package/dist/withdraw-accessible-OZU525ND.js +25 -0
  284. package/dist/withdraw-accessible-OZU525ND.js.map +1 -0
  285. package/package.json +3 -3
  286. package/dist/api-MSJXVYQG.js +0 -18
  287. package/dist/backup-7RKNZMQO.js.map +0 -1
  288. package/dist/chunk-2A56DSRI.js.map +0 -1
  289. package/dist/chunk-2ELOCEXE.js.map +0 -1
  290. package/dist/chunk-45VHWE4C.js.map +0 -1
  291. package/dist/chunk-72XBVN4J.js.map +0 -1
  292. package/dist/chunk-APFFJN5T.js.map +0 -1
  293. package/dist/chunk-CAD7N6HQ.js.map +0 -1
  294. package/dist/chunk-CB4467G3.js.map +0 -1
  295. package/dist/chunk-FSQNGPHH.js.map +0 -1
  296. package/dist/chunk-GOJQ5DZA.js.map +0 -1
  297. package/dist/chunk-JA25QG5M.js.map +0 -1
  298. package/dist/chunk-JBMMWYOH.js.map +0 -1
  299. package/dist/chunk-VSUQI5Q6.js.map +0 -1
  300. package/dist/chunk-XKBTJGFP.js.map +0 -1
  301. package/dist/chunk-Z3ZXVB2Y.js.map +0 -1
  302. package/dist/collection-facade-LZIF7GWD.js +0 -41
  303. package/dist/delegation-ONLM4JFI.js.map +0 -1
  304. package/dist/derive-3YSIS36W.js +0 -20
  305. package/dist/executor-E6YDJ7YA.js +0 -8
  306. package/dist/executor-NJX3YQQ4.js +0 -35
  307. package/dist/executor-WWM3DD4P.js +0 -8
  308. package/dist/export-accessible-RLHU5G4W.js +0 -22
  309. package/dist/extract-partition-QII2EDCS.js +0 -35
  310. package/dist/find-6M7GYDUZ.js +0 -10
  311. package/dist/issue-LPEEEMPP.js +0 -19
  312. package/dist/liberate-LEKDYKTC.js +0 -25
  313. package/dist/noydb-F2AUF6KL.js +0 -98
  314. package/dist/register-SN72QALV.js +0 -30
  315. package/dist/registry-253FF7C6.js +0 -35
  316. package/dist/registry-3AZWQTDT.js +0 -23
  317. package/dist/registry-7UEBTHWG.js +0 -8
  318. package/dist/registry-IVJ67NFQ.js +0 -8
  319. package/dist/request-withdrawal-UKVJZKX2.js +0 -28
  320. package/dist/revoke-G2KXJQA5.js +0 -24
  321. package/dist/seed-JMQTRKRE.js.map +0 -1
  322. package/dist/signer-IUIYR3CX.js +0 -23
  323. package/dist/storage-NPBYP2SM.js +0 -21
  324. package/dist/walk-F4OLXI5H.js +0 -20
  325. package/dist/withdraw-accessible-ZKPLZ66E.js +0 -25
  326. /package/dist/{api-MSJXVYQG.js.map → api-H4B7ZQXP.js.map} +0 -0
  327. /package/dist/{capsule-57BDK7LG.js.map → capsule-YQKQZPH7.js.map} +0 -0
  328. /package/dist/{chunk-AJFPAHMW.js.map → chunk-27NCEPKM.js.map} +0 -0
  329. /package/dist/{chunk-PGC35KXE.js.map → chunk-2IASHJPS.js.map} +0 -0
  330. /package/dist/{chunk-NYJBYVBG.js.map → chunk-2ODEFG6K.js.map} +0 -0
  331. /package/dist/{chunk-7BMOS4JQ.js.map → chunk-2QH3I7QC.js.map} +0 -0
  332. /package/dist/{chunk-IVMFIKNA.js.map → chunk-2T2TGRWE.js.map} +0 -0
  333. /package/dist/{chunk-G66YXUTY.js.map → chunk-35CNOVQE.js.map} +0 -0
  334. /package/dist/{chunk-OJU67C23.js.map → chunk-3EXQXOQ2.js.map} +0 -0
  335. /package/dist/{chunk-BJH77UY2.js.map → chunk-4KYKRYRT.js.map} +0 -0
  336. /package/dist/{chunk-RDOEOPOI.js.map → chunk-4N4OIVK3.js.map} +0 -0
  337. /package/dist/{chunk-WHOKGHJ3.js.map → chunk-4WLI37WK.js.map} +0 -0
  338. /package/dist/{chunk-RNACRT5H.js.map → chunk-52ZFNK46.js.map} +0 -0
  339. /package/dist/{chunk-QDHHHI5Q.js.map → chunk-5SMCBPJ2.js.map} +0 -0
  340. /package/dist/{chunk-EMAWOGVH.js.map → chunk-654RE5YC.js.map} +0 -0
  341. /package/dist/{chunk-FZXRLNJO.js.map → chunk-6BEBWHNL.js.map} +0 -0
  342. /package/dist/{chunk-EUD3HQM4.js.map → chunk-6WEPFEMJ.js.map} +0 -0
  343. /package/dist/{chunk-YFFMPZPY.js.map → chunk-6WIFF46H.js.map} +0 -0
  344. /package/dist/{chunk-ZVSKSUGI.js.map → chunk-7C7OF26T.js.map} +0 -0
  345. /package/dist/{chunk-QXJXG7DN.js.map → chunk-7IV7GVOS.js.map} +0 -0
  346. /package/dist/{chunk-MQ7YWBQ5.js.map → chunk-7JRLCP2J.js.map} +0 -0
  347. /package/dist/{chunk-QSHATAXJ.js.map → chunk-7ONMS7QI.js.map} +0 -0
  348. /package/dist/{chunk-6WS35E6X.js.map → chunk-A52BK5AY.js.map} +0 -0
  349. /package/dist/{chunk-XXQ5XIYY.js.map → chunk-AMSSAOOB.js.map} +0 -0
  350. /package/dist/{chunk-3V6LZHUO.js.map → chunk-AYOQZJDB.js.map} +0 -0
  351. /package/dist/{chunk-DL6BZKP3.js.map → chunk-B3B6HV5S.js.map} +0 -0
  352. /package/dist/{chunk-5XONHAFD.js.map → chunk-B6EWMGFX.js.map} +0 -0
  353. /package/dist/{chunk-6Y5E4SJU.js.map → chunk-BMAXBTYH.js.map} +0 -0
  354. /package/dist/{chunk-LGGIFKJP.js.map → chunk-BNYDOF2Q.js.map} +0 -0
  355. /package/dist/{chunk-XXNWU5QZ.js.map → chunk-BQJ5ORU5.js.map} +0 -0
  356. /package/dist/{chunk-BYHCKX73.js.map → chunk-CLOSXHR4.js.map} +0 -0
  357. /package/dist/{chunk-5HNW4ZTA.js.map → chunk-CSAN22QG.js.map} +0 -0
  358. /package/dist/{chunk-TZYTMZZY.js.map → chunk-DL4GCSTS.js.map} +0 -0
  359. /package/dist/{chunk-EA4VDI5D.js.map → chunk-DYIR6RC3.js.map} +0 -0
  360. /package/dist/{chunk-PUBI455O.js.map → chunk-EPPAEGH5.js.map} +0 -0
  361. /package/dist/{chunk-BNFNQNEP.js.map → chunk-F7X7MPK4.js.map} +0 -0
  362. /package/dist/{chunk-SNM7LSYG.js.map → chunk-FUHUGKDN.js.map} +0 -0
  363. /package/dist/{chunk-D4V5JJAK.js.map → chunk-GHMINSER.js.map} +0 -0
  364. /package/dist/{chunk-QGFEBNHO.js.map → chunk-GZISWBCJ.js.map} +0 -0
  365. /package/dist/{chunk-OM3SEDI4.js.map → chunk-HTRLQ4ZZ.js.map} +0 -0
  366. /package/dist/{chunk-SWXLZ4HX.js.map → chunk-ICHHNI5E.js.map} +0 -0
  367. /package/dist/{chunk-K673OO6B.js.map → chunk-ID4ZBC3X.js.map} +0 -0
  368. /package/dist/{chunk-H3YM66EI.js.map → chunk-IF2M43G4.js.map} +0 -0
  369. /package/dist/{chunk-QGSNJD3B.js.map → chunk-IFUYLIEY.js.map} +0 -0
  370. /package/dist/{chunk-D5A3GCZ4.js.map → chunk-IPF5ORDI.js.map} +0 -0
  371. /package/dist/{chunk-BVF3SXD7.js.map → chunk-KBIS64X4.js.map} +0 -0
  372. /package/dist/{chunk-RIZTZJX6.js.map → chunk-LJ744WXU.js.map} +0 -0
  373. /package/dist/{chunk-L5A3KR7R.js.map → chunk-LUQBG637.js.map} +0 -0
  374. /package/dist/{chunk-6QLCS7ET.js.map → chunk-LZN6DTFI.js.map} +0 -0
  375. /package/dist/{chunk-NIXRB5BP.js.map → chunk-MMWX5OT5.js.map} +0 -0
  376. /package/dist/{chunk-UOZOWN73.js.map → chunk-ND6S2DKC.js.map} +0 -0
  377. /package/dist/{chunk-WFWFXDNS.js.map → chunk-NHEKQWFI.js.map} +0 -0
  378. /package/dist/{chunk-2ZFD2UJC.js.map → chunk-NIUHKKMM.js.map} +0 -0
  379. /package/dist/{chunk-XA34THLF.js.map → chunk-NK4LGBGQ.js.map} +0 -0
  380. /package/dist/{chunk-JSWKVZCR.js.map → chunk-NUZ7ROUZ.js.map} +0 -0
  381. /package/dist/{chunk-DHU2AQ6T.js.map → chunk-O3NGOHXQ.js.map} +0 -0
  382. /package/dist/{chunk-ZBUAX4EF.js.map → chunk-O6VOR4NH.js.map} +0 -0
  383. /package/dist/{chunk-JZ4EDEIP.js.map → chunk-ODBOHPZU.js.map} +0 -0
  384. /package/dist/{chunk-5UUJE4FP.js.map → chunk-OK44MD3C.js.map} +0 -0
  385. /package/dist/{chunk-ECGXA4LT.js.map → chunk-OR3OHKU6.js.map} +0 -0
  386. /package/dist/{chunk-ZWF3EWZA.js.map → chunk-P6FATPXQ.js.map} +0 -0
  387. /package/dist/{chunk-PCYPXLEX.js.map → chunk-PBEHTFUG.js.map} +0 -0
  388. /package/dist/{chunk-7CT6SX4M.js.map → chunk-PFHDQY5L.js.map} +0 -0
  389. /package/dist/{chunk-PTJY5R3O.js.map → chunk-PIO6NW7O.js.map} +0 -0
  390. /package/dist/{chunk-TMIJAR2X.js.map → chunk-PREYKC76.js.map} +0 -0
  391. /package/dist/{chunk-ZHQJAV6D.js.map → chunk-PU5ZEV65.js.map} +0 -0
  392. /package/dist/{chunk-UNSQZSZP.js.map → chunk-PWAMX5KU.js.map} +0 -0
  393. /package/dist/{chunk-GETUTTZU.js.map → chunk-PZN76MMV.js.map} +0 -0
  394. /package/dist/{chunk-ABU6A4Z5.js.map → chunk-Q4DBU5RM.js.map} +0 -0
  395. /package/dist/{chunk-2WJKJZSO.js.map → chunk-QHG7GQKM.js.map} +0 -0
  396. /package/dist/{chunk-UAKY6E4N.js.map → chunk-QNOWNCZS.js.map} +0 -0
  397. /package/dist/{chunk-JPSL5GIZ.js.map → chunk-QQLXKDGC.js.map} +0 -0
  398. /package/dist/{chunk-OK57EATL.js.map → chunk-R4GLRJ55.js.map} +0 -0
  399. /package/dist/{chunk-B65CC6Z6.js.map → chunk-RF5WDM25.js.map} +0 -0
  400. /package/dist/{chunk-G46JSSVX.js.map → chunk-RKBCUP5D.js.map} +0 -0
  401. /package/dist/{chunk-GCUMOKTN.js.map → chunk-S2ORTQGS.js.map} +0 -0
  402. /package/dist/{chunk-MRJDLXI3.js.map → chunk-SVXFCCSX.js.map} +0 -0
  403. /package/dist/{chunk-BUE7R3B5.js.map → chunk-SXPLIRQH.js.map} +0 -0
  404. /package/dist/{chunk-5LMCVBMY.js.map → chunk-T5EXREMW.js.map} +0 -0
  405. /package/dist/{chunk-PT2YCQVK.js.map → chunk-TBVDI3LY.js.map} +0 -0
  406. /package/dist/{chunk-BMHQHH7Q.js.map → chunk-TLIFNRU5.js.map} +0 -0
  407. /package/dist/{chunk-YKGJ44Z7.js.map → chunk-TU6ZJTYT.js.map} +0 -0
  408. /package/dist/{chunk-55P6OBB7.js.map → chunk-U43RSPPX.js.map} +0 -0
  409. /package/dist/{chunk-K7RW7FI4.js.map → chunk-UADW5NOU.js.map} +0 -0
  410. /package/dist/{chunk-GRS2HIV6.js.map → chunk-UMV5GBTJ.js.map} +0 -0
  411. /package/dist/{chunk-4UIP3QNW.js.map → chunk-UNAMWK2Q.js.map} +0 -0
  412. /package/dist/{chunk-J4KAPKBJ.js.map → chunk-UORWAG7K.js.map} +0 -0
  413. /package/dist/{chunk-V55JASXO.js.map → chunk-UQRKAM2R.js.map} +0 -0
  414. /package/dist/{chunk-ZMVSKYTJ.js.map → chunk-VLRY2UH4.js.map} +0 -0
  415. /package/dist/{chunk-SPPOUJLN.js.map → chunk-VZFTON37.js.map} +0 -0
  416. /package/dist/{chunk-YQFBH5ZJ.js.map → chunk-WQUIJPN4.js.map} +0 -0
  417. /package/dist/{chunk-NZULV7LK.js.map → chunk-WVQDY3UM.js.map} +0 -0
  418. /package/dist/{chunk-3Y5JLSXS.js.map → chunk-X5RGG3ZW.js.map} +0 -0
  419. /package/dist/{chunk-PFCTSXHU.js.map → chunk-X6Z2SIRF.js.map} +0 -0
  420. /package/dist/{chunk-UHFGK6YA.js.map → chunk-XQGKS4OW.js.map} +0 -0
  421. /package/dist/{chunk-L2F3CFCH.js.map → chunk-Y22JWHCP.js.map} +0 -0
  422. /package/dist/{chunk-C53ER7AG.js.map → chunk-YVA6UPRN.js.map} +0 -0
  423. /package/dist/{chunk-226V6XXJ.js.map → chunk-Z2KP6PNF.js.map} +0 -0
  424. /package/dist/{chunk-G5EDYVSE.js.map → chunk-ZK2WT532.js.map} +0 -0
  425. /package/dist/{chunk-SFCD6OU7.js.map → chunk-ZNVBCKMV.js.map} +0 -0
  426. /package/dist/{chunk-BU2ABHFW.js.map → chunk-ZOFNZLAA.js.map} +0 -0
  427. /package/dist/{chunk-X2RP4TO5.js.map → chunk-ZVJKHGE5.js.map} +0 -0
  428. /package/dist/{classified-marker-KHDOYIJB.js.map → classified-marker-7HXDMYHI.js.map} +0 -0
  429. /package/dist/{collection-facade-LZIF7GWD.js.map → collection-facade-V63BEBGU.js.map} +0 -0
  430. /package/dist/{computed-XMFTHAXV.js.map → computed-LZLSYOPG.js.map} +0 -0
  431. /package/dist/{dead-filter-CXV5NS67.js.map → dead-filter-PZIJ4F4G.js.map} +0 -0
  432. /package/dist/{derive-3YSIS36W.js.map → delegation-7SSGIETH.js.map} +0 -0
  433. /package/dist/{executor-E6YDJ7YA.js.map → derive-IMI3BMDS.js.map} +0 -0
  434. /package/dist/{dispatch-2MQFMEGY.js.map → dispatch-4BUYPWMJ.js.map} +0 -0
  435. /package/dist/{dispatch-OFDA4WQV.js.map → dispatch-KOPDDPEQ.js.map} +0 -0
  436. /package/dist/{executor-NJX3YQQ4.js.map → executor-7SY3M6TZ.js.map} +0 -0
  437. /package/dist/{executor-WWM3DD4P.js.map → executor-SNHW4ELF.js.map} +0 -0
  438. /package/dist/{export-accessible-RLHU5G4W.js.map → executor-Z3IKK7G3.js.map} +0 -0
  439. /package/dist/{extract-partition-QII2EDCS.js.map → export-accessible-O7DIVFUO.js.map} +0 -0
  440. /package/dist/{find-6M7GYDUZ.js.map → extract-partition-ELZEJKXM.js.map} +0 -0
  441. /package/dist/{fanout-sidecar-BO67PCPO.js.map → fanout-sidecar-FYDRL7F3.js.map} +0 -0
  442. /package/dist/{issue-LPEEEMPP.js.map → find-KWB2RYWJ.js.map} +0 -0
  443. /package/dist/{ledger-MSJGWKGW.js.map → issue-5ZHXK4HJ.js.map} +0 -0
  444. /package/dist/{liberate-LEKDYKTC.js.map → ledger-UFJCB6T5.js.map} +0 -0
  445. /package/dist/{link-set-QXXSPPHL.js.map → liberate-OEOSNNFH.js.map} +0 -0
  446. /package/dist/{managed-secret-VSK7ANQI.js.map → link-set-KMUBFN2L.js.map} +0 -0
  447. /package/dist/{noydb-F2AUF6KL.js.map → managed-secret-H5WYSJ46.js.map} +0 -0
  448. /package/dist/{migrate-cek-GEBFYBDC.js.map → migrate-cek-SPESQAAO.js.map} +0 -0
  449. /package/dist/{register-SN72QALV.js.map → noydb-QDZ4QIKO.js.map} +0 -0
  450. /package/dist/{pod-handle-YE7CT66T.js.map → pod-handle-GJLCOUGK.js.map} +0 -0
  451. /package/dist/{post-register-QC5TEAW3.js.map → post-register-2AC2STHC.js.map} +0 -0
  452. /package/dist/{registry-253FF7C6.js.map → register-PIORIMMR.js.map} +0 -0
  453. /package/dist/{registry-3AZWQTDT.js.map → registry-BIMICFUH.js.map} +0 -0
  454. /package/dist/{registry-7UEBTHWG.js.map → registry-JGWLW53D.js.map} +0 -0
  455. /package/dist/{registry-IVJ67NFQ.js.map → registry-SELCBYEQ.js.map} +0 -0
  456. /package/dist/{request-withdrawal-UKVJZKX2.js.map → registry-W327UNYH.js.map} +0 -0
  457. /package/dist/{revoke-G2KXJQA5.js.map → request-withdrawal-K3SXXODI.js.map} +0 -0
  458. /package/dist/{reveal-YQTRNQFH.js.map → reveal-UAPBG743.js.map} +0 -0
  459. /package/dist/{signer-IUIYR3CX.js.map → revoke-6AFVXTWF.js.map} +0 -0
  460. /package/dist/{stale-SKV33PBU.js.map → signer-TW5MAQJP.js.map} +0 -0
  461. /package/dist/{storage-NPBYP2SM.js.map → stale-CROGJBIJ.js.map} +0 -0
  462. /package/dist/{walk-F4OLXI5H.js.map → storage-SO2L2Z5J.js.map} +0 -0
  463. /package/dist/{store-coordination-provider-Z6HKPOGM.js.map → store-coordination-provider-2YD2PTTP.js.map} +0 -0
  464. /package/dist/{verify-KWQIWLGH.js.map → verify-QWO5UKD6.js.map} +0 -0
  465. /package/dist/{withdraw-accessible-ZKPLZ66E.js.map → walk-3KEOL7BY.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # Changelog — hub
2
2
 
3
+ ## 0.9.0-pre.2
4
+
5
+ **A small, deliberate release: two keyring correctness items and the removal of six shim packages.** No format change, no new surface.
6
+
7
+ ⛔ **A keyring CREATE is now race-safe** (core#134, completing core#132). `writeKeyringFile` writes with `expectedVersion: 0`. core#132 made keyring writes CAS against the version they were computed from, which caught concurrent **updates** to one member; the **create** race stayed open, so two concurrent grants of the same new `userId` both succeeded and the second silently replaced the first — a member who appeared granted, holding a keyring nobody else's view agreed with.
8
+
9
+ ⭐ That limit had been attributed to the store contract being unable to express *"write only if absent"*. Measured, the claim was **wrong**: hub never stores a version below 1, so `expectedVersion: 0` lets the first create through and conflicts every later one — an exact must-not-exist, with **no sentinel added to `put`'s signature and no seventh method on the six-method store contract**. Both were costed; neither was needed. What was missing was an **assertion**, not a mechanism: `@noy-db/ports/to` now holds the absent case (core#138), and `noy-db/to` ran it green across **19 adapters** before this line changed.
10
+
11
+ ⚠️ **Adapter authors:** the contracted answer is that the FIRST create SUCCEEDS. Do not implement absence by throwing — if your backend's conditional write rejects a missing item, OR in an existence check the way `to-aws-dynamo` does. The kit case asserts both halves, so that failure mode reddens rather than passing as "safe".
12
+
13
+ ⛔ **Not closable here: a mixed fleet.** An older hub writes keyrings at `_v: 1` with no `expectedVersion` at all, so it clobbers a new hub's CAS — create or update alike. The guarantee is real only once every writer is a new hub.
14
+
15
+ **`KeyringTamperedError`'s re-seed guidance leads with PRESERVE** (core#143). It used to say *remove the vault from this device first*. That is safe on a local store — a hostile local store means the device is already owned — but on a **remote, separately administered** store the identical error can mean the store altered the keyring, and deleting the local copy destroys the only evidence; on a thin client there is nothing local to remove at all. The remedy now leads with preserving a copy of the raw store contents and names the remote case explicitly. Deliberately **not** conditioned on the store type: the branch that most needs the warning is the one hub cannot classify. No behaviour change; the test's property is now the ORDER of the two instructions.
16
+
17
+ ⛔ **The six `@noy-db/test-*-conformance` re-export shims are removed** (family#39 step 5). They were 8-line `export * from '@noy-db/ports/<port>'` packages kept published while the family's satellites moved off them; `to`, `as`, `on`, `at` and `daemon` all bind `@noy-db/ports/<port>` directly as of 2026-09-25.
18
+
19
+ ⚠️ **Already-published versions are unaffected.** `@noy-db/test-adapter-conformance@0.9.0-pre.1` and every earlier version stay installable; what stops is the publication of *new* ones. A consumer still pinning a shim keeps resolving it, and should migrate to the matching `@noy-db/ports` subpath — `/to`, `/as`, `/at`, `/on`, `/by`, `/capsule`.
20
+
21
+ ## 0.9.0-pre.1
22
+
23
+ **A correctness release on the 0.9 line. The headline is a keyring race that surfaced as a tamper alarm on the user's own data** (core#132) — everything else is additive.
24
+
25
+ ⛔ **`_keyring` writes are now compare-and-swap.** Two sessions putting to a new collection each minted a DEK, one write silently lost, and a cold session then failed to authenticate **both** rows — reported as tampering, on data the user had just written themselves. A keyring write is now CAS'd against the version it was computed from, and a session that loses a mint **adopts the winner's DEK** instead of keeping its own. If you held data written by two concurrent first-writers on `0.9.0-pre.0`, this is the release that stops it recurring; it does not retroactively repair a pair of rows already minted under different DEKs.
26
+
27
+ **Sync — three fixes pilot-1 witnessed against real DynamoDB** (core#107, core#108).
28
+ - An arbiter now **replicates its admission refusals**, so the writer finds out at all. A refusal made on another device arrives as `origin: 'arbiter'` and is **report-only** — the local record is untouched, and `readmit()` is meaningless for it.
29
+ - A dirty record **re-runs this device's own gates before pushing**, so a record refused on the way out (`origin: 'push-recheck'`) stays local and dirty and pushes itself once it passes again.
30
+ - `RecordRejection` carries `recordAt` alongside `at`: an arbiter judges at **pull** time, so a record legitimately written while a period was open can be refused later. With both timestamps a UI can say *written then, refused now* rather than *your push was wrong*.
31
+
32
+ **Backup and restore** (core#76, core#77, core#101, core#103, core#111, core#122). Reads can carry ids, the restore path is exported rather than inferred, and ⭐ **a restore now rewinds the ledger too** — previously the pod came back but the ledger did not, so the next pull reverted it. ⚠️ Delete markers persist across a restore; `vault.compact()` will not remove them, being blob compaction and cache-budget eviction that happens to share the word.
33
+
34
+ **Presence binds the primary sync target, not `targets[0]`** (core#139). With `sync: [{cloud, role:'backup'}, {daemon, role:'sync-peer'}]` records synced with the daemon while presence published to a **push-only archive** target. The two selectors now agree.
35
+
36
+ **`expectedVersion: 0` means "must not exist", and `@noy-db/ports/to` now asserts it** (core#134). The conformance kit holds the agreement instead of relying on it, and the adapter census found the divergence core#136 warned about is not present in this family.
37
+
38
+ **Surface and docs.** The restore/pod types are exported with an invariant so it is the last time (core#101, core#54). `@internal` is not the surface — the golden is (core#128). The KEK gate that keeps the keyring inbox drain unreachable is pinned in a test (core#130), recorded as an accepted risk rather than a fix. `enrollWebAuthn`'s documented slot `meta` now records `rpId`, which the rotation ceremony falls back to (core#140).
39
+
40
+ ⚠️ **`@noy-db/ports` still carries `latest` on a prerelease**, because npm sets `latest` on a package's first publish regardless of `--tag`. Corrected at the `0.9.0` stable cut; there is no stable version to point it at yet.
41
+
3
42
  ## 0.9.0-pre.0
4
43
 
5
44
  **The line moves to 0.9.0 on this pre-release: a new package, a milestone, three seam widenings, and fourteen fewer names.** Everything below is additive unless marked ⛔.
@@ -0,0 +1,18 @@
1
+ import {
2
+ UserApi,
3
+ createUserApi
4
+ } from "./chunk-S2ORTQGS.js";
5
+ import "./chunk-6BEBWHNL.js";
6
+ import "./chunk-WRLWEYHY.js";
7
+ import "./chunk-O6VOR4NH.js";
8
+ import "./chunk-VZFTON37.js";
9
+ import "./chunk-NH2UOV3B.js";
10
+ import "./chunk-HTRLQ4ZZ.js";
11
+ import "./chunk-EPPAEGH5.js";
12
+ import "./chunk-URGHKZPL.js";
13
+ import "./chunk-2RH5SEY7.js";
14
+ export {
15
+ UserApi,
16
+ createUserApi
17
+ };
18
+ //# sourceMappingURL=api-H4B7ZQXP.js.map
package/dist/as/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "../chunk-2DX4JCRI.js";
2
- import "../chunk-EMAWOGVH.js";
2
+ import "../chunk-654RE5YC.js";
3
3
  import {
4
4
  applyListProjection
5
5
  } from "../chunk-VG2ZSFYD.js";
@@ -9,19 +9,19 @@ import {
9
9
  import "../chunk-RXLYKVTF.js";
10
10
  import "../chunk-QJNAHPVT.js";
11
11
  import "../chunk-VYYM3MEN.js";
12
- import "../chunk-J4KAPKBJ.js";
12
+ import "../chunk-UORWAG7K.js";
13
13
  import "../chunk-Y2NBBT6K.js";
14
- import "../chunk-H3YM66EI.js";
15
- import "../chunk-4J3MNVVX.js";
16
- import "../chunk-ZBUAX4EF.js";
17
- import "../chunk-SPPOUJLN.js";
14
+ import "../chunk-IF2M43G4.js";
15
+ import "../chunk-WRLWEYHY.js";
16
+ import "../chunk-O6VOR4NH.js";
17
+ import "../chunk-VZFTON37.js";
18
18
  import "../chunk-NH2UOV3B.js";
19
- import "../chunk-OM3SEDI4.js";
20
- import "../chunk-PUBI455O.js";
21
- import "../chunk-2ELOCEXE.js";
19
+ import "../chunk-HTRLQ4ZZ.js";
20
+ import "../chunk-EPPAEGH5.js";
21
+ import "../chunk-URGHKZPL.js";
22
22
  import {
23
23
  ValidationError
24
- } from "../chunk-VSUQI5Q6.js";
24
+ } from "../chunk-2RH5SEY7.js";
25
25
 
26
26
  // src/port/as/active.ts
27
27
  function redactChunk(chunk, ctx, redact) {
package/dist/at/index.js CHANGED
@@ -3,15 +3,15 @@ import {
3
3
  MemorySealer,
4
4
  SEALED_SECRET_RECORD_ID,
5
5
  parseSealedEnvelope
6
- } from "../chunk-XKBTJGFP.js";
7
- import "../chunk-4J3MNVVX.js";
8
- import "../chunk-ZBUAX4EF.js";
9
- import "../chunk-SPPOUJLN.js";
6
+ } from "../chunk-GU6QXHPZ.js";
7
+ import "../chunk-WRLWEYHY.js";
8
+ import "../chunk-O6VOR4NH.js";
9
+ import "../chunk-VZFTON37.js";
10
10
  import "../chunk-NH2UOV3B.js";
11
- import "../chunk-OM3SEDI4.js";
12
- import "../chunk-PUBI455O.js";
13
- import "../chunk-2ELOCEXE.js";
14
- import "../chunk-VSUQI5Q6.js";
11
+ import "../chunk-HTRLQ4ZZ.js";
12
+ import "../chunk-EPPAEGH5.js";
13
+ import "../chunk-URGHKZPL.js";
14
+ import "../chunk-2RH5SEY7.js";
15
15
  export {
16
16
  MemoryRecipientSealer,
17
17
  MemorySealer,
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  issueAttestationCore
3
- } from "../chunk-QDHHHI5Q.js";
3
+ } from "../chunk-5SMCBPJ2.js";
4
4
  import {
5
5
  getRevokedDocIdsCore,
6
6
  publishRevocationListCore,
7
7
  revokeDocCore,
8
8
  unrevokeDocCore
9
- } from "../chunk-K7RW7FI4.js";
10
- import "../chunk-5XONHAFD.js";
9
+ } from "../chunk-UADW5NOU.js";
10
+ import "../chunk-B6EWMGFX.js";
11
11
  import {
12
12
  ATTESTATIONS_COLLECTION
13
- } from "../chunk-D5A3GCZ4.js";
13
+ } from "../chunk-IPF5ORDI.js";
14
14
  import {
15
15
  NO_ATTESTATION
16
- } from "../chunk-6QLCS7ET.js";
16
+ } from "../chunk-LZN6DTFI.js";
17
17
  import {
18
18
  decodeQr,
19
19
  isRevoked,
@@ -22,27 +22,27 @@ import {
22
22
  verifyRevocationList
23
23
  } from "../chunk-GMKGGY7V.js";
24
24
  import "../chunk-4AOERLTV.js";
25
- import "../chunk-4J3MNVVX.js";
26
- import "../chunk-ZBUAX4EF.js";
27
- import "../chunk-SPPOUJLN.js";
25
+ import "../chunk-WRLWEYHY.js";
26
+ import "../chunk-O6VOR4NH.js";
27
+ import "../chunk-VZFTON37.js";
28
28
  import "../chunk-NH2UOV3B.js";
29
- import "../chunk-OM3SEDI4.js";
30
- import "../chunk-PUBI455O.js";
31
- import "../chunk-2ELOCEXE.js";
29
+ import "../chunk-HTRLQ4ZZ.js";
30
+ import "../chunk-EPPAEGH5.js";
31
+ import "../chunk-URGHKZPL.js";
32
32
  import {
33
33
  AttestationError,
34
34
  AttestationNotEnabledError
35
- } from "../chunk-VSUQI5Q6.js";
35
+ } from "../chunk-2RH5SEY7.js";
36
36
 
37
37
  // src/with-audit/attestation/active.ts
38
38
  function withAttestation() {
39
39
  return {
40
40
  async issueAttestation(ctx, args) {
41
- const { issueAttestationCore: issueAttestationCore2 } = await import("../issue-LPEEEMPP.js");
41
+ const { issueAttestationCore: issueAttestationCore2 } = await import("../issue-5ZHXK4HJ.js");
42
42
  return issueAttestationCore2(ctx, args);
43
43
  },
44
44
  async getDocumentSigningPublicKey(deps) {
45
- const { loadSigner, loadOrCreateSigner } = await import("../signer-IUIYR3CX.js");
45
+ const { loadSigner, loadOrCreateSigner } = await import("../signer-TW5MAQJP.js");
46
46
  const existing = await loadSigner(deps.adapter, deps.vault, deps.getDEK);
47
47
  if (existing) return { keyId: existing.keyId, publicKeyB64: existing.publicKeyB64 };
48
48
  if (deps.role !== "owner") {
@@ -52,19 +52,19 @@ function withAttestation() {
52
52
  return { keyId: signer.keyId, publicKeyB64: signer.publicKeyB64 };
53
53
  },
54
54
  async revokeAttestation(ctx, docId) {
55
- const { revokeDocCore: revokeDocCore2 } = await import("../revoke-G2KXJQA5.js");
55
+ const { revokeDocCore: revokeDocCore2 } = await import("../revoke-6AFVXTWF.js");
56
56
  return revokeDocCore2(ctx, docId);
57
57
  },
58
58
  async unrevokeAttestation(ctx, docId) {
59
- const { unrevokeDocCore: unrevokeDocCore2 } = await import("../revoke-G2KXJQA5.js");
59
+ const { unrevokeDocCore: unrevokeDocCore2 } = await import("../revoke-6AFVXTWF.js");
60
60
  return unrevokeDocCore2(ctx, docId);
61
61
  },
62
62
  async getRevokedDocIds(ctx) {
63
- const { getRevokedDocIdsCore: getRevokedDocIdsCore2 } = await import("../revoke-G2KXJQA5.js");
63
+ const { getRevokedDocIdsCore: getRevokedDocIdsCore2 } = await import("../revoke-6AFVXTWF.js");
64
64
  return getRevokedDocIdsCore2(ctx);
65
65
  },
66
66
  async publishRevocationList(ctx) {
67
- const { publishRevocationListCore: publishRevocationListCore2 } = await import("../revoke-G2KXJQA5.js");
67
+ const { publishRevocationListCore: publishRevocationListCore2 } = await import("../revoke-6AFVXTWF.js");
68
68
  return publishRevocationListCore2(ctx);
69
69
  }
70
70
  };
@@ -3,50 +3,40 @@ import {
3
3
  } from "./chunk-EPFF7LOX.js";
4
4
  import {
5
5
  SCHEMAS_COLLECTION
6
- } from "./chunk-H3YM66EI.js";
6
+ } from "./chunk-IF2M43G4.js";
7
7
  import {
8
8
  PERIODS_COLLECTION,
9
9
  PERIOD_ARCHIVES_COLLECTION,
10
10
  PERIOD_FREEZES_COLLECTION,
11
11
  PERIOD_REOPENS_COLLECTION,
12
12
  PERIOD_TARGET_PURGES_COLLECTION
13
- } from "./chunk-6WS35E6X.js";
13
+ } from "./chunk-A52BK5AY.js";
14
14
  import {
15
15
  SEQUENCE_COLLECTION
16
- } from "./chunk-BYHCKX73.js";
16
+ } from "./chunk-CLOSXHR4.js";
17
17
  import {
18
18
  LEDGER_COLLECTION,
19
19
  LEDGER_DELTAS_COLLECTION
20
20
  } from "./chunk-I7FD46FF.js";
21
21
  import {
22
22
  buildRecordEnvelope
23
- } from "./chunk-4J3MNVVX.js";
24
- import "./chunk-ZBUAX4EF.js";
25
- import "./chunk-SPPOUJLN.js";
23
+ } from "./chunk-WRLWEYHY.js";
24
+ import "./chunk-O6VOR4NH.js";
25
+ import "./chunk-VZFTON37.js";
26
26
  import "./chunk-NH2UOV3B.js";
27
- import "./chunk-OM3SEDI4.js";
28
- import "./chunk-PUBI455O.js";
27
+ import "./chunk-HTRLQ4ZZ.js";
28
+ import "./chunk-EPPAEGH5.js";
29
29
  import {
30
30
  NOYDB_BACKUP_VERSION
31
- } from "./chunk-2ELOCEXE.js";
31
+ } from "./chunk-URGHKZPL.js";
32
32
  import {
33
33
  BackupCorruptedError,
34
34
  BackupLedgerError
35
- } from "./chunk-VSUQI5Q6.js";
35
+ } from "./chunk-2RH5SEY7.js";
36
36
 
37
37
  // src/with-pod/backup.ts
38
- async function dumpVault(ctx) {
39
- const snapshot = await ctx.adapter.loadAll(ctx.vault);
40
- const keyringIds = await ctx.adapter.list(ctx.vault, "_keyring");
41
- const keyrings = {};
42
- for (const keyringId of keyringIds) {
43
- const envelope = await ctx.adapter.get(ctx.vault, "_keyring", keyringId);
44
- if (envelope) {
45
- keyrings[keyringId] = JSON.parse(envelope._data ?? "");
46
- }
47
- }
48
- const internalSnapshot = {};
49
- const internalNames = [
38
+ function internalCollectionNames(dataCollections) {
39
+ return [
50
40
  LEDGER_COLLECTION,
51
41
  LEDGER_DELTAS_COLLECTION,
52
42
  SCHEMAS_COLLECTION,
@@ -87,8 +77,21 @@ async function dumpVault(ctx) {
87
77
  // old eTag may not exist in the destination, so it must be stripped
88
78
  // there instead. Asymmetry: backup = same-vault-resumable = carry;
89
79
  // partition = cross-vault = strip-breadcrumb-carry-marker.
90
- ...Object.keys(snapshot).flatMap((c) => [`_blob_slots_${c}`, `_blob_versions_${c}`])
80
+ ...dataCollections.flatMap((c) => [`_blob_slots_${c}`, `_blob_versions_${c}`])
91
81
  ];
82
+ }
83
+ async function dumpVault(ctx) {
84
+ const snapshot = await ctx.adapter.loadAll(ctx.vault);
85
+ const keyringIds = await ctx.adapter.list(ctx.vault, "_keyring");
86
+ const keyrings = {};
87
+ for (const keyringId of keyringIds) {
88
+ const envelope = await ctx.adapter.get(ctx.vault, "_keyring", keyringId);
89
+ if (envelope) {
90
+ keyrings[keyringId] = JSON.parse(envelope._data ?? "");
91
+ }
92
+ }
93
+ const internalSnapshot = {};
94
+ const internalNames = internalCollectionNames(Object.keys(snapshot));
92
95
  for (const internalName of internalNames) {
93
96
  const ids = await ctx.adapter.list(ctx.vault, internalName);
94
97
  if (ids.length === 0) continue;
@@ -119,9 +122,52 @@ async function dumpVault(ctx) {
119
122
  };
120
123
  return JSON.stringify(backup);
121
124
  }
122
- async function loadVault(ctx, backupJson) {
125
+ async function reconcileCollection(ctx, collection, podRows) {
126
+ let written = 0, skipped = 0, deleted = 0;
127
+ for (const [id, envelope] of Object.entries(podRows)) {
128
+ const local = await ctx.adapter.get(ctx.vault, collection, id);
129
+ if (local && local._v === envelope._v) {
130
+ skipped++;
131
+ continue;
132
+ }
133
+ await ctx.adapter.put(ctx.vault, collection, id, envelope);
134
+ written++;
135
+ }
136
+ for (const id of await ctx.adapter.list(ctx.vault, collection)) {
137
+ if (id in podRows) continue;
138
+ await ctx.adapter.delete(ctx.vault, collection, id);
139
+ deleted++;
140
+ }
141
+ return { written, skipped, deleted };
142
+ }
143
+ function podReport(mode, per) {
144
+ let written = 0, skipped = 0, deleted = 0;
145
+ for (const r of Object.values(per)) {
146
+ written += r.written;
147
+ skipped += r.skipped;
148
+ deleted += r.deleted;
149
+ }
150
+ return { mode, written, skipped, deleted, collections: per };
151
+ }
152
+ async function loadVault(ctx, backupJson, options) {
123
153
  const backup = JSON.parse(backupJson);
124
- await ctx.adapter.saveAll(ctx.vault, backup.collections);
154
+ const mode = options?.mode ?? "replace";
155
+ const per = {};
156
+ if (mode === "incremental" && backup._compartment !== ctx.vault) {
157
+ throw new BackupLedgerError(
158
+ `Incremental load refused: this pod was taken from vault "${backup._compartment}" and is being loaded into "${ctx.vault}". Incremental mode reconciles a vault against its OWN pod; use mode: 'replace' to overwrite this vault with a foreign pod.`
159
+ );
160
+ }
161
+ if (mode === "incremental") {
162
+ const localData = await ctx.adapter.loadAll(ctx.vault);
163
+ const names = /* @__PURE__ */ new Set([...Object.keys(backup.collections), ...Object.keys(localData)]);
164
+ for (const name of names) {
165
+ const r = await reconcileCollection(ctx, name, backup.collections[name] ?? {});
166
+ if (r.written || r.skipped || r.deleted) per[name] = r;
167
+ }
168
+ } else {
169
+ await ctx.adapter.saveAll(ctx.vault, backup.collections);
170
+ }
125
171
  for (const [userId, keyringFile] of Object.entries(backup.keyrings)) {
126
172
  const envelope = buildRecordEnvelope(
127
173
  { collection: "_keyring", id: userId, version: 1 },
@@ -129,16 +175,30 @@ async function loadVault(ctx, backupJson) {
129
175
  );
130
176
  await ctx.adapter.put(ctx.vault, "_keyring", userId, envelope);
131
177
  }
132
- if (backup._internal) {
133
- for (const [internalName, records] of Object.entries(backup._internal)) {
134
- for (const [id, envelope] of Object.entries(records)) {
135
- await ctx.adapter.put(ctx.vault, internalName, id, envelope);
178
+ const internalNamesToLoad = internalCollectionNames(Object.keys(backup.collections));
179
+ if (mode === "incremental") {
180
+ for (const internalName of internalNamesToLoad) {
181
+ const r = await reconcileCollection(ctx, internalName, backup._internal?.[internalName] ?? {});
182
+ if (r.written || r.skipped || r.deleted) per[internalName] = r;
183
+ }
184
+ } else {
185
+ for (const internalName of internalNamesToLoad) {
186
+ for (const id of await ctx.adapter.list(ctx.vault, internalName)) {
187
+ await ctx.adapter.delete(ctx.vault, internalName, id);
188
+ }
189
+ }
190
+ if (backup._internal) {
191
+ for (const [internalName, records] of Object.entries(backup._internal)) {
192
+ for (const [id, envelope] of Object.entries(records)) {
193
+ await ctx.adapter.put(ctx.vault, internalName, id, envelope);
194
+ }
136
195
  }
137
196
  }
138
197
  }
139
198
  await ctx.reloadKeyringAndRebuildDEK();
140
199
  ctx.clearCollectionCache();
141
200
  ctx.resetLedgerStore();
201
+ await ctx.resetSync?.();
142
202
  if (!backup.ledgerHead) {
143
203
  if (ctx.getLedgerOrNull()) {
144
204
  console.warn(
@@ -149,7 +209,7 @@ async function loadVault(ctx, backupJson) {
149
209
  `[noy-db] Loaded a backup with no ledgerHead \u2014 this pod is not integrity-checked. This reader has no ledger enabled (withHistory() is not configured), so nothing is stale: enable the ledger on both the exporter and this reader if tamper detection is wanted.`
150
210
  );
151
211
  }
152
- return;
212
+ return podReport(mode, per);
153
213
  }
154
214
  const result = await verifyBackupIntegrity(ctx);
155
215
  if (!result.ok) {
@@ -167,6 +227,7 @@ async function loadVault(ctx, backupJson) {
167
227
  `Backup ledger head mismatch: embedded "${backup.ledgerHead.hash}" but reconstructed "${result.head}".`
168
228
  );
169
229
  }
230
+ return podReport(mode, per);
170
231
  }
171
232
  async function verifyBackupIntegrity(ctx) {
172
233
  const ledgerForVerify = ctx.getLedgerOrNull();
@@ -266,4 +327,4 @@ export {
266
327
  loadVault,
267
328
  verifyBackupIntegrity
268
329
  };
269
- //# sourceMappingURL=backup-7RKNZMQO.js.map
330
+ //# sourceMappingURL=backup-E3GBMNDA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-pod/backup.ts"],"sourcesContent":["/**\n * Vault backup / restore / integrity.\n *\n * Holds `dump()` (verifiable encrypted JSON backup, including the blob\n * collections so blob \"covers\" travel in the bundle), `load()` (restore +\n * post-load integrity gate), `verifyBackupIntegrity()` (chain + data-envelope\n * cross-check), and `exportJSON()` (plaintext per-collection export, built on\n * the vault's `exportStream`). Behaviour is byte-identical to the inline\n * `Vault` methods these functions replaced — every dependency the moving code\n * touched on `this.*` arrives via {@link BackupContext}. `Vault` keeps the\n * public methods as thin delegators.\n *\n * Internal — reached through `vault.dump()` / `vault.load()` / etc.\n */\nimport { NOYDB_BACKUP_VERSION } from '../kernel/types.js'\nimport { BackupLedgerError, BackupCorruptedError } from '../kernel/errors.js'\nimport { LEDGER_COLLECTION, LEDGER_DELTAS_COLLECTION } from '../with-commit/history/ledger/constants.js'\nimport { SCHEMAS_COLLECTION } from '../with-shape/persisted-schemas/storage.js'\nimport { SEQUENCE_COLLECTION } from '../with-commit/sequence/index.js'\nimport { MANIFEST_COLLECTION } from '../with-shape/manifest/reserved-collections.js'\n// #1025 — imported from the dependency-light `window.ts`, not `periods.ts`: that\n// module exists precisely so a consumer can name the period collections without\n// dragging the ledger hash-chain machinery (`sha256Hex`/`canonicalJson`) into a\n// bundle that opted out of the periods service. Same reason the sync engine's\n// period-scoped pull imports it.\nimport {\n PERIODS_COLLECTION,\n PERIOD_FREEZES_COLLECTION,\n PERIOD_ARCHIVES_COLLECTION,\n PERIOD_TARGET_PURGES_COLLECTION,\n PERIOD_REOPENS_COLLECTION,\n} from '../with-audit/periods/window.js'\nimport type {\n NoydbStore,\n EncryptedEnvelope,\n VaultBackup,\n VaultSnapshot,\n LoadPodOptions,\n LoadPodResult,\n ExportStreamOptions,\n ExportChunk,\n} from '../kernel/types.js'\nimport type { LedgerStore } from '../with-commit/history/ledger/store.js'\nimport { buildRecordEnvelope } from '../capsule/index.js'\n\n/** Everything the moving backup methods touched on the vault's `this.*`. */\nexport interface BackupContext {\n /** The ciphertext store. */\n readonly adapter: NoydbStore\n /** Vault namespace name. */\n readonly vault: string\n /** The invoking keyring's user id (read fresh per call). */\n userId(): string\n /** The vault's ledger store, or null when history is off. */\n getLedgerOrNull(): LedgerStore | null\n /** Recompute an envelope's `payloadHash` (bound `historyStrategy.envelopePayloadHash`). */\n envelopePayloadHash(envelope: EncryptedEnvelope): Promise<string>\n /**\n * Refresh the in-memory keyring from the freshly-loaded keyring file and\n * rebuild the DEK resolver. No-op when the vault has no `reloadKeyring`\n * callback (plaintext vaults / test constructions).\n */\n reloadKeyringAndRebuildDEK(): Promise<void>\n /**\n * core#71 — reset every sync engine attached to the vault after a restore:\n * the dirty log, the watermarks, the adopted epoch. A restore is a new base;\n * the pre-restore dirty entries refer to records the load just replaced.\n * Absent on test constructions without sync.\n */\n resetSync?(): Promise<void>\n /** Clear the vault's collection cache (post-load). */\n clearCollectionCache(): void\n /** Reset the ledger store so the next `ledger()` rebuilds its head cache. */\n resetLedgerStore(): void\n /** The vault's decrypt+ACL export stream (used by `exportJSON`). */\n exportStream(opts: ExportStreamOptions): AsyncIterableIterator<ExportChunk>\n}\n\n/** Result of {@link verifyBackupIntegrity}. */\nexport type VerifyBackupResult =\n | { readonly ok: true; readonly head: string; readonly length: number }\n | {\n readonly ok: false\n readonly kind: 'chain'\n readonly divergedAt: number\n readonly message: string\n }\n | {\n readonly ok: false\n readonly kind: 'data'\n readonly collection: string\n readonly id: string\n readonly message: string\n }\n\n/**\n * Dump vault as a verifiable encrypted JSON backup string.\n *\n * backups embed the current ledger head and the full `_ledger` +\n * `_ledger_deltas` internal collections so the receiver can run\n * `verifyBackupIntegrity()` after `load()` and detect any tampering between\n * dump and restore. Backups produced without a ledger skip the integrity check\n * with a warning — both modes round-trip cleanly.\n */\n/**\n * core#111 — the internal collections a pod carries, derived from its DATA\n * collection names. ⭐ ONE definition, used by the dump AND by the load's\n * clear step: they must agree or a restore leaves rows behind that the pod\n * says should not exist.\n *\n * ⛔ The load side CANNOT just clear what the pod carries. The dump skips a\n * collection with no rows (`if (ids.length === 0) continue`), so a pod taken\n * while `_periods` was empty does not mention `_periods` at all — and a store\n * that has since closed a period would keep those rows through a restore.\n * Absence in a pod means \"empty at dump time\", never \"leave whatever is there\".\n */\nfunction internalCollectionNames(dataCollections: readonly string[]): string[] {\n return [\n LEDGER_COLLECTION, LEDGER_DELTAS_COLLECTION, SCHEMAS_COLLECTION, SEQUENCE_COLLECTION,\n MANIFEST_COLLECTION, // #941: the pod's manifest-set record(s) travel in the bundle too\n // #1025: the accounting-period close state + its companions. The bundle is\n // the backup/restore path, so without these a restore discarded the\n // hash-chained evidence that a month was ever closed — the artifact\n // `closePeriod` exists to produce — and dropped the write gate with it, so\n // the restored vault silently accepted back-dated writes into a sealed\n // month. The companions matter as much as the close: a bounded reopen\n // window (`reopenPeriod({ until })`) is state a restore must not lose.\n PERIODS_COLLECTION,\n PERIOD_REOPENS_COLLECTION,\n PERIOD_FREEZES_COLLECTION,\n PERIOD_ARCHIVES_COLLECTION,\n PERIOD_TARGET_PURGES_COLLECTION,\n '_history', // full-snapshot version history — so history()/getVersion()/diff() survive the bundle\n '_blob_index', '_blob_chunks', '_blob_eviction_audit',\n // #753 spec §7 Q3: `_blob_intent` markers travel too — restoring mid-op\n // state (a blob row without its marker) would reproduce the ambiguity\n // the journal exists to prevent. Note: `_mv_stale` does NOT travel\n // today (a pre-existing, separate gap) — observed here, tracked on\n // #761, not fixed in this pass.\n '_blob_intent',\n // #769: `_blob_slots_<c>` envelopes travel verbatim (raw ciphertext,\n // same DEK, same vault) — including any `SlotRecord.pendingRelease`\n // resume breadcrumb they carry. This is INTENTIONALLY the opposite of\n // `extract-partition`'s `reKeyBlobs`, which STRIPS `pendingRelease`:\n // a full-vault backup restores into the SAME vault it was taken from,\n // so a breadcrumb taken mid-rehome (together with its `_blob_intent`\n // marker, carried above) is resumable on restore — carry-and-resume is\n // correct here. A partition extraction crosses vaults: the breadcrumb's\n // old eTag may not exist in the destination, so it must be stripped\n // there instead. Asymmetry: backup = same-vault-resumable = carry;\n // partition = cross-vault = strip-breadcrumb-carry-marker.\n ...dataCollections.flatMap((c) => [`_blob_slots_${c}`, `_blob_versions_${c}`]),\n ]\n}\n\nexport async function dumpVault(ctx: BackupContext): Promise<string> {\n const snapshot = await ctx.adapter.loadAll(ctx.vault)\n\n // Load keyrings (separate path because loadAll filters them out\n // along with all other underscore-prefixed internal collections).\n const keyringIds = await ctx.adapter.list(ctx.vault, '_keyring')\n const keyrings: Record<string, unknown> = {}\n for (const keyringId of keyringIds) {\n const envelope = await ctx.adapter.get(ctx.vault, '_keyring', keyringId)\n if (envelope) {\n keyrings[keyringId] = JSON.parse(envelope._data ?? '')\n }\n }\n\n // Load the ledger entries + deltas so the receiver can replay\n // the chain after restore. Without this, `load()` would have an\n // empty ledger and `verifyBackupIntegrity()` would have nothing\n // to compare against.\n //\n // Also enumerate the blob collections so blob content (\"covers\")\n // travels in the bundle (the blob DEK already travels in `_keyring`).\n // Literals are inlined (not imported from blobs/blob-set.ts) to keep\n // the blob runtime out of this kernel hot path — they mirror\n // BLOB_INDEX/CHUNKS/EVICTION_AUDIT_COLLECTION and SLOTS/VERSIONS_PREFIX.\n // The collect-loop skips empty ids, so this no-ops without blobs.\n const internalSnapshot: VaultSnapshot = {}\n const internalNames = internalCollectionNames(Object.keys(snapshot))\n for (const internalName of internalNames) {\n const ids = await ctx.adapter.list(ctx.vault, internalName)\n if (ids.length === 0) continue\n const records: Record<string, EncryptedEnvelope> = {}\n for (const id of ids) {\n const envelope = await ctx.adapter.get(ctx.vault, internalName, id)\n if (envelope) records[id] = envelope\n }\n internalSnapshot[internalName] = records\n }\n\n // Embed the ledger head if there's a chain. An empty ledger\n // (fresh vault) leaves `ledgerHead` undefined, which\n // load() treats the same as a legacy backup (no integrity\n // check, console warning). If history is not opted in,\n // `getLedgerOrNull` returns null and we skip embedding entirely\n // — the backup is still valid, just without the integrity head.\n const ledgerForHead = ctx.getLedgerOrNull()\n const head = ledgerForHead ? await ledgerForHead.head() : null\n const backup: VaultBackup = {\n _noydb_backup: NOYDB_BACKUP_VERSION,\n _compartment: ctx.vault,\n _exported_at: new Date().toISOString(),\n _exported_by: ctx.userId(),\n keyrings: keyrings as VaultBackup['keyrings'],\n collections: snapshot,\n ...(Object.keys(internalSnapshot).length > 0\n ? { _internal: internalSnapshot }\n : {}),\n ...(head\n ? {\n ledgerHead: {\n hash: head.hash,\n index: head.entry.index,\n ts: head.entry.ts,\n },\n }\n : {}),\n }\n\n return JSON.stringify(backup)\n}\n\n/**\n * Restore a vault from a verifiable backup. After loading, runs\n * `verifyBackupIntegrity()` to confirm the hash chain, the embedded head, and\n * every data envelope's payload hash. Legacy backups (no `ledgerHead`) load\n * with a console warning and skip the integrity check.\n */\n/**\n * core#77 — reconcile ONE collection against the pod's rows: write what\n * differs, delete what the pod does not carry, leave the rest untouched.\n *\n * Identity is `(id, _v)`, not a content hash — chunk rows are not\n * content-addressed today. That is enough to avoid rewriting 10 GB that has\n * not changed; it is NOT enough to dedupe across records, and nothing here\n * claims otherwise.\n *\n * ⛔ The DELETE half is what keeps this a restore rather than a merge: an id\n * the store holds and the pod does not is removed, exactly as `saveAll`\n * removes it in replace mode (core#111 — a restore rewinds).\n */\nasync function reconcileCollection(\n ctx: BackupContext,\n collection: string,\n podRows: Record<string, EncryptedEnvelope>,\n): Promise<{ written: number; skipped: number; deleted: number }> {\n let written = 0, skipped = 0, deleted = 0\n for (const [id, envelope] of Object.entries(podRows)) {\n const local = await ctx.adapter.get(ctx.vault, collection, id)\n if (local && local._v === envelope._v) { skipped++; continue }\n await ctx.adapter.put(ctx.vault, collection, id, envelope)\n written++\n }\n for (const id of await ctx.adapter.list(ctx.vault, collection)) {\n if (id in podRows) continue\n await ctx.adapter.delete(ctx.vault, collection, id)\n deleted++\n }\n return { written, skipped, deleted }\n}\n\n/** Fold the per-collection counters into the returned report. */\nfunction podReport(mode: 'replace' | 'incremental', per: Record<string, { written: number; skipped: number; deleted: number }>): LoadPodResult {\n let written = 0, skipped = 0, deleted = 0\n for (const r of Object.values(per)) { written += r.written; skipped += r.skipped; deleted += r.deleted }\n return { mode, written, skipped, deleted, collections: per }\n}\n\nexport async function loadVault(\n ctx: BackupContext,\n backupJson: string,\n options?: LoadPodOptions,\n): Promise<LoadPodResult> {\n const backup = JSON.parse(backupJson) as VaultBackup\n const mode = options?.mode ?? 'replace'\n const per: Record<string, { written: number; skipped: number; deleted: number }> = {}\n\n // core#77 — a pod from ANOTHER vault is refused in incremental mode. In\n // replace mode `saveAll` overwrites wholesale and the result is at least\n // coherent; \"write only the differences\" between unrelated vaults is not a\n // restore, it is a silent union of two histories, and the keyrings that\n // arrive with it would not open what is already here.\n if (mode === 'incremental' && backup._compartment !== ctx.vault) {\n throw new BackupLedgerError(\n `Incremental load refused: this pod was taken from vault \"${backup._compartment}\" ` +\n `and is being loaded into \"${ctx.vault}\". Incremental mode reconciles a vault against ` +\n `its OWN pod; use mode: 'replace' to overwrite this vault with a foreign pod.`,\n )\n }\n\n // 1. Restore data collections.\n if (mode === 'incremental') {\n const localData = await ctx.adapter.loadAll(ctx.vault)\n const names = new Set([...Object.keys(backup.collections), ...Object.keys(localData)])\n for (const name of names) {\n const r = await reconcileCollection(ctx, name, backup.collections[name] ?? {})\n if (r.written || r.skipped || r.deleted) per[name] = r\n }\n } else {\n await ctx.adapter.saveAll(ctx.vault, backup.collections)\n }\n\n // 2. Restore keyrings.\n for (const [userId, keyringFile] of Object.entries(backup.keyrings)) {\n // ⛔ core#132 — NO CAS HERE, deliberately. A pod restore is state\n // REPLACEMENT (core#111 made the internal collections wholesale too): the\n // pod is authoritative and there is no \"version this was based on\" to\n // compare against. CASing a restore would make it fail precisely when the\n // store has drifted, which is the case it exists to fix.\n const envelope = buildRecordEnvelope({ collection: '_keyring', id: userId, version: 1 },\n { iv: '', data: JSON.stringify(keyringFile) })\n await ctx.adapter.put(ctx.vault, '_keyring', userId, envelope)\n }\n\n // 3. Restore internal collections (`_ledger`, `_ledger_deltas`, history,\n // periods, blobs). Required so verifyBackupIntegrity has the chain to walk.\n //\n // ⛔⛔ CLEAR FIRST (core#111). This used to `put` the pod's rows id by id and\n // leave everything else, so entries written AFTER the pod survived the\n // restore. With history on that is not a cosmetic leftover: the ledger chain\n // still named `notes/n2`, whose envelope `saveAll` had just removed, and the\n // integrity check refused the restore outright —\n // BackupCorruptedError: Ledger expects data record \"notes/n2\" to exist …\n // which made restoring an OLDER pod possible only onto a store whose ledger\n // had not moved. That is never the case that matters: a restore is a step\n // BACK (core#71/#72).\n //\n // ⭐ A restore rewinds the ledger too, and now says so. The internal\n // collections are replaced wholesale, the way `saveAll` already treats the\n // data ones — anything else asks the chain to describe a store it does not\n // match. The names come from `internalCollectionNames`, NOT from the pod's\n // own keys: see the ⛔ on that function for why absence in a pod cannot mean\n // \"leave it alone\".\n //\n // ⚠️ Known residue, deliberately not chased here: `_blob_slots_<c>` /\n // `_blob_versions_<c>` for a DATA collection the pod does not carry are not\n // cleared, because the names are derived from the pod's collections and the\n // store contract has no way to enumerate `_`-prefixed collections\n // (`loadAll` skips them). Those rows are already orphaned — `saveAll` has\n // just removed the collection they describe — so they are unreachable\n // rather than misleading.\n //\n // core#77 — in INCREMENTAL mode the same names are reconciled instead of\n // cleared and rewritten. ⭐ This is the half that matters for the 10 GB\n // case: `_blob_chunks` is an internal collection, so a clear-and-rewrite\n // here would re-upload every chunk and leave \"incremental\" saving only the\n // record envelopes. Reconciling reaches the SAME end state — extras are\n // still deleted, so the restore still rewinds — at a cost proportional to\n // what actually differs.\n const internalNamesToLoad = internalCollectionNames(Object.keys(backup.collections))\n if (mode === 'incremental') {\n for (const internalName of internalNamesToLoad) {\n const r = await reconcileCollection(ctx, internalName, backup._internal?.[internalName] ?? {})\n if (r.written || r.skipped || r.deleted) per[internalName] = r\n }\n } else {\n for (const internalName of internalNamesToLoad) {\n for (const id of await ctx.adapter.list(ctx.vault, internalName)) {\n await ctx.adapter.delete(ctx.vault, internalName, id)\n }\n }\n if (backup._internal) {\n for (const [internalName, records] of Object.entries(backup._internal)) {\n for (const [id, envelope] of Object.entries(records)) {\n await ctx.adapter.put(ctx.vault, internalName, id, envelope)\n }\n }\n }\n }\n\n // 4. Refresh the in-memory keyring from the freshly-loaded\n // keyring file. Without this, the Vault's getDEK\n // closure still holds the OLD session's DEKs, and every\n // decrypt of a loaded ledger entry / data envelope fails\n // with TamperedError because the DEK doesn't match the\n // ciphertext that was encrypted with the SOURCE user's DEK.\n // Skipped for plaintext vaults and for tests that\n // construct Vault without a reloadKeyring callback.\n await ctx.reloadKeyringAndRebuildDEK()\n\n // 5. Clear collection cache + reset the ledger store so the\n // next ledger() call rebuilds its head cache from the\n // freshly-loaded entries.\n ctx.clearCollectionCache()\n ctx.resetLedgerStore()\n\n // 6. core#71 — a restore is a new base for sync: the pre-restore dirty log\n // named records the load replaced, and the watermarks described a state\n // that is gone. `replaceRemote` (core#72) is the explicit act that makes\n // the restore authoritative on the target; without it, `load()` stays a\n // local view — and now says so in `syncTargetStatus()` instead of pushing\n // stale entries.\n await ctx.resetSync?.()\n\n // 5. Run the verification gate. A backup with no ledgerHead cannot be\n // integrity-checked, and skipping silently would collapse\n // *unverifiable* into *clean* — so it always warns. But the REMEDY\n // depends on the reader, not the pod (#1303): the pod cannot say\n // whether its exporter predates the ledger or never enabled it, and\n // the reader knows its own configuration.\n //\n // - Reader HAS the ledger: the pod is behind it. \"Re-export\" is\n // actionable; keep the migration wording.\n // - Reader has NO ledger: nothing is stale and nothing is migrating —\n // the consumer priced the ledger (#1248 measured ~2.4x) and declined.\n // Prescribing a re-export is advice they should not take, and\n // repeating it on every read trains people to filter the one line\n // that also fires on a genuinely stale pod. State the consequence,\n // name the discriminator, prescribe nothing.\n if (!backup.ledgerHead) {\n if (ctx.getLedgerOrNull()) {\n console.warn(\n `[noy-db] Loaded a legacy backup with no ledgerHead — ` +\n `verifiable-backup integrity check skipped. ` +\n `Re-export with a ledger-aware build to get tamper detection.`,\n )\n } else {\n console.warn(\n `[noy-db] Loaded a backup with no ledgerHead — this pod is not integrity-checked. ` +\n `This reader has no ledger enabled (withHistory() is not configured), so nothing is stale: ` +\n `enable the ledger on both the exporter and this reader if tamper detection is wanted.`,\n )\n }\n return podReport(mode, per)\n }\n\n const result = await verifyBackupIntegrity(ctx)\n if (!result.ok) {\n // Surface the most specific error class we can. The result\n // shape carries enough info for callers to inspect.\n if (result.kind === 'data') {\n throw new BackupCorruptedError(\n result.collection,\n result.id,\n result.message,\n )\n }\n throw new BackupLedgerError(result.message, result.divergedAt)\n }\n\n // 6. Cross-check: the freshly-verified head must match the\n // value embedded at dump time. A mismatch means someone\n // truncated or extended the chain after dump.\n if (result.head !== backup.ledgerHead.hash) {\n throw new BackupLedgerError(\n `Backup ledger head mismatch: embedded \"${backup.ledgerHead.hash}\" ` +\n `but reconstructed \"${result.head}\".`,\n )\n }\n return podReport(mode, per)\n}\n\n/**\n * End-to-end backup integrity check: `ledger.verify()` (hash chain) plus a data\n * envelope cross-check (every current record's `_data` hash must match the\n * latest `put` entry's `payloadHash`). Returns a discriminated union so callers\n * can distinguish chain vs data failures.\n */\nexport async function verifyBackupIntegrity(ctx: BackupContext): Promise<VerifyBackupResult> {\n // Step 1: chain verification. Without the history strategy there\n // is no ledger; an unaudited backup verifies trivially as `ok`\n // because there's nothing to diverge from.\n const ledgerForVerify = ctx.getLedgerOrNull()\n if (!ledgerForVerify) {\n return { ok: true, head: '', length: 0 }\n }\n const chainResult = await ledgerForVerify.verify()\n if (!chainResult.ok) {\n return {\n ok: false,\n kind: 'chain',\n divergedAt: chainResult.divergedAt,\n message:\n `Ledger chain diverged at index ${chainResult.divergedAt}: ` +\n `expected prevHash \"${chainResult.expected}\" but found \"${chainResult.actual}\".`,\n }\n }\n\n // Step 2: data envelope cross-check. Walk every entry in the\n // ledger and, for the LATEST `put` per (collection, id), recompute\n // the data envelope's payloadHash and compare. Earlier puts of the\n // same id are skipped because the data collection only holds the\n // current version — historical envelopes live in the deltas\n // collection (which is itself protected by the chain).\n // Reuse the ledger we already resolved in step 1.\n const allEntries = await ledgerForVerify.loadAllEntries()\n\n // Find the latest non-delete entry per (collection, id). Walk\n // the entries in reverse so we hit the latest first; mark each\n // (collection, id) as seen and skip subsequent entries.\n const seen = new Set<string>()\n const latest = new Map<\n string,\n { collection: string; id: string; expectedHash: string }\n >()\n for (let i = allEntries.length - 1; i >= 0; i--) {\n const entry = allEntries[i]\n if (!entry) continue\n // Amendment entries are multi-record audit entries whose\n // `collection` and `id` are empty strings — building a `\"/\"`\n // key here would mark that synthetic slot as seen and falsely\n // trip the data check on a record that never existed. Skip\n // them BEFORE the key/seen bookkeeping so they neither\n // tombstone real entries nor enter the latest map.\n if (entry.op === 'amendment' || entry.op === 'lifecycle') continue\n const key = `${entry.collection}/${entry.id}`\n if (seen.has(key)) continue\n seen.add(key)\n // For deletes the data collection should NOT have the record,\n // so we skip — there's nothing to cross-check. Marking the key\n // as seen above ensures any earlier `put` of the same id is\n // also skipped (the record was subsequently deleted).\n if (entry.op === 'delete') continue\n latest.set(key, {\n collection: entry.collection,\n id: entry.id,\n expectedHash: entry.payloadHash,\n })\n }\n\n for (const { collection, id, expectedHash } of latest.values()) {\n const envelope = await ctx.adapter.get(ctx.vault, collection, id)\n if (!envelope) {\n return {\n ok: false,\n kind: 'data',\n collection,\n id,\n message:\n `Ledger expects data record \"${collection}/${id}\" to exist, ` +\n `but the adapter has no envelope for it.`,\n }\n }\n const actualHash = await ctx.envelopePayloadHash(envelope)\n if (actualHash !== expectedHash) {\n return {\n ok: false,\n kind: 'data',\n collection,\n id,\n message:\n `Data envelope \"${collection}/${id}\" has been tampered with: ` +\n `expected payloadHash \"${expectedHash}\", got \"${actualHash}\".`,\n }\n }\n }\n\n return {\n ok: true,\n head: chainResult.head,\n length: chainResult.length,\n }\n}\n\n/**\n * Plaintext per-collection export, built on the vault's `exportStream`. Forces\n * collection granularity (record-by-record output makes no sense in a single\n * string) and merges dictionary snapshots across collections.\n */\nexport async function exportVaultJSON(ctx: BackupContext, opts: ExportStreamOptions = {}): Promise<string> {\n // Force per-collection granularity regardless of caller setting:\n // record-by-record output doesn't make sense in a single string.\n const collections: Record<\n string,\n {\n schema: null\n refs: Record<string, { target: string; mode: 'strict' | 'warn' | 'cascade' }>\n records: unknown[]\n }\n > = {}\n let ledgerHead: ExportChunk['ledgerHead'] | undefined\n // Merged dictionary snapshot across all collections.\n // Only populated when `resolveLabels` is not set.\n const allDictionaries: Record<\n string, // collection name\n Record<string, Record<string, Record<string, string>>>\n > = {}\n\n for await (const chunk of ctx.exportStream({\n granularity: 'collection',\n withLedgerHead: opts.withLedgerHead === true,\n // Thread the export locale so records are read at the\n // `export` layer (i18nText collapsed + dictKey/staticDict labels resolved).\n ...(opts.resolveLabels !== undefined ? { resolveLabels: opts.resolveLabels } : {}),\n })) {\n collections[chunk.collection] = {\n schema: null, // Standard Schema validators are not JSON-serializable\n refs: chunk.refs,\n records: chunk.records,\n }\n if (chunk.ledgerHead) ledgerHead = chunk.ledgerHead\n // Collect dictionary snapshots unless resolveLabels is set\n if (!opts.resolveLabels && chunk.dictionaries) {\n allDictionaries[chunk.collection] = chunk.dictionaries\n }\n }\n\n const hasDictionaries = Object.keys(allDictionaries).length > 0\n return JSON.stringify({\n _noydb_export: 1,\n _compartment: ctx.vault,\n _exported_at: new Date().toISOString(),\n _exported_by: ctx.userId(),\n collections,\n ...(hasDictionaries ? { _dictionaries: allDictionaries } : {}),\n ...(ledgerHead ? { ledgerHead } : {}),\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHA,SAAS,wBAAwB,iBAA8C;AAC7E,SAAO;AAAA,IACL;AAAA,IAAmB;AAAA,IAA0B;AAAA,IAAoB;AAAA,IACjE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IACA;AAAA,IAAe;AAAA,IAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM/B;AAAA;AAAA;AAAA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,UAAU,IAAI,EAAE,mDACT,YAAY,WAAW,UAAU;AAAA,MAC9D;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,MAAM,YAAY;AAAA,IAClB,QAAQ,YAAY;AAAA,EACtB;AACF;AAOA,eAAsB,gBAAgB,KAAoB,OAA4B,CAAC,GAAoB;AAGzG,QAAM,cAOF,CAAC;AACL,MAAI;AAGJ,QAAM,kBAGF,CAAC;AAEL,mBAAiB,SAAS,IAAI,aAAa;AAAA,IACzC,aAAa;AAAA,IACb,gBAAgB,KAAK,mBAAmB;AAAA;AAAA;AAAA,IAGxC,GAAI,KAAK,kBAAkB,SAAY,EAAE,eAAe,KAAK,cAAc,IAAI,CAAC;AAAA,EAClF,CAAC,GAAG;AACF,gBAAY,MAAM,UAAU,IAAI;AAAA,MAC9B,QAAQ;AAAA;AAAA,MACR,MAAM,MAAM;AAAA,MACZ,SAAS,MAAM;AAAA,IACjB;AACA,QAAI,MAAM,WAAY,cAAa,MAAM;AAEzC,QAAI,CAAC,KAAK,iBAAiB,MAAM,cAAc;AAC7C,sBAAgB,MAAM,UAAU,IAAI,MAAM;AAAA,IAC5C;AAAA,EACF;AAEA,QAAM,kBAAkB,OAAO,KAAK,eAAe,EAAE,SAAS;AAC9D,SAAO,KAAK,UAAU;AAAA,IACpB,eAAe;AAAA,IACf,cAAc,IAAI;AAAA,IAClB,eAAc,oBAAI,KAAK,GAAE,YAAY;AAAA,IACrC,cAAc,IAAI,OAAO;AAAA,IACzB;AAAA,IACA,GAAI,kBAAkB,EAAE,eAAe,gBAAgB,IAAI,CAAC;AAAA,IAC5D,GAAI,aAAa,EAAE,WAAW,IAAI,CAAC;AAAA,EACrC,CAAC;AACH;","names":[]}
@@ -10,7 +10,7 @@ import {
10
10
  createExportBlobsHandle,
11
11
  reportOrphanBlobChunks,
12
12
  runCompaction
13
- } from "../chunk-G5EDYVSE.js";
13
+ } from "../chunk-ZK2WT532.js";
14
14
  import {
15
15
  BLOB_CHUNKS_COLLECTION,
16
16
  BLOB_COLLECTION,
@@ -25,20 +25,20 @@ import {
25
25
  detectMimeType,
26
26
  isPreCompressed,
27
27
  memoryBlobPinStore
28
- } from "../chunk-QXJXG7DN.js";
29
- import "../chunk-PTJY5R3O.js";
30
- import "../chunk-UHFGK6YA.js";
31
- import "../chunk-RIZTZJX6.js";
32
- import "../chunk-4J3MNVVX.js";
33
- import "../chunk-ZBUAX4EF.js";
34
- import "../chunk-SPPOUJLN.js";
28
+ } from "../chunk-7IV7GVOS.js";
29
+ import "../chunk-PIO6NW7O.js";
30
+ import "../chunk-XQGKS4OW.js";
31
+ import "../chunk-LJ744WXU.js";
32
+ import "../chunk-WRLWEYHY.js";
33
+ import "../chunk-O6VOR4NH.js";
34
+ import "../chunk-VZFTON37.js";
35
35
  import "../chunk-NH2UOV3B.js";
36
- import "../chunk-OM3SEDI4.js";
37
- import "../chunk-PUBI455O.js";
38
- import "../chunk-2ELOCEXE.js";
36
+ import "../chunk-HTRLQ4ZZ.js";
37
+ import "../chunk-EPPAEGH5.js";
38
+ import "../chunk-URGHKZPL.js";
39
39
  import {
40
40
  BlobOfflineError
41
- } from "../chunk-VSUQI5Q6.js";
41
+ } from "../chunk-2RH5SEY7.js";
42
42
 
43
43
  // src/via/blob/active.ts
44
44
  function withBlobs(options = {}) {
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  NO_BROKER
3
- } from "../chunk-72XBVN4J.js";
3
+ } from "../chunk-FVKQ5QUC.js";
4
4
  import {
5
5
  issueChallenge,
6
6
  verifyBrokerProof
7
- } from "../chunk-4J3MNVVX.js";
8
- import "../chunk-ZBUAX4EF.js";
9
- import "../chunk-SPPOUJLN.js";
7
+ } from "../chunk-WRLWEYHY.js";
8
+ import "../chunk-O6VOR4NH.js";
9
+ import "../chunk-VZFTON37.js";
10
10
  import "../chunk-NH2UOV3B.js";
11
- import "../chunk-OM3SEDI4.js";
12
- import "../chunk-PUBI455O.js";
13
- import "../chunk-2ELOCEXE.js";
11
+ import "../chunk-HTRLQ4ZZ.js";
12
+ import "../chunk-EPPAEGH5.js";
13
+ import "../chunk-URGHKZPL.js";
14
14
  import {
15
15
  BrokerEnrolmentError,
16
16
  BrokerNotEnabledError,
17
17
  BrokerProofError
18
- } from "../chunk-VSUQI5Q6.js";
18
+ } from "../chunk-2RH5SEY7.js";
19
19
 
20
20
  // src/with-party/broker/active.ts
21
21
  var DEFAULT_SKEW_MS = 6e4;
@@ -28,7 +28,7 @@ function withBroker(config) {
28
28
  const cache = /* @__PURE__ */ new Map();
29
29
  return {
30
30
  async enroll(ctx) {
31
- const { enrollSeed } = await import("../seed-JMQTRKRE.js");
31
+ const { enrollSeed } = await import("../seed-BVYDPVIW.js");
32
32
  return enrollSeed({ ...ctx, config });
33
33
  },
34
34
  async rotate(ctx) {
@@ -37,15 +37,15 @@ function withBroker(config) {
37
37
  const inFlight = scoped.map(([, e]) => e.inFlight).filter((p) => p !== void 0);
38
38
  await Promise.allSettled(inFlight);
39
39
  for (const [key] of scoped) cache.delete(key);
40
- const { rotateSeed } = await import("../seed-JMQTRKRE.js");
40
+ const { rotateSeed } = await import("../seed-BVYDPVIW.js");
41
41
  return rotateSeed({ ...ctx, config });
42
42
  },
43
43
  async enrolMember(ctx, member) {
44
- const { enrolMemberSeed } = await import("../seed-JMQTRKRE.js");
44
+ const { enrolMemberSeed } = await import("../seed-BVYDPVIW.js");
45
45
  return enrolMemberSeed({ ...ctx, config }, member);
46
46
  },
47
47
  async revokeMember(ctx, userId) {
48
- const { revokeMemberSeed } = await import("../seed-JMQTRKRE.js");
48
+ const { revokeMemberSeed } = await import("../seed-BVYDPVIW.js");
49
49
  return revokeMemberSeed({ ...ctx, config }, userId);
50
50
  },
51
51
  credentialSource(ctx, profile) {
@@ -62,7 +62,7 @@ function withBroker(config) {
62
62
  const skewMs = config.skewMs ?? DEFAULT_SKEW_MS;
63
63
  const capturedEntry = entry;
64
64
  const inFlight = (async () => {
65
- const { mintStoreCredentials } = await import("../seed-JMQTRKRE.js");
65
+ const { mintStoreCredentials } = await import("../seed-BVYDPVIW.js");
66
66
  const creds = await mintStoreCredentials({ ...ctx, config }, profile);
67
67
  capturedEntry.cached = { creds, validUntil: cacheFloor(creds, skewMs) };
68
68
  return creds;
package/dist/by/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  isQuorum,
3
3
  runDrainBarrier
4
- } from "../chunk-UNSQZSZP.js";
5
- import "../chunk-VSUQI5Q6.js";
4
+ } from "../chunk-PWAMX5KU.js";
5
+ import "../chunk-2RH5SEY7.js";
6
6
  export {
7
7
  isQuorum,
8
8
  runDrainBarrier