@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
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/capsule/enclave-aes/broker/proof.ts","../../../src/capsule/enclave-aes/capabilities.ts","../../../src/capsule/enclave-aes/index.ts"],"sourcesContent":["/**\n * Credential-broker proof crypto (#479, credential-broker spec §3).\n *\n * The `_broker` seed (32 random bytes, decrypted from `_broker/<brokerId>` by\n * the party layer) is never transmitted. Instead, a **proof key** is\n * HKDF-derived from it, domain-separated per `(vaultId, brokerId)`, and the\n * derived bits are registered with the broker host once at enrol. Steady\n * state, the client re-derives the same key from the seed and signs a\n * **canonical** string binding the request's identity/context, so the broker\n * can verify a fresh HMAC on every mint without ever holding the seed itself.\n *\n * ## Derivation (spec §3, follow verbatim)\n *\n * ```\n * hkdf = importKey('raw', seed, 'HKDF', false, ['deriveBits'])\n * proofBits = deriveBits({ name:'HKDF', hash:'SHA-256',\n * salt: utf8(BROKER_PROOF_DOMAIN),\n * info: utf8(JSON.stringify([BROKER_PROOF_DOMAIN, vaultId, brokerId])) },\n * hkdf, 256)\n * proofKey = importKey('raw', proofBits, { name:'HMAC', hash:'SHA-256' }, false, ['sign'])\n * proof = base64(sign('HMAC', proofKey, utf8(canonical)))\n * ```\n *\n * `BROKER_PROOF_DOMAIN` is both the HKDF salt and the first `info` array\n * element (the injective-JSON-array convention `deriveClassifyIndexKey`\n * established — see `classify/bidx.ts`). `BROKER_PROOF_VERSION` is the\n * separate MAC version tag, the first element of the `canonical` array.\n *\n * ## Canonical (spec §2 step 3)\n *\n * `JSON.stringify([BROKER_PROOF_VERSION, vaultId, endpointOrigin, brokerId,\n * profile ?? '', instancePid ?? '', challenge, expiresAt])` — every binding\n * field folded into ONE MAC input:\n * - `vaultId` (V1), `challenge` (V3), `expiresAt` (V4) — verbatim strings,\n * never reparsed/reformatted (F8): a byte-identical ISO string is\n * required, so e.g. `Z` vs `+00:00` for the same instant fails.\n * - `profile ?? ''` (F1) — a proof captured at one profile cannot be\n * replayed at another.\n * - `endpointOrigin` (F4) — a proof cannot be relayed to a different broker\n * endpoint reusing the same `brokerId`.\n * - `instancePid ?? ''` (F7) — an EMPTY STRING `instancePid` is forbidden in\n * both {@link computeBrokerProof} and {@link verifyBrokerProof}: absent\n * (the field omitted) and `''` must stay distinguishable, or `?? ''`\n * would alias \"no instance\" onto a real registered instance.\n *\n * ## Verify order (spec §3, non-negotiable, F2/F6)\n *\n * {@link verifyBrokerProof} MUST, in this exact order: (1) burn the challenge\n * via `consumeChallenge` FIRST and short-circuit `false` before any MAC work\n * (F2 — burn-on-presentation, not burn-on-success); (2) recompute the\n * canonical and compare with `crypto.subtle.verify('HMAC', …)` — portable,\n * constant-time, never a manual byte compare or Node `timingSafeEqual` (F6);\n * (3) assert `now < expiresAt` — the client clock is never trusted, so this\n * check only matters once the MAC (which covers `expiresAt`) has verified.\n *\n * ## Zeroing (F5)\n *\n * `seed` and the transient HKDF output are raw, durable secret material —\n * the `recovery.ts:276-307` `try{}finally{secret.fill(0)}` discipline, not\n * the ephemeral-CEK happy-path zeroing elsewhere. {@link computeBrokerProof}\n * zeroes the `seed` argument in a `finally` on every path including a throw;\n * {@link deriveBrokerProofKey} zeroes its own transient HKDF-output bytes the\n * same way. {@link deriveBrokerProofBits} does not zero `seed` — it exists\n * so the party layer can register the raw bits at one-time enrol (the value\n * that must survive the call to be base64-encoded and POSTed).\n *\n * @module\n */\nimport type { EnclaveKey } from '../crypto.js'\nimport { base64ToBuffer, bufferToBase64 } from '../../plumbing/digest.js'\nimport { ValidationError } from '../../../kernel/errors.js'\n\nconst subtle = globalThis.crypto.subtle\n\n/** HKDF salt domain for the broker proof key — also the first `info` array element. */\nexport const BROKER_PROOF_DOMAIN = 'noydb-broker-proof'\n\n/** MAC version tag — the first element of the `canonical` array signed/verified. */\nexport const BROKER_PROOF_VERSION = 'noydb-broker-proof-v1'\n\n/** Default challenge TTL (spec §2 step 2: \"TTL ≤ 60 s\"). */\nconst DEFAULT_CHALLENGE_TTL_MS = 60_000\n\n/** The canonical-binding fields a client supplies alongside `vaultId`/`brokerId` (spec §2 step 3). */\nexport interface BrokerProofCanonicalParts {\n readonly endpointOrigin: string\n readonly profile?: string | undefined\n readonly instancePid?: string | undefined\n readonly challenge: string\n readonly expiresAt: string\n}\n\n/** A freshly-minted, server-random single-use challenge (spec §2 step 2). */\nexport interface IssuedChallenge {\n readonly challenge: string\n readonly expiresAt: string\n}\n\n/** Arguments the broker host passes to verify a submitted proof (spec §3). */\nexport interface VerifyBrokerProofArgs {\n /**\n * Atomically test-and-delete the challenge, returning whether it was still\n * fresh (unconsumed and unexpired-from-the-store's-perspective). MUST burn\n * on presentation, not on successful verification (F2).\n */\n readonly consumeChallenge: (challenge: string) => Promise<boolean>\n /** The registered proof key's raw bytes, already KMS-unwrapped by the host (§7). */\n readonly registeredProofKey: Uint8Array\n readonly vaultId: string\n readonly endpointOrigin: string\n readonly brokerId: string\n readonly profile?: string | undefined\n readonly instancePid?: string | undefined\n readonly challenge: string\n readonly expiresAt: string\n /** base64(HMAC-SHA-256(proofKey, canonical)), as submitted by the client. */\n readonly proof: string\n}\n\n/** Build the canonical MAC input verbatim — never reparses/reformats a field (F8). */\nfunction buildCanonical(vaultId: string, brokerId: string, parts: BrokerProofCanonicalParts): string {\n return JSON.stringify([\n BROKER_PROOF_VERSION,\n vaultId,\n parts.endpointOrigin,\n brokerId,\n parts.profile ?? '',\n parts.instancePid ?? '',\n parts.challenge,\n parts.expiresAt,\n ])\n}\n\n/**\n * The HKDF step: derive the 256-bit proof bits from the `_broker` seed,\n * domain-separated per `(vaultId, brokerId)`. Returns the raw bits — the\n * value registered with the broker host once at enrol (spec §2 step 2/3).\n * Does not mutate or zero `seed`; the caller owns the seed's lifecycle.\n */\nexport async function deriveBrokerProofBits(\n seed: Uint8Array,\n vaultId: string,\n brokerId: string,\n): Promise<Uint8Array> {\n const hkdfKey = await subtle.importKey('raw', seed as BufferSource, 'HKDF', false, ['deriveBits'])\n const salt = new TextEncoder().encode(BROKER_PROOF_DOMAIN)\n const info = new TextEncoder().encode(JSON.stringify([BROKER_PROOF_DOMAIN, vaultId, brokerId]))\n const bits = await subtle.deriveBits({ name: 'HKDF', hash: 'SHA-256', salt, info }, hkdfKey, 256)\n return new Uint8Array(bits)\n}\n\n/**\n * Derive the steady-state, non-extractable `['sign']` HMAC proof key from\n * the `_broker` seed. Zeroes the transient HKDF-output bytes in a `finally`\n * once the key has been imported (F5) — the raw bits never leave this\n * function in usable form after import.\n */\nexport async function deriveBrokerProofKey(\n seed: Uint8Array,\n vaultId: string,\n brokerId: string,\n): Promise<EnclaveKey> {\n const proofBits = await deriveBrokerProofBits(seed, vaultId, brokerId)\n try {\n return await subtle.importKey('raw', proofBits as BufferSource, { name: 'HMAC', hash: 'SHA-256' }, false, ['sign'])\n } finally {\n proofBits.fill(0)\n }\n}\n\n/**\n * Compose derive + sign for the client: re-derive the proof key from the\n * seed and sign the canonical over `canonicalParts` (spec §2 step 3).\n *\n * Rejects an empty-string `instancePid` (F7 — absent is fine, `''` is not).\n * Zeroes the `seed` argument in a `finally` on EVERY path including a throw\n * (F5, durable-secret discipline) — the transient HKDF bits are zeroed one\n * layer down, inside {@link deriveBrokerProofKey}.\n */\nexport async function computeBrokerProof(\n seed: Uint8Array,\n vaultId: string,\n brokerId: string,\n canonicalParts: BrokerProofCanonicalParts,\n): Promise<string> {\n try {\n if (canonicalParts.instancePid === '') {\n throw new ValidationError(\n \"computeBrokerProof: instancePid must not be an empty string — omit the field entirely for \" +\n \"'no instance' (F7); '' would alias onto a registered instance.\",\n )\n }\n const canonical = buildCanonical(vaultId, brokerId, canonicalParts)\n const key = await deriveBrokerProofKey(seed, vaultId, brokerId)\n const mac = await subtle.sign('HMAC', key, new TextEncoder().encode(canonical) as BufferSource)\n return bufferToBase64(new Uint8Array(mac))\n } finally {\n seed.fill(0)\n }\n}\n\n/**\n * Host-side nonce mint: 32 random bytes, base64-encoded, plus an ISO\n * `expiresAt` at most `ttlMs` (default 60 s) in the future. The caller\n * (the broker host) persists both returned strings **verbatim** and MACs\n * those exact bytes on verify — never a reparsed/reformatted copy (F8).\n */\nexport function issueChallenge(opts?: { ttlMs?: number }): IssuedChallenge {\n const ttlMs = opts?.ttlMs ?? DEFAULT_CHALLENGE_TTL_MS\n const bytes = globalThis.crypto.getRandomValues(new Uint8Array(32))\n return {\n challenge: bufferToBase64(bytes),\n expiresAt: new Date(Date.now() + ttlMs).toISOString(),\n }\n}\n\n/**\n * Verify a submitted broker proof. Order is NON-NEGOTIABLE (spec §3):\n *\n * 1. `await consumeChallenge(challenge)` FIRST — burn-and-check-fresh; a\n * not-fresh (already-consumed or unknown) challenge short-circuits to\n * `false` before any MAC work (F2).\n * 2. Empty-string `instancePid` is rejected (F7), then the canonical is\n * recomputed over the verbatim `endpointOrigin`/`brokerId`/`profile`/\n * `instancePid`/`challenge`/`expiresAt` and compared via\n * `crypto.subtle.verify('HMAC', …)` — portable, constant-time, never a\n * manual compare or Node `timingSafeEqual` (F6).\n * 3. `now < expiresAt` — the client clock is never trusted; `expiresAt`\n * rides inside the already-verified MAC (F4/F8).\n */\nexport async function verifyBrokerProof(args: VerifyBrokerProofArgs): Promise<boolean> {\n const fresh = await args.consumeChallenge(args.challenge)\n if (!fresh) return false\n\n if (args.instancePid === '') return false\n\n const canonical = buildCanonical(args.vaultId, args.brokerId, {\n endpointOrigin: args.endpointOrigin,\n profile: args.profile,\n instancePid: args.instancePid,\n challenge: args.challenge,\n expiresAt: args.expiresAt,\n })\n const key = await subtle.importKey(\n 'raw',\n args.registeredProofKey as BufferSource,\n { name: 'HMAC', hash: 'SHA-256' },\n false,\n ['verify'],\n )\n const ok = await subtle.verify(\n 'HMAC',\n key,\n base64ToBuffer(args.proof) as BufferSource,\n new TextEncoder().encode(canonical) as BufferSource,\n )\n if (!ok) return false\n\n return Date.now() < Date.parse(args.expiresAt)\n}\n","import type { CapsuleGroup } from '../contract.js'\n\n/**\n * `enclave-aes` supports every group. It is the REFERENCE capsule — the\n * behaviour every other implementation is compared against, and the one hub\n * ships so that `npm install @noy-db/hub` alone is a working noy-db.\n *\n * An `exclave-*` refuses `authenticate` and `seal` (no secret, no key\n * hierarchy — the store's own IAM is the authority) and may refuse the\n * optional groups. That asymmetry is what the prefix means, and the\n * conformance suite asserts it from the package name rather than trusting a\n * declaration.\n *\n * Frozen so a caller cannot edit what a capsule claims to support: a mutable\n * set would let a service \"enable\" a group by adding to it, which is exactly\n * the confidently-wrong failure the typed refusal exists to prevent.\n */\n/**\n * ⛔ `Object.freeze` does NOT make a Set immutable — it guards own properties,\n * not internal slots, so `frozen.add(x)` still succeeds. Measured 2026-09-12,\n * against a test that asserted otherwise and failed. The mutators are replaced\n * so the refusal is real at runtime, not just in the type.\n *\n * Why it has to be real: a caller holding a mutable capability set can \"enable\"\n * a group the capsule does not implement, and the next thing that happens is a\n * primitive being called on a capsule that has none. `ReadonlySet` alone is a\n * compile-time claim, and a JS consumer never sees it.\n */\nfunction sealedSet<T>(items: readonly T[]): ReadonlySet<T> {\n const set = new Set<T>(items)\n const refuse = (): never => {\n throw new TypeError(\n 'capabilities() is immutable — a capsule\\'s declared groups cannot be edited by a caller',\n )\n }\n set.add = refuse as never\n set.delete = refuse as never\n set.clear = refuse as never\n return Object.freeze(set)\n}\n\nconst ALL: ReadonlySet<CapsuleGroup> = sealedSet<CapsuleGroup>([\n 'authenticate',\n 'seal',\n 'cipher',\n 'digest',\n 'sign',\n 'codec',\n 'sealing',\n 'deterministic',\n 'classify',\n])\n\nexport function capabilities(): ReadonlySet<CapsuleGroup> {\n return ALL\n}\n","/**\n * **capsule/enclave-aes** — the hub's crypto interior, behind one door.\n *\n * This barrel is **the fork-swap contract**: a sister project that wants a\n * different crypto engine (a different KDF, a hardware-backed keystore, a\n * post-quantum wrap algorithm, …) replaces the entire `capsule/enclave-aes/`\n * folder wholesale and only has to honor the exports below. Nothing outside\n * `capsule/enclave-aes/**` may deep-import `crypto.js` or `record-keys/*` directly\n * — `scripts/check-architecture.mjs`'s `enclave-barrel-only` check enforces\n * that mechanically. Import sites inside `capsule/enclave-aes/**` keep their\n * existing relative imports; this door is for everyone else.\n *\n * The export list is the OBSERVED contract — exactly the symbols consumed\n * from outside this folder today — grouped by the module that defines them:\n *\n * - key type — `crypto.ts`: `EnclaveKey`, the opaque key type every\n * barrel-facing signature traffics in (`= CryptoKey` in\n * noy-db's reference enclave; a fork redefines it to its\n * own key representation — see the type's own doc for\n * the fork contract).\n * - crypto ops — `crypto.ts`: AES-256-GCM encrypt/decrypt (+ bytes, AAD,\n * deterministic variants), SHA-256 / HMAC-SHA-256 hashing.\n * - key lifecycle — `crypto.ts` + `record-keys/lifecycle.ts`: KEK/DEK\n * derivation, AES-KW wrap/unwrap, per-record CEK\n * wrap/unwrap/import + resolution/re-wrap, HKDF-derived\n * presence/sealed-field keys, base64 helpers.\n * - record codec — `record-keys/record-codec.ts`: the per-record\n * encode/decode engine.\n * - sealing — `record-keys/sealing.ts`: the sealed-record grantor\n * primitives (seal/revoke/rotate to an `at-*` host).\n * - deterministic — `record-keys/deterministic.ts`: blind-equality lookup\n * over deterministically-encrypted fields.\n * - tombstone — `record-keys/tombstone.ts`: the erased-record residue.\n * - envelope body — `record-keys/envelope-body.ts`: the C1 protected-body\n * access contract (`openEnvelopeJson`,\n * `writeEnvelopeBody`, `hasPerRecordKey`,\n * `hasSealedBody`, `envelopeBodyForHash`) — the\n * sanctioned door onto\n * `_iv`/`_data`/`_cek`/`_sealed` for everyone outside\n * this folder.\n * - reserved envelopes — `plumbing/sealed-slots.ts`: `makeReservedEnvelopes`,\n * the whole-envelope encrypt/decrypt door scoped to a\n * declared collection-name prefix (e.g. `_dict_`) —\n * `kernel/vault.ts` binds it for `DictionaryHandle`\n * (#629 Task 4).\n *\n * Additive changes only — removing or renaming an export here is breaking\n * for any fork. Frozen by `__tests__/enclave-surface-golden.test.ts`.\n *\n * **Refusal contract:** the barrel above is frozen — every symbol must\n * exist in any fork — but the optional groups (sealing, deterministic,\n * per-record-key lifecycle) MAY throw `EnclaveNotSupportedError` instead\n * of implementing the reference behavior. The core groups (crypto ops,\n * record codec, tombstone) MUST NOT throw it — they are load-bearing for\n * every consumer regardless of which enclave is wired in. noy-db's own\n * enclave supports every group, so it never throws this error.\n */\n\nimport { aesCapsule } from './bound.js'\n\n// ─── key type ──────────────────────────────────────────────────────\nexport type { EnclaveKey, EncryptResult } from './crypto.js'\n\n// ─── crypto ops ────────────────────────────────────────────────────\nexport {\n encrypt,\n decrypt,\n encryptBytes,\n decryptBytes,\n encryptBytesWithAAD,\n decryptBytesWithAAD,\n encryptDeterministic,\n decryptDeterministic,\n} from './crypto.js'\n\n// ─── key lifecycle ─────────────────────────────────────────────────\nexport {\n deriveKey,\n deriveSecretKey,\n generateDEK,\n generateEphemeralKey,\n importTransferKey,\n exportDekSet,\n importDekSet,\n wrapKey,\n unwrapKey,\n mintCanary,\n checkCanary,\n deriveDeterministicKey,\n deriveSealedFieldKey,\n deriveSealedFieldKeyFromCek,\n wrapCek,\n unwrapCek,\n importCek,\n deriveEchoKey,\n} from './crypto.js'\nexport type { SecretKeyUsage } from './crypto.js'\n// ─── shared plumbing ───────────────────────────────────────────────\n//\n// Everything from here to the end of this block used to be twelve modules\n// under `./record-keys/`. They now live once in `../plumbing/`, and this\n// capsule is one of two callers of `makeCapsule()`.\n//\n// The split below is not cosmetic. The cipher-FREE half is re-exported\n// straight from its module: it inspects envelope fields and derives hash\n// input, so there is nothing to bind and every capsule gets the identical\n// function. The cipher-BOUND half is destructured off `aesCapsule`, which is\n// `makeCapsule(aesPrimitives)` — one binding for the whole capsule, so a value\n// exported here and a value used inside `classify/**` are the SAME object.\nexport {\n buildRecordAad,\n recordAadFor,\n buildRecordEnvelope,\n isTombstone,\n isTombstoneShape,\n buildTombstone,\n isDeleteMarker,\n buildDeleteMarker,\n requireSealedBody,\n sealedBodyArgs,\n envelopeBodySize,\n hasPerRecordKey,\n envelopeBodyForHash,\n hasSealedBody,\n} from '../plumbing/index.js'\n// ─── digest group ──────────────────────────────────────────────────\n// Shared, not AES-specific: the seam design marks `digest` \"as today\" for every\n// capsule. Re-exported here so the barrel's surface is unchanged.\nexport {\n sha256Hex,\n sha256Bytes,\n hmacSha256Hex,\n hmacSignHex,\n hkdfAesGcmKey,\n deriveBlobAddressKey,\n derivePresenceKey,\n derivePresenceTagKey,\n generateIV,\n generateSalt,\n generateRecoverySecret,\n bufferToBase64,\n base64ToBuffer,\n encodeEchoParts,\n} from '../plumbing/digest.js'\nexport type { EchoSecretParts } from '../plumbing/digest.js'\nexport type { RecordIdentity, RecordRef } from '../plumbing/index.js'\nimport type { RecordCodecBase } from '../plumbing/record-codec.js'\n/**\n * `RecordCodec` is a VALUE (the capsule-bound subclass, destructured below) and\n * a TYPE (the module-level generic base). A type ALIAS can coexist with a value\n * of the same name; a `export type { RecordCodec }` RE-EXPORT cannot, which is\n * what `TS2323: Cannot redeclare exported variable` was saying.\n */\nexport type RecordCodec<T = Record<string, unknown>> = RecordCodecBase<T>\nexport { buildSealedRecordEnvelope } from '../plumbing/record-envelope.js'\nexport type { RecordEnvelopeBody } from '../plumbing/record-envelope.js'\nexport type { RewrappedBody } from '../plumbing/lifecycle.js'\nexport type { SealedShredSlot } from '../plumbing/record-codec.js'\nexport type { SealingContext } from '../plumbing/sealing.js'\nexport type { DeterministicContext } from '../plumbing/deterministic.js'\n\nexport const {\n // envelope body\n openEnvelopeJson,\n writeEnvelopeBody,\n verifyRecordIdentity,\n // key lifecycle\n resolveStableCek,\n rewrapBodyToDek,\n rewrapEnvelope,\n applyRewrappedBody,\n isRewrappedUnder,\n // rekey\n rekeyEnvelopeToDek,\n rekeyEnvelopeIfNeeded,\n envelopeOpensUnderAny,\n rekeyBlobSet,\n // record codec\n RecordCodec,\n // sealed slots — ONLY `makeReservedEnvelopes` is part of the frozen surface.\n // The other seven are capsule-internal; destructuring the whole capsule here\n // leaked them and widened the golden by 8 names. A surface is a contract, so\n // the fix is to narrow the barrel, not to re-baseline the golden.\n makeReservedEnvelopes,\n // sealing\n SEALED_CEK_NS,\n sealRecordToHost,\n revokeSealedRecord,\n rotateRecordCek,\n // deterministic\n findByDet,\n queryByDet,\n} = aesCapsule\n\n// ─── reserved envelopes (ViaCryptoCtx.reservedEnvelopes capability) ──\n\n// ─── classify (stage-2 verify oracle primitives) ────────────────────\n// ADDITIVE per Enclave Contract v1. A fork must provide these four; the\n// verify/matchGroup orchestration (classify/verify.ts) sits behind the\n// with-shape dynamic-import seam and is not part of the fork contract.\nexport { deriveVdigSlotKey } from './classify/vdig.js'\nexport { pbkdf2VerifyDigest } from './classify/digest.js'\nexport { ctEqualTags } from '../plumbing/ct-equal.js'\nexport { evaluateKofN } from '../plumbing/kofn.js'\n\n// ─── classify (slice-2b equatable blind index) ──────────────────────\n// ADDITIVE per Enclave Contract v1. A fork must provide these four; the\n// findByDigest orchestration (collection.ts) sits behind the with-shape\n// dynamic-import seam and is not part of the fork contract.\nexport { deriveClassifyIndexKey, deriveClassifyIndexSalt, mintBidxTag } from './classify/bidx.js'\nexport { computeBidxTarget } from './classify/find.js'\n\n// ─── broker (proof derivation + challenge/verify, #479 slice 2) ─────\n// ADDITIVE per Enclave Contract v1. A fork must provide these five; the\n// seed lifecycle + network/cache orchestration (with-party/broker/**) sits\n// behind its own dynamic-import seam and is not part of the fork contract.\nexport {\n deriveBrokerProofBits,\n deriveBrokerProofKey,\n computeBrokerProof,\n issueChallenge,\n verifyBrokerProof,\n} from './broker/proof.js'\nexport type { BrokerProofCanonicalParts, VerifyBrokerProofArgs, IssuedChallenge } from './broker/proof.js'\n\n// ─── sign ─────────────────────────────────────────────────────────────\nexport { generateSigningKeyPair, signBytes, verifyBytes } from '../plumbing/sign.js'\n\n// ─── recipient sealing ────────────────────────────────────────────────\nexport type { EnclaveKeyPair } from './crypto.js'\nexport {\n generateRecipientKeyPair,\n exportRecipientPublicKeySpki,\n importRecipientPublicKeySpki,\n recipientWrap,\n recipientUnwrap,\n} from './crypto.js'\n\n// ─── capabilities ─────────────────────────────────────────────────────\n// What THIS capsule supports. Part of the contract every capsule implements,\n// not an enclave-aes detail — an alternative declares its own, and a service\n// asserts against it at createNoydb() rather than failing on first write.\nexport { capabilities } from './capabilities.js'\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../../src/capsule/enclave-aes/broker/proof.ts","../../../src/capsule/enclave-aes/capabilities.ts","../../../src/capsule/enclave-aes/index.ts"],"sourcesContent":["/**\n * Credential-broker proof crypto (#479, credential-broker spec §3).\n *\n * The `_broker` seed (32 random bytes, decrypted from `_broker/<brokerId>` by\n * the party layer) is never transmitted. Instead, a **proof key** is\n * HKDF-derived from it, domain-separated per `(vaultId, brokerId)`, and the\n * derived bits are registered with the broker host once at enrol. Steady\n * state, the client re-derives the same key from the seed and signs a\n * **canonical** string binding the request's identity/context, so the broker\n * can verify a fresh HMAC on every mint without ever holding the seed itself.\n *\n * ## Derivation (spec §3, follow verbatim)\n *\n * ```\n * hkdf = importKey('raw', seed, 'HKDF', false, ['deriveBits'])\n * proofBits = deriveBits({ name:'HKDF', hash:'SHA-256',\n * salt: utf8(BROKER_PROOF_DOMAIN),\n * info: utf8(JSON.stringify([BROKER_PROOF_DOMAIN, vaultId, brokerId])) },\n * hkdf, 256)\n * proofKey = importKey('raw', proofBits, { name:'HMAC', hash:'SHA-256' }, false, ['sign'])\n * proof = base64(sign('HMAC', proofKey, utf8(canonical)))\n * ```\n *\n * `BROKER_PROOF_DOMAIN` is both the HKDF salt and the first `info` array\n * element (the injective-JSON-array convention `deriveClassifyIndexKey`\n * established — see `classify/bidx.ts`). `BROKER_PROOF_VERSION` is the\n * separate MAC version tag, the first element of the `canonical` array.\n *\n * ## Canonical (spec §2 step 3)\n *\n * `JSON.stringify([BROKER_PROOF_VERSION, vaultId, endpointOrigin, brokerId,\n * profile ?? '', instancePid ?? '', challenge, expiresAt])` — every binding\n * field folded into ONE MAC input:\n * - `vaultId` (V1), `challenge` (V3), `expiresAt` (V4) — verbatim strings,\n * never reparsed/reformatted (F8): a byte-identical ISO string is\n * required, so e.g. `Z` vs `+00:00` for the same instant fails.\n * - `profile ?? ''` (F1) — a proof captured at one profile cannot be\n * replayed at another.\n * - `endpointOrigin` (F4) — a proof cannot be relayed to a different broker\n * endpoint reusing the same `brokerId`.\n * - `instancePid ?? ''` (F7) — an EMPTY STRING `instancePid` is forbidden in\n * both {@link computeBrokerProof} and {@link verifyBrokerProof}: absent\n * (the field omitted) and `''` must stay distinguishable, or `?? ''`\n * would alias \"no instance\" onto a real registered instance.\n *\n * ## Verify order (spec §3, non-negotiable, F2/F6)\n *\n * {@link verifyBrokerProof} MUST, in this exact order: (1) burn the challenge\n * via `consumeChallenge` FIRST and short-circuit `false` before any MAC work\n * (F2 — burn-on-presentation, not burn-on-success); (2) recompute the\n * canonical and compare with `crypto.subtle.verify('HMAC', …)` — portable,\n * constant-time, never a manual byte compare or Node `timingSafeEqual` (F6);\n * (3) assert `now < expiresAt` — the client clock is never trusted, so this\n * check only matters once the MAC (which covers `expiresAt`) has verified.\n *\n * ## Zeroing (F5)\n *\n * `seed` and the transient HKDF output are raw, durable secret material —\n * the `recovery.ts:276-307` `try{}finally{secret.fill(0)}` discipline, not\n * the ephemeral-CEK happy-path zeroing elsewhere. {@link computeBrokerProof}\n * zeroes the `seed` argument in a `finally` on every path including a throw;\n * {@link deriveBrokerProofKey} zeroes its own transient HKDF-output bytes the\n * same way. {@link deriveBrokerProofBits} does not zero `seed` — it exists\n * so the party layer can register the raw bits at one-time enrol (the value\n * that must survive the call to be base64-encoded and POSTed).\n *\n * @module\n */\nimport type { EnclaveKey } from '../crypto.js'\nimport { base64ToBuffer, bufferToBase64 } from '../../plumbing/digest.js'\nimport { ValidationError } from '../../../kernel/errors.js'\n\nconst subtle = globalThis.crypto.subtle\n\n/** HKDF salt domain for the broker proof key — also the first `info` array element. */\nexport const BROKER_PROOF_DOMAIN = 'noydb-broker-proof'\n\n/** MAC version tag — the first element of the `canonical` array signed/verified (admin shared seed). */\nexport const BROKER_PROOF_VERSION = 'noydb-broker-proof-v1'\n\n/**\n * MAC version tag for a MEMBER proof (core#73): the canonical additionally\n * binds `userId` and `role` right after `brokerId`, so the host verifies WHO\n * proved and at WHICH role with the key it registered for that member — a\n * member cannot claim another user's key or a wider role than the roster\n * granted. Selected by the presence of `member` on the canonical parts; the\n * admin canonical (v1) is byte-for-byte unchanged.\n */\nconst BROKER_PROOF_MEMBER_VERSION = 'noydb-broker-proof-v2'\n\n/** The member identity bound into a v2 canonical and into the HKDF info (core#73). */\nexport interface BrokerMemberIdentity {\n readonly userId: string\n readonly role: string\n}\n\n/** Default challenge TTL (spec §2 step 2: \"TTL ≤ 60 s\"). */\nconst DEFAULT_CHALLENGE_TTL_MS = 60_000\n\n/** The canonical-binding fields a client supplies alongside `vaultId`/`brokerId` (spec §2 step 3). */\nexport interface BrokerProofCanonicalParts {\n readonly endpointOrigin: string\n /** Present ⇒ a member proof (canonical v2, member-scoped HKDF); absent ⇒ the admin shared seed (v1). */\n readonly member?: BrokerMemberIdentity | undefined\n readonly profile?: string | undefined\n readonly instancePid?: string | undefined\n readonly challenge: string\n readonly expiresAt: string\n}\n\n/** A freshly-minted, server-random single-use challenge (spec §2 step 2). */\nexport interface IssuedChallenge {\n readonly challenge: string\n readonly expiresAt: string\n}\n\n/** Arguments the broker host passes to verify a submitted proof (spec §3). */\nexport interface VerifyBrokerProofArgs {\n /**\n * Atomically test-and-delete the challenge, returning whether it was still\n * fresh (unconsumed and unexpired-from-the-store's-perspective). MUST burn\n * on presentation, not on successful verification (F2).\n */\n readonly consumeChallenge: (challenge: string) => Promise<boolean>\n /** The registered proof key's raw bytes, already KMS-unwrapped by the host (§7). */\n readonly registeredProofKey: Uint8Array\n readonly vaultId: string\n readonly endpointOrigin: string\n readonly brokerId: string\n /** The member the `registeredProofKey` was registered FOR; the host supplies its own record, never the client's claim. */\n readonly member?: BrokerMemberIdentity | undefined\n readonly profile?: string | undefined\n readonly instancePid?: string | undefined\n readonly challenge: string\n readonly expiresAt: string\n /** base64(HMAC-SHA-256(proofKey, canonical)), as submitted by the client. */\n readonly proof: string\n}\n\n/** Build the canonical MAC input verbatim — never reparses/reformats a field (F8). */\nfunction buildCanonical(vaultId: string, brokerId: string, parts: BrokerProofCanonicalParts): string {\n if (parts.member) {\n return JSON.stringify([\n BROKER_PROOF_MEMBER_VERSION,\n vaultId,\n parts.endpointOrigin,\n brokerId,\n parts.member.userId,\n parts.member.role,\n parts.profile ?? '',\n parts.instancePid ?? '',\n parts.challenge,\n parts.expiresAt,\n ])\n }\n return JSON.stringify([\n BROKER_PROOF_VERSION,\n vaultId,\n parts.endpointOrigin,\n brokerId,\n parts.profile ?? '',\n parts.instancePid ?? '',\n parts.challenge,\n parts.expiresAt,\n ])\n}\n\n/**\n * The HKDF step: derive the 256-bit proof bits from the `_broker` seed,\n * domain-separated per `(vaultId, brokerId)`. Returns the raw bits — the\n * value registered with the broker host once at enrol (spec §2 step 2/3).\n * Does not mutate or zero `seed`; the caller owns the seed's lifecycle.\n */\nexport async function deriveBrokerProofBits(\n seed: Uint8Array,\n vaultId: string,\n brokerId: string,\n memberUserId?: string,\n): Promise<Uint8Array> {\n const hkdfKey = await subtle.importKey('raw', seed as BufferSource, 'HKDF', false, ['deriveBits'])\n const salt = new TextEncoder().encode(BROKER_PROOF_DOMAIN)\n // core#73: a member key is domain-separated per user as well — a fourth\n // element, so an admin info tag and a member info tag can never collide.\n const info = new TextEncoder().encode(JSON.stringify(\n memberUserId === undefined ? [BROKER_PROOF_DOMAIN, vaultId, brokerId] : [BROKER_PROOF_DOMAIN, vaultId, brokerId, memberUserId],\n ))\n const bits = await subtle.deriveBits({ name: 'HKDF', hash: 'SHA-256', salt, info }, hkdfKey, 256)\n return new Uint8Array(bits)\n}\n\n/**\n * Derive the steady-state, non-extractable `['sign']` HMAC proof key from\n * the `_broker` seed. Zeroes the transient HKDF-output bytes in a `finally`\n * once the key has been imported (F5) — the raw bits never leave this\n * function in usable form after import.\n */\nexport async function deriveBrokerProofKey(\n seed: Uint8Array,\n vaultId: string,\n brokerId: string,\n memberUserId?: string,\n): Promise<EnclaveKey> {\n const proofBits = await deriveBrokerProofBits(seed, vaultId, brokerId, memberUserId)\n try {\n return await subtle.importKey('raw', proofBits as BufferSource, { name: 'HMAC', hash: 'SHA-256' }, false, ['sign'])\n } finally {\n proofBits.fill(0)\n }\n}\n\n/**\n * Compose derive + sign for the client: re-derive the proof key from the\n * seed and sign the canonical over `canonicalParts` (spec §2 step 3).\n *\n * Rejects an empty-string `instancePid` (F7 — absent is fine, `''` is not).\n * Zeroes the `seed` argument in a `finally` on EVERY path including a throw\n * (F5, durable-secret discipline) — the transient HKDF bits are zeroed one\n * layer down, inside {@link deriveBrokerProofKey}.\n */\nexport async function computeBrokerProof(\n seed: Uint8Array,\n vaultId: string,\n brokerId: string,\n canonicalParts: BrokerProofCanonicalParts,\n): Promise<string> {\n try {\n if (canonicalParts.instancePid === '') {\n throw new ValidationError(\n \"computeBrokerProof: instancePid must not be an empty string — omit the field entirely for \" +\n \"'no instance' (F7); '' would alias onto a registered instance.\",\n )\n }\n const canonical = buildCanonical(vaultId, brokerId, canonicalParts)\n const key = await deriveBrokerProofKey(seed, vaultId, brokerId, canonicalParts.member?.userId)\n const mac = await subtle.sign('HMAC', key, new TextEncoder().encode(canonical) as BufferSource)\n return bufferToBase64(new Uint8Array(mac))\n } finally {\n seed.fill(0)\n }\n}\n\n/**\n * Host-side nonce mint: 32 random bytes, base64-encoded, plus an ISO\n * `expiresAt` at most `ttlMs` (default 60 s) in the future. The caller\n * (the broker host) persists both returned strings **verbatim** and MACs\n * those exact bytes on verify — never a reparsed/reformatted copy (F8).\n */\nexport function issueChallenge(opts?: { ttlMs?: number }): IssuedChallenge {\n const ttlMs = opts?.ttlMs ?? DEFAULT_CHALLENGE_TTL_MS\n const bytes = globalThis.crypto.getRandomValues(new Uint8Array(32))\n return {\n challenge: bufferToBase64(bytes),\n expiresAt: new Date(Date.now() + ttlMs).toISOString(),\n }\n}\n\n/**\n * Verify a submitted broker proof. Order is NON-NEGOTIABLE (spec §3):\n *\n * 1. `await consumeChallenge(challenge)` FIRST — burn-and-check-fresh; a\n * not-fresh (already-consumed or unknown) challenge short-circuits to\n * `false` before any MAC work (F2).\n * 2. Empty-string `instancePid` is rejected (F7), then the canonical is\n * recomputed over the verbatim `endpointOrigin`/`brokerId`/`profile`/\n * `instancePid`/`challenge`/`expiresAt` and compared via\n * `crypto.subtle.verify('HMAC', …)` — portable, constant-time, never a\n * manual compare or Node `timingSafeEqual` (F6).\n * 3. `now < expiresAt` — the client clock is never trusted; `expiresAt`\n * rides inside the already-verified MAC (F4/F8).\n */\nexport async function verifyBrokerProof(args: VerifyBrokerProofArgs): Promise<boolean> {\n const fresh = await args.consumeChallenge(args.challenge)\n if (!fresh) return false\n\n if (args.instancePid === '') return false\n\n const canonical = buildCanonical(args.vaultId, args.brokerId, {\n endpointOrigin: args.endpointOrigin,\n member: args.member,\n profile: args.profile,\n instancePid: args.instancePid,\n challenge: args.challenge,\n expiresAt: args.expiresAt,\n })\n const key = await subtle.importKey(\n 'raw',\n args.registeredProofKey as BufferSource,\n { name: 'HMAC', hash: 'SHA-256' },\n false,\n ['verify'],\n )\n const ok = await subtle.verify(\n 'HMAC',\n key,\n base64ToBuffer(args.proof) as BufferSource,\n new TextEncoder().encode(canonical) as BufferSource,\n )\n if (!ok) return false\n\n return Date.now() < Date.parse(args.expiresAt)\n}\n","import type { CapsuleGroup } from '../contract.js'\n\n/**\n * `enclave-aes` supports every group. It is the REFERENCE capsule — the\n * behaviour every other implementation is compared against, and the one hub\n * ships so that `npm install @noy-db/hub` alone is a working noy-db.\n *\n * An `exclave-*` refuses `authenticate` and `seal` (no secret, no key\n * hierarchy — the store's own IAM is the authority) and may refuse the\n * optional groups. That asymmetry is what the prefix means, and the\n * conformance suite asserts it from the package name rather than trusting a\n * declaration.\n *\n * Frozen so a caller cannot edit what a capsule claims to support: a mutable\n * set would let a service \"enable\" a group by adding to it, which is exactly\n * the confidently-wrong failure the typed refusal exists to prevent.\n */\n/**\n * ⛔ `Object.freeze` does NOT make a Set immutable — it guards own properties,\n * not internal slots, so `frozen.add(x)` still succeeds. Measured 2026-09-12,\n * against a test that asserted otherwise and failed. The mutators are replaced\n * so the refusal is real at runtime, not just in the type.\n *\n * Why it has to be real: a caller holding a mutable capability set can \"enable\"\n * a group the capsule does not implement, and the next thing that happens is a\n * primitive being called on a capsule that has none. `ReadonlySet` alone is a\n * compile-time claim, and a JS consumer never sees it.\n */\nfunction sealedSet<T>(items: readonly T[]): ReadonlySet<T> {\n const set = new Set<T>(items)\n const refuse = (): never => {\n throw new TypeError(\n 'capabilities() is immutable — a capsule\\'s declared groups cannot be edited by a caller',\n )\n }\n set.add = refuse as never\n set.delete = refuse as never\n set.clear = refuse as never\n return Object.freeze(set)\n}\n\nconst ALL: ReadonlySet<CapsuleGroup> = sealedSet<CapsuleGroup>([\n 'authenticate',\n 'seal',\n 'cipher',\n 'digest',\n 'sign',\n 'codec',\n 'sealing',\n 'deterministic',\n 'classify',\n // ⭐ ADDED 2026-09-16 (core#42). `enclave-aes` implements `wrapCek` and\n // `unwrapCek`, so advertising the group is the truthful `capabilities()`.\n // The nine-member set was the REFERENCE capsule under-reporting itself:\n // \"supports every group\" was the documented intent above, and it had been\n // untrue since `per-record-keys` existed as a refusable thing.\n // ⛔ This is a published behaviour change — `capabilities()` returns one\n // more member to any consumer that inspects it. Release-noted by name.\n 'per-record-keys',\n])\n\nexport function capabilities(): ReadonlySet<CapsuleGroup> {\n return ALL\n}\n","/**\n * **capsule/enclave-aes** — the hub's crypto interior, behind one door.\n *\n * This barrel is **the fork-swap contract**: a sister project that wants a\n * different crypto engine (a different KDF, a hardware-backed keystore, a\n * post-quantum wrap algorithm, …) replaces the entire `capsule/enclave-aes/`\n * folder wholesale and only has to honor the exports below. Nothing outside\n * `capsule/enclave-aes/**` may deep-import `crypto.js` or `record-keys/*` directly\n * — `scripts/check-architecture.mjs`'s `enclave-barrel-only` check enforces\n * that mechanically. Import sites inside `capsule/enclave-aes/**` keep their\n * existing relative imports; this door is for everyone else.\n *\n * The export list is the OBSERVED contract — exactly the symbols consumed\n * from outside this folder today — grouped by the module that defines them:\n *\n * - key type — `crypto.ts`: `EnclaveKey`, the opaque key type every\n * barrel-facing signature traffics in (`= CryptoKey` in\n * noy-db's reference enclave; a fork redefines it to its\n * own key representation — see the type's own doc for\n * the fork contract).\n * - crypto ops — `crypto.ts`: AES-256-GCM encrypt/decrypt (+ bytes, AAD,\n * deterministic variants), SHA-256 / HMAC-SHA-256 hashing.\n * - key lifecycle — `crypto.ts` + `record-keys/lifecycle.ts`: KEK/DEK\n * derivation, AES-KW wrap/unwrap, per-record CEK\n * wrap/unwrap/import + resolution/re-wrap, HKDF-derived\n * presence/sealed-field keys, base64 helpers.\n * - record codec — `record-keys/record-codec.ts`: the per-record\n * encode/decode engine.\n * - sealing — `record-keys/sealing.ts`: the sealed-record grantor\n * primitives (seal/revoke/rotate to an `at-*` host).\n * - deterministic — `record-keys/deterministic.ts`: blind-equality lookup\n * over deterministically-encrypted fields.\n * - tombstone — `record-keys/tombstone.ts`: the erased-record residue.\n * - envelope body — `record-keys/envelope-body.ts`: the C1 protected-body\n * access contract (`openEnvelopeJson`,\n * `writeEnvelopeBody`, `hasPerRecordKey`,\n * `hasSealedBody`, `envelopeBodyForHash`) — the\n * sanctioned door onto\n * `_iv`/`_data`/`_cek`/`_sealed` for everyone outside\n * this folder.\n * - reserved envelopes — `plumbing/sealed-slots.ts`: `makeReservedEnvelopes`,\n * the whole-envelope encrypt/decrypt door scoped to a\n * declared collection-name prefix (e.g. `_dict_`) —\n * `kernel/vault.ts` binds it for `DictionaryHandle`\n * (#629 Task 4).\n *\n * Additive changes only — removing or renaming an export here is breaking\n * for any fork. Frozen by `__tests__/enclave-surface-golden.test.ts`.\n *\n * **Refusal contract:** the barrel above is frozen — every symbol must\n * exist in any fork — but the optional groups (sealing, deterministic,\n * per-record-key lifecycle) MAY throw `EnclaveNotSupportedError` instead\n * of implementing the reference behavior. The core groups (crypto ops,\n * record codec, tombstone) MUST NOT throw it — they are load-bearing for\n * every consumer regardless of which enclave is wired in. noy-db's own\n * enclave supports every group, so it never throws this error.\n */\n\nimport { aesCapsule } from './bound.js'\n\n// ─── key type ──────────────────────────────────────────────────────\nexport type { EnclaveKey, EncryptResult } from './crypto.js'\n\n// ─── crypto ops ────────────────────────────────────────────────────\nexport {\n encrypt,\n decrypt,\n encryptBytes,\n decryptBytes,\n encryptBytesWithAAD,\n decryptBytesWithAAD,\n encryptDeterministic,\n decryptDeterministic,\n} from './crypto.js'\n\n// ─── key lifecycle ─────────────────────────────────────────────────\nexport {\n deriveKey,\n deriveSecretKey,\n generateDEK,\n generateEphemeralKey,\n importTransferKey,\n importWrappingKey,\n exportDekSet,\n importDekSet,\n wrapKey,\n unwrapKey,\n mintCanary,\n checkCanary,\n deriveDeterministicKey,\n deriveSealedFieldKey,\n deriveSealedFieldKeyFromCek,\n wrapCek,\n unwrapCek,\n importCek,\n deriveEchoKey,\n} from './crypto.js'\nexport type { SecretKeyUsage } from './crypto.js'\n// ─── shared plumbing ───────────────────────────────────────────────\n//\n// Everything from here to the end of this block used to be twelve modules\n// under `./record-keys/`. They now live once in `../plumbing/`, and this\n// capsule is one of two callers of `makeCapsule()`.\n//\n// The split below is not cosmetic. The cipher-FREE half is re-exported\n// straight from its module: it inspects envelope fields and derives hash\n// input, so there is nothing to bind and every capsule gets the identical\n// function. The cipher-BOUND half is destructured off `aesCapsule`, which is\n// `makeCapsule(aesPrimitives)` — one binding for the whole capsule, so a value\n// exported here and a value used inside `classify/**` are the SAME object.\nexport {\n buildRecordAad,\n recordAadFor,\n buildRecordEnvelope,\n isTombstone,\n isTombstoneShape,\n buildTombstone,\n isDeleteMarker,\n buildDeleteMarker,\n requireSealedBody,\n sealedBodyArgs,\n envelopeBodySize,\n hasPerRecordKey,\n envelopeBodyForHash,\n hasSealedBody,\n} from '../plumbing/index.js'\n// ─── digest group ──────────────────────────────────────────────────\n// Shared, not AES-specific: the seam design marks `digest` \"as today\" for every\n// capsule. Re-exported here so the barrel's surface is unchanged.\nexport {\n sha256Hex,\n sha256Bytes,\n hmacSha256Hex,\n hmacSignHex,\n hkdfAesGcmKey,\n deriveBlobAddressKey,\n derivePresenceKey,\n derivePresenceTagKey,\n generateIV,\n generateSalt,\n generateRecoverySecret,\n bufferToBase64,\n base64ToBuffer,\n encodeEchoParts,\n} from '../plumbing/digest.js'\nexport type { EchoSecretParts } from '../plumbing/digest.js'\nexport type { RecordIdentity, RecordRef } from '../plumbing/index.js'\nimport type { RecordCodecBase } from '../plumbing/record-codec.js'\n/**\n * `RecordCodec` is a VALUE (the capsule-bound subclass, destructured below) and\n * a TYPE (the module-level generic base). A type ALIAS can coexist with a value\n * of the same name; a `export type { RecordCodec }` RE-EXPORT cannot, which is\n * what `TS2323: Cannot redeclare exported variable` was saying.\n */\nexport type RecordCodec<T = Record<string, unknown>> = RecordCodecBase<T>\nexport { buildSealedRecordEnvelope } from '../plumbing/record-envelope.js'\nexport type { RecordEnvelopeBody } from '../plumbing/record-envelope.js'\nexport type { RewrappedBody } from '../plumbing/lifecycle.js'\nexport type { SealedShredSlot } from '../plumbing/record-codec.js'\nexport type { SealingContext } from '../plumbing/sealing.js'\nexport type { DeterministicContext } from '../plumbing/deterministic.js'\n\nexport const {\n // envelope body\n openEnvelopeJson,\n writeEnvelopeBody,\n verifyRecordIdentity,\n // key lifecycle\n resolveStableCek,\n rewrapBodyToDek,\n rewrapEnvelope,\n applyRewrappedBody,\n isRewrappedUnder,\n // rekey\n rekeyEnvelopeToDek,\n rekeyEnvelopeIfNeeded,\n envelopeOpensUnderAny,\n rekeyBlobSet,\n // record codec\n RecordCodec,\n // sealed slots — ONLY `makeReservedEnvelopes` is part of the frozen surface.\n // The other seven are capsule-internal; destructuring the whole capsule here\n // leaked them and widened the golden by 8 names. A surface is a contract, so\n // the fix is to narrow the barrel, not to re-baseline the golden.\n makeReservedEnvelopes,\n // sealing\n SEALED_CEK_NS,\n sealRecordToHost,\n revokeSealedRecord,\n rotateRecordCek,\n // deterministic\n findByDet,\n queryByDet,\n} = aesCapsule\n\n// ─── reserved envelopes (ViaCryptoCtx.reservedEnvelopes capability) ──\n\n// ─── classify (stage-2 verify oracle primitives) ────────────────────\n// ADDITIVE per Enclave Contract v1. A fork must provide these four; the\n// verify/matchGroup orchestration (classify/verify.ts) sits behind the\n// with-shape dynamic-import seam and is not part of the fork contract.\nexport { deriveVdigSlotKey } from './classify/vdig.js'\nexport { pbkdf2VerifyDigest } from './classify/digest.js'\nexport { ctEqualTags } from '../plumbing/ct-equal.js'\nexport { evaluateKofN } from '../plumbing/kofn.js'\n\n// ─── classify (slice-2b equatable blind index) ──────────────────────\n// ADDITIVE per Enclave Contract v1. A fork must provide these four; the\n// findByDigest orchestration (collection.ts) sits behind the with-shape\n// dynamic-import seam and is not part of the fork contract.\nexport { deriveClassifyIndexKey, deriveClassifyIndexSalt, mintBidxTag } from './classify/bidx.js'\nexport { computeBidxTarget } from './classify/find.js'\n\n// ─── broker (proof derivation + challenge/verify, #479 slice 2) ─────\n// ADDITIVE per Enclave Contract v1. A fork must provide these five; the\n// seed lifecycle + network/cache orchestration (with-party/broker/**) sits\n// behind its own dynamic-import seam and is not part of the fork contract.\nexport {\n deriveBrokerProofBits,\n deriveBrokerProofKey,\n computeBrokerProof,\n issueChallenge,\n verifyBrokerProof,\n} from './broker/proof.js'\nexport type { BrokerProofCanonicalParts, BrokerMemberIdentity, VerifyBrokerProofArgs, IssuedChallenge } from './broker/proof.js'\n\n// ─── sign ─────────────────────────────────────────────────────────────\nexport { generateSigningKeyPair, signBytes, verifyBytes } from '../plumbing/sign.js'\n\n// ─── recipient sealing ────────────────────────────────────────────────\nexport type { EnclaveKeyPair } from './crypto.js'\nexport {\n generateRecipientKeyPair,\n exportRecipientPrivateKeyPkcs8,\n importRecipientKeyPair,\n exportRecipientPublicKeySpki,\n importRecipientPublicKeySpki,\n recipientWrap,\n recipientUnwrap,\n} from './crypto.js'\n\n// ─── capabilities ─────────────────────────────────────────────────────\n// What THIS capsule supports. Part of the contract every capsule implements,\n// not an enclave-aes detail — an alternative declares its own, and a service\n// asserts against it at createNoydb() rather than failing on first write.\nexport { capabilities } from './capabilities.js'\n"],"mappings":"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","names":[]}
@@ -21,7 +21,7 @@
21
21
  * the surface test freezes, so the door and the golden cannot drift. Adding a
22
22
  * capsule primitive means adding it to the golden and regenerating.
23
23
  */
24
- export { RecordCodec, SEALED_CEK_NS, applyRewrappedBody, base64ToBuffer, bufferToBase64, buildDeleteMarker, buildRecordAad, buildRecordEnvelope, buildSealedRecordEnvelope, buildTombstone, capabilities, checkCanary, computeBidxTarget, computeBrokerProof, ctEqualTags, decrypt, decryptBytes, decryptBytesWithAAD, decryptDeterministic, deriveBlobAddressKey, deriveBrokerProofBits, deriveBrokerProofKey, deriveClassifyIndexKey, deriveClassifyIndexSalt, deriveDeterministicKey, deriveEchoKey, deriveKey, derivePresenceKey, derivePresenceTagKey, deriveSealedFieldKey, deriveSealedFieldKeyFromCek, deriveSecretKey, deriveVdigSlotKey, encodeEchoParts, encrypt, encryptBytes, encryptBytesWithAAD, encryptDeterministic, envelopeBodyForHash, envelopeBodySize, envelopeOpensUnderAny, evaluateKofN, exportDekSet, exportRecipientPublicKeySpki, findByDet, generateDEK, generateEphemeralKey, generateIV, generateRecipientKeyPair, generateRecoverySecret, generateSalt, generateSigningKeyPair, hasPerRecordKey, hasSealedBody, requireSealedBody, sealedBodyArgs, hkdfAesGcmKey, hmacSha256Hex, hmacSignHex, importCek, importDekSet, importRecipientPublicKeySpki, importTransferKey, isDeleteMarker, isRewrappedUnder, isTombstone, isTombstoneShape, issueChallenge, makeReservedEnvelopes, mintBidxTag, mintCanary, openEnvelopeJson, pbkdf2VerifyDigest, queryByDet, recipientUnwrap, recipientWrap, recordAadFor, rekeyBlobSet, rekeyEnvelopeIfNeeded, rekeyEnvelopeToDek, resolveStableCek, revokeSealedRecord, rewrapBodyToDek, rewrapEnvelope, rotateRecordCek, sealRecordToHost, sha256Bytes, sha256Hex, signBytes, unwrapCek, unwrapKey, verifyBrokerProof, verifyBytes, verifyRecordIdentity, wrapCek, wrapKey, writeEnvelopeBody, } from '#capsule';
25
- export type { BrokerProofCanonicalParts, DeterministicContext, EchoSecretParts, EnclaveKey, EnclaveKeyPair, EncryptResult, IssuedChallenge, RecordEnvelopeBody, RecordIdentity, RecordRef, RewrappedBody, SealedShredSlot, SealingContext, SecretKeyUsage, VerifyBrokerProofArgs, } from '#capsule';
24
+ export { RecordCodec, SEALED_CEK_NS, applyRewrappedBody, base64ToBuffer, bufferToBase64, buildDeleteMarker, buildRecordAad, buildRecordEnvelope, buildSealedRecordEnvelope, buildTombstone, capabilities, checkCanary, computeBidxTarget, computeBrokerProof, ctEqualTags, decrypt, decryptBytes, decryptBytesWithAAD, decryptDeterministic, deriveBlobAddressKey, deriveBrokerProofBits, deriveBrokerProofKey, deriveClassifyIndexKey, deriveClassifyIndexSalt, deriveDeterministicKey, deriveEchoKey, deriveKey, derivePresenceKey, derivePresenceTagKey, deriveSealedFieldKey, deriveSealedFieldKeyFromCek, deriveSecretKey, deriveVdigSlotKey, encodeEchoParts, encrypt, encryptBytes, encryptBytesWithAAD, encryptDeterministic, envelopeBodyForHash, envelopeBodySize, envelopeOpensUnderAny, evaluateKofN, exportDekSet, exportRecipientPublicKeySpki, findByDet, generateDEK, generateEphemeralKey, generateIV, generateRecipientKeyPair, exportRecipientPrivateKeyPkcs8, importRecipientKeyPair, generateRecoverySecret, generateSalt, generateSigningKeyPair, hasPerRecordKey, hasSealedBody, requireSealedBody, sealedBodyArgs, hkdfAesGcmKey, hmacSha256Hex, hmacSignHex, importCek, importDekSet, importRecipientPublicKeySpki, importTransferKey, importWrappingKey, isDeleteMarker, isRewrappedUnder, isTombstone, isTombstoneShape, issueChallenge, makeReservedEnvelopes, mintBidxTag, mintCanary, openEnvelopeJson, pbkdf2VerifyDigest, queryByDet, recipientUnwrap, recipientWrap, recordAadFor, rekeyBlobSet, rekeyEnvelopeIfNeeded, rekeyEnvelopeToDek, resolveStableCek, revokeSealedRecord, rewrapBodyToDek, rewrapEnvelope, rotateRecordCek, sealRecordToHost, sha256Bytes, sha256Hex, signBytes, unwrapCek, unwrapKey, verifyBrokerProof, verifyBytes, verifyRecordIdentity, wrapCek, wrapKey, writeEnvelopeBody, } from '#capsule';
25
+ export type { BrokerMemberIdentity, BrokerProofCanonicalParts, DeterministicContext, EchoSecretParts, EnclaveKey, EnclaveKeyPair, EncryptResult, IssuedChallenge, RecordEnvelopeBody, RecordIdentity, RecordRef, RewrappedBody, SealedShredSlot, SealingContext, SecretKeyUsage, VerifyBrokerProofArgs, } from '#capsule';
26
26
  export type { CapsuleKey, CapsuleKeyPair, CapsuleGroup } from './contract.js';
27
27
  export { CapsuleNotSupportedError } from './contract.js';
@@ -415,6 +415,13 @@ export declare class RecordCodecBase<T> {
415
415
  * The capsule-bound codec constructor: same shape callers have always used
416
416
  * (`new RecordCodec(ctx)`), with the capsule already closed over.
417
417
  */
418
+ /**
419
+ * `BoundRecordCodec` — PUBLISHED API, reachable from @noy-db/hub/capsule. Flagged as unused because
420
+ * nothing inside hub imports it from this module; a consumer does. Do not narrow
421
+ * or delete without a seam change (#55).
422
+ *
423
+ * @public
424
+ */
418
425
  export type BoundRecordCodec = (new <T>(ctx: RecordCodecContext<T>) => RecordCodecBase<T>) & Omit<typeof RecordCodecBase, never>;
419
426
  export declare function makeRecordCodec(p: CapsulePrimitives, slots: ReturnType<typeof makeSealedSlots>): {
420
427
  RecordCodec: BoundRecordCodec;
@@ -42,6 +42,7 @@ import {
42
42
  envelopeOpensUnderAny,
43
43
  evaluateKofN,
44
44
  exportDekSet,
45
+ exportRecipientPrivateKeyPkcs8,
45
46
  exportRecipientPublicKeySpki,
46
47
  findByDet,
47
48
  generateDEK,
@@ -58,8 +59,10 @@ import {
58
59
  hmacSignHex,
59
60
  importCek,
60
61
  importDekSet,
62
+ importRecipientKeyPair,
61
63
  importRecipientPublicKeySpki,
62
64
  importTransferKey,
65
+ importWrappingKey,
63
66
  isDeleteMarker,
64
67
  isRewrappedUnder,
65
68
  isTombstone,
@@ -96,16 +99,16 @@ import {
96
99
  wrapCek,
97
100
  wrapKey,
98
101
  writeEnvelopeBody
99
- } from "./chunk-EZGV6F47.js";
102
+ } from "./chunk-WRLWEYHY.js";
100
103
  import {
101
104
  CapsuleNotSupportedError
102
- } from "./chunk-OIEO4WDL.js";
103
- import "./chunk-Q2XRFWOI.js";
105
+ } from "./chunk-ZD7WFMV2.js";
106
+ import "./chunk-RRTQAQ3N.js";
104
107
  import "./chunk-NH2UOV3B.js";
105
- import "./chunk-42ALPZ2B.js";
106
- import "./chunk-QMWY2FDS.js";
107
- import "./chunk-SV2PM2OY.js";
108
- import "./chunk-37EPTBBR.js";
108
+ import "./chunk-ZF6JECDT.js";
109
+ import "./chunk-THQ3BHLM.js";
110
+ import "./chunk-XX4R7TUB.js";
111
+ import "./chunk-IKPQ2GGB.js";
109
112
  export {
110
113
  CapsuleNotSupportedError,
111
114
  RecordCodec,
@@ -151,6 +154,7 @@ export {
151
154
  envelopeOpensUnderAny,
152
155
  evaluateKofN,
153
156
  exportDekSet,
157
+ exportRecipientPrivateKeyPkcs8,
154
158
  exportRecipientPublicKeySpki,
155
159
  findByDet,
156
160
  generateDEK,
@@ -167,8 +171,10 @@ export {
167
171
  hmacSignHex,
168
172
  importCek,
169
173
  importDekSet,
174
+ importRecipientKeyPair,
170
175
  importRecipientPublicKeySpki,
171
176
  importTransferKey,
177
+ importWrappingKey,
172
178
  isDeleteMarker,
173
179
  isRewrappedUnder,
174
180
  isTombstone,
@@ -206,4 +212,4 @@ export {
206
212
  wrapKey,
207
213
  writeEnvelopeBody
208
214
  };
209
- //# sourceMappingURL=capsule-VOLX3QRQ.js.map
215
+ //# sourceMappingURL=capsule-6LJAVQNM.js.map
@@ -5,77 +5,77 @@ import {
5
5
  describeExtraction,
6
6
  unsealDeks,
7
7
  withCargo
8
- } from "../chunk-H7JBY4P7.js";
9
- import {
10
- diffVault
11
- } from "../chunk-LFUID7OW.js";
8
+ } from "../chunk-B7Y2BRQA.js";
12
9
  import {
13
10
  extractPartition,
14
11
  walkClosure
15
- } from "../chunk-EGVJ7TM4.js";
12
+ } from "../chunk-UL6MTRMJ.js";
13
+ import {
14
+ diffVault
15
+ } from "../chunk-LFUID7OW.js";
16
16
  import {
17
17
  createDeedOwner,
18
18
  isDeedVault,
19
19
  liberateVault,
20
20
  loadDeedMarker
21
- } from "../chunk-UIYESRD6.js";
22
- import "../chunk-IMQKWR46.js";
23
- import "../chunk-EJLV62NI.js";
21
+ } from "../chunk-LUCQY3OM.js";
22
+ import "../chunk-R2ZULFXU.js";
23
+ import "../chunk-KN4LUMH6.js";
24
24
  import {
25
25
  groupAndReduce,
26
26
  reduceRecords
27
- } from "../chunk-N7UDP5VU.js";
27
+ } from "../chunk-SCH2F7R2.js";
28
28
  import {
29
29
  NO_CARGO
30
- } from "../chunk-52MGURXO.js";
31
- import "../chunk-3XJQBBZD.js";
30
+ } from "../chunk-WBUHHMLN.js";
31
+ import "../chunk-NTVKHQ3L.js";
32
32
  import {
33
33
  isQuorum,
34
34
  runDrainBarrier
35
- } from "../chunk-DIZLQVAA.js";
35
+ } from "../chunk-4CHM2TRS.js";
36
36
  import {
37
37
  CustodyApi
38
- } from "../chunk-V3RWOOSO.js";
39
- import "../chunk-3L2NBKDR.js";
40
- import "../chunk-KZXDLBY6.js";
41
- import "../chunk-5A4345TG.js";
38
+ } from "../chunk-GYZICGRU.js";
39
+ import "../chunk-IF2M43G4.js";
40
+ import "../chunk-XPW7T2GN.js";
41
+ import "../chunk-DMIEKD24.js";
42
42
  import "../chunk-GMKGGY7V.js";
