@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
|
@@ -1,96 +1,104 @@
|
|
|
1
|
+
// src/capsule/index.ts
|
|
1
2
|
import {
|
|
2
3
|
RecordCodec,
|
|
3
4
|
SEALED_CEK_NS,
|
|
4
5
|
applyRewrappedBody,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
deriveBrokerProofBits,
|
|
8
|
-
deriveBrokerProofKey,
|
|
9
|
-
envelopeBodyForHash,
|
|
10
|
-
envelopeBodySize,
|
|
11
|
-
envelopeOpensUnderAny,
|
|
12
|
-
findByDet,
|
|
13
|
-
hasPerRecordKey,
|
|
14
|
-
hasSealedBody,
|
|
15
|
-
isRewrappedUnder,
|
|
16
|
-
issueChallenge,
|
|
17
|
-
makeReservedEnvelopes,
|
|
18
|
-
openEnvelopeJson,
|
|
19
|
-
queryByDet,
|
|
20
|
-
recordAadFor,
|
|
21
|
-
rekeyBlobSet,
|
|
22
|
-
rekeyEnvelopeIfNeeded,
|
|
23
|
-
rekeyEnvelopeToDek,
|
|
24
|
-
resolveStableCek,
|
|
25
|
-
revokeSealedRecord,
|
|
26
|
-
rewrapBodyToDek,
|
|
27
|
-
rewrapEnvelope,
|
|
28
|
-
rotateRecordCek,
|
|
29
|
-
sealRecordToHost,
|
|
30
|
-
verifyBrokerProof,
|
|
31
|
-
verifyRecordIdentity,
|
|
32
|
-
writeEnvelopeBody
|
|
33
|
-
} from "./chunk-KJFW62P4.js";
|
|
34
|
-
import {
|
|
6
|
+
base64ToBuffer,
|
|
7
|
+
bufferToBase64,
|
|
35
8
|
buildDeleteMarker,
|
|
9
|
+
buildRecordAad,
|
|
36
10
|
buildRecordEnvelope,
|
|
37
11
|
buildSealedRecordEnvelope,
|
|
38
12
|
buildTombstone,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
isTombstoneShape
|
|
42
|
-
} from "./chunk-SEE332EV.js";
|
|
43
|
-
import {
|
|
44
|
-
ctEqualTags,
|
|
45
|
-
deriveVdigSlotKey,
|
|
46
|
-
evaluateKofN
|
|
47
|
-
} from "./chunk-6QSQQLSE.js";
|
|
48
|
-
import "./chunk-DE4DH2RZ.js";
|
|
49
|
-
import {
|
|
13
|
+
capabilities,
|
|
14
|
+
checkCanary,
|
|
50
15
|
computeBidxTarget,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
mintBidxTag
|
|
54
|
-
} from "./chunk-LQ4ZHOKP.js";
|
|
55
|
-
import {
|
|
56
|
-
pbkdf2VerifyDigest
|
|
57
|
-
} from "./chunk-LP7BEXCT.js";
|
|
58
|
-
import {
|
|
59
|
-
base64ToBuffer,
|
|
60
|
-
bufferToBase64,
|
|
16
|
+
computeBrokerProof,
|
|
17
|
+
ctEqualTags,
|
|
61
18
|
decrypt,
|
|
62
19
|
decryptBytes,
|
|
63
20
|
decryptBytesWithAAD,
|
|
64
21
|
decryptDeterministic,
|
|
65
22
|
deriveBlobAddressKey,
|
|
23
|
+
deriveBrokerProofBits,
|
|
24
|
+
deriveBrokerProofKey,
|
|
25
|
+
deriveClassifyIndexKey,
|
|
26
|
+
deriveClassifyIndexSalt,
|
|
66
27
|
deriveDeterministicKey,
|
|
67
28
|
deriveEchoKey,
|
|
68
29
|
deriveKey,
|
|
69
30
|
derivePresenceKey,
|
|
31
|
+
derivePresenceTagKey,
|
|
70
32
|
deriveSealedFieldKey,
|
|
71
33
|
deriveSealedFieldKeyFromCek,
|
|
72
34
|
deriveSecretKey,
|
|
35
|
+
deriveVdigSlotKey,
|
|
73
36
|
encodeEchoParts,
|
|
74
37
|
encrypt,
|
|
75
38
|
encryptBytes,
|
|
76
39
|
encryptBytesWithAAD,
|
|
77
40
|
encryptDeterministic,
|
|
41
|
+
envelopeBodyForHash,
|
|
42
|
+
envelopeBodySize,
|
|
43
|
+
envelopeOpensUnderAny,
|
|
44
|
+
evaluateKofN,
|
|
78
45
|
exportDekSet,
|
|
46
|
+
exportRecipientPublicKeySpki,
|
|
47
|
+
findByDet,
|
|
79
48
|
generateDEK,
|
|
49
|
+
generateEphemeralKey,
|
|
80
50
|
generateIV,
|
|
51
|
+
generateRecipientKeyPair,
|
|
81
52
|
generateRecoverySecret,
|
|
82
53
|
generateSalt,
|
|
54
|
+
generateSigningKeyPair,
|
|
55
|
+
hasPerRecordKey,
|
|
56
|
+
hasSealedBody,
|
|
57
|
+
requireSealedBody,
|
|
58
|
+
sealedBodyArgs,
|
|
59
|
+
hkdfAesGcmKey,
|
|
83
60
|
hmacSha256Hex,
|
|
61
|
+
hmacSignHex,
|
|
84
62
|
importCek,
|
|
85
63
|
importDekSet,
|
|
64
|
+
importRecipientPublicKeySpki,
|
|
65
|
+
importTransferKey,
|
|
66
|
+
isDeleteMarker,
|
|
67
|
+
isRewrappedUnder,
|
|
68
|
+
isTombstone,
|
|
69
|
+
isTombstoneShape,
|
|
70
|
+
issueChallenge,
|
|
71
|
+
makeReservedEnvelopes,
|
|
72
|
+
mintBidxTag,
|
|
73
|
+
mintCanary,
|
|
74
|
+
openEnvelopeJson,
|
|
75
|
+
pbkdf2VerifyDigest,
|
|
76
|
+
queryByDet,
|
|
77
|
+
recipientUnwrap,
|
|
78
|
+
recipientWrap,
|
|
79
|
+
recordAadFor,
|
|
80
|
+
rekeyBlobSet,
|
|
81
|
+
rekeyEnvelopeIfNeeded,
|
|
82
|
+
rekeyEnvelopeToDek,
|
|
83
|
+
resolveStableCek,
|
|
84
|
+
revokeSealedRecord,
|
|
85
|
+
rewrapBodyToDek,
|
|
86
|
+
rewrapEnvelope,
|
|
87
|
+
rotateRecordCek,
|
|
88
|
+
sealRecordToHost,
|
|
89
|
+
sha256Bytes,
|
|
86
90
|
sha256Hex,
|
|
91
|
+
signBytes,
|
|
87
92
|
unwrapCek,
|
|
88
93
|
unwrapKey,
|
|
94
|
+
verifyBrokerProof,
|
|
95
|
+
verifyBytes,
|
|
96
|
+
verifyRecordIdentity,
|
|
89
97
|
wrapCek,
|
|
90
|
-
wrapKey
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
wrapKey,
|
|
99
|
+
writeEnvelopeBody
|
|
100
|
+
} from "#capsule";
|
|
101
|
+
|
|
94
102
|
export {
|
|
95
103
|
RecordCodec,
|
|
96
104
|
SEALED_CEK_NS,
|
|
@@ -102,6 +110,8 @@ export {
|
|
|
102
110
|
buildRecordEnvelope,
|
|
103
111
|
buildSealedRecordEnvelope,
|
|
104
112
|
buildTombstone,
|
|
113
|
+
capabilities,
|
|
114
|
+
checkCanary,
|
|
105
115
|
computeBidxTarget,
|
|
106
116
|
computeBrokerProof,
|
|
107
117
|
ctEqualTags,
|
|
@@ -118,6 +128,7 @@ export {
|
|
|
118
128
|
deriveEchoKey,
|
|
119
129
|
deriveKey,
|
|
120
130
|
derivePresenceKey,
|
|
131
|
+
derivePresenceTagKey,
|
|
121
132
|
deriveSealedFieldKey,
|
|
122
133
|
deriveSealedFieldKeyFromCek,
|
|
123
134
|
deriveSecretKey,
|
|
@@ -132,16 +143,26 @@ export {
|
|
|
132
143
|
envelopeOpensUnderAny,
|
|
133
144
|
evaluateKofN,
|
|
134
145
|
exportDekSet,
|
|
146
|
+
exportRecipientPublicKeySpki,
|
|
135
147
|
findByDet,
|
|
136
148
|
generateDEK,
|
|
149
|
+
generateEphemeralKey,
|
|
137
150
|
generateIV,
|
|
151
|
+
generateRecipientKeyPair,
|
|
138
152
|
generateRecoverySecret,
|
|
139
153
|
generateSalt,
|
|
154
|
+
generateSigningKeyPair,
|
|
140
155
|
hasPerRecordKey,
|
|
141
156
|
hasSealedBody,
|
|
157
|
+
requireSealedBody,
|
|
158
|
+
sealedBodyArgs,
|
|
159
|
+
hkdfAesGcmKey,
|
|
142
160
|
hmacSha256Hex,
|
|
161
|
+
hmacSignHex,
|
|
143
162
|
importCek,
|
|
144
163
|
importDekSet,
|
|
164
|
+
importRecipientPublicKeySpki,
|
|
165
|
+
importTransferKey,
|
|
145
166
|
isDeleteMarker,
|
|
146
167
|
isRewrappedUnder,
|
|
147
168
|
isTombstone,
|
|
@@ -149,9 +170,12 @@ export {
|
|
|
149
170
|
issueChallenge,
|
|
150
171
|
makeReservedEnvelopes,
|
|
151
172
|
mintBidxTag,
|
|
173
|
+
mintCanary,
|
|
152
174
|
openEnvelopeJson,
|
|
153
175
|
pbkdf2VerifyDigest,
|
|
154
176
|
queryByDet,
|
|
177
|
+
recipientUnwrap,
|
|
178
|
+
recipientWrap,
|
|
155
179
|
recordAadFor,
|
|
156
180
|
rekeyBlobSet,
|
|
157
181
|
rekeyEnvelopeIfNeeded,
|
|
@@ -162,13 +186,16 @@ export {
|
|
|
162
186
|
rewrapEnvelope,
|
|
163
187
|
rotateRecordCek,
|
|
164
188
|
sealRecordToHost,
|
|
189
|
+
sha256Bytes,
|
|
165
190
|
sha256Hex,
|
|
191
|
+
signBytes,
|
|
166
192
|
unwrapCek,
|
|
167
193
|
unwrapKey,
|
|
168
194
|
verifyBrokerProof,
|
|
195
|
+
verifyBytes,
|
|
169
196
|
verifyRecordIdentity,
|
|
170
197
|
wrapCek,
|
|
171
198
|
wrapKey,
|
|
172
199
|
writeEnvelopeBody
|
|
173
200
|
};
|
|
174
|
-
//# sourceMappingURL=
|
|
201
|
+
//# sourceMappingURL=chunk-4J3MNVVX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/capsule/index.ts"],"sourcesContent":["/**\n * THE DOOR. This is the ONLY hub file that may import the bound capsule.\n * Everything else in hub imports THIS file.\n *\n * Enforced by `capsule-door-only` in `scripts/check-architecture.mjs`, which\n * fails any other file naming `#capsule`. A door nothing enforces is not a\n * door — the enclave barrel it replaces was reached around 38 times before a\n * check existed.\n *\n * `#capsule` resolves through hub's `imports` map: `capsule/enclave-aes/` by\n * default, or an alternative package when a consumer sets a build condition.\n *\n * ⛔ THE RE-EXPORTS BELOW ARE EXPLICIT, AND MUST STAY THAT WAY.\n * `export * from '#capsule'` is the obvious spelling and it does not build:\n * `#capsule` is EXTERNAL (it has to be, or the capsule choice bakes in at hub's\n * build time), and esbuild cannot enumerate an external module's exports. Every\n * named import through the door then fails with \"No matching export\". Measured\n * 2026-09-12.\n *\n * Generated from `__tests__/enclave-surface.golden.json` — the same artefact\n * the surface test freezes, so the door and the golden cannot drift. Adding a\n * capsule primitive means adding it to the golden and regenerating.\n */\nexport {\n RecordCodec,\n SEALED_CEK_NS,\n applyRewrappedBody,\n base64ToBuffer,\n bufferToBase64,\n buildDeleteMarker,\n buildRecordAad,\n buildRecordEnvelope,\n buildSealedRecordEnvelope,\n buildTombstone,\n capabilities,\n checkCanary,\n computeBidxTarget,\n computeBrokerProof,\n ctEqualTags,\n decrypt,\n decryptBytes,\n decryptBytesWithAAD,\n decryptDeterministic,\n deriveBlobAddressKey,\n deriveBrokerProofBits,\n deriveBrokerProofKey,\n deriveClassifyIndexKey,\n deriveClassifyIndexSalt,\n deriveDeterministicKey,\n deriveEchoKey,\n deriveKey,\n derivePresenceKey,\n derivePresenceTagKey,\n deriveSealedFieldKey,\n deriveSealedFieldKeyFromCek,\n deriveSecretKey,\n deriveVdigSlotKey,\n encodeEchoParts,\n encrypt,\n encryptBytes,\n encryptBytesWithAAD,\n encryptDeterministic,\n envelopeBodyForHash,\n envelopeBodySize,\n envelopeOpensUnderAny,\n evaluateKofN,\n exportDekSet,\n exportRecipientPublicKeySpki,\n findByDet,\n generateDEK,\n generateEphemeralKey,\n generateIV,\n generateRecipientKeyPair,\n generateRecoverySecret,\n generateSalt,\n generateSigningKeyPair,\n hasPerRecordKey,\n hasSealedBody,\n requireSealedBody,\n sealedBodyArgs,\n hkdfAesGcmKey,\n hmacSha256Hex,\n hmacSignHex,\n importCek,\n importDekSet,\n importRecipientPublicKeySpki,\n importTransferKey,\n isDeleteMarker,\n isRewrappedUnder,\n isTombstone,\n isTombstoneShape,\n issueChallenge,\n makeReservedEnvelopes,\n mintBidxTag,\n mintCanary,\n openEnvelopeJson,\n pbkdf2VerifyDigest,\n queryByDet,\n recipientUnwrap,\n recipientWrap,\n recordAadFor,\n rekeyBlobSet,\n rekeyEnvelopeIfNeeded,\n rekeyEnvelopeToDek,\n resolveStableCek,\n revokeSealedRecord,\n rewrapBodyToDek,\n rewrapEnvelope,\n rotateRecordCek,\n sealRecordToHost,\n sha256Bytes,\n sha256Hex,\n signBytes,\n unwrapCek,\n unwrapKey,\n verifyBrokerProof,\n verifyBytes,\n verifyRecordIdentity,\n wrapCek,\n wrapKey,\n writeEnvelopeBody,\n} from '#capsule'\n\nexport type {\n BrokerMemberIdentity,\n BrokerProofCanonicalParts,\n DeterministicContext,\n EchoSecretParts,\n EnclaveKey,\n EnclaveKeyPair,\n EncryptResult,\n IssuedChallenge,\n RecordEnvelopeBody,\n RecordIdentity,\n RecordRef,\n RewrappedBody,\n SealedShredSlot,\n SealingContext,\n SecretKeyUsage,\n VerifyBrokerProofArgs,\n} from '#capsule'\n\nexport type { CapsuleKey, CapsuleKeyPair, CapsuleGroup } from './contract.js'\nexport { CapsuleNotSupportedError } from './contract.js'\n"],"mappings":";AAuBA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
IllegalTransitionError,
|
|
3
3
|
RecordLockedError,
|
|
4
4
|
ValidationError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VSUQI5Q6.js";
|
|
6
6
|
|
|
7
7
|
// src/with-audit/guards/with-guard.ts
|
|
8
8
|
function withGuard(strategy) {
|
|
@@ -124,4 +124,4 @@ export {
|
|
|
124
124
|
immutableGuard,
|
|
125
125
|
transitionGuard
|
|
126
126
|
};
|
|
127
|
-
//# sourceMappingURL=chunk-
|
|
127
|
+
//# sourceMappingURL=chunk-4UIP3QNW.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePod
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RDOEOPOI.js";
|
|
4
4
|
|
|
5
5
|
// src/with-audit/portability/export-accessible.ts
|
|
6
6
|
function resolveAccessibleCollections(keyring, scope, writableOnly = false) {
|
|
@@ -42,4 +42,4 @@ export {
|
|
|
42
42
|
buildAccessibleBundle,
|
|
43
43
|
exportAccessibleData
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-55P6OBB7.js.map
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
decodeVecId,
|
|
3
|
+
deriveChunkVectors,
|
|
4
|
+
embeddingSourceText,
|
|
5
|
+
encodeVecId,
|
|
6
|
+
isVecIdFor
|
|
7
|
+
} from "./chunk-YKGJ44Z7.js";
|
|
1
8
|
import {
|
|
2
9
|
buildBlobFieldEntries,
|
|
3
10
|
buildDictKeyFieldEntries,
|
|
@@ -6,27 +13,20 @@ import {
|
|
|
6
13
|
extractSnippet,
|
|
7
14
|
searchScan,
|
|
8
15
|
segmentTokenizer
|
|
9
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TZYTMZZY.js";
|
|
10
17
|
import {
|
|
11
18
|
fuseRetrieval
|
|
12
19
|
} from "./chunk-AURFOK3D.js";
|
|
13
|
-
import {
|
|
14
|
-
decodeVecId,
|
|
15
|
-
deriveChunkVectors,
|
|
16
|
-
embeddingSourceText,
|
|
17
|
-
encodeVecId,
|
|
18
|
-
isVecIdFor
|
|
19
|
-
} from "./chunk-MDWKM2XC.js";
|
|
20
20
|
import {
|
|
21
21
|
isStaticDictDescriptor,
|
|
22
22
|
stripI18nFilled
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-V55JASXO.js";
|
|
24
24
|
import {
|
|
25
25
|
liveRecordIsElevated
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RIZTZJX6.js";
|
|
27
27
|
import {
|
|
28
28
|
EmbeddingDimMismatchError
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-VSUQI5Q6.js";
|
|
30
30
|
|
|
31
31
|
// src/with-lookup/search/collection-facade.ts
|
|
32
32
|
async function search(ctx, field, query, opts = {}) {
|
|
@@ -374,9 +374,6 @@ async function syncTierSearch(ctx, id, record, version) {
|
|
|
374
374
|
|
|
375
375
|
export {
|
|
376
376
|
search,
|
|
377
|
-
buildRetrievalDocs,
|
|
378
|
-
positionBuildOptions,
|
|
379
|
-
hasIndexedBlobFields,
|
|
380
377
|
flushIndex,
|
|
381
378
|
buildPersistedIndexCallbacks,
|
|
382
379
|
warmIndex,
|
|
@@ -386,4 +383,4 @@ export {
|
|
|
386
383
|
rebuildEmbeddings,
|
|
387
384
|
syncTierSearch
|
|
388
385
|
};
|
|
389
|
-
//# sourceMappingURL=chunk-
|
|
386
|
+
//# sourceMappingURL=chunk-5HNW4ZTA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-lookup/search/collection-facade.ts"],"sourcesContent":["/**\n * Collection-level search / retrieval (`search` / `retrieve` / `similarTo` +\n * the lexical-index build/flush/warm machinery).\n *\n * This is the retrieval surface: a pure client-side lexical scan\n * (`search`), the persisted-or-in-memory inverted-index lifecycle\n * (`flushIndex` / `warmIndex` / `buildRetrievalDocs` + the dict-label / blob-\n * filename resolvers that feed it), and the lexical / semantic / hybrid\n * `retrieve` fan-out plus raw-vector kNN (`similarTo`). None of it touches the\n * write path — it reads the live eager cache and the encrypted `_vec` / `_ftindex`\n * side-cars.\n *\n * Every function takes a small {@link SearchContext} instead of `this`,\n * mirroring the `record-keys/` siblings.\n *\n * The `cache` is the SAME `Map` reference `Collection` owns (passed by\n * reference, never copied) so the index always builds over the live working\n * set. {@link buildPersistedIndexCallbacks} is special: it is invoked from the\n * `Collection` constructor *before* `this.codec` exists, so it takes a context\n * THUNK and resolves the context lazily at each callback invocation.\n *\n * Internal service — not exported as a `@noy-db/hub/*` subpath.\n */\nimport type { NoydbStore } from '../../kernel/types.js'\nimport type { RecordCodec } from '../../capsule/index.js'\nimport { stripI18nFilled, type I18nTextDescriptor } from '../../via/i18n/core.js'\nimport { isStaticDictDescriptor, type DictKeyDescriptor, type StaticDictDescriptor, type DictionaryHandle } from '../../via/i18n/dictionary.js'\nimport type { BlobSet } from '../../with-shape/blobs/blob-set.js'\nimport type { BlobFieldsConfig } from '../../with-shape/blobs/blob-compaction.js'\nimport type { Query } from '../../kernel/query/index.js'\nimport { embeddingSourceText, deriveChunkVectors, type VectorSet, type EmbeddingDescriptor, type StoredVector, type StoredChunk } from '../embeddings/index.js'\nimport { encodeVecId, decodeVecId, isVecIdFor } from '../embeddings/vec-id.js'\nimport { EmbeddingDimMismatchError } from '../../kernel/errors.js'\nimport { liveRecordIsElevated } from '../../kernel/tier-visibility.js'\nimport { searchScan, fuseRetrieval, segmentTokenizer, type SearchOptions, type SearchResult } from './index.js'\nimport type { IndexStore } from './index-store.js'\nimport type { PersistedIndexCallbacks } from './persisted-index-store.js'\nimport { extractSnippet } from './snippet.js'\nimport { buildStringFieldEntries, buildI18nFieldEntries, buildDictKeyFieldEntries, buildBlobFieldEntries } from './build-docs.js'\nimport type { IndexDoc, IndexHit, IndexBuildOptions } from './inverted-index.js'\nimport type { RetrieveOptions, RetrieveHit, SimilarToOptions } from './retrieve-types.js'\n\n/** Everything the moving search/retrieval methods touched on `this.*`. */\nexport interface SearchContext<T> {\n /** Collection name — error context + `_ftindex` row key. */\n readonly name: string\n /** Vault namespace the side-cars (`_vec`, `_ftindex`) live under. */\n readonly vault: string\n /** The ciphertext store. */\n readonly adapter: NoydbStore\n /** The record codec — decrypts the `_vec` / `_ftindex` side-car bodies. */\n readonly codec: RecordCodec<T>\n /** The eager working-set cache (SHARED `Map` reference, never copied). */\n readonly cache: Map<string, { record: T; version: number }>\n /** True in lazy mode — search/retrieve/warm require eager mode. */\n readonly lazy: boolean\n /** Declared text-index fields, or undefined. */\n readonly textIndexes: readonly string[] | undefined\n /** Subset of `textIndexes` recording token positions for phrase / proximity (#1354). */\n readonly textIndexPositions: readonly string[] | undefined\n /** Declared i18n fields, or undefined. */\n readonly i18nFields: Record<string, I18nTextDescriptor> | undefined\n /** Declared dictionary-key fields, or undefined. */\n readonly dictKeyFields: Record<string, DictKeyDescriptor | StaticDictDescriptor> | undefined\n /** Declared blob fields, or undefined. */\n readonly blobFields: BlobFieldsConfig | undefined\n /** Dictionary handle resolver (dynamic dict-key labels), or undefined. */\n readonly getDictionary: ((name: string) => Promise<DictionaryHandle>) | undefined\n /** The lexical inverted-index store (in-memory or persisted), or undefined. */\n readonly searchIndexStore: IndexStore | undefined\n /** The vector set for semantic retrieval, or undefined. */\n readonly vectorSet: VectorSet | undefined\n /** The embeddings descriptor, or undefined. */\n readonly embeddings: EmbeddingDescriptor | undefined\n /** Hydrate the eager cache before reading it. */\n ensureHydrated(): Promise<void>\n /** Open the blob facade for a record (used to list indexed blob filenames). */\n blob(id: string): BlobSet\n}\n\n/**\n * Client-side lexical scan over the live eager cache. Eager mode only;\n * nothing searchable is written to the store.\n */\nexport async function search<T>(ctx: SearchContext<T>, field: string, query: string, opts: SearchOptions = {}): Promise<SearchResult<T>[]> {\n if (ctx.lazy) {\n throw new Error(\n `Collection \"${ctx.name}\": search() (scan mode) requires eager mode (prefetch: true). ` +\n `A store-usable blind index for lazy / at-scale search is a separate gated opt-in (#308).`,\n )\n }\n await ctx.ensureHydrated()\n const entries: { id: string; record: T }[] = []\n // Strip the internal densify marker from the user-facing records.\n // Non-mutating: never touches the cached record object. The search index\n // is built over the same (marker-free) record, which is fine — the marker\n // is never a searchable field.\n for (const [id, e] of ctx.cache) entries.push({ id, record: stripI18nFilled(e.record as Record<string, unknown>) as T })\n return searchScan(entries, field, query, opts)\n}\n\n/** L1 — build IndexDoc[] for the configured text fields over the live cache. */\nfunction buildRetrievalDocs<T>(\n ctx: SearchContext<T>,\n labelMaps: Map<string, Map<string, Record<string, string>>>,\n blobFilenames: Map<string, Map<string, string[]>>,\n only?: readonly string[],\n): IndexDoc[] {\n const docs: IndexDoc[] = []\n for (const [id, e] of ctx.cache) {\n const rec = stripI18nFilled(e.record as Record<string, unknown>)\n const fields = buildStringFieldEntries(rec, ctx.textIndexes ?? [], only)\n if (ctx.i18nFields) fields.push(...buildI18nFieldEntries(rec, ctx.i18nFields, ctx.textIndexes ?? [], only))\n if (ctx.dictKeyFields) fields.push(...buildDictKeyFieldEntries(rec, ctx.dictKeyFields, labelMaps, ctx.textIndexes ?? [], only))\n const blobNames = blobFilenames.get(id)\n if (blobNames) fields.push(...buildBlobFieldEntries(blobNames))\n if (fields.length > 0) docs.push({ id, fields })\n }\n return docs\n}\n\n/**\n * L1 — the positional-postings opt-in for this collection (#1354), or\n * `undefined` when nothing opted in. Returning `undefined` rather than\n * `{ positions: [] }` keeps the no-opt-in path byte-identical to a caller that\n * never heard of positions.\n */\nfunction positionBuildOptions<T>(ctx: SearchContext<T>): IndexBuildOptions | undefined {\n const fields = ctx.textIndexPositions\n return fields && fields.length > 0 ? { positions: fields } : undefined\n}\n\n/** L1 — true iff any configured text index is also a blob field (gates ALL slot I/O). */\nfunction hasIndexedBlobFields<T>(ctx: SearchContext<T>, only?: readonly string[]): boolean {\n if (!ctx.blobFields || !ctx.textIndexes) return false\n const fields = only ? ctx.textIndexes.filter((f) => only.includes(f)) : ctx.textIndexes\n return fields.some((f) => f in ctx.blobFields!)\n}\n\n/**\n * L1 — resolve `recordId -> (blobField -> filenames[])` by listing slots\n * for the configured blob fields of each cached record. Blob slot metadata is\n * NOT inline on the record: it lives in a separate `_blob_slots_*` collection,\n * so this costs ONE `blob(id).list()` (a `listSlots`) per record at build time\n * — the heaviest indexing source. Fully gated by {@link hasIndexedBlobFields};\n * non-blob (and blob-but-not-indexed) collections do ZERO slot I/O.\n */\nasync function resolveBlobFilenames<T>(ctx: SearchContext<T>, only?: readonly string[]): Promise<Map<string, Map<string, string[]>>> {\n const out = new Map<string, Map<string, string[]>>()\n if (!hasIndexedBlobFields(ctx, only)) return out\n const indexed = (only ? ctx.textIndexes!.filter((f) => only.includes(f)) : ctx.textIndexes!)\n .filter((f) => f in ctx.blobFields!)\n const indexedSet = new Set(indexed)\n for (const id of ctx.cache.keys()) {\n let slots\n try {\n slots = await ctx.blob(id).list()\n } catch {\n continue\n }\n let byField: Map<string, string[]> | undefined\n for (const slot of slots) {\n if (!indexedSet.has(slot.name) || !slot.filename) continue\n if (!byField) { byField = new Map(); out.set(id, byField) }\n const names = byField.get(slot.name)\n if (names) names.push(slot.filename)\n else byField.set(slot.name, [slot.filename])\n }\n }\n return out\n}\n\n/** L1 — field -> (key -> {locale->label}) for dictKey fields; static from table, dynamic via getDictionary().list(). */\nasync function resolveDictLabelMaps<T>(ctx: SearchContext<T>): Promise<Map<string, Map<string, Record<string, string>>>> {\n const maps = new Map<string, Map<string, Record<string, string>>>()\n if (!ctx.dictKeyFields || !ctx.textIndexes) return maps\n for (const field of ctx.textIndexes) {\n const desc = ctx.dictKeyFields[field]\n if (!desc) continue\n const m = new Map<string, Record<string, string>>()\n if (isStaticDictDescriptor(desc)) {\n for (const [key, labels] of Object.entries(desc.table)) m.set(key, labels as Record<string, string>)\n } else {\n if (ctx.getDictionary) {\n const handle = await ctx.getDictionary(desc.name)\n for (const e of await handle.list()) m.set(e.key, e.labels)\n }\n }\n maps.set(field, m)\n }\n return maps\n}\n\n/** L1.5 — force-persist the lexical index now (e.g. on save/idle). Persists only when textIndexPersist is enabled; a no-op otherwise. */\nexport async function flushIndex<T>(ctx: SearchContext<T>): Promise<void> {\n if (!ctx.searchIndexStore) return\n await ctx.ensureHydrated()\n const labelMaps = await resolveDictLabelMaps(ctx)\n const blobFilenames = await resolveBlobFilenames(ctx)\n await ctx.searchIndexStore.ensureBuilt(() => buildRetrievalDocs(ctx, labelMaps, blobFilenames), positionBuildOptions(ctx))\n await ctx.searchIndexStore.flush?.()\n}\n\n/** L2 — load + decrypt all _vec sidecars into StoredVector[] for the VectorSet. */\nfunction buildVectorLoad<T>(ctx: SearchContext<T>): () => Promise<StoredVector[]> {\n return async () => {\n const ids = await ctx.adapter.list(ctx.vault, '_vec')\n const out: StoredVector[] = []\n for (const vecId of ids) {\n // #726: _vec is a vault-wide bucket namespaced by collection prefix —\n // skip rows belonging to other collections before touching this one's.\n if (!isVecIdFor(ctx.name, vecId)) continue\n const id = decodeVecId(ctx.name, vecId)!\n // #721 defense-in-depth: a _vec row carries no _tier of its own; the purge\n // on elevate is best-effort and cannot reach a legacy sidecar, so gate on\n // the owning record's live tier. Envelope peek, no decryption.\n if (await liveRecordIsElevated(ctx.adapter, ctx.vault, ctx.name, id)) continue\n const env = await ctx.adapter.get(ctx.vault, '_vec', vecId)\n if (!env) continue\n // #726 fails-safe: a row can pass isVecIdFor's prefix filter yet still\n // be undecryptable under THIS collection's DEK — a surviving legacy\n // bare-id row whose record id happens to start with `<thisCollection>/`,\n // or plain corruption. _vec sidecars are derived, re-derivable\n // artifacts (embedOnWrite regenerates them on the record's next put()),\n // so best-effort skip is correct: never let one poison row crash\n // similarTo()/retrieve() for the whole collection.\n let body: string | null\n try {\n body = await ctx.codec.decryptJsonString({ collection: '_vec', id: vecId }, env)\n } catch {\n continue\n }\n if (body === null) continue\n // #1360: a body carries EITHER `vec` (whole-record, the original shape,\n // still written whenever no `chunk` hook is declared) or `chunks`\n // (sub-document). Reading both shapes is what makes chunking adoptable\n // without a rewrite: existing `_vec` rows keep loading unchanged.\n const parsed = JSON.parse(body) as { vec?: number[]; chunks?: { id: string; start: number; end: number; vec: number[] }[]; model: string }\n if (parsed.chunks && parsed.chunks.length > 0) {\n const chunks: StoredChunk[] = parsed.chunks.map((c) => ({ id: c.id, start: c.start, end: c.end, vec: new Float32Array(c.vec) }))\n out.push({ id, model: parsed.model, chunks })\n } else if (parsed.vec) {\n out.push({ id, vec: new Float32Array(parsed.vec), model: parsed.model })\n }\n }\n return out\n }\n}\n\n/**\n * L1.5 — build the PersistedIndexCallbacks bridge: crypto lives here\n * (collection has getDEK / encryptJsonString / decryptJsonString / adapter),\n * the index store itself is crypto-free.\n *\n * Fingerprint encoding: body-wrap approach — save(json, fp) stores\n * JSON.stringify({ fp, idx: json }) as the encrypted body so the standard\n * EncryptedEnvelope shape is never extended. load() decrypts and JSON.parses\n * the wrapper back out.\n *\n * Cache shape: ctx.cache stores { record, version } — currentFingerprint()\n * iterates over e.version.\n *\n * NOTE: this factory is invoked from the `Collection` constructor *before*\n * `this.codec` is assigned, so it takes a context THUNK and resolves the\n * context lazily inside each callback — by the time a callback actually runs,\n * the codec and cache are fully wired.\n */\nexport function buildPersistedIndexCallbacks<T>(provideCtx: () => SearchContext<T>): PersistedIndexCallbacks {\n const FT = '_ftindex'\n return {\n load: async () => {\n const ctx = provideCtx()\n const env = await ctx.adapter.get(ctx.vault, FT, ctx.name)\n if (!env) return null\n const body = await ctx.codec.decryptJsonString({ collection: FT, id: ctx.name }, env)\n if (body === null) return null\n try {\n const wrapped = JSON.parse(body) as { fp: { count: number; maxVersion: number }; idx: string }\n return { json: wrapped.idx, fingerprint: wrapped.fp }\n } catch {\n return null\n }\n },\n save: async (json, fp, isStale) => {\n const ctx = provideCtx()\n const body = JSON.stringify({ fp, idx: json })\n const env = await ctx.codec.encryptJsonString({ collection: FT, id: ctx.name }, body, fp.count)\n // #725 review: a purge (removePersisted) can land while the encrypt above was\n // in flight — check right before the write and skip it rather than resurrect a\n // purged/forgotten record's blob. PersistedIndexStore's own post-save epoch\n // check is the backstop for every other ordering (incl. a purge landing during\n // this very put).\n if (isStale()) return\n await ctx.adapter.put(ctx.vault, FT, ctx.name, env)\n },\n remove: async () => { const ctx = provideCtx(); await ctx.adapter.delete(ctx.vault, FT, ctx.name) },\n currentFingerprint: () => {\n const ctx = provideCtx()\n let maxVersion = 0\n for (const e of ctx.cache.values()) if (e.version > maxVersion) maxVersion = e.version\n return { count: ctx.cache.size, maxVersion }\n },\n }\n}\n\n/** L1 — pre-build the lexical index (e.g. on open) so the first retrieve() pays no build scan. */\nexport async function warmIndex<T>(ctx: SearchContext<T>): Promise<void> {\n if (!ctx.searchIndexStore) return\n if (ctx.lazy) {\n throw new Error(\n `Collection \"${ctx.name}\": warmIndex() requires eager mode (prefetch: true).`,\n )\n }\n await ctx.ensureHydrated()\n const built = ctx.searchIndexStore.built\n const labelMaps = built ? new Map() : await resolveDictLabelMaps(ctx)\n const blobFilenames = built ? new Map() : await resolveBlobFilenames(ctx)\n await ctx.searchIndexStore.ensureBuilt(() => buildRetrievalDocs(ctx, labelMaps, blobFilenames), positionBuildOptions(ctx))\n}\n\n/**\n * Sentinel `limit` pushed into the mode branches when a `within` is present, so\n * the branch's own truncation (`InvertedIndex.query`'s slice, `cosineTopK`'s\n * `k`, `fuseRetrieval`'s `limit`) becomes a no-op and the caller's real `limit`\n * can be applied AFTER narrowing. `slice(0, Infinity)` is the whole list.\n */\nconst NO_LIMIT = Number.POSITIVE_INFINITY\n\n/**\n * Retrieval. mode: 'lexical' (default) | 'semantic' (L2) | 'hybrid' (L3).\n *\n * ## `within` — the typed half of retrieval (#1343)\n *\n * Money / number / date / boolean fields are NOT tokenised into the lexical\n * index and never will be: instead of a second (typed-token) index format, a\n * typed match is expressed as an ordinary `Query` and handed to `within`, so\n * the comparison runs in the query engine — over the sorted / compound range\n * indexes — in each field's CANONICAL space (money as its scaled integer, not\n * as a lexically-compared string). `retrieve()` contributes the text half and\n * intersects.\n *\n * Two ordering properties, both load-bearing:\n *\n * - **Scoring is global; narrowing is not.** BM25 runs over the WHOLE corpus\n * (df / N / avgdl unchanged by `within`), so a document's score is the same\n * whichever `within` it is paired with — a filter re-ranks nothing. Narrowing\n * the postings instead would make IDF filter-dependent and scores\n * incomparable between two calls. It also costs nothing to score first: the\n * index already scores every doc and only slices at the end.\n * - **`limit` counts hits from the NARROWED set.** Truncating corpus-wide first\n * and filtering after would under-return (`limit: 10` yielding 1), so the\n * mode branches run unlimited and the caller's `limit` is applied last.\n *\n * An empty `within` result set yields NO hits — never all of them.\n *\n * A `within` with an empty text query is **typed-only retrieval**: the typed\n * predicate is the whole query, returned in the usual hit shape (score 0,\n * `field: '(within)'`, empty snippet) so a typed and a text search are read the\n * same way. An empty query with NO `within` still matches nothing.\n */\nexport async function retrieve<T>(ctx: SearchContext<T>, query: string, opts: RetrieveOptions<T> = {}): Promise<RetrieveHit<T>[]> {\n if (opts.within === undefined) {\n return opts.mode === 'semantic' ? retrieveSemantic(ctx, query, opts)\n : opts.mode === 'hybrid' ? retrieveHybrid(ctx, query, opts)\n : retrieveLexical(ctx, query, opts)\n }\n // Typed-only: no query terms to score, so the whole answer is the id set.\n // Checked before the mode branches so it needs neither a textIndexes config\n // nor an embeddings config — a collection of pure money/number fields is a\n // legitimate `retrieve({ within })` target.\n if (segmentTokenizer(query).length === 0) return retrieveWithinOnly(ctx, opts, opts.within)\n const unlimited: RetrieveOptions<T> = { ...opts, limit: NO_LIMIT }\n const hits =\n opts.mode === 'semantic' ? await retrieveSemantic(ctx, query, unlimited)\n : opts.mode === 'hybrid' ? await retrieveHybrid(ctx, query, unlimited)\n : await retrieveLexical(ctx, query, unlimited)\n return applyWithin(hits, opts.within, opts.limit)\n}\n\n/**\n * L3 — keep only hits whose id matches the structured query, truncate to the\n * caller's `limit` (the mode branches ran unlimited), re-rank 1-based.\n */\nfunction applyWithin<T>(hits: RetrieveHit<T>[], within: Query<T>, limit: number | undefined): RetrieveHit<T>[] {\n const ids = new Set(within._idArray())\n const kept = hits.filter(h => ids.has(h.id))\n const limited = limit !== undefined ? kept.slice(0, limit) : kept\n return limited.map((h, i) => ({ ...h, rank: i + 1 }))\n}\n\n/**\n * #1343 — typed-only retrieval: `retrieve('', { within })`. The hits are the\n * `within` ids in query order, presented like any other hit so callers need no\n * second result shape. `score` is 0 and `field` is `'(within)'` because nothing\n * was scored — a structured predicate either matches or does not, and faking a\n * BM25 number would invite sorting by it.\n */\nasync function retrieveWithinOnly<T>(ctx: SearchContext<T>, opts: RetrieveOptions<T>, within: Query<T>): Promise<RetrieveHit<T>[]> {\n if (ctx.lazy) {\n throw new Error(`Collection \"${ctx.name}\": retrieve() requires eager mode (prefetch: true).`)\n }\n await ctx.ensureHydrated()\n const ids = within._idArray()\n const limited = opts.limit !== undefined ? ids.slice(0, opts.limit) : ids\n return limited.map((id, i) => {\n const base: RetrieveHit<T> = { id, score: 0, rank: i + 1, field: '(within)', snippet: '' }\n if (opts.includeRecord) {\n const e = ctx.cache.get(id)\n if (e) (base as { record?: T }).record = stripI18nFilled(e.record as Record<string, unknown>) as T\n }\n return base\n })\n}\n\n/** L1 — client-side lexical retrieval; ranked { id, score, field, snippet, locale? }. */\nasync function retrieveLexical<T>(ctx: SearchContext<T>, query: string, opts: RetrieveOptions<T>): Promise<RetrieveHit<T>[]> {\n if (!ctx.searchIndexStore) {\n throw new Error(`Collection \"${ctx.name}\": retrieve() requires a textIndexes config.`)\n }\n if (ctx.lazy) {\n throw new Error(\n `Collection \"${ctx.name}\": retrieve() requires eager mode (prefetch: true).`,\n )\n }\n await ctx.ensureHydrated()\n const built = ctx.searchIndexStore.built\n const labelMaps = built ? new Map() : await resolveDictLabelMaps(ctx)\n const blobFilenames = built ? new Map() : await resolveBlobFilenames(ctx)\n const index = await ctx.searchIndexStore.ensureBuilt(() => buildRetrievalDocs(ctx, labelMaps, blobFilenames), positionBuildOptions(ctx))\n const hits = index.query(query, {\n ...(opts.limit !== undefined ? { limit: opts.limit } : {}),\n ...(opts.match ? { match: opts.match } : {}),\n ...(opts.prefix ? { prefix: opts.prefix } : {}),\n ...(opts.fields ? { fields: opts.fields } : {}),\n ...(opts.boost ? { boost: opts.boost } : {}),\n })\n const window = opts.snippetWindow ?? 80\n return hits.map((h: IndexHit, i: number) => {\n const base: RetrieveHit<T> = {\n id: h.id,\n score: h.score,\n rank: i + 1,\n field: h.field,\n snippet: extractSnippet(h.text, h.offset, window),\n ...(h.locale !== undefined ? { locale: h.locale } : {}),\n ...(opts.includeRecord\n ? (() => {\n const e = ctx.cache.get(h.id)\n return e ? { record: stripI18nFilled(e.record as Record<string, unknown>) as T } : {}\n })()\n : {}),\n }\n return base\n })\n}\n\n/** L3 — hybrid: fuse lexical (L1) + semantic (L2) by RRF. Requires embeddings. */\nasync function retrieveHybrid<T>(ctx: SearchContext<T>, query: string, opts: RetrieveOptions<T>): Promise<RetrieveHit<T>[]> {\n if (!ctx.embeddings) {\n throw new Error(`Collection \"${ctx.name}\": retrieve({mode:'hybrid'}) requires an embeddings config.`)\n }\n const [lex, sem] = await Promise.all([\n retrieveLexical(ctx, query, opts),\n retrieveSemantic(ctx, query, opts),\n ])\n return fuseRetrieval([lex, sem], opts.limit !== undefined ? { limit: opts.limit } : {})\n}\n\n/** L2 — semantic branch of retrieve(): encode query → similarTo(). */\nasync function retrieveSemantic<T>(ctx: SearchContext<T>, query: string, opts: RetrieveOptions<T>): Promise<RetrieveHit<T>[]> {\n if (!ctx.embeddings) throw new Error(`Collection \"${ctx.name}\": retrieve({mode:'semantic'}) requires an embeddings config.`)\n if (ctx.lazy) throw new Error(`Collection \"${ctx.name}\": retrieve() requires eager mode (prefetch: true).`)\n const qVec = await ctx.embeddings.encode(query)\n return similarTo(ctx, qVec, {\n ...(opts.limit !== undefined ? { k: opts.limit } : {}),\n ...(opts.minScore !== undefined ? { minScore: opts.minScore } : {}),\n ...(opts.includeRecord ? { includeRecord: true } : {}),\n ...(opts.exact !== undefined ? { exact: opts.exact } : {}),\n ...(opts.nprobe !== undefined ? { nprobe: opts.nprobe } : {}),\n })\n}\n\n/** L2 — raw-vector kNN over the encrypted vector set (decrypted in the trusted tier).\n * Snippet is '' for vector hits in v1 (semantic match isn't span-located). */\nexport async function similarTo<T>(ctx: SearchContext<T>, vector: Float32Array, opts: SimilarToOptions = {}): Promise<RetrieveHit<T>[]> {\n if (!ctx.embeddings || !ctx.vectorSet) throw new Error(`Collection \"${ctx.name}\": similarTo() requires an embeddings config.`)\n if (ctx.lazy) throw new Error(`Collection \"${ctx.name}\": similarTo() requires eager mode (prefetch: true).`)\n await ctx.ensureHydrated()\n await ctx.vectorSet.ensureLoaded(buildVectorLoad(ctx))\n // #1360 part 2: `topK` picks exact vs approximate from the collection's\n // `embeddings.index` opt-in, the live vector count and this call's `exact`.\n // With no opt-in it IS `cosineTopK` — same function, same numbers.\n const hits = await ctx.vectorSet.topK(vector, opts.k ?? 10, {\n ...(opts.minScore !== undefined ? { minScore: opts.minScore } : {}),\n ...(opts.exact !== undefined ? { exact: opts.exact } : {}),\n ...(opts.nprobe !== undefined ? { nprobe: opts.nprobe } : {}),\n expectModel: ctx.embeddings.model,\n })\n return hits.map((h, i) => {\n const e = ctx.cache.get(h.id)\n // #1360: for a chunk hit the snippet IS the matched span — resolved by\n // re-deriving the record's joined source text and slicing it at the same\n // offsets the writer used, so the returned span and the returned snippet\n // cannot disagree. Unchunked hits keep snippet '' (a whole-record vector\n // match is not span-located).\n let snippet = ''\n if (h.chunk && e && ctx.embeddings) {\n snippet = embeddingSourceText(e.record as Record<string, unknown>, ctx.embeddings.source).slice(h.chunk.start, h.chunk.end)\n }\n const base: RetrieveHit<T> = { id: h.id, score: h.score, rank: i + 1, field: '(vector)', snippet, ...(h.chunk ? { chunk: h.chunk } : {}) }\n if (opts.includeRecord && e) (base as { record?: T }).record = stripI18nFilled(e.record as Record<string, unknown>) as T\n return base\n })\n}\n\n/**\n * L2 — the embedding write-hook: derive a record's embedding vector at\n * write and persist it as the encrypted `_vec` side-car. Routed through the\n * search strategy so it runs only when `withSearch()` is opted in — computing\n * vectors that no gated `similarTo` / semantic `retrieve` could query would be\n * dead weight, so the compute is paired with the search capability. The caller\n * (`Collection.put`) only invokes this when `embeddings` is declared.\n */\nexport async function embedOnWrite<T>(ctx: SearchContext<T>, id: string, record: T, version: number): Promise<void> {\n if (!ctx.embeddings) return\n const text = embeddingSourceText(record as Record<string, unknown>, ctx.embeddings.source)\n // #1360 — sub-document chunking. When a `chunk` hook is declared and yields\n // usable spans, the sidecar holds ONE VECTOR PER CHUNK and no whole-record\n // vector: the whole-record encode is the thing chunking exists to avoid (it\n // averages a long document's topics away, and can exceed the model's context\n // window — the very case that motivates chunking). No chunk hook, or no\n // usable span, and the body is byte-for-byte the pre-#1360 single-vector\n // shape. Both live in the SAME encrypted `_vec` sidecar: no new store\n // collection, no new plaintext surface.\n const chunks = await deriveChunkVectors(text, ctx.embeddings)\n let body: string\n let writtenVec: Float32Array | undefined\n if (chunks.length > 0) {\n for (const c of chunks) {\n if (c.vec.length !== ctx.embeddings.dim) throw new EmbeddingDimMismatchError('embeddings', ctx.embeddings.dim, c.vec.length)\n }\n body = JSON.stringify({\n chunks: chunks.map((c) => ({ id: c.id, start: c.start, end: c.end, vec: Array.from(c.vec) })),\n model: ctx.embeddings.model,\n dim: ctx.embeddings.dim,\n })\n } else {\n const vec = await ctx.embeddings.encode(text)\n if (vec.length !== ctx.embeddings.dim) throw new EmbeddingDimMismatchError('embeddings', ctx.embeddings.dim, vec.length)\n writtenVec = vec\n body = JSON.stringify({ vec: Array.from(vec), model: ctx.embeddings.model, dim: ctx.embeddings.dim })\n }\n const vecEnv = await ctx.codec.encryptJsonString({ collection: '_vec', id: encodeVecId(ctx.name, id) }, body, version)\n await ctx.adapter.put(ctx.vault, '_vec', encodeVecId(ctx.name, id), vecEnv)\n // #1360 part 2 — hand the just-computed vectors to the in-memory set rather\n // than dropping it. Equivalent to the old `markDirty()` by construction: the\n // sidecar we just wrote is exactly what a reload would decrypt back, so the\n // next query sees the same vectors either way. The difference is cost —\n // `markDirty()` re-reads and re-decrypts every sidecar in the collection on\n // the next query, and would additionally rebuild the approximate index from\n // scratch after every single `put()`.\n if (chunks.length > 0) {\n ctx.vectorSet?.upsert({ id, model: ctx.embeddings.model, chunks: chunks.map((c) => ({ id: c.id, start: c.start, end: c.end, vec: c.vec })) })\n } else {\n ctx.vectorSet?.upsert({ id, model: ctx.embeddings.model, vec: writtenVec! })\n }\n}\n\n/**\n * Force-re-derive every eligible tier-0 record's `_vec` sidecar once (#788).\n * Opt-in bulk repair for the #726 re-namespace: legacy bare-id rows are\n * unreachable to `buildVectorLoad` (it only recognises `<collection>/<id>`\n * keys) and otherwise self-heal only when a record is next `put()` — this\n * lets an adopter recover recall immediately instead of waiting on writes.\n *\n * **Skips elevated records** (`liveRecordIsElevated`) rather than refusing\n * the whole walk — the OPPOSITE of `_applyCutoverTransform`'s\n * `assertCutoverTierSafe` refuse-whole-batch precedent. An elevated record is\n * SUPPOSED to have no `_vec` (`syncTierSearch` purges it on elevate);\n * re-embedding one here would write searchable plaintext-derived data above\n * tier 0. Load-bearing: never write a `_vec` row for an elevated record.\n *\n * Tombstones, delete markers, and a raw `get` racing a delete between `list`\n * and `get` all decrypt to `null` (`decryptRecord` already folds\n * tombstone/delete-marker into that null) and are skipped the same way.\n * Unconditional re-derive, no already-migrated check — safe to re-run after\n * a partial failure (each id is independently idempotent).\n */\nexport async function rebuildEmbeddings<T>(ctx: SearchContext<T>): Promise<{ rebuilt: number; skipped: number }> {\n if (!ctx.embeddings) return { rebuilt: 0, skipped: 0 }\n const ids = await ctx.adapter.list(ctx.vault, ctx.name)\n let rebuilt = 0\n let skipped = 0\n for (const id of ids) {\n if (await liveRecordIsElevated(ctx.adapter, ctx.vault, ctx.name, id)) { skipped++; continue }\n const env = await ctx.adapter.get(ctx.vault, ctx.name, id)\n if (!env) { skipped++; continue }\n const decoded = await ctx.codec.decryptRecord({ collection: ctx.name, id }, env)\n if (decoded === null) { skipped++; continue }\n await embedOnWrite(ctx, id, decoded, env._v ?? 1)\n rebuilt++\n }\n return { rebuilt, skipped }\n}\n\n/**\n * Sync the collection's SEARCH artifacts after a tier move (#721). Both the\n * lexical `_ftindex` blob and the `_vec/<id>` embedding are encrypted under\n * the tier-0 DEK and hold the record's derived plaintext (full field text /\n * a text-invertible vector), so leaving them means elevation never hid what\n * the record was searchable by — the `forget()` precedent, unapplied to\n * elevate. `null` → the record left tier 0: purge its `_vec` sidecar (mirrors\n * `Collection._purgeVector`), and invalidate the `_ftindex` blob (mirrors\n * `Collection._purgeSearchIndex`: deletes the persisted blob when persisted,\n * else drops the in-memory index) so the next `retrieve()` rebuilds from the\n * elevated-free `ctx.cache`. A record → it is tier-0 again: re-embed it via\n * {@link embedOnWrite}, then invalidate `_ftindex` so the rebuild includes it\n * again. No-op fast when the collection has neither a lexical index nor a\n * vector set.\n */\nexport async function syncTierSearch<T>(\n ctx: SearchContext<T>,\n id: string,\n record: T | null,\n version?: number,\n): Promise<void> {\n if (!ctx.searchIndexStore && !ctx.vectorSet) return\n if (record === null) {\n await ctx.adapter.delete(ctx.vault, '_vec', encodeVecId(ctx.name, id))\n ctx.vectorSet?.removeRecord(id)\n } else {\n await embedOnWrite(ctx, id, record, version ?? 1)\n }\n const store = ctx.searchIndexStore\n if (store && 'removePersisted' in store) await (store as { removePersisted(): Promise<void> }).removePersisted()\n else store?.markDirty()\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,eAAsB,OAAU,KAAuB,OAAe,OAAe,OAAsB,CAAC,GAA+B;AACzI,MAAI,IAAI,MAAM;AACZ,UAAM,IAAI;AAAA,MACR,eAAe,IAAI,IAAI;AAAA,IAEzB;AAAA,EACF;AACA,QAAM,IAAI,eAAe;AACzB,QAAM,UAAuC,CAAC;AAK9C,aAAW,CAAC,IAAI,CAAC,KAAK,IAAI,MAAO,SAAQ,KAAK,EAAE,IAAI,QAAQ,gBAAgB,EAAE,MAAiC,EAAO,CAAC;AACvH,SAAO,WAAW,SAAS,OAAO,OAAO,IAAI;AAC/C;AAGA,SAAS,mBACP,KACA,WACA,eACA,MACY;AACZ,QAAM,OAAmB,CAAC;AAC1B,aAAW,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO;AAC/B,UAAM,MAAM,gBAAgB,EAAE,MAAiC;A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cAAc,EAAE,YAAY,IAAI,MAAM,GAAG,GAAG,GAAG;AAC/E,QAAI,YAAY,MAAM;AAAE;AAAW;AAAA,IAAS;AAC5C,UAAM,aAAa,KAAK,IAAI,SAAS,IAAI,MAAM,CAAC;AAChD;AAAA,EACF;AACA,SAAO,EAAE,SAAS,QAAQ;AAC5B;AAiBA,eAAsB,eACpB,KACA,IACA,QACA,SACe;AACf,MAAI,CAAC,IAAI,oBAAoB,CAAC,IAAI,UAAW;AAC7C,MAAI,WAAW,MAAM;AACnB,UAAM,IAAI,QAAQ,OAAO,IAAI,OAAO,QAAQ,YAAY,IAAI,MAAM,EAAE,CAAC;AACrE,QAAI,WAAW,aAAa,EAAE;AAAA,EAChC,OAAO;AACL,UAAM,aAAa,KAAK,IAAI,QAAQ,WAAW,CAAC;AAAA,EAClD;AACA,QAAM,QAAQ,IAAI;AAClB,MAAI,SAAS,qBAAqB,MAAO,OAAO,MAA+C,gBAAgB;AAAA,MAC1G,QAAO,UAAU;AACxB;","names":[]}
|
|
@@ -3,22 +3,20 @@ import {
|
|
|
3
3
|
} from "./chunk-EPFF7LOX.js";
|
|
4
4
|
import {
|
|
5
5
|
loadFence
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BMHQHH7Q.js";
|
|
7
7
|
import {
|
|
8
8
|
SCHEMAS_COLLECTION,
|
|
9
9
|
loadPersistedSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-H3YM66EI.js";
|
|
11
11
|
import {
|
|
12
12
|
canonicalJson,
|
|
13
13
|
sha256Hex
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2WJKJZSO.js";
|
|
15
15
|
import {
|
|
16
|
+
buildSealedRecordEnvelope,
|
|
16
17
|
openEnvelopeJson,
|
|
17
18
|
writeEnvelopeBody
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import {
|
|
20
|
-
buildSealedRecordEnvelope
|
|
21
|
-
} from "./chunk-SEE332EV.js";
|
|
19
|
+
} from "./chunk-4J3MNVVX.js";
|
|
22
20
|
|
|
23
21
|
// src/with-shape/manifest/types.ts
|
|
24
22
|
var MANIFEST_SCHEMA_RECORD_ID = "schema";
|
|
@@ -86,4 +84,4 @@ export {
|
|
|
86
84
|
saveSchemaManifest,
|
|
87
85
|
deriveSchemaManifest
|
|
88
86
|
};
|
|
89
|
-
//# sourceMappingURL=chunk-
|
|
87
|
+
//# sourceMappingURL=chunk-5LMCVBMY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-shape/manifest/types.ts","../src/with-shape/manifest/storage.ts","../src/with-shape/manifest/derive.ts"],"sourcesContent":["/**\n * The pod-wide **schema manifest** record type (#941).\n *\n * This is an INDEX, not a full-inline manifest: `SchemaManifest.collections`\n * carries per-collection *metadata* (generation / content hash / field ids),\n * never the JSON Schema body itself. The JSON Schema stays the source of\n * truth at `_schemas/<collection>`, encrypted under that collection's own\n * DEK (see `with-shape/persisted-schemas`). Inlining full schemas into one\n * pod-wide manifest record would either leak every collection's schema to a\n * principal scoped to a single collection, or force the manifest itself\n * onto a collection-DEK it has no business holding — the index preserves\n * per-collection DEK isolation while still giving a single place to answer\n * \"what schema generation is this pod at, and does collection X's stored\n * schema match its declared content hash.\"\n *\n * `aggregateHash` binds the whole per-collection index's content: it is\n * `sha256Hex(canonicalJson(collections))`, so any change to any collection's\n * entry (a new generation, a changed hash, added/renamed field ids) changes\n * `aggregateHash` too. Canonical JSON (sorted object keys, no whitespace)\n * makes the hash independent of the map's key insertion order.\n *\n * @module\n */\n\n/** Per-collection entry inside a {@link SchemaManifest}'s `collections` index. */\nexport interface SchemaManifestEntry {\n /** The vault-wide schema-fence generation this collection's schema was last written at. */\n readonly generation: number\n /** SHA-256 (hex) of the collection's canonicalised JSON Schema (see `persisted-schemas/derive.ts`). */\n readonly contentHash: string\n /** Stable per-field ids (#946), keyed by the field's current name. Absent when the collection has none. */\n readonly fieldIds?: Record<string, string>\n}\n\n/**\n * The pod-wide schema manifest — one record per pod, stored at\n * `_manifest/schema` (see `storage.ts`). An INDEX over the per-collection\n * `_schemas/<collection>` entries, not the schemas themselves.\n */\nexport interface SchemaManifest {\n readonly v: 1\n readonly kind: 'schema'\n /** Pod-wide schema-fence generation (`FenceDoc.currentSchemaVersion`) as of this manifest's derivation. */\n readonly generation: number\n /** Per-collection index: collection name → its manifest entry. */\n readonly collections: Record<string, SchemaManifestEntry>\n /** `sha256Hex(canonicalJson(collections))` — the pod-wide content binding over the index. */\n readonly aggregateHash: string\n}\n\n/** The record id the schema manifest is stored under inside `_manifest`. */\nexport const MANIFEST_SCHEMA_RECORD_ID = 'schema' as const\n","/**\n * Read / write the pod-wide `_manifest/schema` envelope.\n *\n * Mirrors `with-shape/persisted-schemas/storage.ts`'s shape: the same\n * standard noy-db record envelope, AES-GCM encrypted with a collection DEK\n * (here, the `_manifest` collection's own DEK — the manifest INDEX\n * discloses collection names + hashes + generations + field ids, metadata\n * rather than schema bodies, so it gets the same encryption grain as\n * `_schemas` itself).\n *\n * Storage layout:\n *\n * <vault>/_manifest/schema → EncryptedEnvelope\n *\n * Unlike `persisted-schemas/storage.ts` (which takes an already-resolved\n * `EnclaveKey`), these functions take a `getDEK` resolver and call\n * `getDEK(MANIFEST_COLLECTION)` themselves — there is exactly one manifest\n * record per pod, so there is no per-collection DEK the caller needs to\n * pick; resolving it here keeps every manifest call-site symmetric.\n *\n * @module\n */\n\nimport { buildSealedRecordEnvelope, openEnvelopeJson, writeEnvelopeBody, type EnclaveKey } from '../../capsule/index.js'\nimport { canonicalJson, sha256Hex } from '../../with-commit/history/ledger/index.js'\nimport type { NoydbStore } from '../../kernel/types.js'\nimport { MANIFEST_COLLECTION } from './reserved-collections.js'\nimport { MANIFEST_SCHEMA_RECORD_ID, type SchemaManifest, type SchemaManifestEntry } from './types.js'\n\n/** A resolver for a collection's DEK — the same shape as `Vault`'s internal `getDEK`. */\nexport type GetManifestDEK = (collectionName: string) => Promise<EnclaveKey>\n\n/**\n * A decrypted schema-manifest read paired with the wrapping envelope's `_v`\n * — the optimistic-concurrency token. Pass `version` back to\n * {@link saveSchemaManifest} (via `writeSchemaManifest`'s `expectedVersion`)\n * to make the write a strict CAS.\n */\nexport interface LoadedSchemaManifest {\n /** Wrapping envelope `_v`. */\n readonly version: number\n /** Decrypted schema manifest. */\n readonly manifest: SchemaManifest\n}\n\n/**\n * Read the `_manifest/schema` envelope together with its wrapping `_v`.\n * Returns `undefined` when no manifest has ever been written, when the\n * envelope fails to decrypt (wrong DEK), or when it doesn't parse as a\n * `v: 1, kind: 'schema'` manifest.\n */\nexport async function loadSchemaManifestEntry(\n store: NoydbStore,\n vault: string,\n getDEK: GetManifestDEK,\n): Promise<LoadedSchemaManifest | undefined> {\n const envelope = await store.get(vault, MANIFEST_COLLECTION, MANIFEST_SCHEMA_RECORD_ID)\n if (!envelope) return undefined\n const dek = await getDEK(MANIFEST_COLLECTION)\n try {\n const plaintext = await openEnvelopeJson({ collection: MANIFEST_COLLECTION, id: MANIFEST_SCHEMA_RECORD_ID }, envelope, dek)\n const parsed = JSON.parse(plaintext) as SchemaManifest\n if (parsed.v !== 1 || parsed.kind !== 'schema') return undefined\n return { version: envelope._v, manifest: parsed }\n } catch {\n return undefined\n }\n}\n\n/**\n * Encrypt and persist the schema manifest as a strict CAS write:\n * `expectedVersion` must match the stored envelope's `_v` (0 when no\n * envelope exists yet) or `store.put` throws `ConflictError` — surfaced by\n * `writer.ts`'s `writeSchemaManifest` as `ManifestConflictError` rather than\n * retried.\n */\nexport async function saveSchemaManifest(\n store: NoydbStore,\n vault: string,\n manifest: SchemaManifest,\n expectedVersion: number,\n getDEK: GetManifestDEK,\n): Promise<void> {\n const dek = await getDEK(MANIFEST_COLLECTION)\n const json = JSON.stringify(manifest)\n const env = await buildSealedRecordEnvelope(\n { collection: MANIFEST_COLLECTION, id: MANIFEST_SCHEMA_RECORD_ID, version: expectedVersion + 1 },\n (identity) => writeEnvelopeBody(identity, json, dek),\n {},\n )\n await store.put(vault, MANIFEST_COLLECTION, MANIFEST_SCHEMA_RECORD_ID, env, expectedVersion)\n}\n\n/**\n * `sha256Hex(canonicalJson(collections))` — the pod-wide content binding\n * over a schema manifest's per-collection index. Canonical JSON sorts\n * object keys at every depth, so the result is independent of the map's\n * key insertion order. Shared by the writer's tests and (#941 Task 3) the\n * derivation path, so the hash is computed identically everywhere.\n */\nexport async function computeAggregateHash(\n collections: Record<string, SchemaManifestEntry>,\n): Promise<string> {\n return sha256Hex(canonicalJson(collections))\n}\n","/**\n * Derive the pod-wide {@link SchemaManifest} from the per-collection\n * `_schemas/<collection>` records — the source of truth (#941 Task 3).\n *\n * The manifest is an INDEX, never a cache with independent state: every\n * field in a {@link SchemaManifestEntry} is a direct projection of the\n * matching `PersistedSchemaEnvelope` (`hash` → `contentHash`, `fieldIds` →\n * `fieldIds`, `generation` → `generation`, falling back to the live fence's\n * `currentSchemaVersion` for a legacy pre-#946 envelope that never got a\n * generation stamp). Re-running this function against the same stored state\n * always produces the same manifest — that's what makes round-trip identity\n * (AC #2: dump → restore → re-derive matches the original) hold for free,\n * with no special-cased restore logic.\n *\n * A collection whose `_schemas/<collection>` envelope decrypts successfully\n * but has no derivable content (`hash === null` — a stub envelope for a\n * non-Zod validator) is legitimately omitted from the index: there is no\n * content hash to bind.\n *\n * ## Scoped principals: \"cannot decrypt\" is NOT \"doesn't exist\"\n *\n * A `_schemas/<collection>` envelope is encrypted under **that data\n * collection's own DEK** — the same key its records use — NOT a shared\n * `_schemas`-wide key. In a team vault, a collection-scoped grantee (e.g.\n * `grant(..., { role: 'operator', permissions: { invoices: 'rw' } })`) holds\n * only the DEKs their `permissions` name, plus every system-prefixed (`_*`)\n * collection's DEK — `_manifest` included, by `grant()`'s \"propagate system\n * collections to every role\" rule (`keyring.ts`). So a member scoped to\n * `invoices` CAN decrypt `_manifest/schema` (the pod-wide index) but CANNOT\n * decrypt a sibling's `_schemas/customers` envelope — even though that\n * envelope is right there in `store.list(vault, SCHEMAS_COLLECTION)`.\n *\n * `lookupDEK` (the {@link LookupDEK} passed in) reflects this: it returns\n * `undefined` for a collection name whose DEK the caller does not hold —\n * deliberately NEVER minting a fresh one (see the module doc on\n * `LookupDEK` for why). This function distinguishes that case\n * (`undecodableCollections`) from \"the schema envelope legitimately has no\n * derivable content\" (`hash === null`) — the caller (`sync.ts`) MUST treat\n * an incomplete view differently: writing a manifest derived from a\n * partial view would silently drop every collection this principal can't\n * see. See `sync.ts`'s module doc for how the sync path handles this.\n *\n * @module\n */\n\nimport type { EnclaveKey } from '../../capsule/index.js'\nimport { loadFence } from '../schema-update/fence.js'\nimport { loadPersistedSchema, SCHEMAS_COLLECTION } from '../persisted-schemas/storage.js'\nimport { computeAggregateHash } from './storage.js'\nimport type { NoydbStore } from '../../kernel/types.js'\nimport type { SchemaManifest, SchemaManifestEntry } from './types.js'\n\n/**\n * A NON-MINTING DEK lookup: returns the collection's DEK if the caller\n * already holds it, `undefined` otherwise. Deliberately distinct from\n * `storage.ts`'s `GetManifestDEK` (which mints+persists a fresh DEK for an\n * absent collection — correct for a caller about to WRITE that collection,\n * e.g. `_manifest` itself). `deriveSchemaManifest` only ever READS sibling\n * collections it never created and has no business minting keys for — an\n * absent DEK here means \"not my collection to see,\" never \"new collection\n * that needs a key.\" Minting here would be worse than a no-op: it would\n * silently persist a garbage DEK into the caller's OWN `_keyring/<user>`\n * file (via `ensureCollectionDEK`'s `persistKeyring` side effect) that\n * still can't decrypt anything — see `sync.ts` / `with-pod/open.ts`'s\n * fix notes (#941 review).\n */\nexport type LookupDEK = (collectionName: string) => Promise<EnclaveKey | undefined>\n\nexport interface DeriveSchemaManifestResult {\n /** The derived manifest — an index over every collection this principal could decrypt. */\n readonly manifest: SchemaManifest\n /**\n * Names present in `_schemas` (per `store.list`) whose envelope this\n * principal could NOT decrypt — either no DEK held for that collection,\n * or the DEK held failed to decrypt/parse it (treated the same: the\n * caller cannot verify what's there, so it cannot safely be omitted or\n * asserted). Empty for a principal with full visibility (typically the\n * owner/admin/custodian). Non-empty means `manifest.collections` is\n * DEFINITELY INCOMPLETE relative to the pod's true collection set —\n * see `sync.ts` for why that must gate whether the manifest gets written.\n */\n readonly undecodableCollections: readonly string[]\n}\n\n/**\n * Read the fence generation + every `_schemas/<collection>` envelope this\n * principal can decrypt, and project them into a fresh {@link SchemaManifest}.\n * `lookupDEK` is called once per collection found under `_schemas` (never\n * mints — see {@link LookupDEK}). Names whose DEK isn't held, or whose\n * envelope fails to decrypt/parse despite holding a DEK, are reported via\n * `undecodableCollections` rather than silently dropped from the result.\n */\nexport async function deriveSchemaManifest(\n store: NoydbStore,\n vault: string,\n lookupDEK: LookupDEK,\n): Promise<DeriveSchemaManifestResult> {\n const fence = await loadFence(store, vault)\n const collectionNames = await store.list(vault, SCHEMAS_COLLECTION)\n\n const collections: Record<string, SchemaManifestEntry> = {}\n const undecodableCollections: string[] = []\n for (const name of collectionNames) {\n const dek = await lookupDEK(name)\n if (dek === undefined) {\n undecodableCollections.push(name) // present in _schemas, but not decodable by this principal\n continue\n }\n\n const payload = await loadPersistedSchema(store, vault, name, dek)\n if (!payload) {\n // Held a DEK but still couldn't decrypt/parse — cannot distinguish\n // \"wrong key after all\" from real corruption from here; treat as\n // undecodable (never silently drop) rather than \"no content.\"\n undecodableCollections.push(name)\n continue\n }\n if (payload.hash === null) continue // legitimately no derivable content (stub envelope)\n\n const entry: SchemaManifestEntry = {\n generation: payload.generation ?? fence.currentSchemaVersion,\n contentHash: payload.hash,\n }\n collections[name] = payload.fieldIds !== undefined ? { ...entry, fieldIds: payload.fieldIds } : entry\n }\n\n const aggregateHash = await computeAggregateHash(collections)\n const manifest: SchemaManifest = { v: 1, kind: 'schema', generation: fence.currentSchemaVersion, collections, aggregateHash }\n return { manifest, undecodableCollections }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmDO,IAAM,4BAA4B;;;ACAzC,eAAsB,wBACpB,OACA,OACA,QAC2C;AAC3C,QAAM,WAAW,MAAM,M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AK,IAAI;AAChC;AAAA,IACF;AACA,QAAI,QAAQ,SAAS,KAAM;AAE3B,UAAM,QAA6B;AAAA,MACjC,YAAY,QAAQ,cAAc,MAAM;AAAA,MACxC,aAAa,QAAQ;AAAA,IACvB;AACA,gBAAY,IAAI,IAAI,QAAQ,aAAa,SAAY,EAAE,GAAG,OAAO,UAAU,QAAQ,SAAS,IAAI;AAAA,EAClG;AAEA,QAAM,gBAAgB,MAAM,qBAAqB,WAAW;AAC5D,QAAM,WAA2B,EAAE,GAAG,GAAG,MAAM,UAAU,YAAY,MAAM,sBAAsB,aAAa,cAAc;AAC5H,SAAO,EAAE,UAAU,uBAAuB;AAC5C;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compareKeys,
|
|
3
3
|
toSortKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4CFHL5RY.js";
|
|
5
5
|
import {
|
|
6
6
|
readPath
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BUE7R3B5.js";
|
|
8
8
|
|
|
9
9
|
// src/kernel/query/relate/join-on.ts
|
|
10
10
|
var RANGE_OPS = /* @__PURE__ */ new Set(["<", "<=", ">", ">=", "between"]);
|
|
@@ -201,4 +201,4 @@ export {
|
|
|
201
201
|
joinOnDispatch,
|
|
202
202
|
matchDeclaredJoin
|
|
203
203
|
};
|
|
204
|
-
//# sourceMappingURL=chunk-
|
|
204
|
+
//# sourceMappingURL=chunk-5UUJE4FP.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
signBytes,
|
|
3
|
+
verifyBytes
|
|
4
|
+
} from "./chunk-4J3MNVVX.js";
|
|
5
|
+
|
|
6
|
+
// src/with-audit/attestation/scheme.ts
|
|
7
|
+
var ENCLAVE_SCHEME = { sign: signBytes, verify: verifyBytes };
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
ENCLAVE_SCHEME
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=chunk-5XONHAFD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-audit/attestation/scheme.ts"],"sourcesContent":["import { signBytes, verifyBytes } from '../../capsule/index.js'\nimport type { SignatureScheme } from './types.js'\n\n/**\n * Attestation signs and verifies with the ENCLAVE's sign group, not with the\n * attestation package's bundled Ed25519 — so a different enclave (Stage B/C)\n * changes what hub signs with, without touching attestation.\n */\nexport const ENCLAVE_SCHEME: SignatureScheme = { sign: signBytes, verify: verifyBytes }\n"],"mappings":";;;;;;AAQO,IAAM,iBAAkC,EAAE,MAAM,WAAW,QAAQ,YAAY;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AttestationNotEnabledError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VSUQI5Q6.js";
|
|
4
4
|
|
|
5
5
|
// src/with-audit/attestation/strategy.ts
|
|
6
6
|
var NO_ATTESTATION = {
|
|
@@ -27,4 +27,4 @@ var NO_ATTESTATION = {
|
|
|
27
27
|
export {
|
|
28
28
|
NO_ATTESTATION
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-6QLCS7ET.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-audit/attestation/strategy.ts"],"sourcesContent":["import type { NoydbStore } from '../../kernel/types.js'\nimport type { EnclaveKey } from '../../capsule/index.js'\nimport type { RevocationList } from './types.js'\nimport type { IssueContext, IssueArgs, IssueResult } from './issue.js'\nimport type { RevokeContext } from './revoke.js'\nimport { AttestationNotEnabledError } from '../../kernel/errors.js'\n\n/**\n * Deps the signing-public-key lookup needs. Unlike issue/revoke there is no\n * per-call context object for it, so the vault facade assembles this at call\n * time (reading `role` fresh).\n */\ninterface SignerLookupDeps {\n readonly adapter: NoydbStore\n readonly vault: string\n /** The invoking keyring's role, read fresh by the caller per call. */\n readonly role: string\n /** Per-collection DEK resolver (bound `vault.getDEK`). */\n readonly getDEK: (collection: string) => Promise<EnclaveKey>\n}\n\n/**\n * Attestation capability strategy — the six on-demand methods the vault's\n * attestation delegators route through. The active engine ({@link withAttestation})\n * dynamically imports the issue/revoke/signer cores (keeping them out of the floor\n * bundle); {@link NO_ATTESTATION} throws. The vault-side {@link VaultAttestation}\n * facade holds the per-collection field-schema registry and builds the per-call\n * contexts, then delegates here.\n * @internal\n */\nexport interface AttestationStrategy {\n issueAttestation(ctx: IssueContext, args: IssueArgs): Promise<IssueResult>\n getDocumentSigningPublicKey(deps: SignerLookupDeps): Promise<{ keyId: string; publicKeyB64: string }>\n revokeAttestation(ctx: RevokeContext, docId: string): Promise<void>\n unrevokeAttestation(ctx: RevokeContext, docId: string): Promise<void>\n getRevokedDocIds(ctx: RevokeContext): Promise<string[]>\n publishRevocationList(ctx: RevokeContext): Promise<RevocationList>\n}\n\n/**\n * No-op stub — the floor default. Every capability method throws\n * {@link AttestationNotEnabledError}; opt in with\n * `attestationStrategy: withAttestation()` in createNoydb. @internal\n */\nexport const NO_ATTESTATION: AttestationStrategy = {\n async issueAttestation() { throw new AttestationNotEnabledError() },\n async getDocumentSigningPublicKey() { throw new AttestationNotEnabledError() },\n async revokeAttestation() { throw new AttestationNotEnabledError() },\n async unrevokeAttestation() { throw new AttestationNotEnabledError() },\n async getRevokedDocIds() { throw new AttestationNotEnabledError() },\n async publishRevocationList() { throw new AttestationNotEnabledError() },\n}\n"],"mappings":";;;;;AA4CO,IAAM,iBAAsC;AAAA,EACjD,MAAM,mBAAmB;AAAE,UAAM,IAAI,2BAA2B;AAAA,EAAE;AAAA,EAClE,MAAM,8BAA8B;AAAE,UAAM,IAAI,2BAA2B;AAAA,EAAE;AAAA,EAC7E,MAAM,oBAAoB;AAAE,UAAM,IAAI,2BAA2B;AAAA,EAAE;AAAA,EACnE,MAAM,sBAAsB;AAAE,UAAM,IAAI,2BAA2B;AAAA,EAAE;AAAA,EACrE,MAAM,mBAAmB;AAAE,UAAM,IAAI,2BAA2B;AAAA,EAAE;AAAA,EAClE,MAAM,wBAAwB;AAAE,UAAM,IAAI,2BAA2B;AAAA,EAAE;AACzE;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ValidationError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VSUQI5Q6.js";
|
|
4
4
|
|
|
5
5
|
// src/with-audit/periods/window.ts
|
|
6
6
|
var PERIODS_COLLECTION = "_periods";
|
|
@@ -23,4 +23,4 @@ export {
|
|
|
23
23
|
PERIOD_REOPENS_COLLECTION,
|
|
24
24
|
periodExclusiveUpperBound
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-6WS35E6X.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
freezeAndDeleteClosure,
|
|
3
3
|
randomId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SNM7LSYG.js";
|
|
5
5
|
import {
|
|
6
6
|
buildAccessibleBundle,
|
|
7
7
|
resolveAccessibleCollections
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-55P6OBB7.js";
|
|
9
9
|
import {
|
|
10
10
|
buildRecordEnvelope
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4J3MNVVX.js";
|
|
12
12
|
import {
|
|
13
13
|
NoydbError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VSUQI5Q6.js";
|
|
15
15
|
|
|
16
16
|
// src/with-audit/portability/request-withdrawal.ts
|
|
17
17
|
var WITHDRAWAL_REQUESTS_COLLECTION = "_user_withdrawal_requests";
|
|
@@ -35,7 +35,7 @@ async function readRequest(vault, requestId) {
|
|
|
35
35
|
const { name: vaultName, adapter } = vault._introspectState();
|
|
36
36
|
const env = await adapter.get(vaultName, WITHDRAWAL_REQUESTS_COLLECTION, requestId);
|
|
37
37
|
if (!env) throw new WithdrawalRequestError(`withdrawal request "${requestId}" not found`);
|
|
38
|
-
return { req: JSON.parse(env._data), version: env._v };
|
|
38
|
+
return { req: JSON.parse(env._data ?? ""), version: env._v };
|
|
39
39
|
}
|
|
40
40
|
async function requestWithdrawal(vault, opts = {}) {
|
|
41
41
|
const { keyring } = vault._introspectState();
|
|
@@ -76,7 +76,7 @@ async function listWithdrawalRequests(vault, opts = {}) {
|
|
|
76
76
|
for (const id of ids) {
|
|
77
77
|
const env = await adapter.get(vaultName, WITHDRAWAL_REQUESTS_COLLECTION, id);
|
|
78
78
|
if (!env) continue;
|
|
79
|
-
const req = JSON.parse(env._data);
|
|
79
|
+
const req = JSON.parse(env._data ?? "");
|
|
80
80
|
if (!opts.status || req.status === opts.status) out.push(req);
|
|
81
81
|
}
|
|
82
82
|
return out;
|
|
@@ -151,11 +151,10 @@ async function rejectWithdrawal(vault, requestId, opts = {}) {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
export {
|
|
154
|
-
WITHDRAWAL_REQUESTS_COLLECTION,
|
|
155
154
|
WithdrawalRequestError,
|
|
156
155
|
requestWithdrawal,
|
|
157
156
|
listWithdrawalRequests,
|
|
158
157
|
approveWithdrawal,
|
|
159
158
|
rejectWithdrawal
|
|
160
159
|
};
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
160
|
+
//# sourceMappingURL=chunk-6Y5E4SJU.js.map
|