@noy-db/hub 0.5.0 → 0.6.0-pre.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/dist/api-67SBPMMH.js +20 -0
  2. package/dist/attestation/index.js +18 -18
  3. package/dist/{backup-ENTZYW37.js → backup-GAYWQAFN.js} +16 -11
  4. package/dist/backup-GAYWQAFN.js.map +1 -0
  5. package/dist/blobs/index.js +20 -20
  6. package/dist/broker/index.js +12 -12
  7. package/dist/bundle-handle-5OUAI7CV.js +36 -0
  8. package/dist/bundle-handle-5OUAI7CV.js.map +1 -0
  9. package/dist/cargo/index.js +36 -36
  10. package/dist/{chunk-V3EGXDFN.js → chunk-24UICKTB.js} +3 -3
  11. package/dist/{chunk-77AEMXFA.js → chunk-24ZLWWEO.js} +1 -1
  12. package/dist/chunk-24ZLWWEO.js.map +1 -0
  13. package/dist/{chunk-6PFST3FC.js → chunk-27TCYH6G.js} +5 -5
  14. package/dist/{chunk-PTSVGKSR.js → chunk-2KIV7BEK.js} +2 -2
  15. package/dist/{chunk-3LYMOSY7.js → chunk-2LGDCNFJ.js} +2 -2
  16. package/dist/{chunk-NWK6SVBM.js → chunk-35EBKWQU.js} +3 -3
  17. package/dist/{chunk-QMCWYN6O.js → chunk-3737A6EA.js} +3 -3
  18. package/dist/{chunk-5UKUOMO6.js → chunk-3CLZY46Y.js} +464 -237
  19. package/dist/chunk-3CLZY46Y.js.map +1 -0
  20. package/dist/{chunk-G7ZIMGPQ.js → chunk-3EO7RZLJ.js} +6 -6
  21. package/dist/{chunk-GYJRDALN.js → chunk-3FSX6LDG.js} +2 -2
  22. package/dist/{chunk-4SG5TOXK.js → chunk-3HYWYLXL.js} +2 -2
  23. package/dist/{chunk-653KOQ7A.js → chunk-3IIPWA75.js} +11 -11
  24. package/dist/{chunk-IQ423YMK.js → chunk-3UK6STWO.js} +3 -3
  25. package/dist/chunk-46V67XP5.js +117 -0
  26. package/dist/chunk-46V67XP5.js.map +1 -0
  27. package/dist/{chunk-F5UWVF6Z.js → chunk-4HDYQL3J.js} +2 -2
  28. package/dist/{chunk-J7YVY7TW.js → chunk-4MQDV3HZ.js} +2 -2
  29. package/dist/{chunk-UC5Y7OEJ.js → chunk-4UVDI4XE.js} +3 -3
  30. package/dist/{chunk-4DGBZEV6.js → chunk-4VCWI42L.js} +2 -2
  31. package/dist/{chunk-GIGLOQL7.js → chunk-747LRSOO.js} +2 -2
  32. package/dist/{chunk-W7C7MMIS.js → chunk-7F4DBNSP.js} +3 -3
  33. package/dist/{chunk-5EKL6BXI.js → chunk-7G6VDWXB.js} +3 -3
  34. package/dist/{chunk-PZRYKOKP.js → chunk-AHLJSVRL.js} +2 -2
  35. package/dist/{chunk-L67H6FAQ.js → chunk-AR2JDFAE.js} +2 -2
  36. package/dist/{chunk-TJOUKMWF.js → chunk-BPTZ4K5L.js} +11 -11
  37. package/dist/{chunk-MFW466PX.js → chunk-CCZJJ4I2.js} +4 -4
  38. package/dist/{chunk-OKBNFUUX.js → chunk-CJ73OLMW.js} +2 -2
  39. package/dist/{chunk-FHK6WWUE.js → chunk-CYQOUTMY.js} +3 -3
  40. package/dist/{chunk-LQVRK2XJ.js → chunk-DCMQR46R.js} +5 -5
  41. package/dist/{chunk-QTMZDMJ6.js → chunk-DG27IUVI.js} +2 -2
  42. package/dist/{chunk-XVK7TULT.js → chunk-DMQCLZ4Z.js} +8 -6
  43. package/dist/chunk-DMQCLZ4Z.js.map +1 -0
  44. package/dist/{chunk-IHYSIPEK.js → chunk-DPJTDNUF.js} +68 -34
  45. package/dist/chunk-DPJTDNUF.js.map +1 -0
  46. package/dist/{chunk-PKBONLCP.js → chunk-E6427JU2.js} +2 -2
  47. package/dist/{chunk-KDWBVCIX.js → chunk-EK7DT5BT.js} +220 -13
  48. package/dist/chunk-EK7DT5BT.js.map +1 -0
  49. package/dist/chunk-EPFF7LOX.js +14 -0
  50. package/dist/chunk-EPFF7LOX.js.map +1 -0
  51. package/dist/{chunk-XID22NOA.js → chunk-F3GVO44K.js} +6 -6
  52. package/dist/{chunk-U2ID5A2I.js → chunk-FAXZQ5UF.js} +2 -2
  53. package/dist/{chunk-P6UIVLZK.js → chunk-FNSMZQS4.js} +2 -2
  54. package/dist/{chunk-NIKQQXI2.js → chunk-FUHKW252.js} +2 -2
  55. package/dist/{chunk-623QEHDB.js → chunk-FY343IZR.js} +8 -8
  56. package/dist/{chunk-KPZS5QAQ.js → chunk-GQ3BX5EA.js} +9 -1
  57. package/dist/chunk-GQ3BX5EA.js.map +1 -0
  58. package/dist/{chunk-7P4LL3JH.js → chunk-GS5RT2KK.js} +4 -4
  59. package/dist/{chunk-IM2KST7E.js → chunk-HFKGIBMD.js} +3 -3
  60. package/dist/{chunk-AR5D76T2.js → chunk-HNGSV2YC.js} +129 -1
  61. package/dist/chunk-HNGSV2YC.js.map +1 -0
  62. package/dist/chunk-HNHCQ556.js +63 -0
  63. package/dist/chunk-HNHCQ556.js.map +1 -0
  64. package/dist/chunk-HS7HNYBD.js +91 -0
  65. package/dist/chunk-HS7HNYBD.js.map +1 -0
  66. package/dist/{chunk-FT5Y4VSP.js → chunk-HVQGCKY4.js} +2 -2
  67. package/dist/{chunk-MYSNNMJ3.js → chunk-HXGUIPQB.js} +3 -3
  68. package/dist/{chunk-GTQF32TP.js → chunk-JEM2IGS3.js} +9 -9
  69. package/dist/chunk-JH3OHQM4.js +260 -0
  70. package/dist/chunk-JH3OHQM4.js.map +1 -0
  71. package/dist/{chunk-ALUVACKT.js → chunk-JIUVJ4M7.js} +2 -2
  72. package/dist/{chunk-NJHQE4LT.js → chunk-JRCYZEHU.js} +2 -2
  73. package/dist/{chunk-G3ORJ3IQ.js → chunk-JSRU5W2M.js} +5 -5
  74. package/dist/{chunk-SBGXQK5I.js → chunk-JXIDGFKS.js} +2 -2
  75. package/dist/{chunk-VYYM3MEN.js → chunk-KHKKD62N.js} +16 -2
  76. package/dist/chunk-KHKKD62N.js.map +1 -0
  77. package/dist/{chunk-FQ5CHJR7.js → chunk-KUDZVJKQ.js} +21 -2
  78. package/dist/chunk-KUDZVJKQ.js.map +1 -0
  79. package/dist/{chunk-MGXUAID4.js → chunk-KZ3KMDN3.js} +2 -2
  80. package/dist/{chunk-HGDXJVK2.js → chunk-LBGPO5RL.js} +6 -6
  81. package/dist/{chunk-F2WWHKO7.js → chunk-LTU4FLHG.js} +57 -27
  82. package/dist/chunk-LTU4FLHG.js.map +1 -0
  83. package/dist/{chunk-CLE3TMIS.js → chunk-MC2LFTQM.js} +5 -2
  84. package/dist/{chunk-ECGDJU5R.js → chunk-MJWCLSQL.js} +17 -8
  85. package/dist/chunk-MJWCLSQL.js.map +1 -0
  86. package/dist/{chunk-EAN4TAPC.js → chunk-MSWYQLMQ.js} +2 -2
  87. package/dist/{chunk-WK7ULBTP.js → chunk-MVOWXQHN.js} +5 -3
  88. package/dist/chunk-MVOWXQHN.js.map +1 -0
  89. package/dist/{chunk-K5OFKXUG.js → chunk-MXZ5TSTR.js} +118 -4
  90. package/dist/chunk-MXZ5TSTR.js.map +1 -0
  91. package/dist/{chunk-OKRXXFZZ.js → chunk-MZ5ZFO2D.js} +3 -3
  92. package/dist/{chunk-RQILGK3N.js → chunk-NQCNSVGI.js} +5 -5
  93. package/dist/{chunk-EFJAAFBW.js → chunk-NQRJ5AJO.js} +2 -2
  94. package/dist/{chunk-Q2SEJMP2.js → chunk-NVU7ZMPN.js} +2 -2
  95. package/dist/{chunk-Y2PTKKIN.js → chunk-OF3L2SD6.js} +2 -2
  96. package/dist/{chunk-MDRCEA56.js → chunk-OMSAULZM.js} +11 -11
  97. package/dist/{chunk-SL3PLML2.js → chunk-OSFPNKY4.js} +3 -3
  98. package/dist/{chunk-XX7YB5BI.js → chunk-P7NGLLUF.js} +5 -5
  99. package/dist/{chunk-QITP2JGX.js → chunk-PGAPBZEK.js} +7 -7
  100. package/dist/{chunk-KJNMTE2W.js → chunk-PP5CO2PR.js} +6 -6
  101. package/dist/{chunk-FZAP4JNC.js → chunk-RLWY6Z44.js} +227 -41
  102. package/dist/chunk-RLWY6Z44.js.map +1 -0
  103. package/dist/{chunk-NG4AQIYJ.js → chunk-ROWL352P.js} +5 -5
  104. package/dist/{chunk-V4O6YZSP.js → chunk-RPXL6KSX.js} +4 -4
  105. package/dist/{chunk-ODCEOSJF.js → chunk-SKONR2OL.js} +3 -3
  106. package/dist/{chunk-RM4FIXY2.js → chunk-SRGJET2F.js} +16 -5
  107. package/dist/chunk-SRGJET2F.js.map +1 -0
  108. package/dist/{chunk-QQL6XPPG.js → chunk-T4GPR2IR.js} +2 -2
  109. package/dist/{chunk-WFYKIDCS.js → chunk-TFZ7LLOQ.js} +88 -30
  110. package/dist/chunk-TFZ7LLOQ.js.map +1 -0
  111. package/dist/{chunk-NMYH55MW.js → chunk-TLNNHG3A.js} +4 -4
  112. package/dist/{chunk-DDB626I7.js → chunk-UHXCLPGC.js} +2 -2
  113. package/dist/{chunk-Q6MXHDSE.js → chunk-V5C5NNBR.js} +4 -4
  114. package/dist/{chunk-ELJOLQIG.js → chunk-VBY6ZLJT.js} +7 -7
  115. package/dist/{chunk-RPWMDIGK.js → chunk-VCETL77O.js} +34 -16
  116. package/dist/chunk-VCETL77O.js.map +1 -0
  117. package/dist/{chunk-IJV56FWY.js → chunk-VJFMXYKP.js} +2 -2
  118. package/dist/{chunk-BFG7LD6Z.js → chunk-VMCCGUQB.js} +2 -2
  119. package/dist/{chunk-PWEMRXPO.js → chunk-W3TVWF6N.js} +2 -2
  120. package/dist/{chunk-4TXO442D.js → chunk-WLYIROCJ.js} +2 -2
  121. package/dist/{chunk-MPW6AHTC.js → chunk-XB7LUDKM.js} +4 -4
  122. package/dist/{chunk-YA7Y3EZP.js → chunk-XBLKM73C.js} +10 -10
  123. package/dist/{chunk-LXRVTJ5D.js → chunk-YAWK6AWF.js} +2 -2
  124. package/dist/{chunk-6RDTG6E5.js → chunk-ZGGVOADG.js} +5 -5
  125. package/dist/{chunk-JLBCK7XM.js → chunk-ZK4CO2KZ.js} +6 -6
  126. package/dist/{chunk-DSDXAKIP.js → chunk-ZVF37PKE.js} +34 -5
  127. package/dist/chunk-ZVF37PKE.js.map +1 -0
  128. package/dist/{chunk-NZEGQWQ5.js → chunk-ZWMO5GL5.js} +5 -5
  129. package/dist/{chunk-4MSNAB64.js → chunk-ZXJXDHNK.js} +4 -4
  130. package/dist/classified/index.js +5 -5
  131. package/dist/{classified-marker-ZALWKOBC.js → classified-marker-MH3ON5OL.js} +3 -3
  132. package/dist/collection-facade-AHT7FATG.js +45 -0
  133. package/dist/{computed-YOQCGUCS.js → computed-6G5M3UPH.js} +3 -3
  134. package/dist/consent/index.js +9 -9
  135. package/dist/cover/index.js +3 -3
  136. package/dist/custody/index.js +11 -11
  137. package/dist/{dead-filter-6DVWST6U.js → dead-filter-U575NGSH.js} +2 -2
  138. package/dist/debug/index.js +1 -1
  139. package/dist/{delegation-WMO3Q3O5.js → delegation-PDYL6RWT.js} +10 -10
  140. package/dist/derivations/index.js +12 -12
  141. package/dist/derive-AKT4KU36.js +22 -0
  142. package/dist/directory/index.js +10 -10
  143. package/dist/{dispatch-VNR3TLBX.js → dispatch-4XIJSFTT.js} +5 -5
  144. package/dist/{dispatch-TKV4UCKB.js → dispatch-N5HGVUGU.js} +18 -18
  145. package/dist/{enclave-YWP3QAIQ.js → enclave-OPK24QDR.js} +13 -9
  146. package/dist/executor-3JZ4POTW.js +28 -0
  147. package/dist/executor-CYJQLKKI.js +9 -0
  148. package/dist/executor-S4QIKEHW.js +9 -0
  149. package/dist/export-accessible-CPTP5STN.js +23 -0
  150. package/dist/extract-partition-TWXPHVU7.js +38 -0
  151. package/dist/{fanout-sidecar-WYXO6QQT.js → fanout-sidecar-T2ZGLQFE.js} +9 -9
  152. package/dist/find-RBBYKXI7.js +11 -0
  153. package/dist/forget/index.js +9 -9
  154. package/dist/guards/index.js +4 -4
  155. package/dist/history/index.js +15 -15
  156. package/dist/i18n/index.js +14 -14
  157. package/dist/index.d.ts +35 -7
  158. package/dist/index.js +276 -201
  159. package/dist/index.js.map +1 -1
  160. package/dist/indexing/index.js +3 -3
  161. package/dist/introspection/index.js +12 -12
  162. package/dist/issue-N74C55X6.js +19 -0
  163. package/dist/kernel/collection.d.ts +10 -2
  164. package/dist/kernel/cutover-transform.d.ts +64 -0
  165. package/dist/kernel/enclave/crypto.d.ts +24 -0
  166. package/dist/kernel/enclave/index.d.ts +2 -1
  167. package/dist/kernel/errors.d.ts +123 -0
  168. package/dist/kernel/noydb.d.ts +10 -1
  169. package/dist/kernel/secret-mode.d.ts +59 -0
  170. package/dist/kernel/types.d.ts +98 -7
  171. package/dist/kernel/validation.d.ts +33 -0
  172. package/dist/kernel/vault.d.ts +18 -6
  173. package/dist/{ledger-BLYDYRTQ.js → ledger-DONWFC5M.js} +11 -11
  174. package/dist/liberate-KICI7AJN.js +24 -0
  175. package/dist/{link-set-7F5ZPDEB.js → link-set-2TTP4VLO.js} +11 -11
  176. package/dist/managed-secret-EAOYWRYF.js +27 -0
  177. package/dist/materialized-views/index.js +24 -24
  178. package/dist/money/index.js +3 -3
  179. package/dist/noydb-6W2XGQCS.js +83 -0
  180. package/dist/overlay-views/index.js +6 -6
  181. package/dist/periods/index.js +16 -16
  182. package/dist/pod/index.js +121 -12
  183. package/dist/policy/index.js +4 -4
  184. package/dist/port/to/index.d.ts +3 -1
  185. package/dist/port/to/locator.d.ts +84 -0
  186. package/dist/port/with/device-seal-strategy.d.ts +16 -0
  187. package/dist/port/with/strategies.d.ts +2 -0
  188. package/dist/portability/index.js +8 -8
  189. package/dist/{post-register-PQSY544J.js → post-register-ORQOQJCS.js} +6 -6
  190. package/dist/query/index.js +4 -4
  191. package/dist/reduce/index.js +4 -4
  192. package/dist/register-LHETZRJM.js +32 -0
  193. package/dist/registry-AMAZ6QRZ.js +19 -0
  194. package/dist/registry-CZVINVQH.js +9 -0
  195. package/dist/registry-IKUR2MXD.js +9 -0
  196. package/dist/registry-JRIN447B.js +18 -0
  197. package/dist/request-withdrawal-2DN2RGCO.js +31 -0
  198. package/dist/{reveal-HY7DZST4.js → reveal-AG4SCHUQ.js} +6 -6
  199. package/dist/revoke-ZX4NM2CJ.js +24 -0
  200. package/dist/satellites/index.js +1 -1
  201. package/dist/schema-update/index.js +6 -6
  202. package/dist/sealed-record/index.js +12 -12
  203. package/dist/search/index.js +4 -4
  204. package/dist/{seed-ALU3BHFS.js → seed-IRCDGIRK.js} +11 -11
  205. package/dist/sequence/index.js +9 -9
  206. package/dist/session/index.js +9 -9
  207. package/dist/shadow/index.js +2 -2
  208. package/dist/signer-7KHD4OL2.js +25 -0
  209. package/dist/snapshots/index.js +10 -10
  210. package/dist/{stale-U3WO5MYN.js → stale-K734VACF.js} +10 -10
  211. package/dist/storage-4H2GF6RQ.js +23 -0
  212. package/dist/{store-coordination-provider-AHGFEMFA.js → store-coordination-provider-4SKLSFUG.js} +3 -3
  213. package/dist/sync/index.js +10 -10
  214. package/dist/team/index.js +27 -15
  215. package/dist/tiers/index.js +10 -10
  216. package/dist/to/index.js +28 -3
  217. package/dist/to/index.js.map +1 -1
  218. package/dist/transactions/index.js +3 -3
  219. package/dist/util/index.js +1 -1
  220. package/dist/{verify-JEIXSK5U.js → verify-RO5RTZOJ.js} +5 -5
  221. package/dist/walk-MQHYNDLZ.js +21 -0
  222. package/dist/with-audit/guards/registry.d.ts +8 -1
  223. package/dist/with-audit/guards/types.d.ts +5 -0
  224. package/dist/with-audit/periods/index.d.ts +1 -1
  225. package/dist/with-audit/periods/periods.d.ts +7 -0
  226. package/dist/with-formula/derivations/registry.d.ts +6 -0
  227. package/dist/with-formula/derivations/types.d.ts +5 -0
  228. package/dist/with-lookup/indexing/eager-indexes.d.ts +10 -0
  229. package/dist/with-party/team/device-seal.d.ts +25 -0
  230. package/dist/with-party/team/echo-ceremony.d.ts +74 -0
  231. package/dist/with-party/team/echo-secret.d.ts +56 -0
  232. package/dist/with-party/team/index.d.ts +8 -0
  233. package/dist/with-party/team/keyring.d.ts +71 -9
  234. package/dist/with-party/team/rotate-recover.d.ts +99 -5
  235. package/dist/with-pod/bundle-handle.d.ts +9 -0
  236. package/dist/with-pod/bundle.d.ts +100 -2
  237. package/dist/with-pod/format.d.ts +92 -1
  238. package/dist/with-pod/index.d.ts +22 -1
  239. package/dist/with-pod/open.d.ts +117 -0
  240. package/dist/with-pod/redirect.d.ts +78 -0
  241. package/dist/with-pod/signature.d.ts +13 -0
  242. package/dist/with-shape/introspection/behaviors.d.ts +100 -0
  243. package/dist/with-shape/introspection/derivation-key.d.ts +17 -0
  244. package/dist/with-shape/introspection/describe.d.ts +36 -0
  245. package/dist/with-shape/introspection/index.d.ts +1 -0
  246. package/dist/with-shape/introspection/subsystem-matrix.d.ts +22 -0
  247. package/dist/with-shape/introspection/types.d.ts +2 -1
  248. package/dist/with-shape/links/names.d.ts +14 -0
  249. package/dist/with-shape/manifest/derive.d.ts +86 -0
  250. package/dist/with-shape/manifest/reserved-collections.d.ts +27 -0
  251. package/dist/with-shape/manifest/storage.d.ts +62 -0
  252. package/dist/with-shape/manifest/sync.d.ts +135 -0
  253. package/dist/with-shape/manifest/types.d.ts +49 -0
  254. package/dist/with-shape/manifest/writer.d.ts +32 -0
  255. package/dist/with-shape/persisted-schemas/field-ids.d.ts +29 -0
  256. package/dist/with-shape/persisted-schemas/register.d.ts +3 -0
  257. package/dist/with-shape/persisted-schemas/types.d.ts +17 -0
  258. package/dist/with-shape/schema-update/fence-controller.d.ts +34 -0
  259. package/dist/with-shape/schema-update/fence.d.ts +9 -0
  260. package/dist/with-shape/schema-update/strategies.d.ts +18 -2
  261. package/dist/with-shape/schema-update/types.d.ts +11 -0
  262. package/dist/with-sync/engine.d.ts +4 -0
  263. package/dist/with-sync/presence.d.ts +31 -1
  264. package/dist/withdraw-accessible-JSDQHXHE.js +28 -0
  265. package/dist/withdraw-accessible-JSDQHXHE.js.map +1 -0
  266. package/package.json +3 -3
  267. package/dist/api-M7REIE7H.js +0 -20
  268. package/dist/backup-ENTZYW37.js.map +0 -1
  269. package/dist/chunk-5UKUOMO6.js.map +0 -1
  270. package/dist/chunk-77AEMXFA.js.map +0 -1
  271. package/dist/chunk-AJAOXFCF.js +0 -129
  272. package/dist/chunk-AJAOXFCF.js.map +0 -1
  273. package/dist/chunk-AR5D76T2.js.map +0 -1
  274. package/dist/chunk-DSDXAKIP.js.map +0 -1
  275. package/dist/chunk-EBETHILL.js +0 -41
  276. package/dist/chunk-EBETHILL.js.map +0 -1
  277. package/dist/chunk-ECGDJU5R.js.map +0 -1
  278. package/dist/chunk-F2WWHKO7.js.map +0 -1
  279. package/dist/chunk-FQ5CHJR7.js.map +0 -1
  280. package/dist/chunk-FUECZSRM.js +0 -23
  281. package/dist/chunk-FUECZSRM.js.map +0 -1
  282. package/dist/chunk-FZAP4JNC.js.map +0 -1
  283. package/dist/chunk-IHYSIPEK.js.map +0 -1
  284. package/dist/chunk-K5OFKXUG.js.map +0 -1
  285. package/dist/chunk-KDWBVCIX.js.map +0 -1
  286. package/dist/chunk-KPZS5QAQ.js.map +0 -1
  287. package/dist/chunk-RM4FIXY2.js.map +0 -1
  288. package/dist/chunk-RPWMDIGK.js.map +0 -1
  289. package/dist/chunk-US2AR4BI.js +0 -25
  290. package/dist/chunk-US2AR4BI.js.map +0 -1
  291. package/dist/chunk-VYYM3MEN.js.map +0 -1
  292. package/dist/chunk-WFYKIDCS.js.map +0 -1
  293. package/dist/chunk-WK7ULBTP.js.map +0 -1
  294. package/dist/chunk-XVK7TULT.js.map +0 -1
  295. package/dist/collection-facade-KI53O6QB.js +0 -45
  296. package/dist/derive-P2NXWUNB.js +0 -22
  297. package/dist/executor-M4ZZNX6S.js +0 -28
  298. package/dist/executor-TI64S4LE.js +0 -9
  299. package/dist/executor-YBK3I2OT.js +0 -9
  300. package/dist/export-accessible-GBLYLGW4.js +0 -23
  301. package/dist/extract-partition-SFV35U2R.js +0 -38
  302. package/dist/find-HUSSZRBR.js +0 -11
  303. package/dist/issue-6TIJYWKS.js +0 -19
  304. package/dist/liberate-TSOW7IG5.js +0 -24
  305. package/dist/noydb-KFN6M6UJ.js +0 -81
  306. package/dist/register-S3ECUZPV.js +0 -25
  307. package/dist/registry-BWD2ED52.js +0 -8
  308. package/dist/registry-FZOHKUME.js +0 -18
  309. package/dist/registry-RISV7IDZ.js +0 -19
  310. package/dist/registry-ZE35A7WC.js +0 -9
  311. package/dist/request-withdrawal-KXVTQKR5.js +0 -31
  312. package/dist/revoke-J473JJ22.js +0 -24
  313. package/dist/signer-XLUKCCH3.js +0 -25
  314. package/dist/storage-IQONEOYY.js +0 -23
  315. package/dist/walk-BF36V4SR.js +0 -21
  316. package/dist/withdraw-accessible-TYTA23XH.js +0 -28
  317. /package/dist/{api-M7REIE7H.js.map → api-67SBPMMH.js.map} +0 -0
  318. /package/dist/{chunk-V3EGXDFN.js.map → chunk-24UICKTB.js.map} +0 -0
  319. /package/dist/{chunk-6PFST3FC.js.map → chunk-27TCYH6G.js.map} +0 -0
  320. /package/dist/{chunk-PTSVGKSR.js.map → chunk-2KIV7BEK.js.map} +0 -0
  321. /package/dist/{chunk-3LYMOSY7.js.map → chunk-2LGDCNFJ.js.map} +0 -0
  322. /package/dist/{chunk-NWK6SVBM.js.map → chunk-35EBKWQU.js.map} +0 -0
  323. /package/dist/{chunk-QMCWYN6O.js.map → chunk-3737A6EA.js.map} +0 -0
  324. /package/dist/{chunk-G7ZIMGPQ.js.map → chunk-3EO7RZLJ.js.map} +0 -0
  325. /package/dist/{chunk-GYJRDALN.js.map → chunk-3FSX6LDG.js.map} +0 -0
  326. /package/dist/{chunk-4SG5TOXK.js.map → chunk-3HYWYLXL.js.map} +0 -0
  327. /package/dist/{chunk-653KOQ7A.js.map → chunk-3IIPWA75.js.map} +0 -0
  328. /package/dist/{chunk-IQ423YMK.js.map → chunk-3UK6STWO.js.map} +0 -0
  329. /package/dist/{chunk-F5UWVF6Z.js.map → chunk-4HDYQL3J.js.map} +0 -0
  330. /package/dist/{chunk-J7YVY7TW.js.map → chunk-4MQDV3HZ.js.map} +0 -0
  331. /package/dist/{chunk-UC5Y7OEJ.js.map → chunk-4UVDI4XE.js.map} +0 -0
  332. /package/dist/{chunk-4DGBZEV6.js.map → chunk-4VCWI42L.js.map} +0 -0
  333. /package/dist/{chunk-GIGLOQL7.js.map → chunk-747LRSOO.js.map} +0 -0
  334. /package/dist/{chunk-W7C7MMIS.js.map → chunk-7F4DBNSP.js.map} +0 -0
  335. /package/dist/{chunk-5EKL6BXI.js.map → chunk-7G6VDWXB.js.map} +0 -0
  336. /package/dist/{chunk-PZRYKOKP.js.map → chunk-AHLJSVRL.js.map} +0 -0
  337. /package/dist/{chunk-L67H6FAQ.js.map → chunk-AR2JDFAE.js.map} +0 -0
  338. /package/dist/{chunk-TJOUKMWF.js.map → chunk-BPTZ4K5L.js.map} +0 -0
  339. /package/dist/{chunk-MFW466PX.js.map → chunk-CCZJJ4I2.js.map} +0 -0
  340. /package/dist/{chunk-OKBNFUUX.js.map → chunk-CJ73OLMW.js.map} +0 -0
  341. /package/dist/{chunk-FHK6WWUE.js.map → chunk-CYQOUTMY.js.map} +0 -0
  342. /package/dist/{chunk-LQVRK2XJ.js.map → chunk-DCMQR46R.js.map} +0 -0
  343. /package/dist/{chunk-QTMZDMJ6.js.map → chunk-DG27IUVI.js.map} +0 -0
  344. /package/dist/{chunk-PKBONLCP.js.map → chunk-E6427JU2.js.map} +0 -0
  345. /package/dist/{chunk-XID22NOA.js.map → chunk-F3GVO44K.js.map} +0 -0
  346. /package/dist/{chunk-U2ID5A2I.js.map → chunk-FAXZQ5UF.js.map} +0 -0
  347. /package/dist/{chunk-P6UIVLZK.js.map → chunk-FNSMZQS4.js.map} +0 -0
  348. /package/dist/{chunk-NIKQQXI2.js.map → chunk-FUHKW252.js.map} +0 -0
  349. /package/dist/{chunk-623QEHDB.js.map → chunk-FY343IZR.js.map} +0 -0
  350. /package/dist/{chunk-7P4LL3JH.js.map → chunk-GS5RT2KK.js.map} +0 -0
  351. /package/dist/{chunk-IM2KST7E.js.map → chunk-HFKGIBMD.js.map} +0 -0
  352. /package/dist/{chunk-FT5Y4VSP.js.map → chunk-HVQGCKY4.js.map} +0 -0
  353. /package/dist/{chunk-MYSNNMJ3.js.map → chunk-HXGUIPQB.js.map} +0 -0
  354. /package/dist/{chunk-GTQF32TP.js.map → chunk-JEM2IGS3.js.map} +0 -0
  355. /package/dist/{chunk-ALUVACKT.js.map → chunk-JIUVJ4M7.js.map} +0 -0
  356. /package/dist/{chunk-NJHQE4LT.js.map → chunk-JRCYZEHU.js.map} +0 -0
  357. /package/dist/{chunk-G3ORJ3IQ.js.map → chunk-JSRU5W2M.js.map} +0 -0
  358. /package/dist/{chunk-SBGXQK5I.js.map → chunk-JXIDGFKS.js.map} +0 -0
  359. /package/dist/{chunk-MGXUAID4.js.map → chunk-KZ3KMDN3.js.map} +0 -0
  360. /package/dist/{chunk-HGDXJVK2.js.map → chunk-LBGPO5RL.js.map} +0 -0
  361. /package/dist/{chunk-CLE3TMIS.js.map → chunk-MC2LFTQM.js.map} +0 -0
  362. /package/dist/{chunk-EAN4TAPC.js.map → chunk-MSWYQLMQ.js.map} +0 -0
  363. /package/dist/{chunk-OKRXXFZZ.js.map → chunk-MZ5ZFO2D.js.map} +0 -0
  364. /package/dist/{chunk-RQILGK3N.js.map → chunk-NQCNSVGI.js.map} +0 -0
  365. /package/dist/{chunk-EFJAAFBW.js.map → chunk-NQRJ5AJO.js.map} +0 -0
  366. /package/dist/{chunk-Q2SEJMP2.js.map → chunk-NVU7ZMPN.js.map} +0 -0
  367. /package/dist/{chunk-Y2PTKKIN.js.map → chunk-OF3L2SD6.js.map} +0 -0
  368. /package/dist/{chunk-MDRCEA56.js.map → chunk-OMSAULZM.js.map} +0 -0
  369. /package/dist/{chunk-SL3PLML2.js.map → chunk-OSFPNKY4.js.map} +0 -0
  370. /package/dist/{chunk-XX7YB5BI.js.map → chunk-P7NGLLUF.js.map} +0 -0
  371. /package/dist/{chunk-QITP2JGX.js.map → chunk-PGAPBZEK.js.map} +0 -0
  372. /package/dist/{chunk-KJNMTE2W.js.map → chunk-PP5CO2PR.js.map} +0 -0
  373. /package/dist/{chunk-NG4AQIYJ.js.map → chunk-ROWL352P.js.map} +0 -0
  374. /package/dist/{chunk-V4O6YZSP.js.map → chunk-RPXL6KSX.js.map} +0 -0
  375. /package/dist/{chunk-ODCEOSJF.js.map → chunk-SKONR2OL.js.map} +0 -0
  376. /package/dist/{chunk-QQL6XPPG.js.map → chunk-T4GPR2IR.js.map} +0 -0
  377. /package/dist/{chunk-NMYH55MW.js.map → chunk-TLNNHG3A.js.map} +0 -0
  378. /package/dist/{chunk-DDB626I7.js.map → chunk-UHXCLPGC.js.map} +0 -0
  379. /package/dist/{chunk-Q6MXHDSE.js.map → chunk-V5C5NNBR.js.map} +0 -0
  380. /package/dist/{chunk-ELJOLQIG.js.map → chunk-VBY6ZLJT.js.map} +0 -0
  381. /package/dist/{chunk-IJV56FWY.js.map → chunk-VJFMXYKP.js.map} +0 -0
  382. /package/dist/{chunk-BFG7LD6Z.js.map → chunk-VMCCGUQB.js.map} +0 -0
  383. /package/dist/{chunk-PWEMRXPO.js.map → chunk-W3TVWF6N.js.map} +0 -0
  384. /package/dist/{chunk-4TXO442D.js.map → chunk-WLYIROCJ.js.map} +0 -0
  385. /package/dist/{chunk-MPW6AHTC.js.map → chunk-XB7LUDKM.js.map} +0 -0
  386. /package/dist/{chunk-YA7Y3EZP.js.map → chunk-XBLKM73C.js.map} +0 -0
  387. /package/dist/{chunk-LXRVTJ5D.js.map → chunk-YAWK6AWF.js.map} +0 -0
  388. /package/dist/{chunk-6RDTG6E5.js.map → chunk-ZGGVOADG.js.map} +0 -0
  389. /package/dist/{chunk-JLBCK7XM.js.map → chunk-ZK4CO2KZ.js.map} +0 -0
  390. /package/dist/{chunk-NZEGQWQ5.js.map → chunk-ZWMO5GL5.js.map} +0 -0
  391. /package/dist/{chunk-4MSNAB64.js.map → chunk-ZXJXDHNK.js.map} +0 -0
  392. /package/dist/{classified-marker-ZALWKOBC.js.map → classified-marker-MH3ON5OL.js.map} +0 -0
  393. /package/dist/{collection-facade-KI53O6QB.js.map → collection-facade-AHT7FATG.js.map} +0 -0
  394. /package/dist/{computed-YOQCGUCS.js.map → computed-6G5M3UPH.js.map} +0 -0
  395. /package/dist/{dead-filter-6DVWST6U.js.map → dead-filter-U575NGSH.js.map} +0 -0
  396. /package/dist/{delegation-WMO3Q3O5.js.map → delegation-PDYL6RWT.js.map} +0 -0
  397. /package/dist/{derive-P2NXWUNB.js.map → derive-AKT4KU36.js.map} +0 -0
  398. /package/dist/{dispatch-VNR3TLBX.js.map → dispatch-4XIJSFTT.js.map} +0 -0
  399. /package/dist/{dispatch-TKV4UCKB.js.map → dispatch-N5HGVUGU.js.map} +0 -0
  400. /package/dist/{enclave-YWP3QAIQ.js.map → enclave-OPK24QDR.js.map} +0 -0
  401. /package/dist/{executor-M4ZZNX6S.js.map → executor-3JZ4POTW.js.map} +0 -0
  402. /package/dist/{executor-TI64S4LE.js.map → executor-CYJQLKKI.js.map} +0 -0
  403. /package/dist/{executor-YBK3I2OT.js.map → executor-S4QIKEHW.js.map} +0 -0
  404. /package/dist/{export-accessible-GBLYLGW4.js.map → export-accessible-CPTP5STN.js.map} +0 -0
  405. /package/dist/{extract-partition-SFV35U2R.js.map → extract-partition-TWXPHVU7.js.map} +0 -0
  406. /package/dist/{fanout-sidecar-WYXO6QQT.js.map → fanout-sidecar-T2ZGLQFE.js.map} +0 -0
  407. /package/dist/{find-HUSSZRBR.js.map → find-RBBYKXI7.js.map} +0 -0
  408. /package/dist/{issue-6TIJYWKS.js.map → issue-N74C55X6.js.map} +0 -0
  409. /package/dist/{ledger-BLYDYRTQ.js.map → ledger-DONWFC5M.js.map} +0 -0
  410. /package/dist/{liberate-TSOW7IG5.js.map → liberate-KICI7AJN.js.map} +0 -0
  411. /package/dist/{link-set-7F5ZPDEB.js.map → link-set-2TTP4VLO.js.map} +0 -0
  412. /package/dist/{noydb-KFN6M6UJ.js.map → managed-secret-EAOYWRYF.js.map} +0 -0
  413. /package/dist/{register-S3ECUZPV.js.map → noydb-6W2XGQCS.js.map} +0 -0
  414. /package/dist/{post-register-PQSY544J.js.map → post-register-ORQOQJCS.js.map} +0 -0
  415. /package/dist/{registry-BWD2ED52.js.map → register-LHETZRJM.js.map} +0 -0
  416. /package/dist/{registry-FZOHKUME.js.map → registry-AMAZ6QRZ.js.map} +0 -0
  417. /package/dist/{registry-RISV7IDZ.js.map → registry-CZVINVQH.js.map} +0 -0
  418. /package/dist/{registry-ZE35A7WC.js.map → registry-IKUR2MXD.js.map} +0 -0
  419. /package/dist/{request-withdrawal-KXVTQKR5.js.map → registry-JRIN447B.js.map} +0 -0
  420. /package/dist/{revoke-J473JJ22.js.map → request-withdrawal-2DN2RGCO.js.map} +0 -0
  421. /package/dist/{reveal-HY7DZST4.js.map → reveal-AG4SCHUQ.js.map} +0 -0
  422. /package/dist/{signer-XLUKCCH3.js.map → revoke-ZX4NM2CJ.js.map} +0 -0
  423. /package/dist/{seed-ALU3BHFS.js.map → seed-IRCDGIRK.js.map} +0 -0
  424. /package/dist/{stale-U3WO5MYN.js.map → signer-7KHD4OL2.js.map} +0 -0
  425. /package/dist/{storage-IQONEOYY.js.map → stale-K734VACF.js.map} +0 -0
  426. /package/dist/{walk-BF36V4SR.js.map → storage-4H2GF6RQ.js.map} +0 -0
  427. /package/dist/{store-coordination-provider-AHGFEMFA.js.map → store-coordination-provider-4SKLSFUG.js.map} +0 -0
  428. /package/dist/{verify-JEIXSK5U.js.map → verify-RO5RTZOJ.js.map} +0 -0
  429. /package/dist/{withdraw-accessible-TYTA23XH.js.map → walk-MQHYNDLZ.js.map} +0 -0