43
43
  import {
44
44
  fuseRetrieval
45
45
  } from "../chunk-AURFOK3D.js";
46
- import "../chunk-G2MVBDFP.js";
46
+ import "../chunk-QFW4MYGN.js";
47
47
  import "../chunk-XZHEOSQ2.js";
48
- import "../chunk-MBMTND6D.js";
48
+ import "../chunk-AGGPT4UE.js";
49
49
  import "../chunk-SUZKW6UR.js";
50
50
  import "../chunk-VHM7HCKB.js";
51
- import "../chunk-FOEDQATO.js";
51
+ import "../chunk-66GD7XXU.js";
52
52
  import {
53
53
  readPath
54
- } from "../chunk-5WWDGFOS.js";
55
- import "../chunk-OKSTSITU.js";
56
- import "../chunk-SYNY3VB5.js";
57
- import "../chunk-XSPFDUDG.js";
58
- import "../chunk-LIOVX5TJ.js";
59
- import "../chunk-7XMHMVTS.js";
54
+ } from "../chunk-GIQJGXV7.js";
55
+ import "../chunk-PR7ILCIH.js";
56
+ import "../chunk-NCTN2FW4.js";
57
+ import "../chunk-V7AKGAXY.js";
58
+ import "../chunk-QT5ITL25.js";
59
+ import "../chunk-NXQEOC3X.js";
60
60
  import {
61
61
  generateULID
62
62
  } from "../chunk-4AOERLTV.js";
