@noy-db/hub 0.8.0 → 0.9.0-pre.1

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 (567) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +8 -8
  3. package/codemods/0.4.0-pre.json +1 -1
  4. package/codemods/0.8.0-pre.json +1 -1
  5. package/dist/api-6EFD43KN.js +18 -0
  6. package/dist/as/index.js +33 -23
  7. package/dist/as/index.js.map +1 -1
  8. package/dist/at/index.js +8 -8
  9. package/dist/attestation/index.js +18 -18
  10. package/dist/{backup-YE2VQ26S.js → backup-RJBFQSHE.js} +92 -31
  11. package/dist/backup-RJBFQSHE.js.map +1 -0
  12. package/dist/blobs/index.js +12 -12
  13. package/dist/broker/index.js +19 -11
  14. package/dist/broker/index.js.map +1 -1
  15. package/dist/by/index.js +2 -2
  16. package/dist/capsule/contract.d.ts +1 -1
  17. package/dist/capsule/contract.js +6 -6
  18. package/dist/capsule/enclave-aes/broker/proof.d.ts +12 -3
  19. package/dist/capsule/enclave-aes/crypto.d.ts +18 -0
  20. package/dist/capsule/enclave-aes/index.d.ts +3 -3
  21. package/dist/capsule/enclave-aes/index.js +46 -14
  22. package/dist/capsule/enclave-aes/index.js.map +1 -1
  23. package/dist/capsule/index.d.ts +2 -2
  24. package/dist/capsule/plumbing/record-codec.d.ts +7 -0
  25. package/dist/{capsule-VOLX3QRQ.js → capsule-6LJAVQNM.js} +14 -8
  26. package/dist/cargo/index.js +35 -35
  27. package/dist/{chunk-GZT3NQRA.js → chunk-25FXU6WS.js} +8 -2
  28. package/dist/chunk-25FXU6WS.js.map +1 -0
  29. package/dist/{chunk-OYW3I5M4.js → chunk-2DOCDOPL.js} +6 -6
  30. package/dist/chunk-2DX4JCRI.js +1 -0
  31. package/dist/{chunk-FLPCETP6.js → chunk-2LBS62AC.js} +2 -2
  32. package/dist/{chunk-WXE4W2U6.js → chunk-2ST3WA3C.js} +4 -4
  33. package/dist/{chunk-DQESF6RP.js → chunk-3G3GOGZZ.js} +50 -40
  34. package/dist/chunk-3G3GOGZZ.js.map +1 -0
  35. package/dist/{chunk-O2IMQSNA.js → chunk-3YBIVLTC.js} +2 -2
  36. package/dist/{chunk-LGNDFRYC.js → chunk-4CFHL5RY.js} +1 -1
  37. package/dist/chunk-4CFHL5RY.js.map +1 -0
  38. package/dist/{chunk-DIZLQVAA.js → chunk-4CHM2TRS.js} +2 -2
  39. package/dist/{chunk-V7ADQF5O.js → chunk-4CUJLEOA.js} +4 -4
  40. package/dist/{chunk-3EWS67C7.js → chunk-4TG2ITRW.js} +2 -2
  41. package/dist/{chunk-HS554XAF.js → chunk-5HQFROZS.js} +2 -2
  42. package/dist/{chunk-IUBMZPHM.js → chunk-5ZVE3N5C.js} +5 -6
  43. package/dist/chunk-5ZVE3N5C.js.map +1 -0
  44. package/dist/{chunk-PP3K67AJ.js → chunk-654RE5YC.js} +3 -3
  45. package/dist/{chunk-FOEDQATO.js → chunk-66GD7XXU.js} +2 -2
  46. package/dist/{chunk-BNWA3WG5.js → chunk-72FQ46VW.js} +3 -3
  47. package/dist/{chunk-EYG2CY2X.js → chunk-7JPA3LIH.js} +11 -11
  48. package/dist/chunk-7JPA3LIH.js.map +1 -0
  49. package/dist/{chunk-JQYKPKG6.js → chunk-7K42TSCY.js} +4 -4
  50. package/dist/{chunk-BPWYQ25R.js → chunk-7Q6IU3R7.js} +4 -4
  51. package/dist/{chunk-BPWYQ25R.js.map → chunk-7Q6IU3R7.js.map} +1 -1
  52. package/dist/{chunk-T7IR4N2S.js → chunk-7UHLO4ZN.js} +37 -2
  53. package/dist/chunk-7UHLO4ZN.js.map +1 -0
  54. package/dist/{chunk-UEFOQH74.js → chunk-ADCXTW7L.js} +2 -2
  55. package/dist/{chunk-MBMTND6D.js → chunk-AGGPT4UE.js} +2 -2
  56. package/dist/{chunk-RB4DOPGZ.js → chunk-AKIEBFIJ.js} +10 -10
  57. package/dist/{chunk-VHBKYN2J.js → chunk-B3B6HV5S.js} +2 -2
  58. package/dist/{chunk-JWWYRR4Q.js → chunk-B6EWMGFX.js} +2 -2
  59. package/dist/{chunk-H7JBY4P7.js → chunk-B7Y2BRQA.js} +14 -14
  60. package/dist/chunk-B7Y2BRQA.js.map +1 -0
  61. package/dist/{chunk-4CIQDWRB.js → chunk-BFJE2GPP.js} +14 -8
  62. package/dist/{chunk-4CIQDWRB.js.map → chunk-BFJE2GPP.js.map} +1 -1
  63. package/dist/{chunk-WPOYWFSE.js → chunk-BJRKXNFP.js} +7 -7
  64. package/dist/{chunk-H427H63K.js → chunk-BPQ5CRJF.js} +2 -2
  65. package/dist/{chunk-VFHCKG5M.js → chunk-BVRJYMFZ.js} +3 -3
  66. package/dist/{chunk-244QBK7Z.js → chunk-C4XV3PSJ.js} +4 -4
  67. package/dist/{chunk-244QBK7Z.js.map → chunk-C4XV3PSJ.js.map} +1 -1
  68. package/dist/{chunk-SMV2HRDU.js → chunk-DFC4WTJW.js} +2 -2
  69. package/dist/{chunk-5A4345TG.js → chunk-DMIEKD24.js} +3 -3
  70. package/dist/{chunk-TKVUE4JF.js → chunk-DQAXA2GK.js} +9 -9
  71. package/dist/{chunk-AL6ML4LA.js → chunk-DWCFGF2K.js} +5 -5
  72. package/dist/{chunk-Y3LPTBG7.js → chunk-E2C6FFSI.js} +6 -9
  73. package/dist/chunk-E2C6FFSI.js.map +1 -0
  74. package/dist/{chunk-LNSVGRHO.js → chunk-EQ6C2ZPT.js} +17 -51
  75. package/dist/chunk-EQ6C2ZPT.js.map +1 -0
  76. package/dist/chunk-EZOFTI4K.js +60 -0
  77. package/dist/chunk-EZOFTI4K.js.map +1 -0
  78. package/dist/{chunk-PD64727P.js → chunk-FMINS2B6.js} +2 -2
  79. package/dist/chunk-FMINS2B6.js.map +1 -0
  80. package/dist/{chunk-QBLT6POL.js → chunk-FPF5HRBE.js} +2 -2
  81. package/dist/{chunk-UA372JHH.js → chunk-FZVCZEVI.js} +3 -3
  82. package/dist/chunk-FZVCZEVI.js.map +1 -0
  83. package/dist/{chunk-FFWI7UH7.js → chunk-GAGT3YZN.js} +1 -1
  84. package/dist/chunk-GAGT3YZN.js.map +1 -0
  85. package/dist/{chunk-5WWDGFOS.js → chunk-GIQJGXV7.js} +2 -2
  86. package/dist/{chunk-V3RWOOSO.js → chunk-GYZICGRU.js} +4 -4
  87. package/dist/chunk-GYZICGRU.js.map +1 -0
  88. package/dist/{chunk-BVCUTXE3.js → chunk-H334G6KU.js} +2 -2
  89. package/dist/{chunk-AEQGFRU4.js → chunk-HE7EAHGS.js} +3 -3
  90. package/dist/chunk-HKB4HZDU.js +74 -0
  91. package/dist/chunk-HKB4HZDU.js.map +1 -0
  92. package/dist/{chunk-4V3Q35WG.js → chunk-ICF3TIGY.js} +3 -3
  93. package/dist/{chunk-3L2NBKDR.js → chunk-IF2M43G4.js} +2 -2
  94. package/dist/{chunk-37EPTBBR.js → chunk-IKPQ2GGB.js} +46 -4
  95. package/dist/chunk-IKPQ2GGB.js.map +1 -0
  96. package/dist/{chunk-DHHGL42E.js → chunk-IKS2CPAG.js} +27 -11
  97. package/dist/chunk-IKS2CPAG.js.map +1 -0
  98. package/dist/{chunk-3A5DUZ56.js → chunk-IMIQAGR7.js} +6 -6
  99. package/dist/{chunk-3A5DUZ56.js.map → chunk-IMIQAGR7.js.map} +1 -1
  100. package/dist/{chunk-A4XMIZT3.js → chunk-IQAJ4OR6.js} +41 -6
  101. package/dist/chunk-IQAJ4OR6.js.map +1 -0
  102. package/dist/{chunk-IUT3GWP3.js → chunk-IUD7WU67.js} +17 -93
  103. package/dist/chunk-IUD7WU67.js.map +1 -0
  104. package/dist/{chunk-AUKKUPVB.js → chunk-IVLRPRXM.js} +2 -2
  105. package/dist/{chunk-GUZET4SG.js → chunk-JAQHWHUN.js} +4 -4
  106. package/dist/chunk-JAQHWHUN.js.map +1 -0
  107. package/dist/{chunk-Y2RKVFKR.js → chunk-K4JSTGXT.js} +2 -2
  108. package/dist/{chunk-EJLV62NI.js → chunk-KN4LUMH6.js} +2 -2
  109. package/dist/{chunk-23D6M6VM.js → chunk-KZA3DITX.js} +4 -4
  110. package/dist/{chunk-E2N2T5ZO.js → chunk-L2VM64HK.js} +2 -2
  111. package/dist/chunk-L4UL4IAR.js +55 -0
  112. package/dist/chunk-L4UL4IAR.js.map +1 -0
  113. package/dist/{chunk-UIYESRD6.js → chunk-LUCQY3OM.js} +10 -10
  114. package/dist/{chunk-UIYESRD6.js.map → chunk-LUCQY3OM.js.map} +1 -1
  115. package/dist/{chunk-O46CHQT7.js → chunk-MAQBYBUX.js} +4 -4
  116. package/dist/{chunk-EZOAKKTB.js → chunk-MBPZMZVB.js} +2 -2
  117. package/dist/{chunk-XQRFSKYM.js → chunk-MCNNZBG7.js} +2 -2
  118. package/dist/{chunk-YRXFFWG4.js → chunk-MLVPMDOZ.js} +2 -2
  119. package/dist/{chunk-5FE75J4S.js → chunk-MMCN7TLK.js} +5 -5
  120. package/dist/{chunk-MXOQ5JCG.js → chunk-MRCR7ZMC.js} +686 -202
  121. package/dist/chunk-MRCR7ZMC.js.map +1 -0
  122. package/dist/{chunk-SYNY3VB5.js → chunk-NCTN2FW4.js} +2 -2
  123. package/dist/{chunk-4T3SE27M.js → chunk-ND6S2DKC.js} +2 -2
  124. package/dist/{chunk-3XJQBBZD.js → chunk-NTVKHQ3L.js} +2 -2
  125. package/dist/{chunk-RHVMZSUU.js → chunk-NV4OESHC.js} +1 -1
  126. package/dist/chunk-NV4OESHC.js.map +1 -0
  127. package/dist/chunk-NXQEOC3X.js +40 -0
  128. package/dist/chunk-NXQEOC3X.js.map +1 -0
  129. package/dist/{chunk-Q4UHJ5SN.js → chunk-O2VQ3K36.js} +2 -2
  130. package/dist/{chunk-HW7CMKUG.js → chunk-OFD2HD6F.js} +1 -1
  131. package/dist/{chunk-HW7CMKUG.js.map → chunk-OFD2HD6F.js.map} +1 -1
  132. package/dist/{chunk-2GHDLTPE.js → chunk-OGKMRIIJ.js} +2 -2
  133. package/dist/{chunk-N7EVQD5S.js → chunk-ONZ3B5EW.js} +4 -4
  134. package/dist/{chunk-VKI2EB3N.js → chunk-OOPSMQX5.js} +3 -3
  135. package/dist/{chunk-VMV5SBE4.js → chunk-OYEBSWLE.js} +5 -5
  136. package/dist/{chunk-JDEYF3PJ.js → chunk-P6FATPXQ.js} +2 -2
  137. package/dist/chunk-P6FATPXQ.js.map +1 -0
  138. package/dist/{chunk-VVOLDVIR.js → chunk-PLTIJDQN.js} +2 -2
  139. package/dist/{chunk-OKSTSITU.js → chunk-PR7ILCIH.js} +3 -3
  140. package/dist/{chunk-7R2Q7CPL.js → chunk-QE3TLZ6Z.js} +7 -7
  141. package/dist/{chunk-G2MVBDFP.js → chunk-QFW4MYGN.js} +39 -9
  142. package/dist/chunk-QFW4MYGN.js.map +1 -0
  143. package/dist/{chunk-6QVKPHBF.js → chunk-QHG7GQKM.js} +2 -2
  144. package/dist/chunk-QJNAHPVT.js +91 -0
  145. package/dist/chunk-QJNAHPVT.js.map +1 -0
  146. package/dist/{chunk-LIOVX5TJ.js → chunk-QT5ITL25.js} +3 -3
  147. package/dist/{chunk-IMQKWR46.js → chunk-R2ZULFXU.js} +4 -5
  148. package/dist/chunk-R2ZULFXU.js.map +1 -0
  149. package/dist/{chunk-Q2XRFWOI.js → chunk-RRTQAQ3N.js} +2 -2
  150. package/dist/{chunk-H23XHRTT.js → chunk-RUE6TCES.js} +809 -101
  151. package/dist/chunk-RUE6TCES.js.map +1 -0
  152. package/dist/chunk-RWFQVNXR.js +24 -0
  153. package/dist/chunk-RWFQVNXR.js.map +1 -0
  154. package/dist/{chunk-2PVXF5CS.js → chunk-SALY3LIJ.js} +3 -3
  155. package/dist/{chunk-JOSPH3E5.js → chunk-SBAR5JQ6.js} +2 -2
  156. package/dist/{chunk-N7UDP5VU.js → chunk-SCH2F7R2.js} +7 -7
  157. package/dist/{chunk-MXKI4ABF.js → chunk-SOOAW6HK.js} +3 -3
  158. package/dist/{chunk-VQDZYB2B.js → chunk-T4VTRKCY.js} +3 -3
  159. package/dist/{chunk-VQDZYB2B.js.map → chunk-T4VTRKCY.js.map} +1 -1
  160. package/dist/{chunk-TEHHROZL.js → chunk-T5EXREMW.js} +5 -5
  161. package/dist/{chunk-M5B2W6YY.js → chunk-TDJVQTXD.js} +3 -3
  162. package/dist/{chunk-QMWY2FDS.js → chunk-THQ3BHLM.js} +2 -2
  163. package/dist/{chunk-VAORSCSU.js → chunk-TLIFNRU5.js} +2 -2
  164. package/dist/chunk-TLIFNRU5.js.map +1 -0
  165. package/dist/{chunk-FVH5QYY2.js → chunk-TRHUNPXP.js} +2 -2
  166. package/dist/{chunk-EGVJ7TM4.js → chunk-UL6MTRMJ.js} +8 -9
  167. package/dist/chunk-UL6MTRMJ.js.map +1 -0
  168. package/dist/chunk-UNL6YGL5.js +169 -0
  169. package/dist/chunk-UNL6YGL5.js.map +1 -0
  170. package/dist/{chunk-747G6CT3.js → chunk-UORWAG7K.js} +2 -2
  171. package/dist/{chunk-XSPFDUDG.js → chunk-V7AKGAXY.js} +314 -77
  172. package/dist/chunk-V7AKGAXY.js.map +1 -0
  173. package/dist/{chunk-TZZBXPZK.js → chunk-VLQ6KT7F.js} +2 -2
  174. package/dist/{chunk-NCO25JZO.js → chunk-VP37VUKQ.js} +4 -4
  175. package/dist/{chunk-52MGURXO.js → chunk-WBUHHMLN.js} +2 -2
  176. package/dist/{chunk-EZGV6F47.js → chunk-WRLWEYHY.js} +7 -1
  177. package/dist/chunk-WRLWEYHY.js.map +1 -0
  178. package/dist/{chunk-2MG3SW7Q.js → chunk-X6Z2SIRF.js} +2 -2
  179. package/dist/{chunk-U2FZNEWJ.js → chunk-XLKWF3L4.js} +8 -6
  180. package/dist/{chunk-U2FZNEWJ.js.map → chunk-XLKWF3L4.js.map} +1 -1
  181. package/dist/{chunk-5UMK7GRI.js → chunk-XPNJH7GN.js} +5 -5
  182. package/dist/{chunk-KZXDLBY6.js → chunk-XPW7T2GN.js} +5 -5
  183. package/dist/{chunk-SV2PM2OY.js → chunk-XX4R7TUB.js} +1 -1
  184. package/dist/chunk-XX4R7TUB.js.map +1 -0
  185. package/dist/{chunk-NBQ3KK6X.js → chunk-Y55XHMQB.js} +4 -4
  186. package/dist/chunk-Y55XHMQB.js.map +1 -0
  187. package/dist/{chunk-5KC7QYEC.js → chunk-YH4OUOSI.js} +33 -7
  188. package/dist/chunk-YH4OUOSI.js.map +1 -0
  189. package/dist/{chunk-FFJFE4T7.js → chunk-YJGKOSQD.js} +2 -2
  190. package/dist/{chunk-2AFX33YA.js → chunk-Z3STG43F.js} +3 -3
  191. package/dist/chunk-Z3STG43F.js.map +1 -0
  192. package/dist/{chunk-OIEO4WDL.js → chunk-ZD7WFMV2.js} +2 -2
  193. package/dist/chunk-ZD7WFMV2.js.map +1 -0
  194. package/dist/{chunk-42ALPZ2B.js → chunk-ZF6JECDT.js} +4 -4
  195. package/dist/{chunk-42ALPZ2B.js.map → chunk-ZF6JECDT.js.map} +1 -1
  196. package/dist/{chunk-4JPMZTJY.js → chunk-ZF7KNSLU.js} +2 -2
  197. package/dist/{chunk-2ODVB6LZ.js → chunk-ZGKODRGB.js} +2 -2
  198. package/dist/{chunk-JIBUPZHA.js → chunk-ZNEKQFGF.js} +4 -4
  199. package/dist/{chunk-DLD5LGDS.js → chunk-ZUTUNVFD.js} +3 -3
  200. package/dist/{chunk-JSMTXZR3.js → chunk-ZWMOHANW.js} +8 -6
  201. package/dist/chunk-ZWMOHANW.js.map +1 -0
  202. package/dist/{chunk-MILI22XQ.js → chunk-ZZZ4VCY2.js} +10 -10
  203. package/dist/chunk-ZZZ4VCY2.js.map +1 -0
  204. package/dist/classified/index.js +5 -5
  205. package/dist/{classified-marker-SIYKUU5L.js → classified-marker-WKP33U2R.js} +3 -3
  206. package/dist/collection-facade-COSGZKLC.js +41 -0
  207. package/dist/{computed-FAD7SED4.js → computed-WN6V53ZV.js} +3 -3
  208. package/dist/consent/index.js +8 -8
  209. package/dist/cover/index.js +8 -8
  210. package/dist/coverage/index.js +1 -1
  211. package/dist/custody/index.js +12 -11
  212. package/dist/{dead-filter-4F3LWYKH.js → dead-filter-43WL3Y5H.js} +10 -10
  213. package/dist/debug/index.js +7 -7
  214. package/dist/delegation-5UWT4JGT.js +26 -0
  215. package/dist/derivations/index.js +24 -23
  216. package/dist/derive-IL5JNLEE.js +20 -0
  217. package/dist/directory/index.js +9 -9
  218. package/dist/{dispatch-JDZNGEB3.js → dispatch-LOQQD5JK.js} +20 -20
  219. package/dist/{dispatch-H4HV32AM.js → dispatch-SHKTG57L.js} +5 -5
  220. package/dist/executor-6PQ7WAGV.js +35 -0
  221. package/dist/executor-6ZPQA6HS.js +8 -0
  222. package/dist/executor-OXRA64TY.js +8 -0
  223. package/dist/export-accessible-XG3FKJWW.js +22 -0
  224. package/dist/extract-partition-33747NY5.js +35 -0
  225. package/dist/{fanout-sidecar-L7NHPIOC.js → fanout-sidecar-NEB6IYV7.js} +8 -8
  226. package/dist/find-VW543G3J.js +10 -0
  227. package/dist/forget/index.js +25 -8
  228. package/dist/forget/index.js.map +1 -1
  229. package/dist/guards/index.js +4 -4
  230. package/dist/history/index.js +15 -13
  231. package/dist/history/index.js.map +1 -1
  232. package/dist/i18n/index.js +13 -13
  233. package/dist/index.d.ts +9 -6
  234. package/dist/index.js +126 -110
  235. package/dist/index.js.map +1 -1
  236. package/dist/indexing/index.js +6 -6
  237. package/dist/introspection/index.js +15 -11
  238. package/dist/issue-4ZPSY44M.js +19 -0
  239. package/dist/kernel/cache/index.d.ts +1 -1
  240. package/dist/kernel/collection.d.ts +86 -6
  241. package/dist/kernel/constants.d.ts +7 -0
  242. package/dist/kernel/errors.d.ts +42 -4
  243. package/dist/kernel/export-scope.d.ts +40 -0
  244. package/dist/kernel/merge-authority.d.ts +5 -1
  245. package/dist/kernel/noydb.d.ts +118 -21
  246. package/dist/kernel/put-many-atomic.d.ts +1 -1
  247. package/dist/kernel/query/live/live.d.ts +2 -1
  248. package/dist/kernel/query/sort-key.d.ts +0 -2
  249. package/dist/kernel/rejection-seal.d.ts +13 -0
  250. package/dist/kernel/sync-wiring.d.ts +55 -0
  251. package/dist/kernel/tx-write-gate.d.ts +2 -4
  252. package/dist/kernel/types.d.ts +463 -14
  253. package/dist/kernel/validation.d.ts +0 -10
  254. package/dist/kernel/vault.d.ts +42 -4
  255. package/dist/kernel/via/reconcile.d.ts +1 -42
  256. package/dist/{ledger-5ZMGE44K.js → ledger-MZ25UFT2.js} +10 -10
  257. package/dist/liberate-OJIP2ZFX.js +25 -0
  258. package/dist/{link-set-MFXC24VK.js → link-set-4FRRAVTH.js} +10 -10
  259. package/dist/{managed-secret-MFTFT22X.js → managed-secret-SQWO2EUR.js} +9 -9
  260. package/dist/materialized-views/index.js +26 -26
  261. package/dist/{migrate-cek-DZRFFOHW.js → migrate-cek-JWEM4RP6.js} +2 -2
  262. package/dist/money/index.js +5 -5
  263. package/dist/noydb-U62OVKXB.js +100 -0
  264. package/dist/on/index.js +25 -0
  265. package/dist/overlay-views/index.js +4 -4
  266. package/dist/periods/index.js +11 -11
  267. package/dist/pod/index.js +71 -67
  268. package/dist/{pod-handle-A3LET7NO.js → pod-handle-R6Y4MILX.js} +8 -8
  269. package/dist/policy/index.js +9 -9
  270. package/dist/port/as/active.d.ts +4 -0
  271. package/dist/port/as/index.d.ts +1 -0
  272. package/dist/port/by/index.d.ts +14 -5
  273. package/dist/port/on/index.d.ts +26 -0
  274. package/dist/port/to/index.d.ts +1 -1
  275. package/dist/port/with/admission-authority.d.ts +34 -0
  276. package/dist/port/with/broker-strategy.d.ts +24 -0
  277. package/dist/port/with/coverage-strategy.d.ts +17 -1
  278. package/dist/port/with/formats-strategy.d.ts +34 -1
  279. package/dist/port/with/lookup-strategy.d.ts +85 -4
  280. package/dist/port/with/rejection-courier.d.ts +37 -0
  281. package/dist/port/with/restore-host.d.ts +33 -0
  282. package/dist/port/with/service-bus.d.ts +20 -1
  283. package/dist/port/with/team-strategy.d.ts +2 -2
  284. package/dist/port/with/write-hooks.d.ts +2 -0
  285. package/dist/portability/index.js +8 -8
  286. package/dist/{post-register-7ND27CF2.js → post-register-GRVQHBOH.js} +6 -6
  287. package/dist/query/all/index.js +16 -16
  288. package/dist/query/index.js +8 -8
  289. package/dist/query/live/index.js +7 -7
  290. package/dist/query/reduce/index.js +10 -10
  291. package/dist/query/relate/index.js +10 -10
  292. package/dist/reduce/index.js +8 -8
  293. package/dist/register-YJ5YLQ36.js +30 -0
  294. package/dist/registry-ICOHBQFD.js +8 -0
  295. package/dist/registry-MJ7MWCSW.js +35 -0
  296. package/dist/registry-MVEKKGWL.js +23 -0
  297. package/dist/registry-XP744FAP.js +8 -0
  298. package/dist/request-withdrawal-LSU4G6W3.js +28 -0
  299. package/dist/restore-to-DVBHAQAA.js +66 -0
  300. package/dist/restore-to-DVBHAQAA.js.map +1 -0
  301. package/dist/{reveal-B2TLP4JQ.js → reveal-AIHOIK2N.js} +7 -7
  302. package/dist/revoke-QUT7WWG3.js +24 -0
  303. package/dist/satellites/index.js +1 -1
  304. package/dist/schema-update/index.js +2 -2
  305. package/dist/sealed-record/index.js +11 -11
  306. package/dist/search/index.js +4 -4
  307. package/dist/{seed-XNSE4U3S.js → seed-GFLA4FCK.js} +136 -27
  308. package/dist/seed-GFLA4FCK.js.map +1 -0
  309. package/dist/sequence/index.js +8 -8
  310. package/dist/session/index.js +8 -8
  311. package/dist/shadow/index.js +2 -2
  312. package/dist/signer-NYR4I3FO.js +23 -0
  313. package/dist/snapshots/index.js +9 -9
  314. package/dist/{stale-6GCFMOOR.js → stale-PIJPAL5T.js} +9 -9
  315. package/dist/storage-VH6SPXHC.js +21 -0
  316. package/dist/{store-coordination-provider-C4BPT5XF.js → store-coordination-provider-2KSHCOPU.js} +9 -9
  317. package/dist/sync/index.js +19 -13
  318. package/dist/sync/index.js.map +1 -1
  319. package/dist/team/index.js +17 -15
  320. package/dist/tiers/index.js +10 -10
  321. package/dist/to/index.js +2 -2
  322. package/dist/transactions/index.js +3 -3
  323. package/dist/util/index.js +1 -1
  324. package/dist/vault-head/index.js +8 -8
  325. package/dist/{verify-UKALW7C2.js → verify-PCFS4PNS.js} +7 -7
  326. package/dist/via/classified/presets.d.ts +29 -0
  327. package/dist/via/classified/resolve.d.ts +7 -0
  328. package/dist/via/geo/binding.d.ts +0 -4
  329. package/dist/via/lookup/index.d.ts +32 -0
  330. package/dist/via/money/binding.d.ts +0 -9
  331. package/dist/walk-OZCN6LJS.js +20 -0
  332. package/dist/with-audit/attestation/strategy.d.ts +2 -1
  333. package/dist/with-audit/attestation/vault-facade.d.ts +7 -0
  334. package/dist/with-audit/forget/completeness.d.ts +66 -0
  335. package/dist/with-audit/forget/index.d.ts +2 -0
  336. package/dist/with-audit/forget/strategy.d.ts +65 -0
  337. package/dist/with-audit/guards/types.d.ts +2 -0
  338. package/dist/with-audit/periods/periods.d.ts +0 -9
  339. package/dist/with-audit/periods/reserved-collections.d.ts +7 -0
  340. package/dist/with-audit/portability/request-withdrawal.d.ts +0 -1
  341. package/dist/with-audit/portability/withdraw-accessible.d.ts +0 -1
  342. package/dist/with-audit/tiers/index.d.ts +6 -6
  343. package/dist/with-audit/tiers/strategy.d.ts +19 -0
  344. package/dist/with-cargo/extract-partition.d.ts +0 -46
  345. package/dist/with-commit/history/history.d.ts +16 -0
  346. package/dist/with-commit/history/restore-to.d.ts +40 -0
  347. package/dist/with-commit/numbering/index.d.ts +0 -2
  348. package/dist/with-commit/tx/transaction.d.ts +2 -24
  349. package/dist/with-commit/vault-head/strategy.d.ts +7 -0
  350. package/dist/with-fork/snapshots/noydb-facade.d.ts +7 -0
  351. package/dist/with-formula/derivations/trigger-match.d.ts +8 -5
  352. package/dist/with-formula/materialized-views/emit-memo.d.ts +0 -2
  353. package/dist/with-lookup/embeddings/index.d.ts +1 -2
  354. package/dist/with-lookup/indexing/collection-facade.d.ts +1 -15
  355. package/dist/with-lookup/indexing/eager-indexes.d.ts +2 -1
  356. package/dist/with-lookup/search/collection-facade.d.ts +0 -12
  357. package/dist/with-party/broker/index.d.ts +2 -2
  358. package/dist/with-party/broker/seed.d.ts +29 -10
  359. package/dist/with-party/custody/strategy.d.ts +2 -2
  360. package/dist/with-party/policy/noydb-facade.d.ts +1 -31
  361. package/dist/with-party/team/delegation.d.ts +93 -7
  362. package/dist/with-party/team/echo-secret.d.ts +0 -2
  363. package/dist/with-party/team/index.d.ts +2 -0
  364. package/dist/with-party/team/keyring.d.ts +133 -24
  365. package/dist/with-party/team/magic-link-grant.d.ts +11 -1
  366. package/dist/with-party/team/noydb-facade.d.ts +19 -2
  367. package/dist/with-party/team/reserved-secret-collections.d.ts +10 -8
  368. package/dist/with-party/team/roster-tag.d.ts +42 -1
  369. package/dist/with-party/team/tiers.d.ts +36 -5
  370. package/dist/with-pod/backup.d.ts +9 -17
  371. package/dist/with-shape/blobs/blob-set.d.ts +23 -0
  372. package/dist/with-shape/blobs/legacy-sweep.d.ts +16 -0
  373. package/dist/with-shape/introspection/describe.d.ts +1 -2
  374. package/dist/with-shape/introspection/index.d.ts +1 -0
  375. package/dist/with-shape/introspection/types.d.ts +2 -1
  376. package/dist/with-shape/schema-update/fence.d.ts +7 -0
  377. package/dist/with-sync/active.d.ts +28 -1
  378. package/dist/with-sync/engine.d.ts +88 -2
  379. package/dist/with-sync/index.d.ts +1 -0
  380. package/dist/with-sync/reserved-mirror.d.ts +112 -0
  381. package/dist/with-sync/strategy.d.ts +9 -0
  382. package/dist/with-sync/tab-write-relay.d.ts +0 -10
  383. package/dist/withdraw-accessible-MTFP7OIB.js +25 -0
  384. package/dist/withdraw-accessible-MTFP7OIB.js.map +1 -0
  385. package/package.json +3 -3
  386. package/dist/api-OS747DS4.js +0 -18
  387. package/dist/backup-YE2VQ26S.js.map +0 -1
  388. package/dist/chunk-2AFX33YA.js.map +0 -1
  389. package/dist/chunk-2RH777HH.js +0 -126
  390. package/dist/chunk-2RH777HH.js.map +0 -1
  391. package/dist/chunk-37EPTBBR.js.map +0 -1
  392. package/dist/chunk-5KC7QYEC.js.map +0 -1
  393. package/dist/chunk-7XMHMVTS.js +0 -20
  394. package/dist/chunk-7XMHMVTS.js.map +0 -1
  395. package/dist/chunk-A4XMIZT3.js.map +0 -1
  396. package/dist/chunk-DHHGL42E.js.map +0 -1
  397. package/dist/chunk-DQESF6RP.js.map +0 -1
  398. package/dist/chunk-EGVJ7TM4.js.map +0 -1
  399. package/dist/chunk-EYG2CY2X.js.map +0 -1
  400. package/dist/chunk-EZGV6F47.js.map +0 -1
  401. package/dist/chunk-FFWI7UH7.js.map +0 -1
  402. package/dist/chunk-G2MVBDFP.js.map +0 -1
  403. package/dist/chunk-GUZET4SG.js.map +0 -1
  404. package/dist/chunk-GZT3NQRA.js.map +0 -1
  405. package/dist/chunk-H23XHRTT.js.map +0 -1
  406. package/dist/chunk-H7JBY4P7.js.map +0 -1
  407. package/dist/chunk-IMQKWR46.js.map +0 -1
  408. package/dist/chunk-IUBMZPHM.js.map +0 -1
  409. package/dist/chunk-IUT3GWP3.js.map +0 -1
  410. package/dist/chunk-JDEYF3PJ.js.map +0 -1
  411. package/dist/chunk-JSMTXZR3.js.map +0 -1
  412. package/dist/chunk-LGNDFRYC.js.map +0 -1
  413. package/dist/chunk-LNSVGRHO.js.map +0 -1
  414. package/dist/chunk-MILI22XQ.js.map +0 -1
  415. package/dist/chunk-MXOQ5JCG.js.map +0 -1
  416. package/dist/chunk-NBQ3KK6X.js.map +0 -1
  417. package/dist/chunk-OIEO4WDL.js.map +0 -1
  418. package/dist/chunk-PD64727P.js.map +0 -1
  419. package/dist/chunk-RHVMZSUU.js.map +0 -1
  420. package/dist/chunk-SV2PM2OY.js.map +0 -1
  421. package/dist/chunk-T7IR4N2S.js.map +0 -1
  422. package/dist/chunk-UA372JHH.js.map +0 -1
  423. package/dist/chunk-UBSFPGVJ.js +0 -1
  424. package/dist/chunk-V3RWOOSO.js.map +0 -1
  425. package/dist/chunk-VAORSCSU.js.map +0 -1
  426. package/dist/chunk-XSPFDUDG.js.map +0 -1
  427. package/dist/chunk-Y3LPTBG7.js.map +0 -1
  428. package/dist/collection-facade-CS7CA2XO.js +0 -47
  429. package/dist/delegation-NANZDG4N.js +0 -102
  430. package/dist/delegation-NANZDG4N.js.map +0 -1
  431. package/dist/derive-XLOJVXPU.js +0 -20
  432. package/dist/executor-FMPVN6DT.js +0 -35
  433. package/dist/executor-LBBBRTN5.js +0 -8
  434. package/dist/executor-OSRZST2U.js +0 -8
  435. package/dist/export-accessible-RAOJAAU5.js +0 -22
  436. package/dist/extract-partition-JD5CUSTG.js +0 -37
  437. package/dist/find-JRN4RNQ5.js +0 -10
  438. package/dist/issue-YIVBZUTH.js +0 -19
  439. package/dist/liberate-WZSZM2W6.js +0 -24
  440. package/dist/noydb-ITIGNKUF.js +0 -96
  441. package/dist/register-DT5HZ2LZ.js +0 -30
  442. package/dist/registry-BHRZGZHF.js +0 -8
  443. package/dist/registry-ET6ZFFWA.js +0 -34
  444. package/dist/registry-HXFGLGTG.js +0 -8
  445. package/dist/registry-THCPDEOD.js +0 -23
  446. package/dist/request-withdrawal-AV2MJJKY.js +0 -30
  447. package/dist/revoke-6DWIEOCV.js +0 -24
  448. package/dist/seed-XNSE4U3S.js.map +0 -1
  449. package/dist/signer-MHGW3OIL.js +0 -23
  450. package/dist/storage-BYN5LO6Z.js +0 -21
  451. package/dist/walk-4VPK7AS4.js +0 -20
  452. package/dist/withdraw-accessible-HL7GACUE.js +0 -27
  453. /package/dist/{api-OS747DS4.js.map → api-6EFD43KN.js.map} +0 -0
  454. /package/dist/{capsule-VOLX3QRQ.js.map → capsule-6LJAVQNM.js.map} +0 -0
  455. /package/dist/{chunk-OYW3I5M4.js.map → chunk-2DOCDOPL.js.map} +0 -0
  456. /package/dist/{chunk-UBSFPGVJ.js.map → chunk-2DX4JCRI.js.map} +0 -0
  457. /package/dist/{chunk-FLPCETP6.js.map → chunk-2LBS62AC.js.map} +0 -0
  458. /package/dist/{chunk-WXE4W2U6.js.map → chunk-2ST3WA3C.js.map} +0 -0
  459. /package/dist/{chunk-O2IMQSNA.js.map → chunk-3YBIVLTC.js.map} +0 -0
  460. /package/dist/{chunk-DIZLQVAA.js.map → chunk-4CHM2TRS.js.map} +0 -0
  461. /package/dist/{chunk-V7ADQF5O.js.map → chunk-4CUJLEOA.js.map} +0 -0
  462. /package/dist/{chunk-3EWS67C7.js.map → chunk-4TG2ITRW.js.map} +0 -0
  463. /package/dist/{chunk-HS554XAF.js.map → chunk-5HQFROZS.js.map} +0 -0
  464. /package/dist/{chunk-PP3K67AJ.js.map → chunk-654RE5YC.js.map} +0 -0
  465. /package/dist/{chunk-FOEDQATO.js.map → chunk-66GD7XXU.js.map} +0 -0
  466. /package/dist/{chunk-BNWA3WG5.js.map → chunk-72FQ46VW.js.map} +0 -0
  467. /package/dist/{chunk-JQYKPKG6.js.map → chunk-7K42TSCY.js.map} +0 -0
  468. /package/dist/{chunk-UEFOQH74.js.map → chunk-ADCXTW7L.js.map} +0 -0
  469. /package/dist/{chunk-MBMTND6D.js.map → chunk-AGGPT4UE.js.map} +0 -0
  470. /package/dist/{chunk-RB4DOPGZ.js.map → chunk-AKIEBFIJ.js.map} +0 -0
  471. /package/dist/{chunk-VHBKYN2J.js.map → chunk-B3B6HV5S.js.map} +0 -0
  472. /package/dist/{chunk-JWWYRR4Q.js.map → chunk-B6EWMGFX.js.map} +0 -0
  473. /package/dist/{chunk-WPOYWFSE.js.map → chunk-BJRKXNFP.js.map} +0 -0
  474. /package/dist/{chunk-H427H63K.js.map → chunk-BPQ5CRJF.js.map} +0 -0
  475. /package/dist/{chunk-VFHCKG5M.js.map → chunk-BVRJYMFZ.js.map} +0 -0
  476. /package/dist/{chunk-SMV2HRDU.js.map → chunk-DFC4WTJW.js.map} +0 -0
  477. /package/dist/{chunk-5A4345TG.js.map → chunk-DMIEKD24.js.map} +0 -0
  478. /package/dist/{chunk-TKVUE4JF.js.map → chunk-DQAXA2GK.js.map} +0 -0
  479. /package/dist/{chunk-AL6ML4LA.js.map → chunk-DWCFGF2K.js.map} +0 -0
  480. /package/dist/{chunk-QBLT6POL.js.map → chunk-FPF5HRBE.js.map} +0 -0
  481. /package/dist/{chunk-5WWDGFOS.js.map → chunk-GIQJGXV7.js.map} +0 -0
  482. /package/dist/{chunk-BVCUTXE3.js.map → chunk-H334G6KU.js.map} +0 -0
  483. /package/dist/{chunk-AEQGFRU4.js.map → chunk-HE7EAHGS.js.map} +0 -0
  484. /package/dist/{chunk-4V3Q35WG.js.map → chunk-ICF3TIGY.js.map} +0 -0
  485. /package/dist/{chunk-3L2NBKDR.js.map → chunk-IF2M43G4.js.map} +0 -0
  486. /package/dist/{chunk-AUKKUPVB.js.map → chunk-IVLRPRXM.js.map} +0 -0
  487. /package/dist/{chunk-Y2RKVFKR.js.map → chunk-K4JSTGXT.js.map} +0 -0
  488. /package/dist/{chunk-EJLV62NI.js.map → chunk-KN4LUMH6.js.map} +0 -0
  489. /package/dist/{chunk-23D6M6VM.js.map → chunk-KZA3DITX.js.map} +0 -0
  490. /package/dist/{chunk-E2N2T5ZO.js.map → chunk-L2VM64HK.js.map} +0 -0
  491. /package/dist/{chunk-O46CHQT7.js.map → chunk-MAQBYBUX.js.map} +0 -0
  492. /package/dist/{chunk-EZOAKKTB.js.map → chunk-MBPZMZVB.js.map} +0 -0
  493. /package/dist/{chunk-XQRFSKYM.js.map → chunk-MCNNZBG7.js.map} +0 -0
  494. /package/dist/{chunk-YRXFFWG4.js.map → chunk-MLVPMDOZ.js.map} +0 -0
  495. /package/dist/{chunk-5FE75J4S.js.map → chunk-MMCN7TLK.js.map} +0 -0
  496. /package/dist/{chunk-SYNY3VB5.js.map → chunk-NCTN2FW4.js.map} +0 -0
  497. /package/dist/{chunk-4T3SE27M.js.map → chunk-ND6S2DKC.js.map} +0 -0
  498. /package/dist/{chunk-3XJQBBZD.js.map → chunk-NTVKHQ3L.js.map} +0 -0
  499. /package/dist/{chunk-Q4UHJ5SN.js.map → chunk-O2VQ3K36.js.map} +0 -0
  500. /package/dist/{chunk-2GHDLTPE.js.map → chunk-OGKMRIIJ.js.map} +0 -0
  501. /package/dist/{chunk-N7EVQD5S.js.map → chunk-ONZ3B5EW.js.map} +0 -0
  502. /package/dist/{chunk-VKI2EB3N.js.map → chunk-OOPSMQX5.js.map} +0 -0
  503. /package/dist/{chunk-VMV5SBE4.js.map → chunk-OYEBSWLE.js.map} +0 -0
  504. /package/dist/{chunk-VVOLDVIR.js.map → chunk-PLTIJDQN.js.map} +0 -0
  505. /package/dist/{chunk-OKSTSITU.js.map → chunk-PR7ILCIH.js.map} +0 -0
  506. /package/dist/{chunk-7R2Q7CPL.js.map → chunk-QE3TLZ6Z.js.map} +0 -0
  507. /package/dist/{chunk-6QVKPHBF.js.map → chunk-QHG7GQKM.js.map} +0 -0
  508. /package/dist/{chunk-LIOVX5TJ.js.map → chunk-QT5ITL25.js.map} +0 -0
  509. /package/dist/{chunk-Q2XRFWOI.js.map → chunk-RRTQAQ3N.js.map} +0 -0
  510. /package/dist/{chunk-2PVXF5CS.js.map → chunk-SALY3LIJ.js.map} +0 -0
  511. /package/dist/{chunk-JOSPH3E5.js.map → chunk-SBAR5JQ6.js.map} +0 -0
  512. /package/dist/{chunk-N7UDP5VU.js.map → chunk-SCH2F7R2.js.map} +0 -0
  513. /package/dist/{chunk-MXKI4ABF.js.map → chunk-SOOAW6HK.js.map} +0 -0
  514. /package/dist/{chunk-TEHHROZL.js.map → chunk-T5EXREMW.js.map} +0 -0
  515. /package/dist/{chunk-M5B2W6YY.js.map → chunk-TDJVQTXD.js.map} +0 -0
  516. /package/dist/{chunk-QMWY2FDS.js.map → chunk-THQ3BHLM.js.map} +0 -0
  517. /package/dist/{chunk-FVH5QYY2.js.map → chunk-TRHUNPXP.js.map} +0 -0
  518. /package/dist/{chunk-747G6CT3.js.map → chunk-UORWAG7K.js.map} +0 -0
  519. /package/dist/{chunk-TZZBXPZK.js.map → chunk-VLQ6KT7F.js.map} +0 -0
  520. /package/dist/{chunk-NCO25JZO.js.map → chunk-VP37VUKQ.js.map} +0 -0
  521. /package/dist/{chunk-52MGURXO.js.map → chunk-WBUHHMLN.js.map} +0 -0
  522. /package/dist/{chunk-2MG3SW7Q.js.map → chunk-X6Z2SIRF.js.map} +0 -0
  523. /package/dist/{chunk-5UMK7GRI.js.map → chunk-XPNJH7GN.js.map} +0 -0
  524. /package/dist/{chunk-KZXDLBY6.js.map → chunk-XPW7T2GN.js.map} +0 -0
  525. /package/dist/{chunk-FFJFE4T7.js.map → chunk-YJGKOSQD.js.map} +0 -0
  526. /package/dist/{chunk-4JPMZTJY.js.map → chunk-ZF7KNSLU.js.map} +0 -0
  527. /package/dist/{chunk-2ODVB6LZ.js.map → chunk-ZGKODRGB.js.map} +0 -0
  528. /package/dist/{chunk-JIBUPZHA.js.map → chunk-ZNEKQFGF.js.map} +0 -0
  529. /package/dist/{chunk-DLD5LGDS.js.map → chunk-ZUTUNVFD.js.map} +0 -0
  530. /package/dist/{classified-marker-SIYKUU5L.js.map → classified-marker-WKP33U2R.js.map} +0 -0
  531. /package/dist/{collection-facade-CS7CA2XO.js.map → collection-facade-COSGZKLC.js.map} +0 -0
  532. /package/dist/{computed-FAD7SED4.js.map → computed-WN6V53ZV.js.map} +0 -0
  533. /package/dist/{dead-filter-4F3LWYKH.js.map → dead-filter-43WL3Y5H.js.map} +0 -0
  534. /package/dist/{derive-XLOJVXPU.js.map → delegation-5UWT4JGT.js.map} +0 -0
  535. /package/dist/{executor-FMPVN6DT.js.map → derive-IL5JNLEE.js.map} +0 -0
  536. /package/dist/{dispatch-JDZNGEB3.js.map → dispatch-LOQQD5JK.js.map} +0 -0
  537. /package/dist/{dispatch-H4HV32AM.js.map → dispatch-SHKTG57L.js.map} +0 -0
  538. /package/dist/{executor-LBBBRTN5.js.map → executor-6PQ7WAGV.js.map} +0 -0
  539. /package/dist/{executor-OSRZST2U.js.map → executor-6ZPQA6HS.js.map} +0 -0
  540. /package/dist/{export-accessible-RAOJAAU5.js.map → executor-OXRA64TY.js.map} +0 -0
  541. /package/dist/{extract-partition-JD5CUSTG.js.map → export-accessible-XG3FKJWW.js.map} +0 -0
  542. /package/dist/{find-JRN4RNQ5.js.map → extract-partition-33747NY5.js.map} +0 -0
  543. /package/dist/{fanout-sidecar-L7NHPIOC.js.map → fanout-sidecar-NEB6IYV7.js.map} +0 -0
  544. /package/dist/{issue-YIVBZUTH.js.map → find-VW543G3J.js.map} +0 -0
  545. /package/dist/{ledger-5ZMGE44K.js.map → issue-4ZPSY44M.js.map} +0 -0
  546. /package/dist/{liberate-WZSZM2W6.js.map → ledger-MZ25UFT2.js.map} +0 -0
  547. /package/dist/{link-set-MFXC24VK.js.map → liberate-OJIP2ZFX.js.map} +0 -0
  548. /package/dist/{managed-secret-MFTFT22X.js.map → link-set-4FRRAVTH.js.map} +0 -0
  549. /package/dist/{noydb-ITIGNKUF.js.map → managed-secret-SQWO2EUR.js.map} +0 -0
  550. /package/dist/{migrate-cek-DZRFFOHW.js.map → migrate-cek-JWEM4RP6.js.map} +0 -0
  551. /package/dist/{register-DT5HZ2LZ.js.map → noydb-U62OVKXB.js.map} +0 -0
  552. /package/dist/{pod-handle-A3LET7NO.js.map → pod-handle-R6Y4MILX.js.map} +0 -0
  553. /package/dist/{post-register-7ND27CF2.js.map → post-register-GRVQHBOH.js.map} +0 -0
  554. /package/dist/{registry-BHRZGZHF.js.map → register-YJ5YLQ36.js.map} +0 -0
  555. /package/dist/{registry-ET6ZFFWA.js.map → registry-ICOHBQFD.js.map} +0 -0
  556. /package/dist/{registry-HXFGLGTG.js.map → registry-MJ7MWCSW.js.map} +0 -0
  557. /package/dist/{registry-THCPDEOD.js.map → registry-MVEKKGWL.js.map} +0 -0
  558. /package/dist/{request-withdrawal-AV2MJJKY.js.map → registry-XP744FAP.js.map} +0 -0
  559. /package/dist/{revoke-6DWIEOCV.js.map → request-withdrawal-LSU4G6W3.js.map} +0 -0
  560. /package/dist/{reveal-B2TLP4JQ.js.map → reveal-AIHOIK2N.js.map} +0 -0
  561. /package/dist/{signer-MHGW3OIL.js.map → revoke-QUT7WWG3.js.map} +0 -0
  562. /package/dist/{stale-6GCFMOOR.js.map → signer-NYR4I3FO.js.map} +0 -0
  563. /package/dist/{storage-BYN5LO6Z.js.map → stale-PIJPAL5T.js.map} +0 -0
  564. /package/dist/{walk-4VPK7AS4.js.map → storage-VH6SPXHC.js.map} +0 -0
  565. /package/dist/{store-coordination-provider-C4BPT5XF.js.map → store-coordination-provider-2KSHCOPU.js.map} +0 -0
  566. /package/dist/{verify-UKALW7C2.js.map → verify-PCFS4PNS.js.map} +0 -0
  567. /package/dist/{withdraw-accessible-HL7GACUE.js.map → walk-OZCN6LJS.js.map} +0 -0
