@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
@@ -0,0 +1,66 @@
1
+ import {
2
+ parseHistoryId
3
+ } from "./chunk-EQ6C2ZPT.js";
4
+ import "./chunk-WRLWEYHY.js";
5
+ import "./chunk-O6VOR4NH.js";
6
+ import "./chunk-VZFTON37.js";
7
+ import "./chunk-NH2UOV3B.js";
8
+ import "./chunk-HTRLQ4ZZ.js";
9
+ import "./chunk-EPPAEGH5.js";
10
+ import "./chunk-URGHKZPL.js";
11
+ import "./chunk-2RH5SEY7.js";
12
+
13
+ // src/with-commit/history/restore-to.ts
14
+ var HISTORY_COLLECTION = "_history";
15
+ async function candidateCollections(host) {
16
+ const names = new Set(await host.liveCollectionNames());
17
+ for (const id of await host.adapter.list(host.vault, HISTORY_COLLECTION)) {
18
+ const parsed = parseHistoryId(id);
19
+ if (parsed && !parsed.collection.startsWith("_")) names.add(parsed.collection);
20
+ }
21
+ return [...names].sort();
22
+ }
23
+ var same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
24
+ async function restoreTo(host, timestamp, options) {
25
+ const dryRun = options?.dryRun === true;
26
+ const names = options?.collections ?? await candidateCollections(host);
27
+ const per = {};
28
+ let written = 0, deleted = 0, unchanged = 0;
29
+ for (const name of names) {
30
+ const past = host.instantCollection(name);
31
+ const live = host.liveCollection(name);
32
+ const atT = new Set(await past.list());
33
+ const now = new Set(await host.adapter.list(host.vault, name));
34
+ const w = [], d = [];
35
+ let u = 0;
36
+ for (const id of atT) {
37
+ const target = await past.get(id);
38
+ if (target === null || target === void 0) continue;
39
+ const current = now.has(id) ? await live.get(id).catch(() => null) : null;
40
+ if (current !== null && same(current, target)) {
41
+ u++;
42
+ continue;
43
+ }
44
+ if (!dryRun) await live.put(id, target);
45
+ w.push(id);
46
+ }
47
+ for (const id of now) {
48
+ if (atT.has(id)) continue;
49
+ const current = await live.get(id).catch(() => null);
50
+ if (current === null) continue;
51
+ if (!dryRun) await live.delete(id);
52
+ d.push(id);
53
+ }
54
+ if (w.length || d.length || u) {
55
+ per[name] = { written: w, deleted: d, unchanged: u };
56
+ written += w.length;
57
+ deleted += d.length;
58
+ unchanged += u;
59
+ }
60
+ }
61
+ return { restoredTo: timestamp, dryRun, written, deleted, unchanged, collections: per };
62
+ }
63
+ export {
64
+ restoreTo
65
+ };
66
+ //# sourceMappingURL=restore-to-OOPKLAPU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-commit/history/restore-to.ts"],"sourcesContent":["/**\n * core#76 — point-in-time RESTORE, as forward writes.\n *\n * `vault.at(T)` reconstructs any record at T and is read-only by contract.\n * `restoreTo(T)` takes that reconstruction and WRITES it: for every record\n * whose state at T differs from its state now, put the T-state as a new\n * version; for every record that exists now and did not exist at T, delete it.\n *\n * ## Why forward writes, and not a rewrite of history\n *\n * Every write goes through `Collection.put` / `.delete`, so guards, periods,\n * history and the ledger all see it. The restore is therefore itself an\n * audited, reversible event — `restoreTo(T)` can be undone by another\n * `restoreTo`, the ledger's tamper-evidence is untouched, and the result\n * replicates through ordinary sync because it IS ordinary versioned writes.\n * ⭐ That is the whole argument for this over a pod: a pod restore is state\n * REPLACEMENT and needs core#71/#72 to be safe under sync; this needs nothing,\n * because the stack already knows how to gate, audit and replicate a write.\n *\n * ## What bounds it\n *\n * ⚠️ Accuracy is bounded by history retention. If `historyConfig.maxVersions`\n * pruned the versions around T, the reconstruction at T is incomplete and so\n * is the restore — `at(T)` returns null for a record whose earliest retained\n * snapshot is after T, and this treats that as \"did not exist at T\". A vault\n * that prunes history cannot honestly point-in-time restore past the prune\n * horizon, and a pod is the answer there (core#77).\n *\n * ⛔ BLOBS ARE NOT RESTORED AND ARE NOT REPORTED. `_history` holds record\n * envelopes, not chunks; a record's blob fields at T reference chunks that may\n * since have been compacted away. The record comes back with its handles\n * intact and the chunks may or may not still be there. Detecting that\n * reliably means resolving every handle against `_blob_chunks`, which is a\n * blob-subsystem concern this module deliberately does not reach into — a\n * `blobsUnrecoverable: []` that is empty because nothing looked would be worse\n * than the silence, because it would read as a guarantee.\n */\nimport type { RestoreToOptions, RestoreToResult } from '../../kernel/types.js'\nimport type { RestoreToHost } from '../../port/with/restore-host.js'\nimport { parseHistoryId } from './history.js'\n\n/** Local to avoid a new export from `history.ts` for one string. */\nconst HISTORY_COLLECTION = '_history'\n\n/**\n * Collections to consider: what is live now, PLUS what history knows about.\n *\n * ⭐ The union is the point. A collection dropped since T is absent from the\n * live store, and a restore that only walked live collections would silently\n * decline to bring it back — the exact case (\"the store drifted\") this\n * feature exists for.\n */\nasync function candidateCollections(host: RestoreToHost): Promise<string[]> {\n const names = new Set(await host.liveCollectionNames())\n for (const id of await host.adapter.list(host.vault, HISTORY_COLLECTION)) {\n const parsed = parseHistoryId(id)\n if (parsed && !parsed.collection.startsWith('_')) names.add(parsed.collection)\n }\n return [...names].sort()\n}\n\nconst same = (a: unknown, b: unknown): boolean => JSON.stringify(a) === JSON.stringify(b)\n\nexport async function restoreTo(\n host: RestoreToHost,\n timestamp: string,\n options?: RestoreToOptions,\n): Promise<RestoreToResult> {\n const dryRun = options?.dryRun === true\n const names = options?.collections ?? await candidateCollections(host)\n const per: Record<string, { written: string[]; deleted: string[]; unchanged: number }> = {}\n let written = 0, deleted = 0, unchanged = 0\n\n for (const name of names) {\n const past = host.instantCollection(name)\n const live = host.liveCollection(name)\n const atT = new Set(await past.list())\n const now = new Set((await host.adapter.list(host.vault, name)))\n const w: string[] = [], d: string[] = []\n let u = 0\n\n for (const id of atT) {\n const target = await past.get(id)\n if (target === null || target === undefined) continue\n const current = now.has(id) ? await live.get(id).catch(() => null) : null\n if (current !== null && same(current, target)) { u++; continue }\n if (!dryRun) await live.put(id, target)\n w.push(id)\n }\n for (const id of now) {\n if (atT.has(id)) continue\n const current = await live.get(id).catch(() => null)\n if (current === null) continue // already gone (tombstone / delete marker)\n if (!dryRun) await live.delete(id)\n d.push(id)\n }\n\n if (w.length || d.length || u) {\n per[name] = { written: w, deleted: d, unchanged: u }\n written += w.length; deleted += d.length; unchanged += u\n }\n }\n\n return { restoredTo: timestamp, dryRun, written, deleted, unchanged, collections: per }\n}\n"],"mappings":";;;;;;;;;;;;;AA0CA,IAAM,qBAAqB;AAU3B,eAAe,qBAAqB,MAAwC;AAC1E,QAAM,QAAQ,IAAI,IAAI,MAAM,KAAK,oBAAoB,CAAC;AACtD,aAAW,MAAM,MAAM,KAAK,QAAQ,KAAK,KAAK,OAA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IAAI;AACnD,UAAI,YAAY,KAAM;AACtB,UAAI,CAAC,OAAQ,OAAM,KAAK,OAAO,EAAE;AACjC,QAAE,KAAK,EAAE;AAAA,IACX;AAEA,QAAI,EAAE,UAAU,EAAE,UAAU,GAAG;AAC7B,UAAI,IAAI,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,EAAE;AACnD,iBAAW,EAAE;AAAQ,iBAAW,EAAE;AAAQ,mBAAa;AAAA,IACzD;AAAA,EACF;AAEA,SAAO,EAAE,YAAY,WAAW,QAAQ,SAAS,SAAS,WAAW,aAAa,IAAI;AACxF;","names":[]}
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  dualReadSealedSlot
3
- } from "./chunk-CB4467G3.js";
4
- import "./chunk-ABU6A4Z5.js";
3
+ } from "./chunk-5A3HOTP5.js";
4
+ import "./chunk-Q4DBU5RM.js";
5
5
  import {
6
6
  isTombstone
7
- } from "./chunk-OM3SEDI4.js";
8
- import "./chunk-PUBI455O.js";
9
- import "./chunk-2ELOCEXE.js";
7
+ } from "./chunk-HTRLQ4ZZ.js";
8
+ import "./chunk-EPPAEGH5.js";
9
+ import "./chunk-URGHKZPL.js";
10
10
  import {
11
11
  ClassifiedRevealError
12
- } from "./chunk-VSUQI5Q6.js";
12
+ } from "./chunk-2RH5SEY7.js";
13
13
 
