@noy-db/hub 0.6.0-pre.0 → 0.6.0-pre.2
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/dist/{api-67SBPMMH.js → api-WVY3H3YH.js} +6 -6
- package/dist/attestation/index.js +12 -12
- package/dist/attestation/index.js.map +1 -1
- package/dist/{backup-GAYWQAFN.js → backup-YYBE5RPC.js} +6 -6
- package/dist/blobs/index.js +5 -5
- package/dist/broker/index.js +6 -6
- package/dist/{bundle-handle-5OUAI7CV.js → bundle-handle-JEUWU2SJ.js} +2 -2
- package/dist/cargo/index.js +18 -18
- package/dist/{chunk-3UK6STWO.js → chunk-26JMGSSC.js} +3 -3
- package/dist/{chunk-V5C5NNBR.js → chunk-4MC5JRRX.js} +3 -3
- package/dist/{chunk-4MQDV3HZ.js → chunk-52QYGZHH.js} +2 -2
- package/dist/{chunk-F3GVO44K.js → chunk-5PR33AC4.js} +3 -3
- package/dist/{chunk-VBY6ZLJT.js → chunk-66W5OOCX.js} +3 -3
- package/dist/{chunk-CJ73OLMW.js → chunk-6HFM7EIT.js} +1 -1
- package/dist/chunk-6HFM7EIT.js.map +1 -0
- package/dist/{chunk-4VCWI42L.js → chunk-7NXHMW6Y.js} +2 -2
- package/dist/{chunk-T4GPR2IR.js → chunk-7TSYBD3E.js} +1 -1
- package/dist/chunk-7TSYBD3E.js.map +1 -0
- package/dist/{chunk-JH3OHQM4.js → chunk-7VHY5E3X.js} +6 -6
- package/dist/{chunk-3IIPWA75.js → chunk-A67356IR.js} +2 -2
- package/dist/{chunk-XBLKM73C.js → chunk-BTVYJWSN.js} +8 -8
- package/dist/{chunk-PGAPBZEK.js → chunk-C2OOEM57.js} +4 -4
- package/dist/{chunk-3HYWYLXL.js → chunk-CEJWMBXO.js} +1 -1
- package/dist/chunk-CEJWMBXO.js.map +1 -0
- package/dist/{chunk-LTU4FLHG.js → chunk-DIMKRG2E.js} +4 -4
- package/dist/{chunk-JEM2IGS3.js → chunk-E7OBCBXS.js} +5 -5
- package/dist/{chunk-TFZ7LLOQ.js → chunk-EDXAQ6JI.js} +4 -4
- package/dist/{chunk-JSRU5W2M.js → chunk-EP7VPR7Y.js} +3 -3
- package/dist/{chunk-RLWY6Z44.js → chunk-ERB6NDDW.js} +3 -3
- package/dist/chunk-ERB6NDDW.js.map +1 -0
- package/dist/{chunk-2KIV7BEK.js → chunk-FDX7OWWI.js} +1 -1
- package/dist/chunk-FDX7OWWI.js.map +1 -0
- package/dist/{chunk-HS7HNYBD.js → chunk-G5APARUV.js} +6 -6
- package/dist/{chunk-ZWMO5GL5.js → chunk-GASWQ3XG.js} +3 -3
- package/dist/{chunk-NQCNSVGI.js → chunk-GLKDWWNO.js} +3 -3
- package/dist/{chunk-RPXL6KSX.js → chunk-HFQ6LGIO.js} +3 -3
- package/dist/{chunk-3EO7RZLJ.js → chunk-I4F6PKUK.js} +4 -4
- package/dist/{chunk-MXZ5TSTR.js → chunk-I4ZAO7F7.js} +6 -6
- package/dist/{chunk-HFKGIBMD.js → chunk-I6SDX7WX.js} +2 -2
- package/dist/{chunk-OSFPNKY4.js → chunk-KCQX65FU.js} +2 -2
- package/dist/chunk-KCQX65FU.js.map +1 -0
- package/dist/{chunk-KZ3KMDN3.js → chunk-LWSJG3LI.js} +1 -1
- package/dist/chunk-LWSJG3LI.js.map +1 -0
- package/dist/{chunk-DCMQR46R.js → chunk-MWKDOHEF.js} +3 -3
- package/dist/{chunk-ZK4CO2KZ.js → chunk-NIVEDYJZ.js} +4 -4
- package/dist/{chunk-SRGJET2F.js → chunk-NJDQ4YSV.js} +2 -2
- package/dist/{chunk-TLNNHG3A.js → chunk-NKH7GSIH.js} +3 -3
- package/dist/{chunk-TLNNHG3A.js.map → chunk-NKH7GSIH.js.map} +1 -1
- package/dist/{chunk-NQRJ5AJO.js → chunk-NWCGDAV6.js} +2 -2
- package/dist/{chunk-MJWCLSQL.js → chunk-P7OG2ETF.js} +3 -3
- package/dist/{chunk-NVU7ZMPN.js → chunk-PJNTR2NV.js} +2 -2
- package/dist/{chunk-XB7LUDKM.js → chunk-PRDRGL73.js} +3 -3
- package/dist/{chunk-PP5CO2PR.js → chunk-PVU7LW5L.js} +2 -2
- package/dist/{chunk-3CLZY46Y.js → chunk-PY7CI6L5.js} +56 -56
- package/dist/chunk-PY7CI6L5.js.map +1 -0
- package/dist/{chunk-GS5RT2KK.js → chunk-QD724WDJ.js} +2 -2
- package/dist/chunk-QD724WDJ.js.map +1 -0
- package/dist/{chunk-ZGGVOADG.js → chunk-RKKORO4M.js} +2 -2
- package/dist/{chunk-CYQOUTMY.js → chunk-SZ2K3MHL.js} +2 -2
- package/dist/{chunk-MC2LFTQM.js → chunk-TAGFGKHP.js} +2 -2
- package/dist/{chunk-OMSAULZM.js → chunk-TDJPS3T2.js} +9 -9
- package/dist/{chunk-MVOWXQHN.js → chunk-TOAIYQJR.js} +2 -2
- package/dist/{chunk-27TCYH6G.js → chunk-UIBGXRDD.js} +3 -3
- package/dist/{chunk-27TCYH6G.js.map → chunk-UIBGXRDD.js.map} +1 -1
- package/dist/{chunk-ROWL352P.js → chunk-V5KYPBUR.js} +4 -4
- package/dist/{chunk-FY343IZR.js → chunk-VN45YLWM.js} +3 -3
- package/dist/{chunk-EK7DT5BT.js → chunk-VOQW5LAM.js} +3 -3
- package/dist/{chunk-DPJTDNUF.js → chunk-VRA4Q7DA.js} +5 -5
- package/dist/{chunk-P7NGLLUF.js → chunk-VV4NSB7P.js} +2 -2
- package/dist/{chunk-24UICKTB.js → chunk-VW6ZZGCG.js} +2 -2
- package/dist/chunk-VW6ZZGCG.js.map +1 -0
- package/dist/{chunk-24ZLWWEO.js → chunk-W5W6KHN2.js} +1 -1
- package/dist/chunk-W5W6KHN2.js.map +1 -0
- package/dist/{chunk-LBGPO5RL.js → chunk-WHJKIZS7.js} +4 -4
- package/dist/{chunk-SKONR2OL.js → chunk-WKPJXWKR.js} +2 -2
- package/dist/{chunk-46V67XP5.js → chunk-WQDTCJ6W.js} +2 -2
- package/dist/chunk-WQDTCJ6W.js.map +1 -0
- package/dist/{chunk-BPTZ4K5L.js → chunk-WYZ5MYUA.js} +7 -7
- package/dist/{chunk-2LGDCNFJ.js → chunk-Z45YRGFO.js} +1 -1
- package/dist/chunk-Z45YRGFO.js.map +1 -0
- package/dist/{chunk-ZXJXDHNK.js → chunk-ZNACADFG.js} +2 -2
- package/dist/{chunk-ZXJXDHNK.js.map → chunk-ZNACADFG.js.map} +1 -1
- package/dist/classified/index.js +3 -3
- package/dist/{classified-marker-MH3ON5OL.js → classified-marker-FTOX7Q5L.js} +3 -3
- package/dist/{collection-facade-AHT7FATG.js → collection-facade-QN5ULWYC.js} +8 -8
- package/dist/consent/index.js +4 -4
- package/dist/cover/index.js +2 -2
- package/dist/custody/index.js +6 -6
- package/dist/{dead-filter-U575NGSH.js → dead-filter-ENRIOQIE.js} +2 -2
- package/dist/{delegation-PDYL6RWT.js → delegation-SSEPLXXO.js} +4 -4
- package/dist/derivations/index.js +6 -6
- package/dist/{derive-AKT4KU36.js → derive-6V3PIZF7.js} +5 -5
- package/dist/directory/index.js +5 -5
- package/dist/{dispatch-N5HGVUGU.js → dispatch-BDVGYC6X.js} +9 -9
- package/dist/{dispatch-4XIJSFTT.js → dispatch-RE74SH6L.js} +5 -5
- package/dist/{enclave-OPK24QDR.js → enclave-52VUXNRL.js} +4 -4
- package/dist/{executor-3JZ4POTW.js → executor-FHHLXO4Y.js} +8 -8
- package/dist/{export-accessible-CPTP5STN.js → export-accessible-PE5AYKZR.js} +7 -7
- package/dist/{extract-partition-TWXPHVU7.js → extract-partition-X2L26O6A.js} +10 -10
- package/dist/{fanout-sidecar-T2ZGLQFE.js → fanout-sidecar-DTBIDOWF.js} +4 -4
- package/dist/forget/index.js +4 -4
- package/dist/guards/index.js +1 -1
- package/dist/history/index.js +6 -6
- package/dist/i18n/index.js +6 -6
- package/dist/index.js +54 -54
- package/dist/index.js.map +1 -1
- package/dist/introspection/index.js +6 -6
- package/dist/{issue-N74C55X6.js → issue-RNU55YOF.js} +6 -6
- package/dist/kernel/secret-mode.d.ts +1 -1
- package/dist/kernel/types.d.ts +6 -6
- package/dist/kernel/vault.d.ts +3 -3
- package/dist/{ledger-DONWFC5M.js → ledger-4WJL66BW.js} +6 -6
- package/dist/liberate-PX4CAT5V.js +24 -0
- package/dist/{link-set-2TTP4VLO.js → link-set-N4ZPV6E6.js} +5 -5
- package/dist/{managed-secret-EAOYWRYF.js → managed-secret-OTHS64IF.js} +3 -3
- package/dist/materialized-views/index.js +9 -9
- package/dist/{noydb-6W2XGQCS.js → noydb-YPSEGK32.js} +27 -27
- package/dist/overlay-views/index.js +1 -1
- package/dist/periods/index.js +6 -6
- package/dist/pod/index.js +30 -30
- package/dist/policy/index.js +3 -3
- package/dist/port/with/collection-options.d.ts +1 -1
- package/dist/portability/index.js +6 -6
- package/dist/{post-register-ORQOQJCS.js → post-register-ZAG2CAIY.js} +4 -4
- package/dist/{register-LHETZRJM.js → register-TMD6YRCX.js} +11 -11
- package/dist/{registry-JRIN447B.js → registry-FVLDWQKT.js} +6 -6
- package/dist/{registry-AMAZ6QRZ.js → registry-JET4HBLY.js} +4 -4
- package/dist/{request-withdrawal-2DN2RGCO.js → request-withdrawal-RH55LNZL.js} +9 -9
- package/dist/{reveal-AG4SCHUQ.js → reveal-CMOJY4VO.js} +3 -3
- package/dist/{revoke-ZX4NM2CJ.js → revoke-R5TBYVA6.js} +6 -6
- package/dist/sealed-record/index.js +6 -6
- package/dist/search/index.js +1 -1
- package/dist/{seed-IRCDGIRK.js → seed-UK4QRIUN.js} +6 -6
- package/dist/sequence/index.js +4 -4
- package/dist/session/index.js +3 -3
- package/dist/{signer-7KHD4OL2.js → signer-AGALOXOO.js} +5 -5
- package/dist/snapshots/index.js +5 -5
- package/dist/{stale-K734VACF.js → stale-ZWXSOWJI.js} +5 -5
- package/dist/{storage-4H2GF6RQ.js → storage-N7LB275C.js} +5 -5
- package/dist/{store-coordination-provider-4SKLSFUG.js → store-coordination-provider-PB6QZ57W.js} +3 -3
- package/dist/sync/index.js +4 -4
- package/dist/team/index.js +8 -8
- package/dist/tiers/index.js +4 -4
- package/dist/via/classified/descriptor.d.ts +1 -1
- package/dist/{walk-MQHYNDLZ.js → walk-OCUHCYJ6.js} +7 -7
- package/dist/with-audit/attestation/index.d.ts +1 -1
- package/dist/with-audit/guards/with-guard.d.ts +1 -1
- package/dist/with-cargo/index.d.ts +1 -1
- package/dist/with-commit/history/ledger/entry.d.ts +1 -1
- package/dist/with-commit/numbering/descriptor.d.ts +1 -1
- package/dist/with-formula/derivations/with-derivation.d.ts +1 -1
- package/dist/with-formula/materialized-views/with-materialized-view.d.ts +3 -3
- package/dist/with-formula/overlay-views/with-overlayed-view.d.ts +1 -1
- package/dist/with-party/custody/index.d.ts +1 -1
- package/dist/with-party/directory/user-envelope/index.d.ts +1 -1
- package/dist/with-party/directory/user-envelope/storage.d.ts +1 -1
- package/dist/with-party/team/echo-ceremony.d.ts +3 -3
- package/dist/with-party/team/echo-secret.d.ts +2 -2
- package/dist/with-shape/introspection/index.d.ts +1 -1
- package/dist/with-shape/introspection/types.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/derive.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/index.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/types.d.ts +1 -1
- package/dist/{withdraw-accessible-JSDQHXHE.js → withdraw-accessible-QQNWM5BO.js} +8 -8
- package/package.json +3 -3
- package/dist/chunk-24UICKTB.js.map +0 -1
- package/dist/chunk-24ZLWWEO.js.map +0 -1
- package/dist/chunk-2KIV7BEK.js.map +0 -1
- package/dist/chunk-2LGDCNFJ.js.map +0 -1
- package/dist/chunk-3CLZY46Y.js.map +0 -1
- package/dist/chunk-3HYWYLXL.js.map +0 -1
- package/dist/chunk-46V67XP5.js.map +0 -1
- package/dist/chunk-CJ73OLMW.js.map +0 -1
- package/dist/chunk-GS5RT2KK.js.map +0 -1
- package/dist/chunk-KZ3KMDN3.js.map +0 -1
- package/dist/chunk-OSFPNKY4.js.map +0 -1
- package/dist/chunk-RLWY6Z44.js.map +0 -1
- package/dist/chunk-T4GPR2IR.js.map +0 -1
- package/dist/liberate-KICI7AJN.js +0 -24
- /package/dist/{api-67SBPMMH.js.map → api-WVY3H3YH.js.map} +0 -0
- /package/dist/{backup-GAYWQAFN.js.map → backup-YYBE5RPC.js.map} +0 -0
- /package/dist/{bundle-handle-5OUAI7CV.js.map → bundle-handle-JEUWU2SJ.js.map} +0 -0
- /package/dist/{chunk-3UK6STWO.js.map → chunk-26JMGSSC.js.map} +0 -0
- /package/dist/{chunk-V5C5NNBR.js.map → chunk-4MC5JRRX.js.map} +0 -0
- /package/dist/{chunk-4MQDV3HZ.js.map → chunk-52QYGZHH.js.map} +0 -0
- /package/dist/{chunk-F3GVO44K.js.map → chunk-5PR33AC4.js.map} +0 -0
- /package/dist/{chunk-VBY6ZLJT.js.map → chunk-66W5OOCX.js.map} +0 -0
- /package/dist/{chunk-4VCWI42L.js.map → chunk-7NXHMW6Y.js.map} +0 -0
- /package/dist/{chunk-JH3OHQM4.js.map → chunk-7VHY5E3X.js.map} +0 -0
- /package/dist/{chunk-3IIPWA75.js.map → chunk-A67356IR.js.map} +0 -0
- /package/dist/{chunk-XBLKM73C.js.map → chunk-BTVYJWSN.js.map} +0 -0
- /package/dist/{chunk-PGAPBZEK.js.map → chunk-C2OOEM57.js.map} +0 -0
- /package/dist/{chunk-LTU4FLHG.js.map → chunk-DIMKRG2E.js.map} +0 -0
- /package/dist/{chunk-JEM2IGS3.js.map → chunk-E7OBCBXS.js.map} +0 -0
- /package/dist/{chunk-TFZ7LLOQ.js.map → chunk-EDXAQ6JI.js.map} +0 -0
- /package/dist/{chunk-JSRU5W2M.js.map → chunk-EP7VPR7Y.js.map} +0 -0
- /package/dist/{chunk-HS7HNYBD.js.map → chunk-G5APARUV.js.map} +0 -0
- /package/dist/{chunk-ZWMO5GL5.js.map → chunk-GASWQ3XG.js.map} +0 -0
- /package/dist/{chunk-NQCNSVGI.js.map → chunk-GLKDWWNO.js.map} +0 -0
- /package/dist/{chunk-RPXL6KSX.js.map → chunk-HFQ6LGIO.js.map} +0 -0
- /package/dist/{chunk-3EO7RZLJ.js.map → chunk-I4F6PKUK.js.map} +0 -0
- /package/dist/{chunk-MXZ5TSTR.js.map → chunk-I4ZAO7F7.js.map} +0 -0
- /package/dist/{chunk-HFKGIBMD.js.map → chunk-I6SDX7WX.js.map} +0 -0
- /package/dist/{chunk-DCMQR46R.js.map → chunk-MWKDOHEF.js.map} +0 -0
- /package/dist/{chunk-ZK4CO2KZ.js.map → chunk-NIVEDYJZ.js.map} +0 -0
- /package/dist/{chunk-SRGJET2F.js.map → chunk-NJDQ4YSV.js.map} +0 -0
- /package/dist/{chunk-NQRJ5AJO.js.map → chunk-NWCGDAV6.js.map} +0 -0
- /package/dist/{chunk-MJWCLSQL.js.map → chunk-P7OG2ETF.js.map} +0 -0
- /package/dist/{chunk-NVU7ZMPN.js.map → chunk-PJNTR2NV.js.map} +0 -0
- /package/dist/{chunk-XB7LUDKM.js.map → chunk-PRDRGL73.js.map} +0 -0
- /package/dist/{chunk-PP5CO2PR.js.map → chunk-PVU7LW5L.js.map} +0 -0
- /package/dist/{chunk-ZGGVOADG.js.map → chunk-RKKORO4M.js.map} +0 -0
- /package/dist/{chunk-CYQOUTMY.js.map → chunk-SZ2K3MHL.js.map} +0 -0
- /package/dist/{chunk-MC2LFTQM.js.map → chunk-TAGFGKHP.js.map} +0 -0
- /package/dist/{chunk-OMSAULZM.js.map → chunk-TDJPS3T2.js.map} +0 -0
- /package/dist/{chunk-MVOWXQHN.js.map → chunk-TOAIYQJR.js.map} +0 -0
- /package/dist/{chunk-ROWL352P.js.map → chunk-V5KYPBUR.js.map} +0 -0
- /package/dist/{chunk-FY343IZR.js.map → chunk-VN45YLWM.js.map} +0 -0
- /package/dist/{chunk-EK7DT5BT.js.map → chunk-VOQW5LAM.js.map} +0 -0
- /package/dist/{chunk-DPJTDNUF.js.map → chunk-VRA4Q7DA.js.map} +0 -0
- /package/dist/{chunk-P7NGLLUF.js.map → chunk-VV4NSB7P.js.map} +0 -0
- /package/dist/{chunk-LBGPO5RL.js.map → chunk-WHJKIZS7.js.map} +0 -0
- /package/dist/{chunk-SKONR2OL.js.map → chunk-WKPJXWKR.js.map} +0 -0
- /package/dist/{chunk-BPTZ4K5L.js.map → chunk-WYZ5MYUA.js.map} +0 -0
- /package/dist/{classified-marker-MH3ON5OL.js.map → classified-marker-FTOX7Q5L.js.map} +0 -0
- /package/dist/{collection-facade-AHT7FATG.js.map → collection-facade-QN5ULWYC.js.map} +0 -0
- /package/dist/{dead-filter-U575NGSH.js.map → dead-filter-ENRIOQIE.js.map} +0 -0
- /package/dist/{delegation-PDYL6RWT.js.map → delegation-SSEPLXXO.js.map} +0 -0
- /package/dist/{derive-AKT4KU36.js.map → derive-6V3PIZF7.js.map} +0 -0
- /package/dist/{dispatch-N5HGVUGU.js.map → dispatch-BDVGYC6X.js.map} +0 -0
- /package/dist/{dispatch-4XIJSFTT.js.map → dispatch-RE74SH6L.js.map} +0 -0
- /package/dist/{enclave-OPK24QDR.js.map → enclave-52VUXNRL.js.map} +0 -0
- /package/dist/{executor-3JZ4POTW.js.map → executor-FHHLXO4Y.js.map} +0 -0
- /package/dist/{export-accessible-CPTP5STN.js.map → export-accessible-PE5AYKZR.js.map} +0 -0
- /package/dist/{extract-partition-TWXPHVU7.js.map → extract-partition-X2L26O6A.js.map} +0 -0
- /package/dist/{fanout-sidecar-T2ZGLQFE.js.map → fanout-sidecar-DTBIDOWF.js.map} +0 -0
- /package/dist/{issue-N74C55X6.js.map → issue-RNU55YOF.js.map} +0 -0
- /package/dist/{ledger-DONWFC5M.js.map → ledger-4WJL66BW.js.map} +0 -0
- /package/dist/{liberate-KICI7AJN.js.map → liberate-PX4CAT5V.js.map} +0 -0
- /package/dist/{link-set-2TTP4VLO.js.map → link-set-N4ZPV6E6.js.map} +0 -0
- /package/dist/{managed-secret-EAOYWRYF.js.map → managed-secret-OTHS64IF.js.map} +0 -0
- /package/dist/{noydb-6W2XGQCS.js.map → noydb-YPSEGK32.js.map} +0 -0
- /package/dist/{post-register-ORQOQJCS.js.map → post-register-ZAG2CAIY.js.map} +0 -0
- /package/dist/{register-LHETZRJM.js.map → register-TMD6YRCX.js.map} +0 -0
- /package/dist/{registry-AMAZ6QRZ.js.map → registry-FVLDWQKT.js.map} +0 -0
- /package/dist/{registry-JRIN447B.js.map → registry-JET4HBLY.js.map} +0 -0
- /package/dist/{request-withdrawal-2DN2RGCO.js.map → request-withdrawal-RH55LNZL.js.map} +0 -0
- /package/dist/{reveal-AG4SCHUQ.js.map → reveal-CMOJY4VO.js.map} +0 -0
- /package/dist/{revoke-ZX4NM2CJ.js.map → revoke-R5TBYVA6.js.map} +0 -0
- /package/dist/{seed-IRCDGIRK.js.map → seed-UK4QRIUN.js.map} +0 -0
- /package/dist/{signer-7KHD4OL2.js.map → signer-AGALOXOO.js.map} +0 -0
- /package/dist/{stale-K734VACF.js.map → stale-ZWXSOWJI.js.map} +0 -0
- /package/dist/{storage-4H2GF6RQ.js.map → storage-N7LB275C.js.map} +0 -0
- /package/dist/{store-coordination-provider-4SKLSFUG.js.map → store-coordination-provider-PB6QZ57W.js.map} +0 -0
- /package/dist/{walk-MQHYNDLZ.js.map → walk-OCUHCYJ6.js.map} +0 -0
- /package/dist/{withdraw-accessible-JSDQHXHE.js.map → withdraw-accessible-QQNWM5BO.js.map} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openEnvelopeJson
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VN45YLWM.js";
|
|
4
4
|
import {
|
|
5
5
|
encrypt
|
|
6
6
|
} from "./chunk-VCETL77O.js";
|
|
7
7
|
import {
|
|
8
8
|
NOYDB_FORMAT_VERSION
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-W5W6KHN2.js";
|
|
10
10
|
import {
|
|
11
11
|
SequenceContentionError,
|
|
12
12
|
SequenceNotEnabledError,
|
|
@@ -199,4 +199,4 @@ export {
|
|
|
199
199
|
resolveSequenceKey,
|
|
200
200
|
SequenceStore
|
|
201
201
|
};
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# sourceMappingURL=chunk-GLKDWWNO.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openEnvelopeJson
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VN45YLWM.js";
|
|
4
4
|
import {
|
|
5
5
|
encrypt,
|
|
6
6
|
hmacSha256Hex,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-VCETL77O.js";
|
|
9
9
|
import {
|
|
10
10
|
NOYDB_FORMAT_VERSION
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-W5W6KHN2.js";
|
|
12
12
|
|
|
13
13
|
// src/with-audit/forget/strategy.ts
|
|
14
14
|
var NO_FORGET = { subjects: {} };
|
|
@@ -147,4 +147,4 @@ export {
|
|
|
147
147
|
coerceSubjectId,
|
|
148
148
|
readDottedPath
|
|
149
149
|
};
|
|
150
|
-
//# sourceMappingURL=chunk-
|
|
150
|
+
//# sourceMappingURL=chunk-HFQ6LGIO.js.map
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
ATTESTATIONS_COLLECTION,
|
|
3
3
|
REVOKED_RECORD_ID,
|
|
4
4
|
loadOrCreateSigner
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GASWQ3XG.js";
|
|
6
6
|
import {
|
|
7
7
|
openEnvelopeJson
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VN45YLWM.js";
|
|
9
9
|
import {
|
|
10
10
|
encrypt
|
|
11
11
|
} from "./chunk-VCETL77O.js";
|
|
12
12
|
import {
|
|
13
13
|
NOYDB_FORMAT_VERSION
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-W5W6KHN2.js";
|
|
15
15
|
import {
|
|
16
16
|
AttestationError,
|
|
17
17
|
ConflictError
|
|
@@ -82,4 +82,4 @@ export {
|
|
|
82
82
|
getRevokedDocIdsCore,
|
|
83
83
|
publishRevocationListCore
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-I4F6PKUK.js.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createNoydb
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PY7CI6L5.js";
|
|
4
4
|
import {
|
|
5
5
|
deriveSchemaManifest
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-G5APARUV.js";
|
|
7
7
|
import {
|
|
8
8
|
loadFence
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TOAIYQJR.js";
|
|
10
10
|
import {
|
|
11
11
|
readPod,
|
|
12
12
|
readPodRedirect,
|
|
13
13
|
signRecord,
|
|
14
14
|
verifyPodHeader,
|
|
15
15
|
verifyRecord
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VOQW5LAM.js";
|
|
17
17
|
import {
|
|
18
18
|
loadKeyring
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ERB6NDDW.js";
|
|
20
20
|
import {
|
|
21
21
|
ConflictError,
|
|
22
22
|
MigrationRequiredError,
|
|
@@ -290,4 +290,4 @@ export {
|
|
|
290
290
|
followRedirects,
|
|
291
291
|
open
|
|
292
292
|
};
|
|
293
|
-
//# sourceMappingURL=chunk-
|
|
293
|
+
//# sourceMappingURL=chunk-I4ZAO7F7.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-ZJADGNYF.js";
|
|
4
4
|
import {
|
|
5
5
|
openEnvelopeJson
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VN45YLWM.js";
|
|
7
7
|
import {
|
|
8
8
|
encrypt
|
|
9
9
|
} from "./chunk-VCETL77O.js";
|
|
@@ -72,4 +72,4 @@ export {
|
|
|
72
72
|
writeConsentEntry,
|
|
73
73
|
loadConsentEntries
|
|
74
74
|
};
|
|
75
|
-
//# sourceMappingURL=chunk-
|
|
75
|
+
//# sourceMappingURL=chunk-I6SDX7WX.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
persistUserVisibility,
|
|
5
5
|
readUserVisibility,
|
|
6
6
|
saveUserEnvelope
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UIBGXRDD.js";
|
|
8
8
|
import {
|
|
9
9
|
PolicyDeniedError
|
|
10
10
|
} from "./chunk-HNGSV2YC.js";
|
|
@@ -379,4 +379,4 @@ export {
|
|
|
379
379
|
UserApi,
|
|
380
380
|
createUserApi
|
|
381
381
|
};
|
|
382
|
-
//# sourceMappingURL=chunk-
|
|
382
|
+
//# sourceMappingURL=chunk-KCQX65FU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-party/directory/user-envelope/api.ts"],"sourcesContent":["/**\n * Public `vault.user.*` API surface.\n *\n * Three families:\n * - Write-self: `me` / `updateMe` / `setMe` — always target the writer's\n * own keyringId. **Own-only write rule** is structural — no method\n * exists to write someone else's envelope.\n * - Read-anyone: `get` / `list` — read other principals' envelopes\n * (subject to `view-team-profiles` policy gate).\n * - Reactive: `subscribe` / `live` — in-process event emission on local\n * writes. Cross-instance updates land via the team/sync engine and\n * surface to subscribers when the sync diff replays through this API.\n *\n * @see design-history/2026-05-05-user-envelope-design.md\n *\n * @module\n */\nimport { PolicyDeniedError } from '../../../kernel/errors.js'\nimport {\n loadUserEnvelope,\n saveUserEnvelope,\n listUserEnvelopeIds,\n} from './storage.js'\nimport type {\n UserEnvelope,\n DeepPartialOrNull,\n Unsubscribe,\n UserEnvelopePresented,\n LiveUserEnvelope,\n VaultUserApi,\n UserApiDeps,\n UserApiFactory,\n} from '../../../kernel/types.js'\nimport {\n persistUserVisibility,\n readUserVisibility,\n} from '../visibility.js'\nimport type { UserVisibility } from '../types.js'\nimport type { ExportAccessibleOptions } from '../../../with-audit/portability/export-accessible.js'\nimport type { WithdrawAccessibleOptions, WithdrawResult } from '../../../with-audit/portability/withdraw-accessible.js'\nimport type {\n RequestWithdrawalOptions,\n RequestWithdrawalResult,\n WithdrawalRequest,\n WithdrawalRequestStatus,\n ApproveWithdrawalOptions,\n RejectWithdrawalOptions,\n} from '../../../with-audit/portability/request-withdrawal.js'\n\ninterface ChangeListener<T = unknown> {\n (env: UserEnvelope<T> | null): void\n}\n\n/**\n * Implementation behind `vault.user`. Constructed once per Vault via\n * {@link createUserApi}, holds the writer's keyringId in closure so\n * `updateMe`/`setMe` cannot target any other principal — the own-only\n * rule is enforced at the type level (no `set(otherKeyringId, …)`\n * method) AND at runtime (the keyringId argument simply doesn't exist\n * on the write path).\n */\nexport class UserApi implements VaultUserApi {\n /** keyringId → set of listeners. Wildcard '*' fires on every change. */\n private readonly listeners = new Map<string, Set<ChangeListener>>()\n\n private readonly adapter: UserApiDeps['adapter']\n private readonly vaultName: UserApiDeps['vaultName']\n /** The writer's own keyringId. Frozen at construction time. */\n private readonly writerKeyringId: UserApiDeps['writerKeyringId']\n private readonly getDek: UserApiDeps['getDek']\n /**\n * Policy-gate validator. When omitted, gates are skipped — useful\n * for low-level tests that exercise the storage layer directly.\n * Production paths always wire the Noydb-backed implementation.\n */\n private readonly checkGate?: UserApiDeps['checkGate']\n /**\n * Noydb-backed `exportMyAccessibleData`, injected by the Vault\n * (which holds the keyring + bundle machinery). Omitted in low-level tests.\n */\n private readonly exportAccessible?: UserApiDeps['exportAccessible']\n /**\n * Noydb-backed `unilateralWithdrawal`, injected by the Vault.\n * Destructive — extract + dispose (delete | freeze). Omitted in low-level tests.\n */\n private readonly unilateralWithdraw?: UserApiDeps['unilateralWithdraw']\n /**\n * Noydb-backed two-party withdrawal ceremony, injected by the\n * Vault. requestWithdraw = requester side; the rest = owner side.\n */\n private readonly requestWithdraw?: UserApiDeps['requestWithdraw']\n private readonly listWithdrawals?: UserApiDeps['listWithdrawals']\n private readonly approveWithdraw?: UserApiDeps['approveWithdraw']\n private readonly rejectWithdraw?: UserApiDeps['rejectWithdraw']\n\n constructor(deps: UserApiDeps) {\n this.adapter = deps.adapter\n this.vaultName = deps.vaultName\n this.writerKeyringId = deps.writerKeyringId\n this.getDek = deps.getDek\n this.checkGate = deps.checkGate\n this.exportAccessible = deps.exportAccessible\n this.unilateralWithdraw = deps.unilateralWithdraw\n this.requestWithdraw = deps.requestWithdraw\n this.listWithdrawals = deps.listWithdrawals\n this.approveWithdraw = deps.approveWithdraw\n this.rejectWithdraw = deps.rejectWithdraw\n }\n\n /**\n * File a two-party withdrawal request for the caller's accessible\n * scope. Non-destructive (writes a pending request); an owner later approves\n * or rejects. This is the path for read-only roles (`client`/`viewer`) that\n * cannot self-serve a destructive `unilateralWithdrawal`. Gated by\n * `user-request-withdrawal` (enabled by default).\n */\n async requestWithdrawal(opts: RequestWithdrawalOptions = {}): Promise<RequestWithdrawalResult> {\n if (this.checkGate) await this.checkGate('user-request-withdrawal')\n if (!this.requestWithdraw) {\n throw new Error('requestWithdrawal requires a Noydb-backed vault (not a bare UserApi)')\n }\n return this.requestWithdraw(opts)\n }\n\n /** Owner side: list filed withdrawal requests (optionally by status). */\n async listWithdrawalRequests(opts: { status?: WithdrawalRequestStatus } = {}): Promise<WithdrawalRequest[]> {\n if (!this.listWithdrawals) {\n throw new Error('listWithdrawalRequests requires a Noydb-backed vault (not a bare UserApi)')\n }\n return this.listWithdrawals(opts)\n }\n\n /**\n * Owner side: approve a pending request. Extracts the requester's\n * recorded scope under firm authority, disposes of the source per the\n * request's disposition, and returns the re-keyed bundle to hand back. Gated\n * by `approve-user-withdrawal` (tier-2 default) + owner/admin role.\n */\n async approveWithdrawal(requestId: string, opts: ApproveWithdrawalOptions = {}): Promise<WithdrawResult> {\n if (this.checkGate) await this.checkGate('approve-user-withdrawal')\n if (!this.approveWithdraw) {\n throw new Error('approveWithdrawal requires a Noydb-backed vault (not a bare UserApi)')\n }\n return this.approveWithdraw(requestId, opts)\n }\n\n /** Owner side: reject a pending request (no data is touched). */\n async rejectWithdrawal(requestId: string, opts: RejectWithdrawalOptions = {}): Promise<WithdrawalRequest> {\n if (this.checkGate) await this.checkGate('approve-user-withdrawal')\n if (!this.rejectWithdraw) {\n throw new Error('rejectWithdrawal requires a Noydb-backed vault (not a bare UserApi)')\n }\n return this.rejectWithdraw(requestId, opts)\n }\n\n /**\n * Single-party withdrawal: export the caller's accessible scope\n * (re-keyed) and dispose of the source (`delete` or `freeze`). Gated by the\n * fail-closed built-in `client-unilateral-withdraw` policy — undefined or\n * disabled → throws (use `requestWithdrawal`). The firm enables it at vault\n * creation.\n */\n async unilateralWithdrawal(opts: WithdrawAccessibleOptions): Promise<WithdrawResult> {\n if (this.checkGate) await this.checkGate('client-unilateral-withdraw')\n if (!this.unilateralWithdraw) {\n throw new Error('unilateralWithdrawal requires a Noydb-backed vault (not a bare UserApi)')\n }\n return this.unilateralWithdraw(opts)\n }\n\n /**\n * Export the calling user's accessible scope as a portable, re-keyed\n * `.noydb` bundle. Non-destructive and **always allowed** (data sovereignty\n * by construction) but audited. Scope = the caller's DEK access set.\n */\n async exportMyAccessibleData(opts: ExportAccessibleOptions = {}): Promise<Uint8Array> {\n if (!this.exportAccessible) {\n throw new Error('exportMyAccessibleData requires a Noydb-backed vault (not a bare UserApi)')\n }\n return this.exportAccessible(opts)\n }\n\n // ─── Write-self ──────────────────────────────────────────────────────\n\n /** Read the writer's own envelope. Returns null if never written. */\n async me<T = unknown>(): Promise<UserEnvelope<T> | null> {\n const dek = await this.getDek()\n return loadUserEnvelope<T>(this.adapter, this.vaultName, this.writerKeyringId, dek)\n }\n\n /**\n * Deep-merge a partial patch into the writer's own envelope. Creates\n * the envelope on first call. Optimistic-concurrency safe — a stale\n * `_v` (parallel writer on another device) throws `ConflictError`.\n *\n * Patch semantics:\n * - `undefined` (or omitted key) — skip; existing value preserved\n * - `null` — delete the field from the merged result\n * - any other value — overwrite (deep-merge for plain objects,\n * replace for primitives / arrays)\n *\n * To clear a field, pass `null` rather than `undefined`. Callers\n * with shape `T = string | null` where `null` is a meaningful value\n * should use `setMe` for that specific field instead — `null` here\n * always means delete.\n *\n * Gated by the `edit-own-profile` policy gate (default `minTier: 3`).\n * Pass `presented` to satisfy tightened policies that require a\n * factor proof (e.g. STRICT_POLICY's TOTP requirement).\n */\n async updateMe<T extends object = Record<string, unknown>>(\n patch: DeepPartialOrNull<T>,\n presented?: UserEnvelopePresented,\n ): Promise<UserEnvelope<T>> {\n if (this.checkGate) await this.checkGate('edit-own-profile', presented)\n const dek = await this.getDek()\n const current = await loadUserEnvelope<T>(\n this.adapter,\n this.vaultName,\n this.writerKeyringId,\n dek,\n )\n const merged: T = current ? deepMerge(current.data, patch) : (patch as unknown as T)\n const written = await saveUserEnvelope<T>(\n this.adapter,\n this.vaultName,\n this.writerKeyringId,\n merged,\n dek,\n current?._v ?? 0,\n )\n this.fireChange(this.writerKeyringId, written)\n return written\n }\n\n /**\n * Replace the writer's own envelope with `payload`. Use sparingly —\n * `updateMe` is the canonical mutation. No `expectedVersion` check;\n * callers explicitly take last-write-wins semantics.\n *\n * Gated by `edit-own-profile`. See `updateMe` for `presented` usage.\n */\n async setMe<T = unknown>(\n payload: T,\n presented?: UserEnvelopePresented,\n ): Promise<UserEnvelope<T>> {\n if (this.checkGate) await this.checkGate('edit-own-profile', presented)\n const dek = await this.getDek()\n const written = await saveUserEnvelope<T>(\n this.adapter,\n this.vaultName,\n this.writerKeyringId,\n payload,\n dek,\n )\n this.fireChange(this.writerKeyringId, written)\n return written\n }\n\n // ─── Visibility ──────────────────────────────────────────────────────\n\n /**\n * Read the current user's visibility flag from\n * `_meta/visibility/<keyringId>`. Returns `{ hidden: false }` when no\n * document has been persisted (the default-visible case).\n */\n async getMyVisibility(): Promise<UserVisibility> {\n const persisted = await readUserVisibility(this.adapter, this.vaultName, this.writerKeyringId)\n return persisted ?? { hidden: false }\n }\n\n /**\n * Update the current user's visibility in the team directory.\n *\n * - `hidden: true` — opt out of the default `listUsersWithEnvelopes`\n * listing. `owner`/`admin` callers can still see the user by passing\n * `{ includeHidden: true }`.\n * - `hidden: false` — opt back in.\n *\n * Own-only by construction: the keyringId argument doesn't exist on\n * this method, so no caller can hide or unhide another principal.\n *\n * Honest caveat: this is a UX flag, not a privacy guarantee. The\n * envelope ciphertext at `_users/<keyringId>` and the keyring file at\n * `_keyring/<userId>` are both still observable to anyone with direct\n * store read access. See `https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/user-envelope.md` →\n * \"Directory visibility\".\n */\n async setMyVisibility(visibility: UserVisibility): Promise<void> {\n await persistUserVisibility(\n this.adapter,\n this.vaultName,\n this.writerKeyringId,\n { hidden: visibility.hidden },\n )\n }\n\n // ─── Read-anyone ─────────────────────────────────────────────────────\n\n /**\n * Read another principal's envelope by their keyringId. Returns null\n * if the principal exists but has no envelope yet, or if the\n * keyringId does not exist at all.\n *\n * Gated by `view-team-profiles` (default `minTier: 2`) — but ONLY for\n * cross-principal reads. Reading your own envelope (`keyringId ===\n * self`) is never gated; that's just `me()` written long-form.\n */\n async get<T = unknown>(\n keyringId: string,\n presented?: UserEnvelopePresented,\n ): Promise<UserEnvelope<T> | null> {\n if (this.checkGate && keyringId !== this.writerKeyringId) {\n await this.checkGate('view-team-profiles', presented)\n }\n const dek = await this.getDek()\n return loadUserEnvelope<T>(this.adapter, this.vaultName, keyringId, dek)\n }\n\n /**\n * Read every persisted envelope in the vault. Order is store-defined.\n *\n * Gated by `view-team-profiles`. Default policy (`minTier: 2`) lets\n * any authenticated session read all envelopes. Two privacy-strict\n * opt-outs:\n *\n * - `view-team-profiles.enabled: false` → list() returns only the\n * caller's own envelope (silent self-fallback, no thrown error).\n * - `view-team-profiles.minTier: 1` + insufficient tier → throws\n * `PolicyDeniedError` with `reason: 'insufficient-tier'`. The\n * caller is expected to elevate, not silently degrade.\n *\n * The asymmetry is deliberate: `enabled: false` is a deliberate\n * design choice (\"nobody sees teammate profiles in this app\");\n * `insufficient-tier` is \"you need to authenticate further\". Different\n * UX prompts for different intents.\n */\n async list<T = unknown>(presented?: UserEnvelopePresented): Promise<UserEnvelope<T>[]> {\n if (this.checkGate) {\n try {\n await this.checkGate('view-team-profiles', presented)\n } catch (err) {\n if (err instanceof PolicyDeniedError && err.reason === 'disabled') {\n // Privacy-strict opt-out: quietly return only self.\n const me = await this.me<T>()\n return me ? [me] : []\n }\n throw err\n }\n }\n const dek = await this.getDek()\n const ids = await listUserEnvelopeIds(this.adapter, this.vaultName)\n const envelopes = await Promise.all(\n ids.map((id) => loadUserEnvelope<T>(this.adapter, this.vaultName, id, dek)),\n )\n return envelopes.filter((e): e is UserEnvelope<T> => e !== null)\n }\n\n // ─── Reactive ────────────────────────────────────────────────────────\n\n /**\n * Listen for changes to a specific keyringId's envelope. The callback\n * fires synchronously after every successful local `updateMe` /\n * `setMe` for that principal.\n *\n * Cross-instance changes (a teammate edits their profile on their\n * device, the sync engine pulls the diff onto this device) will fire\n * subscribers when the sync layer replays the write through this API.\n * In v1, subscribers do NOT fire on raw store changes — wire your sync\n * layer to call back through `vault.user.setMe` / `updateMe` if you\n * need that.\n *\n * Pass keyringId `'*'` to fire on every change in the vault.\n */\n subscribe<T = unknown>(\n keyringId: string,\n cb: (env: UserEnvelope<T> | null) => void,\n ): Unsubscribe {\n let listeners = this.listeners.get(keyringId)\n if (!listeners) {\n listeners = new Set()\n this.listeners.set(keyringId, listeners)\n }\n const wrapped: ChangeListener = cb as ChangeListener\n listeners.add(wrapped)\n return () => {\n listeners?.delete(wrapped)\n if (listeners && listeners.size === 0) {\n this.listeners.delete(keyringId)\n }\n }\n }\n\n /**\n * Reactive handle that caches the current value and re-reads on every\n * change for the given keyringId. Convenient for framework bindings:\n *\n * const live = vault.user.live<UserShape>(vault.userId)\n * live.subscribe(env => render(env?.data))\n *\n * Initial value is `null` until the first `current()` call materializes\n * it via `vault.user.get()`. Call `stop()` when done to release the\n * subscription.\n */\n live<T = unknown>(keyringId: string): LiveUserEnvelope<T> {\n let value: UserEnvelope<T> | null = null\n let primed = false\n const unsubscribe = this.subscribe<T>(keyringId, (env) => {\n value = env\n })\n\n return {\n current(): UserEnvelope<T> | null {\n if (!primed) {\n primed = true\n // First call: kick off a read but return synchronously. The\n // subscriber will be re-fired by the next write or the caller\n // can await `vault.user.get()` directly for an immediate read.\n }\n return value\n },\n subscribe: (cb) => this.subscribe<T>(keyringId, cb),\n stop: unsubscribe,\n }\n }\n\n // ─── Internal: change emission ───────────────────────────────────────\n\n private fireChange<T>(keyringId: string, env: UserEnvelope<T> | null): void {\n const targeted = this.listeners.get(keyringId)\n if (targeted) for (const l of targeted) l(env)\n const wildcard = this.listeners.get('*')\n if (wildcard) for (const l of wildcard) l(env)\n }\n}\n\n/**\n * Build the `vault.user` API implementation from its dependencies. This is\n * the real {@link UserApiFactory} — `createNoydb()` dynamically imports it\n * and stashes it on the `Noydb` instance so `Vault`'s constructor can call\n * it synchronously.\n */\nexport const createUserApi: UserApiFactory = (deps: UserApiDeps): VaultUserApi => new UserApi(deps)\n\n/**\n * Recursive plain-object deep merge with delete intent.\n *\n * Patch semantics:\n * - `undefined` — skip the key; source value preserved\n * - `null` — delete the key from output (lodash `_.merge` /\n * Firestore `FieldValue.delete()` semantics)\n * - plain object — recurse (deep merge)\n * - any other value — replace (arrays are replaced, not concatenated)\n *\n * Safe against the JS quirk where an own property explicitly set to\n * `undefined` is iterated by `Object.entries`. We dispatch on the value\n * BEFORE writing, so `{ k: undefined }` triggers the skip branch rather\n * than overwriting `out[k]` with undefined.\n */\nfunction deepMerge<T>(source: T, patch: DeepPartialOrNull<T>): T {\n if (!isPlainObject(source) || !isPlainObject(patch)) {\n // Top-level non-object replace. `null` patch at the leaf level\n // would have been caught by the parent recursion's branch table;\n // at the top level it means \"set the whole envelope to null,\"\n // which the type system already prevents (T extends object).\n return patch as unknown as T\n }\n const out: Record<string, unknown> = { ...(source as Record<string, unknown>) }\n for (const [key, patchVal] of Object.entries(patch as Record<string, unknown>)) {\n if (patchVal === undefined) {\n // Skip — preserve the source value at this key. Matches the\n // pre-existing behavior so callers who never used `null` see no diff.\n continue\n }\n if (patchVal === null) {\n // Delete intent. `delete` rather than `out[key] = undefined`\n // because JSON.stringify drops undefined fields silently and\n // we want the deletion to be visible to consumers iterating\n // the merged object (e.g. `Object.keys(merged.profile)`).\n delete out[key]\n continue\n }\n const sourceVal = (source as Record<string, unknown>)[key]\n if (isPlainObject(patchVal)) {\n // Recurse for any plain-object patch — including the \"source is\n // missing this key\" case. Without recursing through a synthetic\n // empty source, nested `null` deletions in the patch would land\n // as literal `null` values instead of triggering the delete\n // branch (e.g. `{ app: { signature: null } }` against a missing\n // `app` would emit `{ app: { signature: null } }` instead of\n // `{ app: {} }`).\n const recurseSource = isPlainObject(sourceVal) ? sourceVal : {}\n out[key] = deepMerge(recurseSource, patchVal as DeepPartialOrNull<typeof recurseSource>)\n } else {\n out[key] = patchVal\n }\n }\n return out as T\n}\n\nfunction isPlainObject(x: unknown): x is Record<string, unknown> {\n if (x === null || typeof x !== 'object') return false\n if (Array.isArray(x)) return false\n const proto = Object.getPrototypeOf(x) as object | null\n return proto === Object.prototype || proto === null\n}\n"],"mappings":";;;;;;;;;;;;AA6DO,IAAM,UAAN,MAAsC;AAAA;AAAA,EAE1B,YAAY,oBAAI,IAAiC;AAAA,EAEjD;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEjB,YAAY,MAAmB;AAC7B,SAAK,UAAU,KAAK;AACpB,SAAK,YA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","../src/with-audit/guards/immutable-guard.ts","../src/with-audit/guards/transition-guard.ts"],"sourcesContent":["import { ValidationError } from '../../kernel/errors.js'\nimport type { GuardSpec, GuardStrategy } from './types.js'\n\n/**\n * Register a guard for a collection. Guards run on every `put()` /\n * `delete()` for the named collection (after permissions, before\n * encryption) and may:\n *\n * - `check` — block writes by throwing (typically `RecordLockedError`)\n * - `frozenFields` — freeze specific fields once a condition is true\n * - `amendment` — declare an authorized-override path with invariant\n *\n * Pass the returned handle to `createNoydb({ strategies: [...] })`.\n *\n * @see design-history/2026-05-18-guards-design.md\n */\nexport function withGuard<T extends Record<string, unknown>>(\n strategy: GuardSpec<T>,\n): GuardStrategy<T> {\n if (!strategy.collection || strategy.collection.length === 0) {\n throw new ValidationError('withGuard: collection name is required')\n }\n return {\n __noydb_strategy: 'guard',\n spec: strategy,\n }\n}\n","/**\n * `immutableGuard` — declarative WORM / append-only sugar over the guard\n * service.\n *\n * Issued fiscal documents (invoices, DDTs) must be immutable after issue.\n * That is expressible today with a hand-rolled `withGuard` (block on\n * `check`/`onDelete`, allow an admin `amendment`), but the boilerplate is\n * repetitive and easy to get subtly wrong. `immutableGuard` generates\n * exactly that guard from a declarative config, reusing the guard\n * machinery wholesale — `check`/`onDelete` rejection, the ledgered\n * `amendment` override, and composition with `periods`/`history`.\n *\n * ```ts\n * createNoydb({ guardStrategies: [\n * immutableGuard({\n * collection: 'invoices',\n * after: (r) => r.status === 'issued', // immutable once issued\n * }),\n * ] })\n * ```\n *\n * A record is mutable until `after(record)` holds; from then on, updates\n * and deletes throw `RecordLockedError` unless performed inside an\n * `amendment` transaction by an authorized role (the override is\n * ledgered by the guard amendment mechanism). `appendOnly: true` is\n * shorthand for `after: () => true` — immutable from creation.\n */\n\nimport { withGuard } from './with-guard.js'\nimport type { GuardSpec, GuardStrategy, GuardContext, GuardChange } from './types.js'\nimport { RecordLockedError, ValidationError } from '../../kernel/errors.js'\n\nexport interface ImmutableGuardConfig<T extends Record<string, unknown>> {\n /** The collection to make WORM. */\n collection: string\n /**\n * A record becomes immutable once this predicate holds. Evaluated on\n * the *existing* (already-persisted) record, so the write that first\n * makes it true is still allowed; subsequent writes are blocked.\n * Mutually exclusive with `appendOnly`.\n */\n after?: (record: T) => boolean\n /** Shorthand for `after: () => true` — immutable from creation. */\n appendOnly?: boolean\n /** Roles permitted to override via an amendment transaction. Default `['admin', 'owner']`. */\n amendmentRoles?: ReadonlyArray<'admin' | 'owner'>\n /**\n * Optional set-level invariant run over the amendment change-set after\n * the writes execute. Signature matches `GuardSpec.amendment.invariant`\n * exactly: it receives every {before, after} pair touching this\n * collection in the amendment plus the guard context; throwing reverts\n * the whole amendment and surfaces as `InvariantError`.\n *\n * Use this to keep a constraint inviolable EVEN under amendment — e.g.\n * forbid deleting an issued document by re-throwing on any\n * `before !== null && after === null` change, or assert a cross-record\n * sum is preserved. When omitted the amendment is unconditionally\n * allowed (the amendment itself is the sanctioned, ledgered override) —\n * this is the backward-compatible default.\n */\n amendmentInvariant?: (\n changes: ReadonlyArray<GuardChange<T>>,\n ctx: GuardContext<T>,\n ) => Promise<void> | void\n}\n\nfunction recordId(record: Record<string, unknown> | null): string {\n const id = record?.id\n return typeof id === 'string' ? id : ''\n}\n\n/**\n * Build an immutability guard. Pass the returned handle to\n * `createNoydb({ guardStrategies: [...] })`.\n */\nexport function immutableGuard<T extends Record<string, unknown>>(\n config: ImmutableGuardConfig<T>,\n): GuardStrategy<T> {\n const { collection, after, appendOnly, amendmentRoles, amendmentInvariant } = config\n if (appendOnly && after !== undefined) {\n throw new ValidationError('immutableGuard: `after` and `appendOnly` are mutually exclusive')\n }\n if (!appendOnly && after === undefined) {\n throw new ValidationError('immutableGuard: provide `after` or `appendOnly: true`')\n }\n\n const isImmutable: (record: T) => boolean = appendOnly ? () => true : after!\n const reason = appendOnly ? 'append-only collection' : 'record is immutable after issue'\n\n const spec: GuardSpec<T> = {\n collection,\n // Block updates to an already-immutable record. Inserts (existing\n // null) and the transition write that first makes the record\n // immutable are allowed — `after` reads the prior state.\n check: (incoming: T, ctx: GuardContext<T>) => {\n if (ctx.existing !== null && isImmutable(ctx.existing)) {\n throw new RecordLockedError(collection, recordId(incoming as Record<string, unknown>), reason)\n }\n },\n // Block deletes of an immutable record.\n onDelete: (existing: T) => {\n if (isImmutable(existing)) {\n throw new RecordLockedError(collection, recordId(existing as Record<string, unknown>), reason)\n }\n },\n // The authorized override: inside an amendment transaction the\n // check/onDelete are skipped and the change is ledgered. By default\n // there is no extra invariant — the amendment itself is the\n // sanctioned exception. Callers may supply `amendmentInvariant` to\n // keep a constraint inviolable even under amendment (e.g. forbid\n // deletes, or preserve a cross-record sum); a throw reverts the\n // amendment and surfaces as `InvariantError`.\n amendment: {\n roles: amendmentRoles ?? ['admin', 'owner'],\n invariant: amendmentInvariant ?? (() => {\n /* allow — the amendment is the override, and is ledgered */\n }),\n },\n }\n\n return withGuard<T>(spec)\n}\n","/**\n * `transitionGuard` — declarative state-machine sugar over the guard\n * service.\n *\n * Any record with a lifecycle field (invoice `status`, order state,\n * ticket workflow, subscription phase) needs transition validation: a\n * write may only move the field along a declared arc. That is expressible\n * with a hand-rolled `withGuard({ check })`, but every consumer\n * re-implements the same graph lookup + error. `transitionGuard`\n * generates exactly that guard from a state graph, reusing the guard\n * machinery wholesale — `check` rejection, the ledgered `amendment`\n * override, and composition with `periods`/`history`.\n *\n * It generalizes {@link immutableGuard}: WORM is the special case \"every\n * state has no outgoing arcs\", i.e. `transitions` mapping each state to `[]`.\n *\n * ```ts\n * createNoydb({ guardStrategies: [\n * transitionGuard<Sale>({\n * collection: 'sales', field: 'status',\n * transitions: { // absence of an arc = forbidden\n * draft: ['to_verify', 'cancelled'],\n * to_verify: ['proforma', 'draft', 'cancelled'],\n * proforma: ['invoiced', 'cancelled'],\n * invoiced: ['paid'], paid: [], cancelled: [],\n * },\n * initial: ['draft', 'to_verify'], // allowed status on insert\n * }),\n * ] })\n * ```\n *\n * Semantics:\n * - **Insert** (`ctx.existing === null`): `incoming[field]` must be in\n * `initial`. When `initial` is omitted, any value is allowed on insert.\n * - **Update**: the arc `(existing[field] → incoming[field])` must be\n * listed in `transitions[from]`, else `IllegalTransitionError`. A\n * same-value write (`from === to`) is allowed when `allowIdempotent`\n * (default `true`) — so writes that touch other fields without moving\n * state pass.\n * - **Override**: inside an `amendment` transaction by an authorized role\n * the check is skipped and the change is ledgered (mirrors every guard).\n *\n * The status graph is caller-supplied data — no UI, no domain logic.\n */\n\nimport { withGuard } from './with-guard.js'\nimport type { GuardSpec, GuardStrategy, GuardContext, GuardChange } from './types.js'\nimport { IllegalTransitionError, ValidationError } from '../../kernel/errors.js'\n\nexport interface TransitionGuardConfig<T extends Record<string, unknown>> {\n /** The collection whose state field is governed. */\n collection: string\n /** The state field on the record (e.g. `'status'`). */\n field: keyof T & string\n /**\n * The transition graph: each state maps to the states it may move to.\n * A state absent from the map (or mapped to `[]`) is terminal — no\n * outgoing arc, so any non-idempotent write from it is rejected.\n */\n transitions: Readonly<Record<string, readonly string[]>>\n /**\n * States allowed as the initial value on insert (`existing === null`).\n * Omit to allow any value on insert.\n */\n initial?: readonly string[]\n /**\n * Allow a same-value write (`from === to`) on update. Default `true` —\n * lets a put that changes other fields, but not the state, through.\n */\n allowIdempotent?: boolean\n /** Roles permitted to override via an amendment transaction. Default `['admin', 'owner']`. */\n amendmentRoles?: ReadonlyArray<'admin' | 'owner'>\n /**\n * Optional set-level invariant run over the amendment change-set after\n * the writes execute. Signature matches `GuardSpec.amendment.invariant`\n * exactly. When omitted the amendment is unconditionally allowed (the\n * amendment itself is the sanctioned, ledgered override) — the\n * backward-compatible default. Mirrors {@link immutableGuard}.\n */\n amendmentInvariant?: (\n changes: ReadonlyArray<GuardChange<T>>,\n ctx: GuardContext<T>,\n ) => Promise<void> | void\n}\n\nfunction recordId(record: Record<string, unknown> | null): string {\n const id = record?.id\n return typeof id === 'string' ? id : ''\n}\n\nfunction stateOf(record: Record<string, unknown>, field: string): string {\n const v = record[field]\n return typeof v === 'string' ? v : String(v)\n}\n\n/**\n * Build a state-machine transition guard. Pass the returned handle to\n * `createNoydb({ guardStrategies: [...] })`.\n */\nexport function transitionGuard<T extends Record<string, unknown>>(\n config: TransitionGuardConfig<T>,\n): GuardStrategy<T> {\n const { collection, field, transitions, initial, amendmentRoles, amendmentInvariant } = config\n const allowIdempotent = config.allowIdempotent ?? true\n\n if (!field) {\n throw new ValidationError('transitionGuard: `field` is required')\n }\n if (transitions === undefined || typeof transitions !== 'object') {\n throw new ValidationError('transitionGuard: `transitions` must be a state→states map')\n }\n\n const spec: GuardSpec<T> = {\n collection,\n check: (incoming: T, ctx: GuardContext<T>) => {\n const rec = incoming as Record<string, unknown>\n const to = stateOf(rec, field)\n\n // Insert — gate on the allowed initial set (any value if unset).\n if (ctx.existing === null) {\n if (initial !== undefined && !initial.includes(to)) {\n throw new IllegalTransitionError(collection, recordId(rec), '(none)', to)\n }\n return\n }\n\n // Update — the arc (from → to) must be a declared edge.\n const from = stateOf(ctx.existing as Record<string, unknown>, field)\n if (from === to) {\n if (allowIdempotent) return\n throw new IllegalTransitionError(collection, recordId(rec), from, to)\n }\n const allowed = transitions[from] ?? []\n if (!allowed.includes(to)) {\n throw new IllegalTransitionError(collection, recordId(rec), from, to)\n }\n },\n // The authorized override: inside an amendment transaction the check\n // is skipped and the change is ledgered. By default no extra invariant\n // — the amendment itself is the sanctioned exception. Callers may\n // supply `amendmentInvariant` to keep a constraint inviolable even\n // under amendment; a throw reverts the amendment as `InvariantError`.\n amendment: {\n roles: amendmentRoles ?? ['admin', 'owner'],\n invariant: amendmentInvariant ?? (() => {\n /* allow — the amendment is the override, and is ledgered */\n }),\n },\n }\n\n return withGuard<T>(spec)\n}\n"],"mappings":";;;;;;;AAgBO,SAAS,UACd,UACkB;AAClB,MAAI,CAAC,SAAS,cAAc,SAAS,WAAW,WAAW,GAAG;AAC5D,UAAM,IAAI,gBAAgB,wCAAwC;AAAA,EACpE;AACA,SAAO;AAAA,IACL,kBAAkB;AAAA,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|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GASWQ3XG.js";
|
|
5
5
|
import {
|
|
6
6
|
generateULID
|
|
7
7
|
} from "./chunk-ZJADGNYF.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-VCETL77O.js";
|
|
11
11
|
import {
|
|
12
12
|
NOYDB_FORMAT_VERSION
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-W5W6KHN2.js";
|
|
14
14
|
import {
|
|
15
15
|
AttestationError
|
|
16
16
|
} from "./chunk-HNGSV2YC.js";
|
|
@@ -56,4 +56,4 @@ async function issueAttestationCore(ctx, args) {
|
|
|
56
56
|
export {
|
|
57
57
|
issueAttestationCore
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-MWKDOHEF.js.map
|
|
@@ -7,16 +7,16 @@ import {
|
|
|
7
7
|
hashEntry,
|
|
8
8
|
paddedIndex,
|
|
9
9
|
sha256Hex
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VW6ZZGCG.js";
|
|
11
11
|
import {
|
|
12
12
|
openEnvelopeJson
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VN45YLWM.js";
|
|
14
14
|
import {
|
|
15
15
|
encrypt
|
|
16
16
|
} from "./chunk-VCETL77O.js";
|
|
17
17
|
import {
|
|
18
18
|
NOYDB_FORMAT_VERSION
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-W5W6KHN2.js";
|
|
20
20
|
import {
|
|
21
21
|
LedgerContentionError,
|
|
22
22
|
isConflictError
|
|
@@ -717,4 +717,4 @@ export {
|
|
|
717
717
|
applyPatch,
|
|
718
718
|
LedgerStore
|
|
719
719
|
};
|
|
720
|
-
//# sourceMappingURL=chunk-
|
|
720
|
+
//# sourceMappingURL=chunk-NIVEDYJZ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViaGraph
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7TSYBD3E.js";
|
|
4
4
|
import {
|
|
5
5
|
sha256Hex
|
|
6
6
|
} from "./chunk-VCETL77O.js";
|
|
@@ -172,4 +172,4 @@ var DerivationRegistry = class {
|
|
|
172
172
|
export {
|
|
173
173
|
DerivationRegistry
|
|
174
174
|
};
|
|
175
|
-
//# sourceMappingURL=chunk-
|
|
175
|
+
//# sourceMappingURL=chunk-NJDQ4YSV.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
grant,
|
|
3
3
|
revoke
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ERB6NDDW.js";
|
|
5
5
|
import {
|
|
6
6
|
CustodyNotEnabledError
|
|
7
7
|
} from "./chunk-HNGSV2YC.js";
|
|
@@ -16,7 +16,7 @@ function withCustody() {
|
|
|
16
16
|
return host._revokeCustodianImpl(revoke, vault, options, factors);
|
|
17
17
|
},
|
|
18
18
|
async liberate(vault, opts) {
|
|
19
|
-
const { liberateVault } = await import("./liberate-
|
|
19
|
+
const { liberateVault } = await import("./liberate-PX4CAT5V.js");
|
|
20
20
|
return liberateVault(vault, opts);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
@@ -74,4 +74,4 @@ export {
|
|
|
74
74
|
withCustody,
|
|
75
75
|
CustodyApi
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
77
|
+
//# sourceMappingURL=chunk-NKH7GSIH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/with-party/custody/active.ts","../src/with-party/custody/strategy.ts","../src/with-party/custody/index.ts"],"sourcesContent":["/**\n * Enable the sovereign-custody (FR-6) capability.\n * Pass to `createNoydb({ custodyStrategy: withCustody() })` to make\n * `db.grantCustodian` / `db.revokeCustodian` (and the `vault.custody.*` facade\n * that delegates to them) plus `vault.custody.liberate()` live. The heavy\n * `liberateVault` ceremony is dynamically imported here, so it is reached only\n * via opt-in; grant/revoke run the host's own gate + keyring engine.\n */\nimport type { CustodyStrategy } from './strategy.js'\nimport { grant as grantEngine, revoke as revokeEngine } from '../team/keyring.js'\n\nexport function withCustody(): CustodyStrategy {\n return {\n async grantCustodian(host, vault, options, factors) {\n return host._grantCustodianImpl(grantEngine, vault, options, factors)\n },\n async revokeCustodian(host, vault, options, factors) {\n return host._revokeCustodianImpl(revokeEngine, vault, options, factors)\n },\n async liberate(vault, opts) {\n const { liberateVault } = await import('./liberate.js')\n return liberateVault(vault, opts)\n },\n }\n}\n","/**\n * Sovereign-custody (FR-6) capability strategy — the three on-demand\n * operations the custody surface routes through: minting a custodian\n * (`grantCustodian`), removing one (`revokeCustodian`), and the audited\n * ownership-claim ceremony (`liberate`). The active engine ({@link withCustody})\n * runs the grant/revoke impls the host exposes and dynamically imports the\n * heavy `liberateVault` ceremony (keeping it out of the floor bundle);\n * {@link NO_CUSTODY} throws.\n *\n * `Noydb.grantCustodian` / `Noydb.revokeCustodian` delegate here (passing\n * themselves as the {@link CustodyHost}), and `vault.custody.liberate` delegates\n * here with its {@link Vault}. An un-opted-in caller hits `NO_CUSTODY`'s throw.\n *\n * Note: the lower-level `liberateVault` FREE FUNCTION (exported from\n * `custody/liberate.ts`) stays ungated — it has no `createNoydb` instance to\n * gate against (the same carve-out as the `openSealedRecord` host opener). Only\n * the instance surfaces (`db.grantCustodian` / `db.revokeCustodian` /\n * `vault.custody.*`) are the capability.\n * @internal\n */\nimport type { GrantOptions, RevokeOptions, FactorProofBundle, NoydbStore } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { UnlockedKeyring } from '../team/keyring.js'\nimport type { GrantCustodianOptions } from './index.js'\nimport type { LiberateOptions, LiberateResult } from './liberate.js'\nimport { CustodyNotEnabledError } from '../../kernel/errors.js'\n\n/**\n * The grant/revoke engine the strategy runs when opted in — implemented by\n * `Noydb` (`_grantCustodianImpl` / `_revokeCustodianImpl` hold the gate +\n * keyring logic; the public `grantCustodian` / `revokeCustodian` route through\n * the strategy). Since the #267 team split the keyring grant/revoke engines\n * are passed IN by `withCustody()` (statically linked there, not in the\n * kernel) so the single-user floor never carries them.\n */\nexport interface CustodyHost {\n _grantCustodianImpl(\n engine: (adapter: NoydbStore, vault: string, callerKeyring: UnlockedKeyring, options: GrantOptions) => Promise<void>,\n vault: string,\n options: GrantCustodianOptions,\n factors?: FactorProofBundle,\n ): Promise<void>\n _revokeCustodianImpl(\n engine: (adapter: NoydbStore, vault: string, callerKeyring: UnlockedKeyring, options: RevokeOptions) => Promise<void>,\n vault: string,\n options: RevokeOptions,\n factors?: FactorProofBundle,\n ): Promise<void>\n}\n\nexport interface CustodyStrategy {\n grantCustodian(host: CustodyHost, vault: string, options: GrantCustodianOptions, factors?: FactorProofBundle): Promise<void>\n revokeCustodian(host: CustodyHost, vault: string, options: RevokeOptions, factors?: FactorProofBundle): Promise<void>\n liberate(vault: Vault, opts: LiberateOptions): Promise<LiberateResult>\n}\n\n/**\n * No-op stub — the floor default. Every custody operation throws\n * {@link CustodyNotEnabledError}; opt in with `custodyStrategy: withCustody()`\n * in createNoydb. @internal\n */\nexport const NO_CUSTODY: CustodyStrategy = {\n async grantCustodian() { throw new CustodyNotEnabledError() },\n async revokeCustodian() { throw new CustodyNotEnabledError() },\n async liberate() { throw new CustodyNotEnabledError() },\n}\n","/**\n * Public `vault.custody.*` API surface (FR-6).\n *\n * The custody namespace is the vault-instance face of the FR-6 sovereign-custody\n * model — it mirrors `vault.user.*` exactly: a thin delegation shell with NO\n * business logic. The Vault constructs one `CustodyApi` per session, injecting\n * closures that bind the vault name / keyring into the genuinely-core\n * implementations (`Noydb.grantCustodian` / `Noydb.revokeCustodian` and the\n * `liberateVault` ceremony). Each method just forwards to its injected callback.\n *\n * Three operations:\n * - `grantCustodian(opts)` — owner-only: mint a `custodian` who operates the\n * vault fully but can never grant / rotate / sever / extract.\n * - `revokeCustodian(opts)` — owner-only: remove a custodian.\n * - `liberate(opts)` — custodian-only: audited claim of ownership over a\n * sealed-owner (Deed) vault (mints a DISTINCT new owner; ledger-audited).\n *\n * Provisioning a Deed (`createDeedOwner`) is deliberately NOT on this class: it\n * is a store-level operation that mints the vault's first owner, so there is no\n * vault instance (and thus no custody namespace) yet — it stays the exported\n * `team/deed.ts` function.\n *\n * @see
|
|
1
|
+
{"version":3,"sources":["../src/with-party/custody/active.ts","../src/with-party/custody/strategy.ts","../src/with-party/custody/index.ts"],"sourcesContent":["/**\n * Enable the sovereign-custody (FR-6) capability.\n * Pass to `createNoydb({ custodyStrategy: withCustody() })` to make\n * `db.grantCustodian` / `db.revokeCustodian` (and the `vault.custody.*` facade\n * that delegates to them) plus `vault.custody.liberate()` live. The heavy\n * `liberateVault` ceremony is dynamically imported here, so it is reached only\n * via opt-in; grant/revoke run the host's own gate + keyring engine.\n */\nimport type { CustodyStrategy } from './strategy.js'\nimport { grant as grantEngine, revoke as revokeEngine } from '../team/keyring.js'\n\nexport function withCustody(): CustodyStrategy {\n return {\n async grantCustodian(host, vault, options, factors) {\n return host._grantCustodianImpl(grantEngine, vault, options, factors)\n },\n async revokeCustodian(host, vault, options, factors) {\n return host._revokeCustodianImpl(revokeEngine, vault, options, factors)\n },\n async liberate(vault, opts) {\n const { liberateVault } = await import('./liberate.js')\n return liberateVault(vault, opts)\n },\n }\n}\n","/**\n * Sovereign-custody (FR-6) capability strategy — the three on-demand\n * operations the custody surface routes through: minting a custodian\n * (`grantCustodian`), removing one (`revokeCustodian`), and the audited\n * ownership-claim ceremony (`liberate`). The active engine ({@link withCustody})\n * runs the grant/revoke impls the host exposes and dynamically imports the\n * heavy `liberateVault` ceremony (keeping it out of the floor bundle);\n * {@link NO_CUSTODY} throws.\n *\n * `Noydb.grantCustodian` / `Noydb.revokeCustodian` delegate here (passing\n * themselves as the {@link CustodyHost}), and `vault.custody.liberate` delegates\n * here with its {@link Vault}. An un-opted-in caller hits `NO_CUSTODY`'s throw.\n *\n * Note: the lower-level `liberateVault` FREE FUNCTION (exported from\n * `custody/liberate.ts`) stays ungated — it has no `createNoydb` instance to\n * gate against (the same carve-out as the `openSealedRecord` host opener). Only\n * the instance surfaces (`db.grantCustodian` / `db.revokeCustodian` /\n * `vault.custody.*`) are the capability.\n * @internal\n */\nimport type { GrantOptions, RevokeOptions, FactorProofBundle, NoydbStore } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { UnlockedKeyring } from '../team/keyring.js'\nimport type { GrantCustodianOptions } from './index.js'\nimport type { LiberateOptions, LiberateResult } from './liberate.js'\nimport { CustodyNotEnabledError } from '../../kernel/errors.js'\n\n/**\n * The grant/revoke engine the strategy runs when opted in — implemented by\n * `Noydb` (`_grantCustodianImpl` / `_revokeCustodianImpl` hold the gate +\n * keyring logic; the public `grantCustodian` / `revokeCustodian` route through\n * the strategy). Since the #267 team split the keyring grant/revoke engines\n * are passed IN by `withCustody()` (statically linked there, not in the\n * kernel) so the single-user floor never carries them.\n */\nexport interface CustodyHost {\n _grantCustodianImpl(\n engine: (adapter: NoydbStore, vault: string, callerKeyring: UnlockedKeyring, options: GrantOptions) => Promise<void>,\n vault: string,\n options: GrantCustodianOptions,\n factors?: FactorProofBundle,\n ): Promise<void>\n _revokeCustodianImpl(\n engine: (adapter: NoydbStore, vault: string, callerKeyring: UnlockedKeyring, options: RevokeOptions) => Promise<void>,\n vault: string,\n options: RevokeOptions,\n factors?: FactorProofBundle,\n ): Promise<void>\n}\n\nexport interface CustodyStrategy {\n grantCustodian(host: CustodyHost, vault: string, options: GrantCustodianOptions, factors?: FactorProofBundle): Promise<void>\n revokeCustodian(host: CustodyHost, vault: string, options: RevokeOptions, factors?: FactorProofBundle): Promise<void>\n liberate(vault: Vault, opts: LiberateOptions): Promise<LiberateResult>\n}\n\n/**\n * No-op stub — the floor default. Every custody operation throws\n * {@link CustodyNotEnabledError}; opt in with `custodyStrategy: withCustody()`\n * in createNoydb. @internal\n */\nexport const NO_CUSTODY: CustodyStrategy = {\n async grantCustodian() { throw new CustodyNotEnabledError() },\n async revokeCustodian() { throw new CustodyNotEnabledError() },\n async liberate() { throw new CustodyNotEnabledError() },\n}\n","/**\n * Public `vault.custody.*` API surface (FR-6).\n *\n * The custody namespace is the vault-instance face of the FR-6 sovereign-custody\n * model — it mirrors `vault.user.*` exactly: a thin delegation shell with NO\n * business logic. The Vault constructs one `CustodyApi` per session, injecting\n * closures that bind the vault name / keyring into the genuinely-core\n * implementations (`Noydb.grantCustodian` / `Noydb.revokeCustodian` and the\n * `liberateVault` ceremony). Each method just forwards to its injected callback.\n *\n * Three operations:\n * - `grantCustodian(opts)` — owner-only: mint a `custodian` who operates the\n * vault fully but can never grant / rotate / sever / extract.\n * - `revokeCustodian(opts)` — owner-only: remove a custodian.\n * - `liberate(opts)` — custodian-only: audited claim of ownership over a\n * sealed-owner (Deed) vault (mints a DISTINCT new owner; ledger-audited).\n *\n * Provisioning a Deed (`createDeedOwner`) is deliberately NOT on this class: it\n * is a store-level operation that mints the vault's first owner, so there is no\n * vault instance (and thus no custody namespace) yet — it stays the exported\n * `team/deed.ts` function.\n *\n * @see design-history/2026-06-17-fr6-deed-custodian-liberate-design.md\n * @module\n */\nimport type { GrantOptions, RevokeOptions, FactorProofBundle } from '../../kernel/types.js'\nimport type { LiberateOptions, LiberateResult } from './liberate.js'\n\n/** Options for `vault.custody.grantCustodian` — a grant with the role fixed to `custodian`. */\nexport type GrantCustodianOptions = Omit<GrantOptions, 'role'>\n\n// Capability opt-in seam (S4): grant/revoke custodian + liberate throw\n// CustodyNotEnabledError unless `custodyStrategy: withCustody()` is opted in.\nexport { withCustody } from './active.js'\nexport { NO_CUSTODY, type CustodyStrategy, type CustodyHost } from './strategy.js'\nexport { CustodyNotEnabledError } from '../../kernel/errors.js'\n\n/**\n * Implementation behind `vault.custody`. Constructed once per Vault. Holds the\n * injected, vault-bound implementations in closure; every method delegates with\n * no added logic (the owner-only / custodian-only / gate checks all live in the\n * injected implementations — `Noydb.grantCustodian` etc. and `liberateVault`).\n */\nexport class CustodyApi {\n constructor(\n /** Bound `Noydb.grantCustodian(this.name, ...)` — owner-only, gated. */\n private readonly _grantCustodian: (options: GrantCustodianOptions, factors?: FactorProofBundle) => Promise<void>,\n /** Bound `Noydb.revokeCustodian(this.name, ...)` — owner-only, gated. */\n private readonly _revokeCustodian: (options: RevokeOptions, factors?: FactorProofBundle) => Promise<void>,\n /** Bound `liberateVault(this, ...)` — custodian-only audited ownership claim. */\n private readonly _liberate: (opts: LiberateOptions) => Promise<LiberateResult>,\n ) {}\n\n /**\n * Owner-only: grant the FR-6 `custodian` role. The custodian operates every\n * collection (rw + access) but is provably unable to grant / revoke / rotate /\n * extract-and-sever. Defended in depth (gate + owner-only role check) inside\n * the injected `Noydb.grantCustodian`.\n */\n async grantCustodian(options: GrantCustodianOptions, factors?: FactorProofBundle): Promise<void> {\n return this._grantCustodian(options, factors)\n }\n\n /** Owner-only: revoke a custodian. */\n async revokeCustodian(options: RevokeOptions, factors?: FactorProofBundle): Promise<void> {\n return this._revokeCustodian(options, factors)\n }\n\n /**\n * Custodian-only: the audited claim of ownership over a sealed-owner (Deed)\n * vault. Mints a DISTINCT new owner re-wrapping the incumbent DEKs under a\n * fresh KEK (the latent owner is never impersonated), ledger-audited. See\n * {@link liberateVault}.\n */\n async liberate(opts: LiberateOptions): Promise<LiberateResult> {\n return this._liberate(opts)\n }\n}\n"],"mappings":";;;;;;;;;AAWO,SAAS,cAA+B;AAC7C,SAAO;AAAA,IACL,MAAM,eAAe,MAAM,OAAO,SAAS,SAAS;AAClD,aAAO,KAAK,oBAAoB,OAAa,OAAO,SAAS,OAAO;AAAA,IACtE;AAAA,IACA,MAAM,gBAAgB,MAAM,OAAO,SAAS,SAAS;AACnD,aAAO,KAAK,qBAAqB,QAAc,OAAO,SAAS,OAAO;AAAA,IACxE;AAAA,IACA,MAAM,SAAS,OAAO,MAAM;AAC1B,YAAM,EAAE,cAAc,IAAI,MAAM,OAAO,wBAAe;AACtD,aAAO,cAAc,OAAO,IAAI;AAAA,IAClC;AAAA,EACF;AACF;;;ACqCO,IAAM,aAA8B;AAAA,EACzC,MAAM,iBAAiB;AAAE,UAAM,IAAI,uBAAuB;AAAA,EAAE;AAAA,EAC5D,MAAM,kBAAkB;AAAE,UAAM,IAAI,uBAAuB;AAAA,EAAE;AAAA,EAC7D,MAAM,WAAW;AAAE,UAAM,IAAI,uBAAuB;AAAA,EAAE;AACxD;;;ACtBO,IAAM,aAAN,MAAiB;AAAA,EACtB,YAEmB,iBAEA,kBAEA,WACjB;AALiB;AAEA;AAEA;AAAA,EAChB;AAAA,EALgB;AAAA,EAEA;AAAA,EAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASnB,MAAM,eAAe,SAAgC,SAA4C;AAC/F,WAAO,KAAK,gBAAgB,SAAS,OAAO;AAAA,EAC9C;AAAA;AAAA,EAGA,MAAM,gBAAgB,SAAwB,SAA4C;AACxF,WAAO,KAAK,iBAAiB,SAAS,OAAO;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,SAAS,MAAgD;AAC7D,WAAO,KAAK,UAAU,IAAI;AAAA,EAC5B;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOYDB_FORMAT_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W5W6KHN2.js";
|
|
4
4
|
|
|
5
5
|
// src/kernel/enclave/record-keys/tombstone.ts
|
|
6
6
|
function isTombstoneShape(envelope) {
|
|
@@ -42,4 +42,4 @@ export {
|
|
|
42
42
|
isDeleteMarker,
|
|
43
43
|
buildDeleteMarker
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-NWCGDAV6.js.map
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-KHKKD62N.js";
|
|
5
5
|
import {
|
|
6
6
|
derivePersistedSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Z45YRGFO.js";
|
|
8
8
|
import {
|
|
9
9
|
loadPersistedSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4MC5JRRX.js";
|
|
11
11
|
|
|
12
12
|
// src/with-shape/introspection/walk.ts
|
|
13
13
|
var INTERNAL_PREFIX = "_";
|
|
@@ -238,4 +238,4 @@ function summariseAggregateOp(value) {
|
|
|
238
238
|
export {
|
|
239
239
|
dumpVaultSchema
|
|
240
240
|
};
|
|
241
|
-
//# sourceMappingURL=chunk-
|
|
241
|
+
//# sourceMappingURL=chunk-P7OG2ETF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOYDB_FORMAT_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W5W6KHN2.js";
|
|
4
4
|
|
|
5
5
|
// src/with-party/policy/storage.ts
|
|
6
6
|
var META_COLLECTION = "_meta";
|
|
@@ -39,4 +39,4 @@ export {
|
|
|
39
39
|
loadVaultPolicy,
|
|
40
40
|
saveVaultPolicy
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-PJNTR2NV.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
envelopePayloadHash
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VW6ZZGCG.js";
|
|
4
4
|
import {
|
|
5
5
|
NOYDB_FORMAT_VERSION
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-W5W6KHN2.js";
|
|
7
7
|
import {
|
|
8
8
|
DictKeyMissingError,
|
|
9
9
|
PermissionDeniedError
|
|
@@ -389,4 +389,4 @@ export {
|
|
|
389
389
|
dictCollectionName,
|
|
390
390
|
LookupHandle
|
|
391
391
|
};
|
|
392
|
-
//# sourceMappingURL=chunk-
|
|
392
|
+
//# sourceMappingURL=chunk-PRDRGL73.js.map
|
|
@@ -201,7 +201,7 @@ var engineCtx = (ctx) => ({
|
|
|
201
201
|
function withClassified() {
|
|
202
202
|
return {
|
|
203
203
|
async reveal(ctx, id, field) {
|
|
204
|
-
const { revealSealedField } = await import("./reveal-
|
|
204
|
+
const { revealSealedField } = await import("./reveal-CMOJY4VO.js");
|
|
205
205
|
const value = await revealSealedField({
|
|
206
206
|
collection: ctx.collection,
|
|
207
207
|
encrypted: ctx.encrypted,
|
|
@@ -244,4 +244,4 @@ export {
|
|
|
244
244
|
classified,
|
|
245
245
|
withClassified
|
|
246
246
|
};
|
|
247
|
-
//# sourceMappingURL=chunk-
|
|
247
|
+
//# sourceMappingURL=chunk-PVU7LW5L.js.map
|