@noy-db/hub 0.4.0-pre.3 → 0.4.0-pre.5

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 (381) hide show
  1. package/README.md +2 -2
  2. package/dist/aggregate/index.js +4 -4
  3. package/dist/api-22ES33N3.js +20 -0
  4. package/dist/as/index.js +11 -11
  5. package/dist/attestation/index.js +20 -20
  6. package/dist/{backup-JL2GOTYQ.js → backup-YCHAC575.js} +11 -11
  7. package/dist/blobs/index.js +12 -12
  8. package/dist/broker/index.js +12 -12
  9. package/dist/by/index.js +2 -2
  10. package/dist/cargo/index.js +29 -29
  11. package/dist/{chunk-2RMDVWGB.js → chunk-2CRZOVDI.js} +2 -2
  12. package/dist/{chunk-T7S4V52L.js → chunk-2PDBYF2O.js} +4 -4
  13. package/dist/{chunk-WJDYZP3U.js → chunk-3LJYHE7S.js} +36 -36
  14. package/dist/chunk-3LJYHE7S.js.map +1 -0
  15. package/dist/{chunk-CCT4WZI6.js → chunk-3OWYOECI.js} +5 -5
  16. package/dist/chunk-3OWYOECI.js.map +1 -0
  17. package/dist/{chunk-L4OA7G5T.js → chunk-522MBPE5.js} +2 -2
  18. package/dist/{chunk-ZJGZDOQO.js → chunk-5ATANZSW.js} +6 -6
  19. package/dist/{chunk-M25ZIEB2.js → chunk-5HSSTOOG.js} +2 -2
  20. package/dist/{chunk-LLVW4V7R.js → chunk-5WLDZZ6S.js} +3 -3
  21. package/dist/{chunk-7B4GPCX7.js → chunk-6RPWILRH.js} +5 -5
  22. package/dist/{chunk-IGM563N5.js → chunk-6SYOHUHM.js} +6 -6
  23. package/dist/chunk-6SYOHUHM.js.map +1 -0
  24. package/dist/{chunk-HGVFJL63.js → chunk-7BIJS6II.js} +15 -5
  25. package/dist/{chunk-HGVFJL63.js.map → chunk-7BIJS6II.js.map} +1 -1
  26. package/dist/{chunk-KR5EGWI4.js → chunk-7ICV4ASA.js} +5 -5
  27. package/dist/{chunk-J3VW4J4E.js → chunk-7LP7FFJ2.js} +2 -2
  28. package/dist/chunk-7LP7FFJ2.js.map +1 -0
  29. package/dist/{chunk-5P5AAXYA.js → chunk-7U6AB7DZ.js} +7 -7
  30. package/dist/chunk-7U6AB7DZ.js.map +1 -0
  31. package/dist/{chunk-KMONEHDJ.js → chunk-AFAPBZAA.js} +2 -2
  32. package/dist/{chunk-GBEXTC6Z.js → chunk-BAAUFCJK.js} +3 -3
  33. package/dist/chunk-BAAUFCJK.js.map +1 -0
  34. package/dist/{chunk-CGPO3ZYB.js → chunk-BY5YBSXA.js} +2 -2
  35. package/dist/{chunk-3O62PVDW.js → chunk-CJVEAVYH.js} +5 -5
  36. package/dist/chunk-CJVEAVYH.js.map +1 -0
  37. package/dist/{chunk-3XVOLB75.js → chunk-CKUYQO2P.js} +3 -3
  38. package/dist/{chunk-2JZ763FV.js → chunk-D4LAJ737.js} +2 -2
  39. package/dist/{chunk-OOTTXUNV.js → chunk-DYZ5CCVM.js} +2 -2
  40. package/dist/{chunk-LUH2MPEF.js → chunk-EEZCB74X.js} +808 -1175
  41. package/dist/chunk-EEZCB74X.js.map +1 -0
  42. package/dist/{chunk-N4FZ6ITM.js → chunk-EGU4PWQW.js} +2 -2
  43. package/dist/{chunk-JKWNG3TM.js → chunk-FHHYCBBP.js} +2 -2
  44. package/dist/{chunk-UBF7HTOR.js → chunk-FIP7KI2P.js} +40 -40
  45. package/dist/chunk-FIP7KI2P.js.map +1 -0
  46. package/dist/{chunk-N4A3DCBT.js → chunk-FTCGEUOY.js} +8 -8
  47. package/dist/{chunk-5BB3N4KU.js → chunk-G4MFQXYX.js} +2 -2
  48. package/dist/{chunk-PEY6ZTCF.js → chunk-GEEJPID6.js} +9 -9
  49. package/dist/{chunk-PEY6ZTCF.js.map → chunk-GEEJPID6.js.map} +1 -1
  50. package/dist/{chunk-KVHWEPT2.js → chunk-GHEMAVTN.js} +2 -2
  51. package/dist/{chunk-OVFCAS7U.js → chunk-GP54LU5N.js} +9 -9
  52. package/dist/{chunk-XW7NWO4A.js → chunk-GTNRMJYH.js} +2 -2
  53. package/dist/{chunk-J6U4BOKP.js → chunk-HAPY7WFP.js} +12 -12
  54. package/dist/{chunk-GU5AYA2Q.js → chunk-HQKRZIX6.js} +5 -5
  55. package/dist/{chunk-OWE4BNTM.js → chunk-I2XEBEEF.js} +4 -4
  56. package/dist/{chunk-WEC3JGBA.js → chunk-IGLU4ME7.js} +3 -3
  57. package/dist/{chunk-BZK6JEX4.js → chunk-ILM6X6CP.js} +5 -5
  58. package/dist/{chunk-2KL6NDD4.js → chunk-J5TEU77Q.js} +4 -4
  59. package/dist/{chunk-UEO5CHOP.js → chunk-JAMDDLIM.js} +13 -13
  60. package/dist/chunk-JAMDDLIM.js.map +1 -0
  61. package/dist/{chunk-V7RGFJ3Z.js → chunk-JIHH26WQ.js} +6 -6
  62. package/dist/{chunk-XGVDLQJE.js → chunk-JN3SGXJE.js} +3 -3
  63. package/dist/{chunk-XULHFSHO.js → chunk-K4BWPNJO.js} +5 -5
  64. package/dist/chunk-K4BWPNJO.js.map +1 -0
  65. package/dist/{chunk-BZEPJJOK.js → chunk-K7BADAOS.js} +4 -4
  66. package/dist/{chunk-OWLPX2GI.js → chunk-KJTIAECI.js} +17 -17
  67. package/dist/chunk-KJTIAECI.js.map +1 -0
  68. package/dist/{chunk-SN75YVM5.js → chunk-L2CAWCQL.js} +18 -18
  69. package/dist/{chunk-SN75YVM5.js.map → chunk-L2CAWCQL.js.map} +1 -1
  70. package/dist/{chunk-MSO2C3KG.js → chunk-LC7DSMHR.js} +2 -2
  71. package/dist/{chunk-JA5B3SLH.js → chunk-M6QA2KK2.js} +2 -2
  72. package/dist/{chunk-IUIVDVXM.js → chunk-MUPZ6IZX.js} +2 -2
  73. package/dist/{chunk-QAFWRGVD.js → chunk-OGVE4IJW.js} +7 -7
  74. package/dist/{chunk-BCOKZC4B.js → chunk-OHV6T5JB.js} +19 -19
  75. package/dist/chunk-OHV6T5JB.js.map +1 -0
  76. package/dist/{chunk-25ZDB25Z.js → chunk-OMSKGLYA.js} +3 -3
  77. package/dist/chunk-OMSKGLYA.js.map +1 -0
  78. package/dist/{chunk-2U7Y7BNJ.js → chunk-ONB627HU.js} +2 -2
  79. package/dist/{chunk-GYB2QK5H.js → chunk-OWLZONGX.js} +2 -2
  80. package/dist/{chunk-YHPUDB7Q.js → chunk-OWOT7CFC.js} +2 -2
  81. package/dist/{chunk-VEX6G3YL.js → chunk-P4NUJVWL.js} +2 -2
  82. package/dist/{chunk-NM4LVUXH.js → chunk-PTT2NB46.js} +2 -2
  83. package/dist/{chunk-2ITLQZV5.js → chunk-PWWWMRT7.js} +2 -2
  84. package/dist/{chunk-GS3Q2KOZ.js → chunk-QBOQI6PG.js} +2 -2
  85. package/dist/{chunk-JIMEB4C6.js → chunk-QMMOMBH6.js} +4 -4
  86. package/dist/{chunk-QDNVHA2F.js → chunk-QMZ5A6FQ.js} +2 -2
  87. package/dist/{chunk-FLHOTGOO.js → chunk-QVGEVZ5F.js} +3 -3
  88. package/dist/{chunk-AFBJHD55.js → chunk-QZJEYZ4I.js} +5 -5
  89. package/dist/{chunk-V3YB7RGR.js → chunk-R2N37AA6.js} +3 -3
  90. package/dist/{chunk-JLHKBAFY.js → chunk-RWW3I3PO.js} +3 -3
  91. package/dist/{chunk-IGAIOGCN.js → chunk-S4YERMGJ.js} +4 -4
  92. package/dist/{chunk-OGFPMCSP.js → chunk-SBOHNJUD.js} +2 -2
  93. package/dist/{chunk-QXPOEAKR.js → chunk-SC4JLMZI.js} +2 -2
  94. package/dist/{chunk-EDC6MLXV.js → chunk-SEU6QHH4.js} +2 -2
  95. package/dist/{chunk-F4COUZLL.js → chunk-TMR64XPL.js} +2 -2
  96. package/dist/{chunk-DEQ2JTBR.js → chunk-TNATF3HB.js} +3 -3
  97. package/dist/{chunk-GZ2GKOF6.js → chunk-TNJVDG2B.js} +3 -3
  98. package/dist/{chunk-5OZCCLNC.js → chunk-TSNRZSRC.js} +2 -2
  99. package/dist/{chunk-QCUH2G77.js → chunk-UTEATWHO.js} +6 -6
  100. package/dist/{chunk-JA5O7UEZ.js → chunk-UVBHM7AK.js} +6 -6
  101. package/dist/chunk-UVBHM7AK.js.map +1 -0
  102. package/dist/{chunk-HKR25MGX.js → chunk-V5JUAW4M.js} +10 -10
  103. package/dist/chunk-V5JUAW4M.js.map +1 -0
  104. package/dist/{chunk-YGBIBOCR.js → chunk-VEGQYPCP.js} +7 -7
  105. package/dist/{chunk-25G7U6RD.js → chunk-WQN5SM7P.js} +2 -2
  106. package/dist/{chunk-NOT7XA7Q.js → chunk-X3MWEFPT.js} +5 -5
  107. package/dist/chunk-XUFAFHQM.js +78 -0
  108. package/dist/chunk-XUFAFHQM.js.map +1 -0
  109. package/dist/{chunk-MEKAMERX.js → chunk-YCAJDK4O.js} +29 -29
  110. package/dist/chunk-YCAJDK4O.js.map +1 -0
  111. package/dist/{chunk-BVZGNMVM.js → chunk-YFFEF6HR.js} +3 -3
  112. package/dist/{chunk-H4SMS4O2.js → chunk-YJ3TREAC.js} +2 -2
  113. package/dist/{chunk-5SZ24DL5.js → chunk-YQQPNXNO.js} +6 -6
  114. package/dist/{chunk-5BHNQNBI.js → chunk-YTW6ZIPD.js} +1 -1
  115. package/dist/chunk-YTW6ZIPD.js.map +1 -0
  116. package/dist/{chunk-EW4HFWGJ.js → chunk-YWZEDG7F.js} +6 -6
  117. package/dist/{chunk-2VUISNGP.js → chunk-YXIVUWDU.js} +5 -5
  118. package/dist/{chunk-YG2EG6CB.js → chunk-YXZNGHID.js} +4 -4
  119. package/dist/{chunk-QYJIOWKN.js → chunk-YZN6NRTR.js} +9 -9
  120. package/dist/{chunk-IZX3WZBF.js → chunk-YZNKFYDC.js} +4 -4
  121. package/dist/{chunk-E2R5NRZD.js → chunk-Z4D3YGAB.js} +2 -2
  122. package/dist/{chunk-STR7WBOB.js → chunk-ZUDAK436.js} +2 -2
  123. package/dist/{chunk-ITI3SJRB.js → chunk-ZX5FNWH7.js} +2 -2
  124. package/dist/classified/index.js +5 -5
  125. package/dist/{classified-marker-7S5IEP6Q.js → classified-marker-52P3D72W.js} +3 -3
  126. package/dist/collection-facade-XKCFHSLR.js +44 -0
  127. package/dist/{computed-WZNKRLCY.js → computed-33DRJDOC.js} +3 -3
  128. package/dist/consent/index.js +9 -9
  129. package/dist/{cover-B5MY43CK.js → cover-5BSNJREH.js} +4 -4
  130. package/dist/{dead-filter-KRRD57MR.js → dead-filter-JXVCKS6W.js} +2 -2
  131. package/dist/delegation-WWZPEDK2.js +25 -0
  132. package/dist/derivations/index.js +12 -12
  133. package/dist/derive-CWWFEQ4N.js +21 -0
  134. package/dist/dispatch-PKQQFDBT.js +193 -0
  135. package/dist/dispatch-PKQQFDBT.js.map +1 -0
  136. package/dist/dispatch-SMXUO7W5.js +72 -0
  137. package/dist/dispatch-SMXUO7W5.js.map +1 -0
  138. package/dist/{enclave-YFKA3GJT.js → enclave-I5H3GINP.js} +11 -11
  139. package/dist/executor-FCJEH3FU.js +9 -0
  140. package/dist/executor-OHET7TF7.js +9 -0
  141. package/dist/executor-SHYLIBOM.js +26 -0
  142. package/dist/export-accessible-FBL6TDSK.js +23 -0
  143. package/dist/extract-partition-ZYIRYMTI.js +38 -0
  144. package/dist/{fanout-sidecar-HJV3A7PM.js → fanout-sidecar-WWXVHHUH.js} +9 -9
  145. package/dist/find-LEBUXVL7.js +11 -0
  146. package/dist/forget/index.js +9 -9
  147. package/dist/guards/index.js +3 -3
  148. package/dist/history/index.js +12 -12
  149. package/dist/i18n/index.js +14 -14
  150. package/dist/index.d.ts +13 -9
  151. package/dist/index.js +119 -118
  152. package/dist/index.js.map +1 -1
  153. package/dist/indexing/index.js +2 -2
  154. package/dist/issue-F76PAGIR.js +19 -0
  155. package/dist/kernel/collection-config.d.ts +11 -69
  156. package/dist/kernel/collection.d.ts +10 -22
  157. package/dist/kernel/enclave/crypto.d.ts +8 -8
  158. package/dist/kernel/enclave/index.d.ts +2 -2
  159. package/dist/kernel/errors.d.ts +20 -20
  160. package/dist/kernel/noydb.d.ts +43 -103
  161. package/dist/kernel/types.d.ts +82 -41
  162. package/dist/kernel/validation.d.ts +33 -33
  163. package/dist/kernel/vault.d.ts +31 -215
  164. package/dist/kernel/via/dispatch.d.ts +7 -0
  165. package/dist/{ledger-SW6QQOAV.js → ledger-M2BKCNVS.js} +11 -11
  166. package/dist/liberate-ZP7UB57K.js +24 -0
  167. package/dist/{link-set-GNGGCFI4.js → link-set-ZU4E5J5S.js} +11 -11
  168. package/dist/materialized-views/index.js +19 -19
  169. package/dist/noydb-BNDGEK5X.js +71 -0
  170. package/dist/on/index.js +9 -9
  171. package/dist/overlay-views/index.js +4 -4
  172. package/dist/periods/index.js +13 -13
  173. package/dist/pod/index.js +11 -11
  174. package/dist/{policy-EAXSJNOT.js → policy-IY2YEA3A.js} +5 -5
  175. package/dist/port/at/index.d.ts +4 -4
  176. package/dist/port/with/archive-strategy.d.ts +31 -0
  177. package/dist/port/with/collection-options.d.ts +171 -0
  178. package/dist/port/with/strategies.d.ts +134 -0
  179. package/dist/port/with/team-strategy.d.ts +1 -1
  180. package/dist/portability/index.js +8 -8
  181. package/dist/{post-register-A7HCFBP5.js → post-register-XIAHB6KF.js} +6 -6
  182. package/dist/query/index.js +6 -6
  183. package/dist/register-HB4TQZSV.js +23 -0
  184. package/dist/registry-6BMBFEXT.js +19 -0
  185. package/dist/registry-7CZWF3EQ.js +9 -0
  186. package/dist/registry-JOFO7RAH.js +18 -0
  187. package/dist/request-withdrawal-UN3TRHWI.js +31 -0
  188. package/dist/{reveal-PB3YG544.js → reveal-VWXRV2XU.js} +6 -6
  189. package/dist/revoke-OLO2OVR7.js +24 -0
  190. package/dist/satellites/index.js +1 -1
  191. package/dist/sealed-record/index.js +12 -12
  192. package/dist/{seed-EKF4DIBB.js → seed-CDBFOTIK.js} +12 -12
  193. package/dist/seed-CDBFOTIK.js.map +1 -0
  194. package/dist/session/index.js +9 -9
  195. package/dist/shadow/index.js +2 -2
  196. package/dist/signer-MGGKPYAN.js +25 -0
  197. package/dist/snapshots/index.js +10 -10
  198. package/dist/{stale-4UNPHWOU.js → stale-NBROTA66.js} +10 -10
  199. package/dist/storage-3R37QZLA.js +23 -0
  200. package/dist/{store-coordination-provider-3AELCZ4Y.js → store-coordination-provider-P3IU5JHD.js} +3 -3
  201. package/dist/sync/index.js +10 -10
  202. package/dist/team/index.js +20 -20
  203. package/dist/tiers/index.js +10 -10
  204. package/dist/to/index.js +1 -1
  205. package/dist/tx/index.js +3 -3
  206. package/dist/util/index.js +1 -1
  207. package/dist/{verify-MXN66IIH.js → verify-5X37OXRY.js} +5 -5
  208. package/dist/{walk-H4YE52S2.js → walk-E3OVLBFR.js} +11 -11
  209. package/dist/with/index.js +11 -11
  210. package/dist/with-audit/portability/export-accessible.d.ts +4 -4
  211. package/dist/with-audit/portability/request-withdrawal.d.ts +3 -3
  212. package/dist/with-audit/portability/withdraw-accessible.d.ts +2 -2
  213. package/dist/with-audit/sealed-record/strategy.d.ts +1 -1
  214. package/dist/with-cargo/adopt-partition.d.ts +7 -7
  215. package/dist/with-cargo/index.d.ts +1 -1
  216. package/dist/with-commit/history/time-machine.d.ts +2 -2
  217. package/dist/with-formula/derivations/dispatch.d.ts +98 -0
  218. package/dist/with-formula/materialized-views/dispatch.d.ts +75 -0
  219. package/dist/with-party/custody/liberate.d.ts +3 -3
  220. package/dist/with-party/session/dev-unlock.d.ts +2 -2
  221. package/dist/with-party/session/session.d.ts +2 -2
  222. package/dist/with-party/team/deed.d.ts +8 -8
  223. package/dist/with-party/team/index.d.ts +2 -2
  224. package/dist/with-party/team/keyring.d.ts +19 -19
  225. package/dist/with-party/team/{managed-passphrase.d.ts → managed-secret.d.ts} +27 -27
  226. package/dist/with-party/team/noydb-facade.d.ts +41 -41
  227. package/dist/with-party/team/peer-recover.d.ts +13 -13
  228. package/dist/with-party/team/recovery.d.ts +5 -5
  229. package/dist/with-party/team/rotate-recover.d.ts +30 -30
  230. package/dist/with-pod/bundle.d.ts +30 -30
  231. package/dist/with-pod/format.d.ts +2 -2
  232. package/dist/withdraw-accessible-Q2EMATCU.js +28 -0
  233. package/package.json +3 -3
  234. package/dist/api-UPAT2O3M.js +0 -20
  235. package/dist/chunk-25ZDB25Z.js.map +0 -1
  236. package/dist/chunk-3O62PVDW.js.map +0 -1
  237. package/dist/chunk-5BHNQNBI.js.map +0 -1
  238. package/dist/chunk-5P5AAXYA.js.map +0 -1
  239. package/dist/chunk-BCOKZC4B.js.map +0 -1
  240. package/dist/chunk-CCT4WZI6.js.map +0 -1
  241. package/dist/chunk-GBEXTC6Z.js.map +0 -1
  242. package/dist/chunk-HKR25MGX.js.map +0 -1
  243. package/dist/chunk-IGM563N5.js.map +0 -1
  244. package/dist/chunk-J3VW4J4E.js.map +0 -1
  245. package/dist/chunk-JA5O7UEZ.js.map +0 -1
  246. package/dist/chunk-LUH2MPEF.js.map +0 -1
  247. package/dist/chunk-MEKAMERX.js.map +0 -1
  248. package/dist/chunk-OWLPX2GI.js.map +0 -1
  249. package/dist/chunk-UBF7HTOR.js.map +0 -1
  250. package/dist/chunk-UEO5CHOP.js.map +0 -1
  251. package/dist/chunk-WJDYZP3U.js.map +0 -1
  252. package/dist/chunk-XULHFSHO.js.map +0 -1
  253. package/dist/collection-facade-ENLTJZBT.js +0 -44
  254. package/dist/delegation-UT76AQIG.js +0 -25
  255. package/dist/derive-SGRCCKVP.js +0 -21
  256. package/dist/executor-TEZYRDN3.js +0 -9
  257. package/dist/executor-WQQRU6DO.js +0 -9
  258. package/dist/executor-YORMIBWV.js +0 -26
  259. package/dist/export-accessible-HXMKW5LJ.js +0 -23
  260. package/dist/extract-partition-QGQ2R42J.js +0 -38
  261. package/dist/find-VV6PBIHK.js +0 -11
  262. package/dist/issue-7JJ4Z7E2.js +0 -19
  263. package/dist/liberate-FK7JI2QX.js +0 -24
  264. package/dist/noydb-KUX2TJMX.js +0 -70
  265. package/dist/register-YBMRLZLO.js +0 -23
  266. package/dist/registry-3LXKNXWI.js +0 -9
  267. package/dist/registry-4V4YQCXJ.js +0 -19
  268. package/dist/registry-ZULMLCJK.js +0 -18
  269. package/dist/request-withdrawal-SEVUEUDG.js +0 -31
  270. package/dist/revoke-5QULL5GT.js +0 -24
  271. package/dist/seed-EKF4DIBB.js.map +0 -1
  272. package/dist/signer-ZMH35FT4.js +0 -25
  273. package/dist/storage-QOZKQMID.js +0 -23
  274. package/dist/withdraw-accessible-HPOVNG2G.js +0 -28
  275. /package/dist/{api-UPAT2O3M.js.map → api-22ES33N3.js.map} +0 -0
  276. /package/dist/{backup-JL2GOTYQ.js.map → backup-YCHAC575.js.map} +0 -0
  277. /package/dist/{chunk-2RMDVWGB.js.map → chunk-2CRZOVDI.js.map} +0 -0
  278. /package/dist/{chunk-T7S4V52L.js.map → chunk-2PDBYF2O.js.map} +0 -0
  279. /package/dist/{chunk-L4OA7G5T.js.map → chunk-522MBPE5.js.map} +0 -0
  280. /package/dist/{chunk-ZJGZDOQO.js.map → chunk-5ATANZSW.js.map} +0 -0
  281. /package/dist/{chunk-M25ZIEB2.js.map → chunk-5HSSTOOG.js.map} +0 -0
  282. /package/dist/{chunk-LLVW4V7R.js.map → chunk-5WLDZZ6S.js.map} +0 -0
  283. /package/dist/{chunk-7B4GPCX7.js.map → chunk-6RPWILRH.js.map} +0 -0
  284. /package/dist/{chunk-KR5EGWI4.js.map → chunk-7ICV4ASA.js.map} +0 -0
  285. /package/dist/{chunk-KMONEHDJ.js.map → chunk-AFAPBZAA.js.map} +0 -0
  286. /package/dist/{chunk-CGPO3ZYB.js.map → chunk-BY5YBSXA.js.map} +0 -0
  287. /package/dist/{chunk-3XVOLB75.js.map → chunk-CKUYQO2P.js.map} +0 -0
  288. /package/dist/{chunk-2JZ763FV.js.map → chunk-D4LAJ737.js.map} +0 -0
  289. /package/dist/{chunk-OOTTXUNV.js.map → chunk-DYZ5CCVM.js.map} +0 -0
  290. /package/dist/{chunk-N4FZ6ITM.js.map → chunk-EGU4PWQW.js.map} +0 -0
  291. /package/dist/{chunk-JKWNG3TM.js.map → chunk-FHHYCBBP.js.map} +0 -0
  292. /package/dist/{chunk-N4A3DCBT.js.map → chunk-FTCGEUOY.js.map} +0 -0
  293. /package/dist/{chunk-5BB3N4KU.js.map → chunk-G4MFQXYX.js.map} +0 -0
  294. /package/dist/{chunk-KVHWEPT2.js.map → chunk-GHEMAVTN.js.map} +0 -0
  295. /package/dist/{chunk-OVFCAS7U.js.map → chunk-GP54LU5N.js.map} +0 -0
  296. /package/dist/{chunk-XW7NWO4A.js.map → chunk-GTNRMJYH.js.map} +0 -0
  297. /package/dist/{chunk-J6U4BOKP.js.map → chunk-HAPY7WFP.js.map} +0 -0
  298. /package/dist/{chunk-GU5AYA2Q.js.map → chunk-HQKRZIX6.js.map} +0 -0
  299. /package/dist/{chunk-OWE4BNTM.js.map → chunk-I2XEBEEF.js.map} +0 -0
  300. /package/dist/{chunk-WEC3JGBA.js.map → chunk-IGLU4ME7.js.map} +0 -0
  301. /package/dist/{chunk-BZK6JEX4.js.map → chunk-ILM6X6CP.js.map} +0 -0
  302. /package/dist/{chunk-2KL6NDD4.js.map → chunk-J5TEU77Q.js.map} +0 -0
  303. /package/dist/{chunk-V7RGFJ3Z.js.map → chunk-JIHH26WQ.js.map} +0 -0
  304. /package/dist/{chunk-XGVDLQJE.js.map → chunk-JN3SGXJE.js.map} +0 -0
  305. /package/dist/{chunk-BZEPJJOK.js.map → chunk-K7BADAOS.js.map} +0 -0
  306. /package/dist/{chunk-MSO2C3KG.js.map → chunk-LC7DSMHR.js.map} +0 -0
  307. /package/dist/{chunk-JA5B3SLH.js.map → chunk-M6QA2KK2.js.map} +0 -0
  308. /package/dist/{chunk-IUIVDVXM.js.map → chunk-MUPZ6IZX.js.map} +0 -0
  309. /package/dist/{chunk-QAFWRGVD.js.map → chunk-OGVE4IJW.js.map} +0 -0
  310. /package/dist/{chunk-2U7Y7BNJ.js.map → chunk-ONB627HU.js.map} +0 -0
  311. /package/dist/{chunk-GYB2QK5H.js.map → chunk-OWLZONGX.js.map} +0 -0
  312. /package/dist/{chunk-YHPUDB7Q.js.map → chunk-OWOT7CFC.js.map} +0 -0
  313. /package/dist/{chunk-VEX6G3YL.js.map → chunk-P4NUJVWL.js.map} +0 -0
  314. /package/dist/{chunk-NM4LVUXH.js.map → chunk-PTT2NB46.js.map} +0 -0
  315. /package/dist/{chunk-2ITLQZV5.js.map → chunk-PWWWMRT7.js.map} +0 -0
  316. /package/dist/{chunk-GS3Q2KOZ.js.map → chunk-QBOQI6PG.js.map} +0 -0
  317. /package/dist/{chunk-JIMEB4C6.js.map → chunk-QMMOMBH6.js.map} +0 -0
  318. /package/dist/{chunk-QDNVHA2F.js.map → chunk-QMZ5A6FQ.js.map} +0 -0
  319. /package/dist/{chunk-FLHOTGOO.js.map → chunk-QVGEVZ5F.js.map} +0 -0
  320. /package/dist/{chunk-AFBJHD55.js.map → chunk-QZJEYZ4I.js.map} +0 -0
  321. /package/dist/{chunk-V3YB7RGR.js.map → chunk-R2N37AA6.js.map} +0 -0
  322. /package/dist/{chunk-JLHKBAFY.js.map → chunk-RWW3I3PO.js.map} +0 -0
  323. /package/dist/{chunk-IGAIOGCN.js.map → chunk-S4YERMGJ.js.map} +0 -0
  324. /package/dist/{chunk-OGFPMCSP.js.map → chunk-SBOHNJUD.js.map} +0 -0
  325. /package/dist/{chunk-QXPOEAKR.js.map → chunk-SC4JLMZI.js.map} +0 -0
  326. /package/dist/{chunk-EDC6MLXV.js.map → chunk-SEU6QHH4.js.map} +0 -0
  327. /package/dist/{chunk-F4COUZLL.js.map → chunk-TMR64XPL.js.map} +0 -0
  328. /package/dist/{chunk-DEQ2JTBR.js.map → chunk-TNATF3HB.js.map} +0 -0
  329. /package/dist/{chunk-GZ2GKOF6.js.map → chunk-TNJVDG2B.js.map} +0 -0
  330. /package/dist/{chunk-5OZCCLNC.js.map → chunk-TSNRZSRC.js.map} +0 -0
  331. /package/dist/{chunk-QCUH2G77.js.map → chunk-UTEATWHO.js.map} +0 -0
  332. /package/dist/{chunk-YGBIBOCR.js.map → chunk-VEGQYPCP.js.map} +0 -0
  333. /package/dist/{chunk-25G7U6RD.js.map → chunk-WQN5SM7P.js.map} +0 -0
  334. /package/dist/{chunk-NOT7XA7Q.js.map → chunk-X3MWEFPT.js.map} +0 -0
  335. /package/dist/{chunk-BVZGNMVM.js.map → chunk-YFFEF6HR.js.map} +0 -0
  336. /package/dist/{chunk-H4SMS4O2.js.map → chunk-YJ3TREAC.js.map} +0 -0
  337. /package/dist/{chunk-5SZ24DL5.js.map → chunk-YQQPNXNO.js.map} +0 -0
  338. /package/dist/{chunk-EW4HFWGJ.js.map → chunk-YWZEDG7F.js.map} +0 -0
  339. /package/dist/{chunk-2VUISNGP.js.map → chunk-YXIVUWDU.js.map} +0 -0
  340. /package/dist/{chunk-YG2EG6CB.js.map → chunk-YXZNGHID.js.map} +0 -0
  341. /package/dist/{chunk-QYJIOWKN.js.map → chunk-YZN6NRTR.js.map} +0 -0
  342. /package/dist/{chunk-IZX3WZBF.js.map → chunk-YZNKFYDC.js.map} +0 -0
  343. /package/dist/{chunk-E2R5NRZD.js.map → chunk-Z4D3YGAB.js.map} +0 -0
  344. /package/dist/{chunk-STR7WBOB.js.map → chunk-ZUDAK436.js.map} +0 -0
  345. /package/dist/{chunk-ITI3SJRB.js.map → chunk-ZX5FNWH7.js.map} +0 -0
  346. /package/dist/{classified-marker-7S5IEP6Q.js.map → classified-marker-52P3D72W.js.map} +0 -0
  347. /package/dist/{collection-facade-ENLTJZBT.js.map → collection-facade-XKCFHSLR.js.map} +0 -0
  348. /package/dist/{computed-WZNKRLCY.js.map → computed-33DRJDOC.js.map} +0 -0
  349. /package/dist/{cover-B5MY43CK.js.map → cover-5BSNJREH.js.map} +0 -0
  350. /package/dist/{dead-filter-KRRD57MR.js.map → dead-filter-JXVCKS6W.js.map} +0 -0
  351. /package/dist/{delegation-UT76AQIG.js.map → delegation-WWZPEDK2.js.map} +0 -0
  352. /package/dist/{derive-SGRCCKVP.js.map → derive-CWWFEQ4N.js.map} +0 -0
  353. /package/dist/{enclave-YFKA3GJT.js.map → enclave-I5H3GINP.js.map} +0 -0
  354. /package/dist/{executor-TEZYRDN3.js.map → executor-FCJEH3FU.js.map} +0 -0
  355. /package/dist/{executor-WQQRU6DO.js.map → executor-OHET7TF7.js.map} +0 -0
  356. /package/dist/{executor-YORMIBWV.js.map → executor-SHYLIBOM.js.map} +0 -0
  357. /package/dist/{export-accessible-HXMKW5LJ.js.map → export-accessible-FBL6TDSK.js.map} +0 -0
  358. /package/dist/{extract-partition-QGQ2R42J.js.map → extract-partition-ZYIRYMTI.js.map} +0 -0
  359. /package/dist/{fanout-sidecar-HJV3A7PM.js.map → fanout-sidecar-WWXVHHUH.js.map} +0 -0
  360. /package/dist/{find-VV6PBIHK.js.map → find-LEBUXVL7.js.map} +0 -0
  361. /package/dist/{issue-7JJ4Z7E2.js.map → issue-F76PAGIR.js.map} +0 -0
  362. /package/dist/{ledger-SW6QQOAV.js.map → ledger-M2BKCNVS.js.map} +0 -0
  363. /package/dist/{liberate-FK7JI2QX.js.map → liberate-ZP7UB57K.js.map} +0 -0
  364. /package/dist/{link-set-GNGGCFI4.js.map → link-set-ZU4E5J5S.js.map} +0 -0
  365. /package/dist/{noydb-KUX2TJMX.js.map → noydb-BNDGEK5X.js.map} +0 -0
  366. /package/dist/{policy-EAXSJNOT.js.map → policy-IY2YEA3A.js.map} +0 -0
  367. /package/dist/{post-register-A7HCFBP5.js.map → post-register-XIAHB6KF.js.map} +0 -0
  368. /package/dist/{register-YBMRLZLO.js.map → register-HB4TQZSV.js.map} +0 -0
  369. /package/dist/{registry-3LXKNXWI.js.map → registry-6BMBFEXT.js.map} +0 -0
  370. /package/dist/{registry-4V4YQCXJ.js.map → registry-7CZWF3EQ.js.map} +0 -0
  371. /package/dist/{registry-ZULMLCJK.js.map → registry-JOFO7RAH.js.map} +0 -0
  372. /package/dist/{request-withdrawal-SEVUEUDG.js.map → request-withdrawal-UN3TRHWI.js.map} +0 -0
  373. /package/dist/{reveal-PB3YG544.js.map → reveal-VWXRV2XU.js.map} +0 -0
  374. /package/dist/{revoke-5QULL5GT.js.map → revoke-OLO2OVR7.js.map} +0 -0
  375. /package/dist/{signer-ZMH35FT4.js.map → signer-MGGKPYAN.js.map} +0 -0
  376. /package/dist/{stale-4UNPHWOU.js.map → stale-NBROTA66.js.map} +0 -0
  377. /package/dist/{storage-QOZKQMID.js.map → storage-3R37QZLA.js.map} +0 -0
  378. /package/dist/{store-coordination-provider-3AELCZ4Y.js.map → store-coordination-provider-P3IU5JHD.js.map} +0 -0
  379. /package/dist/{verify-MXN66IIH.js.map → verify-5X37OXRY.js.map} +0 -0
  380. /package/dist/{walk-H4YE52S2.js.map → walk-E3OVLBFR.js.map} +0 -0
  381. /package/dist/{withdraw-accessible-HPOVNG2G.js.map → withdraw-accessible-Q2EMATCU.js.map} +0 -0