14
14
  // src/capsule/enclave-aes/classify/reveal.ts
15
15
  async function revealSealedField(ctx, id, field) {
@@ -35,4 +35,4 @@ async function revealSealedField(ctx, id, field) {
35
35
  export {
36
36
  revealSealedField
37
37
  };
38
- //# sourceMappingURL=reveal-YQTRNQFH.js.map
38
+ //# sourceMappingURL=reveal-UAPBG743.js.map
@@ -0,0 +1,24 @@
1
+ import {
2
+ getRevokedDocIdsCore,
3
+ publishRevocationListCore,
4
+ revokeDocCore,
5
+ unrevokeDocCore
6
+ } from "./chunk-UADW5NOU.js";
7
+ import "./chunk-B6EWMGFX.js";
8
+ import "./chunk-IPF5ORDI.js";
9
+ import "./chunk-GMKGGY7V.js";
10
+ import "./chunk-WRLWEYHY.js";
11
+ import "./chunk-O6VOR4NH.js";
12
+ import "./chunk-VZFTON37.js";
13
+ import "./chunk-NH2UOV3B.js";
14
+ import "./chunk-HTRLQ4ZZ.js";
15
+ import "./chunk-EPPAEGH5.js";
16
+ import "./chunk-URGHKZPL.js";
17
+ import "./chunk-2RH5SEY7.js";
18
+ export {
19
+ getRevokedDocIdsCore,
20
+ publishRevocationListCore,
21
+ revokeDocCore,
22
+ unrevokeDocCore
23
+ };
24
+ //# sourceMappingURL=revoke-6AFVXTWF.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SatelliteConfigError
3
- } from "../chunk-VSUQI5Q6.js";
3
+ } from "../chunk-2RH5SEY7.js";
4
4
  export {
5
5
  SatelliteConfigError
6
6
  };