@@ -5,10 +5,13 @@ import {
5
5
  readDirectoryConfig,
6
6
  readUserVisibility,
7
7
  saveUserEnvelope
8
- } from "./chunk-LIOVX5TJ.js";
8
+ } from "./chunk-QT5ITL25.js";
9
+ import {
10
+ keyringClearance
11
+ } from "./chunk-NXQEOC3X.js";
9
12
  import {
10
13
  parseDekKey
11
- } from "./chunk-FLPCETP6.js";
14
+ } from "./chunk-2LBS62AC.js";
12
15
  import {
13
16
  base64ToBuffer,
14
17
  bufferToBase64,
@@ -23,26 +26,38 @@ import {
23
26
  encrypt,
24
27
  encryptBytes,
25
28
  envelopeOpensUnderAny,
29
+ exportDekSet,
30
+ exportRecipientPrivateKeyPkcs8,
31
+ exportRecipientPublicKeySpki,
26
32
  generateDEK,
33
+ generateRecipientKeyPair,
27
34
  generateSalt,
28
35
  hasSealedBody,
36
+ importDekSet,
37
+ importRecipientKeyPair,
38
+ importRecipientPublicKeySpki,
39
+ importTransferKey,
29
40
  mintCanary,
41
+ recipientUnwrap,
42
+ recipientWrap,
30
43
  rekeyBlobSet,
31
44
  rekeyEnvelopeIfNeeded,
32
45
  unwrapKey,
33
46
  wrapKey
34
- } from "./chunk-EZGV6F47.js";
47
+ } from "./chunk-WRLWEYHY.js";
35
48
  import {
36
49
  NOYDB_KEYRING_VERSION
37
- } from "./chunk-SV2PM2OY.js";
50
+ } from "./chunk-XX4R7TUB.js";
38
51
  import {
39
52
  BLOB_ADDRESS_KEY_ID,
40
53
  DirectoryDisabledError,
41
54
  EchoCeremonyRequiredError,
55
+ INBOX_KEY_ID,
42
56
  InvalidKeyError,
43
57
  KeyringCorruptError,
44
58
  KeyringExpiredError,
45
59
  KeyringTamperedError,
60
+ MemberInboxMissingError,
46
61
  NoAccessError,
47
62
  NoydbError,
48
63
  PermissionDeniedError,
@@ -51,8 +66,9 @@ import {
51
66
  TamperedError,
52
67
  USER_ENVELOPE_COLLECTION,
53
68
  ValidationError,
54
- WrongPromptError
55
- } from "./chunk-37EPTBBR.js";
69
+ WrongPromptError,
70
+ isConflictError
71
+ } from "./chunk-IKPQ2GGB.js";
56
72
 