@@ -26,8 +26,8 @@
26
26
  * **Why split read/load?** `readPod` returns the
27
27
  * *unwrapped JSON string*, not a Vault object. The caller
28
28
  * is responsible for piping that JSON into
29
- * `vault.load(json, passphrase)`. Splitting the layers
30
- * keeps the bundle module free of any crypto/passphrase
29
+ * `vault.load(json, secret)`. Splitting the layers
30
+ * keeps the bundle module free of any crypto/secret
31
31
  * concerns — it's purely a format layer. The same `readPod`
32
32
  * call can also feed verification tools, format inspectors, or
33
33
  * archive utilities that don't care about decryption.
@@ -36,18 +36,18 @@ import { type NoydbPodHeader } from './format.js';
36
36
  import type { Vault } from '../kernel/vault.js';
37
37
  import type { BundleRecipient } from '../with-party/team/keyring.js';
38
38
  import type { Cover } from '../with-party/directory/cover/types.js';
39
- import type { SealingKeyProvider, RecipientSealer, RecipientHint } from '../with-party/team/managed-passphrase.js';
39
+ import type { SealingKeyProvider, RecipientSealer, RecipientHint } from '../with-party/team/managed-secret.js';
40
40
  /**
41
41
  * The credential kinds that can be bundled for auto-unlock.
42
42
  * WebAuthn is intentionally excluded — it is hardware-bound and
43
43
  * cannot be embedded as a portable credential.
44
44
  */