@@ -3,7 +3,7 @@ import {
3
3
  blindUpdate,
4
4
  coordinatedCutover,
5
5
  lockSchema
6
- } from "../chunk-3Y5JLSXS.js";
6
+ } from "../chunk-X5RGG3ZW.js";
7
7
  import {
8
8
  computeSchemaDelta,
9
9
  evaluateStrategies
@@ -12,7 +12,7 @@ import {
12
12
  SchemaUpdateGate
13
13
  } from "../chunk-6LJY7X5A.js";
14
14
  import "../chunk-Y2NBBT6K.js";
15
- import "../chunk-VSUQI5Q6.js";
15
+ import "../chunk-2RH5SEY7.js";
16
16
  export {
17
17
  SchemaUpdateGate,
18
18
  additiveOnly,
@@ -1,38 +1,38 @@
1
1
  import {
2
2
  NO_SEALED_RECORD
3
- } from "../chunk-GRS2HIV6.js";
3
+ } from "../chunk-UMV5GBTJ.js";
4
4
  import {
5
5
  base64ToBuffer,
6
6
  decrypt,
7
7
  importCek,
8
8
  recordAadFor,
9
9
  sealedBodyArgs
10
- } from "../chunk-4J3MNVVX.js";
11
- import "../chunk-ZBUAX4EF.js";
12
- import "../chunk-SPPOUJLN.js";
10
+ } from "../chunk-WRLWEYHY.js";
11
+ import "../chunk-O6VOR4NH.js";
12
+ import "../chunk-VZFTON37.js";
13
13
  import "../chunk-NH2UOV3B.js";
14
- import "../chunk-OM3SEDI4.js";
15
- import "../chunk-PUBI455O.js";
16
- import "../chunk-2ELOCEXE.js";
14
+ import "../chunk-HTRLQ4ZZ.js";
15
+ import "../chunk-EPPAEGH5.js";
16
+ import "../chunk-URGHKZPL.js";
17
17
  import {
18
18
  SealedRecordExpiredError,
19
19
  SealedRecordMismatchError,
20
20
  SealedRecordNotEnabledError
21
- } from "../chunk-VSUQI5Q6.js";
21
+ } from "../chunk-2RH5SEY7.js";
22
22
 
23
23
  // src/with-audit/sealed-record/active.ts
24
24
  function withSealedRecord() {
25
25
  return {
26
26
  async sealRecordToHost(ctx, collection, id, hostSealer, opts) {
27
- const { sealRecordToHost } = await import("../capsule-57BDK7LG.js");
27
+ const { sealRecordToHost } = await import("../capsule-YQKQZPH7.js");
28
28
  return sealRecordToHost(ctx, collection, id, hostSealer, opts);
29
29
  },
30
30
  async revokeSealedRecord(ctx, collection, id, pid, opts) {
31
- const { revokeSealedRecord } = await import("../capsule-57BDK7LG.js");
31
+ const { revokeSealedRecord } = await import("../capsule-YQKQZPH7.js");
32
32
  return revokeSealedRecord(ctx, collection, id, pid, opts);
33
33
  },
34
34
  async rotateRecordCek(ctx, collection, id) {
35
- const { rotateRecordCek } = await import("../capsule-57BDK7LG.js");
35
+ const { rotateRecordCek } = await import("../capsule-YQKQZPH7.js");
36
36
  return rotateRecordCek(ctx, collection, id);
37
37
  }
38
38
  };
@@ -9,7 +9,7 @@ import {
9
9
  segmentTokens,
10
10
  tokenize,
11
11
  withSearch
12
- } from "../chunk-TZYTMZZY.js";
12
+ } from "../chunk-DL4GCSTS.js";
13
13
  import {
14
14
  fuseRetrieval
15
15
  } from "../chunk-AURFOK3D.js";
@@ -17,11 +17,11 @@ import {
17
17
  DEFAULT_INDEX_MIN_VECTORS,
18
18
  withVectorIndex
19
19
  } from "../chunk-NYMLINRP.js";