63
63
  import "../chunk-SVLR4POP.js";
64
- import "../chunk-N7EVQD5S.js";
64
+ import "../chunk-ONZ3B5EW.js";
65
65
  import "../chunk-I7FD46FF.js";
66
- import "../chunk-6QVKPHBF.js";
67
- import "../chunk-FLPCETP6.js";
66
+ import "../chunk-QHG7GQKM.js";
67
+ import "../chunk-2LBS62AC.js";
68
68
  import {
69
69
  sha256Hex
70
- } from "../chunk-EZGV6F47.js";
71
- import "../chunk-OIEO4WDL.js";
72
- import "../chunk-Q2XRFWOI.js";
70
+ } from "../chunk-WRLWEYHY.js";
71
+ import "../chunk-ZD7WFMV2.js";
72
+ import "../chunk-RRTQAQ3N.js";
73
73
  import "../chunk-NH2UOV3B.js";
74
- import "../chunk-42ALPZ2B.js";
75
- import "../chunk-QMWY2FDS.js";
74
+ import "../chunk-ZF6JECDT.js";
75
+ import "../chunk-THQ3BHLM.js";
76
76
  import {
77
77
  NOYDB_ENVELOPE_GENERATION
78
- } from "../chunk-SV2PM2OY.js";
78
+ } from "../chunk-XX4R7TUB.js";
79
79
  import {
80
80
  AdoptionStateError,
81
81
  CargoNotEnabledError,
@@ -90,7 +90,7 @@ import {
90
90
  UnknownShardError,
91
91
  ValidationError,
92
92
  VaultTemplateNotFoundError
93
- } from "../chunk-37EPTBBR.js";
93
+ } from "../chunk-IKPQ2GGB.js";
94
94
  export {
95
95
  AdoptionStateError,
96
96
  CargoNotEnabledError,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BrokerNotEnabledError
3
- } from "./chunk-37EPTBBR.js";
3
+ } from "./chunk-IKPQ2GGB.js";
4
4
 