45
- export type AutoCredentialKind = 'passphrase' | 'password' | 'pin';
45
+ export type AutoCredentialKind = 'secret' | 'password' | 'pin';
46
46
  /**
47
47
  * A typed credential for auto-unlock. Carries the credential `kind`
48
48
  * alongside the plaintext `value`, so consumers can dispatch the
49
49
  * correct login/prefill path rather than treating all credentials
50
- * as passphrases.
50
+ * as secrets.
51
51
  *
52
52
  * `bundle.ts` is a pure format layer — it carries the credential
53
53
  * without interpreting it. The consumer is responsible for
@@ -112,17 +112,17 @@ export interface WritePodOptions {
112
112
  /**
113
113
  * Single-recipient re-keying shorthand. When set, the
114
114
  * bundle's keyring is replaced with one freshly-derived entry sealed
115
- * with this passphrase. The recipient inherits the source keyring's
115
+ * with this secret. The recipient inherits the source keyring's
116
116
  * userId, role, and permissions. Mutually exclusive with `recipients`.
117
117
  */
118
- readonly exportPassphrase?: string;
118
+ readonly exportSecret?: string;
119
119
  /**
120
120
  * Multi-recipient re-keying. Replaces the bundle's keyring
121
121
  * map with one slot per recipient, each sealed with its own
122
- * passphrase. DEKs are unwrapped from the source keyring once and
122
+ * secret. DEKs are unwrapped from the source keyring once and
123
123
  * re-wrapped per recipient — record ciphertext is unchanged.
124
124
  *
125
- * Mutually exclusive with `exportPassphrase`. When neither is set,
125
+ * Mutually exclusive with `exportSecret`. When neither is set,
126
126
  * the bundle inherits the source keyring as-is (today's behaviour,
127
127
  * suited to personal backup-and-restore).
128
128
  */