20
- import "../chunk-V55JASXO.js";
21
- import "../chunk-PTJY5R3O.js";
20
+ import "../chunk-UQRKAM2R.js";
21
+ import "../chunk-PIO6NW7O.js";
22
22
  import {
23
23
  SearchNotEnabledError
24
- } from "../chunk-VSUQI5Q6.js";
24
+ } from "../chunk-2RH5SEY7.js";
25
25
  export {
26
26
  DEFAULT_INDEX_MIN_VECTORS,
27
27
  InvertedIndex,
@@ -1,12 +1,15 @@
1
1
  import {
2
2
  BROKER_COLLECTION,
3
3
  BROKER_MEMBER_COLLECTION,
4
+ assertRosterTagValid,
4
5
  ensureCollectionDEK,
5
- loadKeyring
6
- } from "./chunk-45VHWE4C.js";
7
- import "./chunk-FZXRLNJO.js";
8
- import "./chunk-UHFGK6YA.js";
9
- import "./chunk-RIZTZJX6.js";
6
+ loadKeyring,
7
+ readKeyringFile,
8
+ requireRosterKey
9
+ } from "./chunk-QVUMKG3Z.js";
10
+ import "./chunk-6BEBWHNL.js";
11
+ import "./chunk-XQGKS4OW.js";
12
+ import "./chunk-LJ744WXU.js";
10
13
  import {
11
14
  base64ToBuffer,
12
15
  bufferToBase64,
@@ -15,13 +18,13 @@ import {
15
18
  deriveBrokerProofBits,
16
19
  openEnvelopeJson,
17
20
  writeEnvelopeBody
18
- } from "./chunk-4J3MNVVX.js";
19
- import "./chunk-ZBUAX4EF.js";
20
- import "./chunk-SPPOUJLN.js";
21
+ } from "./chunk-WRLWEYHY.js";
22
+ import "./chunk-O6VOR4NH.js";
23
+ import "./chunk-VZFTON37.js";
21
24
  import "./chunk-NH2UOV3B.js";
22
- import "./chunk-OM3SEDI4.js";
23
- import "./chunk-PUBI455O.js";
24
- import "./chunk-2ELOCEXE.js";
25
+ import "./chunk-HTRLQ4ZZ.js";
26
+ import "./chunk-EPPAEGH5.js";
27
+ import "./chunk-URGHKZPL.js";
25
28
  import {
26
29
  BrokerEnrolmentError,
27
30
  BrokerProofError,
@@ -30,7 +33,7 @@ import {
30
33
  TamperedError,
31
34
  ValidationError,
32
35
  isConflictError
33
- } from "./chunk-VSUQI5Q6.js";
36
+ } from "./chunk-2RH5SEY7.js";
34
37
 
35
38
  // src/with-party/broker/seed.ts
