@noy-db/hub 0.6.0-pre.13 → 0.6.0-pre.14
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-6IBOZN6F.js +20 -0
- package/dist/attestation/index.js +19 -19
- package/dist/{backup-JNCS4OMI.js → backup-FNAYQMLF.js} +12 -12
- package/dist/blobs/index.js +13 -13
- package/dist/broker/index.js +12 -12
- package/dist/cargo/index.js +30 -30
- package/dist/{chunk-M3VRXAVD.js → chunk-42IDLU5V.js} +2 -2
- package/dist/{chunk-FWZ7WYAH.js → chunk-4444HN72.js} +4 -4
- package/dist/{chunk-WX5ABQSL.js → chunk-466KGOQB.js} +2 -2
- package/dist/{chunk-ZJADGNYF.js → chunk-4AOERLTV.js} +1 -1
- package/dist/chunk-4AOERLTV.js.map +1 -0
- package/dist/{chunk-GAELDPIH.js → chunk-4LNFXGNW.js} +63 -63
- package/dist/chunk-4LNFXGNW.js.map +1 -0
- package/dist/{chunk-YZC4DWJQ.js → chunk-4NI5PR5S.js} +2 -2
- package/dist/{chunk-ZFO26ZZR.js → chunk-4YUIVHII.js} +5 -5
- package/dist/{chunk-2KX6MT3D.js → chunk-5NKSNW25.js} +2 -2
- package/dist/{chunk-ALBA4CET.js → chunk-5SK5AFYH.js} +2 -2
- package/dist/{chunk-DKJXAZWF.js → chunk-6U7M7AX6.js} +2 -2
- package/dist/{chunk-7GWC6RI5.js → chunk-6ZFTVY3O.js} +1 -1
- package/dist/chunk-6ZFTVY3O.js.map +1 -0
- package/dist/{chunk-MLMDO4OQ.js → chunk-7EIPPOEL.js} +2 -2
- package/dist/{chunk-KOM2GMTW.js → chunk-7J6YERYT.js} +10 -10
- package/dist/{chunk-R6V4M2JO.js → chunk-7VIIEXQ2.js} +12 -12
- package/dist/chunk-7VIIEXQ2.js.map +1 -0
- package/dist/{chunk-YRTS5MWY.js → chunk-A4JJUWSV.js} +3 -3
- package/dist/{chunk-VFBJMTLJ.js → chunk-AFSMT3WI.js} +3 -3
- package/dist/{chunk-C5N3ZWGJ.js → chunk-AMKCY454.js} +2 -2
- package/dist/{chunk-SX4HK6FU.js → chunk-BVYRPAB2.js} +7 -7
- package/dist/{chunk-IHKRTVJQ.js → chunk-C66T4W5P.js} +3 -3
- package/dist/{chunk-M3XBZPLU.js → chunk-C6MI5OCF.js} +6 -6
- package/dist/{chunk-2KHT6EP3.js → chunk-CAJ7QAPC.js} +3 -3
- package/dist/{chunk-DMRDPZQ7.js → chunk-CK6Z5DJQ.js} +4 -4
- package/dist/{chunk-EPUDMBVL.js → chunk-CK7IRIRY.js} +5 -5
- package/dist/{chunk-C6RYZ4ZD.js → chunk-CNA3QRLM.js} +2 -2
- package/dist/chunk-CNA3QRLM.js.map +1 -0
- package/dist/{chunk-KYIXANXU.js → chunk-CWX6YIX5.js} +7 -7
- package/dist/{chunk-TJGB5I4J.js → chunk-D763JZRO.js} +3 -3
- package/dist/{chunk-AS53PYO6.js → chunk-DZWRTWN2.js} +81 -81
- package/dist/{chunk-AS53PYO6.js.map → chunk-DZWRTWN2.js.map} +1 -1
- package/dist/{chunk-OERLXUF5.js → chunk-ESABIXMQ.js} +4 -4
- package/dist/{chunk-H6UFT22R.js → chunk-FMZV43QY.js} +4 -4
- package/dist/{chunk-YRMA7CJH.js → chunk-FSZPQCDR.js} +3 -3
- package/dist/{chunk-65NL6YZM.js → chunk-GBTLOHJM.js} +5 -5
- package/dist/{chunk-4TLFWYZG.js → chunk-GE2AGI67.js} +3 -3
- package/dist/{chunk-Y6C67PJX.js → chunk-GJX6DOGD.js} +5 -5
- package/dist/{chunk-PV76W4KB.js → chunk-GLS7OSZT.js} +7 -7
- package/dist/{chunk-IQVVUZ6Z.js → chunk-H545OIWE.js} +2 -2
- package/dist/{chunk-CM7MGRP3.js → chunk-HJAFOPTN.js} +6 -6
- package/dist/{chunk-HRQF23XS.js → chunk-HNOBRU24.js} +2 -2
- package/dist/{chunk-GNMGX4FY.js → chunk-HVPQ5QIZ.js} +8 -8
- package/dist/{chunk-CUEWN4FX.js → chunk-HVR74IBG.js} +2 -2
- package/dist/{chunk-CT35TQV7.js → chunk-I64WQSN3.js} +7 -7
- package/dist/chunk-I64WQSN3.js.map +1 -0
- package/dist/{chunk-LVLXWIBF.js → chunk-IMYGJ5HU.js} +2 -2
- package/dist/{chunk-OFGLLNQW.js → chunk-IYYGLI2K.js} +6 -6
- package/dist/{chunk-LOLK4EAT.js → chunk-JBMSNYOS.js} +5 -5
- package/dist/{chunk-JTZRLD47.js → chunk-JU3JKOY5.js} +3 -3
- package/dist/{chunk-A7BP42KY.js → chunk-K2MR7ROB.js} +2 -2
- package/dist/{chunk-M44ZBLL3.js → chunk-KCLNKE4W.js} +6 -6
- package/dist/{chunk-OGQSJJWF.js → chunk-KPD6HNQD.js} +12 -12
- package/dist/chunk-KPD6HNQD.js.map +1 -0
- package/dist/{chunk-A5AB7EZU.js → chunk-KTCQKXHW.js} +3 -3
- package/dist/{chunk-GGM3JCEG.js → chunk-LBQIKMBH.js} +2 -2
- package/dist/{chunk-S7UTUFPU.js → chunk-LWOSNMHE.js} +8 -8
- package/dist/{chunk-4TRAQICY.js → chunk-MVG67SMN.js} +2 -2
- package/dist/{chunk-45UIDGPY.js → chunk-N6OJLR2M.js} +3 -3
- package/dist/{chunk-OOOU3F5Y.js → chunk-P2UFDX2F.js} +5 -5
- package/dist/{chunk-LQEHLFFF.js → chunk-PCXAUC65.js} +2 -2
- package/dist/{chunk-V3WLQXDF.js → chunk-PJ5TGJ7U.js} +2 -2
- package/dist/{chunk-Z7PW63ZC.js → chunk-QEYXKICE.js} +2 -2
- package/dist/{chunk-LQFNJRMI.js → chunk-QI2KXQOM.js} +2 -2
- package/dist/{chunk-MUE2CQX2.js → chunk-QJYTGH5V.js} +7 -7
- package/dist/{chunk-Y2FDCDLY.js → chunk-QLMUW7OC.js} +2 -2
- package/dist/{chunk-MRDQ6HJS.js → chunk-QQP5KJMS.js} +4 -4
- package/dist/{chunk-WJD5VF2N.js → chunk-QTDAPDDV.js} +2 -2
- package/dist/{chunk-Q4AU3NJE.js → chunk-QWNYUTI2.js} +2 -2
- package/dist/{chunk-H3BDH7DA.js → chunk-R7E7X4CQ.js} +3 -3
- package/dist/{chunk-3IJK5FRG.js → chunk-RBTZLXZJ.js} +2 -2
- package/dist/{chunk-6FXQZ3T7.js → chunk-RDPZMUCX.js} +2 -2
- package/dist/{chunk-4WXISHDI.js → chunk-RJTGXZT6.js} +2 -2
- package/dist/{chunk-4R4N5PRM.js → chunk-ROFEKKMI.js} +4 -4
- package/dist/{chunk-7DK6CYXO.js → chunk-RVTOCAHQ.js} +2 -2
- package/dist/{chunk-J6EBSGIR.js → chunk-RWPNRCK2.js} +2 -2
- package/dist/{chunk-YVGJLRXN.js → chunk-S6CP5FWF.js} +2 -2
- package/dist/{chunk-LZHDIO64.js → chunk-S77LTWCZ.js} +7 -7
- package/dist/{chunk-TEOL6VAV.js → chunk-SGEI3IJK.js} +2 -2
- package/dist/{chunk-EWTAUGAK.js → chunk-SZZEDEIU.js} +3 -3
- package/dist/{chunk-ZG7MXW5J.js → chunk-T7AEAFEE.js} +4 -4
- package/dist/{chunk-KMLMEIWV.js → chunk-THYGVKZB.js} +7 -7
- package/dist/chunk-THYGVKZB.js.map +1 -0
- package/dist/{chunk-TAFRRVFR.js → chunk-TQ7IRULX.js} +2 -2
- package/dist/{chunk-MVWO6KXU.js → chunk-TQLYMYOK.js} +2 -2
- package/dist/{chunk-MSCXCF4T.js → chunk-UTQLKPBS.js} +6 -6
- package/dist/{chunk-QLFLX5VA.js → chunk-V2BEYLNR.js} +6 -6
- package/dist/{chunk-P7A2FX5Y.js → chunk-V4M4BZNW.js} +2 -2
- package/dist/{chunk-PLJ622XY.js → chunk-VTTRWLOR.js} +2 -2
- package/dist/{chunk-QNGRTWGM.js → chunk-VVMSDWRG.js} +5 -5
- package/dist/{chunk-PRN65IDE.js → chunk-WLZKVY33.js} +6 -6
- package/dist/{chunk-3EFQV2XQ.js → chunk-XHX3NTRP.js} +4 -4
- package/dist/{chunk-CFM6GBNF.js → chunk-Y7MJSOZ7.js} +5 -5
- package/dist/{chunk-CFM6GBNF.js.map → chunk-Y7MJSOZ7.js.map} +1 -1
- package/dist/{chunk-ALDFGMO7.js → chunk-YDJXGYYA.js} +2 -2
- package/dist/{chunk-VDQZKDED.js → chunk-YGJZLOSR.js} +2 -2
- package/dist/{chunk-IONRKUH4.js → chunk-YH65A6WM.js} +2 -2
- package/dist/{chunk-YKDAFWWS.js → chunk-YKEJ5P3H.js} +5 -5
- package/dist/{chunk-J5LO2H42.js → chunk-YODIXNV4.js} +4 -4
- package/dist/{chunk-37M5QBAS.js → chunk-YVOW35HH.js} +2 -2
- package/dist/{chunk-NW3PSKAN.js → chunk-YZ7BRD26.js} +2 -2
- package/dist/{chunk-2BBXXSAD.js → chunk-Z3U2YVNM.js} +4 -4
- package/dist/{chunk-SX2ZKKZS.js → chunk-ZHDMT2MJ.js} +6 -6
- package/dist/{chunk-EZYLQKHP.js → chunk-ZWPUYBNK.js} +8 -8
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-IYWA7L6U.js → classified-marker-3STDEUFT.js} +3 -3
- package/dist/collection-facade-SGTS3TRS.js +45 -0
- package/dist/{computed-B3BJQSU5.js → computed-5E2OM6EN.js} +3 -3
- package/dist/consent/index.js +10 -10
- package/dist/cover/index.js +3 -3
- package/dist/custody/index.js +11 -11
- package/dist/{dead-filter-QV7ORQS3.js → dead-filter-ZNWVGV5U.js} +2 -2
- package/dist/debug/index.js +1 -1
- package/dist/{delegation-UPE5PUKB.js → delegation-LZWFOST7.js} +11 -11
- package/dist/derivations/index.js +12 -12
- package/dist/derive-BWXA2L7D.js +22 -0
- package/dist/directory/index.js +10 -10
- package/dist/{dispatch-BW2W2LXV.js → dispatch-S34AUC43.js} +18 -18
- package/dist/{dispatch-OBZS537P.js → dispatch-TIYW3UDN.js} +5 -5
- package/dist/{enclave-LXFVDJLO.js → enclave-Y6GMYQMS.js} +9 -9
- package/dist/executor-JDMH2IGK.js +29 -0
- package/dist/executor-PCZN2LTY.js +9 -0
- package/dist/executor-WFTHIDT7.js +9 -0
- package/dist/export-accessible-U6GXZZMQ.js +23 -0
- package/dist/extract-partition-IDI6NDUR.js +38 -0
- package/dist/{fanout-sidecar-BD4ZSPER.js → fanout-sidecar-BVFOEJTP.js} +9 -9
- package/dist/find-VBNMB42N.js +11 -0
- package/dist/forget/index.js +9 -9
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +12 -12
- package/dist/i18n/index.js +14 -14
- package/dist/index.d.ts +7 -7
- package/dist/index.js +103 -103
- package/dist/indexing/index.js +2 -2
- package/dist/introspection/index.js +11 -11
- package/dist/issue-TEGTAN7N.js +19 -0
- package/dist/kernel/errors.d.ts +6 -6
- package/dist/kernel/types.d.ts +1 -1
- package/dist/kernel/vault.d.ts +4 -4
- package/dist/{ledger-6EMFGJRU.js → ledger-NFLBQASD.js} +11 -11
- package/dist/liberate-SG2PPGAJ.js +24 -0
- package/dist/{link-set-GUKFJQGW.js → link-set-IPS57KDM.js} +11 -11
- package/dist/{managed-secret-T6X4VHB2.js → managed-secret-GFYGPLNI.js} +3 -3
- package/dist/materialized-views/index.js +20 -20
- package/dist/money/index.js +4 -4
- package/dist/noydb-TN2VIJJO.js +83 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +12 -12
- package/dist/pod/index.js +71 -71
- package/dist/{bundle-handle-RJZXOFXE.js → pod-handle-I4ZME246.js} +6 -6
- package/dist/pod-handle-I4ZME246.js.map +1 -0
- package/dist/policy/index.js +4 -4
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-XKYJDDZL.js → post-register-JUSV3X4E.js} +6 -6
- package/dist/query/index.js +3 -3
- package/dist/reduce/index.js +4 -4
- package/dist/register-UTMPUAQW.js +32 -0
- package/dist/registry-B2S4UNUI.js +19 -0
- package/dist/registry-E4FM32KD.js +9 -0
- package/dist/registry-HACMULJJ.js +9 -0
- package/dist/registry-NDLBGQLJ.js +18 -0
- package/dist/request-withdrawal-Q5G43PR7.js +31 -0
- package/dist/{reveal-IN2ZBB5U.js → reveal-YJU7GUYJ.js} +6 -6
- package/dist/revoke-NXOUPYS3.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +2 -2
- package/dist/sealed-record/index.js +12 -12
- package/dist/search/index.js +4 -4
- package/dist/{seed-D623RNG3.js → seed-XXLR4KXU.js} +11 -11
- package/dist/sequence/index.js +9 -9
- package/dist/session/index.js +10 -10
- package/dist/shadow/index.js +2 -2
- package/dist/share-link/index.js +1 -1
- package/dist/signer-FCGAUB6E.js +25 -0
- package/dist/snapshots/index.js +10 -10
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-O3CZVYMO.js → stale-OT5NMBXU.js} +10 -10
- package/dist/storage-EWWIFB43.js +23 -0
- package/dist/{store-coordination-provider-RKBDHHN4.js → store-coordination-provider-PPLVM2I2.js} +3 -3
- package/dist/sync/index.js +10 -10
- package/dist/team/index.js +14 -14
- package/dist/tiers/index.js +10 -10
- package/dist/to/index.js +1 -1
- package/dist/transactions/index.js +4 -4
- package/dist/{ulid-PTAIMDG4.js → ulid-VQW6ERQN.js} +2 -2
- package/dist/util/index.js +1 -1
- package/dist/{verify-GB7SBYC3.js → verify-SHJXGZGM.js} +5 -5
- package/dist/walk-4NIT2ZBH.js +21 -0
- package/dist/with-cargo/adopt-partition.d.ts +1 -1
- package/dist/with-cargo/extract-partition.d.ts +1 -1
- package/dist/with-cargo/index.d.ts +1 -1
- package/dist/with-party/team/index.d.ts +1 -1
- package/dist/with-party/team/keyring.d.ts +2 -2
- package/dist/with-pod/format.d.ts +10 -10
- package/dist/with-pod/index.d.ts +7 -7
- package/dist/with-pod/open.d.ts +2 -2
- package/dist/with-pod/{bundle-handle.d.ts → pod-handle.d.ts} +2 -2
- package/dist/with-pod/{bundle.d.ts → pod.d.ts} +8 -8
- package/dist/with-pod/ulid.d.ts +1 -1
- package/dist/withdraw-accessible-LJG66PZQ.js +28 -0
- package/package.json +3 -3
- package/dist/api-FYF5WE2E.js +0 -20
- package/dist/bundle-handle-RJZXOFXE.js.map +0 -1
- package/dist/chunk-7GWC6RI5.js.map +0 -1
- package/dist/chunk-C6RYZ4ZD.js.map +0 -1
- package/dist/chunk-CT35TQV7.js.map +0 -1
- package/dist/chunk-GAELDPIH.js.map +0 -1
- package/dist/chunk-KMLMEIWV.js.map +0 -1
- package/dist/chunk-OGQSJJWF.js.map +0 -1
- package/dist/chunk-R6V4M2JO.js.map +0 -1
- package/dist/chunk-ZJADGNYF.js.map +0 -1
- package/dist/collection-facade-FLXXGAPR.js +0 -45
- package/dist/derive-R7ALNQRH.js +0 -22
- package/dist/executor-4WZG7D46.js +0 -9
- package/dist/executor-5RWPUTGR.js +0 -29
- package/dist/executor-VOD4C6ZA.js +0 -9
- package/dist/export-accessible-TCVU6B72.js +0 -23
- package/dist/extract-partition-UNUQF5MD.js +0 -38
- package/dist/find-QJPVK6CY.js +0 -11
- package/dist/issue-QYCCTU4S.js +0 -19
- package/dist/liberate-ZJDLMKOW.js +0 -24
- package/dist/noydb-IP2QPER4.js +0 -83
- package/dist/register-GFYFTV74.js +0 -32
- package/dist/registry-BY7Z54RJ.js +0 -9
- package/dist/registry-D6NSZUVQ.js +0 -9
- package/dist/registry-KQPWMFIP.js +0 -19
- package/dist/registry-P7RU4TPR.js +0 -18
- package/dist/request-withdrawal-6RA6PGWD.js +0 -31
- package/dist/revoke-ETYVUNHE.js +0 -24
- package/dist/signer-FLW4HHWM.js +0 -25
- package/dist/storage-7GVHLKVJ.js +0 -23
- package/dist/walk-77FSILOU.js +0 -21
- package/dist/withdraw-accessible-XMWJWDZP.js +0 -28
- /package/dist/{api-FYF5WE2E.js.map → api-6IBOZN6F.js.map} +0 -0
- /package/dist/{backup-JNCS4OMI.js.map → backup-FNAYQMLF.js.map} +0 -0
- /package/dist/{chunk-M3VRXAVD.js.map → chunk-42IDLU5V.js.map} +0 -0
- /package/dist/{chunk-FWZ7WYAH.js.map → chunk-4444HN72.js.map} +0 -0
- /package/dist/{chunk-WX5ABQSL.js.map → chunk-466KGOQB.js.map} +0 -0
- /package/dist/{chunk-YZC4DWJQ.js.map → chunk-4NI5PR5S.js.map} +0 -0
- /package/dist/{chunk-ZFO26ZZR.js.map → chunk-4YUIVHII.js.map} +0 -0
- /package/dist/{chunk-2KX6MT3D.js.map → chunk-5NKSNW25.js.map} +0 -0
- /package/dist/{chunk-ALBA4CET.js.map → chunk-5SK5AFYH.js.map} +0 -0
- /package/dist/{chunk-DKJXAZWF.js.map → chunk-6U7M7AX6.js.map} +0 -0
- /package/dist/{chunk-MLMDO4OQ.js.map → chunk-7EIPPOEL.js.map} +0 -0
- /package/dist/{chunk-KOM2GMTW.js.map → chunk-7J6YERYT.js.map} +0 -0
- /package/dist/{chunk-YRTS5MWY.js.map → chunk-A4JJUWSV.js.map} +0 -0
- /package/dist/{chunk-VFBJMTLJ.js.map → chunk-AFSMT3WI.js.map} +0 -0
- /package/dist/{chunk-C5N3ZWGJ.js.map → chunk-AMKCY454.js.map} +0 -0
- /package/dist/{chunk-SX4HK6FU.js.map → chunk-BVYRPAB2.js.map} +0 -0
- /package/dist/{chunk-IHKRTVJQ.js.map → chunk-C66T4W5P.js.map} +0 -0
- /package/dist/{chunk-M3XBZPLU.js.map → chunk-C6MI5OCF.js.map} +0 -0
- /package/dist/{chunk-2KHT6EP3.js.map → chunk-CAJ7QAPC.js.map} +0 -0
- /package/dist/{chunk-DMRDPZQ7.js.map → chunk-CK6Z5DJQ.js.map} +0 -0
- /package/dist/{chunk-EPUDMBVL.js.map → chunk-CK7IRIRY.js.map} +0 -0
- /package/dist/{chunk-KYIXANXU.js.map → chunk-CWX6YIX5.js.map} +0 -0
- /package/dist/{chunk-TJGB5I4J.js.map → chunk-D763JZRO.js.map} +0 -0
- /package/dist/{chunk-OERLXUF5.js.map → chunk-ESABIXMQ.js.map} +0 -0
- /package/dist/{chunk-H6UFT22R.js.map → chunk-FMZV43QY.js.map} +0 -0
- /package/dist/{chunk-YRMA7CJH.js.map → chunk-FSZPQCDR.js.map} +0 -0
- /package/dist/{chunk-65NL6YZM.js.map → chunk-GBTLOHJM.js.map} +0 -0
- /package/dist/{chunk-4TLFWYZG.js.map → chunk-GE2AGI67.js.map} +0 -0
- /package/dist/{chunk-Y6C67PJX.js.map → chunk-GJX6DOGD.js.map} +0 -0
- /package/dist/{chunk-PV76W4KB.js.map → chunk-GLS7OSZT.js.map} +0 -0
- /package/dist/{chunk-IQVVUZ6Z.js.map → chunk-H545OIWE.js.map} +0 -0
- /package/dist/{chunk-CM7MGRP3.js.map → chunk-HJAFOPTN.js.map} +0 -0
- /package/dist/{chunk-HRQF23XS.js.map → chunk-HNOBRU24.js.map} +0 -0
- /package/dist/{chunk-GNMGX4FY.js.map → chunk-HVPQ5QIZ.js.map} +0 -0
- /package/dist/{chunk-CUEWN4FX.js.map → chunk-HVR74IBG.js.map} +0 -0
- /package/dist/{chunk-LVLXWIBF.js.map → chunk-IMYGJ5HU.js.map} +0 -0
- /package/dist/{chunk-OFGLLNQW.js.map → chunk-IYYGLI2K.js.map} +0 -0
- /package/dist/{chunk-LOLK4EAT.js.map → chunk-JBMSNYOS.js.map} +0 -0
- /package/dist/{chunk-JTZRLD47.js.map → chunk-JU3JKOY5.js.map} +0 -0
- /package/dist/{chunk-A7BP42KY.js.map → chunk-K2MR7ROB.js.map} +0 -0
- /package/dist/{chunk-M44ZBLL3.js.map → chunk-KCLNKE4W.js.map} +0 -0
- /package/dist/{chunk-A5AB7EZU.js.map → chunk-KTCQKXHW.js.map} +0 -0
- /package/dist/{chunk-GGM3JCEG.js.map → chunk-LBQIKMBH.js.map} +0 -0
- /package/dist/{chunk-S7UTUFPU.js.map → chunk-LWOSNMHE.js.map} +0 -0
- /package/dist/{chunk-4TRAQICY.js.map → chunk-MVG67SMN.js.map} +0 -0
- /package/dist/{chunk-45UIDGPY.js.map → chunk-N6OJLR2M.js.map} +0 -0
- /package/dist/{chunk-OOOU3F5Y.js.map → chunk-P2UFDX2F.js.map} +0 -0
- /package/dist/{chunk-LQEHLFFF.js.map → chunk-PCXAUC65.js.map} +0 -0
- /package/dist/{chunk-V3WLQXDF.js.map → chunk-PJ5TGJ7U.js.map} +0 -0
- /package/dist/{chunk-Z7PW63ZC.js.map → chunk-QEYXKICE.js.map} +0 -0
- /package/dist/{chunk-LQFNJRMI.js.map → chunk-QI2KXQOM.js.map} +0 -0
- /package/dist/{chunk-MUE2CQX2.js.map → chunk-QJYTGH5V.js.map} +0 -0
- /package/dist/{chunk-Y2FDCDLY.js.map → chunk-QLMUW7OC.js.map} +0 -0
- /package/dist/{chunk-MRDQ6HJS.js.map → chunk-QQP5KJMS.js.map} +0 -0
- /package/dist/{chunk-WJD5VF2N.js.map → chunk-QTDAPDDV.js.map} +0 -0
- /package/dist/{chunk-Q4AU3NJE.js.map → chunk-QWNYUTI2.js.map} +0 -0
- /package/dist/{chunk-H3BDH7DA.js.map → chunk-R7E7X4CQ.js.map} +0 -0
- /package/dist/{chunk-3IJK5FRG.js.map → chunk-RBTZLXZJ.js.map} +0 -0
- /package/dist/{chunk-6FXQZ3T7.js.map → chunk-RDPZMUCX.js.map} +0 -0
- /package/dist/{chunk-4WXISHDI.js.map → chunk-RJTGXZT6.js.map} +0 -0
- /package/dist/{chunk-4R4N5PRM.js.map → chunk-ROFEKKMI.js.map} +0 -0
- /package/dist/{chunk-7DK6CYXO.js.map → chunk-RVTOCAHQ.js.map} +0 -0
- /package/dist/{chunk-J6EBSGIR.js.map → chunk-RWPNRCK2.js.map} +0 -0
- /package/dist/{chunk-YVGJLRXN.js.map → chunk-S6CP5FWF.js.map} +0 -0
- /package/dist/{chunk-LZHDIO64.js.map → chunk-S77LTWCZ.js.map} +0 -0
- /package/dist/{chunk-TEOL6VAV.js.map → chunk-SGEI3IJK.js.map} +0 -0
- /package/dist/{chunk-EWTAUGAK.js.map → chunk-SZZEDEIU.js.map} +0 -0
- /package/dist/{chunk-ZG7MXW5J.js.map → chunk-T7AEAFEE.js.map} +0 -0
- /package/dist/{chunk-TAFRRVFR.js.map → chunk-TQ7IRULX.js.map} +0 -0
- /package/dist/{chunk-MVWO6KXU.js.map → chunk-TQLYMYOK.js.map} +0 -0
- /package/dist/{chunk-MSCXCF4T.js.map → chunk-UTQLKPBS.js.map} +0 -0
- /package/dist/{chunk-QLFLX5VA.js.map → chunk-V2BEYLNR.js.map} +0 -0
- /package/dist/{chunk-P7A2FX5Y.js.map → chunk-V4M4BZNW.js.map} +0 -0
- /package/dist/{chunk-PLJ622XY.js.map → chunk-VTTRWLOR.js.map} +0 -0
- /package/dist/{chunk-QNGRTWGM.js.map → chunk-VVMSDWRG.js.map} +0 -0
- /package/dist/{chunk-PRN65IDE.js.map → chunk-WLZKVY33.js.map} +0 -0
- /package/dist/{chunk-3EFQV2XQ.js.map → chunk-XHX3NTRP.js.map} +0 -0
- /package/dist/{chunk-ALDFGMO7.js.map → chunk-YDJXGYYA.js.map} +0 -0
- /package/dist/{chunk-VDQZKDED.js.map → chunk-YGJZLOSR.js.map} +0 -0
- /package/dist/{chunk-IONRKUH4.js.map → chunk-YH65A6WM.js.map} +0 -0
- /package/dist/{chunk-YKDAFWWS.js.map → chunk-YKEJ5P3H.js.map} +0 -0
- /package/dist/{chunk-J5LO2H42.js.map → chunk-YODIXNV4.js.map} +0 -0
- /package/dist/{chunk-37M5QBAS.js.map → chunk-YVOW35HH.js.map} +0 -0
- /package/dist/{chunk-NW3PSKAN.js.map → chunk-YZ7BRD26.js.map} +0 -0
- /package/dist/{chunk-2BBXXSAD.js.map → chunk-Z3U2YVNM.js.map} +0 -0
- /package/dist/{chunk-SX2ZKKZS.js.map → chunk-ZHDMT2MJ.js.map} +0 -0
- /package/dist/{chunk-EZYLQKHP.js.map → chunk-ZWPUYBNK.js.map} +0 -0
- /package/dist/{classified-marker-IYWA7L6U.js.map → classified-marker-3STDEUFT.js.map} +0 -0
- /package/dist/{collection-facade-FLXXGAPR.js.map → collection-facade-SGTS3TRS.js.map} +0 -0
- /package/dist/{computed-B3BJQSU5.js.map → computed-5E2OM6EN.js.map} +0 -0
- /package/dist/{dead-filter-QV7ORQS3.js.map → dead-filter-ZNWVGV5U.js.map} +0 -0
- /package/dist/{delegation-UPE5PUKB.js.map → delegation-LZWFOST7.js.map} +0 -0
- /package/dist/{derive-R7ALNQRH.js.map → derive-BWXA2L7D.js.map} +0 -0
- /package/dist/{dispatch-BW2W2LXV.js.map → dispatch-S34AUC43.js.map} +0 -0
- /package/dist/{dispatch-OBZS537P.js.map → dispatch-TIYW3UDN.js.map} +0 -0
- /package/dist/{enclave-LXFVDJLO.js.map → enclave-Y6GMYQMS.js.map} +0 -0
- /package/dist/{executor-4WZG7D46.js.map → executor-JDMH2IGK.js.map} +0 -0
- /package/dist/{executor-5RWPUTGR.js.map → executor-PCZN2LTY.js.map} +0 -0
- /package/dist/{executor-VOD4C6ZA.js.map → executor-WFTHIDT7.js.map} +0 -0
- /package/dist/{export-accessible-TCVU6B72.js.map → export-accessible-U6GXZZMQ.js.map} +0 -0
- /package/dist/{extract-partition-UNUQF5MD.js.map → extract-partition-IDI6NDUR.js.map} +0 -0
- /package/dist/{fanout-sidecar-BD4ZSPER.js.map → fanout-sidecar-BVFOEJTP.js.map} +0 -0
- /package/dist/{find-QJPVK6CY.js.map → find-VBNMB42N.js.map} +0 -0
- /package/dist/{issue-QYCCTU4S.js.map → issue-TEGTAN7N.js.map} +0 -0
- /package/dist/{ledger-6EMFGJRU.js.map → ledger-NFLBQASD.js.map} +0 -0
- /package/dist/{liberate-ZJDLMKOW.js.map → liberate-SG2PPGAJ.js.map} +0 -0
- /package/dist/{link-set-GUKFJQGW.js.map → link-set-IPS57KDM.js.map} +0 -0
- /package/dist/{managed-secret-T6X4VHB2.js.map → managed-secret-GFYGPLNI.js.map} +0 -0
- /package/dist/{noydb-IP2QPER4.js.map → noydb-TN2VIJJO.js.map} +0 -0
- /package/dist/{post-register-XKYJDDZL.js.map → post-register-JUSV3X4E.js.map} +0 -0
- /package/dist/{register-GFYFTV74.js.map → register-UTMPUAQW.js.map} +0 -0
- /package/dist/{registry-BY7Z54RJ.js.map → registry-B2S4UNUI.js.map} +0 -0
- /package/dist/{registry-D6NSZUVQ.js.map → registry-E4FM32KD.js.map} +0 -0
- /package/dist/{registry-KQPWMFIP.js.map → registry-HACMULJJ.js.map} +0 -0
- /package/dist/{registry-P7RU4TPR.js.map → registry-NDLBGQLJ.js.map} +0 -0
- /package/dist/{request-withdrawal-6RA6PGWD.js.map → request-withdrawal-Q5G43PR7.js.map} +0 -0
- /package/dist/{reveal-IN2ZBB5U.js.map → reveal-YJU7GUYJ.js.map} +0 -0
- /package/dist/{revoke-ETYVUNHE.js.map → revoke-NXOUPYS3.js.map} +0 -0
- /package/dist/{seed-D623RNG3.js.map → seed-XXLR4KXU.js.map} +0 -0
- /package/dist/{signer-FLW4HHWM.js.map → signer-FCGAUB6E.js.map} +0 -0
- /package/dist/{stale-O3CZVYMO.js.map → stale-OT5NMBXU.js.map} +0 -0
- /package/dist/{storage-7GVHLKVJ.js.map → storage-EWWIFB43.js.map} +0 -0
- /package/dist/{store-coordination-provider-RKBDHHN4.js.map → store-coordination-provider-PPLVM2I2.js.map} +0 -0
- /package/dist/{ulid-PTAIMDG4.js.map → ulid-VQW6ERQN.js.map} +0 -0
- /package/dist/{verify-GB7SBYC3.js.map → verify-SHJXGZGM.js.map} +0 -0
- /package/dist/{walk-77FSILOU.js.map → walk-4NIT2ZBH.js.map} +0 -0
- /package/dist/{withdraw-accessible-XMWJWDZP.js.map → withdraw-accessible-LJG66PZQ.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-cargo/vault-diff.ts","../src/with-cargo/active.ts","../src/with-cargo/describe-extraction.ts","../src/with-cargo/adopt-partition.ts","../src/with-cargo/decrypt-partition.ts"],"sourcesContent":["/**\n * Vault-level diff orchestrator.\n *\n * Compares a live `Vault`'s plaintext state against a candidate state\n * (another vault, a plain `{ collection: records[] }` map, or a vault\n * dump JSON) and returns a structured `VaultDiff` plan listing the\n * records that would be added, modified, or deleted to bring the live\n * vault into the candidate's shape.\n *\n * Builds on two existing record-level helpers:\n *\n * 1. `diff(a, b)` from `./history/diff.ts` — emits dot-pathed\n * `DiffEntry[]` with `type: 'added' | 'removed' | 'changed'` for\n * each changed field of two records. Used here for the\n * `fieldDiffs` of every `modified` entry, and (with empty result)\n * as the default deep-equal check.\n *\n * 2. `Vault.exportStream()` from `./vault.ts` — the canonical\n * decrypt-and-stream-records iterator. Used to walk both sides\n * when the candidate is itself a `Vault`. ACL-scoped: collections\n * the caller can't read silently drop out, the same way every\n * other plaintext-emitting export pipeline filters them.\n *\n * The new orchestration is the **vault-level** enumeration: bucket\n * each record id into added (only in candidate), deleted (only in\n * vault), or modified (in both with field changes); leave the\n * field-level granularity to the existing `diff()`.\n *\n * Use cases:\n *\n * - Import preview (`@noy-db/as-*` `fromString` returns a plan\n * whose body is a `VaultDiff`).\n * - Backup verification (\"does this `.noydb` bundle from yesterday\n * match the current vault?\").\n * - Two-vault reconciliation (\"what's different between Office A\n * and Office B before we sync?\").\n * - Test assertions (golden-file testing with one-liner\n * `expect(plan.summary).toEqual(...)`).\n *\n * @module\n */\n\nimport type { Vault } from '../kernel/vault.js'\nimport { diff as fieldDiff, type DiffEntry as FieldDiffEntry } from '../with-commit/history/diff.js'\n\n// ─── Public types ──────────────────────────────────────────────────────\n\n/** Per-record entry shape — added and deleted records carry only the record value. */\nexport interface VaultDiffEntry<T = unknown> {\n readonly collection: string\n readonly id: string\n readonly record: T\n /**\n * Unencrypted envelope metadata for the RECEIVER-side record.\n * Populated only when `diffVault` is called with `{includeMetadata: true}`.\n * Default: `undefined` (zero extra reads, no behavior change).\n *\n * Populated for `modified` (the CURRENT receiver state, before the candidate\n * is applied) and `deleted` (the receiver envelope of the record being\n * removed). `added` entries have no receiver envelope at diff time, so their\n * `metadata` is always absent.\n */\n readonly metadata?: {\n readonly version: number\n readonly timestamp: string\n readonly by?: string\n readonly source?: string\n readonly sourceTs?: string\n }\n}\n\n/** Modified records carry both halves of the diff plus the field-level breakdown. */\nexport interface VaultDiffModifiedEntry<T = unknown> extends VaultDiffEntry<T> {\n /** The record as it stands in the live vault. */\n readonly before: T\n /** Top-level keys whose values differ between `before` and `record`. */\n readonly fieldsChanged: readonly string[]\n /**\n * Field-level diff entries from `diff(before, record)`. Reuses the\n * existing per-record diff helper so consumers can render git-style\n * `path: from → to` rows without re-walking the records.\n */\n readonly fieldDiffs: readonly FieldDiffEntry[]\n}\n\nexport interface VaultDiff<T = unknown> {\n readonly added: readonly VaultDiffEntry<T>[]\n readonly modified: readonly VaultDiffModifiedEntry<T>[]\n readonly deleted: readonly VaultDiffEntry<T>[]\n /** Only populated when `options.includeUnchanged: true`. */\n readonly unchanged: readonly VaultDiffEntry<T>[] | undefined\n readonly summary: {\n readonly add: number\n readonly modify: number\n readonly delete: number\n readonly total: number\n }\n /**\n * Format the diff as a human-readable string.\n *\n * - `'count'` — one line, just the numbers (`12 added · 3 modified · 0 deleted`)\n * - `'one-line'` — count plus a single overview line\n * - `'full'` — count + one row per added/modified/deleted record (default)\n */\n format(opts?: { detail?: 'count' | 'one-line' | 'full' }): string\n}\n\nexport interface DiffOptions {\n /** Restrict the diff to a subset of collections. */\n readonly collections?: readonly string[]\n /** Field on each record that carries its id. Defaults to `'id'`. */\n readonly idKey?: string\n /** Override the default deep-equal check for \"modified vs unchanged\". */\n readonly compareFn?: (a: unknown, b: unknown) => boolean\n /** If true, include unchanged records in the diff (off by default to save memory). */\n readonly includeUnchanged?: boolean\n /**\n * When `true`, each entry in `added`, `modified`, and `deleted` will carry a\n * `metadata` field with the RECEIVER-side envelope metadata\n * (`version`, `timestamp`, `by?`, `source?`, `sourceTs?`).\n *\n * Off by default — no extra adapter reads, no behavior change for existing callers.\n */\n readonly includeMetadata?: boolean\n}\n\n/**\n * Candidate state to diff the vault against:\n *\n * - A `Vault` instance — both sides are walked via `exportStream()`.\n * - A `Record<collection, records[]>` map — same shape `as-json.toObject()`\n * produces. Useful for diffing parsed file content against the live vault.\n * - A `VaultDump` (output of `vault.dump()`) — a JSON string carrying the\n * full vault state. Parsed and reduced to the map shape above.\n */\nexport type DiffCandidate<T = unknown> =\n | Vault\n | Record<string, readonly T[]>\n | string\n\n// ─── Implementation ────────────────────────────────────────────────────\n\n/**\n * Compute the diff between a live vault and a candidate state.\n *\n * Ungated shared import/merge infrastructure: the `as-*` exporters call this\n * internally from their `fromString`/import merge logic, so it is always\n * available (not behind `withCargo()`). Only `extractPartition` is a gated\n * cargo capability.\n *\n * Returns a fully buffered `VaultDiff` — no streaming. Memory cost is\n * O(n + m) in the row count of vault + candidate. For documented\n * 1K-50K-record vaults this is fine; a streaming variant lands as a\n * follow-up if a > 100K-record consumer arrives.\n */\nexport async function diffVault<T = unknown>(\n vault: Vault,\n candidate: DiffCandidate<T>,\n options: DiffOptions = {},\n): Promise<VaultDiff<T>> {\n const idKey = options.idKey ?? 'id'\n const filter = options.collections ? new Set(options.collections) : null\n const compareFn =\n options.compareFn ?? ((a: unknown, b: unknown) => fieldDiff(a, b).length === 0)\n\n // Side A — walk the live vault via exportStream(). Each chunk arrives\n // already decrypted and ACL-scoped, so collections the caller can't\n // read silently drop out. exportStream's records are typed `unknown[]`\n // — diffVault is the type-erasure boundary; the caller asserts the\n // record shape via the function's `<T>` generic.\n const live = new Map<string, Map<string, T>>()\n for await (const chunk of vault.exportStream({ granularity: 'collection' })) {\n if (filter && !filter.has(chunk.collection)) continue\n const collection = live.get(chunk.collection) ?? new Map<string, T>()\n for (const record of chunk.records) {\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record as T)\n }\n live.set(chunk.collection, collection)\n }\n\n // Side B — normalise the candidate into the same shape.\n const cand = await normaliseCandidate<T>(candidate, idKey, filter)\n\n // Walk every (collection, id) on either side and bucket.\n const added: VaultDiffEntry<T>[] = []\n const modified: VaultDiffModifiedEntry<T>[] = []\n const deleted: VaultDiffEntry<T>[] = []\n const unchanged: VaultDiffEntry<T>[] | undefined = options.includeUnchanged ? [] : undefined\n\n const collectionNames = new Set([...live.keys(), ...cand.keys()])\n for (const collection of [...collectionNames].sort()) {\n const liveColl = live.get(collection) ?? new Map<string, T>()\n const candColl = cand.get(collection) ?? new Map<string, T>()\n const allIds = new Set([...liveColl.keys(), ...candColl.keys()])\n\n for (const id of [...allIds].sort()) {\n const before = liveColl.get(id)\n const after = candColl.get(id)\n\n if (before === undefined && after !== undefined) {\n // added: record only in candidate — no receiver envelope\n added.push({ collection, id, record: after })\n } else if (before !== undefined && after === undefined) {\n // deleted: record only in receiver — attach metadata if requested\n const metadata = options.includeMetadata\n ? (await vault.collection(collection).getMetadata(id)) ?? undefined\n : undefined\n deleted.push({ collection, id, record: before, ...(metadata !== undefined ? { metadata } : {}) })\n } else if (before !== undefined && after !== undefined) {\n if (compareFn(before, after)) {\n unchanged?.push({ collection, id, record: after })\n } else {\n // modified: record in both — attach receiver-side metadata if requested\n const metadata = options.includeMetadata\n ? (await vault.collection(collection).getMetadata(id)) ?? undefined\n : undefined\n const fieldDiffs = fieldDiff(before, after)\n const fieldsChanged = uniqueTopLevelKeys(fieldDiffs)\n modified.push({\n collection,\n id,\n record: after,\n before,\n fieldsChanged,\n fieldDiffs,\n ...(metadata !== undefined ? { metadata } : {}),\n })\n }\n }\n }\n }\n\n const summary = {\n add: added.length,\n modify: modified.length,\n delete: deleted.length,\n total: added.length + modified.length + deleted.length,\n }\n\n return {\n added,\n modified,\n deleted,\n unchanged,\n summary,\n format(opts) {\n return formatDiff(opts?.detail ?? 'full', { added, modified, deleted, summary })\n },\n }\n}\n\n// ─── Internals ─────────────────────────────────────────────────────────\n\nasync function normaliseCandidate<T>(\n candidate: DiffCandidate<T>,\n idKey: string,\n filter: Set<string> | null,\n): Promise<Map<string, Map<string, T>>> {\n const out = new Map<string, Map<string, T>>()\n\n // Vault instance — duck-type via the exportStream method (matches\n // vault.ts's structural shape without forcing a runtime instanceof check\n // that would import the class and risk circular deps).\n if (\n typeof candidate === 'object' &&\n candidate !== null &&\n 'exportStream' in candidate &&\n typeof (candidate as Vault).exportStream === 'function'\n ) {\n for await (const chunk of (candidate as Vault).exportStream({ granularity: 'collection' })) {\n if (filter && !filter.has(chunk.collection)) continue\n const collection = out.get(chunk.collection) ?? new Map<string, T>()\n for (const record of chunk.records) {\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record as T)\n }\n out.set(chunk.collection, collection)\n }\n return out\n }\n\n // String — assume a vault.dump() JSON string. Parse and reduce to the map shape.\n if (typeof candidate === 'string') {\n let parsed: unknown\n try {\n parsed = JSON.parse(candidate)\n } catch (err) {\n throw new Error(\n `diffVault: candidate string is not valid JSON (${(err as Error).message})`,\n )\n }\n return collectionsFromObject<T>(parsed, idKey, filter)\n }\n\n // Plain object — `Record<collection, records[]>` (same shape as-json.toObject() returns).\n return collectionsFromObject<T>(candidate, idKey, filter)\n}\n\nfunction collectionsFromObject<T>(\n raw: unknown,\n idKey: string,\n filter: Set<string> | null,\n): Map<string, Map<string, T>> {\n const out = new Map<string, Map<string, T>>()\n if (raw === null || typeof raw !== 'object') {\n throw new Error('diffVault: candidate must be a Vault, an object, or a JSON string')\n }\n // A vault dump JSON has a top-level shape like { _compartment, _keyring, <coll>: <records[]> }.\n // We accept both: keys starting with `_` are skipped (they're metadata), the rest are collections.\n for (const [key, value] of Object.entries(raw)) {\n if (key.startsWith('_')) continue\n if (filter && !filter.has(key)) continue\n if (!Array.isArray(value)) continue\n const collection = new Map<string, T>()\n for (const record of value as readonly T[]) {\n if (record === null || typeof record !== 'object') continue\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record)\n }\n out.set(key, collection)\n }\n return out\n}\n\nfunction uniqueTopLevelKeys(diffs: readonly FieldDiffEntry[]): readonly string[] {\n const keys = new Set<string>()\n for (const d of diffs) {\n // path is dot-separated; the top-level key is everything before the\n // first `.` or `[`. (`a.b.c` → `a`, `tags[0]` → `tags`, `(root)` → `(root)`).\n const m = /^[^.[]+/.exec(d.path)\n if (m) keys.add(m[0])\n }\n return [...keys]\n}\n\n/**\n * Pull the id field off a record without going through `String(obj)`,\n * which would emit `[object Object]` for nested objects and silently\n * collapse rows that share the same parent. Only string and number ids\n * are accepted; anything else returns the empty string and the record\n * is skipped at the call site.\n */\nfunction readIdField(record: unknown, idKey: string): string {\n if (record === null || typeof record !== 'object') return ''\n const v = (record as Record<string, unknown>)[idKey]\n if (typeof v === 'string') return v\n if (typeof v === 'number' && Number.isFinite(v)) return String(v)\n return ''\n}\n\ninterface FormatBuckets<T> {\n readonly added: readonly VaultDiffEntry<T>[]\n readonly modified: readonly VaultDiffModifiedEntry<T>[]\n readonly deleted: readonly VaultDiffEntry<T>[]\n readonly summary: VaultDiff<T>['summary']\n}\n\nfunction formatDiff<T>(\n detail: 'count' | 'one-line' | 'full',\n b: FormatBuckets<T>,\n): string {\n const head = `${b.summary.add} added · ${b.summary.modify} modified · ${b.summary.delete} deleted`\n if (detail === 'count') return head\n if (b.summary.total === 0) return head + '\\n(no changes)'\n if (detail === 'one-line') return head\n\n const rows: string[] = [head, '']\n for (const e of b.added) rows.push(`${e.collection}/${e.id}\\tadded`)\n for (const e of b.modified) {\n const fields = e.fieldDiffs\n .map((f) => `${f.path}: ${shortJSON(f.from)} → ${shortJSON(f.to)}`)\n .join(', ')\n rows.push(`${e.collection}/${e.id}\\tmodified\\t${fields}`)\n }\n for (const e of b.deleted) rows.push(`${e.collection}/${e.id}\\tdeleted`)\n return rows.join('\\n')\n}\n\nfunction shortJSON(value: unknown): string {\n if (value === undefined) return 'undefined'\n const s = JSON.stringify(value)\n // JSON.stringify returns string for any JSON value except `undefined`\n // (handled above), `function`, and `symbol`. Fall back to a static\n // tag for those — never let an arbitrary object hit the default\n // stringifier (which the lint rule explicitly bans).\n if (typeof s !== 'string') return '<unrepresentable>'\n return s.length > 60 ? s.slice(0, 57) + '...' : s\n}\n","/**\n * Enable the cargo (partition extraction) capability.\n * Pass to `createNoydb({ cargoStrategy: withCargo() })` to make the source-side\n * `extractPartition(vault, ...)` free function live. The extraction crypto\n * engine is dynamically imported here, so it stays out of the floor bundle\n * until opted in. The recipient-side `adoptPartition` /\n * `decryptExtractedPartition` free functions — and `diffVault` (shared\n * import/merge infra) — are ungated and unaffected.\n */\nimport type { CargoStrategy } from './strategy.js'\n\nexport function withCargo(): CargoStrategy {\n return {\n async extractPartition(vault, opts) {\n const { extractPartitionCore } = await import('./extract-partition.js')\n return extractPartitionCore(vault, opts)\n },\n }\n}\n","/**\n * Partition-extraction dry-run. Read-only preview of what an\n * `extractPartition` would move: record counts, byte totals, and the\n * timestamp span per collection — computed from raw encrypted\n * envelopes WITHOUT decrypting them. Writes nothing, mutates nothing.\n *\n * @module\n */\nimport type { Vault } from '../kernel/vault.js'\nimport { walkClosure, type WalkClosureOptions, type DanglingRefNotice } from './walk-closure.js'\n\nexport interface ExtractionPreview {\n readonly totalRecords: number\n /** Sum of serialized encrypted-envelope sizes (bytes). */\n readonly totalBytes: number\n readonly byCollection: ReadonlyArray<{\n readonly name: string\n readonly recordCount: number\n readonly bytes: number\n /** Earliest envelope `_ts` in this collection (lexicographic). */\n readonly oldestTs?: string\n readonly newestTs?: string\n }>\n readonly graph: { readonly depth: number; readonly cyclesDetected: boolean }\n /** Records the walk reached but whose envelope couldn't be read. */\n readonly inaccessible: ReadonlyArray<{ readonly collection: string; readonly id: string }>\n /**\n * #772: outbound FK edges whose referenced parent was excluded from the\n * closure (missing, or tier-elevated and therefore invisible) — mirrors\n * `ExtractPartitionResult.danglingRefs` (#759) so a preview/extract pair\n * gives the SAME signal. A parent excluded this way never appears in\n * `byCollection` at all; this is the only preview-time indicator.\n */\n readonly danglingRefs: ReadonlyArray<DanglingRefNotice>\n}\n\nexport async function describeExtraction(\n vault: Vault,\n opts: WalkClosureOptions,\n): Promise<ExtractionPreview> {\n const { closure, graph, danglingRefs } = await walkClosure(vault, opts)\n\n const { name: vaultName, adapter } = vault._introspectState()\n const encoder = new TextEncoder()\n\n const byCollection: Array<{\n name: string; recordCount: number; bytes: number; oldestTs?: string; newestTs?: string\n }> = []\n const inaccessible: Array<{ collection: string; id: string }> = []\n let totalBytes = 0\n let totalRecords = 0\n\n for (const [collectionName, ids] of closure) {\n let bytes = 0\n let oldestTs: string | undefined\n let newestTs: string | undefined\n let recordCount = 0\n\n for (const id of ids) {\n const env = await adapter.get(vaultName, collectionName, id)\n if (!env) {\n // Walk reached it (via decrypted list) but the raw store read\n // returned nothing — surface rather than miscount.\n inaccessible.push({ collection: collectionName, id })\n continue\n }\n recordCount++\n bytes += encoder.encode(JSON.stringify(env)).length\n const ts = env._ts\n if (oldestTs === undefined || ts < oldestTs) oldestTs = ts\n if (newestTs === undefined || ts > newestTs) newestTs = ts\n }\n\n byCollection.push({\n name: collectionName,\n recordCount,\n bytes,\n // Spread conditionally — exactOptionalPropertyTypes forbids an\n // explicit `undefined` on an optional property.\n ...(oldestTs !== undefined ? { oldestTs } : {}),\n ...(newestTs !== undefined ? { newestTs } : {}),\n })\n totalBytes += bytes\n totalRecords += recordCount\n }\n\n byCollection.sort((a, b) => a.name.localeCompare(b.name))\n\n return Object.freeze({\n totalRecords,\n totalBytes,\n byCollection,\n graph,\n inaccessible,\n danglingRefs,\n })\n}\n","/**\n * Partition adoption. Recipient side: verify an extracted bundle,\n * validate the transfer key, import the re-keyed collections into a\n * destination store, and record an `_meta/adoption` marker. The bundle\n * stays UNOWNED after adoption — `createOwnerOnAdoptedPartition`\n * mints the owner; the transfer seal is then destroyed.\n *\n * @module\n */\nimport { base64ToBuffer, wrapKey, type EnclaveKey } from '../kernel/enclave/index.js'\nimport { TransferSealError, AdoptionStateError, ValidationError } from '../kernel/errors.js'\nimport type { NoydbStore, VaultSnapshot, KeyringFile } from '../kernel/types.js'\nimport { createOwnerKeyring } from '../with-party/team/keyring.js'\nimport { resolveManagedSecret } from '../with-party/team/managed-secret.js'\nimport type { SealingKeyProvider } from '../with-party/team/managed-secret.js'\nimport type { ShamirRecoveryProvider } from '../with-party/team/shamir-recovery-provider.js'\nimport type { RecoveryEnrollmentInput } from '../with-party/team/rotate-recover.js'\nimport { LedgerStore } from '../with-commit/history/ledger/store.js'\nimport { LEDGER_COLLECTION } from '../with-commit/history/ledger/constants.js'\nimport type { TransferSealPayload } from '../with-pod/pod.js'\nimport { readPodHeader, readPod, parseExtractedPartitionBody } from '../with-pod/pod.js'\nimport { NOYDB_FORMAT_VERSION } from '../kernel/types.js'\n\n/**\n * Reverse of `sealDeks`. Imports the transfer key, decrypts the\n * sealed `{ collection: base64(rawDEK) }` map (layout iv(12)‖ct‖tag), and\n * re-imports each DEK as an AES-GCM key. Throws `TransferSealError` on a\n * wrong key (AES-GCM auth-tag failure) or malformed payload.\n */\nexport async function unsealDeks(\n seal: TransferSealPayload,\n transferKey: Uint8Array,\n): Promise<Map<string, EnclaveKey>> {\n if (transferKey.byteLength !== 32) {\n throw new TransferSealError(\n `transfer key must be 32 bytes, got ${transferKey.byteLength}.`,\n )\n }\n const key = await crypto.subtle.importKey('raw', transferKey as BufferSource, 'AES-GCM', false, ['decrypt'])\n const raw = base64ToBuffer(seal.payload)\n let plaintext: ArrayBuffer\n try {\n plaintext = await crypto.subtle.decrypt(\n { name: 'AES-GCM', iv: raw.slice(0, 12) as BufferSource },\n key,\n raw.slice(12) as BufferSource,\n )\n } catch {\n throw new TransferSealError(\n 'transfer seal could not be opened — wrong transfer key (AES-GCM authentication failed).',\n )\n }\n let dekMap: Record<string, string>\n try {\n dekMap = JSON.parse(new TextDecoder().decode(plaintext)) as Record<string, string>\n } catch {\n throw new TransferSealError('transfer seal payload is not valid JSON after decryption.')\n }\n const deks = new Map<string, EnclaveKey>()\n for (const [collection, b64] of Object.entries(dekMap)) {\n // Extractable: the recipient must be able to re-wrap these under their\n // own KEK (AES-KW) at owner-creation. Matches generateDEK.\n const dek = await crypto.subtle.importKey('raw', base64ToBuffer(b64) as BufferSource, 'AES-GCM', true, ['encrypt', 'decrypt'])\n deks.set(collection, dek)\n }\n return deks\n}\n\nexport interface AdoptPartitionOptions {\n readonly transferKey: Uint8Array\n readonly destinationStore: NoydbStore\n readonly vaultName: string\n}\n\nexport interface AdoptPartitionResult {\n readonly vaultName: string\n readonly needsOwner: true\n readonly sealId: string\n}\n\nexport async function adoptPartition(\n bundleBytes: Uint8Array,\n opts: AdoptPartitionOptions,\n): Promise<AdoptPartitionResult> {\n const { transferKey, destinationStore, vaultName } = opts\n\n const header = readPodHeader(bundleBytes)\n if (header.bundleKind !== 'extracted-partition' || header.transferSeal === undefined) {\n throw new ValidationError(\n 'adoptPartition requires an extracted-partition bundle with a transfer seal. '\n + 'For ordinary backups use readPod + vault.load.',\n )\n }\n\n const { dumpJson } = await readPod(bundleBytes)\n const { dump, seal } = parseExtractedPartitionBody(dumpJson)\n\n // Validate the transfer key by unsealing in memory; throws\n // TransferSealError on mismatch. DEKs are discarded here — they stay\n // sealed at rest (in _meta/adoption) until owner-creation wraps them under the\n // recipient's KEK.\n await unsealDeks(seal, transferKey)\n\n // Single-occupancy per vaultName: an `_meta/adoption` marker already present\n // means this slot holds a partition (adopted-and-unowned, or already owned).\n // saveAll below would overwrite its data and replace the marker, stranding the\n // prior adoption's transfer seal. Refuse regardless of sealId — re-adopting the\n // SAME bundle is a redundant call, and adopting a DIFFERENT bundle here would\n // clobber the existing partition. Either way, pick a fresh vaultName.\n const existing = await destinationStore.get(vaultName, '_meta', 'adoption')\n if (existing) {\n const prior = JSON.parse(existing._data) as { sealId?: string }\n if (prior.sealId === seal.sealId) {\n throw new AdoptionStateError(\n `partition (sealId ${seal.sealId}) is already adopted into vault \"${vaultName}\".`,\n )\n }\n throw new AdoptionStateError(\n `vault \"${vaultName}\" already holds an adopted partition (sealId ${prior.sealId}); `\n + `adopting a different partition (sealId ${seal.sealId}) here would overwrite it. `\n + `Adopt into a fresh vaultName instead.`,\n )\n }\n\n // The marker-only check above misses a worse case: a vaultName already in use\n // by an ORDINARY vault (createNoydb + openVault) carries no `_meta/adoption`,\n // yet `saveAll` below is destructive on SQL adapters (`DELETE FROM ... WHERE\n // vault = ?` followed by upsert) and would wipe the legitimate keyring +\n // data. Refuse adoption into ANY occupied slot — a fresh vaultName is the\n // documented precondition.\n const existingKeyring = await destinationStore.list(vaultName, '_keyring')\n if (existingKeyring.length > 0) {\n throw new AdoptionStateError(\n `vault \"${vaultName}\" already holds a keyring (an unrelated owner exists at this slot); `\n + `adoptPartition requires a fresh vaultName to avoid destructive saveAll on SQL adapters.`,\n )\n }\n\n const backup = JSON.parse(dump) as { collections: VaultSnapshot; _internal?: VaultSnapshot }\n await destinationStore.saveAll(vaultName, backup.collections)\n\n // Import carried internal collections (e.g. _schemas from carrySchemas).\n // saveAll only writes data collections; _internal is written per-record.\n if (backup._internal) {\n for (const [collection, records] of Object.entries(backup._internal)) {\n for (const [id, envelope] of Object.entries(records)) {\n await destinationStore.put(vaultName, collection, id, envelope)\n }\n }\n }\n\n const adoptedAt = new Date().toISOString()\n const adoption = { sealId: seal.sealId, adoptedAt, needsOwner: true as const, transferSeal: seal }\n await destinationStore.put(vaultName, '_meta', 'adoption', {\n _noydb: NOYDB_FORMAT_VERSION, _v: 1, _ts: adoptedAt, _iv: '', _data: JSON.stringify(adoption),\n })\n\n return { vaultName, needsOwner: true, sealId: seal.sealId }\n}\n\nexport interface CreateOwnerResult {\n readonly vaultName: string\n readonly userId: string\n}\n\n/** Standard-mode owner: recipient supplies the secret. */\nexport interface CreateOwnerStandardOptions {\n readonly userId: string\n readonly secret: string\n readonly transferKey: Uint8Array\n}\n\n/**\n * Managed-mode owner: the secret is minted + sealed under\n * a `SealingKeyProvider` (e.g. an `at-*` OS keychain) so the partition\n * auto-unlocks on the recipient's device. Managed mode mandates a strong\n * (Shamir) recovery profile at creation, which needs the\n * `shamirRecovery` provider injected.\n */\nexport interface CreateOwnerManagedOptions {\n readonly userId: string\n readonly secretMode: 'managed'\n readonly sealingKey: SealingKeyProvider\n readonly recovery: ReadonlyArray<RecoveryEnrollmentInput>\n readonly shamirRecovery: ShamirRecoveryProvider\n readonly transferKey: Uint8Array\n}\n\nexport type CreateOwnerOptions = CreateOwnerStandardOptions | CreateOwnerManagedOptions\n\nfunction isManaged(o: CreateOwnerOptions): o is CreateOwnerManagedOptions {\n return 'secretMode' in o && o.secretMode === 'managed'\n}\n\n/**\n * Mint the first owner keyring on an adopted-but-unowned partition,\n * then destroy the transfer seal.\n *\n * Standard mode: the recipient supplies a secret. Managed mode: the\n * secret is minted + sealed under a `SealingKeyProvider` and a strong\n * (Shamir) recovery profile is enrolled — orchestrated via the existing\n * `openVaultAndEnrollRecovery` ceremony.\n *\n * Either way, reuses `createOwnerKeyring` to derive the KEK + write the base\n * keyring, then wraps the partition's DEKs (recovered from the seal) under that\n * KEK and re-persists the merged keyring file.\n *\n * Idempotent under retry: the seal is destroyed LAST (Stage D), after the\n * keyring (Stage A), the ledger transition (Stage B), and — in managed mode —\n * strong-recovery enrollment (Stage C). A failure in the fallible enrollment\n * step leaves the seal intact, and re-running with the same `userId` +\n * `transferKey` resumes from the first incomplete stage. (Multi-profile recovery\n * arrays may re-enroll an already-enrolled profile on retry; managed mode's\n * mandated single Shamir profile does not.)\n */\nexport async function createOwnerOnAdoptedPartition(\n store: NoydbStore,\n vaultName: string,\n opts: CreateOwnerOptions,\n): Promise<CreateOwnerResult> {\n const { userId, transferKey } = opts\n\n // Managed mode requires a strong (Shamir) recovery profile, validated BEFORE\n // any disk write — same gate as createNoydb.\n if (isManaged(opts) && !opts.recovery.some((r) => r.profile === 'shamir')) {\n throw new AdoptionStateError(\n 'managed-mode adoption requires at least one strong (shamir) recovery profile in '\n + '`recovery` — paper alone is not strong when there is no user secret to fall back on.',\n )\n }\n\n // 1. Verify adopted-unowned state.\n const adoptionEnv = await store.get(vaultName, '_meta', 'adoption')\n if (!adoptionEnv) {\n throw new AdoptionStateError(\n `vault \"${vaultName}\" is not an adopted partition (no _meta/adoption). `\n + `createOwnerOnAdoptedPartition only applies to vaults created via adoptPartition.`,\n )\n }\n const adoption = JSON.parse(adoptionEnv._data) as {\n sealId: string; adoptedAt: string; needsOwner?: boolean\n consumedAt?: string; transferSeal?: TransferSealPayload\n }\n if (adoption.consumedAt !== undefined || adoption.transferSeal === undefined) {\n throw new AdoptionStateError(\n `vault \"${vaultName}\" already has an owner (transfer seal consumed at ${adoption.consumedAt}).`,\n )\n }\n\n // 2. Recover the partition DEKs from the seal (throws on wrong key) BEFORE\n // writing any keyring, so a bad transfer key leaves no trace. Always\n // validated, including when resuming a partial prior call.\n const partitionDeks = await unsealDeks(adoption.transferSeal, transferKey)\n\n // The ceremony below is split into stages so a failure in the fallible\n // managed-enrollment step (network/provider outage) leaves the call RETRYABLE\n // — the seal is destroyed only once everything durable is in place. Each stage\n // detects its own prior completion rather than relying on a single resume bit.\n\n // A keyring present for a DIFFERENT user (with the seal still unconsumed) is a\n // genuine second-owner attempt — refuse it. A same-user keyring is a resumed\n // partial call and is handled by the stage checks below.\n const existingKeyring = await store.get(vaultName, '_keyring', userId)\n const otherOwners = (await store.list(vaultName, '_keyring')).filter((u) => u !== userId)\n if (otherOwners.length > 0) {\n throw new AdoptionStateError(\n `vault \"${vaultName}\" already has a keyring for a different owner; cannot create owner \"${userId}\".`,\n )\n }\n\n // Stage A — mint the owner keyring + merge the partition DEKs. Considered done\n // only when the keyring already holds every partition DEK. createOwnerKeyring\n // overwrites (fresh KEK + fresh _users DEK), so re-running is safe ONLY while\n // no recovery has been enrolled yet — guaranteed here because enrollment\n // (Stage C) runs strictly after Stage A completes.\n const partitionCollections = [...partitionDeks.keys()]\n const priorDeks = existingKeyring ? (JSON.parse(existingKeyring._data) as KeyringFile).deks : {}\n const ownerMinted = existingKeyring !== null && partitionCollections.every((c) => c in priorDeks)\n if (!ownerMinted) {\n // Resolve the owner secret. Managed mode mints a random secret, seals\n // it under the provider, and persists _meta/sealed-secret (so the\n // partition auto-unlocks on the recipient's device); standard mode uses the\n // caller's secret. Idempotent under retry — resolveManagedSecret's reopen\n // arm reuses an already-sealed secret.\n const secret = isManaged(opts)\n ? await resolveManagedSecret(store, vaultName, opts.sealingKey)\n : opts.secret\n\n // Mint the owner keyring (KEK + _users DEK + canary, written to disk).\n const unlocked = await createOwnerKeyring(store, vaultName, { userId: userId, secret: secret })\n\n // Merge the partition DEKs (wrapped under the new KEK) into the keyring.\n const env = await store.get(vaultName, '_keyring', userId)\n if (!env) throw new AdoptionStateError(`keyring write for \"${userId}\" did not persist`)\n const keyringFile = JSON.parse(env._data) as KeyringFile\n const kek = unlocked.kek\n if (!kek) throw new AdoptionStateError(`owner keyring for \"${userId}\" has no KEK to wrap partition DEKs under`)\n const mergedDeks: Record<string, string> = { ...keyringFile.deks }\n for (const [collection, dek] of partitionDeks) {\n mergedDeks[collection] = await wrapKey(dek, kek)\n }\n const mergedFile: KeyringFile = { ...keyringFile, deks: mergedDeks }\n await store.put(vaultName, '_keyring', userId, { ...env, _data: JSON.stringify(mergedFile) })\n }\n\n // Stage B — record the ownership transition on the carried\n // audit chain (carryLedger sealed the _ledger DEK). No-op without that DEK.\n // Idempotent: appended only if the closing `transfer-seal-consumed` entry is\n // absent, so a retry does not duplicate the pair.\n const ledgerDek = partitionDeks.get(LEDGER_COLLECTION)\n if (ledgerDek) {\n const ledger = new LedgerStore({\n adapter: store,\n vault: vaultName,\n encrypted: true,\n getDEK: async () => ledgerDek,\n actor: userId,\n })\n const creationReason = `creation-of-new-owner:${userId}`\n const consumedReason = `transfer-seal-consumed:${adoption.sealId}`\n // Gate each append on its own presence — a crash or store error strictly\n // between the two adjacent puts would otherwise re-append the first one\n // on retry. The pair is the audit record, not a single transaction.\n const recordedReasons = new Set((await ledger.loadAllEntries()).map((e) => e.reason))\n if (!recordedReasons.has(creationReason)) {\n await ledger.append({ op: 'lifecycle', collection: '', id: '', version: 0, actor: '', payloadHash: '', reason: creationReason })\n }\n if (!recordedReasons.has(consumedReason)) {\n await ledger.append({ op: 'lifecycle', collection: '', id: '', version: 0, actor: '', payloadHash: '', reason: consumedReason })\n }\n }\n\n // Stage C — Managed mode: enroll the mandatory strong recovery\n // by orchestrating the existing public ceremony. The partition is\n // now a managed-mode vault on disk (sealed secret + keyring), so we\n // open it as a normal client and let openVaultAndEnrollRecovery do the\n // gate-bypass + enroll + re-assert. Dynamic import keeps the Noydb class\n // out of the @noy-db/hub/cargo static graph. Runs BEFORE seal destruction\n // so a failure here leaves the seal intact and the call retryable.\n if (isManaged(opts)) {\n const { createNoydb } = await import('../kernel/noydb.js')\n const db = await createNoydb({\n store,\n user: userId,\n secretMode: 'managed',\n sealingKey: opts.sealingKey,\n shamirRecovery: opts.shamirRecovery,\n })\n await db.team.openVaultAndEnrollRecovery(vaultName, { recovery: opts.recovery })\n }\n\n // Stage D — Destroy the transfer seal LAST — the commit point. Everything\n // above is either idempotent or resumable, so the seal is only consumed\n // once the owner keyring (and, in managed mode, strong recovery) is\n // durably in place. Retain sealId + consumedAt for audit.\n const consumed = { sealId: adoption.sealId, adoptedAt: adoption.adoptedAt, consumedAt: new Date().toISOString() }\n await store.put(vaultName, '_meta', 'adoption', { ...adoptionEnv, _data: JSON.stringify(consumed) })\n\n return { vaultName, userId }\n}\n","/**\n * Read-side counterpart to `extractPartition`: decrypt an\n * extracted-partition bundle's records to plaintext using its transfer\n * key, WITHOUT adopting it into a vault. Used by an outward\n * orchestration layer's reconcile/merge and field-authority flows to\n * compare incoming records against a receiver. The transfer key validates the bundle\n * (wrong key throws).\n * @module\n */\nimport type { EncryptedEnvelope } from '../kernel/types.js'\nimport { openEnvelopeJson } from '../kernel/enclave/index.js'\nimport { readPodHeader, readPod, parseExtractedPartitionBody } from '../with-pod/pod.js'\nimport { unsealDeks } from './adopt-partition.js'\n\n/** One decrypted record from an extracted-partition compartment. */\nexport interface DecryptedRecord {\n readonly id: string\n readonly record: Record<string, unknown>\n /** Source envelope write timestamp (ISO) — for last-write-wins merges. */\n readonly ts: string\n /** Source envelope version. */\n readonly version: number\n /** Provenance source id (FR-5). Present only when the source collection had provenance:true and a source was supplied on put. */\n readonly source?: string\n /** ISO-8601 timestamp the provenance source was recorded (FR-5). */\n readonly sourceTs?: string\n}\n\n/**\n * Decrypt every record of an extracted-partition bundle to plaintext,\n * grouped by collection. Throws if the bundle isn't an\n * extracted-partition or the transfer key is wrong.\n */\nexport async function decryptExtractedPartition(\n bundleBytes: Uint8Array,\n transferKey: Uint8Array,\n): Promise<Record<string, DecryptedRecord[]>> {\n const header = readPodHeader(bundleBytes)\n if (header.bundleKind !== 'extracted-partition' || header.transferSeal === undefined) {\n throw new Error('decryptExtractedPartition: bundle is not an extracted-partition.')\n }\n const { dumpJson } = await readPod(bundleBytes)\n const { dump, seal } = parseExtractedPartitionBody(dumpJson)\n const deks = await unsealDeks(seal, transferKey) // throws TransferSealError on wrong key\n const backup = JSON.parse(dump) as { collections: Record<string, Record<string, EncryptedEnvelope>> }\n const out: Record<string, DecryptedRecord[]> = {}\n for (const [collection, byId] of Object.entries(backup.collections)) {\n const dek = deks.get(collection)\n if (dek === undefined) continue // no DEK sealed for this collection — skip\n const recs: DecryptedRecord[] = []\n for (const [id, env] of Object.entries(byId)) {\n const plaintext = await openEnvelopeJson(env, dek)\n const body = JSON.parse(plaintext) as Record<string, unknown>\n recs.push({\n id,\n record: { ...body, id },\n ts: env._ts,\n version: env._v,\n ...(env._source !== undefined ? { source: env._source } : {}),\n ...(env._sourceTs !== undefined ? { sourceTs: env._sourceTs } : {}),\n })\n }\n out[collection] = recs\n }\n return out\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2JA,eAAsB,UACpB,OACA,WACA,UAAuB,CAAC,GACD;AACvB,QAAM,QAAQ,QAAQ,SAAS;AAC/B,QAAM,SAAS,QAAQ,cAAc,IAAI,IAAI,QAAQ,WAAW,IAAI;AACpE,QAAM,YACJ,QAAQ,cAAc,CAAC,GAAY,MAAe,KAAU,GAAG,CAAC,EAAE,WAAW;AAO/E,QAAM,OAAO,oBAAI,IAA4B;AAC7C,mBAAiB,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AC;AAChD,aAAW,CAAC,YAAY,IAAI,KAAK,OAAO,QAAQ,OAAO,WAAW,GAAG;AACnE,UAAM,MAAM,KAAK,IAAI,UAAU;AAC/B,QAAI,QAAQ,OAAW;AACvB,UAAM,OAA0B,CAAC;AACjC,eAAW,CAAC,IAAI,GAAG,KAAK,OAAO,QAAQ,IAAI,GAAG;AAC5C,YAAM,YAAY,MAAM,iBAAiB,KAAK,GAAG;AACjD,YAAM,OAAO,KAAK,MAAM,SAAS;AACjC,WAAK,KAAK;AAAA,QACR;AAAA,QACA,QAAQ,EAAE,GAAG,MAAM,GAAG;AAAA,QACtB,IAAI,IAAI;AAAA,QACR,SAAS,IAAI;AAAA,QACb,GAAI,IAAI,YAAY,SAAY,EAAE,QAAQ,IAAI,QAAQ,IAAI,CAAC;AAAA,QAC3D,GAAI,IAAI,cAAc,SAAY,EAAE,UAAU,IAAI,UAAU,IAAI,CAAC;AAAA,MACnE,CAAC;AAAA,IACH;AACA,QAAI,UAAU,IAAI;AAAA,EACpB;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
envelopeBodyForHash
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZWPUYBNK.js";
|
|
4
4
|
import {
|
|
5
5
|
sha256Hex
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QTDAPDDV.js";
|
|
7
7
|
|
|
8
8
|
// src/with-commit/history/ledger/entry.ts
|
|
9
9
|
function canonicalJson(value) {
|
|
@@ -67,4 +67,4 @@ export {
|
|
|
67
67
|
parseIndex,
|
|
68
68
|
envelopePayloadHash
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=chunk-
|
|
70
|
+
//# sourceMappingURL=chunk-A4JJUWSV.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyJoins,
|
|
3
3
|
splitAroundJoins
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QI2KXQOM.js";
|
|
5
5
|
import {
|
|
6
6
|
NO_REDUCE
|
|
7
7
|
} from "./chunk-YMUFFJCO.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
CrossJoinTooLargeError,
|
|
19
19
|
DanglingReferenceError,
|
|
20
20
|
FieldNotQueryableError
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-I64WQSN3.js";
|
|
22
22
|
|
|
23
23
|
// src/kernel/query/live.ts
|
|
24
24
|
function buildLiveQuery(recompute, upstreams) {
|
|
@@ -1574,4 +1574,4 @@ export {
|
|
|
1574
1574
|
executePlan,
|
|
1575
1575
|
ScanBuilder
|
|
1576
1576
|
};
|
|
1577
|
-
//# sourceMappingURL=chunk-
|
|
1577
|
+
//# sourceMappingURL=chunk-AFSMT3WI.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TierWriteRefusedError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-I64WQSN3.js";
|
|
4
4
|
|
|
5
5
|
// src/kernel/tier-visibility.ts
|
|
6
6
|
async function peekLiveTier(adapter, vault, name, id) {
|
|
@@ -34,4 +34,4 @@ export {
|
|
|
34
34
|
assertTierWritable,
|
|
35
35
|
assertCutoverTierSafe
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-AMKCY454.js.map
|
|
@@ -7,28 +7,28 @@ import {
|
|
|
7
7
|
deriveSchemaManifest,
|
|
8
8
|
loadSchemaManifestEntry,
|
|
9
9
|
saveSchemaManifest
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZHDMT2MJ.js";
|
|
11
11
|
import {
|
|
12
12
|
MANIFEST_COLLECTION
|
|
13
13
|
} from "./chunk-EPFF7LOX.js";
|
|
14
14
|
import {
|
|
15
15
|
loadFence,
|
|
16
16
|
saveFence
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LBQIKMBH.js";
|
|
18
18
|
import {
|
|
19
19
|
derivePersistedSchema
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-HNOBRU24.js";
|
|
21
21
|
import {
|
|
22
22
|
loadPersistedSchemaEntry,
|
|
23
23
|
savePersistedSchema
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-CK6Z5DJQ.js";
|
|
25
25
|
import {
|
|
26
26
|
envelopePayloadHash
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-A4JJUWSV.js";
|
|
28
28
|
import {
|
|
29
29
|
ManifestConflictError,
|
|
30
30
|
isConflictError
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-I64WQSN3.js";
|
|
32
32
|
|
|
33
33
|
// src/with-shape/persisted-schemas/field-ids.ts
|
|
34
34
|
var BASE32URL_ALPHABET = "abcdefghijklmnopqrstuvwxyz234567";
|
|
@@ -257,4 +257,4 @@ export {
|
|
|
257
257
|
persistClassifiedMarker,
|
|
258
258
|
persistSatelliteMarker
|
|
259
259
|
};
|
|
260
|
-
//# sourceMappingURL=chunk-
|
|
260
|
+
//# sourceMappingURL=chunk-BVYRPAB2.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sha256Hex
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QTDAPDDV.js";
|
|
4
4
|
import {
|
|
5
5
|
MaterializedViewSourceUnknownError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-I64WQSN3.js";
|
|
7
7
|
|
|
8
8
|
// src/with-formula/materialized-views/dependency-analyzer.ts
|
|
9
9
|
function analyzeDependencies(query) {
|
|
@@ -366,4 +366,4 @@ export {
|
|
|
366
366
|
MaterializedViewRegistry,
|
|
367
367
|
wrapDbWithPredicates
|
|
368
368
|
};
|
|
369
|
-
//# sourceMappingURL=chunk-
|
|
369
|
+
//# sourceMappingURL=chunk-C66T4W5P.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-YJU7GUYJ.js");
|
|
205
205
|
const value = await revealSealedField({
|
|
206
206
|
collection: ctx.collection,
|
|
207
207
|
encrypted: ctx.encrypted,
|
|
@@ -213,26 +213,26 @@ function withClassified() {
|
|
|
213
213
|
return value;
|
|
214
214
|
},
|
|
215
215
|
async verify(ctx, id, field, candidate) {
|
|
216
|
-
const { verifyDigestField } = await import("./verify-
|
|
216
|
+
const { verifyDigestField } = await import("./verify-SHJXGZGM.js");
|
|
217
217
|
const verdict = await verifyDigestField(engineCtx(ctx), id, field, candidate, policyOf(ctx.spec));
|
|
218
218
|
await ctx.onAccess?.("verify", id);
|
|
219
219
|
return verdict;
|
|
220
220
|
},
|
|
221
221
|
async verifyText(ctx, id, field, candidate) {
|
|
222
|
-
const { verifyTextField } = await import("./verify-
|
|
222
|
+
const { verifyTextField } = await import("./verify-SHJXGZGM.js");
|
|
223
223
|
const verdict = await verifyTextField(engineCtx(ctx), id, field, candidate, ctx.spec.verifyNormalize ?? "password");
|
|
224
224
|
await ctx.onAccess?.("verify", id);
|
|
225
225
|
return verdict;
|
|
226
226
|
},
|
|
227
227
|
async matchGroup(ctx, id, answers, opts) {
|
|
228
|
-
const { matchGroupFields } = await import("./verify-
|
|
228
|
+
const { matchGroupFields } = await import("./verify-SHJXGZGM.js");
|
|
229
229
|
const members = (ctx.groupMembers ?? []).map((m) => ({ field: m.field, policy: policyOf(m.spec) }));
|
|
230
230
|
const result = await matchGroupFields(engineCtx(ctx), id, answers, members, opts);
|
|
231
231
|
await ctx.onAccess?.("verify", id);
|
|
232
232
|
return result;
|
|
233
233
|
},
|
|
234
234
|
async computeTarget(ctx, field, candidate, costByte) {
|
|
235
|
-
const { computeBidxTarget } = await import("./find-
|
|
235
|
+
const { computeBidxTarget } = await import("./find-VBNMB42N.js");
|
|
236
236
|
const dek = await ctx.getDEK();
|
|
237
237
|
return computeBidxTarget(candidate, policyOf(ctx.spec).normalize, dek, ctx.collection, field, costByte);
|
|
238
238
|
}
|
|
@@ -244,4 +244,4 @@ export {
|
|
|
244
244
|
classified,
|
|
245
245
|
withClassified
|
|
246
246
|
};
|
|
247
|
-
//# sourceMappingURL=chunk-
|
|
247
|
+
//# sourceMappingURL=chunk-C6MI5OCF.js.map
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
persistUserVisibility,
|
|
5
5
|
readUserVisibility,
|
|
6
6
|
saveUserEnvelope
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CK7IRIRY.js";
|
|
8
8
|
import {
|
|
9
9
|
PolicyDeniedError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-I64WQSN3.js";
|
|
11
11
|
|
|
12
12
|
// src/with-party/directory/user-envelope/api.ts
|
|
13
13
|
var UserApi = class {
|
|
@@ -379,4 +379,4 @@ export {
|
|
|
379
379
|
UserApi,
|
|
380
380
|
createUserApi
|
|
381
381
|
};
|
|
382
|
-
//# sourceMappingURL=chunk-
|
|
382
|
+
//# sourceMappingURL=chunk-CAJ7QAPC.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openEnvelopeJson
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZWPUYBNK.js";
|
|
4
4
|
import {
|
|
5
5
|
encrypt
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QTDAPDDV.js";
|
|
7
7
|
import {
|
|
8
8
|
NOYDB_FORMAT_VERSION
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6ZFTVY3O.js";
|
|
10
10
|
|
|
11
11
|
// src/with-shape/persisted-schemas/storage.ts
|
|
12
12
|
var SCHEMAS_COLLECTION = "_schemas";
|
|
@@ -46,4 +46,4 @@ export {
|
|
|
46
46
|
loadPersistedSchema,
|
|
47
47
|
savePersistedSchema
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-CK6Z5DJQ.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openEnvelopeJson
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZWPUYBNK.js";
|
|
4
4
|
import {
|
|
5
5
|
encrypt
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QTDAPDDV.js";
|
|
7
7
|
import {
|
|
8
8
|
NOYDB_FORMAT_VERSION
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6ZFTVY3O.js";
|
|
10
10
|
import {
|
|
11
11
|
ConflictError,
|
|
12
12
|
USER_ENVELOPE_COLLECTION,
|
|
13
13
|
USER_ENVELOPE_MAX_BYTES,
|
|
14
14
|
UserEnvelopeOversizedError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-I64WQSN3.js";
|
|
16
16
|
|
|
17
17
|
// src/with-party/directory/storage.ts
|
|
18
18
|
var META_COLLECTION = "_meta";
|
|
@@ -148,4 +148,4 @@ export {
|
|
|
148
148
|
deleteUserEnvelope,
|
|
149
149
|
listUserEnvelopeIds
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=chunk-
|
|
151
|
+
//# sourceMappingURL=chunk-CK7IRIRY.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePod
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4LNFXGNW.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-CNA3QRLM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-audit/portability/export-accessible.ts"],"sourcesContent":["/**\n * `exportMyAccessibleData`: a non-owner user exports the scope they\n * can decrypt as a portable, re-keyed `.noydb` bundle. Non-destructive and\n * **always allowed** (the \"data sovereignty by construction\" property of\n * sealing-at-dimension — the firm cannot deny it) but **audited**.\n *\n * Reuses the existing bundle machinery: the access boundary is the caller's DEK\n * set (operator/client → `keyring.permissions`; owner/admin/viewer → all), so a\n * record outside the caller's keys can never enter the bundle. Re-keying to a\n * new owner reuses `writePod`'s `exportSecret` shorthand.\n */\nimport type { Vault } from '../../kernel/vault.js'\nimport type { UnlockedKeyring } from '../../with-party/team/keyring.js'\nimport { writePod } from '../../with-pod/pod.js'\n\n/**\n * Resolve the collections a caller may export/withdraw: operator/client are\n * scoped to their granted collections; owner/admin/viewer see everything\n * (`undefined` = no allowlist). A `scope.collections` sub-scope intersects the\n * granted set. `writableOnly` keeps only `rw` grants (for destructive ops).\n */\nexport function resolveAccessibleCollections(\n keyring: UnlockedKeyring,\n scope: { collections?: readonly string[] } | undefined,\n writableOnly = false,\n): string[] | undefined {\n let collections: string[] | undefined\n if (keyring.role === 'operator' || keyring.role === 'client') {\n collections = Object.entries(keyring.permissions)\n .filter(([, mode]) => !writableOnly || mode === 'rw')\n .map(([c]) => c)\n }\n if (scope?.collections) {\n const allow = new Set(scope.collections)\n collections = (collections ?? [...scope.collections]).filter((c) => allow.has(c))\n }\n return collections\n}\n\n/** Produce a (optionally re-keyed, scoped) `.noydb` bundle — no audit. */\nexport async function buildAccessibleBundle(\n vault: Vault,\n collections: string[] | undefined,\n reKey: { secret: string } | undefined,\n compression: 'auto' | 'brotli' | 'gzip' | 'none' = 'auto',\n): Promise<Uint8Array> {\n return writePod(vault, {\n compression,\n ...(collections !== undefined ? { collections } : {}),\n ...(reKey ? { exportSecret: reKey.secret } : {}),\n })\n}\n\nexport interface ExportAccessibleOptions {\n /**\n * Re-key the bundle so it is independently openable by a new owner with this\n * secret (the receiving firm / the client themselves). Omit to inherit\n * the source keyring (personal backup).\n */\n readonly reKey?: { readonly secret: string }\n /** Narrow the export to a subset of the caller's accessible collections. */\n readonly scope?: { readonly collections?: readonly string[] }\n readonly compression?: 'auto' | 'brotli' | 'gzip' | 'none'\n}\n\n/**\n * Produce a re-keyed, access-scoped `.noydb` bundle of the caller's accessible\n * data. Appends a tamper-evident audit entry (`reason: 'user-export:<userId>'`).\n */\nexport async function exportAccessibleData(\n vault: Vault,\n opts: ExportAccessibleOptions = {},\n): Promise<Uint8Array> {\n const { keyring } = vault._introspectState()\n const collections = resolveAccessibleCollections(keyring, opts.scope)\n const bytes = await buildAccessibleBundle(vault, collections, opts.reKey, opts.compression ?? 'auto')\n\n // §11.11 audit — non-destructive, always-allowed export. No-op when the vault\n // has no history/ledger strategy (avoids minting a phantom _ledger DEK).\n await vault._getLedgerOrNull()?.append({\n op: 'lifecycle',\n collection: '',\n id: '',\n version: 0,\n actor: keyring.userId,\n payloadHash: '',\n reason: `user-export:${keyring.userId}`,\n })\n\n return bytes\n}\n"],"mappings":";;;;;AAqBO,SAAS,6BACd,SACA,OACA,eAAe,OACO;AACtB,MAAI;AACJ,MAAI,QAAQ,SAAS,cAAc,QAAQ,SAAS,UAAU;AAC5D,kBAAc,OAAO,QAAQ,QAAQ,WAAW,EAC7C,OAAO,CAAC,CAAC,EAAE,IAAI,MAAM,CAAC,gBAAgB,SAAS,IAAI,EACnD,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AAAA,EACnB;AACA,MAAI,OAAO,aAAa;AACtB,UAAM,QAAQ,IAAI,IAAI,MAAM,WAAW;AACvC,mBAAe,eAAe,CAAC,GAAG,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,MAAM,IAAI,CAAC,CAAC;AAAA,EAClF;AACA,SAAO;AACT;AAGA,eAAsB,sBACpB,OACA,aACA,OACA,cAAmD,QAC9B;AACrB,SAAO,SAAS,OAAO;AAAA,IACrB;AAAA,IACA,GAAI,gBAAgB,SAAY,EAAE,YAAY,IAAI,CAAC;AAAA,IACnD,GAAI,QAAQ,EAAE,cAAc,MAAM,OAAO,IAAI,CAAC;AAAA,EAChD,CAAC;AACH;AAkBA,eAAsB,qBACpB,OACA,OAAgC,CAAC,GACZ;AACrB,QAAM,EAAE,QAAQ,IAAI,MAAM,iBAAiB;AAC3C,QAAM,cAAc,6BAA6B,SAAS,KAAK,KAAK;AACpE,QAAM,QAAQ,MAAM,sBAAsB,OAAO,aAAa,KAAK,OAAO,KAAK,eAAe,MAAM;AAIpG,QAAM,MAAM,iBAAiB,GAAG,OAAO;AAAA,IACrC,IAAI;AAAA,IACJ,YAAY;AAAA,IACZ,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,IACf,aAAa;AAAA,IACb,QAAQ,eAAe,QAAQ,MAAM;AAAA,EACvC,CAAC;AAED,SAAO;AACT;","names":[]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertTierAccess,
|
|
3
3
|
dekKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YVOW35HH.js";
|
|
5
5
|
import {
|
|
6
6
|
liveRecordIsElevated,
|
|
7
7
|
liveRecordTier
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AMKCY454.js";
|
|
9
9
|
import {
|
|
10
10
|
openEnvelopeJson,
|
|
11
11
|
writeEnvelopeBody
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZWPUYBNK.js";
|
|
13
13
|
import {
|
|
14
14
|
base64ToBuffer,
|
|
15
15
|
bufferToBase64,
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
sha256Hex,
|
|
22
22
|
unwrapCek,
|
|
23
23
|
wrapCek
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-QTDAPDDV.js";
|
|
25
25
|
import {
|
|
26
26
|
NOYDB_FORMAT_VERSION
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-6ZFTVY3O.js";
|
|
28
28
|
import {
|
|
29
29
|
BlobIntentPendingError,
|
|
30
30
|
BlobOfflineError,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
UnsupportedTierCompositionError,
|
|
36
36
|
ValidationError,
|
|
37
37
|
isConflictError
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-I64WQSN3.js";
|
|
39
39
|
|
|
40
40
|
// src/with-shape/blobs/blob-pinning.ts
|
|
41
41
|
function memoryBlobPinStore() {
|
|
@@ -3070,4 +3070,4 @@ export {
|
|
|
3070
3070
|
DEFAULT_CHUNK_SIZE,
|
|
3071
3071
|
BlobSet
|
|
3072
3072
|
};
|
|
3073
|
-
//# sourceMappingURL=chunk-
|
|
3073
|
+
//# sourceMappingURL=chunk-CWX6YIX5.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadVaultPolicy,
|
|
3
3
|
saveVaultPolicy
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YZ7BRD26.js";
|
|
5
5
|
import {
|
|
6
6
|
PolicyDeniedError,
|
|
7
7
|
ValidationError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-I64WQSN3.js";
|
|
9
9
|
|
|
10
10
|
// src/with-party/policy/presets.ts
|
|
11
11
|
var PERSONAL_POLICY = Object.freeze({
|
|
@@ -364,4 +364,4 @@ export {
|
|
|
364
364
|
describeGate,
|
|
365
365
|
createNoydbPolicy
|
|
366
366
|
};
|
|
367
|
-
//# sourceMappingURL=chunk-
|
|
367
|
+
//# sourceMappingURL=chunk-D763JZRO.js.map
|