5
5
  // src/port/with/broker-strategy.ts
6
6
  var NO_BROKER = {
@@ -12,6 +12,12 @@ var NO_BROKER = {
12
12
  },
13
13
  credentialSource() {
14
14
  throw new BrokerNotEnabledError();
15
+ },
16
+ // grant()/revoke() must keep working without a broker — these two are the
17
+ // only members of this stub that do NOT throw.
18
+ async enrolMember() {
19
+ },
20
+ async revokeMember() {
15
21
  }
16
22
  };
17
23
  function buildCredentialBrokerHandle(strategy, store, vault, getKeyring) {
@@ -27,4 +33,4 @@ export {
27
33
  NO_BROKER,
28
34
  buildCredentialBrokerHandle
29
35
  };
30
- //# sourceMappingURL=chunk-GZT3NQRA.js.map
36
+ //# sourceMappingURL=chunk-25FXU6WS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/port/with/broker-strategy.ts"],"sourcesContent":["/**\n * Credential-broker strategy seam (#479, credential-broker spec §5). Lives\n * on the `/with` port (the one seam the kernel spine may import statically)\n * so `Vault` can hold the `NO_BROKER` floor default without a spine→service\n * static import — the same idiom as `port/with/team-strategy.ts`.\n *\n * `BrokerCtx` bundles what the `_broker` seed lifecycle needs (`store`/\n * `vault`/`keyring`) into one argument, so `BrokerStrategy`'s three methods\n * stay uniform. The `BrokerConfig` a strategy was built with is NOT part of\n * this port-level ctx — `withBroker(config)` (`with-party/broker/active.ts`)\n * keeps it in its own closure and injects it into the richer\n * {@link BrokerSeedCtx} it passes to the `_broker` seed ops\n * (`enrollSeed`/`rotateSeed`/`mintStoreCredentials`). `NO_BROKER` (the floor\n * default) never builds a ctx — every method throws first.\n * @internal\n */\nimport type { NoydbStore, StoreCredentialSource } from '../../kernel/types.js'\nimport type { UnlockedKeyring } from '../../with-party/team/keyring.js'\nimport type { EnclaveKey } from '../../capsule/index.js'\nimport { BrokerNotEnabledError } from '../../kernel/errors.js'\n\n/** Construction-time options for `withBroker(config)` (spec §5 client surface). */\nexport interface BrokerConfig {\n /**\n * Stable id; part of the HKDF info tag AND the proof canonical. MUST be\n * globally-unique / endpoint-derived (spec F4) — reusing one `brokerId`\n * across two endpoints enables a cross-endpoint relay.\n */\n readonly brokerId: string\n /** https broker base URL; its origin is bound into the proof MAC (F4). */\n readonly endpoint: string\n /** Dev-backend session token for `/enroll` (spec decision 1). */\n readonly attestation?: (() => string | Promise<string>) | undefined\n /** DI for tests / non-window runtimes. */\n readonly fetch?: typeof fetch | undefined\n /** Refresh margin in ms, default 60_000. */\n readonly skewMs?: number | undefined\n}\n\n/**\n * Per-call context a {@link BrokerStrategy} method needs: the seed API's\n * `store`/`vault`/`keyring`.\n */\nexport interface BrokerCtx {\n readonly store: NoydbStore\n readonly vault: string\n readonly keyring: UnlockedKeyring\n}\n\n/**\n * {@link BrokerCtx} augmented with the `BrokerConfig` the `_broker` seed ops\n * (`enrollSeed`/`rotateSeed`/`mintStoreCredentials`) need. `withBroker(config)`\n * (`with-party/broker/active.ts`) builds this by injecting its closed-over\n * `config` into the port-level `BrokerCtx` it receives — the port interface\n * itself never carries `config`.\n */\nexport interface BrokerSeedCtx extends BrokerCtx {\n readonly config: BrokerConfig\n}\n\n/** The vault-bound handle `vault.broker()` returns (spec §5). */\nexport interface CredentialBrokerHandle {\n /** Generate+persist the `_broker` seed (idempotent), register its proof key. */\n enroll(): Promise<void>\n /** Rotate the seed + re-register (revokes the old proof key after a grace window). */\n rotate(): Promise<void>\n /** Single-flight, per-profile cache of a `StoreCredentialSource`. */\n credentialSource(profile?: string): StoreCredentialSource\n}\n\n/** The opt-in strategy contract `withBroker(config)` implements. */\nexport interface BrokerStrategy {\n enroll(ctx: BrokerCtx): Promise<void>\n rotate(ctx: BrokerCtx): Promise<void>\n credentialSource(ctx: BrokerCtx, profile?: string): StoreCredentialSource\n /**\n * core#73 — called by the kernel right after `grant()`: register the\n * grantee with the broker host under its own per-member key. Needs the\n * grantee's `secret` because the member's `_broker_member` DEK can only be\n * opened with it, and only at this moment does the grantor hold it. A\n * no-op for owner/admin grantees (they use the shared seed) and for the\n * floor stub (no broker ⇒ nothing to register).\n */\n /**\n * core#73 — register a sub-admin member with the host. With `secret` (a\n * grant) the member's `_broker_member` DEK is read from their keyring; with\n * `dek` (core#96, a role change through `updateUser`) it is the fresh key\n * just delivered through the member's inbox.\n */\n enrolMember(ctx: BrokerCtx, member: { readonly userId: string; readonly secret: string } | { readonly userId: string; readonly dek: EnclaveKey }): Promise<void>\n /** core#73 — called by the kernel right after `revoke()`: de-register the member with the host and drop its record. */\n revokeMember(ctx: BrokerCtx, userId: string): Promise<void>\n}\n\n/**\n * No-op stub — the floor default. Every broker operation throws\n * {@link BrokerNotEnabledError}; opt in with `brokerStrategy: withBroker(config)`\n * (from `@noy-db/hub/broker`) in `createNoydb()`.\n * @internal\n */\nexport const NO_BROKER: BrokerStrategy = {\n async enroll() { throw new BrokerNotEnabledError() },\n async rotate() { throw new BrokerNotEnabledError() },\n credentialSource() { throw new BrokerNotEnabledError() },\n // grant()/revoke() must keep working without a broker — these two are the\n // only members of this stub that do NOT throw.\n async enrolMember() { /* no broker configured */ },\n async revokeMember() { /* no broker configured */ },\n}\n\n/**\n * Build the vault-bound {@link CredentialBrokerHandle} `vault.broker()`\n * returns — factored out of `kernel/vault.ts` to keep that file's footprint\n * to a single accessor line (the kernel-surface ceiling). `getKeyring` is a\n * thunk, not a snapshot: the active keyring can change after `vault.load()`,\n * so each handle method re-reads it fresh at call time.\n */\nexport function buildCredentialBrokerHandle(\n strategy: BrokerStrategy,\n store: NoydbStore,\n vault: string,\n getKeyring: () => UnlockedKeyring,\n): CredentialBrokerHandle {\n const ctx = (): BrokerCtx => ({ store, vault, keyring: getKeyring() })\n return {\n enroll: () => strategy.enroll(ctx()),\n rotate: () => strategy.rotate(ctx()),\n credentialSource: (profile) => strategy.credentialSource(ctx(), profile),\n }\n}\n"],"mappings":";;;;;AAoGO,IAAM,YAA4B;AAAA,EACvC,MAAM,SAAS;AAAE,UAAM,IAAI,sBAAsB;AAAA,EAAE;AAAA,EACnD,MAAM,SAAS;AAAE,UAAM,IAAI,sBAAsB;AAAA,EAAE;AAAA,EACnD,mBAAmB;AAAE,UAAM,IAAI,sBAAsB;AAAA,EAAE;AAAA;AAAA;AAAA,EAGvD,MAAM,cAAc;AAAA,EAA6B;AAAA,EACjD,MAAM,eAAe;AAAA,EAA6B;AACpD;AASO,SAAS,4BACd,UACA,OACA,OACA,YACwB;AACxB,QAAM,MAAM,OAAkB,EAAE,OAAO,OAAO,SAAS,WAAW,EAAE;AACpE,SAAO;AAAA,IACL,QAAQ,MAAM,SAAS,OAAO,IAAI,CAAC;AAAA,IACnC,QAAQ,MAAM,SAAS,OAAO,IAAI,CAAC;AAAA,IACnC,kBAAkB,CAAC,YAAY,SAAS,iBAAiB,IAAI,GAAG,OAAO;AAAA,EACzE;AACF;","names":[]}
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  installLive
3
- } from "./chunk-NBQ3KK6X.js";
3
+ } from "./chunk-Y55XHMQB.js";
4
4
  import {
5
5
  installReduce
6
- } from "./chunk-4CIQDWRB.js";
6
+ } from "./chunk-BFJE2GPP.js";
7
7
  import {
8
8
  installRelate
9
- } from "./chunk-TKVUE4JF.js";
9
+ } from "./chunk-DQAXA2GK.js";
10
10
  import {
11
11
  ScanBuilder
12
- } from "./chunk-JQYKPKG6.js";
12
+ } from "./chunk-7K42TSCY.js";
13
13
  import {
14
14
  Query,
15
15
  executePlan
16
- } from "./chunk-AL6ML4LA.js";
16
+ } from "./chunk-DWCFGF2K.js";
17
17
 