36
39
  function isAdminRole(keyring) {
@@ -196,16 +199,28 @@ async function rotateSeed(ctx) {
196
199
  async function enrolMemberSeed(ctx, member) {
197
200
  const { store, vault, keyring, config } = ctx;
198
201
  requireAdminAccess(keyring);
199
- const grantee = await loadKeyring(store, vault, { userId: member.userId, secret: member.secret });
200
- if (isAdminRole(grantee)) return;
201
- const dek = grantee.deks.get(BROKER_MEMBER_COLLECTION);
202
+ let dek;
203
+ let role;
204
+ if ("dek" in member) {
205
+ const found = await readKeyringFile(store, vault, member.userId);
206
+ if (!found) throw new BrokerEnrolmentError(`No keyring for "${member.userId}" in vault "${vault}".`);
207
+ await assertRosterTagValid(found.file, requireRosterKey(keyring, "enrolMemberSeed"), member.userId);
208
+ if (found.file.role === "owner" || found.file.role === "admin") return;
209
+ dek = member.dek;
210
+ role = found.file.role;
211
+ } else {
212
+ const grantee = await loadKeyring(store, vault, { userId: member.userId, secret: member.secret });
213
+ if (isAdminRole(grantee)) return;
214
+ dek = grantee.deks.get(BROKER_MEMBER_COLLECTION);
215
+ role = grantee.role;
216
+ }
202
217
  if (!dek) {
203
218
  throw new BrokerEnrolmentError(
204
219
  `grant() did not mint a _broker_member DEK for "${member.userId}" \u2014 the keyring predates member enrolment; re-grant the user.`
205
220
  );
206
221
  }
207
222
  const seedBytes = globalThis.crypto.getRandomValues(new Uint8Array(32));
208
- const identity = { userId: member.userId, role: grantee.role };
223
+ const identity = { userId: member.userId, role };
209
224
  const proofBits = await deriveBrokerProofBits(seedBytes, vault, config.brokerId, member.userId);
210
225
  try {
211
226
  await postEnroll(config, vault, proofBits, identity);
@@ -215,7 +230,7 @@ async function enrolMemberSeed(ctx, member) {
215
230
  const record = {
216
231
  brokerId: config.brokerId,
217
232
  userId: member.userId,
218
- role: grantee.role,
233
+ role,
219
234
  seed: bufferToBase64(seedBytes),
220
235
  endpoint: config.endpoint,
221
236
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
@@ -316,4 +331,4 @@ export {
316
331
  revokeMemberSeed,
317
332
  rotateSeed
318
333
  };
319
- //# sourceMappingURL=seed-JMQTRKRE.js.map
334
+ //# sourceMappingURL=seed-BVYDPVIW.js.map
@@ -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 type { UnlockedKeyring } from '../../with-party/team/keyring.js'\nimport { ensureCollectionDEK, loadKeyring, readKeyringFile, requireRosterKey } from '../../with-party/team/keyring.js'\nimport { assertRosterTagValid } from '../../with-party/team/roster-tag.js'\nimport { BROKER_COLLECTION, BROKER_MEMBER_COLLECTION } from '../../with-party/team/reserved-secret-collections.js'\nimport {\n buildSealedRecordEnvelope,\n openEnvelopeJson,\n writeEnvelopeBody,\n bufferToBase64,\n base64ToBuffer,\n deriveBrokerProofBits,\n computeBrokerProof,\n} from '../../capsule/index.js'\nimport type { EnclaveKey, BrokerMemberIdentity } from '../../capsule/index.js'\nimport {\n PermissionDeniedError,\n ValidationError,\n isConflictError,\n NetworkError,\n BrokerEnrolmentError,\n BrokerProofError,\n TamperedError,\n} from '../../kernel/errors.js'\nimport type { BrokerSeedCtx, BrokerConfig } from '../../port/with/broker-strategy.js'\n\n/** The `_broker/<brokerId>` record payload (spec §3). */\ninterface 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\n/**\n * The `_broker_member/<userId>` record payload (core#73): one per sub-admin\n * member, encrypted under the DEK `grant()` minted for that grantee alone.\n * The host holds the HKDF-derived proof key for `(vault, brokerId, userId)`\n * together with the role it was registered at; the seed itself never leaves\n * the record.\n */\ninterface BrokerMemberRecord {\n readonly brokerId: string\n readonly userId: string\n /** The role registered with the host — informational; the host's own record is what verifies. */\n readonly role: string\n /** base64(32 random bytes). */\n readonly seed: string\n readonly endpoint: string\n readonly createdAt: string\n}\n\nfunction isAdminRole(keyring: UnlockedKeyring): boolean {\n return keyring.role === 'owner' || keyring.role === 'admin'\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({ collection: BROKER_COLLECTION, id: brokerId }, 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 envelope = await buildSealedRecordEnvelope(\n { collection: BROKER_COLLECTION, id: record.brokerId, by: keyring.userId, version: expectedVersion + 1 },\n (identity) => writeEnvelopeBody(identity, JSON.stringify(record), dek),\n {},\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\n/** Attested POST to the host (`/enroll`, `/revoke`) — the two calls only an owner/admin makes. */\nasync function postAttested(config: BrokerConfig, path: string, body: Record<string, unknown>, what: string): 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}${path}`, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n ...(attestation !== undefined ? { authorization: `Bearer ${attestation}` } : {}),\n },\n body: JSON.stringify(body),\n })\n } catch (err) {\n throw new BrokerEnrolmentError(`broker ${path} request failed: ${(err as Error).message}`)\n }\n if (!res.ok) {\n throw new BrokerEnrolmentError(`broker refused ${what} (status ${res.status}) — attestation likely missing or invalid`)\n }\n}\n\nasync function postEnroll(config: BrokerConfig, vault: string, proofBits: Uint8Array, member?: BrokerMemberIdentity): Promise<void> {\n await postAttested(config, '/enroll', {\n vaultId: vault, brokerId: config.brokerId, proofKey: bufferToBase64(proofBits),\n // core#73 — a member registration carries WHO and at WHICH role; the host\n // stores both and binds them into the canonical it verifies against.\n ...(member ? { userId: member.userId, role: member.role } : {}),\n }, 'enrolment')\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 * core#73 — enrol a freshly granted MEMBER with the host under its own key.\n * Called by the kernel right after `grant()`, while the grantor still holds\n * the grantee's secret: that secret opens the grantee's keyring, whose\n * `_broker_member` DEK (minted by `grant()` for this grantee alone) is the\n * only key that can seal the member record. Register-first, then persist,\n * so a record on disk always means a registered member (the same order as\n * `rotateSeed`). Owner/admin grantees use the shared seed and are skipped.\n *\n * A re-grant (role change) lands here again with a NEW DEK and mints a NEW\n * seed, so the host's record for this userId is REPLACED — key and role — and\n * a device still holding the previous enrolment is refused from then on.\n */\nexport async function enrolMemberSeed(\n ctx: BrokerSeedCtx,\n member: { readonly userId: string; readonly secret: string } | { readonly userId: string; readonly dek: EnclaveKey },\n): Promise<void> {\n const { store, vault, keyring, config } = ctx\n requireAdminAccess(keyring)\n let dek: EnclaveKey | undefined\n let role: string\n if ('dek' in member) {\n // core#96 — a role change: the fresh DEK came from `updateKeyringIdentity`,\n // the role from the file it just wrote. Verified before it is trusted: the\n // host scopes credentials by this role, so a store-forged one here would\n // register a forged scope.\n const found = await readKeyringFile(store, vault, member.userId)\n if (!found) throw new BrokerEnrolmentError(`No keyring for \"${member.userId}\" in vault \"${vault}\".`)\n await assertRosterTagValid(found.file, requireRosterKey(keyring, 'enrolMemberSeed'), member.userId)\n if (found.file.role === 'owner' || found.file.role === 'admin') return\n dek = member.dek\n role = found.file.role\n } else {\n const grantee = await loadKeyring(store, vault, { userId: member.userId, secret: member.secret })\n if (isAdminRole(grantee)) return\n dek = grantee.deks.get(BROKER_MEMBER_COLLECTION)\n role = grantee.role\n }\n if (!dek) {\n throw new BrokerEnrolmentError(\n `grant() did not mint a _broker_member DEK for \"${member.userId}\" — the keyring predates member enrolment; re-grant the user.`,\n )\n }\n\n const seedBytes = globalThis.crypto.getRandomValues(new Uint8Array(32))\n const identity: BrokerMemberIdentity = { userId: member.userId, role }\n const proofBits = await deriveBrokerProofBits(seedBytes, vault, config.brokerId, member.userId)\n try {\n await postEnroll(config, vault, proofBits, identity)\n } finally {\n proofBits.fill(0)\n }\n\n const record: BrokerMemberRecord = {\n brokerId: config.brokerId,\n userId: member.userId,\n role,\n seed: bufferToBase64(seedBytes),\n endpoint: config.endpoint,\n createdAt: new Date().toISOString(),\n }\n seedBytes.fill(0)\n const existing = await store.get(vault, BROKER_MEMBER_COLLECTION, member.userId)\n const expectedVersion = existing?._v ?? 0\n const envelope = await buildSealedRecordEnvelope(\n { collection: BROKER_MEMBER_COLLECTION, id: member.userId, by: keyring.userId, version: expectedVersion + 1 },\n (id) => writeEnvelopeBody(id, JSON.stringify(record), dek),\n {},\n )\n await store.put(vault, BROKER_MEMBER_COLLECTION, member.userId, envelope, expectedVersion)\n}\n\n/**\n * core#73 — de-register a member with the host and drop its record. Called\n * by the kernel right after `revoke()`; the local record goes first (cheap,\n * always succeeds), then the host — a host failure surfaces as\n * {@link BrokerEnrolmentError} AFTER the keyring revocation has completed,\n * so the caller retries the host half, never the revocation.\n */\nexport async function revokeMemberSeed(ctx: BrokerSeedCtx, userId: string): Promise<void> {\n const { store, vault, keyring, config } = ctx\n requireAdminAccess(keyring)\n await store.delete(vault, BROKER_MEMBER_COLLECTION, userId)\n await postAttested(config, '/revoke', { vaultId: vault, brokerId: config.brokerId, userId }, 'member revocation')\n}\n\n/** Read this member's own seed: the caller's `_broker_member` DEK opens only the caller's record. */\nasync function readMemberSeed(store: NoydbStore, vault: string, keyring: UnlockedKeyring, config: BrokerConfig): Promise<Uint8Array> {\n const dek = keyring.deks.get(BROKER_MEMBER_COLLECTION)\n const envelope = dek ? await store.get(vault, BROKER_MEMBER_COLLECTION, keyring.userId) : null\n if (!dek || !envelope) {\n throw new BrokerEnrolmentError(\n `User \"${keyring.userId}\" (${keyring.role}) is not enrolled as a broker member for \"${config.brokerId}\" — ` +\n 'the owner must re-grant the user with a broker configured (enrolment happens at grant time).',\n )\n }\n let json: string\n try {\n json = await openEnvelopeJson({ collection: BROKER_MEMBER_COLLECTION, id: keyring.userId }, envelope, dek)\n } catch (err) {\n // A re-grant minted a NEW `_broker_member` DEK and re-sealed the record\n // under it; a session still holding the previous keyring cannot open it.\n // That is a superseded enrolment, not a tampered store — name it so.\n if (err instanceof TamperedError) {\n throw new BrokerEnrolmentError(\n `User \"${keyring.userId}\"'s broker enrolment was replaced by a re-grant — reopen the vault to load the current keyring.`,\n )\n }\n throw err\n }\n const record = JSON.parse(json) as BrokerMemberRecord\n if (record.brokerId !== config.brokerId) {\n throw new BrokerEnrolmentError(`User \"${keyring.userId}\" is enrolled with broker \"${record.brokerId}\", not \"${config.brokerId}\".`)\n }\n return base64ToBuffer(record.seed)\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\n // core#73 — two seeds, one round trip. An owner/admin proves with the shared\n // `_broker` seed (canonical v1, no identity); every other role proves with\n // its OWN `_broker_member` seed (canonical v2: userId + role inside the MAC,\n // verified by the host against the record it registered at grant time).\n let seedBytes: Uint8Array\n let member: BrokerMemberIdentity | undefined\n if (isAdminRole(keyring)) {\n const dek = await brokerDek(store, vault, keyring)\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 seedBytes = base64ToBuffer(found.record.seed)\n } else {\n seedBytes = await readMemberSeed(store, vault, keyring, config)\n member = { userId: keyring.userId, role: keyring.role }\n }\n\n const fetchFn = config.fetch ?? globalThis.fetch\n const endpointOrigin = new URL(config.endpoint).origin\n const who = member ? { userId: member.userId, role: member.role } : {}\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, ...who }),\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 proof = await computeBrokerProof(seedBytes, vault, config.brokerId, { endpointOrigin, member, 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, ...who, 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,SAAS,YAAY,SAAmC;AACtD,SAAO,QAAQ,SAAS,WAAW,QAAQ,SAAS;AACtD;AAEA,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,OAAO,iBAAiB;AAAA,IACvC,SAAS,KAAK;AACZ,UAAI,eAAe,iBAAiB;AAClC,cAAM,IAAI;AAAA,UACR;AAAA,QAGF;AAAA,MACF;AACA,YAAM;AAAA,IACR;AAAA,EACF,GAAG;AACH,WAAS,IAAI,OAAO,OAAO;AAC3B,MAAI;AACF,WAAO,MAAM;AAAA,EACf,UAAE;AACA,aAAS,OAAO,KAAK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BYHCKX73.js";
9
- import "../chunk-4J3MNVVX.js";
10
- import "../chunk-ZBUAX4EF.js";
11
- import "../chunk-SPPOUJLN.js";
8
+ } from "../chunk-CLOSXHR4.js";
9
+ import "../chunk-WRLWEYHY.js";
10
+ import "../chunk-O6VOR4NH.js";
11
+ import "../chunk-VZFTON37.js";
12
12
  import "../chunk-NH2UOV3B.js";
13
- import "../chunk-OM3SEDI4.js";
14
- import "../chunk-PUBI455O.js";
15
- import "../chunk-2ELOCEXE.js";
13
+ import "../chunk-HTRLQ4ZZ.js";
14
+ import "../chunk-EPPAEGH5.js";
15
+ import "../chunk-URGHKZPL.js";
16
16
  import {
17
17
  SequenceNotEnabledError
18
- } from "../chunk-VSUQI5Q6.js";
18
+ } from "../chunk-2RH5SEY7.js";
19
19
  export {
20
20
  NO_SEQUENCE,
21
21
  SEQUENCE_COLLECTION,
@@ -12,23 +12,23 @@ import {
12
12
  revokeAllSessions,
13
13
  revokeSession,
14
14
  validateSessionPolicy
15
- } from "../chunk-JPSL5GIZ.js";
15
+ } from "../chunk-QQLXKDGC.js";
16
16
  import {
17
17
  NO_SESSION
18
18
  } from "../chunk-VKQCVU2Z.js";
19
19
  import "../chunk-4AOERLTV.js";
20
- import "../chunk-4J3MNVVX.js";
21
- import "../chunk-ZBUAX4EF.js";
22
- import "../chunk-SPPOUJLN.js";
20
+ import "../chunk-WRLWEYHY.js";
21
+ import "../chunk-O6VOR4NH.js";
22
+ import "../chunk-VZFTON37.js";
23
23
  import "../chunk-NH2UOV3B.js";
24
- import "../chunk-OM3SEDI4.js";
25
- import "../chunk-PUBI455O.js";
26
- import "../chunk-2ELOCEXE.js";
24
+ import "../chunk-HTRLQ4ZZ.js";
25
+ import "../chunk-EPPAEGH5.js";
26
+ import "../chunk-URGHKZPL.js";
27
27
  import {
28
28
  SessionExpiredError,
29
29
  SessionNotFoundError,
30
30
  SessionPolicyError
31
- } from "../chunk-VSUQI5Q6.js";
31
+ } from "../chunk-2RH5SEY7.js";
32
32
 
33
33
  // src/with-party/session/active.ts
34
34
  function withSession() {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  CollectionFrame,
3
3
  VaultFrame
4
- } from "../chunk-B65CC6Z6.js";
4
+ } from "../chunk-RF5WDM25.js";
5
5
  import {
6
6
  NO_SHADOW
7
7
  } from "../chunk-SMY5X46Z.js";
8
- import "../chunk-VSUQI5Q6.js";
8
+ import "../chunk-2RH5SEY7.js";
9
9
 
10
10
  // src/with-fork/shadow/active.ts
11
11
  function withShadow() {
@@ -0,0 +1,23 @@
1
+ import {
2
+ ATTESTATIONS_COLLECTION,
3
+ REVOKED_RECORD_ID,
4
+ SIGNER_RECORD_ID,
5
+ loadOrCreateSigner,
6
+ loadSigner
7
+ } from "./chunk-IPF5ORDI.js";
8
+ import "./chunk-WRLWEYHY.js";
9
+ import "./chunk-O6VOR4NH.js";
10
+ import "./chunk-VZFTON37.js";
11
+ import "./chunk-NH2UOV3B.js";
12
+ import "./chunk-HTRLQ4ZZ.js";
13
+ import "./chunk-EPPAEGH5.js";
14
+ import "./chunk-URGHKZPL.js";
15
+ import "./chunk-2RH5SEY7.js";
16
+ export {
17
+ ATTESTATIONS_COLLECTION,
18
+ REVOKED_RECORD_ID,
19
+ SIGNER_RECORD_ID,
20
+ loadOrCreateSigner,
21
+ loadSigner
22
+ };
23
+ //# sourceMappingURL=signer-TW5MAQJP.js.map
@@ -4,19 +4,19 @@ import {
4
4
  import {
5
5
  readPod,
6
6
  writePod
7
- } from "../chunk-RDOEOPOI.js";
8
- import "../chunk-YQFBH5ZJ.js";
7
+ } from "../chunk-4N4OIVK3.js";
8
+ import "../chunk-WQUIJPN4.js";
9
9
  import "../chunk-GMKGGY7V.js";
10
- import "../chunk-4J3MNVVX.js";
11
- import "../chunk-ZBUAX4EF.js";
12
- import "../chunk-SPPOUJLN.js";
10
+ import "../chunk-WRLWEYHY.js";
11
+ import "../chunk-O6VOR4NH.js";
12
+ import "../chunk-VZFTON37.js";
13
13
  import "../chunk-NH2UOV3B.js";
14
- import "../chunk-OM3SEDI4.js";
15
- import "../chunk-PUBI455O.js";
16
- import "../chunk-2ELOCEXE.js";
14
+ import "../chunk-HTRLQ4ZZ.js";
15
+ import "../chunk-EPPAEGH5.js";
16
+ import "../chunk-URGHKZPL.js";
17
17
  import {
18
18
  SnapshotNotFoundError
19
- } from "../chunk-VSUQI5Q6.js";
19
+ } from "../chunk-2RH5SEY7.js";
20
20
 
21
21
  // src/with-fork/snapshots/engine.ts
22
22
  var SnapshotEngine = class {
@@ -6,16 +6,16 @@ import {
6
6
  isMVStale,
7
7
  markMVStale,
8
8
  resolveStaleMVOnRead
9
- } from "./chunk-AJFPAHMW.js";
9
+ } from "./chunk-27NCEPKM.js";
10
10
  import "./chunk-5D2ALSM5.js";
11
- import "./chunk-4J3MNVVX.js";
12
- import "./chunk-ZBUAX4EF.js";
13
- import "./chunk-SPPOUJLN.js";
11
+ import "./chunk-WRLWEYHY.js";
12
+ import "./chunk-O6VOR4NH.js";
13
+ import "./chunk-VZFTON37.js";
14
14
  import "./chunk-NH2UOV3B.js";
15
- import "./chunk-OM3SEDI4.js";
16
- import "./chunk-PUBI455O.js";
17
- import "./chunk-2ELOCEXE.js";
18
- import "./chunk-VSUQI5Q6.js";
15
+ import "./chunk-HTRLQ4ZZ.js";
16
+ import "./chunk-EPPAEGH5.js";
17
+ import "./chunk-URGHKZPL.js";
18
+ import "./chunk-2RH5SEY7.js";
19
19
  export {
20
20
  MV_STALE_COLLECTION,
21
21
  clearMVStale,
@@ -25,4 +25,4 @@ export {
25
25
  markMVStale,
26
26
  resolveStaleMVOnRead
27
27
  };
28
- //# sourceMappingURL=stale-SKV33PBU.js.map
28
+ //# sourceMappingURL=stale-CROGJBIJ.js.map
@@ -0,0 +1,21 @@
1
+ import {
2
+ SCHEMAS_COLLECTION,
3
+ loadPersistedSchema,
4
+ loadPersistedSchemaEntry,
5
+ savePersistedSchema
6
+ } from "./chunk-IF2M43G4.js";
7
+ import "./chunk-WRLWEYHY.js";
8
+ import "./chunk-O6VOR4NH.js";
9
+ import "./chunk-VZFTON37.js";
10
+ import "./chunk-NH2UOV3B.js";
11
+ import "./chunk-HTRLQ4ZZ.js";
12
+ import "./chunk-EPPAEGH5.js";
13
+ import "./chunk-URGHKZPL.js";
14
+ import "./chunk-2RH5SEY7.js";
15
+ export {
16
+ SCHEMAS_COLLECTION,
17
+ loadPersistedSchema,
18
+ loadPersistedSchemaEntry,
19
+ savePersistedSchema
20
+ };
21
+ //# sourceMappingURL=storage-SO2L2Z5J.js.map
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  loadFence,
3
3
  saveFence
4
- } from "./chunk-BMHQHH7Q.js";
4
+ } from "./chunk-TLIFNRU5.js";
5
5
  import {
6
6
  buildRecordEnvelope
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";
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
 
16
16
  // src/with-shape/schema-update/client-registry.ts
17
17
  var META_COLLECTION = "_meta";
@@ -144,4 +144,4 @@ function unref(timer) {
144
144
  export {
145
145
  StoreMesh
146
146
  };
147
- //# sourceMappingURL=store-coordination-provider-Z6HKPOGM.js.map
147
+ //# sourceMappingURL=store-coordination-provider-2YD2PTTP.js.map