@@ -5,24 +5,29 @@ import {
5
5
  readDirectoryConfig,
6
6
  readUserVisibility,
7
7
  saveUserEnvelope
8
- } from "./chunk-6PFST3FC.js";
8
+ } from "./chunk-27TCYH6G.js";
9
9
  import {
10
10
  base64ToBuffer,
11
11
  bufferToBase64,
12
12
  decrypt,
13
+ deriveEchoKey,
13
14
  deriveKey,
15
+ deriveSecretKey,
16
+ encodeEchoParts,
14
17
  encrypt,
15
18
  generateDEK,
19
+ generateIV,
16
20
  generateSalt,
17
21
  unwrapKey,
18
22
  wrapKey
19
- } from "./chunk-RPWMDIGK.js";
23
+ } from "./chunk-VCETL77O.js";
20
24
  import {
21
25
  NOYDB_FORMAT_VERSION,
22
26
  NOYDB_KEYRING_VERSION
23
- } from "./chunk-77AEMXFA.js";
27
+ } from "./chunk-24ZLWWEO.js";
24
28
  import {
25
29
  DirectoryDisabledError,
30
+ EchoCeremonyRequiredError,
26
31
  InvalidKeyError,
27
32
  KeyringCorruptError,
28
33
  KeyringExpiredError,
@@ -31,8 +36,9 @@ import {
31
36
  PermissionDeniedError,
32
37
  PrivilegeEscalationError,
33
38
  USER_ENVELOPE_COLLECTION,
34
- ValidationError
35
- } from "./chunk-AR5D76T2.js";
39
+ ValidationError,
40
+ WrongPromptError
41
+ } from "./chunk-HNGSV2YC.js";
36
42
 