18
18
  // src/kernel/query/all.ts
19
19
  installRelate();
@@ -28,4 +28,4 @@ export {
28
28
  ScanBuilder2 as ScanBuilder,
29
29
  executePlan2 as executePlan
30
30
  };
31
- //# sourceMappingURL=chunk-OYW3I5M4.js.map
31
+ //# sourceMappingURL=chunk-2DOCDOPL.js.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-2DX4JCRI.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TierWriteRefusedError
3
- } from "./chunk-37EPTBBR.js";
3
+ } from "./chunk-IKPQ2GGB.js";
4
4
 
5
5
  // src/kernel/tier-visibility.ts
6
6
  async function peekLiveTier(adapter, vault, name, id) {
@@ -49,4 +49,4 @@ export {
49
49
  dekKey,
50
50
  parseDekKey
51
51
  };
52
- //# sourceMappingURL=chunk-FLPCETP6.js.map
52
+ //# sourceMappingURL=chunk-2LBS62AC.js.map
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  linkCollectionName,
3
3
  linkRowKey
4
- } from "./chunk-Q4UHJ5SN.js";
4
+ } from "./chunk-O2VQ3K36.js";
5
5
  import {
6
6
  buildRecordAad,
7
7
  buildRecordEnvelope,
8
8
  encrypt,
9
9
  openEnvelopeJson
10
- } from "./chunk-EZGV6F47.js";
10
+ } from "./chunk-WRLWEYHY.js";
11
11
  import {
12
12
  NoydbError
13
- } from "./chunk-37EPTBBR.js";
13
+ } from "./chunk-IKPQ2GGB.js";
14
14
 
15
15
  // src/with-shape/links/link-set.ts
16
16
  var LinkSet = class {
@@ -126,4 +126,4 @@ export {
126
126
  LinkSet,
127
127
  LinkEndpointError
128
128
  };
129
- //# sourceMappingURL=chunk-WXE4W2U6.js.map
129
+ //# sourceMappingURL=chunk-2ST3WA3C.js.map