57
73
  // src/with-party/team/roster-epoch.ts
58
74
  function assertRosterEpochCurrent(found, expected, userId) {
@@ -121,7 +137,36 @@ function rosterCanonical(file) {
121
137
  // the tag stops verifying, so a store cannot downgrade a file to the
122
138
  // no-epoch shape. It can only replay a file that genuinely never had one,
123
139
  // which is why absence must read as UNKNOWN rather than as zero.
124
- ...file.roster_epoch !== void 0 ? { roster_epoch: file.roster_epoch } : {}
140
+ ...file.roster_epoch !== void 0 ? { roster_epoch: file.roster_epoch } : {},
141
+ // core#58 — the advisory clearance, bound ONLY WHEN PRESENT.
142
+ //
143
+ // ⛔ The conditional spread is mandatory here for the identical reason
144
+ // given for `roster_epoch` directly above: `file.clearance ?? null` would
145
+ // change the canonical string for every keyring written before this field
146
+ // existed, fail every one of their tags, and render every existing vault
147
+ // unopenable. Do not "tidy" it into the `?? null` shape the older optional
148
+ // fields use.
149
+ //
150
+ // ⚠️ Why bind it at all, when it is DERIVED from `dek_slots` which is
151
+ // already bound? Because "derived" is a property of how WE write it, not of
152
+ // what a store must send back. Binding it costs one conditional and makes a
153
+ // forged value fail the tag instead of merely disagreeing with the slots —
154
+ // which is the difference between a caught tamper and a silent one, for a
155
+ // reader who trusted the cheap number. It is defence in depth for a field
156
+ // whose whole risk is being read instead of the DEK map.
157
+ ...file.clearance !== void 0 ? { clearance: file.clearance } : {},
158
+ // core#96 — the inbox PUBLIC KEY and the PENDING SLOT NAMES, bound ONLY
159
+ // WHEN PRESENT (same conditional spread, same reason as the two above).
160
+ //
161
+ // `inbox_pub`: an amend seals DEKs to this key, so a store that could swap
162
+ // it for its own would read every DEK delivered afterwards. Bound, a swap
163
+ // fails the tag before anything is sealed to it.
164
+ // `inbox_slots`: `revoke` rotates what the target's file NAMES; a pending
165
+ // delivery is a DEK the target may hold, so its names must be as
166
+ // unstrippable as `dek_slots`. Contents are self-authenticating (AES-GCM
167
+ // under a CEK only the private half unwraps) and stay out.
168
+ ...file.inbox_key !== void 0 ? { inbox_pub: file.inbox_key.pub } : {},
169
+ ...file.inbox !== void 0 ? { inbox_slots: [...new Set(file.inbox.flatMap((box) => box.slots))].sort() } : {}
125
170
  });
