@noy-db/hub 0.8.0-pre.0 → 0.9.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.
- package/CHANGELOG.md +78 -0
- package/README.md +8 -8
- package/codemods/0.4.0-pre.json +1 -1
- package/codemods/0.8.0-pre.json +1 -1
- package/dist/api-MSJXVYQG.js +18 -0
- package/dist/as/index.js +34 -25
- package/dist/as/index.js.map +1 -1
- package/dist/at/index.js +9 -10
- package/dist/attestation/index.js +39 -28
- package/dist/attestation/index.js.map +1 -1
- package/dist/{backup-7TFRVFLH.js → backup-7RKNZMQO.js} +15 -16
- package/dist/backup-7RKNZMQO.js.map +1 -0
- package/dist/blobs/index.js +13 -14
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +20 -13
- package/dist/broker/index.js.map +1 -1
- package/dist/by/index.js +2 -2
- package/dist/capsule/contract.d.ts +159 -0
- package/dist/capsule/contract.js +95 -0
- package/dist/capsule/enclave-aes/bound.d.ts +52 -0
- package/dist/{kernel/enclave → capsule/enclave-aes}/broker/proof.d.ts +12 -3
- package/dist/capsule/enclave-aes/capabilities.d.ts +2 -0
- package/dist/capsule/enclave-aes/classify/compare.d.ts +20 -0
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/find.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/reveal.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/verify.d.ts +2 -2
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/write.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/crypto.d.ts +33 -129
- package/dist/capsule/enclave-aes/index.d.ts +113 -0
- package/dist/capsule/enclave-aes/index.js +361 -0
- package/dist/capsule/enclave-aes/index.js.map +1 -0
- package/dist/capsule/enclave-aes/primitives.d.ts +29 -0
- package/dist/capsule/index.d.ts +27 -0
- package/dist/capsule/plumbing/ct-equal.d.ts +11 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/deterministic.d.ts +8 -21
- package/dist/capsule/plumbing/digest.d.ts +122 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/envelope-body.d.ts +44 -48
- package/dist/capsule/plumbing/index.d.ts +100 -0
- package/dist/capsule/plumbing/lifecycle.d.ts +50 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/record-codec.d.ts +62 -20
- package/dist/{kernel/enclave → capsule/plumbing}/record-envelope.d.ts +1 -1
- package/dist/capsule/plumbing/rekey-blob.d.ts +33 -0
- package/dist/capsule/plumbing/rekey.d.ts +44 -0
- package/dist/capsule/plumbing/sealed-slot.d.ts +22 -0
- package/dist/capsule/plumbing/sealed-slots.d.ts +37 -0
- package/dist/capsule/plumbing/sealing.d.ts +29 -0
- package/dist/capsule/plumbing/sign.d.ts +9 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/tombstone.d.ts +2 -2
- package/dist/capsule-57BDK7LG.js +209 -0
- package/dist/cargo/index.js +36 -36
- package/dist/{chunk-BUDAGWL5.js → chunk-226V6XXJ.js} +41 -6
- package/dist/chunk-226V6XXJ.js.map +1 -0
- package/dist/{chunk-QWGU66MP.js → chunk-2A56DSRI.js} +5 -7
- package/dist/chunk-2A56DSRI.js.map +1 -0
- package/dist/chunk-2DX4JCRI.js +1 -0
- package/dist/{chunk-ODVPTDPK.js → chunk-2ELOCEXE.js} +1 -1
- package/dist/chunk-2ELOCEXE.js.map +1 -0
- package/dist/{chunk-CKNGS5MH.js → chunk-2WJKJZSO.js} +3 -5
- package/dist/chunk-2WJKJZSO.js.map +1 -0
- package/dist/{chunk-ZSX4S5XB.js → chunk-2ZFD2UJC.js} +9 -9
- package/dist/{chunk-YSK2CU2Q.js → chunk-3V6LZHUO.js} +3 -3
- package/dist/chunk-3V6LZHUO.js.map +1 -0
- package/dist/{chunk-HT2AHGQI.js → chunk-3Y5JLSXS.js} +2 -2
- package/dist/{chunk-M7NI3IWE.js → chunk-45VHWE4C.js} +67 -60
- package/dist/chunk-45VHWE4C.js.map +1 -0
- package/dist/{chunk-LGNDFRYC.js → chunk-4CFHL5RY.js} +1 -1
- package/dist/chunk-4CFHL5RY.js.map +1 -0
- package/dist/{enclave-27SMF6GF.js → chunk-4J3MNVVX.js} +83 -56
- package/dist/chunk-4J3MNVVX.js.map +1 -0
- package/dist/{chunk-SI3V7D4G.js → chunk-4UIP3QNW.js} +2 -2
- package/dist/{chunk-WNJ4AVGE.js → chunk-55P6OBB7.js} +2 -2
- package/dist/{chunk-6LNL42F5.js → chunk-5HNW4ZTA.js} +12 -15
- package/dist/chunk-5HNW4ZTA.js.map +1 -0
- package/dist/{chunk-SYVZW77S.js → chunk-5LMCVBMY.js} +6 -8
- package/dist/chunk-5LMCVBMY.js.map +1 -0
- package/dist/{chunk-MKXXMNJH.js → chunk-5UUJE4FP.js} +3 -3
- package/dist/chunk-5XONHAFD.js +12 -0
- package/dist/chunk-5XONHAFD.js.map +1 -0
- package/dist/{chunk-X4773RBR.js → chunk-6QLCS7ET.js} +2 -2
- package/dist/chunk-6QLCS7ET.js.map +1 -0
- package/dist/{chunk-FW22ZCXT.js → chunk-6WS35E6X.js} +2 -2
- package/dist/{chunk-FCKWQE2H.js → chunk-6Y5E4SJU.js} +7 -8
- package/dist/chunk-6Y5E4SJU.js.map +1 -0
- package/dist/{chunk-4AF3TUMP.js → chunk-72XBVN4J.js} +8 -2
- package/dist/{chunk-4AF3TUMP.js.map → chunk-72XBVN4J.js.map} +1 -1
- package/dist/{chunk-QBBUZ3I3.js → chunk-7BMOS4JQ.js} +11 -11
- package/dist/chunk-7BMOS4JQ.js.map +1 -0
- package/dist/{chunk-5FDLC6G7.js → chunk-7CT6SX4M.js} +3 -3
- package/dist/chunk-7CT6SX4M.js.map +1 -0
- package/dist/{chunk-LQ4ZHOKP.js → chunk-ABU6A4Z5.js} +36 -27
- package/dist/chunk-ABU6A4Z5.js.map +1 -0
- package/dist/{chunk-WX5ADGTZ.js → chunk-AJFPAHMW.js} +3 -3
- package/dist/chunk-AJFPAHMW.js.map +1 -0
- package/dist/{chunk-ZE4CHIED.js → chunk-APFFJN5T.js} +39 -37
- package/dist/chunk-APFFJN5T.js.map +1 -0
- package/dist/{chunk-6OWXYZK2.js → chunk-B65CC6Z6.js} +2 -2
- package/dist/{chunk-F2TDU7MQ.js → chunk-BJH77UY2.js} +2 -2
- package/dist/{chunk-L7DOS3TE.js → chunk-BMHQHH7Q.js} +3 -3
- package/dist/chunk-BMHQHH7Q.js.map +1 -0
- package/dist/{chunk-BJ2IXQ5Q.js → chunk-BNFNQNEP.js} +2 -2
- package/dist/chunk-BU2ABHFW.js +74 -0
- package/dist/chunk-BU2ABHFW.js.map +1 -0
- package/dist/{chunk-HLEK5VAN.js → chunk-BUE7R3B5.js} +2 -2
- package/dist/{chunk-ISZQJBML.js → chunk-BVF3SXD7.js} +6 -6
- package/dist/chunk-BVF3SXD7.js.map +1 -0
- package/dist/{chunk-M522UYZ2.js → chunk-BYHCKX73.js} +6 -10
- package/dist/chunk-BYHCKX73.js.map +1 -0
- package/dist/{chunk-EOVMT6TB.js → chunk-C53ER7AG.js} +2 -2
- package/dist/{chunk-K6W7BVZ6.js → chunk-CAD7N6HQ.js} +3 -3
- package/dist/chunk-CB4467G3.js +565 -0
- package/dist/chunk-CB4467G3.js.map +1 -0
- package/dist/{chunk-NWHBJQAL.js → chunk-D4V5JJAK.js} +4 -4
- package/dist/chunk-D4V5JJAK.js.map +1 -0
- package/dist/{chunk-QWFHIOD2.js → chunk-D5A3GCZ4.js} +11 -12
- package/dist/chunk-D5A3GCZ4.js.map +1 -0
- package/dist/{chunk-5O7D6ZTW.js → chunk-DHU2AQ6T.js} +2 -2
- package/dist/{chunk-DC5QVPV7.js → chunk-DL6BZKP3.js} +3 -3
- package/dist/chunk-DL6BZKP3.js.map +1 -0
- package/dist/{chunk-FQ54DWUQ.js → chunk-EA4VDI5D.js} +4 -4
- package/dist/chunk-EA4VDI5D.js.map +1 -0
- package/dist/{chunk-IT22PWKV.js → chunk-ECGXA4LT.js} +2 -2
- package/dist/{chunk-BP6DARYA.js → chunk-EMAWOGVH.js} +4 -4
- package/dist/chunk-EMAWOGVH.js.map +1 -0
- package/dist/{chunk-3F7GLNAE.js → chunk-EUD3HQM4.js} +7 -11
- package/dist/chunk-EUD3HQM4.js.map +1 -0
- package/dist/{chunk-T2LBQ5DV.js → chunk-FSQNGPHH.js} +335 -250
- package/dist/chunk-FSQNGPHH.js.map +1 -0
- package/dist/{chunk-7VCXZDA4.js → chunk-FZXRLNJO.js} +7 -11
- package/dist/chunk-FZXRLNJO.js.map +1 -0
- package/dist/{chunk-6LMQ5R26.js → chunk-G46JSSVX.js} +7 -7
- package/dist/{chunk-6LMQ5R26.js.map → chunk-G46JSSVX.js.map} +1 -1
- package/dist/{chunk-GF5BZ7D4.js → chunk-G5EDYVSE.js} +11 -13
- package/dist/chunk-G5EDYVSE.js.map +1 -0
- package/dist/chunk-G66YXUTY.js +60 -0
- package/dist/chunk-G66YXUTY.js.map +1 -0
- package/dist/{chunk-FFWI7UH7.js → chunk-GAGT3YZN.js} +1 -1
- package/dist/chunk-GAGT3YZN.js.map +1 -0
- package/dist/{chunk-4MXI3ODD.js → chunk-GCUMOKTN.js} +3 -3
- package/dist/{chunk-FH2L2E34.js → chunk-GETUTTZU.js} +4 -4
- package/dist/{chunk-FH2L2E34.js.map → chunk-GETUTTZU.js.map} +1 -1
- package/dist/chunk-GMKGGY7V.js +234 -0
- package/dist/chunk-GMKGGY7V.js.map +1 -0
- package/dist/{chunk-B6SJIBQK.js → chunk-GOJQ5DZA.js} +4 -4
- package/dist/{chunk-EIPVYUEP.js → chunk-GQ4MF3CM.js} +3 -3
- package/dist/chunk-GQ4MF3CM.js.map +1 -0
- package/dist/{chunk-PDCG6PR5.js → chunk-GRS2HIV6.js} +2 -2
- package/dist/chunk-GRS2HIV6.js.map +1 -0
- package/dist/{chunk-PEOZ34EM.js → chunk-GSAK56VF.js} +1 -1
- package/dist/chunk-GSAK56VF.js.map +1 -0
- package/dist/{chunk-3H5KLDZN.js → chunk-H3YM66EI.js} +4 -8
- package/dist/chunk-H3YM66EI.js.map +1 -0
- package/dist/{chunk-NRT6QZQB.js → chunk-IVMFIKNA.js} +6 -6
- package/dist/chunk-IVMFIKNA.js.map +1 -0
- package/dist/{chunk-PSIV7CJV.js → chunk-J4KAPKBJ.js} +2 -2
- package/dist/chunk-J4KAPKBJ.js.map +1 -0
- package/dist/{chunk-N5DNADLQ.js → chunk-JA25QG5M.js} +224 -34
- package/dist/chunk-JA25QG5M.js.map +1 -0
- package/dist/{chunk-T7IR4N2S.js → chunk-JBMMWYOH.js} +3 -1
- package/dist/{chunk-T7IR4N2S.js.map → chunk-JBMMWYOH.js.map} +1 -1
- package/dist/{chunk-YNIUIERI.js → chunk-JPSL5GIZ.js} +18 -59
- package/dist/chunk-JPSL5GIZ.js.map +1 -0
- package/dist/{chunk-TKUOEU2F.js → chunk-JSWKVZCR.js} +2 -2
- package/dist/chunk-JZ4EDEIP.js +22 -0
- package/dist/chunk-JZ4EDEIP.js.map +1 -0
- package/dist/{chunk-QOOUUR4A.js → chunk-K673OO6B.js} +10 -4
- package/dist/chunk-K673OO6B.js.map +1 -0
- package/dist/{chunk-NNARWO72.js → chunk-K7RW7FI4.js} +13 -12
- package/dist/chunk-K7RW7FI4.js.map +1 -0
- package/dist/{chunk-ZXABPVM6.js → chunk-L2F3CFCH.js} +9 -13
- package/dist/chunk-L2F3CFCH.js.map +1 -0
- package/dist/{chunk-X25NWUZB.js → chunk-L5A3KR7R.js} +3 -3
- package/dist/{chunk-T52GX4SA.js → chunk-LGGIFKJP.js} +4 -4
- package/dist/{chunk-ID6Z6E66.js → chunk-MQ7YWBQ5.js} +2 -2
- package/dist/{chunk-FXQBGFOX.js → chunk-MRJDLXI3.js} +14 -8
- package/dist/{chunk-FXQBGFOX.js.map → chunk-MRJDLXI3.js.map} +1 -1
- package/dist/chunk-NH2UOV3B.js +18 -0
- package/dist/chunk-NH2UOV3B.js.map +1 -0
- package/dist/{chunk-FN5EBVTQ.js → chunk-NIXRB5BP.js} +2 -2
- package/dist/{chunk-RHVMZSUU.js → chunk-NV4OESHC.js} +1 -1
- package/dist/chunk-NV4OESHC.js.map +1 -0
- package/dist/{chunk-HBRLNOHL.js → chunk-NYJBYVBG.js} +4 -4
- package/dist/{chunk-DF73H4UN.js → chunk-NZULV7LK.js} +5 -5
- package/dist/chunk-NZULV7LK.js.map +1 -0
- package/dist/{chunk-HK67PX4J.js → chunk-OFD2HD6F.js} +1 -1
- package/dist/chunk-OFD2HD6F.js.map +1 -0
- package/dist/{chunk-WY2XXTET.js → chunk-OJU67C23.js} +4 -4
- package/dist/{chunk-WY2XXTET.js.map → chunk-OJU67C23.js.map} +1 -1
- package/dist/{chunk-ZUVBC32X.js → chunk-OK57EATL.js} +2 -2
- package/dist/{chunk-KJFW62P4.js → chunk-OM3SEDI4.js} +652 -662
- package/dist/chunk-OM3SEDI4.js.map +1 -0
- package/dist/{chunk-TOPYQ6GA.js → chunk-PCYPXLEX.js} +6 -6
- package/dist/{chunk-GYGLAVCX.js → chunk-PFCTSXHU.js} +6 -2
- package/dist/chunk-PFCTSXHU.js.map +1 -0
- package/dist/{chunk-VNNRUGMM.js → chunk-PGC35KXE.js} +2 -2
- package/dist/{chunk-4I522ERM.js → chunk-PT2YCQVK.js} +4 -4
- package/dist/{chunk-Z5HTYMMQ.js → chunk-PTJY5R3O.js} +2 -2
- package/dist/chunk-PUBI455O.js +157 -0
- package/dist/chunk-PUBI455O.js.map +1 -0
- package/dist/{chunk-MTL7MXGR.js → chunk-QDHHHI5Q.js} +16 -17
- package/dist/chunk-QDHHHI5Q.js.map +1 -0
- package/dist/{chunk-F24ZZTHQ.js → chunk-QGFEBNHO.js} +4 -4
- package/dist/{chunk-A6IJU4TK.js → chunk-QGSNJD3B.js} +2 -2
- package/dist/chunk-QJNAHPVT.js +91 -0
- package/dist/chunk-QJNAHPVT.js.map +1 -0
- package/dist/{chunk-BK2HHQGN.js → chunk-QSHATAXJ.js} +2 -2
- package/dist/{chunk-ANWPSTZU.js → chunk-QXJXG7DN.js} +57 -30
- package/dist/chunk-QXJXG7DN.js.map +1 -0
- package/dist/{chunk-HBPPGWUM.js → chunk-RDOEOPOI.js} +14 -9
- package/dist/chunk-RDOEOPOI.js.map +1 -0
- package/dist/{chunk-JCN44NCY.js → chunk-RIZTZJX6.js} +2 -2
- package/dist/{chunk-MVZ2TPVP.js → chunk-RNACRT5H.js} +2 -2
- package/dist/chunk-RWFQVNXR.js +24 -0
- package/dist/chunk-RWFQVNXR.js.map +1 -0
- package/dist/{chunk-TROR3ALR.js → chunk-SFCD6OU7.js} +2 -2
- package/dist/{chunk-S57HTZ6X.js → chunk-SNM7LSYG.js} +5 -8
- package/dist/chunk-SNM7LSYG.js.map +1 -0
- package/dist/chunk-SPPOUJLN.js +40 -0
- package/dist/chunk-SPPOUJLN.js.map +1 -0
- package/dist/{chunk-3ELRMVJK.js → chunk-SWXLZ4HX.js} +31 -35
- package/dist/chunk-SWXLZ4HX.js.map +1 -0
- package/dist/{chunk-6B3VNR4P.js → chunk-TFWFPZRU.js} +26 -35
- package/dist/chunk-TFWFPZRU.js.map +1 -0
- package/dist/{chunk-F7XGHL5O.js → chunk-TMIJAR2X.js} +3 -3
- package/dist/{chunk-F7XGHL5O.js.map → chunk-TMIJAR2X.js.map} +1 -1
- package/dist/{chunk-I3JDRCMW.js → chunk-TZYTMZZY.js} +10 -10
- package/dist/{chunk-AOWGXU6D.js → chunk-UAKY6E4N.js} +2 -2
- package/dist/chunk-UHFGK6YA.js +40 -0
- package/dist/chunk-UHFGK6YA.js.map +1 -0
- package/dist/{chunk-3JWHAR6E.js → chunk-UNSQZSZP.js} +2 -2
- package/dist/{chunk-FQ5VRHIB.js → chunk-UOZOWN73.js} +5 -9
- package/dist/chunk-UOZOWN73.js.map +1 -0
- package/dist/{chunk-GHLTDZRS.js → chunk-V55JASXO.js} +25 -4
- package/dist/chunk-V55JASXO.js.map +1 -0
- package/dist/{chunk-244VXYPG.js → chunk-VSUQI5Q6.js} +45 -4
- package/dist/chunk-VSUQI5Q6.js.map +1 -0
- package/dist/{chunk-6K7DPM7D.js → chunk-WFWFXDNS.js} +2 -2
- package/dist/{chunk-CF5UU4S7.js → chunk-WHOKGHJ3.js} +7 -7
- package/dist/{chunk-LGRLME4M.js → chunk-X2RP4TO5.js} +16 -16
- package/dist/chunk-X2RP4TO5.js.map +1 -0
- package/dist/{chunk-VNPEWFPD.js → chunk-XA34THLF.js} +8 -6
- package/dist/chunk-XA34THLF.js.map +1 -0
- package/dist/{chunk-HVSCEIYL.js → chunk-XITHENBI.js} +12 -14
- package/dist/chunk-XITHENBI.js.map +1 -0
- package/dist/{chunk-ENAG3IY7.js → chunk-XKBTJGFP.js} +26 -28
- package/dist/chunk-XKBTJGFP.js.map +1 -0
- package/dist/{chunk-32YV3TJT.js → chunk-XXNWU5QZ.js} +2 -2
- package/dist/{chunk-B57AFBY2.js → chunk-XXQ5XIYY.js} +2 -2
- package/dist/{chunk-ORDURZBU.js → chunk-YFFMPZPY.js} +2 -2
- package/dist/{chunk-MDWKM2XC.js → chunk-YKGJ44Z7.js} +3 -3
- package/dist/{chunk-IUWCVHQ7.js → chunk-YQFBH5ZJ.js} +4 -4
- package/dist/{chunk-IUWCVHQ7.js.map → chunk-YQFBH5ZJ.js.map} +1 -1
- package/dist/{chunk-UPD5NWI5.js → chunk-Z3ZXVB2Y.js} +29 -16
- package/dist/chunk-Z3ZXVB2Y.js.map +1 -0
- package/dist/chunk-ZBUAX4EF.js +27 -0
- package/dist/chunk-ZBUAX4EF.js.map +1 -0
- package/dist/{chunk-MLPHLJIQ.js → chunk-ZHQJAV6D.js} +2 -2
- package/dist/{chunk-UD5EVGZ7.js → chunk-ZMVSKYTJ.js} +56 -96
- package/dist/chunk-ZMVSKYTJ.js.map +1 -0
- package/dist/{chunk-7JE7BDYJ.js → chunk-ZVSKSUGI.js} +5 -5
- package/dist/{chunk-J6UOHJY5.js → chunk-ZWF3EWZA.js} +4 -8
- package/dist/chunk-ZWF3EWZA.js.map +1 -0
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-W3USLL5M.js → classified-marker-KHDOYIJB.js} +3 -3
- package/dist/classified-marker-KHDOYIJB.js.map +1 -0
- package/dist/collection-facade-LZIF7GWD.js +41 -0
- package/dist/{computed-TPFBX7U4.js → computed-XMFTHAXV.js} +3 -3
- package/dist/consent/index.js +10 -11
- package/dist/consent/index.js.map +1 -1
- package/dist/cover/index.js +9 -10
- package/dist/coverage/index.js +1 -1
- package/dist/custody/index.js +13 -13
- package/dist/{dead-filter-U2UYKSZL.js → dead-filter-CXV5NS67.js} +11 -3
- package/dist/dead-filter-CXV5NS67.js.map +1 -0
- package/dist/debug/index.js +11 -2
- package/dist/debug/index.js.map +1 -1
- package/dist/{delegation-S3AEPW2T.js → delegation-ONLM4JFI.js} +52 -31
- package/dist/delegation-ONLM4JFI.js.map +1 -0
- package/dist/derivations/index.js +25 -25
- package/dist/derive-3YSIS36W.js +20 -0
- package/dist/directory/index.js +10 -11
- package/dist/{dispatch-RH4LHKBH.js → dispatch-2MQFMEGY.js} +22 -23
- package/dist/dispatch-2MQFMEGY.js.map +1 -0
- package/dist/{dispatch-3CQDJV5Q.js → dispatch-OFDA4WQV.js} +5 -5
- package/dist/executor-E6YDJ7YA.js +8 -0
- package/dist/executor-NJX3YQQ4.js +35 -0
- package/dist/executor-WWM3DD4P.js +8 -0
- package/dist/export-accessible-RLHU5G4W.js +22 -0
- package/dist/extract-partition-QII2EDCS.js +35 -0
- package/dist/{fanout-sidecar-OT6RYLOL.js → fanout-sidecar-BO67PCPO.js} +13 -15
- package/dist/fanout-sidecar-BO67PCPO.js.map +1 -0
- package/dist/find-6M7GYDUZ.js +10 -0
- package/dist/forget/index.js +26 -10
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +13 -14
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +14 -15
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +15 -13
- package/dist/index.js +198 -187
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +6 -6
- package/dist/introspection/index.js +16 -13
- package/dist/issue-LPEEEMPP.js +19 -0
- package/dist/kernel/attestation-types.d.ts +62 -0
- package/dist/kernel/cache/index.d.ts +1 -1
- package/dist/kernel/collection-config.d.ts +1 -48
- package/dist/kernel/collection.d.ts +2 -1
- package/dist/kernel/cutover-transform.d.ts +1 -1
- package/dist/kernel/errors.d.ts +63 -6
- package/dist/kernel/export-scope.d.ts +40 -0
- package/dist/kernel/merge-authority.d.ts +1 -1
- package/dist/kernel/noydb.d.ts +3 -1
- package/dist/kernel/paths.d.ts +29 -5
- package/dist/kernel/prepared-write.d.ts +1 -1
- package/dist/kernel/put-many-atomic.d.ts +1 -1
- package/dist/kernel/query/live/live.d.ts +2 -1
- package/dist/kernel/query/sort-key.d.ts +0 -2
- package/dist/kernel/secret-mode.d.ts +1 -1
- package/dist/kernel/tx-write-gate.d.ts +2 -4
- package/dist/kernel/types.d.ts +135 -11
- package/dist/kernel/validation.d.ts +0 -10
- package/dist/kernel/vault.d.ts +6 -2
- package/dist/kernel/via/reconcile.d.ts +1 -42
- package/dist/kernel/write-queue.d.ts +17 -0
- package/dist/{ledger-KZPCMVZY.js → ledger-MSJGWKGW.js} +11 -12
- package/dist/liberate-LEKDYKTC.js +25 -0
- package/dist/link-set-QXXSPPHL.js +29 -0
- package/dist/{managed-secret-S3MQ6SH6.js → managed-secret-VSK7ANQI.js} +10 -11
- package/dist/materialized-views/index.js +27 -28
- package/dist/{migrate-cek-V7GKJZ7O.js → migrate-cek-GEBFYBDC.js} +2 -2
- package/dist/money/index.js +5 -5
- package/dist/noydb-F2AUF6KL.js +98 -0
- package/dist/on/index.js +25 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +12 -13
- package/dist/pod/index.js +76 -74
- package/dist/{pod-handle-WGDFB4C2.js → pod-handle-YE7CT66T.js} +10 -11
- package/dist/pod-handle-YE7CT66T.js.map +1 -0
- package/dist/policy/index.js +10 -11
- package/dist/port/as/active.d.ts +4 -0
- package/dist/port/as/index.d.ts +1 -0
- package/dist/port/by/index.d.ts +14 -5
- package/dist/port/on/index.d.ts +27 -1
- package/dist/port/to/index.d.ts +1 -1
- package/dist/port/with/blob-strategy.d.ts +1 -1
- package/dist/port/with/broker-strategy.d.ts +14 -0
- package/dist/port/with/classified-strategy.d.ts +1 -1
- package/dist/port/with/collection-options.d.ts +1 -1
- package/dist/port/with/collection-registries.d.ts +1 -1
- package/dist/port/with/coverage-strategy.d.ts +17 -1
- package/dist/port/with/formats-strategy.d.ts +34 -1
- package/dist/port/with/lookup-strategy.d.ts +87 -6
- package/dist/port/with/service-bus.d.ts +2 -1
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-SLSXIPBV.js → post-register-QC5TEAW3.js} +6 -6
- package/dist/post-register-QC5TEAW3.js.map +1 -0
- package/dist/query/all/index.js +16 -16
- package/dist/query/index.js +8 -8
- package/dist/query/live/index.js +7 -7
- package/dist/query/reduce/index.js +10 -10
- package/dist/query/relate/index.js +10 -10
- package/dist/reduce/index.js +8 -8
- package/dist/register-SN72QALV.js +30 -0
- package/dist/registry-253FF7C6.js +35 -0
- package/dist/registry-3AZWQTDT.js +23 -0
- package/dist/registry-7UEBTHWG.js +8 -0
- package/dist/registry-IVJ67NFQ.js +8 -0
- package/dist/request-withdrawal-UKVJZKX2.js +28 -0
- package/dist/{reveal-4BCKPEC2.js → reveal-YQTRNQFH.js} +10 -9
- package/dist/reveal-YQTRNQFH.js.map +1 -0
- package/dist/revoke-G2KXJQA5.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +2 -2
- package/dist/sealed-record/index.js +16 -18
- package/dist/sealed-record/index.js.map +1 -1
- package/dist/search/index.js +4 -4
- package/dist/{seed-4JS2RJ4A.js → seed-JMQTRKRE.js} +125 -34
- package/dist/seed-JMQTRKRE.js.map +1 -0
- package/dist/sequence/index.js +9 -10
- package/dist/session/index.js +9 -10
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.js +2 -2
- package/dist/signer-IUIYR3CX.js +23 -0
- package/dist/snapshots/index.js +11 -11
- package/dist/stale-SKV33PBU.js +28 -0
- package/dist/storage-NPBYP2SM.js +21 -0
- package/dist/store/index.js +1 -1
- package/dist/{store-coordination-provider-2O2VUHKW.js → store-coordination-provider-Z6HKPOGM.js} +11 -12
- package/dist/store-coordination-provider-Z6HKPOGM.js.map +1 -0
- package/dist/sync/index.js +18 -13
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +18 -17
- package/dist/tiers/index.js +11 -12
- package/dist/to/index.js +2 -2
- package/dist/transactions/index.js +3 -3
- package/dist/util/index.js +1 -1
- package/dist/vault-head/index.js +11 -14
- package/dist/vault-head/index.js.map +1 -1
- package/dist/{verify-RVT67IMH.js → verify-KWQIWLGH.js} +14 -12
- package/dist/verify-KWQIWLGH.js.map +1 -0
- package/dist/via/classified/binding.d.ts +2 -2
- package/dist/via/classified/config-drift.d.ts +2 -2
- package/dist/via/classified/errors.d.ts +1 -1
- package/dist/via/classified/presets.d.ts +29 -0
- package/dist/via/classified/resolve.d.ts +7 -0
- package/dist/via/geo/binding.d.ts +0 -4
- package/dist/via/lookup/handle.d.ts +4 -4
- package/dist/via/lookup/index.d.ts +32 -0
- package/dist/via/money/binding.d.ts +0 -9
- package/dist/walk-F4OLXI5H.js +20 -0
- package/dist/with-audit/attestation/index.d.ts +2 -1
- package/dist/with-audit/attestation/issue.d.ts +2 -2
- package/dist/with-audit/attestation/revoke.d.ts +2 -2
- package/dist/with-audit/attestation/scheme.d.ts +7 -0
- package/dist/with-audit/attestation/signer.d.ts +1 -1
- package/dist/with-audit/attestation/strategy.d.ts +4 -3
- package/dist/with-audit/attestation/types.d.ts +10 -0
- package/dist/with-audit/attestation/vault-facade.d.ts +9 -2
- package/dist/with-audit/attestation/verifier.d.ts +6 -0
- package/dist/with-audit/consent/consent.d.ts +1 -1
- package/dist/with-audit/consent/strategy.d.ts +1 -1
- package/dist/with-audit/forget/completeness.d.ts +66 -0
- package/dist/with-audit/forget/index.d.ts +2 -0
- package/dist/with-audit/forget/strategy.d.ts +65 -0
- package/dist/with-audit/forget/subject-index.d.ts +1 -1
- package/dist/with-audit/periods/periods.d.ts +0 -9
- package/dist/with-audit/periods/reserved-collections.d.ts +7 -0
- package/dist/with-audit/periods/vault-facade.d.ts +1 -1
- package/dist/with-audit/portability/request-withdrawal.d.ts +0 -1
- package/dist/with-audit/portability/withdraw-accessible.d.ts +0 -1
- package/dist/with-audit/sealed-record/index.d.ts +2 -2
- package/dist/with-audit/sealed-record/strategy.d.ts +1 -1
- package/dist/with-audit/tiers/index.d.ts +3 -3
- package/dist/with-audit/tiers/strategy.d.ts +19 -0
- package/dist/with-cargo/adopt-partition.d.ts +1 -1
- package/dist/with-cargo/extract-partition.d.ts +1 -47
- package/dist/with-cargo/floor.d.ts +1 -1
- package/dist/with-commit/history/history.d.ts +2 -2
- package/dist/with-commit/history/index.d.ts +1 -1
- package/dist/with-commit/history/ledger/store.d.ts +1 -1
- package/dist/with-commit/history/strategy.d.ts +1 -1
- package/dist/with-commit/history/time-machine.d.ts +1 -1
- package/dist/with-commit/numbering/index.d.ts +1 -3
- package/dist/with-commit/sequence/index.d.ts +1 -1
- package/dist/with-commit/tx/transaction.d.ts +2 -24
- package/dist/with-commit/vault-head/head.d.ts +1 -1
- package/dist/with-commit/vault-head/index.d.ts +1 -1
- package/dist/with-commit/vault-head/strategy.d.ts +8 -1
- package/dist/with-commit/vault-head/verify.d.ts +1 -1
- package/dist/with-fork/snapshots/noydb-facade.d.ts +7 -0
- package/dist/with-formula/derivations/dispatch.d.ts +1 -1
- package/dist/with-formula/derivations/fanout-sidecar.d.ts +1 -1
- package/dist/with-formula/derivations/trigger-match.d.ts +8 -5
- package/dist/with-formula/materialized-views/emit-memo.d.ts +0 -2
- package/dist/with-lookup/embeddings/index.d.ts +1 -2
- package/dist/with-lookup/indexing/collection-facade.d.ts +2 -16
- package/dist/with-lookup/indexing/eager-indexes.d.ts +2 -1
- package/dist/with-lookup/search/collection-facade.d.ts +1 -13
- package/dist/with-party/broker/index.d.ts +4 -4
- package/dist/with-party/broker/seed.d.ts +25 -10
- package/dist/with-party/directory/user-envelope/storage.d.ts +1 -1
- package/dist/with-party/policy/noydb-facade.d.ts +1 -31
- package/dist/with-party/team/delegation.d.ts +59 -3
- package/dist/with-party/team/echo-secret.d.ts +2 -4
- package/dist/with-party/team/index.d.ts +1 -1
- package/dist/with-party/team/keyring.d.ts +2 -22
- package/dist/with-party/team/magic-link-grant.d.ts +12 -2
- package/dist/with-party/team/noydb-facade.d.ts +5 -0
- package/dist/with-party/team/recovery.d.ts +1 -1
- package/dist/with-party/team/reserved-secret-collections.d.ts +10 -8
- package/dist/with-party/team/roster-tag.d.ts +43 -2
- package/dist/with-party/team/rotate-recover.d.ts +1 -1
- package/dist/with-party/team/tiers.d.ts +36 -5
- package/dist/with-party/team/wrapped-deks.d.ts +1 -1
- package/dist/with-pod/index.d.ts +1 -1
- package/dist/with-shape/blobs/blob-compaction.d.ts +1 -1
- package/dist/with-shape/blobs/blob-intent.d.ts +1 -1
- package/dist/with-shape/blobs/blob-set.d.ts +25 -2
- package/dist/with-shape/blobs/legacy-sweep.d.ts +17 -1
- package/dist/with-shape/introspection/describe.d.ts +2 -3
- package/dist/with-shape/introspection/index.d.ts +1 -0
- package/dist/with-shape/introspection/types.d.ts +2 -1
- package/dist/with-shape/introspection/walk.d.ts +1 -1
- package/dist/with-shape/links/lazy-handle.d.ts +1 -1
- package/dist/with-shape/links/link-set.d.ts +1 -1
- package/dist/with-shape/manifest/derive.d.ts +1 -1
- package/dist/with-shape/manifest/storage.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/register.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/storage.d.ts +1 -1
- package/dist/with-shape/satellites/dead-filter.d.ts +1 -1
- package/dist/with-shape/satellites/declare.d.ts +1 -1
- package/dist/with-shape/satellites/marker.d.ts +1 -1
- package/dist/with-shape/satellites/post-register.d.ts +1 -1
- package/dist/with-shape/schema-update/fence.d.ts +7 -0
- package/dist/with-sync/engine.d.ts +30 -1
- package/dist/with-sync/presence.d.ts +5 -10
- package/dist/with-sync/reserved-mirror.d.ts +89 -0
- package/dist/with-sync/strategy.d.ts +7 -0
- package/dist/with-sync/tab-write-relay.d.ts +0 -10
- package/dist/withdraw-accessible-ZKPLZ66E.js +25 -0
- package/dist/withdraw-accessible-ZKPLZ66E.js.map +1 -0
- package/package.json +14 -5
- package/dist/api-GVYEKSJE.js +0 -19
- package/dist/backup-7TFRVFLH.js.map +0 -1
- package/dist/chunk-244VXYPG.js.map +0 -1
- package/dist/chunk-3ELRMVJK.js.map +0 -1
- package/dist/chunk-3F7GLNAE.js.map +0 -1
- package/dist/chunk-3H5KLDZN.js.map +0 -1
- package/dist/chunk-5FDLC6G7.js.map +0 -1
- package/dist/chunk-6B3VNR4P.js.map +0 -1
- package/dist/chunk-6LNL42F5.js.map +0 -1
- package/dist/chunk-6QSQQLSE.js +0 -95
- package/dist/chunk-6QSQQLSE.js.map +0 -1
- package/dist/chunk-7VCXZDA4.js.map +0 -1
- package/dist/chunk-ANWPSTZU.js.map +0 -1
- package/dist/chunk-BP6DARYA.js.map +0 -1
- package/dist/chunk-BUDAGWL5.js.map +0 -1
- package/dist/chunk-CKNGS5MH.js.map +0 -1
- package/dist/chunk-DC5QVPV7.js.map +0 -1
- package/dist/chunk-DE4DH2RZ.js +0 -29
- package/dist/chunk-DE4DH2RZ.js.map +0 -1
- package/dist/chunk-DF73H4UN.js.map +0 -1
- package/dist/chunk-EIPVYUEP.js.map +0 -1
- package/dist/chunk-ENAG3IY7.js.map +0 -1
- package/dist/chunk-FCKWQE2H.js.map +0 -1
- package/dist/chunk-FFWI7UH7.js.map +0 -1
- package/dist/chunk-FQ54DWUQ.js.map +0 -1
- package/dist/chunk-FQ5VRHIB.js.map +0 -1
- package/dist/chunk-GF5BZ7D4.js.map +0 -1
- package/dist/chunk-GHLTDZRS.js.map +0 -1
- package/dist/chunk-GYGLAVCX.js.map +0 -1
- package/dist/chunk-HBPPGWUM.js.map +0 -1
- package/dist/chunk-HK67PX4J.js.map +0 -1
- package/dist/chunk-HVSCEIYL.js.map +0 -1
- package/dist/chunk-IEX7NK2K.js +0 -125
- package/dist/chunk-IEX7NK2K.js.map +0 -1
- package/dist/chunk-ISZQJBML.js.map +0 -1
- package/dist/chunk-J6UOHJY5.js.map +0 -1
- package/dist/chunk-KJFW62P4.js.map +0 -1
- package/dist/chunk-L7DOS3TE.js.map +0 -1
- package/dist/chunk-LGNDFRYC.js.map +0 -1
- package/dist/chunk-LGRLME4M.js.map +0 -1
- package/dist/chunk-LP7BEXCT.js +0 -32
- package/dist/chunk-LP7BEXCT.js.map +0 -1
- package/dist/chunk-LQ4ZHOKP.js.map +0 -1
- package/dist/chunk-M522UYZ2.js.map +0 -1
- package/dist/chunk-M7NI3IWE.js.map +0 -1
- package/dist/chunk-MTL7MXGR.js.map +0 -1
- package/dist/chunk-N5DNADLQ.js.map +0 -1
- package/dist/chunk-NNARWO72.js.map +0 -1
- package/dist/chunk-NRT6QZQB.js.map +0 -1
- package/dist/chunk-NWHBJQAL.js.map +0 -1
- package/dist/chunk-ODVPTDPK.js.map +0 -1
- package/dist/chunk-PDCG6PR5.js.map +0 -1
- package/dist/chunk-PEOZ34EM.js.map +0 -1
- package/dist/chunk-PSIV7CJV.js.map +0 -1
- package/dist/chunk-QBBUZ3I3.js.map +0 -1
- package/dist/chunk-QOOUUR4A.js.map +0 -1
- package/dist/chunk-QWFHIOD2.js.map +0 -1
- package/dist/chunk-QWGU66MP.js.map +0 -1
- package/dist/chunk-RHVMZSUU.js.map +0 -1
- package/dist/chunk-S57HTZ6X.js.map +0 -1
- package/dist/chunk-SEE332EV.js +0 -66
- package/dist/chunk-SEE332EV.js.map +0 -1
- package/dist/chunk-SOIQ4MM4.js +0 -20
- package/dist/chunk-SOIQ4MM4.js.map +0 -1
- package/dist/chunk-SYVZW77S.js.map +0 -1
- package/dist/chunk-T2LBQ5DV.js.map +0 -1
- package/dist/chunk-UBSFPGVJ.js +0 -1
- package/dist/chunk-UD5EVGZ7.js.map +0 -1
- package/dist/chunk-UPD5NWI5.js.map +0 -1
- package/dist/chunk-UYB234ZR.js +0 -479
- package/dist/chunk-UYB234ZR.js.map +0 -1
- package/dist/chunk-VNPEWFPD.js.map +0 -1
- package/dist/chunk-WX5ADGTZ.js.map +0 -1
- package/dist/chunk-X4773RBR.js.map +0 -1
- package/dist/chunk-YNIUIERI.js.map +0 -1
- package/dist/chunk-YSK2CU2Q.js.map +0 -1
- package/dist/chunk-ZE4CHIED.js.map +0 -1
- package/dist/chunk-ZXABPVM6.js.map +0 -1
- package/dist/classified-marker-W3USLL5M.js.map +0 -1
- package/dist/collection-facade-QU6IJBN3.js +0 -48
- package/dist/dead-filter-U2UYKSZL.js.map +0 -1
- package/dist/delegation-S3AEPW2T.js.map +0 -1
- package/dist/derive-OX7F6TGG.js +0 -21
- package/dist/dispatch-RH4LHKBH.js.map +0 -1
- package/dist/executor-B6SRO2QS.js +0 -36
- package/dist/executor-BI5CHWRY.js +0 -8
- package/dist/executor-RBKM5W5K.js +0 -8
- package/dist/export-accessible-VMA3YM5V.js +0 -22
- package/dist/extract-partition-NF7PXGPP.js +0 -37
- package/dist/fanout-sidecar-OT6RYLOL.js.map +0 -1
- package/dist/find-LZMP26KF.js +0 -10
- package/dist/issue-IHARXWW5.js +0 -18
- package/dist/kernel/enclave/classify/compare.d.ts +0 -10
- package/dist/kernel/enclave/index.d.ts +0 -87
- package/dist/kernel/enclave/record-keys/lifecycle.d.ts +0 -124
- package/dist/kernel/enclave/record-keys/rekey-blob.d.ts +0 -88
- package/dist/kernel/enclave/record-keys/rekey.d.ts +0 -91
- package/dist/kernel/enclave/record-keys/sealed-slot.d.ts +0 -14
- package/dist/kernel/enclave/record-keys/sealed-slots.d.ts +0 -123
- package/dist/kernel/enclave/record-keys/sealing.d.ts +0 -70
- package/dist/liberate-GRLCZMW4.js +0 -24
- package/dist/link-set-JCMJ7ULP.js +0 -30
- package/dist/noydb-SWQJ3MZS.js +0 -97
- package/dist/pod-handle-WGDFB4C2.js.map +0 -1
- package/dist/post-register-SLSXIPBV.js.map +0 -1
- package/dist/register-F3OYE7MJ.js +0 -31
- package/dist/registry-CILQFXFK.js +0 -8
- package/dist/registry-XNNYQVKV.js +0 -8
- package/dist/registry-YCDZV3VW.js +0 -35
- package/dist/registry-ZGYS33TE.js +0 -24
- package/dist/request-withdrawal-Z5NC6TXT.js +0 -30
- package/dist/reveal-4BCKPEC2.js.map +0 -1
- package/dist/revoke-ZL62WC2D.js +0 -23
- package/dist/seed-4JS2RJ4A.js.map +0 -1
- package/dist/signer-MBZZMXTC.js +0 -24
- package/dist/stale-TJ3DYZMQ.js +0 -29
- package/dist/storage-SVMKRGCW.js +0 -22
- package/dist/store-coordination-provider-2O2VUHKW.js.map +0 -1
- package/dist/verify-RVT67IMH.js.map +0 -1
- package/dist/walk-HJ42EISE.js +0 -21
- package/dist/withdraw-accessible-5NZUPAVA.js +0 -27
- /package/dist/{api-GVYEKSJE.js.map → api-MSJXVYQG.js.map} +0 -0
- /package/dist/{collection-facade-QU6IJBN3.js.map → capsule/contract.js.map} +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/bidx.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/digest.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/vdig.d.ts +0 -0
- /package/dist/{kernel/enclave/classify → capsule/plumbing}/kofn.d.ts +0 -0
- /package/dist/{kernel/enclave/classify → capsule/plumbing}/normalize.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/plumbing}/record-aad.d.ts +0 -0
- /package/dist/{chunk-UBSFPGVJ.js.map → capsule-57BDK7LG.js.map} +0 -0
- /package/dist/{computed-TPFBX7U4.js.map → chunk-2DX4JCRI.js.map} +0 -0
- /package/dist/{chunk-ZSX4S5XB.js.map → chunk-2ZFD2UJC.js.map} +0 -0
- /package/dist/{chunk-HT2AHGQI.js.map → chunk-3Y5JLSXS.js.map} +0 -0
- /package/dist/{chunk-SI3V7D4G.js.map → chunk-4UIP3QNW.js.map} +0 -0
- /package/dist/{chunk-WNJ4AVGE.js.map → chunk-55P6OBB7.js.map} +0 -0
- /package/dist/{chunk-MKXXMNJH.js.map → chunk-5UUJE4FP.js.map} +0 -0
- /package/dist/{chunk-FW22ZCXT.js.map → chunk-6WS35E6X.js.map} +0 -0
- /package/dist/{chunk-6OWXYZK2.js.map → chunk-B65CC6Z6.js.map} +0 -0
- /package/dist/{chunk-F2TDU7MQ.js.map → chunk-BJH77UY2.js.map} +0 -0
- /package/dist/{chunk-BJ2IXQ5Q.js.map → chunk-BNFNQNEP.js.map} +0 -0
- /package/dist/{chunk-HLEK5VAN.js.map → chunk-BUE7R3B5.js.map} +0 -0
- /package/dist/{chunk-EOVMT6TB.js.map → chunk-C53ER7AG.js.map} +0 -0
- /package/dist/{chunk-K6W7BVZ6.js.map → chunk-CAD7N6HQ.js.map} +0 -0
- /package/dist/{chunk-5O7D6ZTW.js.map → chunk-DHU2AQ6T.js.map} +0 -0
- /package/dist/{chunk-IT22PWKV.js.map → chunk-ECGXA4LT.js.map} +0 -0
- /package/dist/{chunk-4MXI3ODD.js.map → chunk-GCUMOKTN.js.map} +0 -0
- /package/dist/{chunk-B6SJIBQK.js.map → chunk-GOJQ5DZA.js.map} +0 -0
- /package/dist/{chunk-TKUOEU2F.js.map → chunk-JSWKVZCR.js.map} +0 -0
- /package/dist/{chunk-X25NWUZB.js.map → chunk-L5A3KR7R.js.map} +0 -0
- /package/dist/{chunk-T52GX4SA.js.map → chunk-LGGIFKJP.js.map} +0 -0
- /package/dist/{chunk-ID6Z6E66.js.map → chunk-MQ7YWBQ5.js.map} +0 -0
- /package/dist/{chunk-FN5EBVTQ.js.map → chunk-NIXRB5BP.js.map} +0 -0
- /package/dist/{chunk-HBRLNOHL.js.map → chunk-NYJBYVBG.js.map} +0 -0
- /package/dist/{chunk-ZUVBC32X.js.map → chunk-OK57EATL.js.map} +0 -0
- /package/dist/{chunk-TOPYQ6GA.js.map → chunk-PCYPXLEX.js.map} +0 -0
- /package/dist/{chunk-VNNRUGMM.js.map → chunk-PGC35KXE.js.map} +0 -0
- /package/dist/{chunk-4I522ERM.js.map → chunk-PT2YCQVK.js.map} +0 -0
- /package/dist/{chunk-Z5HTYMMQ.js.map → chunk-PTJY5R3O.js.map} +0 -0
- /package/dist/{chunk-F24ZZTHQ.js.map → chunk-QGFEBNHO.js.map} +0 -0
- /package/dist/{chunk-A6IJU4TK.js.map → chunk-QGSNJD3B.js.map} +0 -0
- /package/dist/{chunk-BK2HHQGN.js.map → chunk-QSHATAXJ.js.map} +0 -0
- /package/dist/{chunk-JCN44NCY.js.map → chunk-RIZTZJX6.js.map} +0 -0
- /package/dist/{chunk-MVZ2TPVP.js.map → chunk-RNACRT5H.js.map} +0 -0
- /package/dist/{chunk-TROR3ALR.js.map → chunk-SFCD6OU7.js.map} +0 -0
- /package/dist/{chunk-I3JDRCMW.js.map → chunk-TZYTMZZY.js.map} +0 -0
- /package/dist/{chunk-AOWGXU6D.js.map → chunk-UAKY6E4N.js.map} +0 -0
- /package/dist/{chunk-3JWHAR6E.js.map → chunk-UNSQZSZP.js.map} +0 -0
- /package/dist/{chunk-6K7DPM7D.js.map → chunk-WFWFXDNS.js.map} +0 -0
- /package/dist/{chunk-CF5UU4S7.js.map → chunk-WHOKGHJ3.js.map} +0 -0
- /package/dist/{chunk-32YV3TJT.js.map → chunk-XXNWU5QZ.js.map} +0 -0
- /package/dist/{chunk-B57AFBY2.js.map → chunk-XXQ5XIYY.js.map} +0 -0
- /package/dist/{chunk-ORDURZBU.js.map → chunk-YFFMPZPY.js.map} +0 -0
- /package/dist/{chunk-MDWKM2XC.js.map → chunk-YKGJ44Z7.js.map} +0 -0
- /package/dist/{chunk-MLPHLJIQ.js.map → chunk-ZHQJAV6D.js.map} +0 -0
- /package/dist/{chunk-7JE7BDYJ.js.map → chunk-ZVSKSUGI.js.map} +0 -0
- /package/dist/{derive-OX7F6TGG.js.map → collection-facade-LZIF7GWD.js.map} +0 -0
- /package/dist/{enclave-27SMF6GF.js.map → computed-XMFTHAXV.js.map} +0 -0
- /package/dist/{executor-B6SRO2QS.js.map → derive-3YSIS36W.js.map} +0 -0
- /package/dist/{dispatch-3CQDJV5Q.js.map → dispatch-OFDA4WQV.js.map} +0 -0
- /package/dist/{executor-BI5CHWRY.js.map → executor-E6YDJ7YA.js.map} +0 -0
- /package/dist/{executor-RBKM5W5K.js.map → executor-NJX3YQQ4.js.map} +0 -0
- /package/dist/{export-accessible-VMA3YM5V.js.map → executor-WWM3DD4P.js.map} +0 -0
- /package/dist/{extract-partition-NF7PXGPP.js.map → export-accessible-RLHU5G4W.js.map} +0 -0
- /package/dist/{find-LZMP26KF.js.map → extract-partition-QII2EDCS.js.map} +0 -0
- /package/dist/{issue-IHARXWW5.js.map → find-6M7GYDUZ.js.map} +0 -0
- /package/dist/{ledger-KZPCMVZY.js.map → issue-LPEEEMPP.js.map} +0 -0
- /package/dist/{liberate-GRLCZMW4.js.map → ledger-MSJGWKGW.js.map} +0 -0
- /package/dist/{link-set-JCMJ7ULP.js.map → liberate-LEKDYKTC.js.map} +0 -0
- /package/dist/{managed-secret-S3MQ6SH6.js.map → link-set-QXXSPPHL.js.map} +0 -0
- /package/dist/{noydb-SWQJ3MZS.js.map → managed-secret-VSK7ANQI.js.map} +0 -0
- /package/dist/{migrate-cek-V7GKJZ7O.js.map → migrate-cek-GEBFYBDC.js.map} +0 -0
- /package/dist/{register-F3OYE7MJ.js.map → noydb-F2AUF6KL.js.map} +0 -0
- /package/dist/{registry-CILQFXFK.js.map → register-SN72QALV.js.map} +0 -0
- /package/dist/{registry-XNNYQVKV.js.map → registry-253FF7C6.js.map} +0 -0
- /package/dist/{registry-YCDZV3VW.js.map → registry-3AZWQTDT.js.map} +0 -0
- /package/dist/{registry-ZGYS33TE.js.map → registry-7UEBTHWG.js.map} +0 -0
- /package/dist/{request-withdrawal-Z5NC6TXT.js.map → registry-IVJ67NFQ.js.map} +0 -0
- /package/dist/{revoke-ZL62WC2D.js.map → request-withdrawal-UKVJZKX2.js.map} +0 -0
- /package/dist/{signer-MBZZMXTC.js.map → revoke-G2KXJQA5.js.map} +0 -0
- /package/dist/{stale-TJ3DYZMQ.js.map → signer-IUIYR3CX.js.map} +0 -0
- /package/dist/{storage-SVMKRGCW.js.map → stale-SKV33PBU.js.map} +0 -0
- /package/dist/{walk-HJ42EISE.js.map → storage-NPBYP2SM.js.map} +0 -0
- /package/dist/{withdraw-accessible-5NZUPAVA.js.map → walk-F4OLXI5H.js.map} +0 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computeBidxTarget
|
|
3
|
+
} from "../../chunk-JZ4EDEIP.js";
|
|
4
|
+
import {
|
|
5
|
+
aesCapsule,
|
|
6
|
+
checkCanary,
|
|
7
|
+
decrypt,
|
|
8
|
+
decryptBytes,
|
|
9
|
+
decryptBytesWithAAD,
|
|
10
|
+
decryptDeterministic,
|
|
11
|
+
deriveDeterministicKey,
|
|
12
|
+
deriveEchoKey,
|
|
13
|
+
deriveKey,
|
|
14
|
+
deriveSealedFieldKey,
|
|
15
|
+
deriveSealedFieldKeyFromCek,
|
|
16
|
+
deriveSecretKey,
|
|
17
|
+
deriveVdigSlotKey,
|
|
18
|
+
encrypt,
|
|
19
|
+
encryptBytes,
|
|
20
|
+
encryptBytesWithAAD,
|
|
21
|
+
encryptDeterministic,
|
|
22
|
+
exportDekSet,
|
|
23
|
+
exportRecipientPublicKeySpki,
|
|
24
|
+
generateDEK,
|
|
25
|
+
generateEphemeralKey,
|
|
26
|
+
generateRecipientKeyPair,
|
|
27
|
+
importCek,
|
|
28
|
+
importDekSet,
|
|
29
|
+
importRecipientPublicKeySpki,
|
|
30
|
+
importTransferKey,
|
|
31
|
+
mintCanary,
|
|
32
|
+
recipientUnwrap,
|
|
33
|
+
recipientWrap,
|
|
34
|
+
unwrapCek,
|
|
35
|
+
unwrapKey,
|
|
36
|
+
wrapCek,
|
|
37
|
+
wrapKey
|
|
38
|
+
} from "../../chunk-CB4467G3.js";
|
|
39
|
+
import {
|
|
40
|
+
deriveClassifyIndexKey,
|
|
41
|
+
deriveClassifyIndexSalt,
|
|
42
|
+
mintBidxTag,
|
|
43
|
+
pbkdf2VerifyDigest
|
|
44
|
+
} from "../../chunk-ABU6A4Z5.js";
|
|
45
|
+
import {
|
|
46
|
+
generateSigningKeyPair,
|
|
47
|
+
signBytes,
|
|
48
|
+
verifyBytes
|
|
49
|
+
} from "../../chunk-SPPOUJLN.js";
|
|
50
|
+
import {
|
|
51
|
+
evaluateKofN
|
|
52
|
+
} from "../../chunk-NH2UOV3B.js";
|
|
53
|
+
import {
|
|
54
|
+
buildDeleteMarker,
|
|
55
|
+
buildRecordAad,
|
|
56
|
+
buildRecordEnvelope,
|
|
57
|
+
buildSealedRecordEnvelope,
|
|
58
|
+
buildTombstone,
|
|
59
|
+
ctEqualTags,
|
|
60
|
+
envelopeBodyForHash,
|
|
61
|
+
envelopeBodySize,
|
|
62
|
+
hasPerRecordKey,
|
|
63
|
+
hasSealedBody,
|
|
64
|
+
isDeleteMarker,
|
|
65
|
+
isTombstone,
|
|
66
|
+
isTombstoneShape,
|
|
67
|
+
recordAadFor,
|
|
68
|
+
requireSealedBody,
|
|
69
|
+
sealedBodyArgs
|
|
70
|
+
} from "../../chunk-OM3SEDI4.js";
|
|
71
|
+
import {
|
|
72
|
+
base64ToBuffer,
|
|
73
|
+
bufferToBase64,
|
|
74
|
+
deriveBlobAddressKey,
|
|
75
|
+
derivePresenceKey,
|
|
76
|
+
derivePresenceTagKey,
|
|
77
|
+
encodeEchoParts,
|
|
78
|
+
generateIV,
|
|
79
|
+
generateRecoverySecret,
|
|
80
|
+
generateSalt,
|
|
81
|
+
hkdfAesGcmKey,
|
|
82
|
+
hmacSha256Hex,
|
|
83
|
+
hmacSignHex,
|
|
84
|
+
sha256Bytes,
|
|
85
|
+
sha256Hex
|
|
86
|
+
} from "../../chunk-PUBI455O.js";
|
|
87
|
+
import "../../chunk-2ELOCEXE.js";
|
|
88
|
+
import {
|
|
89
|
+
ValidationError
|
|
90
|
+
} from "../../chunk-VSUQI5Q6.js";
|
|
91
|
+
|
|
92
|
+
// src/capsule/enclave-aes/broker/proof.ts
|
|
93
|
+
var subtle = globalThis.crypto.subtle;
|
|
94
|
+
var BROKER_PROOF_DOMAIN = "noydb-broker-proof";
|
|
95
|
+
var BROKER_PROOF_VERSION = "noydb-broker-proof-v1";
|
|
96
|
+
var BROKER_PROOF_MEMBER_VERSION = "noydb-broker-proof-v2";
|
|
97
|
+
var DEFAULT_CHALLENGE_TTL_MS = 6e4;
|
|
98
|
+
function buildCanonical(vaultId, brokerId, parts) {
|
|
99
|
+
if (parts.member) {
|
|
100
|
+
return JSON.stringify([
|
|
101
|
+
BROKER_PROOF_MEMBER_VERSION,
|
|
102
|
+
vaultId,
|
|
103
|
+
parts.endpointOrigin,
|
|
104
|
+
brokerId,
|
|
105
|
+
parts.member.userId,
|
|
106
|
+
parts.member.role,
|
|
107
|
+
parts.profile ?? "",
|
|
108
|
+
parts.instancePid ?? "",
|
|
109
|
+
parts.challenge,
|
|
110
|
+
parts.expiresAt
|
|
111
|
+
]);
|
|
112
|
+
}
|
|
113
|
+
return JSON.stringify([
|
|
114
|
+
BROKER_PROOF_VERSION,
|
|
115
|
+
vaultId,
|
|
116
|
+
parts.endpointOrigin,
|
|
117
|
+
brokerId,
|
|
118
|
+
parts.profile ?? "",
|
|
119
|
+
parts.instancePid ?? "",
|
|
120
|
+
parts.challenge,
|
|
121
|
+
parts.expiresAt
|
|
122
|
+
]);
|
|
123
|
+
}
|
|
124
|
+
async function deriveBrokerProofBits(seed, vaultId, brokerId, memberUserId) {
|
|
125
|
+
const hkdfKey = await subtle.importKey("raw", seed, "HKDF", false, ["deriveBits"]);
|
|
126
|
+
const salt = new TextEncoder().encode(BROKER_PROOF_DOMAIN);
|
|
127
|
+
const info = new TextEncoder().encode(JSON.stringify(
|
|
128
|
+
memberUserId === void 0 ? [BROKER_PROOF_DOMAIN, vaultId, brokerId] : [BROKER_PROOF_DOMAIN, vaultId, brokerId, memberUserId]
|
|
129
|
+
));
|
|
130
|
+
const bits = await subtle.deriveBits({ name: "HKDF", hash: "SHA-256", salt, info }, hkdfKey, 256);
|
|
131
|
+
return new Uint8Array(bits);
|
|
132
|
+
}
|
|
133
|
+
async function deriveBrokerProofKey(seed, vaultId, brokerId, memberUserId) {
|
|
134
|
+
const proofBits = await deriveBrokerProofBits(seed, vaultId, brokerId, memberUserId);
|
|
135
|
+
try {
|
|
136
|
+
return await subtle.importKey("raw", proofBits, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
137
|
+
} finally {
|
|
138
|
+
proofBits.fill(0);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
async function computeBrokerProof(seed, vaultId, brokerId, canonicalParts) {
|
|
142
|
+
try {
|
|
143
|
+
if (canonicalParts.instancePid === "") {
|
|
144
|
+
throw new ValidationError(
|
|
145
|
+
"computeBrokerProof: instancePid must not be an empty string \u2014 omit the field entirely for 'no instance' (F7); '' would alias onto a registered instance."
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
const canonical = buildCanonical(vaultId, brokerId, canonicalParts);
|
|
149
|
+
const key = await deriveBrokerProofKey(seed, vaultId, brokerId, canonicalParts.member?.userId);
|
|
150
|
+
const mac = await subtle.sign("HMAC", key, new TextEncoder().encode(canonical));
|
|
151
|
+
return bufferToBase64(new Uint8Array(mac));
|
|
152
|
+
} finally {
|
|
153
|
+
seed.fill(0);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function issueChallenge(opts) {
|
|
157
|
+
const ttlMs = opts?.ttlMs ?? DEFAULT_CHALLENGE_TTL_MS;
|
|
158
|
+
const bytes = globalThis.crypto.getRandomValues(new Uint8Array(32));
|
|
159
|
+
return {
|
|
160
|
+
challenge: bufferToBase64(bytes),
|
|
161
|
+
expiresAt: new Date(Date.now() + ttlMs).toISOString()
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
async function verifyBrokerProof(args) {
|
|
165
|
+
const fresh = await args.consumeChallenge(args.challenge);
|
|
166
|
+
if (!fresh) return false;
|
|
167
|
+
if (args.instancePid === "") return false;
|
|
168
|
+
const canonical = buildCanonical(args.vaultId, args.brokerId, {
|
|
169
|
+
endpointOrigin: args.endpointOrigin,
|
|
170
|
+
member: args.member,
|
|
171
|
+
profile: args.profile,
|
|
172
|
+
instancePid: args.instancePid,
|
|
173
|
+
challenge: args.challenge,
|
|
174
|
+
expiresAt: args.expiresAt
|
|
175
|
+
});
|
|
176
|
+
const key = await subtle.importKey(
|
|
177
|
+
"raw",
|
|
178
|
+
args.registeredProofKey,
|
|
179
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
180
|
+
false,
|
|
181
|
+
["verify"]
|
|
182
|
+
);
|
|
183
|
+
const ok = await subtle.verify(
|
|
184
|
+
"HMAC",
|
|
185
|
+
key,
|
|
186
|
+
base64ToBuffer(args.proof),
|
|
187
|
+
new TextEncoder().encode(canonical)
|
|
188
|
+
);
|
|
189
|
+
if (!ok) return false;
|
|
190
|
+
return Date.now() < Date.parse(args.expiresAt);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// src/capsule/enclave-aes/capabilities.ts
|
|
194
|
+
function sealedSet(items) {
|
|
195
|
+
const set = new Set(items);
|
|
196
|
+
const refuse = () => {
|
|
197
|
+
throw new TypeError(
|
|
198
|
+
"capabilities() is immutable \u2014 a capsule's declared groups cannot be edited by a caller"
|
|
199
|
+
);
|
|
200
|
+
};
|
|
201
|
+
set.add = refuse;
|
|
202
|
+
set.delete = refuse;
|
|
203
|
+
set.clear = refuse;
|
|
204
|
+
return Object.freeze(set);
|
|
205
|
+
}
|
|
206
|
+
var ALL = sealedSet([
|
|
207
|
+
"authenticate",
|
|
208
|
+
"seal",
|
|
209
|
+
"cipher",
|
|
210
|
+
"digest",
|
|
211
|
+
"sign",
|
|
212
|
+
"codec",
|
|
213
|
+
"sealing",
|
|
214
|
+
"deterministic",
|
|
215
|
+
"classify",
|
|
216
|
+
// ⭐ ADDED 2026-09-16 (core#42). `enclave-aes` implements `wrapCek` and
|
|
217
|
+
// `unwrapCek`, so advertising the group is the truthful `capabilities()`.
|
|
218
|
+
// The nine-member set was the REFERENCE capsule under-reporting itself:
|
|
219
|
+
// "supports every group" was the documented intent above, and it had been
|
|
220
|
+
// untrue since `per-record-keys` existed as a refusable thing.
|
|
221
|
+
// ⛔ This is a published behaviour change — `capabilities()` returns one
|
|
222
|
+
// more member to any consumer that inspects it. Release-noted by name.
|
|
223
|
+
"per-record-keys"
|
|
224
|
+
]);
|
|
225
|
+
function capabilities() {
|
|
226
|
+
return ALL;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// src/capsule/enclave-aes/index.ts
|
|
230
|
+
var {
|
|
231
|
+
// envelope body
|
|
232
|
+
openEnvelopeJson,
|
|
233
|
+
writeEnvelopeBody,
|
|
234
|
+
verifyRecordIdentity,
|
|
235
|
+
// key lifecycle
|
|
236
|
+
resolveStableCek,
|
|
237
|
+
rewrapBodyToDek,
|
|
238
|
+
rewrapEnvelope,
|
|
239
|
+
applyRewrappedBody,
|
|
240
|
+
isRewrappedUnder,
|
|
241
|
+
// rekey
|
|
242
|
+
rekeyEnvelopeToDek,
|
|
243
|
+
rekeyEnvelopeIfNeeded,
|
|
244
|
+
envelopeOpensUnderAny,
|
|
245
|
+
rekeyBlobSet,
|
|
246
|
+
// record codec
|
|
247
|
+
RecordCodec,
|
|
248
|
+
// sealed slots — ONLY `makeReservedEnvelopes` is part of the frozen surface.
|
|
249
|
+
// The other seven are capsule-internal; destructuring the whole capsule here
|
|
250
|
+
// leaked them and widened the golden by 8 names. A surface is a contract, so
|
|
251
|
+
// the fix is to narrow the barrel, not to re-baseline the golden.
|
|
252
|
+
makeReservedEnvelopes,
|
|
253
|
+
// sealing
|
|
254
|
+
SEALED_CEK_NS,
|
|
255
|
+
sealRecordToHost,
|
|
256
|
+
revokeSealedRecord,
|
|
257
|
+
rotateRecordCek,
|
|
258
|
+
// deterministic
|
|
259
|
+
findByDet,
|
|
260
|
+
queryByDet
|
|
261
|
+
} = aesCapsule;
|
|
262
|
+
export {
|
|
263
|
+
RecordCodec,
|
|
264
|
+
SEALED_CEK_NS,
|
|
265
|
+
applyRewrappedBody,
|
|
266
|
+
base64ToBuffer,
|
|
267
|
+
bufferToBase64,
|
|
268
|
+
buildDeleteMarker,
|
|
269
|
+
buildRecordAad,
|
|
270
|
+
buildRecordEnvelope,
|
|
271
|
+
buildSealedRecordEnvelope,
|
|
272
|
+
buildTombstone,
|
|
273
|
+
capabilities,
|
|
274
|
+
checkCanary,
|
|
275
|
+
computeBidxTarget,
|
|
276
|
+
computeBrokerProof,
|
|
277
|
+
ctEqualTags,
|
|
278
|
+
decrypt,
|
|
279
|
+
decryptBytes,
|
|
280
|
+
decryptBytesWithAAD,
|
|
281
|
+
decryptDeterministic,
|
|
282
|
+
deriveBlobAddressKey,
|
|
283
|
+
deriveBrokerProofBits,
|
|
284
|
+
deriveBrokerProofKey,
|
|
285
|
+
deriveClassifyIndexKey,
|
|
286
|
+
deriveClassifyIndexSalt,
|
|
287
|
+
deriveDeterministicKey,
|
|
288
|
+
deriveEchoKey,
|
|
289
|
+
deriveKey,
|
|
290
|
+
derivePresenceKey,
|
|
291
|
+
derivePresenceTagKey,
|
|
292
|
+
deriveSealedFieldKey,
|
|
293
|
+
deriveSealedFieldKeyFromCek,
|
|
294
|
+
deriveSecretKey,
|
|
295
|
+
deriveVdigSlotKey,
|
|
296
|
+
encodeEchoParts,
|
|
297
|
+
encrypt,
|
|
298
|
+
encryptBytes,
|
|
299
|
+
encryptBytesWithAAD,
|
|
300
|
+
encryptDeterministic,
|
|
301
|
+
envelopeBodyForHash,
|
|
302
|
+
envelopeBodySize,
|
|
303
|
+
envelopeOpensUnderAny,
|
|
304
|
+
evaluateKofN,
|
|
305
|
+
exportDekSet,
|
|
306
|
+
exportRecipientPublicKeySpki,
|
|
307
|
+
findByDet,
|
|
308
|
+
generateDEK,
|
|
309
|
+
generateEphemeralKey,
|
|
310
|
+
generateIV,
|
|
311
|
+
generateRecipientKeyPair,
|
|
312
|
+
generateRecoverySecret,
|
|
313
|
+
generateSalt,
|
|
314
|
+
generateSigningKeyPair,
|
|
315
|
+
hasPerRecordKey,
|
|
316
|
+
hasSealedBody,
|
|
317
|
+
hkdfAesGcmKey,
|
|
318
|
+
hmacSha256Hex,
|
|
319
|
+
hmacSignHex,
|
|
320
|
+
importCek,
|
|
321
|
+
importDekSet,
|
|
322
|
+
importRecipientPublicKeySpki,
|
|
323
|
+
importTransferKey,
|
|
324
|
+
isDeleteMarker,
|
|
325
|
+
isRewrappedUnder,
|
|
326
|
+
isTombstone,
|
|
327
|
+
isTombstoneShape,
|
|
328
|
+
issueChallenge,
|
|
329
|
+
makeReservedEnvelopes,
|
|
330
|
+
mintBidxTag,
|
|
331
|
+
mintCanary,
|
|
332
|
+
openEnvelopeJson,
|
|
333
|
+
pbkdf2VerifyDigest,
|
|
334
|
+
queryByDet,
|
|
335
|
+
recipientUnwrap,
|
|
336
|
+
recipientWrap,
|
|
337
|
+
recordAadFor,
|
|
338
|
+
rekeyBlobSet,
|
|
339
|
+
rekeyEnvelopeIfNeeded,
|
|
340
|
+
rekeyEnvelopeToDek,
|
|
341
|
+
requireSealedBody,
|
|
342
|
+
resolveStableCek,
|
|
343
|
+
revokeSealedRecord,
|
|
344
|
+
rewrapBodyToDek,
|
|
345
|
+
rewrapEnvelope,
|
|
346
|
+
rotateRecordCek,
|
|
347
|
+
sealRecordToHost,
|
|
348
|
+
sealedBodyArgs,
|
|
349
|
+
sha256Bytes,
|
|
350
|
+
sha256Hex,
|
|
351
|
+
signBytes,
|
|
352
|
+
unwrapCek,
|
|
353
|
+
unwrapKey,
|
|
354
|
+
verifyBrokerProof,
|
|
355
|
+
verifyBytes,
|
|
356
|
+
verifyRecordIdentity,
|
|
357
|
+
wrapCek,
|
|
358
|
+
wrapKey,
|
|
359
|
+
writeEnvelopeBody
|
|
360
|
+
};
|
|
361
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/capsule/enclave-aes/broker/proof.ts","../../../src/capsule/enclave-aes/capabilities.ts","../../../src/capsule/enclave-aes/index.ts"],"sourcesContent":["/**\n * Credential-broker proof crypto (#479, credential-broker spec §3).\n *\n * The `_broker` seed (32 random bytes, decrypted from `_broker/<brokerId>` by\n * the party layer) is never transmitted. Instead, a **proof key** is\n * HKDF-derived from it, domain-separated per `(vaultId, brokerId)`, and the\n * derived bits are registered with the broker host once at enrol. Steady\n * state, the client re-derives the same key from the seed and signs a\n * **canonical** string binding the request's identity/context, so the broker\n * can verify a fresh HMAC on every mint without ever holding the seed itself.\n *\n * ## Derivation (spec §3, follow verbatim)\n *\n * ```\n * hkdf = importKey('raw', seed, 'HKDF', false, ['deriveBits'])\n * proofBits = deriveBits({ name:'HKDF', hash:'SHA-256',\n * salt: utf8(BROKER_PROOF_DOMAIN),\n * info: utf8(JSON.stringify([BROKER_PROOF_DOMAIN, vaultId, brokerId])) },\n * hkdf, 256)\n * proofKey = importKey('raw', proofBits, { name:'HMAC', hash:'SHA-256' }, false, ['sign'])\n * proof = base64(sign('HMAC', proofKey, utf8(canonical)))\n * ```\n *\n * `BROKER_PROOF_DOMAIN` is both the HKDF salt and the first `info` array\n * element (the injective-JSON-array convention `deriveClassifyIndexKey`\n * established — see `classify/bidx.ts`). `BROKER_PROOF_VERSION` is the\n * separate MAC version tag, the first element of the `canonical` array.\n *\n * ## Canonical (spec §2 step 3)\n *\n * `JSON.stringify([BROKER_PROOF_VERSION, vaultId, endpointOrigin, brokerId,\n * profile ?? '', instancePid ?? '', challenge, expiresAt])` — every binding\n * field folded into ONE MAC input:\n * - `vaultId` (V1), `challenge` (V3), `expiresAt` (V4) — verbatim strings,\n * never reparsed/reformatted (F8): a byte-identical ISO string is\n * required, so e.g. `Z` vs `+00:00` for the same instant fails.\n * - `profile ?? ''` (F1) — a proof captured at one profile cannot be\n * replayed at another.\n * - `endpointOrigin` (F4) — a proof cannot be relayed to a different broker\n * endpoint reusing the same `brokerId`.\n * - `instancePid ?? ''` (F7) — an EMPTY STRING `instancePid` is forbidden in\n * both {@link computeBrokerProof} and {@link verifyBrokerProof}: absent\n * (the field omitted) and `''` must stay distinguishable, or `?? ''`\n * would alias \"no instance\" onto a real registered instance.\n *\n * ## Verify order (spec §3, non-negotiable, F2/F6)\n *\n * {@link verifyBrokerProof} MUST, in this exact order: (1) burn the challenge\n * via `consumeChallenge` FIRST and short-circuit `false` before any MAC work\n * (F2 — burn-on-presentation, not burn-on-success); (2) recompute the\n * canonical and compare with `crypto.subtle.verify('HMAC', …)` — portable,\n * constant-time, never a manual byte compare or Node `timingSafeEqual` (F6);\n * (3) assert `now < expiresAt` — the client clock is never trusted, so this\n * check only matters once the MAC (which covers `expiresAt`) has verified.\n *\n * ## Zeroing (F5)\n *\n * `seed` and the transient HKDF output are raw, durable secret material —\n * the `recovery.ts:276-307` `try{}finally{secret.fill(0)}` discipline, not\n * the ephemeral-CEK happy-path zeroing elsewhere. {@link computeBrokerProof}\n * zeroes the `seed` argument in a `finally` on every path including a throw;\n * {@link deriveBrokerProofKey} zeroes its own transient HKDF-output bytes the\n * same way. {@link deriveBrokerProofBits} does not zero `seed` — it exists\n * so the party layer can register the raw bits at one-time enrol (the value\n * that must survive the call to be base64-encoded and POSTed).\n *\n * @module\n */\nimport type { EnclaveKey } from '../crypto.js'\nimport { base64ToBuffer, bufferToBase64 } from '../../plumbing/digest.js'\nimport { ValidationError } from '../../../kernel/errors.js'\n\nconst subtle = globalThis.crypto.subtle\n\n/** HKDF salt domain for the broker proof key — also the first `info` array element. */\nexport const BROKER_PROOF_DOMAIN = 'noydb-broker-proof'\n\n/** MAC version tag — the first element of the `canonical` array signed/verified (admin shared seed). */\nexport const BROKER_PROOF_VERSION = 'noydb-broker-proof-v1'\n\n/**\n * MAC version tag for a MEMBER proof (core#73): the canonical additionally\n * binds `userId` and `role` right after `brokerId`, so the host verifies WHO\n * proved and at WHICH role with the key it registered for that member — a\n * member cannot claim another user's key or a wider role than the roster\n * granted. Selected by the presence of `member` on the canonical parts; the\n * admin canonical (v1) is byte-for-byte unchanged.\n */\nconst BROKER_PROOF_MEMBER_VERSION = 'noydb-broker-proof-v2'\n\n/** The member identity bound into a v2 canonical and into the HKDF info (core#73). */\nexport interface BrokerMemberIdentity {\n readonly userId: string\n readonly role: string\n}\n\n/** Default challenge TTL (spec §2 step 2: \"TTL ≤ 60 s\"). */\nconst DEFAULT_CHALLENGE_TTL_MS = 60_000\n\n/** The canonical-binding fields a client supplies alongside `vaultId`/`brokerId` (spec §2 step 3). */\nexport interface BrokerProofCanonicalParts {\n readonly endpointOrigin: string\n /** Present ⇒ a member proof (canonical v2, member-scoped HKDF); absent ⇒ the admin shared seed (v1). */\n readonly member?: BrokerMemberIdentity | undefined\n readonly profile?: string | undefined\n readonly instancePid?: string | undefined\n readonly challenge: string\n readonly expiresAt: string\n}\n\n/** A freshly-minted, server-random single-use challenge (spec §2 step 2). */\nexport interface IssuedChallenge {\n readonly challenge: string\n readonly expiresAt: string\n}\n\n/** Arguments the broker host passes to verify a submitted proof (spec §3). */\nexport interface VerifyBrokerProofArgs {\n /**\n * Atomically test-and-delete the challenge, returning whether it was still\n * fresh (unconsumed and unexpired-from-the-store's-perspective). MUST burn\n * on presentation, not on successful verification (F2).\n */\n readonly consumeChallenge: (challenge: string) => Promise<boolean>\n /** The registered proof key's raw bytes, already KMS-unwrapped by the host (§7). */\n readonly registeredProofKey: Uint8Array\n readonly vaultId: string\n readonly endpointOrigin: string\n readonly brokerId: string\n /** The member the `registeredProofKey` was registered FOR; the host supplies its own record, never the client's claim. */\n readonly member?: BrokerMemberIdentity | undefined\n readonly profile?: string | undefined\n readonly instancePid?: string | undefined\n readonly challenge: string\n readonly expiresAt: string\n /** base64(HMAC-SHA-256(proofKey, canonical)), as submitted by the client. */\n readonly proof: string\n}\n\n/** Build the canonical MAC input verbatim — never reparses/reformats a field (F8). */\nfunction buildCanonical(vaultId: string, brokerId: string, parts: BrokerProofCanonicalParts): string {\n if (parts.member) {\n return JSON.stringify([\n BROKER_PROOF_MEMBER_VERSION,\n vaultId,\n parts.endpointOrigin,\n brokerId,\n parts.member.userId,\n parts.member.role,\n parts.profile ?? '',\n parts.instancePid ?? '',\n parts.challenge,\n parts.expiresAt,\n ])\n }\n return JSON.stringify([\n BROKER_PROOF_VERSION,\n vaultId,\n parts.endpointOrigin,\n brokerId,\n parts.profile ?? '',\n parts.instancePid ?? '',\n parts.challenge,\n parts.expiresAt,\n ])\n}\n\n/**\n * The HKDF step: derive the 256-bit proof bits from the `_broker` seed,\n * domain-separated per `(vaultId, brokerId)`. Returns the raw bits — the\n * value registered with the broker host once at enrol (spec §2 step 2/3).\n * Does not mutate or zero `seed`; the caller owns the seed's lifecycle.\n */\nexport async function deriveBrokerProofBits(\n seed: Uint8Array,\n vaultId: string,\n brokerId: string,\n memberUserId?: string,\n): Promise<Uint8Array> {\n const hkdfKey = await subtle.importKey('raw', seed as BufferSource, 'HKDF', false, ['deriveBits'])\n const salt = new TextEncoder().encode(BROKER_PROOF_DOMAIN)\n // core#73: a member key is domain-separated per user as well — a fourth\n // element, so an admin info tag and a member info tag can never collide.\n const info = new TextEncoder().encode(JSON.stringify(\n memberUserId === undefined ? [BROKER_PROOF_DOMAIN, vaultId, brokerId] : [BROKER_PROOF_DOMAIN, vaultId, brokerId, memberUserId],\n ))\n const bits = await subtle.deriveBits({ name: 'HKDF', hash: 'SHA-256', salt, info }, hkdfKey, 256)\n return new Uint8Array(bits)\n}\n\n/**\n * Derive the steady-state, non-extractable `['sign']` HMAC proof key from\n * the `_broker` seed. Zeroes the transient HKDF-output bytes in a `finally`\n * once the key has been imported (F5) — the raw bits never leave this\n * function in usable form after import.\n */\nexport async function deriveBrokerProofKey(\n seed: Uint8Array,\n vaultId: string,\n brokerId: string,\n memberUserId?: string,\n): Promise<EnclaveKey> {\n const proofBits = await deriveBrokerProofBits(seed, vaultId, brokerId, memberUserId)\n try {\n return await subtle.importKey('raw', proofBits as BufferSource, { name: 'HMAC', hash: 'SHA-256' }, false, ['sign'])\n } finally {\n proofBits.fill(0)\n }\n}\n\n/**\n * Compose derive + sign for the client: re-derive the proof key from the\n * seed and sign the canonical over `canonicalParts` (spec §2 step 3).\n *\n * Rejects an empty-string `instancePid` (F7 — absent is fine, `''` is not).\n * Zeroes the `seed` argument in a `finally` on EVERY path including a throw\n * (F5, durable-secret discipline) — the transient HKDF bits are zeroed one\n * layer down, inside {@link deriveBrokerProofKey}.\n */\nexport async function computeBrokerProof(\n seed: Uint8Array,\n vaultId: string,\n brokerId: string,\n canonicalParts: BrokerProofCanonicalParts,\n): Promise<string> {\n try {\n if (canonicalParts.instancePid === '') {\n throw new ValidationError(\n \"computeBrokerProof: instancePid must not be an empty string — omit the field entirely for \" +\n \"'no instance' (F7); '' would alias onto a registered instance.\",\n )\n }\n const canonical = buildCanonical(vaultId, brokerId, canonicalParts)\n const key = await deriveBrokerProofKey(seed, vaultId, brokerId, canonicalParts.member?.userId)\n const mac = await subtle.sign('HMAC', key, new TextEncoder().encode(canonical) as BufferSource)\n return bufferToBase64(new Uint8Array(mac))\n } finally {\n seed.fill(0)\n }\n}\n\n/**\n * Host-side nonce mint: 32 random bytes, base64-encoded, plus an ISO\n * `expiresAt` at most `ttlMs` (default 60 s) in the future. The caller\n * (the broker host) persists both returned strings **verbatim** and MACs\n * those exact bytes on verify — never a reparsed/reformatted copy (F8).\n */\nexport function issueChallenge(opts?: { ttlMs?: number }): IssuedChallenge {\n const ttlMs = opts?.ttlMs ?? DEFAULT_CHALLENGE_TTL_MS\n const bytes = globalThis.crypto.getRandomValues(new Uint8Array(32))\n return {\n challenge: bufferToBase64(bytes),\n expiresAt: new Date(Date.now() + ttlMs).toISOString(),\n }\n}\n\n/**\n * Verify a submitted broker proof. Order is NON-NEGOTIABLE (spec §3):\n *\n * 1. `await consumeChallenge(challenge)` FIRST — burn-and-check-fresh; a\n * not-fresh (already-consumed or unknown) challenge short-circuits to\n * `false` before any MAC work (F2).\n * 2. Empty-string `instancePid` is rejected (F7), then the canonical is\n * recomputed over the verbatim `endpointOrigin`/`brokerId`/`profile`/\n * `instancePid`/`challenge`/`expiresAt` and compared via\n * `crypto.subtle.verify('HMAC', …)` — portable, constant-time, never a\n * manual compare or Node `timingSafeEqual` (F6).\n * 3. `now < expiresAt` — the client clock is never trusted; `expiresAt`\n * rides inside the already-verified MAC (F4/F8).\n */\nexport async function verifyBrokerProof(args: VerifyBrokerProofArgs): Promise<boolean> {\n const fresh = await args.consumeChallenge(args.challenge)\n if (!fresh) return false\n\n if (args.instancePid === '') return false\n\n const canonical = buildCanonical(args.vaultId, args.brokerId, {\n endpointOrigin: args.endpointOrigin,\n member: args.member,\n profile: args.profile,\n instancePid: args.instancePid,\n challenge: args.challenge,\n expiresAt: args.expiresAt,\n })\n const key = await subtle.importKey(\n 'raw',\n args.registeredProofKey as BufferSource,\n { name: 'HMAC', hash: 'SHA-256' },\n false,\n ['verify'],\n )\n const ok = await subtle.verify(\n 'HMAC',\n key,\n base64ToBuffer(args.proof) as BufferSource,\n new TextEncoder().encode(canonical) as BufferSource,\n )\n if (!ok) return false\n\n return Date.now() < Date.parse(args.expiresAt)\n}\n","import type { CapsuleGroup } from '../contract.js'\n\n/**\n * `enclave-aes` supports every group. It is the REFERENCE capsule — the\n * behaviour every other implementation is compared against, and the one hub\n * ships so that `npm install @noy-db/hub` alone is a working noy-db.\n *\n * An `exclave-*` refuses `authenticate` and `seal` (no secret, no key\n * hierarchy — the store's own IAM is the authority) and may refuse the\n * optional groups. That asymmetry is what the prefix means, and the\n * conformance suite asserts it from the package name rather than trusting a\n * declaration.\n *\n * Frozen so a caller cannot edit what a capsule claims to support: a mutable\n * set would let a service \"enable\" a group by adding to it, which is exactly\n * the confidently-wrong failure the typed refusal exists to prevent.\n */\n/**\n * ⛔ `Object.freeze` does NOT make a Set immutable — it guards own properties,\n * not internal slots, so `frozen.add(x)` still succeeds. Measured 2026-09-12,\n * against a test that asserted otherwise and failed. The mutators are replaced\n * so the refusal is real at runtime, not just in the type.\n *\n * Why it has to be real: a caller holding a mutable capability set can \"enable\"\n * a group the capsule does not implement, and the next thing that happens is a\n * primitive being called on a capsule that has none. `ReadonlySet` alone is a\n * compile-time claim, and a JS consumer never sees it.\n */\nfunction sealedSet<T>(items: readonly T[]): ReadonlySet<T> {\n const set = new Set<T>(items)\n const refuse = (): never => {\n throw new TypeError(\n 'capabilities() is immutable — a capsule\\'s declared groups cannot be edited by a caller',\n )\n }\n set.add = refuse as never\n set.delete = refuse as never\n set.clear = refuse as never\n return Object.freeze(set)\n}\n\nconst ALL: ReadonlySet<CapsuleGroup> = sealedSet<CapsuleGroup>([\n 'authenticate',\n 'seal',\n 'cipher',\n 'digest',\n 'sign',\n 'codec',\n 'sealing',\n 'deterministic',\n 'classify',\n // ⭐ ADDED 2026-09-16 (core#42). `enclave-aes` implements `wrapCek` and\n // `unwrapCek`, so advertising the group is the truthful `capabilities()`.\n // The nine-member set was the REFERENCE capsule under-reporting itself:\n // \"supports every group\" was the documented intent above, and it had been\n // untrue since `per-record-keys` existed as a refusable thing.\n // ⛔ This is a published behaviour change — `capabilities()` returns one\n // more member to any consumer that inspects it. Release-noted by name.\n 'per-record-keys',\n])\n\nexport function capabilities(): ReadonlySet<CapsuleGroup> {\n return ALL\n}\n","/**\n * **capsule/enclave-aes** — the hub's crypto interior, behind one door.\n *\n * This barrel is **the fork-swap contract**: a sister project that wants a\n * different crypto engine (a different KDF, a hardware-backed keystore, a\n * post-quantum wrap algorithm, …) replaces the entire `capsule/enclave-aes/`\n * folder wholesale and only has to honor the exports below. Nothing outside\n * `capsule/enclave-aes/**` may deep-import `crypto.js` or `record-keys/*` directly\n * — `scripts/check-architecture.mjs`'s `enclave-barrel-only` check enforces\n * that mechanically. Import sites inside `capsule/enclave-aes/**` keep their\n * existing relative imports; this door is for everyone else.\n *\n * The export list is the OBSERVED contract — exactly the symbols consumed\n * from outside this folder today — grouped by the module that defines them:\n *\n * - key type — `crypto.ts`: `EnclaveKey`, the opaque key type every\n * barrel-facing signature traffics in (`= CryptoKey` in\n * noy-db's reference enclave; a fork redefines it to its\n * own key representation — see the type's own doc for\n * the fork contract).\n * - crypto ops — `crypto.ts`: AES-256-GCM encrypt/decrypt (+ bytes, AAD,\n * deterministic variants), SHA-256 / HMAC-SHA-256 hashing.\n * - key lifecycle — `crypto.ts` + `record-keys/lifecycle.ts`: KEK/DEK\n * derivation, AES-KW wrap/unwrap, per-record CEK\n * wrap/unwrap/import + resolution/re-wrap, HKDF-derived\n * presence/sealed-field keys, base64 helpers.\n * - record codec — `record-keys/record-codec.ts`: the per-record\n * encode/decode engine.\n * - sealing — `record-keys/sealing.ts`: the sealed-record grantor\n * primitives (seal/revoke/rotate to an `at-*` host).\n * - deterministic — `record-keys/deterministic.ts`: blind-equality lookup\n * over deterministically-encrypted fields.\n * - tombstone — `record-keys/tombstone.ts`: the erased-record residue.\n * - envelope body — `record-keys/envelope-body.ts`: the C1 protected-body\n * access contract (`openEnvelopeJson`,\n * `writeEnvelopeBody`, `hasPerRecordKey`,\n * `hasSealedBody`, `envelopeBodyForHash`) — the\n * sanctioned door onto\n * `_iv`/`_data`/`_cek`/`_sealed` for everyone outside\n * this folder.\n * - reserved envelopes — `plumbing/sealed-slots.ts`: `makeReservedEnvelopes`,\n * the whole-envelope encrypt/decrypt door scoped to a\n * declared collection-name prefix (e.g. `_dict_`) —\n * `kernel/vault.ts` binds it for `DictionaryHandle`\n * (#629 Task 4).\n *\n * Additive changes only — removing or renaming an export here is breaking\n * for any fork. Frozen by `__tests__/enclave-surface-golden.test.ts`.\n *\n * **Refusal contract:** the barrel above is frozen — every symbol must\n * exist in any fork — but the optional groups (sealing, deterministic,\n * per-record-key lifecycle) MAY throw `EnclaveNotSupportedError` instead\n * of implementing the reference behavior. The core groups (crypto ops,\n * record codec, tombstone) MUST NOT throw it — they are load-bearing for\n * every consumer regardless of which enclave is wired in. noy-db's own\n * enclave supports every group, so it never throws this error.\n */\n\nimport { aesCapsule } from './bound.js'\n\n// ─── key type ──────────────────────────────────────────────────────\nexport type { EnclaveKey, EncryptResult } from './crypto.js'\n\n// ─── crypto ops ────────────────────────────────────────────────────\nexport {\n encrypt,\n decrypt,\n encryptBytes,\n decryptBytes,\n encryptBytesWithAAD,\n decryptBytesWithAAD,\n encryptDeterministic,\n decryptDeterministic,\n} from './crypto.js'\n\n// ─── key lifecycle ─────────────────────────────────────────────────\nexport {\n deriveKey,\n deriveSecretKey,\n generateDEK,\n generateEphemeralKey,\n importTransferKey,\n exportDekSet,\n importDekSet,\n wrapKey,\n unwrapKey,\n mintCanary,\n checkCanary,\n deriveDeterministicKey,\n deriveSealedFieldKey,\n deriveSealedFieldKeyFromCek,\n wrapCek,\n unwrapCek,\n importCek,\n deriveEchoKey,\n} from './crypto.js'\nexport type { SecretKeyUsage } from './crypto.js'\n// ─── shared plumbing ───────────────────────────────────────────────\n//\n// Everything from here to the end of this block used to be twelve modules\n// under `./record-keys/`. They now live once in `../plumbing/`, and this\n// capsule is one of two callers of `makeCapsule()`.\n//\n// The split below is not cosmetic. The cipher-FREE half is re-exported\n// straight from its module: it inspects envelope fields and derives hash\n// input, so there is nothing to bind and every capsule gets the identical\n// function. The cipher-BOUND half is destructured off `aesCapsule`, which is\n// `makeCapsule(aesPrimitives)` — one binding for the whole capsule, so a value\n// exported here and a value used inside `classify/**` are the SAME object.\nexport {\n buildRecordAad,\n recordAadFor,\n buildRecordEnvelope,\n isTombstone,\n isTombstoneShape,\n buildTombstone,\n isDeleteMarker,\n buildDeleteMarker,\n requireSealedBody,\n sealedBodyArgs,\n envelopeBodySize,\n hasPerRecordKey,\n envelopeBodyForHash,\n hasSealedBody,\n} from '../plumbing/index.js'\n// ─── digest group ──────────────────────────────────────────────────\n// Shared, not AES-specific: the seam design marks `digest` \"as today\" for every\n// capsule. Re-exported here so the barrel's surface is unchanged.\nexport {\n sha256Hex,\n sha256Bytes,\n hmacSha256Hex,\n hmacSignHex,\n hkdfAesGcmKey,\n deriveBlobAddressKey,\n derivePresenceKey,\n derivePresenceTagKey,\n generateIV,\n generateSalt,\n generateRecoverySecret,\n bufferToBase64,\n base64ToBuffer,\n encodeEchoParts,\n} from '../plumbing/digest.js'\nexport type { EchoSecretParts } from '../plumbing/digest.js'\nexport type { RecordIdentity, RecordRef } from '../plumbing/index.js'\nimport type { RecordCodecBase } from '../plumbing/record-codec.js'\n/**\n * `RecordCodec` is a VALUE (the capsule-bound subclass, destructured below) and\n * a TYPE (the module-level generic base). A type ALIAS can coexist with a value\n * of the same name; a `export type { RecordCodec }` RE-EXPORT cannot, which is\n * what `TS2323: Cannot redeclare exported variable` was saying.\n */\nexport type RecordCodec<T = Record<string, unknown>> = RecordCodecBase<T>\nexport { buildSealedRecordEnvelope } from '../plumbing/record-envelope.js'\nexport type { RecordEnvelopeBody } from '../plumbing/record-envelope.js'\nexport type { RewrappedBody } from '../plumbing/lifecycle.js'\nexport type { SealedShredSlot } from '../plumbing/record-codec.js'\nexport type { SealingContext } from '../plumbing/sealing.js'\nexport type { DeterministicContext } from '../plumbing/deterministic.js'\n\nexport const {\n // envelope body\n openEnvelopeJson,\n writeEnvelopeBody,\n verifyRecordIdentity,\n // key lifecycle\n resolveStableCek,\n rewrapBodyToDek,\n rewrapEnvelope,\n applyRewrappedBody,\n isRewrappedUnder,\n // rekey\n rekeyEnvelopeToDek,\n rekeyEnvelopeIfNeeded,\n envelopeOpensUnderAny,\n rekeyBlobSet,\n // record codec\n RecordCodec,\n // sealed slots — ONLY `makeReservedEnvelopes` is part of the frozen surface.\n // The other seven are capsule-internal; destructuring the whole capsule here\n // leaked them and widened the golden by 8 names. A surface is a contract, so\n // the fix is to narrow the barrel, not to re-baseline the golden.\n makeReservedEnvelopes,\n // sealing\n SEALED_CEK_NS,\n sealRecordToHost,\n revokeSealedRecord,\n rotateRecordCek,\n // deterministic\n findByDet,\n queryByDet,\n} = aesCapsule\n\n// ─── reserved envelopes (ViaCryptoCtx.reservedEnvelopes capability) ──\n\n// ─── classify (stage-2 verify oracle primitives) ────────────────────\n// ADDITIVE per Enclave Contract v1. A fork must provide these four; the\n// verify/matchGroup orchestration (classify/verify.ts) sits behind the\n// with-shape dynamic-import seam and is not part of the fork contract.\nexport { deriveVdigSlotKey } from './classify/vdig.js'\nexport { pbkdf2VerifyDigest } from './classify/digest.js'\nexport { ctEqualTags } from '../plumbing/ct-equal.js'\nexport { evaluateKofN } from '../plumbing/kofn.js'\n\n// ─── classify (slice-2b equatable blind index) ──────────────────────\n// ADDITIVE per Enclave Contract v1. A fork must provide these four; the\n// findByDigest orchestration (collection.ts) sits behind the with-shape\n// dynamic-import seam and is not part of the fork contract.\nexport { deriveClassifyIndexKey, deriveClassifyIndexSalt, mintBidxTag } from './classify/bidx.js'\nexport { computeBidxTarget } from './classify/find.js'\n\n// ─── broker (proof derivation + challenge/verify, #479 slice 2) ─────\n// ADDITIVE per Enclave Contract v1. A fork must provide these five; the\n// seed lifecycle + network/cache orchestration (with-party/broker/**) sits\n// behind its own dynamic-import seam and is not part of the fork contract.\nexport {\n deriveBrokerProofBits,\n deriveBrokerProofKey,\n computeBrokerProof,\n issueChallenge,\n verifyBrokerProof,\n} from './broker/proof.js'\nexport type { BrokerProofCanonicalParts, BrokerMemberIdentity, VerifyBrokerProofArgs, IssuedChallenge } from './broker/proof.js'\n\n// ─── sign ─────────────────────────────────────────────────────────────\nexport { generateSigningKeyPair, signBytes, verifyBytes } from '../plumbing/sign.js'\n\n// ─── recipient sealing ────────────────────────────────────────────────\nexport type { EnclaveKeyPair } from './crypto.js'\nexport {\n generateRecipientKeyPair,\n exportRecipientPublicKeySpki,\n importRecipientPublicKeySpki,\n recipientWrap,\n recipientUnwrap,\n} from './crypto.js'\n\n// ─── capabilities ─────────────────────────────────────────────────────\n// What THIS capsule supports. Part of the contract every capsule implements,\n// not an enclave-aes detail — an alternative declares its own, and a service\n// asserts against it at createNoydb() rather than failing on first write.\nexport { capabilities } from './capabilities.js'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,IAAM,SAAS,WAAW,OAAO;AAG1B,IAAM,sBAAsB;AAG5B,IAAM,uBAAuB;AAUpC,IAAM,8BAA8B;AASpC,IAAM,2BAA2B;AA2CjC,SAAS,eAAe,SAAiB,UAAkB,OAA0C;AACnG,MAAI,MAAM,QAAQ;AAChB,WAAO,KAAK,UAAU;AAAA,MACpB;AAAA,MACA;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA,MAAM,OAAO;AAAA,MACb,MAAM,OAAO;AAAA,MACb,MAAM,WAAW;AAAA,MACjB,MAAM,eAAe;AAAA,MACrB,MAAM;AAAA,MACN,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AACA,SAAO,KAAK,UAAU;AAAA,IACpB;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA,MAAM,WAAW;AAAA,IACjB,MAAM,eAAe;AAAA,IACrB,MAAM;AAAA,IACN,MAAM;AAAA,EACR,CAAC;AACH;AAQA,eAAsB,sBACpB,MACA,SACA,UACA,cACqB;AACrB,QAAM,UAAU,MAAM,OAAO,UAAU,OAAO,MAAsB,QAAQ,OAAO,CAAC,YAAY,CAAC;AACjG,QAAM,OAAO,IAAI,YAAY,EAAE,OAAO,mBAAmB;AAGzD,QAAM,OAAO,IAAI,YAAY,EAAE,OAAO,KAAK;AAAA,IACzC,iBAAiB,SAAY,CAAC,qBAAqB,SAAS,QAAQ,IAAI,CAAC,qBAAqB,SAAS,UAAU,YAAY;AAAA,EAC/H,CAAC;AACD,QAAM,OAAO,MAAM,OAAO,WAAW,EAAE,MAAM,QAAQ,MAAM,WAAW,MAAM,KAAK,GAAG,SAAS,GAAG;AAChG,SAAO,IAAI,WAAW,IAAI;AAC5B;AAQA,eAAsB,qBACpB,MACA,SACA,UACA,cACqB;AACrB,QAAM,YAAY,MAAM,sBAAsB,MAAM,SAAS,UAAU,YAAY;AACnF,MAAI;AACF,WAAO,MAAM,OAAO,UAAU,OAAO,WAA2B,EAAE,MAAM,QAAQ,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;AAAA,EACpH,UAAE;AACA,cAAU,KAAK,CAAC;AAAA,EAClB;AACF;AAWA,eAAsB,mBACpB,MACA,SACA,UACA,gBACiB;AACjB,MAAI;AACF,QAAI,eAAe,gBAAgB,IAAI;AACrC,YAAM,IAAI;AAAA,QACR;AAAA,MAEF;AAAA,IACF;AACA,UAAM,YAAY,eAAe,SAAS,UAAU,cAAc;AAClE,UAAM,MAAM,MAAM,qBAAqB,MAAM,SAAS,UAAU,eAAe,QAAQ,MAAM;AAC7F,UAAM,MAAM,MAAM,OAAO,KAAK,QAAQ,KAAK,IAAI,YAAY,EAAE,OAAO,SAAS,CAAiB;AAC9F,WAAO,eAAe,IAAI,WAAW,GAAG,CAAC;AAAA,EAC3C,UAAE;AACA,SAAK,KAAK,CAAC;AAAA,EACb;AACF;AAQO,SAAS,eAAe,MAA4C;AACzE,QAAM,QAAQ,MAAM,SAAS;AAC7B,QAAM,QAAQ,WAAW,OAAO,gBAAgB,IAAI,WAAW,EAAE,CAAC;AAClE,SAAO;AAAA,IACL,WAAW,eAAe,KAAK;AAAA,IAC/B,WAAW,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,EAAE,YAAY;AAAA,EACtD;AACF;AAgBA,eAAsB,kBAAkB,MAA+C;AACrF,QAAM,QAAQ,MAAM,KAAK,iBAAiB,KAAK,SAAS;AACxD,MAAI,CAAC,MAAO,QAAO;AAEnB,MAAI,KAAK,gBAAgB,GAAI,QAAO;AAEpC,QAAM,YAAY,eAAe,KAAK,SAAS,KAAK,UAAU;AAAA,IAC5D,gBAAgB,KAAK;AAAA,IACrB,QAAQ,KAAK;AAAA,IACb,SAAS,KAAK;AAAA,IACd,aAAa,KAAK;AAAA,IAClB,WAAW,KAAK;AAAA,IAChB,WAAW,KAAK;AAAA,EAClB,CAAC;AACD,QAAM,MAAM,MAAM,OAAO;AAAA,IACvB;AAAA,IACA,KAAK;AAAA,IACL,EAAE,MAAM,QAAQ,MAAM,UAAU;AAAA,IAChC;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,KAAK,MAAM,OAAO;AAAA,IACtB;AAAA,IACA;AAAA,IACA,eAAe,KAAK,KAAK;AAAA,IACzB,IAAI,YAAY,EAAE,OAAO,SAAS;AAAA,EACpC;AACA,MAAI,CAAC,GAAI,QAAO;AAEhB,SAAO,KAAK,IAAI,IAAI,KAAK,MAAM,KAAK,SAAS;AAC/C;;;AChRA,SAAS,UAAa,OAAqC;AACzD,QAAM,MAAM,IAAI,IAAO,KAAK;AAC5B,QAAM,SAAS,MAAa;AAC1B,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,MAAI,MAAM;AACV,MAAI,SAAS;AACb,MAAI,QAAQ;AACZ,SAAO,OAAO,OAAO,GAAG;AAC1B;AAEA,IAAM,MAAiC,UAAwB;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA;AACF,CAAC;AAEM,SAAS,eAA0C;AACxD,SAAO;AACT;;;ACkGO,IAAM;AAAA;AAAA,EAEX;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AACF,IAAI;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `enclave-aes` as a {@link CapsulePrimitives} — the 13 functions the shared
|
|
3
|
+
* plumbing binds to.
|
|
4
|
+
*
|
|
5
|
+
* ⭐ THE ASSIGNMENT BELOW IS A TEST, and it is the reason this file exists as
|
|
6
|
+
* a file rather than an inline object at the `makeCapsule()` call. Declaring
|
|
7
|
+
* the seam type and implementing it are two different acts; nothing checks a
|
|
8
|
+
* hand-written interface against the module it claims to describe unless
|
|
9
|
+
* something binds one to the other. This binding caught two errors in the
|
|
10
|
+
* declaration within minutes of it being written:
|
|
11
|
+
*
|
|
12
|
+
* - `deriveDeterministicKey` was declared `(dek, context)`. It takes ONE
|
|
13
|
+
* argument — the AES capsule derives the context into the IV, not the key.
|
|
14
|
+
* - `bufferToBase64` was declared `(bytes: Uint8Array)`. It also accepts an
|
|
15
|
+
* `ArrayBuffer`, which is what its callers actually pass.
|
|
16
|
+
*
|
|
17
|
+
* Both would have compiled here and failed at the far end of the refactor,
|
|
18
|
+
* where the cause is no longer visible. (The same lesson as `#16`: a
|
|
19
|
+
* structural declaration drifts silently from its implementation until an
|
|
20
|
+
* assignment pins the two together.)
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ Method shorthand in `CapsulePrimitives` is checked BIVARIANTLY, so this
|
|
23
|
+
* assignment does NOT catch parameter-arity drift — that is exactly how the
|
|
24
|
+
* `deriveDeterministicKey` mistake survived the type and was caught by a call
|
|
25
|
+
* site instead. Keep the conformance kit's call-site coverage; this assignment
|
|
26
|
+
* is necessary, not sufficient.
|
|
27
|
+
*/
|
|
28
|
+
import type { CapsulePrimitives } from '../contract.js';
|
|
29
|
+
export declare const aesPrimitives: CapsulePrimitives;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE DOOR. This is the ONLY hub file that may import the bound capsule.
|
|
3
|
+
* Everything else in hub imports THIS file.
|
|
4
|
+
*
|
|
5
|
+
* Enforced by `capsule-door-only` in `scripts/check-architecture.mjs`, which
|
|
6
|
+
* fails any other file naming `#capsule`. A door nothing enforces is not a
|
|
7
|
+
* door — the enclave barrel it replaces was reached around 38 times before a
|
|
8
|
+
* check existed.
|
|
9
|
+
*
|
|
10
|
+
* `#capsule` resolves through hub's `imports` map: `capsule/enclave-aes/` by
|
|
11
|
+
* default, or an alternative package when a consumer sets a build condition.
|
|
12
|
+
*
|
|
13
|
+
* ⛔ THE RE-EXPORTS BELOW ARE EXPLICIT, AND MUST STAY THAT WAY.
|
|
14
|
+
* `export * from '#capsule'` is the obvious spelling and it does not build:
|
|
15
|
+
* `#capsule` is EXTERNAL (it has to be, or the capsule choice bakes in at hub's
|
|
16
|
+
* build time), and esbuild cannot enumerate an external module's exports. Every
|
|
17
|
+
* named import through the door then fails with "No matching export". Measured
|
|
18
|
+
* 2026-09-12.
|
|
19
|
+
*
|
|
20
|
+
* Generated from `__tests__/enclave-surface.golden.json` — the same artefact
|
|
21
|
+
* the surface test freezes, so the door and the golden cannot drift. Adding a
|
|
22
|
+
* capsule primitive means adding it to the golden and regenerating.
|
|
23
|
+
*/
|
|
24
|
+
export { RecordCodec, SEALED_CEK_NS, applyRewrappedBody, base64ToBuffer, bufferToBase64, buildDeleteMarker, buildRecordAad, buildRecordEnvelope, buildSealedRecordEnvelope, buildTombstone, capabilities, checkCanary, computeBidxTarget, computeBrokerProof, ctEqualTags, decrypt, decryptBytes, decryptBytesWithAAD, decryptDeterministic, deriveBlobAddressKey, deriveBrokerProofBits, deriveBrokerProofKey, deriveClassifyIndexKey, deriveClassifyIndexSalt, deriveDeterministicKey, deriveEchoKey, deriveKey, derivePresenceKey, derivePresenceTagKey, deriveSealedFieldKey, deriveSealedFieldKeyFromCek, deriveSecretKey, deriveVdigSlotKey, encodeEchoParts, encrypt, encryptBytes, encryptBytesWithAAD, encryptDeterministic, envelopeBodyForHash, envelopeBodySize, envelopeOpensUnderAny, evaluateKofN, exportDekSet, exportRecipientPublicKeySpki, findByDet, generateDEK, generateEphemeralKey, generateIV, generateRecipientKeyPair, generateRecoverySecret, generateSalt, generateSigningKeyPair, hasPerRecordKey, hasSealedBody, requireSealedBody, sealedBodyArgs, hkdfAesGcmKey, hmacSha256Hex, hmacSignHex, importCek, importDekSet, importRecipientPublicKeySpki, importTransferKey, isDeleteMarker, isRewrappedUnder, isTombstone, isTombstoneShape, issueChallenge, makeReservedEnvelopes, mintBidxTag, mintCanary, openEnvelopeJson, pbkdf2VerifyDigest, queryByDet, recipientUnwrap, recipientWrap, recordAadFor, rekeyBlobSet, rekeyEnvelopeIfNeeded, rekeyEnvelopeToDek, resolveStableCek, revokeSealedRecord, rewrapBodyToDek, rewrapEnvelope, rotateRecordCek, sealRecordToHost, sha256Bytes, sha256Hex, signBytes, unwrapCek, unwrapKey, verifyBrokerProof, verifyBytes, verifyRecordIdentity, wrapCek, wrapKey, writeEnvelopeBody, } from '#capsule';
|
|
25
|
+
export type { BrokerMemberIdentity, BrokerProofCanonicalParts, DeterministicContext, EchoSecretParts, EnclaveKey, EnclaveKeyPair, EncryptResult, IssuedChallenge, RecordEnvelopeBody, RecordIdentity, RecordRef, RewrappedBody, SealedShredSlot, SealingContext, SecretKeyUsage, VerifyBrokerProofArgs, } from '#capsule';
|
|
26
|
+
export type { CapsuleKey, CapsuleKeyPair, CapsuleGroup } from './contract.js';
|
|
27
|
+
export { CapsuleNotSupportedError } from './contract.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constant-time 32-byte tag comparison.
|
|
3
|
+
*
|
|
4
|
+
* Pure — no WebCrypto, no key material — so it is plumbing rather than a
|
|
5
|
+
* capsule primitive. It lived in `enclave-aes/classify/compare.ts` only
|
|
6
|
+
* because that is where its first caller was; leaving it there would have made
|
|
7
|
+
* `@noy-db/hub/capsule` import the AES capsule to reach it, which is precisely
|
|
8
|
+
* the coupling the seam exists to remove.
|
|
9
|
+
*/
|
|
10
|
+
/** Compare exactly-32-byte tags. XOR-accumulate over all 32 bytes, no early exit. */
|
|
11
|
+
export declare function ctEqualTags(a: Uint8Array, b: Uint8Array): boolean;
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Internal service — not exported as a `@noy-db/hub/*` subpath.
|
|
18
18
|
*/
|
|
19
|
-
import {
|
|
20
|
-
import type {
|
|
21
|
-
import type { RecordCodec } from './record-codec.js';
|
|
19
|
+
import type { NoydbStore } from '../../kernel/types.js';
|
|
20
|
+
import type { RecordCodec } from './index.js';
|
|
22
21
|
/** Everything the moving deterministic-index methods touched on `this.*`. */
|
|
22
|
+
import type { CapsuleKey, CapsulePrimitives } from '../contract.js';
|
|
23
23
|
export interface DeterministicContext<T> {
|
|
24
24
|
/** Collection name — the deterministic-encryption AAD scope. */
|
|
25
25
|
readonly name: string;
|
|
@@ -32,24 +32,11 @@ export interface DeterministicContext<T> {
|
|
|
32
32
|
/** False on plaintext collections — det lookups are encrypted-only. */
|
|
33
33
|
readonly storeCiphertext: boolean;
|
|
34
34
|
/** The collection DEK resolver. */
|
|
35
|
-
getDEK(): Promise<
|
|
35
|
+
getDEK(): Promise<CapsuleKey>;
|
|
36
36
|
/** The record codec — decrypts a matched envelope to T. */
|
|
37
37
|
readonly codec: RecordCodec<T>;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
* Reads every envelope via the adapter and compares the stored `_det[field]` to
|
|
44
|
-
* a freshly computed deterministic ciphertext — no record bodies are decrypted
|
|
45
|
-
* during the search.
|
|
46
|
-
*
|
|
47
|
-
* Throws when the field is not declared in `deterministicFields`, so a typo
|
|
48
|
-
* fails loudly at the call site rather than silently returning null forever.
|
|
49
|
-
*/
|
|
50
|
-
export declare function findByDet<T>(ctx: DeterministicContext<T>, field: string, value: unknown): Promise<T | null>;
|
|
51
|
-
/**
|
|
52
|
-
* Return every record whose deterministic field matches. Same semantics as
|
|
53
|
-
* {@link findByDet} but without the short-circuit.
|
|
54
|
-
*/
|
|
55
|
-
export declare function queryByDet<T>(ctx: DeterministicContext<T>, field: string, value: unknown): Promise<T[]>;
|
|
39
|
+
export declare function makeDeterministic(p: CapsulePrimitives): {
|
|
40
|
+
findByDet: <T>(ctx: DeterministicContext<T>, field: string, value: unknown) => Promise<T | null>;
|
|
41
|
+
queryByDet: <T>(ctx: DeterministicContext<T>, field: string, value: unknown) => Promise<T[]>;
|
|
42
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/** AES key size in bits. Shared: every capsule that derives an AES-GCM subkey
|
|
2
|
+
* from the digest group produces a 256-bit key, or the derivations diverge. */
|
|
3
|
+
export declare const KEY_BITS = 256;
|
|
4
|
+
export declare const IV_BYTES = 12;
|
|
5
|
+
/** The echo-secret typed parts. Encoding lives here with `encodeEchoParts`; the
|
|
6
|
+
* KEK derivation that consumes it stays in the capsule's `authenticate` group. */
|
|
7
|
+
export interface EchoSecretParts {
|
|
8
|
+
readonly prompt: string;
|
|
9
|
+
readonly echo: string;
|
|
10
|
+
readonly key: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* AG-1 encoding: domain context + 4-byte big-endian length prefix per
|
|
14
|
+
* part. Two independent guarantees make a single typed string unable to
|
|
15
|
+
* derive an echo vault's KEK (spec AG-1):
|
|
16
|
+
*
|
|
17
|
+
* 1. The `0xFF` context prefix — UTF-8 never produces that byte, so the
|
|
18
|
+
* encoding is provably not the encoding of ANY string (not merely of
|
|
19
|
+
* no separator-joined form).
|
|
20
|
+
* 2. Structural length prefixes — part boundaries are key material, so
|
|
21
|
+
* re-splitting the same characters changes the derived KEK.
|
|
22
|
+
*
|
|
23
|
+
* @throws ValidationError when any part is not a string — the single
|
|
24
|
+
* chokepoint every echo KEK derivation and block mint passes through, so a
|
|
25
|
+
* malformed parts object cannot be `TextEncoder`-coerced into key material.
|
|
26
|
+
*/
|
|
27
|
+
export declare function encodeEchoParts(parts: EchoSecretParts): Uint8Array;
|
|
28
|
+
/**
|
|
29
|
+
* SHA-256 hex digest of raw bytes. Used to derive content-addressed
|
|
30
|
+
* eTags for blob deduplication. Computed on plaintext bytes
|
|
31
|
+
* before compression and encryption so the eTag identifies content, not
|
|
32
|
+
* ciphertext, and survives re-encryption (key rotation, re-upload).
|
|
33
|
+
*/
|
|
34
|
+
export declare function sha256Hex(data: Uint8Array): Promise<string>;
|
|
35
|
+
/** SHA-256 of raw bytes, as bytes. */
|
|
36
|
+
export declare function sha256Bytes(data: Uint8Array): Promise<Uint8Array>;
|
|
37
|
+
/**
|
|
38
|
+
* Derive the blob CONTENT-ADDRESSING key for one tier (#1126).
|
|
39
|
+
*
|
|
40
|
+
* The blob eTag is an HMAC over the plaintext. It used to be keyed by the
|
|
41
|
+
* `_blob` DEK — the very key `rotateKeys` replaces — so after any rotation
|
|
42
|
+
* `HMAC(live DEK, plaintext) !== storedETag` for every blob written before it,
|
|
43
|
+
* permanently. `decryptResponse()` checks that unconditionally, so the
|
|
44
|
+
* presigned-URL read path raised `TamperedError` on legitimate data forever;
|
|
45
|
+
* dedup also split, minting a second address for identical bytes.
|
|
46
|
+
*
|
|
47
|
+
* The fix is a `root` that rotation never touches (`_blob_addr`, refused by
|
|
48
|
+
* `rotateKeys` exactly as `_roster` is). Rotation then re-keys chunk BODIES
|
|
49
|
+
* while every address stays stable, which is what makes the AAD
|
|
50
|
+
* `{eTag}:{i}:{count}` and every `_blob_index` / `_blob_slots_*` /
|
|
51
|
+
* `_blob_versions_*` row survive it untouched.
|
|
52
|
+
*
|
|
53
|
+
* **Derived PER TIER, deliberately.** A single vault-wide address would make an
|
|
54
|
+
* elevated blob and a tier-0 blob with identical content share an eTag,
|
|
55
|
+
* leaking equality across a boundary the tier system exists to enforce — and
|
|
56
|
+
* `rehomeForTier` re-addresses on a tier move precisely because the address is
|
|
57
|
+
* tier-scoped today. Domain separation keeps that property while removing the
|
|
58
|
+
* rotation coupling: the two are independent axes, and only one of them was
|
|
59
|
+
* ever meant to change the address.
|
|
60
|
+
*
|
|
61
|
+
* Same HKDF idiom as `asKwKey`, with its own salt so the addressing key can
|
|
62
|
+
* never coincide with a wrapping or encryption key.
|
|
63
|
+
*/
|
|
64
|
+
export declare function deriveBlobAddressKey(root: CryptoKey, tier: number): Promise<CryptoKey>;
|
|
65
|
+
/**
|
|
66
|
+
* HMAC-SHA-256(key, data) as hex.
|
|
67
|
+
*
|
|
68
|
+
* Keyed, unlike {@link sha256Hex}: blob eTags derived with this are opaque to
|
|
69
|
+
* the store, so an attacker with store access cannot pre-compute the address of
|
|
70
|
+
* a file they guess at. Dedup still works inside a vault, where the key is shared.
|
|
71
|
+
*/
|
|
72
|
+
export declare function hmacSha256Hex(key: CryptoKey, data: Uint8Array): Promise<string>;
|
|
73
|
+
/**
|
|
74
|
+
* Derive an AES-256-GCM presence key from a collection DEK using HKDF-SHA256.
|
|
75
|
+
*
|
|
76
|
+
* The presence key is domain-separated from the data DEK by the fixed salt
|
|
77
|
+
* `'noydb-presence'` and the `info` = collection name. This means:
|
|
78
|
+
* - The adapter never sees the presence key.
|
|
79
|
+
* - Presence payloads rotate automatically when the collection DEK is rotated.
|
|
80
|
+
* - Revoked users cannot derive the new presence key after a DEK rotation.
|
|
81
|
+
*
|
|
82
|
+
* @param dek The collection's AES-256-GCM DEK (extractable).
|
|
83
|
+
* @param collectionName Used as the HKDF `info` parameter for domain separation.
|
|
84
|
+
* @returns A non-extractable AES-256-GCM key suitable for presence payload encryption.
|
|
85
|
+
*/
|
|
86
|
+
export declare function derivePresenceKey(dek: CryptoKey, collectionName: string): Promise<CryptoKey>;
|
|
87
|
+
/**
|
|
88
|
+
* Derive the presence-TAG key from a collection DEK: a non-extractable,
|
|
89
|
+
* sign-only HMAC-SHA256 key, HKDF-separated from the presence PAYLOAD key
|
|
90
|
+
* ({@link derivePresenceKey}) by its own salt. The tag is the adapter-opaque
|
|
91
|
+
* record id for storage-polled presence; the adapter never sees the userId.
|
|
92
|
+
*/
|
|
93
|
+
export declare function derivePresenceTagKey(dek: CryptoKey, collectionName: string): Promise<CryptoKey>;
|
|
94
|
+
/**
|
|
95
|
+
* HMAC-SHA256 hex with a key that IS an HMAC key (e.g. from
|
|
96
|
+
* {@link derivePresenceTagKey}). {@link hmacSha256Hex} takes an AES-GCM
|
|
97
|
+
* carrier and re-imports its raw bytes, which needs an extractable key;
|
|
98
|
+
* this one signs directly and works with non-extractable keys.
|
|
99
|
+
*/
|
|
100
|
+
export declare function hmacSignHex(key: CryptoKey, data: Uint8Array): Promise<string>;
|
|
101
|
+
/**
|
|
102
|
+
* HKDF-SHA256 → non-extractable AES-256-GCM key from caller-supplied input
|
|
103
|
+
* key material. The magic-link content key derives here from
|
|
104
|
+
* `(serverSecret, SHA-256(token), info)`; `salt`/`info` are the caller's
|
|
105
|
+
* domain separation, this function adds none.
|
|
106
|
+
*/
|
|
107
|
+
export declare function hkdfAesGcmKey(ikm: Uint8Array, salt: Uint8Array, info: Uint8Array): Promise<CryptoKey>;
|
|
108
|
+
/** Generate a random 12-byte IV for AES-GCM. */
|
|
109
|
+
export declare function generateIV(): Uint8Array;
|
|
110
|
+
/** Generate a random 32-byte salt for PBKDF2. */
|
|
111
|
+
export declare function generateSalt(): Uint8Array;
|
|
112
|
+
/**
|
|
113
|
+
* Mint a fresh recovery secret — the high-entropy value a recovery profile
|
|
114
|
+
* wraps the DEK set under and then hands out (Shamir splits it into shares;
|
|
115
|
+
* paper prints it). Not a salt: a salt is public, this is not, and a fork
|
|
116
|
+
* may size them differently. The reference enclave returns 32 bytes.
|
|
117
|
+
*
|
|
118
|
+
* Callers must zero the buffer once it has been wrapped and split.
|
|
119
|
+
*/
|
|
120
|
+
export declare function generateRecoverySecret(): Uint8Array;
|
|
121
|
+
export declare function bufferToBase64(buffer: ArrayBuffer | Uint8Array): string;
|
|
122
|
+
export declare function base64ToBuffer(base64: string): Uint8Array<ArrayBuffer>;
|