@@ -130,8 +130,8 @@ export interface WritePodOptions {
130
130
  /**
131
131
  * Auto-unlock — unsealed per-user credentials.
132
132
  *
133
- * Generalises `autoPassphrases` to support any bundleable credential
134
- * kind (`passphrase` | `password` | `pin`).
133
+ * Generalises `autoSecrets` to support any bundleable credential
134
+ * kind (`secret` | `password` | `pin`).
135
135
  *
136
136
  * Public-by-design: anyone holding the bundle bytes can read these
137
137
  * plaintext credentials. Use for demo data, sample vaults,
@@ -141,8 +141,8 @@ export interface WritePodOptions {
141
141
  * bare `{ perUser }` without it is rejected at write time — the
142
142
  * safety net against a careless call against a production vault.
143
143
  *
144
- * Mutually exclusive with `sealedCredentials`, `autoPassphrases`,
145
- * and `sealedPassphrases`.
144
+ * Mutually exclusive with `sealedCredentials`, `autoSecrets`,
145
+ * and `sealedSecrets`.
146
146
  */
147
147
  readonly autoCredentials?: {
148
148
  readonly policy: 'public-by-design';
@@ -152,8 +152,8 @@ export interface WritePodOptions {
152
152
  * Auto-unlock — per-user credentials sealed under a
153
153
  * {@link SealingKeyProvider}.
154
154
  *
155
- * Generalises `sealedPassphrases` to support any bundleable
156
- * credential kind (`passphrase` | `password` | `pin`).
155
+ * Generalises `sealedSecrets` to support any bundleable
156
+ * credential kind (`secret` | `password` | `pin`).
157
157
  *
158
158
  * The hub seals each user's plaintext credential under `provider`
159
159
  * and embeds the resulting sealed envelopes in the bundle. The
@@ -170,8 +170,8 @@ export interface WritePodOptions {
170
170
  * The bundle can only be unsealed by the holder of the matching
171
171
  * private key.
172
172
  *
173
- * Mutually exclusive with `autoCredentials`, `autoPassphrases`,
174
- * and `sealedPassphrases`.
173
+ * Mutually exclusive with `autoCredentials`, `autoSecrets`,
174
+ * and `sealedSecrets`.
175
175
  */
176
176
  readonly sealedCredentials?: {
177
177
  readonly mode: 'self-target';
@@ -188,7 +188,7 @@ export interface WritePodOptions {
188
188
  /**
189
189
  * @deprecated Use `autoCredentials` instead.
190
190
  *
191
- * Auto-unlock — unsealed per-user passphrases.
191
+ * Auto-unlock — unsealed per-user secrets.
192
192
  *
193
193
  * Public-by-design: anyone holding the bundle bytes can read these
194
194
  * plaintext credentials. Use for demo data, sample vaults,
@@ -199,33 +199,33 @@ export interface WritePodOptions {
199
199
  * safety net against a careless call against a production vault.
200
200
  *
201
201
  * Mutually exclusive with `autoCredentials`, `sealedCredentials`,
202
- * and `sealedPassphrases`.
202
+ * and `sealedSecrets`.
203
203
  */
204
- readonly autoPassphrases?: {
204
+ readonly autoSecrets?: {
205
205
  readonly policy: 'public-by-design';
206
206
  readonly perUser: Record<string, string>;
207
207
  };
208
208
  /**
209
209
  * @deprecated Use `sealedCredentials` instead.
210
210
  *
211
- * Auto-unlock — per-user passphrases sealed under a
211
+ * Auto-unlock — per-user secrets sealed under a
212
212
  * {@link SealingKeyProvider} (self-target only).
213
213
  *
214
- * The hub seals each user's plaintext passphrase under `provider`
214
+ * The hub seals each user's plaintext secret under `provider`
215
215
  * and embeds the resulting sealed envelopes in the bundle. The
216
216
  * recipient must hold a provider with a matching `pid` (i.e.,
217
217
  * `provider.id`) to auto-unseal on import.
218
218
  *
219
- * `mode: 'self-target'` is the only mode for `sealedPassphrases` — sender
219
+ * `mode: 'self-target'` is the only mode for `sealedSecrets` — sender
220
220
  * and recipient share the same provider identity (same iCloud Keychain
221
221
  * entry, same MDM-provisioned bundle id, same KMS account, etc.).
222
222
  * For recipient-target sealing via the `RecipientSealer` interface,
223
223
  * use `sealedCredentials` with `mode: 'recipient-target'` (§11.4).
224
224
  *
225
225
  * Mutually exclusive with `autoCredentials`, `sealedCredentials`,
226
- * and `autoPassphrases`.
226
+ * and `autoSecrets`.
227
227
  */
228
- readonly sealedPassphrases?: {
228
+ readonly sealedSecrets?: {
229
229
  readonly mode: 'self-target';
230
230
  readonly provider: SealingKeyProvider;
231
231
  readonly perUser: Record<string, string>;
@@ -235,7 +235,7 @@ export interface WritePodOptions {
235
235
  export type WriteNoydbBundleOptions = WritePodOptions;
236
236
  /**
237
237
  * Result returned by `readPod`. The caller is expected to
238
- * pass `dumpJson` into `vault.load(json, passphrase)` to
238
+ * pass `dumpJson` into `vault.load(json, secret)` to
239
239
  * actually restore a vault. Splitting the layers keeps the
240
240
  * bundle module free of crypto concerns — see file-level docs.
241
241
  */
@@ -251,7 +251,7 @@ export interface NoydbBundleReadResult {
251
251
  *
252
252
  * Consumers dispatch on `cred.kind` to choose the correct login /
253
253
  * prefill path. Pre-0.2 bundles (bare string entries) are coerced
254
- * to `{ kind: 'passphrase', value }` on read for back-compat.
254
+ * to `{ kind: 'secret', value }` on read for back-compat.
255
255
  *
256
256
  * For `kind: 'sealed'` bundles read without `sealingProviders`, the
257
257
  * `value` field is the raw base64 sealed bytes — opaque to the
@@ -270,7 +270,7 @@ export interface NoydbBundleReadResult {
270
270
  export interface ReadNoydbBundleOptions {
271
271
  /**
272
272
  * Recipient-side sealing providers used to unseal entries from
273
- * `sealedPassphrases`. The reader picks the one whose `.id`
273
+ * `sealedSecrets`. The reader picks the one whose `.id`
274
274
  * matches each entry's `pid`. Multiple providers may be supplied
275
275
  * (different users may seal under different identities).
276
276
  *
@@ -402,9 +402,9 @@ export declare function readPodCover(bytes: Uint8Array, opts?: {
402
402
  * format error so consumers can pattern-match in catch blocks
403
403
  * (corrupted-in-transit vs malformed-by-producer).
404
404
  *
405
- * Note: this function does NOT take a passphrase. The dump JSON
405
+ * Note: this function does NOT take a secret. The dump JSON
406
406
  * inside the body still contains encrypted records — restoring
407
- * the vault requires `vault.load(dumpJson, passphrase)`
407
+ * the vault requires `vault.load(dumpJson, secret)`
408
408
  * after this call. Splitting the layers keeps the bundle module
409
409
  * free of crypto concerns and lets the same code feed format
410
410
  * inspectors that never decrypt anything.
@@ -34,7 +34,7 @@
34
34
  * The dump JSON inside the body still contains the original
35
35
  * metadata, but that's only readable by someone who already has the
36
36
  * file bytes — the same person who could read the encrypted records
37
- * with the right passphrase.
37
+ * with the right secret.
38
38
  *
39
39
  * **Why minimum disclosure** in the header? Because consumers will
40
40
  * inevitably store these in services where the filename, file size,
@@ -128,7 +128,7 @@ export interface NoydbPodHeader {
128
128
  /**
129
129
  * Auto-unlock material indicator. When present, the bundle
130
130
  * body wraps the dump JSON in a structure carrying per-user
131
- * passphrases — either plaintext (`'unsealed'`, public-by-design)
131
+ * secrets — either plaintext (`'unsealed'`, public-by-design)
132
132
  * or sealed under a `SealingKeyProvider` (`'sealed'`, requires
133
133
  * matching provider on the recipient side).
134
134
  *
@@ -0,0 +1,28 @@
1
+ import {
2
+ FROZEN_SNAPSHOTS_COLLECTION,
3
+ freezeAndDeleteClosure,
4
+ freezeSnapshotOnly,
5
+ randomId,
6
+ withdrawAccessibleData
7
+ } from "./chunk-K4BWPNJO.js";
8
+ import "./chunk-OMSKGLYA.js";
9
+ import "./chunk-YCAJDK4O.js";
10
+ import "./chunk-YFFEF6HR.js";
11
+ import "./chunk-GEEJPID6.js";
12
+ import "./chunk-SC4JLMZI.js";
13
+ import "./chunk-5WLDZZ6S.js";
14
+ import "./chunk-5HSSTOOG.js";
15
+ import "./chunk-G4MFQXYX.js";
16
+ import "./chunk-LP7BEXCT.js";
17
+ import "./chunk-7U6AB7DZ.js";
18
+ import "./chunk-YTW6ZIPD.js";
19
+ import "./chunk-6SYOHUHM.js";
20
+ import "./chunk-PZ5AY32C.js";
21
+ export {
22
+ FROZEN_SNAPSHOTS_COLLECTION,
23
+ freezeAndDeleteClosure,
24
+ freezeSnapshotOnly,
25
+ randomId,
26
+ withdrawAccessibleData
27
+ };
28
+ //# sourceMappingURL=withdraw-accessible-Q2EMATCU.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noy-db/hub",
3
- "version": "0.4.0-pre.3",
3
+ "version": "0.4.0-pre.5",
4
4
  "description": "Zero-knowledge, offline-first, encrypted document store — core library with AES-256-GCM, PBKDF2, multi-user keyring, and sync engine",
5
5
  "license": "MIT",
6
6
  "author": "vLannaAi <vicio@lanna.ai>",
@@ -192,14 +192,14 @@
192
192
  "node": ">=22.0.0"
193
193
  },
194
194
  "dependencies": {
195
- "@noy-db/attestation": "0.4.0-pre.3"
195
+ "@noy-db/attestation": "0.4.0-pre.5"
196
196
  },
197
197
  "devDependencies": {
198
198
  "@types/node": "^22.0.0",
199
199
  "esbuild": "^0.25.0",
200
200
  "zod": "^4.0.0",
201
201
  "zod-to-json-schema": "^3.25.2",
202
- "@noy-db/on-shamir": "0.4.0-pre.3"
202
+ "@noy-db/on-shamir": "0.4.0-pre.5"
203
203
  },
204
204
  "peerDependencies": {
205
205
  "zod-to-json-schema": "^3.25.0"
@@ -1,20 +0,0 @@
1
- import {
2
- UserApi,
3
- createUserApi
4
- } from "./chunk-GZ2GKOF6.js";
5
- import "./chunk-7B4GPCX7.js";
6
- import "./chunk-PEY6ZTCF.js";
7
- import "./chunk-QXPOEAKR.js";
8
- import "./chunk-LLVW4V7R.js";
9
- import "./chunk-M25ZIEB2.js";
10
- import "./chunk-5BB3N4KU.js";
11
- import "./chunk-LP7BEXCT.js";
12
- import "./chunk-5P5AAXYA.js";
13
- import "./chunk-5BHNQNBI.js";
14
- import "./chunk-IGM563N5.js";
15
- import "./chunk-PZ5AY32C.js";
16
- export {
17
- UserApi,
18
- createUserApi
19
- };
20
- //# sourceMappingURL=api-UPAT2O3M.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/with-audit/portability/export-accessible.ts"],"sourcesContent":["/**\n * `exportMyAccessibleData`: a non-owner user exports the scope they\n * can decrypt as a portable, re-keyed `.noydb` bundle. Non-destructive and\n * **always allowed** (the \"data sovereignty by construction\" property of\n * sealing-at-dimension — the firm cannot deny it) but **audited**.\n *\n * Reuses the existing bundle machinery: the access boundary is the caller's DEK\n * set (operator/client → `keyring.permissions`; owner/admin/viewer → all), so a\n * record outside the caller's keys can never enter the bundle. Re-keying to a\n * new owner reuses `writePod`'s `exportPassphrase` shorthand.\n */\nimport type { Vault } from '../../kernel/vault.js'\nimport type { UnlockedKeyring } from '../../with-party/team/keyring.js'\nimport { writePod } from '../../with-pod/bundle.js'\n\n/**\n * Resolve the collections a caller may export/withdraw: operator/client are\n * scoped to their granted collections; owner/admin/viewer see everything\n * (`undefined` = no allowlist). A `scope.collections` sub-scope intersects the\n * granted set. `writableOnly` keeps only `rw` grants (for destructive ops).\n */\nexport function resolveAccessibleCollections(\n keyring: UnlockedKeyring,\n scope: { collections?: readonly string[] } | undefined,\n writableOnly = false,\n): string[] | undefined {\n let collections: string[] | undefined\n if (keyring.role === 'operator' || keyring.role === 'client') {\n collections = Object.entries(keyring.permissions)\n .filter(([, mode]) => !writableOnly || mode === 'rw')\n .map(([c]) => c)\n }\n if (scope?.collections) {\n const allow = new Set(scope.collections)\n collections = (collections ?? [...scope.collections]).filter((c) => allow.has(c))\n }\n return collections\n}\n\n/** Produce a (optionally re-keyed, scoped) `.noydb` bundle — no audit. */\nexport async function buildAccessibleBundle(\n vault: Vault,\n collections: string[] | undefined,\n reKey: { passphrase: string } | undefined,\n compression: 'auto' | 'brotli' | 'gzip' | 'none' = 'auto',\n): Promise<Uint8Array> {\n return writePod(vault, {\n compression,\n ...(collections !== undefined ? { collections } : {}),\n ...(reKey ? { exportPassphrase: reKey.passphrase } : {}),\n })\n}\n\nexport interface ExportAccessibleOptions {\n /**\n * Re-key the bundle so it is independently openable by a new owner with this\n * passphrase (the receiving firm / the client themselves). Omit to inherit\n * the source keyring (personal backup).\n */\n readonly reKey?: { readonly passphrase: string }\n /** Narrow the export to a subset of the caller's accessible collections. */\n readonly scope?: { readonly collections?: readonly string[] }\n readonly compression?: 'auto' | 'brotli' | 'gzip' | 'none'\n}\n\n/**\n * Produce a re-keyed, access-scoped `.noydb` bundle of the caller's accessible\n * data. Appends a tamper-evident audit entry (`reason: 'user-export:<userId>'`).\n */\nexport async function exportAccessibleData(\n vault: Vault,\n opts: ExportAccessibleOptions = {},\n): Promise<Uint8Array> {\n const { keyring } = vault._introspectState()\n const collections = resolveAccessibleCollections(keyring, opts.scope)\n const bytes = await buildAccessibleBundle(vault, collections, opts.reKey, opts.compression ?? 'auto')\n\n // §11.11 audit — non-destructive, always-allowed export. No-op when the vault\n // has no history/ledger strategy (avoids minting a phantom _ledger DEK).\n await vault._getLedgerOrNull()?.append({\n op: 'lifecycle',\n collection: '',\n id: '',\n version: 0,\n actor: keyring.userId,\n payloadHash: '',\n reason: `user-export:${keyring.userId}`,\n })\n\n return bytes\n}\n"],"mappings":";;;;;AAqBO,SAAS,6BACd,SACA,OACA,eAAe,OACO;AACtB,MAAI;AACJ,MAAI,QAAQ,SAAS,cAAc,QAAQ,SAAS,UAAU;AAC5D,kBAAc,OAAO,QAAQ,QAAQ,WAAW,EAC7C,OAAO,CAAC,CAAC,EAAE,IAAI,MAAM,CAAC,gBAAgB,SAAS,IAAI,EACnD,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AAAA,EACnB;AACA,MAAI,OAAO,aAAa;AACtB,UAAM,QAAQ,IAAI,IAAI,MAAM,WAAW;AACvC,mBAAe,eAAe,CAAC,GAAG,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,MAAM,IAAI,CAAC,CAAC;AAAA,EAClF;AACA,SAAO;AACT;AAGA,eAAsB,sBACpB,OACA,aACA,OACA,cAAmD,QAC9B;AACrB,SAAO,SAAS,OAAO;AAAA,IACrB;AAAA,IACA,GAAI,gBAAgB,SAAY,EAAE,YAAY,IAAI,CAAC;AAAA,IACnD,GAAI,QAAQ,EAAE,kBAAkB,MAAM,WAAW,IAAI,CAAC;AAAA,EACxD,CAAC;AACH;AAkBA,eAAsB,qBACpB,OACA,OAAgC,CAAC,GACZ;AACrB,QAAM,EAAE,QAAQ,IAAI,MAAM,iBAAiB;AAC3C,QAAM,cAAc,6BAA6B,SAAS,KAAK,KAAK;AACpE,QAAM,QAAQ,MAAM,sBAAsB,OAAO,aAAa,KAAK,OAAO,KAAK,eAAe,MAAM;AAIpG,QAAM,MAAM,iBAAiB,GAAG,OAAO;AAAA,IACrC,IAAI;AAAA,IACJ,YAAY;AAAA,IACZ,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,IACf,aAAa;AAAA,IACb,QAAQ,eAAe,QAAQ,MAAM;AAAA,EACvC,CAAC;AAED,SAAO;AACT;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/with-party/team/wrapped-deks.ts","../src/with-party/team/recovery.ts"],"sourcesContent":["/**\n * **Wrap-DEKs primitive** — a single canonical shape for the\n * pattern of \"serialize a DEK set, encrypt it under a credential-derived\n * AES-GCM key.\" Used by:\n *\n * - **tier-0** — paper recovery entries (`_meta/recovery-paper`),\n * credential = the printed code.\n * - **tier-2** — password authenticator slots (`KeyringFile.authenticators`,\n * `wrapKind: 'deks'`), credential = the user's password.\n *\n * **Not** used by `@noy-db/on-pin` — tier-3 wraps the DEK set under\n * the same conceptual pattern but at **100,000 PBKDF2 iterations**\n * (vs the 600,000 here), because the protection window for a PIN\n * slot is short (idle-timeout-bounded, typically 15 min) and 600k\n * iterations would make every PIN-resume noticeably slow. The wire\n * formats are deliberately incompatible. See `@noy-db/on-pin`'s\n * `PIN_PBKDF2_ITERATIONS` and the threat-model rationale in its\n * module docstring.\n *\n * Previously, the same crypto lived in two places: `mintPaperRecoveryEntry`\n * (in `team/recovery.ts`) and `enrollPasswordAuthenticator` (in\n * `@noy-db/on-password`). Both functions did identical work — PBKDF2\n * the credential, AES-GCM-encrypt the JSON-serialized DEK set — but\n * their implementations had drifted apart enough that fixing a bug\n * in one wouldn't fix the other.\n *\n * This module owns the canonical implementation. Consumers compose:\n *\n * - `mintPaperRecoveryEntry` is now a thin wrapper that calls\n * `mintWrappedDeksBlob` and adds `{ codeId, enrolledAt }`.\n * - `enrollPasswordAuthenticator` calls `mintWrappedDeksBlob` and\n * wraps the result in the slot envelope.\n *\n * @module\n */\n\nimport { derivePassphraseKey, type EnclaveKey } from '../../kernel/enclave/index.js'\n\nconst PBKDF2_ITERATIONS = 600_000\nconst SALT_BYTES = 32\nconst IV_BYTES = 12\n\nconst subtle = globalThis.crypto.subtle\n\n// ─── Type ──────────────────────────────────────────────────────────────\n\n/**\n * The wrap-DEKs primitive — a serialized + AES-GCM-encrypted DEK set\n * keyed under a credential-derived key.\n *\n * All three fields are base64-encoded so the blob is JSON-safe and\n * round-trips through `_meta/*` envelopes (which carry plaintext\n * JSON in `_data`).\n *\n * Composition: `PaperRecoveryEntry extends WrappedDeksBlob` plus\n * `{ codeId, enrolledAt }`. `KeyringAuthenticatorWrappingDEKs`\n * carries the same three fields with `salt` stored in `meta` for\n * slot-format back-compat (defers moving it to top-level).\n */\nexport interface WrappedDeksBlob {\n /** Base64 PBKDF2 salt for the credential-derived wrapping key. */\n readonly salt: string\n /** Base64 AES-GCM IV used for the `wrappedDeks` ciphertext. */\n readonly iv: string\n /** Base64 AES-GCM ciphertext of `{ deks: { collection: base64rawDek } }`. */\n readonly wrappedDeks: string\n}\n\n// ─── Mint ──────────────────────────────────────────────────────────────\n\n/**\n * Mint a fresh `WrappedDeksBlob` from a DEK set + a string credential.\n *\n * Generates a random salt + IV, derives a 256-bit AES-GCM key via\n * PBKDF2-SHA256(credential, salt, 600K), serializes the DEK set as\n * `{ deks: { coll: rawBase64 } }`, and AES-GCM-encrypts.\n *\n * The `credential` is the user-typed string (recovery code, password,\n * PIN). Caller normalization rules apply (e.g. paper\n * recovery uppercase-strips the code before reaching this function).\n *\n * @param deks - DEK set to wrap. Each DEK must be exportable via\n * `subtle.exportKey('raw', dek)` (the hub mints DEKs\n * this way; consumers feeding non-extractable keys\n * will get `InvalidAccessError` from WebCrypto).\n * @param credential - String input the consumer minted (paper code,\n * password, PIN). Treated as opaque bytes by PBKDF2.\n */\nexport async function mintWrappedDeksBlob(\n deks: Map<string, EnclaveKey>,\n credential: string,\n): Promise<WrappedDeksBlob> {\n const salt = crypto.getRandomValues(new Uint8Array(SALT_BYTES))\n const iv = crypto.getRandomValues(new Uint8Array(IV_BYTES))\n const wrappingKey = await deriveWrappingKey(credential, salt)\n\n // Serialize the DEK set as JSON `{ deks: { collection: base64 } }`.\n const exported: Record<string, string> = {}\n for (const [coll, dek] of deks) {\n const raw = await subtle.exportKey('raw', dek)\n exported[coll] = bytesToBase64(new Uint8Array(raw))\n }\n const plaintext = new TextEncoder().encode(JSON.stringify({ deks: exported }))\n const ciphertext = await subtle.encrypt(\n { name: 'AES-GCM', iv: iv as BufferSource },\n wrappingKey,\n plaintext as BufferSource,\n )\n\n return {\n salt: bytesToBase64(salt),\n iv: bytesToBase64(iv),\n wrappedDeks: bytesToBase64(new Uint8Array(ciphertext)),\n }\n}\n\n// ─── Unwrap ────────────────────────────────────────────────────────────\n\n/**\n * Reverse of {@link mintWrappedDeksBlob}. Re-derives the wrapping key\n * from the credential + stored salt, AES-GCM-decrypts the wrapped DEK\n * set, and re-imports each DEK as an extractable AES-GCM CryptoKey.\n *\n * Throws (AES-GCM auth tag failure) when the credential doesn't\n * match the blob. Callers iterating over multiple blobs (e.g. paper\n * recovery's \"try every entry until one matches\") should catch.\n */\nexport async function unwrapDeksFromBlob(\n blob: WrappedDeksBlob,\n credential: string,\n): Promise<Map<string, EnclaveKey>> {\n const wrappingKey = await deriveWrappingKey(credential, base64ToBytes(blob.salt))\n const plaintext = await subtle.decrypt(\n { name: 'AES-GCM', iv: base64ToBytes(blob.iv) as BufferSource },\n wrappingKey,\n base64ToBytes(blob.wrappedDeks) as BufferSource,\n )\n const parsed = JSON.parse(new TextDecoder().decode(plaintext)) as { deks: Record<string, string> }\n const deks = new Map<string, EnclaveKey>()\n for (const [coll, b64] of Object.entries(parsed.deks)) {\n const raw = base64ToBytes(b64)\n const key = await subtle.importKey(\n 'raw',\n raw as BufferSource,\n { name: 'AES-GCM', length: 256 },\n true,\n ['encrypt', 'decrypt'],\n )\n deks.set(coll, key)\n }\n return deks\n}\n\n// ─── Internals ─────────────────────────────────────────────────────────\n\nasync function deriveWrappingKey(credential: string, salt: Uint8Array): Promise<CryptoKey> {\n return derivePassphraseKey(credential, salt, { iterations: PBKDF2_ITERATIONS, keyUsage: 'aes-gcm' })\n}\n\nfunction bytesToBase64(b: Uint8Array): string {\n let s = ''\n for (const x of b) s += String.fromCharCode(x)\n return btoa(s)\n}\n\nfunction base64ToBytes(b64: string): Uint8Array {\n const s = atob(b64)\n const out = new Uint8Array(s.length)\n for (let i = 0; i < s.length; i++) out[i] = s.charCodeAt(i)\n return out\n}\n","/**\n * Recovery profile persistence + dispatch.\n *\n * Wires the **paper** profile end-to-end through\n * `@noy-db/on-recovery`. The other three profiles (Shamir,\n * multi-channel, admin-mediated) ship the API surface and throw\n * {@link RecoveryProfileNotImplementedError} during use; per-profile\n * dispatch lands in follow-up issues.\n *\n * Storage layout:\n *\n * ```\n * _meta/recovery-paper — JSON { entries: RecoveryCodeEntry[] } produced by `on-recovery`.\n * _meta/recovery-shamir — reserved\n * _meta/recovery-multi — reserved\n * _meta/recovery-admin — reserved\n * ```\n *\n * Like `_meta/policy` and `_meta/handle`, the documents are plain JSON\n * with empty `_iv` — the recovery-code wrapping is what protects the\n * KEK; the entries themselves are inert without the user's code.\n *\n * @module\n */\nimport type { NoydbStore, EncryptedEnvelope } from '../../kernel/types.js'\nimport { NOYDB_FORMAT_VERSION } from '../../kernel/types.js'\nimport type { EnclaveKey } from '../../kernel/enclave/index.js'\nimport {\n mintWrappedDeksBlob,\n unwrapDeksFromBlob,\n type WrappedDeksBlob,\n} from './wrapped-deks.js'\nimport type { ShamirRecoveryProvider } from './shamir-recovery-provider.js'\n\n/**\n * One paper recovery code as persisted in `_meta/recovery-paper`.\n *\n * The hub's KEK is intentionally non-extractable (see `crypto.ts`),\n * so the recovery entry can't AES-KW-wrap the KEK directly. Instead\n * we wrap a serialized DEK set: the entry holds the AES-GCM\n * ciphertext of `{ deks: { collection: rawDekBase64 } }`. Recovery\n * deserializes the DEK set, then mints a fresh KEK from the new\n * passphrase and rewraps the DEKs under it.\n *\n * This is the same pattern `@noy-db/on-pin` uses for tier-3 quick\n * resume — the cryptographic guarantee is identical (AES-GCM with a\n * PBKDF2-derived key), and it sidesteps the non-extractable-KEK\n * constraint cleanly.\n *\n * Type-level composition: `PaperRecoveryEntry extends\n * WrappedDeksBlob` — the three crypto fields (`salt`, `iv`,\n * `wrappedDeks`) come from the shared primitive; `codeId` and\n * `enrolledAt` are paper-recovery's own metadata. Wire format\n * unchanged.\n */\nexport interface PaperRecoveryEntry extends WrappedDeksBlob {\n readonly codeId: string\n readonly enrolledAt: string\n}\n\nexport interface PaperRecoveryDoc {\n readonly _noydb_recovery: 1\n readonly profile: 'paper'\n readonly entries: ReadonlyArray<PaperRecoveryEntry>\n}\n\nconst PAPER_DOC_ID = 'recovery-paper'\n\n/** Read the paper-recovery entries. Returns empty array when absent. */\nexport async function loadPaperRecoveryEntries(\n store: NoydbStore,\n vault: string,\n): Promise<ReadonlyArray<PaperRecoveryEntry>> {\n const env = await store.get(vault, '_meta', PAPER_DOC_ID)\n if (!env) return []\n try {\n const doc = JSON.parse(env._data) as PaperRecoveryDoc\n if (doc.profile !== 'paper' || !Array.isArray(doc.entries)) return []\n return doc.entries\n } catch {\n return []\n }\n}\n\n/** Replace the paper-recovery entries (used after burn-on-recovery). */\nexport async function savePaperRecoveryEntries(\n store: NoydbStore,\n vault: string,\n entries: ReadonlyArray<PaperRecoveryEntry>,\n): Promise<void> {\n const doc: PaperRecoveryDoc = {\n _noydb_recovery: 1,\n profile: 'paper',\n entries,\n }\n const envelope: EncryptedEnvelope = {\n _noydb: NOYDB_FORMAT_VERSION,\n _v: 1,\n _ts: new Date().toISOString(),\n _iv: '',\n _data: JSON.stringify(doc),\n }\n await store.put(vault, '_meta', PAPER_DOC_ID, envelope)\n}\n\n/** Drop a single paper-recovery entry (burn-on-use). */\nexport async function burnPaperRecoveryEntry(\n store: NoydbStore,\n vault: string,\n codeId: string,\n): Promise<void> {\n const entries = await loadPaperRecoveryEntries(store, vault)\n const remaining = entries.filter((e) => e.codeId !== codeId)\n await savePaperRecoveryEntries(store, vault, remaining)\n}\n\n/** Whether at least one recovery profile has any enrolled entries. */\nexport async function hasRecoveryEnrolled(\n store: NoydbStore,\n vault: string,\n): Promise<boolean> {\n const paper = await loadPaperRecoveryEntries(store, vault)\n if (paper.length > 0) return true\n const shamir = await loadShamirRecoveryEntries(store, vault)\n return shamir.length > 0\n}\n\n/**\n * Whether at least one **strong** recovery profile is enrolled.\n *\n * \"Strong\" excludes paper-alone — under managed-passphrase mode the\n * user has no memorized passphrase, so a stolen/lost paper sheet\n * would be a single point of total loss. Strong profiles today:\n *\n * - `shamir` (k-of-n threshold; survives loss of up to n-k shares)\n * - `multi-channel` (when shipped — follow-up slice)\n * - `admin-mediated` (when shipped — follow-up slice)\n *\n * Managed mode requires this check to pass before `openVault` returns.\n */\nexport async function hasStrongRecoveryEnrolled(\n store: NoydbStore,\n vault: string,\n): Promise<boolean> {\n const shamir = await loadShamirRecoveryEntries(store, vault)\n return shamir.length > 0\n // When multi-channel / admin-mediated land, extend this check.\n}\n\n// ─── Shamir recovery ─────────────────────────────────────────────────────\n\n/**\n * One Shamir-recovery entry as persisted in `_meta/recovery-shamir`.\n *\n * Like {@link PaperRecoveryEntry}, the entry composes\n * {@link WrappedDeksBlob} (DEKs wrapped under a fresh ephemeral\n * recovery secret) with profile-specific metadata. Unlike paper, the\n * \"credential\" was never visible to the user — it was 32 random\n * bytes split into N Shamir shares at enrollment. The shares ARE\n * the credential; the user holds them, the hub never sees them\n * again after `enrollRecovery` returns.\n *\n * The recovery secret is base64-encoded and\n * passed as the `credential` arg to\n * {@link mintWrappedDeksBlob} / {@link unwrapDeksFromBlob}. The\n * PBKDF2 round over high-entropy input is harmless overhead — it\n * keeps the shared primitive unchanged while letting Shamir reuse\n * the same wrapping pipeline as paper.\n */\nexport interface ShamirRecoveryEntry extends WrappedDeksBlob {\n /** Stable id for this entry. Allows multiple Shamir splits to coexist. */\n readonly entryId: string\n /** Threshold — minimum shares to reconstruct. */\n readonly k: number\n /** Total shares minted at enrollment. */\n readonly n: number\n /** x-coordinates of the n minted shares. Informational. Omitted as of 0.2\n * (string-level provider doesn't expose share x-coords); kept optional so\n * pre-0.2 entries still read. */\n readonly xCoords?: ReadonlyArray<number>\n /** ISO timestamp. */\n readonly enrolledAt: string\n /** Optional caller-supplied label (e.g., \"2-of-3 board escrow\"). */\n readonly label?: string\n}\n\nexport interface ShamirRecoveryDoc {\n readonly _noydb_recovery: 1\n readonly profile: 'shamir'\n readonly entries: ReadonlyArray<ShamirRecoveryEntry>\n}\n\nconst SHAMIR_DOC_ID = 'recovery-shamir'\n\n/** Read the Shamir-recovery entries. Returns empty array when absent. */\nexport async function loadShamirRecoveryEntries(\n store: NoydbStore,\n vault: string,\n): Promise<ReadonlyArray<ShamirRecoveryEntry>> {\n const env = await store.get(vault, '_meta', SHAMIR_DOC_ID)\n if (!env) return []\n try {\n const doc = JSON.parse(env._data) as ShamirRecoveryDoc\n if (doc.profile !== 'shamir' || !Array.isArray(doc.entries)) return []\n return doc.entries\n } catch {\n return []\n }\n}\n\n/** Replace the Shamir-recovery entries (used by enrollment and rotation). */\nexport async function saveShamirRecoveryEntries(\n store: NoydbStore,\n vault: string,\n entries: ReadonlyArray<ShamirRecoveryEntry>,\n): Promise<void> {\n const doc: ShamirRecoveryDoc = {\n _noydb_recovery: 1,\n profile: 'shamir',\n entries,\n }\n const envelope: EncryptedEnvelope = {\n _noydb: NOYDB_FORMAT_VERSION,\n _v: 1,\n _ts: new Date().toISOString(),\n _iv: '',\n _data: JSON.stringify(doc),\n }\n await store.put(vault, '_meta', SHAMIR_DOC_ID, envelope)\n}\n\n/**\n * Mint a fresh Shamir recovery entry from a DEK set.\n *\n * 1. Generates a 32-byte recovery secret.\n * 2. Wraps the DEK set under that secret via\n * {@link mintWrappedDeksBlob} (the recovery secret is base64-\n * encoded as the credential string — PBKDF2 over high-entropy\n * input is harmless overhead).\n * 3. Splits the recovery secret via Shamir into `n` shares with\n * threshold `k`.\n * 4. Zeros the in-memory recovery secret after wrapping + splitting.\n *\n * Returns:\n * - `entry` — the {@link ShamirRecoveryEntry} to persist.\n * - `shareStrings` — the `n` Base32-encoded share strings to\n * return to the caller. The HUB MUST NOT PERSIST THESE; once\n * returned they are the user's responsibility.\n *\n * @param deks - DEK set to wrap.\n * @param entryId - Stable id for this entry (caller-supplied or\n * hub-generated).\n * @param k - Threshold (>= 2).\n * @param n - Total shares (k <= n <= 255).\n * @param label - Optional caller label.\n */\nexport async function mintShamirRecoveryEntry(\n provider: ShamirRecoveryProvider,\n deks: Map<string, EnclaveKey>,\n entryId: string,\n k: number,\n n: number,\n label?: string,\n): Promise<{ entry: ShamirRecoveryEntry; shareStrings: string[] }> {\n const recoverySecret = crypto.getRandomValues(new Uint8Array(32))\n try {\n const credential = bytesToBase64(recoverySecret)\n const blob = await mintWrappedDeksBlob(deks, credential)\n const shareStrings = provider.splitToShares(recoverySecret, k, n)\n const entry: ShamirRecoveryEntry = {\n ...blob, entryId, k, n,\n enrolledAt: new Date().toISOString(),\n ...(label !== undefined && { label }),\n }\n return { entry, shareStrings }\n } finally {\n recoverySecret.fill(0)\n }\n}\n\n/**\n * Decrypt a Shamir recovery entry to recover the raw DEK set.\n *\n * Combines K or more `shares`, reconstructs the recovery secret,\n * unwraps the DEKs via {@link unwrapDeksFromBlob}.\n *\n * Throws (AES-GCM auth-tag mismatch) when the shares don't combine\n * to the secret originally used to mint the entry — typically\n * because they came from a different enrollment or were tampered\n * with. Callers iterating multiple entries should catch.\n */\nexport async function unwrapDeksFromShamirEntry(\n provider: ShamirRecoveryProvider,\n entry: ShamirRecoveryEntry,\n shareStrings: readonly string[],\n): Promise<Map<string, EnclaveKey>> {\n if (shareStrings.length < entry.k) {\n throw new Error(\n `Insufficient shares: this Shamir entry needs ${entry.k} of ${entry.n}, `\n + `but ${shareStrings.length} were provided.`,\n )\n }\n const secret = provider.combineShares(shareStrings)\n try {\n return await unwrapDeksFromBlob(entry, bytesToBase64(secret))\n } finally {\n secret.fill(0)\n }\n}\n\nfunction bytesToBase64(b: Uint8Array): string {\n let s = ''\n for (const x of b) s += String.fromCharCode(x)\n return btoa(s)\n}\n\n/**\n * Generate one paper-recovery entry from an unlocked DEK set.\n *\n * Returns the serializable entry (persisted via\n * {@link savePaperRecoveryEntries}). The recovery flow unwraps the\n * DEK set, then mints a fresh KEK from the user's new passphrase.\n *\n * Thin wrapper over {@link mintWrappedDeksBlob} — the crypto\n * lives in the shared primitive; this function just adds paper-\n * recovery's own metadata (`codeId`, `enrolledAt`).\n *\n * @param deks Map of collection-name → DEK (extractable).\n * @param code The plaintext recovery code (caller-supplied;\n * pair this with `@noy-db/on-recovery`'s code\n * generator/parser if available).\n * @param codeId Stable id used by `burnPaperRecoveryEntry`.\n */\nexport async function mintPaperRecoveryEntry(\n deks: Map<string, EnclaveKey>,\n code: string,\n codeId: string,\n): Promise<PaperRecoveryEntry> {\n const blob = await mintWrappedDeksBlob(deks, code)\n return {\n ...blob,\n codeId,\n enrolledAt: new Date().toISOString(),\n }\n}\n\n/**\n * Decrypt a recovery entry to recover the raw DEK set. Used by the\n * `recoverPassphrase` flow after the user's code has been parsed.\n *\n * Thin wrapper over {@link unwrapDeksFromBlob}.\n *\n * @throws when the code does not match the entry (AES-GCM auth tag fail).\n */\nexport async function unwrapDeksFromPaperEntry(\n entry: PaperRecoveryEntry,\n code: string,\n): Promise<Map<string, EnclaveKey>> {\n return unwrapDeksFromBlob(entry, code)\n}\n\n// The crypto helpers (deriveRecoveryWrappingKey, bytesToBase64,\n// base64ToBytes) live in the canonical wrap-DEKs primitive at\n// `./wrapped-deks.ts` and are reached via\n// `mintWrappedDeksBlob` / `unwrapDeksFromBlob`.\n"],"mappings":"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","names":["bytesToBase64"]}