37
43
  // src/kernel/validation.ts
38
44
  var WeakSecretError = class extends NoydbError {
@@ -105,6 +111,130 @@ function estimateEntropy(secret) {
105
111
  if (!result.ok) return 0;
106
112
  return Math.round(result.words * Math.log2(7776));
107
113
  }
114
+ var DEFAULT_ECHO_PROMPT_MIN_WORDS = 3;
115
+ var DEFAULT_ECHO_MIN_WORD_LENGTH = 1;
116
+ function validateEchoSecretDetailed(parts, opts) {
117
+ for (const part of [parts.prompt, parts.echo, parts.key]) {
118
+ if (part.trim().length === 0) return { result: { ok: false, reason: "empty" }, failedCheck: "empty" };
119
+ }
120
+ const promptPolicy = {
121
+ minWords: opts?.prompt?.minWords ?? DEFAULT_ECHO_PROMPT_MIN_WORDS,
122
+ minWordLength: opts?.prompt?.minWordLength ?? DEFAULT_ECHO_MIN_WORD_LENGTH,
123
+ ...opts?.prompt?.rejectRepeatedAdjacent !== void 0 && { rejectRepeatedAdjacent: opts.prompt.rejectRepeatedAdjacent },
124
+ ...opts?.prompt?.pattern !== void 0 && { pattern: opts.prompt.pattern },
125
+ ...opts?.prompt?.customValidator !== void 0 && { customValidator: opts.prompt.customValidator }
126
+ };
127
+ const promptResult = validateSecret(parts.prompt, promptPolicy);
128
+ if (!promptResult.ok) return { result: promptResult, failedCheck: "prompt" };
129
+ const combinedPolicy = {
130
+ ...opts?.combined?.minWords !== void 0 && { minWords: opts.combined.minWords },
131
+ minWordLength: opts?.combined?.minWordLength ?? DEFAULT_ECHO_MIN_WORD_LENGTH,
132
+ ...opts?.combined?.rejectRepeatedAdjacent !== void 0 && { rejectRepeatedAdjacent: opts.combined.rejectRepeatedAdjacent },
133
+ ...opts?.combined?.pattern !== void 0 && { pattern: opts.combined.pattern },
134
+ ...opts?.combined?.customValidator !== void 0 && { customValidator: opts.combined.customValidator }
135
+ };
136
+ const combinedResult = validateSecret(`${parts.prompt} ${parts.echo} ${parts.key}`, combinedPolicy);
137
+ return { result: combinedResult, failedCheck: "combined" };
138
+ }
139
+ function validateEchoSecret(parts, opts) {
140
+ return validateEchoSecretDetailed(parts, opts).result;
141
+ }
142
+ function promptSuggestion(reason, minWords) {
143
+ if (reason === "too-few-words") {
144
+ return `The prompt (the part you type first) must be at least ${minWords} words. Example: "sono chiamato vicio".`;
145
+ }
146
+ return `The prompt (the part you type first) is the problem. ${SUGGESTIONS[reason]}`;
147
+ }
148
+ function assertStrongEchoSecret(parts, opts) {
149
+ if (opts?.allowWeakSecret) return;
150
+ const { result, failedCheck } = validateEchoSecretDetailed(parts, opts);
151
+ if (result.ok) return;
152
+ const promptMinWords = opts?.prompt?.minWords ?? DEFAULT_ECHO_PROMPT_MIN_WORDS;
153
+ const suggestion = failedCheck === "prompt" ? promptSuggestion(result.reason, promptMinWords) : SUGGESTIONS[result.reason];
154
+ throw new WeakSecretError(result.reason, suggestion);
155
+ }
156
+
157
+ // src/with-party/team/echo-secret.ts
158
+ var ECHO_KDF_ITERATIONS = 6e5;
159
+ var VERIFIER_PLAINTEXT = new Uint8Array(32).fill(90);
160
+ var subtle = globalThis.crypto.subtle;
161
+ async function getVerifierKey() {
162
+ return subtle.importKey("raw", VERIFIER_PLAINTEXT, { name: "AES-GCM" }, true, ["encrypt"]);
163
+ }
164
+ async function mintVerifier(part, salt) {
165
+ const kek = await deriveSecretKey(part, salt, { iterations: ECHO_KDF_ITERATIONS, keyUsage: "aes-kw" });
166
+ return wrapKey(await getVerifierKey(), kek);
167
+ }
168
+ async function checkVerifier(verifier, part, saltB64) {
169
+ try {
170
+ const kek = await deriveSecretKey(part, base64ToBuffer(saltB64), { iterations: ECHO_KDF_ITERATIONS, keyUsage: "aes-kw" });
171
+ await subtle.unwrapKey("raw", base64ToBuffer(verifier), kek, "AES-KW", { name: "AES-GCM" }, false, ["encrypt"]);
172
+ return true;
173
+ } catch {
174
+ return false;
175
+ }
176
+ }
177
+ async function buildEchoBlock(parts, reveal, maskHint) {
178
+ encodeEchoParts(parts);
179
+ const promptSalt = generateSalt();
180
+ const echoSalt = generateSalt();
181
+ let revealField;
182
+ if (reveal.kind === "portable") {
183
+ const blobSalt = generateSalt();
184
+ const iv = generateIV();
185
+ const gcmKey = await deriveSecretKey(parts.prompt, blobSalt, { iterations: ECHO_KDF_ITERATIONS, keyUsage: "aes-gcm" });
186
+ const ct = new Uint8Array(
187
+ await subtle.encrypt({ name: "AES-GCM", iv }, gcmKey, new TextEncoder().encode(parts.echo))
188
+ );
189
+ revealField = { kind: "portable", blob: bufferToBase64(ct), iv: bufferToBase64(iv), salt: bufferToBase64(blobSalt) };
190
+ } else if (reveal.kind === "sealed") {
191
+ const sealed = await reveal.deviceSeal.seal(new TextEncoder().encode(parts.echo));
192
+ revealField = { kind: "sealed", blob: bufferToBase64(sealed), provider_hint: reveal.deviceSeal.id };
193
+ } else {
194
+ revealField = { kind: "none" };
195
+ }
196
+ return {
197
+ v: 1,
198
+ prompt_salt: bufferToBase64(promptSalt),
199
+ prompt_verifier: await mintVerifier(parts.prompt, promptSalt),
200
+ echo_salt: bufferToBase64(echoSalt),
201
+ echo_verifier: await mintVerifier(parts.echo, echoSalt),
202
+ reveal: revealField,
203
+ ...maskHint !== void 0 ? { mask_hint: maskHint } : {}
204
+ };
205
+ }
206
+ async function verifyPrompt(block, prompt) {
207
+ return checkVerifier(block.prompt_verifier, prompt, block.prompt_salt);
208
+ }
209
+ async function resolveEchoReveal(block, prompt, deviceSeal) {
210
+ if (block.reveal.kind === "portable") {
211
+ try {
212
+ const gcmKey = await deriveSecretKey(prompt, base64ToBuffer(block.reveal.salt), {
213
+ iterations: ECHO_KDF_ITERATIONS,
214
+ keyUsage: "aes-gcm"
215
+ });
216
+ const plain = await subtle.decrypt(
217
+ { name: "AES-GCM", iv: base64ToBuffer(block.reveal.iv) },
218
+ gcmKey,
219
+ base64ToBuffer(block.reveal.blob)
220
+ );
221
+ return new TextDecoder().decode(plain);
222
+ } catch {
223
+ throw new WrongPromptError();
224
+ }
225
+ }
226
+ if (block.reveal.kind === "sealed" && deviceSeal !== void 0) {
227
+ if (deviceSeal.id !== block.reveal.provider_hint) {
228
+ return null;
229
+ }
230
+ const plain = await deviceSeal.unseal(base64ToBuffer(block.reveal.blob));
231
+ return new TextDecoder().decode(plain);
232
+ }
233
+ return null;
234
+ }
235
+ async function verifyTypedEcho(block, echo) {
236
+ return checkVerifier(block.echo_verifier, echo, block.echo_salt);
237
+ }
108
238
 
109
239
  // src/with-party/team/reserved-secret-collections.ts
110
240
  var SYNC_CREDENTIALS_COLLECTION = "_sync_credentials";
@@ -164,21 +294,42 @@ async function verifyKeyringCanary(wrappedCanary, kek) {
164
294
  return false;
165
295
  }
166
296
  }