126
171
  }
127
172
  async function mintRosterTag(file, rosterKey) {
@@ -161,6 +206,13 @@ function mismatchReason(file) {
161
206
  if (file._noydb_keyring !== NOYDB_KEYRING_VERSION) return "format-superseded";
162
207
  return "roster-tag-mismatch";
163
208
  }
209
+ function stampAuthority(authority, previousEpoch) {
210
+ return {
211
+ ...authority,
212
+ roster_epoch: nextRosterEpoch(previousEpoch),
213
+ clearance: keyringClearance(Object.keys(authority.deks ?? {}))
214
+ };
215
+ }
164
216
 
165
217
  // src/kernel/validation.ts
166
218
  var WeakSecretError = class extends NoydbError {
@@ -366,9 +418,11 @@ async function verifyTypedEcho(block, echo) {
366
418
  // src/with-party/team/reserved-secret-collections.ts
367
419
  var SYNC_CREDENTIALS_COLLECTION = "_sync_credentials";
368
420
  var BROKER_COLLECTION = "_broker";
421
+ var BROKER_MEMBER_COLLECTION = "_broker_member";
369
422
  var SECRET_BEARING_RESERVED_COLLECTIONS = /* @__PURE__ */ new Set([
370
423
  SYNC_CREDENTIALS_COLLECTION,
371
- BROKER_COLLECTION
424
+ BROKER_COLLECTION,
425
+ BROKER_MEMBER_COLLECTION
372
426
  ]);
373
427
  function isSecretBearingReservedCollection(name) {
374
428
  return SECRET_BEARING_RESERVED_COLLECTIONS.has(name);
@@ -452,7 +506,10 @@ async function loadKeyring(store, vault, opts) {
452
506
  }
453
507
  const { file: keyringFile } = found;
454
508
  const salt = base64ToBuffer(keyringFile.salt);
455
- const kek = await deriveKekForKeyring(keyringFile, secret, salt);
509
+ if (opts.kek === void 0 && secret === void 0) {
510
+ throw new ValidationError(`loadKeyring: one of \`secret\` / \`kek\` is required (user "${userId}").`);
511
+ }
512
+ const kek = opts.kek ?? await deriveKekForKeyring(keyringFile, secret, salt);
456
513
  if (keyringFile.canary === void 0) {
457
514
  throw new KeyringTamperedError({ userId, reason: "canary-missing" });
458
515
  }
@@ -491,7 +548,13 @@ async function loadKeyring(store, vault, opts) {
491
548
  }
492
549
  await assertRosterAuthenticated(keyringFile, deks, userId);
493
550
  assertKeyringNotExpired(keyringFile);
494
- return {
551
+ let drained = false;
552
+ const inboxKeyAes = deks.get(INBOX_KEY_ID);
553
+ if (keyringFile.inbox !== void 0 && keyringFile.inbox.length > 0 && inboxKeyAes !== void 0) {
554
+ for (const [name, dek] of await openInbox(keyringFile, inboxKeyAes)) deks.set(name, dek);
555
+ drained = true;
556
+ }
557
+ const unlocked = {
495
558
  userId: keyringFile.user_id,
496
559
  displayName: keyringFile.display_name,
497
560
  role: keyringFile.role,
@@ -505,6 +568,8 @@ async function loadKeyring(store, vault, opts) {
505
568
  ...keyringFile.import_capability !== void 0 && { importCapability: keyringFile.import_capability },
506
569
  ...keyringFile.policy !== void 0 && { policy: keyringFile.policy }
507
570
  };
571
+ if (drained) await persistKeyring(store, vault, unlocked);
572
+ return unlocked;
508
573
  }
509
574
  async function assertKeyringOpenAllowed(store, vault, userId, create) {
510
575
  const keyringUsers = await store.list(vault, "_keyring");
@@ -537,6 +602,7 @@ async function createOwnerKeyring(store, vault, opts) {
537
602
  const wrappedRosterKey = await wrapKey(rosterKey, kek);
538
603
  const blobAddressKey = await generateDEK();
539
604
  const wrappedBlobAddressKey = await wrapKey(blobAddressKey, kek);
605
+ const inbox = await mintInboxKey(kek);
540
606
  const canary = await mintKeyringCanary(kek);
541
607
  const authority = {
542
608
  user_id: userId,
@@ -550,10 +616,13 @@ async function createOwnerKeyring(store, vault, opts) {
550
616
  deks: {
551
617
  [USER_ENVELOPE_COLLECTION]: wrappedUserEnvelopeDek,
552
618
  [ROSTER_KEY_ID]: wrappedRosterKey,
553
- [BLOB_ADDRESS_KEY_ID]: wrappedBlobAddressKey
554
- }
619
+ [BLOB_ADDRESS_KEY_ID]: wrappedBlobAddressKey,
620
+ [INBOX_KEY_ID]: inbox.wrappedInboxKey
621
+ },
622
+ inbox_key: inbox.inboxKey
623
+ // core#65 — tag-bound, like every other keyring's
555
624
  };
556
- const withEpoch = { ...authorityWithDeks, roster_epoch: nextRosterEpoch(void 0) };
625
+ const withEpoch = stampAuthority(authorityWithDeks, void 0);
557
626
  const keyringFile = {
558
627
  _noydb_keyring: NOYDB_KEYRING_VERSION,
559
628
  ...withEpoch,
@@ -571,7 +640,7 @@ async function createOwnerKeyring(store, vault, opts) {
571
640
  )
572
641
  } : {}
573
642
  };
574
- await writeKeyringFile(store, vault, userId, keyringFile);
643
+ await writeKeyringFile(store, vault, userId, keyringFile, "create");
575
644
  return {
576
645
  userId,
577
646
  displayName: userId,
@@ -579,13 +648,41 @@ async function createOwnerKeyring(store, vault, opts) {
579
648
  permissions: {},
580
649
  deks: /* @__PURE__ */ new Map([
581
650
  [USER_ENVELOPE_COLLECTION, userEnvelopeDek],
582
- [ROSTER_KEY_ID, rosterKey]
651
+ [ROSTER_KEY_ID, rosterKey],
652
+ [INBOX_KEY_ID, inbox.inboxKeyAes]
653
+ // core#65 — in the SESSION too, not only the file: it opens this owner's own inbox
583
654
  ]),
584
655
  kek,
585
656
  salt,
586
657
  authenticators: []
587
658
  };
588
659
  }
660
+ function selectGranteeDekNames(role, requested, permissions, callerDeks) {
661
+ const mayHoldSecrets = role === "owner" || role === "admin";
662
+ const admits = (name) => name !== INBOX_KEY_ID && name !== BROKER_MEMBER_COLLECTION && !(isSecretBearingReservedCollection(name) && !mayHoldSecrets);
663
+ const selected = /* @__PURE__ */ new Set();
664
+ for (const collName of Object.keys(permissions)) {
665
+ if (collName === PERMISSION_WILDCARD) continue;
666
+ if (admits(collName) && callerDeks.has(collName)) selected.add(collName);
667
+ }
668
+ const wrapAll = role === "owner" || role === "admin" || role === "custodian" || role === "viewer" || permissionsAreWildcard(requested);
669
+ for (const name of callerDeks.keys()) {
670
+ if ((wrapAll || name.startsWith("_")) && admits(name)) selected.add(name);
671
+ }
672
+ return [...selected];
673
+ }
674
+ async function mintMissingDeksForGrant(store, vault, callerKeyring, permissions, mayHoldSecrets) {
675
+ let minted = false;
676
+ for (const collName of Object.keys(permissions)) {
677
+ if (collName === PERMISSION_WILDCARD) continue;
678
+ if (isSecretBearingReservedCollection(collName) && !mayHoldSecrets) continue;
679
+ if (callerKeyring.deks.has(collName)) continue;
680
+ if (await collectionHasRecords(store, vault, collName)) continue;
681
+ callerKeyring.deks.set(collName, await generateDEK());
682
+ minted = true;
683
+ }
684
+ return minted;
685
+ }
589
686
  async function grant(store, vault, callerKeyring, options) {
590
687
  if (!callerKeyring.kek) {
591
688
  throw new ValidationError(
@@ -611,44 +708,24 @@ async function grant(store, vault, callerKeyring, options) {
611
708
  const newSalt = generateSalt();
612
709
  const newKek = await deriveKey(options.secret, newSalt);
613
710
  const granteeMayHoldSecrets = options.role === "owner" || options.role === "admin";
614
- let mintedForGrant = false;
615
- for (const collName of Object.keys(permissions)) {
616
- if (collName === PERMISSION_WILDCARD) continue;
617
- if (isSecretBearingReservedCollection(collName) && !granteeMayHoldSecrets) continue;
618
- if (callerKeyring.deks.has(collName)) continue;
619
- if (await collectionHasRecords(store, vault, collName)) continue;
620
- callerKeyring.deks.set(collName, await generateDEK());
621
- mintedForGrant = true;
622
- }
711
+ const mintedForGrant = await mintMissingDeksForGrant(store, vault, callerKeyring, permissions, granteeMayHoldSecrets);
623
712
  if (mintedForGrant) await persistKeyring(store, vault, callerKeyring);
624
713
  const previousGrantFound = await readKeyringFile(store, vault, options.userId);
625
714
  const previousDekNames = previousGrantFound ? new Set(Object.keys(previousGrantFound.file.deks)) : null;
626
715
  const wrappedDeks = {};
627
- for (const collName of Object.keys(permissions)) {
628
- if (collName === PERMISSION_WILDCARD) continue;
629
- if (isSecretBearingReservedCollection(collName) && !granteeMayHoldSecrets) continue;
630
- const dek = callerKeyring.deks.get(collName);
631
- if (dek) {
632
- wrappedDeks[collName] = await wrapKey(dek, newKek);
633
- }
634
- }
635
- if (options.role === "owner" || options.role === "admin" || options.role === "custodian" || options.role === "viewer" || permissionsAreWildcard(options.permissions)) {
636
- for (const [collName, dek] of callerKeyring.deks) {
637
- if (collName in wrappedDeks) continue;
638
- if (isSecretBearingReservedCollection(collName) && !granteeMayHoldSecrets) continue;
639
- wrappedDeks[collName] = await wrapKey(dek, newKek);
640
- }
641
- }
642
- for (const [collName, dek] of callerKeyring.deks) {
643
- if (!collName.startsWith("_") || collName in wrappedDeks) continue;
644
- if (isSecretBearingReservedCollection(collName) && !granteeMayHoldSecrets) continue;
645
- wrappedDeks[collName] = await wrapKey(dek, newKek);
716
+ for (const collName of selectGranteeDekNames(options.role, options.permissions, permissions, callerKeyring.deks)) {
717
+ wrappedDeks[collName] = await wrapKey(callerKeyring.deks.get(collName), newKek);
646
718
  }
647
719
  for (const collName of Object.keys(wrappedDeks)) {
648
720
  if (!callerKeyring.deks.has(collName)) {
649
721
  throw new PrivilegeEscalationError(collName);
650
722
  }
651
723
  }
724
+ if (!granteeMayHoldSecrets) {
725
+ wrappedDeks[BROKER_MEMBER_COLLECTION] = await wrapKey(await generateDEK(), newKek);
726
+ }
727
+ const inbox = await mintInboxKey(newKek);
728
+ wrappedDeks[INBOX_KEY_ID] = inbox.wrappedInboxKey;
652
729
  const canary = await mintKeyringCanary(newKek);
653
730
  const authority = {
654
731
  user_id: options.userId,
@@ -659,8 +736,8 @@ async function grant(store, vault, callerKeyring, options) {
659
736
  ...options.exportCapability !== void 0 && { export_capability: options.exportCapability },
660
737
  ...options.importCapability !== void 0 && { import_capability: options.importCapability }
661
738
  };
662
- const authorityWithDeks = { ...authority, deks: wrappedDeks };
663
- const withEpoch = { ...authorityWithDeks, roster_epoch: nextRosterEpoch(previousGrantFound?.file.roster_epoch) };
739
+ const authorityWithDeks = { ...authority, deks: wrappedDeks, inbox_key: inbox.inboxKey };
740
+ const withEpoch = stampAuthority(authorityWithDeks, previousGrantFound?.file.roster_epoch);
664
741
  const keyringFile = {
665
742
  _noydb_keyring: NOYDB_KEYRING_VERSION,
666
743
  ...withEpoch,
@@ -671,13 +748,13 @@ async function grant(store, vault, callerKeyring, options) {
671
748
  // propagation loop above, so they can verify this tag on first unlock.
672
749
  roster_tag: await mintRosterTag(withEpoch, callerRosterKey)
673
750
  };
674
- await writeKeyringFile(store, vault, options.userId, keyringFile);
751
+ await writeKeyringFile(store, vault, options.userId, keyringFile, basisOf(previousGrantFound));
675
752
  if (previousDekNames !== null && options.userId !== callerKeyring.userId) {
676
753
  const dropped = [...previousDekNames].filter(
677
754
  (name) => !name.startsWith("_") && !(name in wrappedDeks)
678
755
  );
679
756
  if (dropped.length > 0) {
680
- await rotateKeys(store, vault, callerKeyring, { collections: dropped });
757
+ await rotateKeys(store, vault, callerKeyring, { collections: dropped, exclude: [options.userId] });
681
758
  }
682
759
  }
683
760
  const userEnvelopeDek = callerKeyring.deks.get(USER_ENVELOPE_COLLECTION);
@@ -692,6 +769,12 @@ async function grant(store, vault, callerKeyring, options) {
692
769
  );
693
770
  }
694
771
  }
772
+ var NON_ROTATABLE_SLOTS = /* @__PURE__ */ new Set([
773
+ ROSTER_KEY_ID,
774
+ BLOB_ADDRESS_KEY_ID,
775
+ INBOX_KEY_ID,
776
+ BROKER_MEMBER_COLLECTION
777
+ ]);
695
778
  async function findAdminDescendants(store, vault, rootUserId, rosterKey) {
696
779
  const allUserIds = await store.list(vault, "_keyring");
697
780
  const childrenByParent = /* @__PURE__ */ new Map();
@@ -725,8 +808,8 @@ async function revoke(store, vault, callerKeyring, options) {
725
808
  if (!targetFound) {
726
809
  const pending = [...callerKeyring.pendingDeks?.keys() ?? []];
727
810
  if (pending.length > 0) {
728
- await rotateKeys(store, vault, callerKeyring, { collections: pending });
729
- return;
811
+ const resumed = await rotateKeys(store, vault, callerKeyring, { collections: pending });
812
+ return { rewritten: resumed.rewritten };
730
813
  }
731
814
  throw new NoAccessError(`User "${options.userId}" has no keyring in vault "${vault}"`);
732
815
  }
@@ -764,18 +847,24 @@ async function revoke(store, vault, callerKeyring, options) {
764
847
  await deleteUserEnvelope(store, vault, userId);
765
848
  await deleteUserVisibility(store, vault, userId);
766
849
  }
767
- affectedCollections.delete(ROSTER_KEY_ID);
768
- affectedCollections.delete(BLOB_ADDRESS_KEY_ID);
850
+ for (const slot of NON_ROTATABLE_SLOTS) affectedCollections.delete(slot);
851
+ for (const slot of inboxSlots(targetKeyring)) affectedCollections.add(slot);
852
+ let rewritten = [];
769
853
  if (affectedCollections.size > 0) {
770
- const { unverified } = await rotateKeys(store, vault, callerKeyring, {
771
- collections: [...affectedCollections]
854
+ const rotation = await rotateKeys(store, vault, callerKeyring, {
855
+ collections: [...affectedCollections],
856
+ exclude: usersToRevoke
857
+ // core#100 / #1043 — never deliver to the member(s) being revoked
772
858
  });
859
+ const { unverified } = rotation;
860
+ rewritten = rotation.rewritten;
773
861
  if (unverified.length > 0) {
774
862
  console.warn(
775
- `[noy-db] revoke(${options.userId}): ${unverified.length} member(s) were SKIPPED by the rotation because their keyring failed roster authentication: ${unverified.map((u) => `${u.userId} (${u.reason})`).join(", ")}. The revocation itself completed. Those members cannot open the vault and did not receive the rotated keys; their keyring files need repair or removal (noy-db#1114).`
863
+ `[noy-db] revoke(${options.userId}): ${unverified.length} member(s) were SKIPPED by the rotation because their keyring failed roster authentication: ${unverified.map((u) => `${u.userId} (${u.reason})`).join(", ")}. The revocation itself completed. Those members cannot open the vault and did not receive the rotated keys; their keyring files need repair or removal (vLannaAi/noy-db#1114).`
776
864
  );
777
865
  }
778
866
  }
867
+ return { rewritten };
779
868
  }
780
869
  async function readKeyringForAudit(store, vault, userId) {
781
870
  const envelope = await store.get(vault, "_keyring", userId);
@@ -853,8 +942,8 @@ async function quarantineKeyring(store, vault, callerKeyring, userId) {
853
942
  await store.delete(vault, "_keyring", userId);
854
943
  await deleteUserEnvelope(store, vault, userId);
855
944
  await deleteUserVisibility(store, vault, userId);
856
- const rotated = [...callerKeyring.deks.keys()].filter((c) => c !== ROSTER_KEY_ID);
857
- const result = rotated.length > 0 ? await rotateKeys(store, vault, callerKeyring, { collections: rotated }) : { needsRegrant: [], unverified: [] };
945
+ const rotated = [...callerKeyring.deks.keys()].filter((c) => !NON_ROTATABLE_SLOTS.has(c));
946
+ const result = rotated.length > 0 ? await rotateKeys(store, vault, callerKeyring, { collections: rotated, exclude: [userId] }) : { needsRegrant: [], unverified: [], rewritten: [] };
858
947
  return {
859
948
  userId,
860
949
  reason,
@@ -888,7 +977,7 @@ async function updateKeyringIdentity(store, vault, callerKeyring, options) {
888
977
  `Role "${callerKeyring.role}" cannot promote target to role "${options.role}"`
889
978
  );
890
979
  }
891
- const edited = {
980
+ const header = {
892
981
  ...target,
893
982
  ...options.role !== void 0 && { role: options.role },
894
983
  ...options.displayName !== void 0 && {
@@ -897,9 +986,52 @@ async function updateKeyringIdentity(store, vault, callerKeyring, options) {
897
986
  },
898
987
  ...options.permissions !== void 0 && { permissions: options.permissions }
899
988
  };
900
- const withEpoch = { ...edited, roster_epoch: nextRosterEpoch(target.roster_epoch) };
989
+ const roleChanged = header.role !== target.role;
990
+ const mayHoldSecrets = header.role === "owner" || header.role === "admin";
991
+ const permissions = resolvePermissions(header.role, header.permissions);
992
+ const minted = await mintMissingDeksForGrant(store, vault, callerKeyring, permissions, mayHoldSecrets);
993
+ if (minted) await persistKeyring(store, vault, callerKeyring);
994
+ const wanted = new Set(selectGranteeDekNames(header.role, header.permissions, permissions, callerKeyring.deks));
995
+ const held = target.deks;
996
+ const pending = new Set(inboxSlots(target));
997
+ const retains = (name) => {
998
+ if (name === INBOX_KEY_ID) return true;
999
+ if (name === BROKER_MEMBER_COLLECTION) return !mayHoldSecrets && !roleChanged;
1000
+ if (wanted.has(name)) return true;
1001
+ if (!name.startsWith("_")) return false;
1002
+ return !(isSecretBearingReservedCollection(name) && !mayHoldSecrets);
1003
+ };
1004
+ const deks = {};
1005
+ for (const [name, wrapped] of Object.entries(held)) if (retains(name)) deks[name] = wrapped;
1006
+ const dropped = Object.keys(held).filter((name) => !name.startsWith("_") && !(name in deks));
1007
+ const deliver = /* @__PURE__ */ new Map();
1008
+ for (const name of wanted) {
1009
+ if (name in deks || pending.has(name)) continue;
1010
+ const dek = callerKeyring.deks.get(name);
1011
+ if (!dek) throw new PrivilegeEscalationError(name);
1012
+ deliver.set(name, dek);
1013
+ }
1014
+ for (const name of pending) if (!wanted.has(name) && !name.startsWith("_")) dropped.push(name);
1015
+ let brokerMemberDek;
1016
+ if (roleChanged && !mayHoldSecrets) {
1017
+ brokerMemberDek = await generateDEK();
1018
+ deliver.set(BROKER_MEMBER_COLLECTION, brokerMemberDek);
1019
+ }
1020
+ let inbox = target.inbox;
1021
+ if (deliver.size > 0) {
1022
+ if (target.inbox_key === void 0) throw new MemberInboxMissingError(options.userId);
1023
+ inbox = [...target.inbox ?? [], await sealInbox(target.inbox_key, deliver)];
1024
+ }
1025
+ const { inbox: _previousInbox, ...carried } = header;
1026
+ const edited = { ...carried, deks, ...inbox !== void 0 && inbox.length > 0 && { inbox } };
1027
+ const withEpoch = stampAuthority(edited, target.roster_epoch);
901
1028
  const next = { ...withEpoch, roster_tag: await mintRosterTag(withEpoch, rosterKey) };
902
- await writeKeyringFile(store, vault, options.userId, next);
1029
+ await writeKeyringFile(store, vault, options.userId, next, basisOf(found));
1030
+ const rotate = [...new Set(dropped)].filter((name) => !name.startsWith("_"));
1031
+ if (rotate.length > 0 && options.userId !== callerKeyring.userId) {
1032
+ await rotateKeys(store, vault, callerKeyring, { collections: rotate, exclude: [options.userId] });
1033
+ }
1034
+ return { roleChanged, ...brokerMemberDek !== void 0 && { brokerMemberDek } };
903
1035
  }
904
1036
  var HISTORY_COLLECTION = "_history";
905
1037
  var LEDGER_COLLECTION = "_ledger";
@@ -952,6 +1084,12 @@ async function rotateKeys(store, vault, callerKeyring, opts) {
952
1084
  `rotateKeys: "${ROSTER_KEY_ID}" is the vault roster key, not a collection, and cannot be rotated \u2014 doing so would strip it from every other member and leave the vault unopenable. Remove it from \`collections\`.`
953
1085
  );
954
1086
  }
1087
+ for (const name of [BROKER_MEMBER_COLLECTION, INBOX_KEY_ID]) {
1088
+ if (collections.includes(name)) {
1089
+ throw new ValidationError(`rotateKeys: "${name}" is a per-member key, not a collection, and cannot be rotated. Remove it from \`collections\`.`);
1090
+ }
1091
+ }
1092
+ const rewritten = [];
955
1093
  if (callerKeyring.role === "custodian") {
956
1094
  throw new PermissionDeniedError(
957
1095
  "custodian cannot rotate keys (FR-6: re-key is an owner-only meta-capability; use the Deed owner)"
@@ -977,6 +1115,12 @@ async function rotateKeys(store, vault, callerKeyring, opts) {
977
1115
  for (const [name, dek] of callerKeyring.deks) if (name !== collName) others.push(dek);
978
1116
  for (const [name, dek] of newDeks) if (name !== collName) others.push(dek);
979
1117
  await rekeyBlobSet(store, vault, oldDek, newDek, others);
1118
+ for (const blobColl of ["_blob_index", "_blob_chunks"]) {
1119
+ for (const id of await store.list(vault, blobColl)) {
1120
+ const env = await store.get(vault, blobColl, id);
1121
+ if (env) rewritten.push({ collection: blobColl, id, version: env._v });
1122
+ }
1123
+ }
980
1124
  }
981
1125
  const { collection: baseColl } = parseDekKey(collName);
982
1126
  const siblingSlotDeks = [];
@@ -999,7 +1143,10 @@ async function rotateKeys(store, vault, callerKeyring, opts) {
999
1143
  }
1000
1144
  throw err;
1001
1145
  }
1002
- if (newEnvelope !== null) await store.put(vault, refColl, id, newEnvelope);
1146
+ if (newEnvelope !== null) {
1147
+ await store.put(vault, refColl, id, newEnvelope);
1148
+ rewritten.push({ collection: refColl, id, version: newEnvelope._v });
1149
+ }
1003
1150
  }
1004
1151
  }
1005
1152
  for (const [collName, newDek] of newDeks) {
@@ -1024,26 +1171,37 @@ async function rotateKeys(store, vault, callerKeyring, opts) {
1024
1171
  }
1025
1172
  const updatedDeks = { ...userKeyringFile.deks };
1026
1173
  const updatedPermissions = { ...userKeyringFile.permissions };
1174
+ const deliver = /* @__PURE__ */ new Map();
1175
+ const pendingSlots = new Set(inboxSlots(userKeyringFile));
1027
1176
  for (const collName of collections) {
1177
+ const held = collName in updatedDeks || pendingSlots.has(collName);
1178
+ if (held && userKeyringFile.inbox_key !== void 0 && !opts.exclude?.includes(userId)) {
1179
+ deliver.set(collName, newDeks.get(collName));
1180
+ delete updatedDeks[collName];
1181
+ continue;
1182
+ }
1028
1183
  if (collName in updatedDeks || collName in updatedPermissions) {
1029
1184
  needsRegrant.push({ userId, collection: collName });
1030
1185
  }
1031
1186
  delete updatedDeks[collName];
1032
1187
  delete updatedPermissions[collName];
1033
1188
  }
1189
+ const inbox = deliver.size > 0 && userKeyringFile.inbox_key !== void 0 ? [...userKeyringFile.inbox ?? [], await sealInbox(userKeyringFile.inbox_key, deliver)] : userKeyringFile.inbox;
1034
1190
  const edited = {
1035
1191
  ...userKeyringFile,
1036
1192
  deks: updatedDeks,
1037
- permissions: updatedPermissions
1193
+ permissions: updatedPermissions,
1194
+ ...inbox !== void 0 && inbox.length > 0 ? { inbox } : {}
1038
1195
  };
1039
- const withEpoch = { ...edited, roster_epoch: nextRosterEpoch(userKeyringFile.roster_epoch) };
1196
+ if (inbox === void 0 || inbox.length === 0) delete edited.inbox;
1197
+ const withEpoch = stampAuthority(edited, userKeyringFile.roster_epoch);
1040
1198
  const updatedKeyring = {
1041
1199
  ...withEpoch,
1042
1200
  roster_tag: await mintRosterTag(withEpoch, callerRosterKey)
1043
1201
  };
1044
- await writeKeyringFile(store, vault, userId, updatedKeyring);
1202
+ await writeKeyringFile(store, vault, userId, updatedKeyring, basisOf(userFound));
1045
1203
  }
1046
- return { needsRegrant, unverified };
1204
+ return { needsRegrant, unverified, rewritten };
1047
1205
  }
1048
1206
  async function changeSecret(store, vault, keyring, opts) {
1049
1207
  const existingFound = await readKeyringFile(store, vault, keyring.userId);
@@ -1076,7 +1234,7 @@ async function changeSecret(store, vault, keyring, opts) {
1076
1234
  ...existingAuthority?.import_capability !== void 0 && { import_capability: existingAuthority.import_capability }
1077
1235
  };
1078
1236
  const authorityWithDeks = { ...authority, deks: wrappedDeks };
1079
- const withEpoch = { ...authorityWithDeks, roster_epoch: nextRosterEpoch(existingAuthority?.roster_epoch) };
1237
+ const withEpoch = stampAuthority(authorityWithDeks, existingAuthority?.roster_epoch);
1080
1238
  const keyringFile = {
1081
1239
  _noydb_keyring: NOYDB_KEYRING_VERSION,
1082
1240
  ...withEpoch,
@@ -1085,7 +1243,7 @@ async function changeSecret(store, vault, keyring, opts) {
1085
1243
  canary,
1086
1244
  roster_tag: await mintRosterTag(withEpoch, rosterKey)
1087
1245
  };
1088
- await writeKeyringFile(store, vault, keyring.userId, keyringFile);
1246
+ await writeKeyringFile(store, vault, keyring.userId, keyringFile, basisOf(existingFound));
1089
1247
  return {
1090
1248
  userId: keyring.userId,
1091
1249
  displayName: keyring.displayName,
@@ -1151,7 +1309,7 @@ async function buildRecipientKeyringFile(callerKeyring, recipient) {
1151
1309
  ...recipient.expiresAt !== void 0 ? { expires_at: recipient.expiresAt } : {}
1152
1310
  };
1153
1311
  const authorityWithDeks = { ...authority, deks: wrappedDeks };
1154
- const withEpoch = { ...authorityWithDeks, roster_epoch: nextRosterEpoch(void 0) };
1312
+ const withEpoch = stampAuthority(authorityWithDeks, void 0);
1155
1313
  return {
1156
1314
  _noydb_keyring: NOYDB_KEYRING_VERSION,
1157
1315
  ...withEpoch,
@@ -1269,8 +1427,17 @@ async function ensureCollectionDEK(store, vault, keyring) {
1269
1427
  }
1270
1428
  const dek = await generateDEK();
1271
1429
  keyring.deks.set(collectionName, dek);
1272
- await persistKeyring(store, vault, keyring);
1273
- return dek;
1430
+ for (let attempt = 0; ; attempt++) {
1431
+ try {
1432
+ await persistKeyring(store, vault, keyring);
1433
+ return keyring.deks.get(collectionName) ?? dek;
1434
+ } catch (err) {
1435
+ if (!isConflictError(err)) throw err;
1436
+ const winner = await reloadPersistedDEK(store, vault, keyring, collectionName);
1437
+ if (winner) return winner;
1438
+ if (attempt >= 5) throw err;
1439
+ }
1440
+ }
1274
1441
  })();
1275
1442
  inFlight.set(collectionName, promise);
1276
1443
  try {
@@ -1296,6 +1463,58 @@ function hasAccess(keyring, collectionName) {
1296
1463
  if (PERMISSION_WILDCARD in keyring.permissions) return true;
1297
1464
  return collectionName in keyring.permissions;
1298
1465
  }
1466
+ async function mintInboxKey(kek) {
1467
+ const inboxKey = await generateDEK();
1468
+ const pair = await generateRecipientKeyPair();
1469
+ const pub = await exportRecipientPublicKeySpki(pair);
1470
+ const priv = await exportRecipientPrivateKeyPkcs8(pair);
1471
+ try {
1472
+ const sealed = await encryptBytes(priv, inboxKey);
1473
+ return { wrappedInboxKey: await wrapKey(inboxKey, kek), inboxKeyAes: inboxKey, inboxKey: { pub: bufferToBase64(pub), priv: sealed } };
1474
+ } finally {
1475
+ priv.fill(0);
1476
+ }
1477
+ }
1478
+ function inboxSlots(file) {
1479
+ return [...new Set((file.inbox ?? []).flatMap((box) => box.slots))];
1480
+ }
1481
+ async function sealInbox(inboxKey, deks) {
1482
+ const pub = await importRecipientPublicKeySpki(base64ToBuffer(inboxKey.pub));
1483
+ const cekBytes = globalThis.crypto.getRandomValues(new Uint8Array(32));
1484
+ try {
1485
+ const cek = await importTransferKey(cekBytes);
1486
+ const payload = new TextEncoder().encode(JSON.stringify(await exportDekSet(deks)));
1487
+ const { iv, data } = await encryptBytes(payload, cek);
1488
+ const wrapped = await recipientWrap(pub, cekBytes);
1489
+ return { slots: [...deks.keys()].sort(), cek: bufferToBase64(wrapped), iv, data };
1490
+ } finally {
1491
+ cekBytes.fill(0);
1492
+ }
1493
+ }
1494
+ async function openInboxKeyPair(inboxKey, inboxKeyAes) {
1495
+ const priv = await decryptBytes(inboxKey.priv.iv, inboxKey.priv.data, inboxKeyAes);
1496
+ try {
1497
+ return await importRecipientKeyPair(priv, base64ToBuffer(inboxKey.pub));
1498
+ } finally {
1499
+ priv.fill(0);
1500
+ }
1501
+ }
1502
+ async function openInbox(file, inboxKeyAes) {
1503
+ const out = /* @__PURE__ */ new Map();
1504
+ if (!file.inbox || file.inbox.length === 0 || !file.inbox_key) return out;
1505
+ const pair = await openInboxKeyPair(file.inbox_key, inboxKeyAes);
1506
+ for (const box of file.inbox) {
1507
+ const cekBytes = await recipientUnwrap(pair, base64ToBuffer(box.cek));
1508
+ try {
1509
+ const cek = await importTransferKey(cekBytes);
1510
+ const payload = await decryptBytes(box.iv, box.data, cek);
1511
+ for (const [name, dek] of await importDekSet(JSON.parse(new TextDecoder().decode(payload)))) out.set(name, dek);
1512
+ } finally {
1513
+ cekBytes.fill(0);
1514
+ }
1515
+ }
1516
+ return out;
1517
+ }
1299
1518
  async function persistKeyring(store, vault, keyring) {
1300
1519
  if (!keyring.kek) {
1301
1520
  throw new ValidationError(
@@ -1309,6 +1528,9 @@ async function persistKeyring(store, vault, keyring) {
1309
1528
  const existingGrantedBy = existingFound?.file.granted_by;
1310
1529
  const existingCreatedAt = existingFound?.file.created_at;
1311
1530
  const existingExpiresAt = existingFound?.file.expires_at;
1531
+ const existingInboxKey = existingFound?.file.inbox_key;
1532
+ const existingInbox = existingFound?.file.inbox;
1533
+ const undrainedInbox = existingInbox !== void 0 && existingInbox.length > 0 && !inboxSlots({ inbox: existingInbox }).every((slot) => keyring.deks.has(slot));
1312
1534
  const wrappedDeks = {};
1313
1535
  for (const [collName, dek] of keyring.deks) {
1314
1536
  wrappedDeks[collName] = await wrapKey(dek, keyring.kek);
@@ -1331,9 +1553,13 @@ async function persistKeyring(store, vault, keyring) {
1331
1553
  const authorityWithDeks = {
1332
1554
  ...authority,
1333
1555
  deks: wrappedDeks,
1334
- ...Object.keys(wrappedPending).length > 0 ? { pending_deks: wrappedPending } : {}
1556
+ ...Object.keys(wrappedPending).length > 0 ? { pending_deks: wrappedPending } : {},
1557
+ // core#96 — both tag-bound (`inbox_pub`, `inbox_slots`), so they must be
1558
+ // in the object the tag is minted from, not spread in afterwards.
1559
+ ...existingInboxKey !== void 0 && { inbox_key: existingInboxKey },
1560
+ ...undrainedInbox && existingInbox !== void 0 && { inbox: existingInbox }
1335
1561
  };
1336
- const withEpoch = { ...authorityWithDeks, roster_epoch: nextRosterEpoch(existingFound?.file.roster_epoch) };
1562
+ const withEpoch = stampAuthority(authorityWithDeks, existingFound?.file.roster_epoch);
1337
1563
  const keyringFile = {
1338
1564
  _noydb_keyring: NOYDB_KEYRING_VERSION,
1339
1565
  ...withEpoch,
@@ -1345,7 +1571,7 @@ async function persistKeyring(store, vault, keyring) {
1345
1571
  ...keyring.policy !== void 0 && { policy: keyring.policy },
1346
1572
  ...existingEcho !== void 0 && { echo: existingEcho }
1347
1573
  };
1348
- await writeKeyringFile(store, vault, keyring.userId, keyringFile);
1574
+ await writeKeyringFile(store, vault, keyring.userId, keyringFile, basisOf(existingFound));
1349
1575
  }
1350
1576
  function defaultBundleCapability(role) {
1351
1577
  return role === "owner" || role === "admin";
@@ -1384,17 +1610,19 @@ function resolvePermissions(role, explicit) {
1384
1610
  if (role === "owner" || role === "admin" || role === "custodian" || role === "viewer") return {};
1385
1611
  return explicit ?? {};
1386
1612
  }
1387
- async function writeKeyringFile(store, vault, userId, keyringFile) {
1613
+ var basisOf = (found) => found ? { on: found.envelope } : "create";
1614
+ async function writeKeyringFile(store, vault, userId, keyringFile, basis) {
1388
1615
  if (keyringFile.roster_epoch === void 0) {
1389
1616
  throw new Error(
1390
1617
  `writeKeyringFile: refusing to write a keyring for "${userId}" with no roster_epoch (#1097). Stamp it with nextRosterEpoch(previous) onto the authority object BEFORE minting the roster tag, so it is covered by rosterCanonical.`
1391
1618
  );
1392
1619
  }
1620
+ const base = basis === "create" ? 0 : basis.on._v;
1393
1621
  const envelope = buildRecordEnvelope(
1394
- { collection: "_keyring", id: userId, version: 1 },
1622
+ { collection: "_keyring", id: userId, version: base + 1 },
1395
1623
  { iv: "", data: JSON.stringify(keyringFile) }
1396
1624
  );
1397
- await store.put(vault, "_keyring", userId, envelope);
1625
+ await store.put(vault, "_keyring", userId, envelope, basis === "create" ? void 0 : base);
1398
1626
  }
1399
1627
 
1400
1628
  export {
@@ -1403,6 +1631,7 @@ export {
1403
1631
  mintRosterTag,
1404
1632
  assertRosterAuthenticated,
1405
1633
  assertRosterTagValid,
1634
+ stampAuthority,
1406
1635
  WeakSecretError,
1407
1636
  validateSecret,
1408
1637
  assertStrongSecret,
@@ -1417,16 +1646,19 @@ export {
1417
1646
  verifyTypedEcho,
1418
1647
  SYNC_CREDENTIALS_COLLECTION,
1419
1648
  BROKER_COLLECTION,
1649
+ BROKER_MEMBER_COLLECTION,
1420
1650
  isSecretBearingReservedCollection,
1421
1651
  mintKeyringCanary,
1422
1652
  requireRosterKey,
1423
1653
  deriveKekForKeyring,
1654
+ parseKeyringEnvelope,
1424
1655
  readKeyringFile,
1425
1656
  assertKeyringNotExpired,
1426
1657
  loadKeyring,
1427
1658
  assertKeyringOpenAllowed,
1428
1659
  createOwnerKeyring,
1429
1660
  grant,
1661
+ NON_ROTATABLE_SLOTS,
1430
1662
  revoke,
1431
1663
  verifyRoster,
1432
1664
  quarantineKeyring,
@@ -1439,10 +1671,15 @@ export {
1439
1671
  ensureCollectionDEK,
1440
1672
  hasWritePermission,
1441
1673
  hasAccess,
1674
+ mintInboxKey,
1675
+ inboxSlots,
1676
+ openInboxKeyPair,
1442
1677
  persistKeyring,
1443
1678
  hasExportCapability,
1444
1679
  evaluateExportCapability,
1445
1680
  hasImportCapability,
1446
- evaluateImportCapability
1681
+ evaluateImportCapability,
1682
+ basisOf,
1683
+ writeKeyringFile
1447
1684
  };
1448
- //# sourceMappingURL=chunk-XSPFDUDG.js.map
1685
+ //# sourceMappingURL=chunk-V7AKGAXY.js.map