167
- async function loadKeyring(store, vault, opts) {
168
- const { userId, secret } = opts;
169
- const envelope = await store.get(vault, "_keyring", userId);
170
- if (!envelope) {
171
- throw new NoAccessError(`No keyring found for user "${userId}" in vault "${vault}"`);
297
+ async function deriveKekForKeyring(file, secret, salt) {
298
+ if (file.echo !== void 0) {
299
+ if (typeof secret === "string") throw new EchoCeremonyRequiredError();
300
+ return deriveEchoKey(secret, salt);
172
301
  }
173
- const keyringFile = JSON.parse(envelope._data);
174
- if (keyringFile.expires_at !== void 0) {
175
- const cutoff = Date.parse(keyringFile.expires_at);
302
+ if (typeof secret !== "string") {
303
+ throw new ValidationError("This keyring uses a standard secret \u2014 pass a string, not echo parts.");
304
+ }
305
+ return deriveKey(secret, salt);
306
+ }
307
+ function parseKeyringEnvelope(envelope) {
308
+ return JSON.parse(envelope._data);
309
+ }
310
+ async function readKeyringFile(store, vault, userId) {
311
+ const envelope = await store.get(vault, "_keyring", userId);
312
+ if (!envelope) return void 0;
313
+ return { envelope, file: parseKeyringEnvelope(envelope) };
314
+ }
315
+ function assertKeyringNotExpired(file) {
316
+ if (file.expires_at !== void 0) {
317
+ const cutoff = Date.parse(file.expires_at);
176
318
  if (Number.isFinite(cutoff) && Date.now() >= cutoff) {
177
- throw new KeyringExpiredError({ userId: keyringFile.user_id, expiresAt: keyringFile.expires_at });
319
+ throw new KeyringExpiredError({ userId: file.user_id, expiresAt: file.expires_at });
178
320
  }
179
321
  }
322
+ }
323
+ async function loadKeyring(store, vault, opts) {
324
+ const { userId, secret } = opts;
325
+ const found = await readKeyringFile(store, vault, userId);
326
+ if (!found) {
327
+ throw new NoAccessError(`No keyring found for user "${userId}" in vault "${vault}"`);
328
+ }
329
+ const { file: keyringFile } = found;
330
+ assertKeyringNotExpired(keyringFile);
180
331
  const salt = base64ToBuffer(keyringFile.salt);
181
- const kek = await deriveKey(secret, salt);
332
+ const kek = await deriveKekForKeyring(keyringFile, secret, salt);
182
333
  const canaryOk = keyringFile.canary !== void 0 ? await verifyKeyringCanary(keyringFile.canary, kek) : null;
183
334
  const deks = /* @__PURE__ */ new Map();
184
335
  const failedCollections = [];
@@ -241,10 +392,16 @@ async function assertKeyringOpenAllowed(store, vault, userId, create) {
241
392
  async function createOwnerKeyring(store, vault, opts) {
242
393
  const { userId, secret } = opts;
243
394
  if (opts.validate && !opts.allowWeakSecret) {
244
- assertStrongSecret(secret, opts);
395
+ if (typeof secret === "string") assertStrongSecret(secret, opts);
396
+ else {
397
+ assertStrongEchoSecret(secret, {
398
+ ...opts.echoSecretPolicy,
399
+ ...opts.allowWeakSecret !== void 0 && { allowWeakSecret: opts.allowWeakSecret }
400
+ });
401
+ }
245
402
  }
246
403
  const salt = generateSalt();
247
- const kek = await deriveKey(secret, salt);
404
+ const kek = typeof secret === "string" ? await deriveKey(secret, salt) : await deriveEchoKey(secret, salt);
248
405
  const userEnvelopeDek = await generateDEK();
249
406
  const wrappedUserEnvelopeDek = await wrapKey(userEnvelopeDek, kek);
250
407
  const canary = await mintKeyringCanary(kek);
@@ -258,7 +415,16 @@ async function createOwnerKeyring(store, vault, opts) {
258
415
  salt: bufferToBase64(salt),
259
416
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
260
417
  granted_by: userId,
261
- canary
418
+ canary,
419
+ // The presence of this block is what makes the keyring an echo keyring —
420
+ // `deriveKekForKeyring` reads it to refuse a single-string unlock (AG-1).
421
+ ...typeof secret !== "string" ? {
422
+ echo: await buildEchoBlock(
423
+ secret,
424
+ opts.deviceSeal ? { kind: "sealed", deviceSeal: opts.deviceSeal } : { kind: "portable" },
425
+ opts.echoMaskHint
426
+ )
427
+ } : {}
262
428
  };
263
429
  await writeKeyringFile(store, vault, userId, keyringFile);
264
430
  return {
@@ -347,9 +513,9 @@ async function findAdminDescendants(store, vault, rootUserId) {
347
513
  const allUserIds = await store.list(vault, "_keyring");
348
514
  const childrenByParent = /* @__PURE__ */ new Map();
349
515
  for (const userId of allUserIds) {
350
- const env = await store.get(vault, "_keyring", userId);
351
- if (!env) continue;
352
- const kf = JSON.parse(env._data);
516
+ const found = await readKeyringFile(store, vault, userId);
517
+ if (!found) continue;
518
+ const kf = found.file;
353
519
  if (kf.role !== "admin") continue;
354
520
  if (kf.user_id === rootUserId) continue;
355
521
  const list = childrenByParent.get(kf.granted_by) ?? [];
@@ -371,11 +537,11 @@ async function findAdminDescendants(store, vault, rootUserId) {
371
537
  return order;
372
538
  }
373
539
  async function revoke(store, vault, callerKeyring, options) {
374
- const targetEnvelope = await store.get(vault, "_keyring", options.userId);
375
- if (!targetEnvelope) {
540
+ const targetFound = await readKeyringFile(store, vault, options.userId);
541
+ if (!targetFound) {
376
542
  throw new NoAccessError(`User "${options.userId}" has no keyring in vault "${vault}"`);
377
543
  }
378
- const targetKeyring = JSON.parse(targetEnvelope._data);
544
+ const targetKeyring = targetFound.file;
379
545
  if (!canRevoke(callerKeyring.role, targetKeyring.role)) {
380
546
  throw new PermissionDeniedError(
381
547
  `Role "${callerKeyring.role}" cannot revoke role "${targetKeyring.role}"`
@@ -393,11 +559,10 @@ async function revoke(store, vault, callerKeyring, options) {
393
559
  );
394
560
  } else {
395
561
  for (const userId of descendants) {
396
- const descEnv = await store.get(vault, "_keyring", userId);
397
- if (!descEnv) continue;
398
- const descKf = JSON.parse(descEnv._data);
562
+ const descFound = await readKeyringFile(store, vault, userId);
563
+ if (!descFound) continue;
399
564
  usersToRevoke.push(userId);
400
- for (const c of Object.keys(descKf.deks)) affectedCollections.add(c);
565
+ for (const c of Object.keys(descFound.file.deks)) affectedCollections.add(c);
401
566
  }
402
567
  }
403
568
  }
@@ -417,13 +582,13 @@ async function updateKeyringIdentity(store, vault, callerKeyring, options) {
417
582
  `updateUser: at least one of role / displayName / permissions must be provided (userId: "${options.userId}").`
418
583
  );
419
584
  }
420
- const env = await store.get(vault, "_keyring", options.userId);
421
- if (!env) {
585
+ const found = await readKeyringFile(store, vault, options.userId);
586
+ if (!found) {
422
587
  throw new NoAccessError(
423
588
  `updateUser: user "${options.userId}" has no keyring in vault "${vault}".`
424
589
  );
425
590
  }
426
- const target = JSON.parse(env._data);
591
+ const target = found.file;
427
592
  if (!canUpdateRole(callerKeyring.role, target.role)) {
428
593
  throw new PermissionDeniedError(
429
594
  `Role "${callerKeyring.role}" cannot update a keyring with role "${target.role}"`
@@ -484,9 +649,9 @@ async function rotateKeys(store, vault, callerKeyring, opts) {
484
649
  const userIds = await store.list(vault, "_keyring");
485
650
  for (const userId of userIds) {
486
651
  if (userId === callerKeyring.userId) continue;
487
- const userEnvelope = await store.get(vault, "_keyring", userId);
488
- if (!userEnvelope) continue;
489
- const userKeyringFile = JSON.parse(userEnvelope._data);
652
+ const userFound = await readKeyringFile(store, vault, userId);
653
+ if (!userFound) continue;
654
+ const userKeyringFile = userFound.file;
490
655
  const updatedDeks = { ...userKeyringFile.deks };
491
656
  const updatedPermissions = { ...userKeyringFile.permissions };
492
657
  for (const collName of collections) {
@@ -506,6 +671,8 @@ async function rotateKeys(store, vault, callerKeyring, opts) {
506
671
  return { needsRegrant };
507
672
  }
508
673
  async function changeSecret(store, vault, keyring, opts) {
674
+ const existingFound = await readKeyringFile(store, vault, keyring.userId);
675
+ if (existingFound && existingFound.file.echo !== void 0) throw new EchoCeremonyRequiredError();
509
676
  const { newSecret } = opts;
510
677
  if (!opts.allowWeakSecret) {
511
678
  assertStrongSecret(newSecret, opts);
@@ -557,7 +724,7 @@ async function buildRecipientKeyringFile(callerKeyring, recipient) {
557
724
  const role = recipient.role ?? "viewer";
558
725
  const permissions = resolvePermissions(role, recipient.permissions);
559
726
  const newSalt = generateSalt();
560
- const newKek = await deriveKey(recipient.secret, newSalt);
727
+ const newKek = typeof recipient.secret === "string" ? await deriveKey(recipient.secret, newSalt) : await deriveEchoKey(recipient.secret, newSalt);
561
728
  const wrappedDeks = {};
562
729
  for (const collName of Object.keys(permissions)) {
563
730
  const dek = callerKeyring.deks.get(collName);
@@ -596,16 +763,21 @@ async function buildRecipientKeyringFile(callerKeyring, recipient) {
596
763
  canary,
597
764
  ...recipient.exportCapability !== void 0 ? { export_capability: recipient.exportCapability } : {},
598
765
  ...recipient.importCapability !== void 0 ? { import_capability: recipient.importCapability } : {},
599
- ...recipient.expiresAt !== void 0 ? { expires_at: recipient.expiresAt } : {}
766
+ ...recipient.expiresAt !== void 0 ? { expires_at: recipient.expiresAt } : {},
767
+ // The presence of this block is what makes the recipient's slot an
768
+ // echo keyring — mirrors `createOwnerKeyring`'s same dance so the
769
+ // ceremony (prompt → echo → key) travels with the pod, not just a
770
+ // live owner keyring.
771
+ ...typeof recipient.secret !== "string" ? { echo: await buildEchoBlock(recipient.secret, { kind: recipient.secret.reveal ?? "portable" }) } : {}
600
772
  };
601
773
  }
602
774
  async function listUsers(store, vault) {
603
775
  const userIds = await store.list(vault, "_keyring");
604
776
  const users = [];
605
777
  for (const userId of userIds) {
606
- const envelope = await store.get(vault, "_keyring", userId);
607
- if (!envelope) continue;
608
- const kf = JSON.parse(envelope._data);
778
+ const found = await readKeyringFile(store, vault, userId);
779
+ if (!found) continue;
780
+ const kf = found.file;
609
781
  users.push({
610
782
  userId: kf.user_id,
611
783
  displayName: kf.display_name,
@@ -682,6 +854,8 @@ async function persistKeyring(store, vault, keyring) {
682
854
  "persistKeyring: keyring.kek is null \u2014 cannot wrap DEKs without the KEK. This typically means the keyring was opened via tier-3 PIN resume, session restore, or a wrap-DEKs tier-2 unlock. Re-authenticate at tier 1 (secret) before persisting."
683
855
  );
684
856
  }
857
+ const existingFound = await readKeyringFile(store, vault, keyring.userId);
858
+ const existingEcho = existingFound?.file.echo;
685
859
  const wrappedDeks = {};
686
860
  for (const [collName, dek] of keyring.deks) {
687
861
  wrappedDeks[collName] = await wrapKey(dek, keyring.kek);
@@ -701,7 +875,8 @@ async function persistKeyring(store, vault, keyring) {
701
875
  ...keyring.exportCapability !== void 0 && { export_capability: keyring.exportCapability },
702
876
  ...keyring.importCapability !== void 0 && { import_capability: keyring.importCapability },
703
877
  ...keyring.authenticators.length > 0 && { authenticators: keyring.authenticators },
704
- ...keyring.policy !== void 0 && { policy: keyring.policy }
878
+ ...keyring.policy !== void 0 && { policy: keyring.policy },
879
+ ...existingEcho !== void 0 && { echo: existingEcho }
705
880
  };
706
881
  await writeKeyringFile(store, vault, keyring.userId, keyringFile);
707
882
  }
@@ -758,10 +933,21 @@ export {
758
933
  validateSecret,
759
934
  assertStrongSecret,
760
935
  estimateEntropy,
936
+ DEFAULT_ECHO_PROMPT_MIN_WORDS,
937
+ DEFAULT_ECHO_MIN_WORD_LENGTH,
938
+ validateEchoSecret,
939
+ assertStrongEchoSecret,
940
+ buildEchoBlock,
941
+ verifyPrompt,
942
+ resolveEchoReveal,
943
+ verifyTypedEcho,
761
944
  SYNC_CREDENTIALS_COLLECTION,
762
945
  BROKER_COLLECTION,
763
946
  isSecretBearingReservedCollection,
764
947
  mintKeyringCanary,
948
+ deriveKekForKeyring,
949
+ readKeyringFile,
950
+ assertKeyringNotExpired,
765
951
  loadKeyring,
766
952
  assertKeyringOpenAllowed,
767
953
  createOwnerKeyring,
@@ -782,4 +968,4 @@ export {
782
968
  hasImportCapability,
783
969
  evaluateImportCapability
784
970
  };
785
- //# sourceMappingURL=chunk-FZAP4JNC.js.map
971
+ //# sourceMappingURL=chunk-RLWY6Z44.js.map