@noy-db/hub 0.8.0 → 0.9.0-pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/README.md +8 -8
- package/codemods/0.4.0-pre.json +1 -1
- package/codemods/0.8.0-pre.json +1 -1
- package/dist/api-6EFD43KN.js +18 -0
- package/dist/as/index.js +33 -23
- package/dist/as/index.js.map +1 -1
- package/dist/at/index.js +8 -8
- package/dist/attestation/index.js +18 -18
- package/dist/{backup-YE2VQ26S.js → backup-RJBFQSHE.js} +92 -31
- package/dist/backup-RJBFQSHE.js.map +1 -0
- package/dist/blobs/index.js +12 -12
- package/dist/broker/index.js +19 -11
- package/dist/broker/index.js.map +1 -1
- package/dist/by/index.js +2 -2
- package/dist/capsule/contract.d.ts +1 -1
- package/dist/capsule/contract.js +6 -6
- package/dist/capsule/enclave-aes/broker/proof.d.ts +12 -3
- package/dist/capsule/enclave-aes/crypto.d.ts +18 -0
- package/dist/capsule/enclave-aes/index.d.ts +3 -3
- package/dist/capsule/enclave-aes/index.js +46 -14
- package/dist/capsule/enclave-aes/index.js.map +1 -1
- package/dist/capsule/index.d.ts +2 -2
- package/dist/capsule/plumbing/record-codec.d.ts +7 -0
- package/dist/{capsule-VOLX3QRQ.js → capsule-6LJAVQNM.js} +14 -8
- package/dist/cargo/index.js +35 -35
- package/dist/{chunk-GZT3NQRA.js → chunk-25FXU6WS.js} +8 -2
- package/dist/chunk-25FXU6WS.js.map +1 -0
- package/dist/{chunk-OYW3I5M4.js → chunk-2DOCDOPL.js} +6 -6
- package/dist/chunk-2DX4JCRI.js +1 -0
- package/dist/{chunk-FLPCETP6.js → chunk-2LBS62AC.js} +2 -2
- package/dist/{chunk-WXE4W2U6.js → chunk-2ST3WA3C.js} +4 -4
- package/dist/{chunk-DQESF6RP.js → chunk-3G3GOGZZ.js} +50 -40
- package/dist/chunk-3G3GOGZZ.js.map +1 -0
- package/dist/{chunk-O2IMQSNA.js → chunk-3YBIVLTC.js} +2 -2
- package/dist/{chunk-LGNDFRYC.js → chunk-4CFHL5RY.js} +1 -1
- package/dist/chunk-4CFHL5RY.js.map +1 -0
- package/dist/{chunk-DIZLQVAA.js → chunk-4CHM2TRS.js} +2 -2
- package/dist/{chunk-V7ADQF5O.js → chunk-4CUJLEOA.js} +4 -4
- package/dist/{chunk-3EWS67C7.js → chunk-4TG2ITRW.js} +2 -2
- package/dist/{chunk-HS554XAF.js → chunk-5HQFROZS.js} +2 -2
- package/dist/{chunk-IUBMZPHM.js → chunk-5ZVE3N5C.js} +5 -6
- package/dist/chunk-5ZVE3N5C.js.map +1 -0
- package/dist/{chunk-PP3K67AJ.js → chunk-654RE5YC.js} +3 -3
- package/dist/{chunk-FOEDQATO.js → chunk-66GD7XXU.js} +2 -2
- package/dist/{chunk-BNWA3WG5.js → chunk-72FQ46VW.js} +3 -3
- package/dist/{chunk-EYG2CY2X.js → chunk-7JPA3LIH.js} +11 -11
- package/dist/chunk-7JPA3LIH.js.map +1 -0
- package/dist/{chunk-JQYKPKG6.js → chunk-7K42TSCY.js} +4 -4
- package/dist/{chunk-BPWYQ25R.js → chunk-7Q6IU3R7.js} +4 -4
- package/dist/{chunk-BPWYQ25R.js.map → chunk-7Q6IU3R7.js.map} +1 -1
- package/dist/{chunk-T7IR4N2S.js → chunk-7UHLO4ZN.js} +37 -2
- package/dist/chunk-7UHLO4ZN.js.map +1 -0
- package/dist/{chunk-UEFOQH74.js → chunk-ADCXTW7L.js} +2 -2
- package/dist/{chunk-MBMTND6D.js → chunk-AGGPT4UE.js} +2 -2
- package/dist/{chunk-RB4DOPGZ.js → chunk-AKIEBFIJ.js} +10 -10
- package/dist/{chunk-VHBKYN2J.js → chunk-B3B6HV5S.js} +2 -2
- package/dist/{chunk-JWWYRR4Q.js → chunk-B6EWMGFX.js} +2 -2
- package/dist/{chunk-H7JBY4P7.js → chunk-B7Y2BRQA.js} +14 -14
- package/dist/chunk-B7Y2BRQA.js.map +1 -0
- package/dist/{chunk-4CIQDWRB.js → chunk-BFJE2GPP.js} +14 -8
- package/dist/{chunk-4CIQDWRB.js.map → chunk-BFJE2GPP.js.map} +1 -1
- package/dist/{chunk-WPOYWFSE.js → chunk-BJRKXNFP.js} +7 -7
- package/dist/{chunk-H427H63K.js → chunk-BPQ5CRJF.js} +2 -2
- package/dist/{chunk-VFHCKG5M.js → chunk-BVRJYMFZ.js} +3 -3
- package/dist/{chunk-244QBK7Z.js → chunk-C4XV3PSJ.js} +4 -4
- package/dist/{chunk-244QBK7Z.js.map → chunk-C4XV3PSJ.js.map} +1 -1
- package/dist/{chunk-SMV2HRDU.js → chunk-DFC4WTJW.js} +2 -2
- package/dist/{chunk-5A4345TG.js → chunk-DMIEKD24.js} +3 -3
- package/dist/{chunk-TKVUE4JF.js → chunk-DQAXA2GK.js} +9 -9
- package/dist/{chunk-AL6ML4LA.js → chunk-DWCFGF2K.js} +5 -5
- package/dist/{chunk-Y3LPTBG7.js → chunk-E2C6FFSI.js} +6 -9
- package/dist/chunk-E2C6FFSI.js.map +1 -0
- package/dist/{chunk-LNSVGRHO.js → chunk-EQ6C2ZPT.js} +17 -51
- package/dist/chunk-EQ6C2ZPT.js.map +1 -0
- package/dist/chunk-EZOFTI4K.js +60 -0
- package/dist/chunk-EZOFTI4K.js.map +1 -0
- package/dist/{chunk-PD64727P.js → chunk-FMINS2B6.js} +2 -2
- package/dist/chunk-FMINS2B6.js.map +1 -0
- package/dist/{chunk-QBLT6POL.js → chunk-FPF5HRBE.js} +2 -2
- package/dist/{chunk-UA372JHH.js → chunk-FZVCZEVI.js} +3 -3
- package/dist/chunk-FZVCZEVI.js.map +1 -0
- package/dist/{chunk-FFWI7UH7.js → chunk-GAGT3YZN.js} +1 -1
- package/dist/chunk-GAGT3YZN.js.map +1 -0
- package/dist/{chunk-5WWDGFOS.js → chunk-GIQJGXV7.js} +2 -2
- package/dist/{chunk-V3RWOOSO.js → chunk-GYZICGRU.js} +4 -4
- package/dist/chunk-GYZICGRU.js.map +1 -0
- package/dist/{chunk-BVCUTXE3.js → chunk-H334G6KU.js} +2 -2
- package/dist/{chunk-AEQGFRU4.js → chunk-HE7EAHGS.js} +3 -3
- package/dist/chunk-HKB4HZDU.js +74 -0
- package/dist/chunk-HKB4HZDU.js.map +1 -0
- package/dist/{chunk-4V3Q35WG.js → chunk-ICF3TIGY.js} +3 -3
- package/dist/{chunk-3L2NBKDR.js → chunk-IF2M43G4.js} +2 -2
- package/dist/{chunk-37EPTBBR.js → chunk-IKPQ2GGB.js} +46 -4
- package/dist/chunk-IKPQ2GGB.js.map +1 -0
- package/dist/{chunk-DHHGL42E.js → chunk-IKS2CPAG.js} +27 -11
- package/dist/chunk-IKS2CPAG.js.map +1 -0
- package/dist/{chunk-3A5DUZ56.js → chunk-IMIQAGR7.js} +6 -6
- package/dist/{chunk-3A5DUZ56.js.map → chunk-IMIQAGR7.js.map} +1 -1
- package/dist/{chunk-A4XMIZT3.js → chunk-IQAJ4OR6.js} +41 -6
- package/dist/chunk-IQAJ4OR6.js.map +1 -0
- package/dist/{chunk-IUT3GWP3.js → chunk-IUD7WU67.js} +17 -93
- package/dist/chunk-IUD7WU67.js.map +1 -0
- package/dist/{chunk-AUKKUPVB.js → chunk-IVLRPRXM.js} +2 -2
- package/dist/{chunk-GUZET4SG.js → chunk-JAQHWHUN.js} +4 -4
- package/dist/chunk-JAQHWHUN.js.map +1 -0
- package/dist/{chunk-Y2RKVFKR.js → chunk-K4JSTGXT.js} +2 -2
- package/dist/{chunk-EJLV62NI.js → chunk-KN4LUMH6.js} +2 -2
- package/dist/{chunk-23D6M6VM.js → chunk-KZA3DITX.js} +4 -4
- package/dist/{chunk-E2N2T5ZO.js → chunk-L2VM64HK.js} +2 -2
- package/dist/chunk-L4UL4IAR.js +55 -0
- package/dist/chunk-L4UL4IAR.js.map +1 -0
- package/dist/{chunk-UIYESRD6.js → chunk-LUCQY3OM.js} +10 -10
- package/dist/{chunk-UIYESRD6.js.map → chunk-LUCQY3OM.js.map} +1 -1
- package/dist/{chunk-O46CHQT7.js → chunk-MAQBYBUX.js} +4 -4
- package/dist/{chunk-EZOAKKTB.js → chunk-MBPZMZVB.js} +2 -2
- package/dist/{chunk-XQRFSKYM.js → chunk-MCNNZBG7.js} +2 -2
- package/dist/{chunk-YRXFFWG4.js → chunk-MLVPMDOZ.js} +2 -2
- package/dist/{chunk-5FE75J4S.js → chunk-MMCN7TLK.js} +5 -5
- package/dist/{chunk-MXOQ5JCG.js → chunk-MRCR7ZMC.js} +686 -202
- package/dist/chunk-MRCR7ZMC.js.map +1 -0
- package/dist/{chunk-SYNY3VB5.js → chunk-NCTN2FW4.js} +2 -2
- package/dist/{chunk-4T3SE27M.js → chunk-ND6S2DKC.js} +2 -2
- package/dist/{chunk-3XJQBBZD.js → chunk-NTVKHQ3L.js} +2 -2
- package/dist/{chunk-RHVMZSUU.js → chunk-NV4OESHC.js} +1 -1
- package/dist/chunk-NV4OESHC.js.map +1 -0
- package/dist/chunk-NXQEOC3X.js +40 -0
- package/dist/chunk-NXQEOC3X.js.map +1 -0
- package/dist/{chunk-Q4UHJ5SN.js → chunk-O2VQ3K36.js} +2 -2
- package/dist/{chunk-HW7CMKUG.js → chunk-OFD2HD6F.js} +1 -1
- package/dist/{chunk-HW7CMKUG.js.map → chunk-OFD2HD6F.js.map} +1 -1
- package/dist/{chunk-2GHDLTPE.js → chunk-OGKMRIIJ.js} +2 -2
- package/dist/{chunk-N7EVQD5S.js → chunk-ONZ3B5EW.js} +4 -4
- package/dist/{chunk-VKI2EB3N.js → chunk-OOPSMQX5.js} +3 -3
- package/dist/{chunk-VMV5SBE4.js → chunk-OYEBSWLE.js} +5 -5
- package/dist/{chunk-JDEYF3PJ.js → chunk-P6FATPXQ.js} +2 -2
- package/dist/chunk-P6FATPXQ.js.map +1 -0
- package/dist/{chunk-VVOLDVIR.js → chunk-PLTIJDQN.js} +2 -2
- package/dist/{chunk-OKSTSITU.js → chunk-PR7ILCIH.js} +3 -3
- package/dist/{chunk-7R2Q7CPL.js → chunk-QE3TLZ6Z.js} +7 -7
- package/dist/{chunk-G2MVBDFP.js → chunk-QFW4MYGN.js} +39 -9
- package/dist/chunk-QFW4MYGN.js.map +1 -0
- package/dist/{chunk-6QVKPHBF.js → chunk-QHG7GQKM.js} +2 -2
- package/dist/chunk-QJNAHPVT.js +91 -0
- package/dist/chunk-QJNAHPVT.js.map +1 -0
- package/dist/{chunk-LIOVX5TJ.js → chunk-QT5ITL25.js} +3 -3
- package/dist/{chunk-IMQKWR46.js → chunk-R2ZULFXU.js} +4 -5
- package/dist/chunk-R2ZULFXU.js.map +1 -0
- package/dist/{chunk-Q2XRFWOI.js → chunk-RRTQAQ3N.js} +2 -2
- package/dist/{chunk-H23XHRTT.js → chunk-RUE6TCES.js} +809 -101
- package/dist/chunk-RUE6TCES.js.map +1 -0
- package/dist/chunk-RWFQVNXR.js +24 -0
- package/dist/chunk-RWFQVNXR.js.map +1 -0
- package/dist/{chunk-2PVXF5CS.js → chunk-SALY3LIJ.js} +3 -3
- package/dist/{chunk-JOSPH3E5.js → chunk-SBAR5JQ6.js} +2 -2
- package/dist/{chunk-N7UDP5VU.js → chunk-SCH2F7R2.js} +7 -7
- package/dist/{chunk-MXKI4ABF.js → chunk-SOOAW6HK.js} +3 -3
- package/dist/{chunk-VQDZYB2B.js → chunk-T4VTRKCY.js} +3 -3
- package/dist/{chunk-VQDZYB2B.js.map → chunk-T4VTRKCY.js.map} +1 -1
- package/dist/{chunk-TEHHROZL.js → chunk-T5EXREMW.js} +5 -5
- package/dist/{chunk-M5B2W6YY.js → chunk-TDJVQTXD.js} +3 -3
- package/dist/{chunk-QMWY2FDS.js → chunk-THQ3BHLM.js} +2 -2
- package/dist/{chunk-VAORSCSU.js → chunk-TLIFNRU5.js} +2 -2
- package/dist/chunk-TLIFNRU5.js.map +1 -0
- package/dist/{chunk-FVH5QYY2.js → chunk-TRHUNPXP.js} +2 -2
- package/dist/{chunk-EGVJ7TM4.js → chunk-UL6MTRMJ.js} +8 -9
- package/dist/chunk-UL6MTRMJ.js.map +1 -0
- package/dist/chunk-UNL6YGL5.js +169 -0
- package/dist/chunk-UNL6YGL5.js.map +1 -0
- package/dist/{chunk-747G6CT3.js → chunk-UORWAG7K.js} +2 -2
- package/dist/{chunk-XSPFDUDG.js → chunk-V7AKGAXY.js} +314 -77
- package/dist/chunk-V7AKGAXY.js.map +1 -0
- package/dist/{chunk-TZZBXPZK.js → chunk-VLQ6KT7F.js} +2 -2
- package/dist/{chunk-NCO25JZO.js → chunk-VP37VUKQ.js} +4 -4
- package/dist/{chunk-52MGURXO.js → chunk-WBUHHMLN.js} +2 -2
- package/dist/{chunk-EZGV6F47.js → chunk-WRLWEYHY.js} +7 -1
- package/dist/chunk-WRLWEYHY.js.map +1 -0
- package/dist/{chunk-2MG3SW7Q.js → chunk-X6Z2SIRF.js} +2 -2
- package/dist/{chunk-U2FZNEWJ.js → chunk-XLKWF3L4.js} +8 -6
- package/dist/{chunk-U2FZNEWJ.js.map → chunk-XLKWF3L4.js.map} +1 -1
- package/dist/{chunk-5UMK7GRI.js → chunk-XPNJH7GN.js} +5 -5
- package/dist/{chunk-KZXDLBY6.js → chunk-XPW7T2GN.js} +5 -5
- package/dist/{chunk-SV2PM2OY.js → chunk-XX4R7TUB.js} +1 -1
- package/dist/chunk-XX4R7TUB.js.map +1 -0
- package/dist/{chunk-NBQ3KK6X.js → chunk-Y55XHMQB.js} +4 -4
- package/dist/chunk-Y55XHMQB.js.map +1 -0
- package/dist/{chunk-5KC7QYEC.js → chunk-YH4OUOSI.js} +33 -7
- package/dist/chunk-YH4OUOSI.js.map +1 -0
- package/dist/{chunk-FFJFE4T7.js → chunk-YJGKOSQD.js} +2 -2
- package/dist/{chunk-2AFX33YA.js → chunk-Z3STG43F.js} +3 -3
- package/dist/chunk-Z3STG43F.js.map +1 -0
- package/dist/{chunk-OIEO4WDL.js → chunk-ZD7WFMV2.js} +2 -2
- package/dist/chunk-ZD7WFMV2.js.map +1 -0
- package/dist/{chunk-42ALPZ2B.js → chunk-ZF6JECDT.js} +4 -4
- package/dist/{chunk-42ALPZ2B.js.map → chunk-ZF6JECDT.js.map} +1 -1
- package/dist/{chunk-4JPMZTJY.js → chunk-ZF7KNSLU.js} +2 -2
- package/dist/{chunk-2ODVB6LZ.js → chunk-ZGKODRGB.js} +2 -2
- package/dist/{chunk-JIBUPZHA.js → chunk-ZNEKQFGF.js} +4 -4
- package/dist/{chunk-DLD5LGDS.js → chunk-ZUTUNVFD.js} +3 -3
- package/dist/{chunk-JSMTXZR3.js → chunk-ZWMOHANW.js} +8 -6
- package/dist/chunk-ZWMOHANW.js.map +1 -0
- package/dist/{chunk-MILI22XQ.js → chunk-ZZZ4VCY2.js} +10 -10
- package/dist/chunk-ZZZ4VCY2.js.map +1 -0
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-SIYKUU5L.js → classified-marker-WKP33U2R.js} +3 -3
- package/dist/collection-facade-COSGZKLC.js +41 -0
- package/dist/{computed-FAD7SED4.js → computed-WN6V53ZV.js} +3 -3
- package/dist/consent/index.js +8 -8
- package/dist/cover/index.js +8 -8
- package/dist/coverage/index.js +1 -1
- package/dist/custody/index.js +12 -11
- package/dist/{dead-filter-4F3LWYKH.js → dead-filter-43WL3Y5H.js} +10 -10
- package/dist/debug/index.js +7 -7
- package/dist/delegation-5UWT4JGT.js +26 -0
- package/dist/derivations/index.js +24 -23
- package/dist/derive-IL5JNLEE.js +20 -0
- package/dist/directory/index.js +9 -9
- package/dist/{dispatch-JDZNGEB3.js → dispatch-LOQQD5JK.js} +20 -20
- package/dist/{dispatch-H4HV32AM.js → dispatch-SHKTG57L.js} +5 -5
- package/dist/executor-6PQ7WAGV.js +35 -0
- package/dist/executor-6ZPQA6HS.js +8 -0
- package/dist/executor-OXRA64TY.js +8 -0
- package/dist/export-accessible-XG3FKJWW.js +22 -0
- package/dist/extract-partition-33747NY5.js +35 -0
- package/dist/{fanout-sidecar-L7NHPIOC.js → fanout-sidecar-NEB6IYV7.js} +8 -8
- package/dist/find-VW543G3J.js +10 -0
- package/dist/forget/index.js +25 -8
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +15 -13
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +13 -13
- package/dist/index.d.ts +9 -6
- package/dist/index.js +126 -110
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +6 -6
- package/dist/introspection/index.js +15 -11
- package/dist/issue-4ZPSY44M.js +19 -0
- package/dist/kernel/cache/index.d.ts +1 -1
- package/dist/kernel/collection.d.ts +86 -6
- package/dist/kernel/constants.d.ts +7 -0
- package/dist/kernel/errors.d.ts +42 -4
- package/dist/kernel/export-scope.d.ts +40 -0
- package/dist/kernel/merge-authority.d.ts +5 -1
- package/dist/kernel/noydb.d.ts +118 -21
- package/dist/kernel/put-many-atomic.d.ts +1 -1
- package/dist/kernel/query/live/live.d.ts +2 -1
- package/dist/kernel/query/sort-key.d.ts +0 -2
- package/dist/kernel/rejection-seal.d.ts +13 -0
- package/dist/kernel/sync-wiring.d.ts +55 -0
- package/dist/kernel/tx-write-gate.d.ts +2 -4
- package/dist/kernel/types.d.ts +463 -14
- package/dist/kernel/validation.d.ts +0 -10
- package/dist/kernel/vault.d.ts +42 -4
- package/dist/kernel/via/reconcile.d.ts +1 -42
- package/dist/{ledger-5ZMGE44K.js → ledger-MZ25UFT2.js} +10 -10
- package/dist/liberate-OJIP2ZFX.js +25 -0
- package/dist/{link-set-MFXC24VK.js → link-set-4FRRAVTH.js} +10 -10
- package/dist/{managed-secret-MFTFT22X.js → managed-secret-SQWO2EUR.js} +9 -9
- package/dist/materialized-views/index.js +26 -26
- package/dist/{migrate-cek-DZRFFOHW.js → migrate-cek-JWEM4RP6.js} +2 -2
- package/dist/money/index.js +5 -5
- package/dist/noydb-U62OVKXB.js +100 -0
- package/dist/on/index.js +25 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +11 -11
- package/dist/pod/index.js +71 -67
- package/dist/{pod-handle-A3LET7NO.js → pod-handle-R6Y4MILX.js} +8 -8
- package/dist/policy/index.js +9 -9
- package/dist/port/as/active.d.ts +4 -0
- package/dist/port/as/index.d.ts +1 -0
- package/dist/port/by/index.d.ts +14 -5
- package/dist/port/on/index.d.ts +26 -0
- package/dist/port/to/index.d.ts +1 -1
- package/dist/port/with/admission-authority.d.ts +34 -0
- package/dist/port/with/broker-strategy.d.ts +24 -0
- package/dist/port/with/coverage-strategy.d.ts +17 -1
- package/dist/port/with/formats-strategy.d.ts +34 -1
- package/dist/port/with/lookup-strategy.d.ts +85 -4
- package/dist/port/with/rejection-courier.d.ts +37 -0
- package/dist/port/with/restore-host.d.ts +33 -0
- package/dist/port/with/service-bus.d.ts +20 -1
- package/dist/port/with/team-strategy.d.ts +2 -2
- package/dist/port/with/write-hooks.d.ts +2 -0
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-7ND27CF2.js → post-register-GRVQHBOH.js} +6 -6
- package/dist/query/all/index.js +16 -16
- package/dist/query/index.js +8 -8
- package/dist/query/live/index.js +7 -7
- package/dist/query/reduce/index.js +10 -10
- package/dist/query/relate/index.js +10 -10
- package/dist/reduce/index.js +8 -8
- package/dist/register-YJ5YLQ36.js +30 -0
- package/dist/registry-ICOHBQFD.js +8 -0
- package/dist/registry-MJ7MWCSW.js +35 -0
- package/dist/registry-MVEKKGWL.js +23 -0
- package/dist/registry-XP744FAP.js +8 -0
- package/dist/request-withdrawal-LSU4G6W3.js +28 -0
- package/dist/restore-to-DVBHAQAA.js +66 -0
- package/dist/restore-to-DVBHAQAA.js.map +1 -0
- package/dist/{reveal-B2TLP4JQ.js → reveal-AIHOIK2N.js} +7 -7
- package/dist/revoke-QUT7WWG3.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +2 -2
- package/dist/sealed-record/index.js +11 -11
- package/dist/search/index.js +4 -4
- package/dist/{seed-XNSE4U3S.js → seed-GFLA4FCK.js} +136 -27
- package/dist/seed-GFLA4FCK.js.map +1 -0
- package/dist/sequence/index.js +8 -8
- package/dist/session/index.js +8 -8
- package/dist/shadow/index.js +2 -2
- package/dist/signer-NYR4I3FO.js +23 -0
- package/dist/snapshots/index.js +9 -9
- package/dist/{stale-6GCFMOOR.js → stale-PIJPAL5T.js} +9 -9
- package/dist/storage-VH6SPXHC.js +21 -0
- package/dist/{store-coordination-provider-C4BPT5XF.js → store-coordination-provider-2KSHCOPU.js} +9 -9
- package/dist/sync/index.js +19 -13
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +17 -15
- package/dist/tiers/index.js +10 -10
- package/dist/to/index.js +2 -2
- package/dist/transactions/index.js +3 -3
- package/dist/util/index.js +1 -1
- package/dist/vault-head/index.js +8 -8
- package/dist/{verify-UKALW7C2.js → verify-PCFS4PNS.js} +7 -7
- package/dist/via/classified/presets.d.ts +29 -0
- package/dist/via/classified/resolve.d.ts +7 -0
- package/dist/via/geo/binding.d.ts +0 -4
- package/dist/via/lookup/index.d.ts +32 -0
- package/dist/via/money/binding.d.ts +0 -9
- package/dist/walk-OZCN6LJS.js +20 -0
- package/dist/with-audit/attestation/strategy.d.ts +2 -1
- package/dist/with-audit/attestation/vault-facade.d.ts +7 -0
- package/dist/with-audit/forget/completeness.d.ts +66 -0
- package/dist/with-audit/forget/index.d.ts +2 -0
- package/dist/with-audit/forget/strategy.d.ts +65 -0
- package/dist/with-audit/guards/types.d.ts +2 -0
- package/dist/with-audit/periods/periods.d.ts +0 -9
- package/dist/with-audit/periods/reserved-collections.d.ts +7 -0
- package/dist/with-audit/portability/request-withdrawal.d.ts +0 -1
- package/dist/with-audit/portability/withdraw-accessible.d.ts +0 -1
- package/dist/with-audit/tiers/index.d.ts +6 -6
- package/dist/with-audit/tiers/strategy.d.ts +19 -0
- package/dist/with-cargo/extract-partition.d.ts +0 -46
- package/dist/with-commit/history/history.d.ts +16 -0
- package/dist/with-commit/history/restore-to.d.ts +40 -0
- package/dist/with-commit/numbering/index.d.ts +0 -2
- package/dist/with-commit/tx/transaction.d.ts +2 -24
- package/dist/with-commit/vault-head/strategy.d.ts +7 -0
- package/dist/with-fork/snapshots/noydb-facade.d.ts +7 -0
- package/dist/with-formula/derivations/trigger-match.d.ts +8 -5
- package/dist/with-formula/materialized-views/emit-memo.d.ts +0 -2
- package/dist/with-lookup/embeddings/index.d.ts +1 -2
- package/dist/with-lookup/indexing/collection-facade.d.ts +1 -15
- package/dist/with-lookup/indexing/eager-indexes.d.ts +2 -1
- package/dist/with-lookup/search/collection-facade.d.ts +0 -12
- package/dist/with-party/broker/index.d.ts +2 -2
- package/dist/with-party/broker/seed.d.ts +29 -10
- package/dist/with-party/custody/strategy.d.ts +2 -2
- package/dist/with-party/policy/noydb-facade.d.ts +1 -31
- package/dist/with-party/team/delegation.d.ts +93 -7
- package/dist/with-party/team/echo-secret.d.ts +0 -2
- package/dist/with-party/team/index.d.ts +2 -0
- package/dist/with-party/team/keyring.d.ts +133 -24
- package/dist/with-party/team/magic-link-grant.d.ts +11 -1
- package/dist/with-party/team/noydb-facade.d.ts +19 -2
- package/dist/with-party/team/reserved-secret-collections.d.ts +10 -8
- package/dist/with-party/team/roster-tag.d.ts +42 -1
- package/dist/with-party/team/tiers.d.ts +36 -5
- package/dist/with-pod/backup.d.ts +9 -17
- package/dist/with-shape/blobs/blob-set.d.ts +23 -0
- package/dist/with-shape/blobs/legacy-sweep.d.ts +16 -0
- package/dist/with-shape/introspection/describe.d.ts +1 -2
- package/dist/with-shape/introspection/index.d.ts +1 -0
- package/dist/with-shape/introspection/types.d.ts +2 -1
- package/dist/with-shape/schema-update/fence.d.ts +7 -0
- package/dist/with-sync/active.d.ts +28 -1
- package/dist/with-sync/engine.d.ts +88 -2
- package/dist/with-sync/index.d.ts +1 -0
- package/dist/with-sync/reserved-mirror.d.ts +112 -0
- package/dist/with-sync/strategy.d.ts +9 -0
- package/dist/with-sync/tab-write-relay.d.ts +0 -10
- package/dist/withdraw-accessible-MTFP7OIB.js +25 -0
- package/dist/withdraw-accessible-MTFP7OIB.js.map +1 -0
- package/package.json +3 -3
- package/dist/api-OS747DS4.js +0 -18
- package/dist/backup-YE2VQ26S.js.map +0 -1
- package/dist/chunk-2AFX33YA.js.map +0 -1
- package/dist/chunk-2RH777HH.js +0 -126
- package/dist/chunk-2RH777HH.js.map +0 -1
- package/dist/chunk-37EPTBBR.js.map +0 -1
- package/dist/chunk-5KC7QYEC.js.map +0 -1
- package/dist/chunk-7XMHMVTS.js +0 -20
- package/dist/chunk-7XMHMVTS.js.map +0 -1
- package/dist/chunk-A4XMIZT3.js.map +0 -1
- package/dist/chunk-DHHGL42E.js.map +0 -1
- package/dist/chunk-DQESF6RP.js.map +0 -1
- package/dist/chunk-EGVJ7TM4.js.map +0 -1
- package/dist/chunk-EYG2CY2X.js.map +0 -1
- package/dist/chunk-EZGV6F47.js.map +0 -1
- package/dist/chunk-FFWI7UH7.js.map +0 -1
- package/dist/chunk-G2MVBDFP.js.map +0 -1
- package/dist/chunk-GUZET4SG.js.map +0 -1
- package/dist/chunk-GZT3NQRA.js.map +0 -1
- package/dist/chunk-H23XHRTT.js.map +0 -1
- package/dist/chunk-H7JBY4P7.js.map +0 -1
- package/dist/chunk-IMQKWR46.js.map +0 -1
- package/dist/chunk-IUBMZPHM.js.map +0 -1
- package/dist/chunk-IUT3GWP3.js.map +0 -1
- package/dist/chunk-JDEYF3PJ.js.map +0 -1
- package/dist/chunk-JSMTXZR3.js.map +0 -1
- package/dist/chunk-LGNDFRYC.js.map +0 -1
- package/dist/chunk-LNSVGRHO.js.map +0 -1
- package/dist/chunk-MILI22XQ.js.map +0 -1
- package/dist/chunk-MXOQ5JCG.js.map +0 -1
- package/dist/chunk-NBQ3KK6X.js.map +0 -1
- package/dist/chunk-OIEO4WDL.js.map +0 -1
- package/dist/chunk-PD64727P.js.map +0 -1
- package/dist/chunk-RHVMZSUU.js.map +0 -1
- package/dist/chunk-SV2PM2OY.js.map +0 -1
- package/dist/chunk-T7IR4N2S.js.map +0 -1
- package/dist/chunk-UA372JHH.js.map +0 -1
- package/dist/chunk-UBSFPGVJ.js +0 -1
- package/dist/chunk-V3RWOOSO.js.map +0 -1
- package/dist/chunk-VAORSCSU.js.map +0 -1
- package/dist/chunk-XSPFDUDG.js.map +0 -1
- package/dist/chunk-Y3LPTBG7.js.map +0 -1
- package/dist/collection-facade-CS7CA2XO.js +0 -47
- package/dist/delegation-NANZDG4N.js +0 -102
- package/dist/delegation-NANZDG4N.js.map +0 -1
- package/dist/derive-XLOJVXPU.js +0 -20
- package/dist/executor-FMPVN6DT.js +0 -35
- package/dist/executor-LBBBRTN5.js +0 -8
- package/dist/executor-OSRZST2U.js +0 -8
- package/dist/export-accessible-RAOJAAU5.js +0 -22
- package/dist/extract-partition-JD5CUSTG.js +0 -37
- package/dist/find-JRN4RNQ5.js +0 -10
- package/dist/issue-YIVBZUTH.js +0 -19
- package/dist/liberate-WZSZM2W6.js +0 -24
- package/dist/noydb-ITIGNKUF.js +0 -96
- package/dist/register-DT5HZ2LZ.js +0 -30
- package/dist/registry-BHRZGZHF.js +0 -8
- package/dist/registry-ET6ZFFWA.js +0 -34
- package/dist/registry-HXFGLGTG.js +0 -8
- package/dist/registry-THCPDEOD.js +0 -23
- package/dist/request-withdrawal-AV2MJJKY.js +0 -30
- package/dist/revoke-6DWIEOCV.js +0 -24
- package/dist/seed-XNSE4U3S.js.map +0 -1
- package/dist/signer-MHGW3OIL.js +0 -23
- package/dist/storage-BYN5LO6Z.js +0 -21
- package/dist/walk-4VPK7AS4.js +0 -20
- package/dist/withdraw-accessible-HL7GACUE.js +0 -27
- /package/dist/{api-OS747DS4.js.map → api-6EFD43KN.js.map} +0 -0
- /package/dist/{capsule-VOLX3QRQ.js.map → capsule-6LJAVQNM.js.map} +0 -0
- /package/dist/{chunk-OYW3I5M4.js.map → chunk-2DOCDOPL.js.map} +0 -0
- /package/dist/{chunk-UBSFPGVJ.js.map → chunk-2DX4JCRI.js.map} +0 -0
- /package/dist/{chunk-FLPCETP6.js.map → chunk-2LBS62AC.js.map} +0 -0
- /package/dist/{chunk-WXE4W2U6.js.map → chunk-2ST3WA3C.js.map} +0 -0
- /package/dist/{chunk-O2IMQSNA.js.map → chunk-3YBIVLTC.js.map} +0 -0
- /package/dist/{chunk-DIZLQVAA.js.map → chunk-4CHM2TRS.js.map} +0 -0
- /package/dist/{chunk-V7ADQF5O.js.map → chunk-4CUJLEOA.js.map} +0 -0
- /package/dist/{chunk-3EWS67C7.js.map → chunk-4TG2ITRW.js.map} +0 -0
- /package/dist/{chunk-HS554XAF.js.map → chunk-5HQFROZS.js.map} +0 -0
- /package/dist/{chunk-PP3K67AJ.js.map → chunk-654RE5YC.js.map} +0 -0
- /package/dist/{chunk-FOEDQATO.js.map → chunk-66GD7XXU.js.map} +0 -0
- /package/dist/{chunk-BNWA3WG5.js.map → chunk-72FQ46VW.js.map} +0 -0
- /package/dist/{chunk-JQYKPKG6.js.map → chunk-7K42TSCY.js.map} +0 -0
- /package/dist/{chunk-UEFOQH74.js.map → chunk-ADCXTW7L.js.map} +0 -0
- /package/dist/{chunk-MBMTND6D.js.map → chunk-AGGPT4UE.js.map} +0 -0
- /package/dist/{chunk-RB4DOPGZ.js.map → chunk-AKIEBFIJ.js.map} +0 -0
- /package/dist/{chunk-VHBKYN2J.js.map → chunk-B3B6HV5S.js.map} +0 -0
- /package/dist/{chunk-JWWYRR4Q.js.map → chunk-B6EWMGFX.js.map} +0 -0
- /package/dist/{chunk-WPOYWFSE.js.map → chunk-BJRKXNFP.js.map} +0 -0
- /package/dist/{chunk-H427H63K.js.map → chunk-BPQ5CRJF.js.map} +0 -0
- /package/dist/{chunk-VFHCKG5M.js.map → chunk-BVRJYMFZ.js.map} +0 -0
- /package/dist/{chunk-SMV2HRDU.js.map → chunk-DFC4WTJW.js.map} +0 -0
- /package/dist/{chunk-5A4345TG.js.map → chunk-DMIEKD24.js.map} +0 -0
- /package/dist/{chunk-TKVUE4JF.js.map → chunk-DQAXA2GK.js.map} +0 -0
- /package/dist/{chunk-AL6ML4LA.js.map → chunk-DWCFGF2K.js.map} +0 -0
- /package/dist/{chunk-QBLT6POL.js.map → chunk-FPF5HRBE.js.map} +0 -0
- /package/dist/{chunk-5WWDGFOS.js.map → chunk-GIQJGXV7.js.map} +0 -0
- /package/dist/{chunk-BVCUTXE3.js.map → chunk-H334G6KU.js.map} +0 -0
- /package/dist/{chunk-AEQGFRU4.js.map → chunk-HE7EAHGS.js.map} +0 -0
- /package/dist/{chunk-4V3Q35WG.js.map → chunk-ICF3TIGY.js.map} +0 -0
- /package/dist/{chunk-3L2NBKDR.js.map → chunk-IF2M43G4.js.map} +0 -0
- /package/dist/{chunk-AUKKUPVB.js.map → chunk-IVLRPRXM.js.map} +0 -0
- /package/dist/{chunk-Y2RKVFKR.js.map → chunk-K4JSTGXT.js.map} +0 -0
- /package/dist/{chunk-EJLV62NI.js.map → chunk-KN4LUMH6.js.map} +0 -0
- /package/dist/{chunk-23D6M6VM.js.map → chunk-KZA3DITX.js.map} +0 -0
- /package/dist/{chunk-E2N2T5ZO.js.map → chunk-L2VM64HK.js.map} +0 -0
- /package/dist/{chunk-O46CHQT7.js.map → chunk-MAQBYBUX.js.map} +0 -0
- /package/dist/{chunk-EZOAKKTB.js.map → chunk-MBPZMZVB.js.map} +0 -0
- /package/dist/{chunk-XQRFSKYM.js.map → chunk-MCNNZBG7.js.map} +0 -0
- /package/dist/{chunk-YRXFFWG4.js.map → chunk-MLVPMDOZ.js.map} +0 -0
- /package/dist/{chunk-5FE75J4S.js.map → chunk-MMCN7TLK.js.map} +0 -0
- /package/dist/{chunk-SYNY3VB5.js.map → chunk-NCTN2FW4.js.map} +0 -0
- /package/dist/{chunk-4T3SE27M.js.map → chunk-ND6S2DKC.js.map} +0 -0
- /package/dist/{chunk-3XJQBBZD.js.map → chunk-NTVKHQ3L.js.map} +0 -0
- /package/dist/{chunk-Q4UHJ5SN.js.map → chunk-O2VQ3K36.js.map} +0 -0
- /package/dist/{chunk-2GHDLTPE.js.map → chunk-OGKMRIIJ.js.map} +0 -0
- /package/dist/{chunk-N7EVQD5S.js.map → chunk-ONZ3B5EW.js.map} +0 -0
- /package/dist/{chunk-VKI2EB3N.js.map → chunk-OOPSMQX5.js.map} +0 -0
- /package/dist/{chunk-VMV5SBE4.js.map → chunk-OYEBSWLE.js.map} +0 -0
- /package/dist/{chunk-VVOLDVIR.js.map → chunk-PLTIJDQN.js.map} +0 -0
- /package/dist/{chunk-OKSTSITU.js.map → chunk-PR7ILCIH.js.map} +0 -0
- /package/dist/{chunk-7R2Q7CPL.js.map → chunk-QE3TLZ6Z.js.map} +0 -0
- /package/dist/{chunk-6QVKPHBF.js.map → chunk-QHG7GQKM.js.map} +0 -0
- /package/dist/{chunk-LIOVX5TJ.js.map → chunk-QT5ITL25.js.map} +0 -0
- /package/dist/{chunk-Q2XRFWOI.js.map → chunk-RRTQAQ3N.js.map} +0 -0
- /package/dist/{chunk-2PVXF5CS.js.map → chunk-SALY3LIJ.js.map} +0 -0
- /package/dist/{chunk-JOSPH3E5.js.map → chunk-SBAR5JQ6.js.map} +0 -0
- /package/dist/{chunk-N7UDP5VU.js.map → chunk-SCH2F7R2.js.map} +0 -0
- /package/dist/{chunk-MXKI4ABF.js.map → chunk-SOOAW6HK.js.map} +0 -0
- /package/dist/{chunk-TEHHROZL.js.map → chunk-T5EXREMW.js.map} +0 -0
- /package/dist/{chunk-M5B2W6YY.js.map → chunk-TDJVQTXD.js.map} +0 -0
- /package/dist/{chunk-QMWY2FDS.js.map → chunk-THQ3BHLM.js.map} +0 -0
- /package/dist/{chunk-FVH5QYY2.js.map → chunk-TRHUNPXP.js.map} +0 -0
- /package/dist/{chunk-747G6CT3.js.map → chunk-UORWAG7K.js.map} +0 -0
- /package/dist/{chunk-TZZBXPZK.js.map → chunk-VLQ6KT7F.js.map} +0 -0
- /package/dist/{chunk-NCO25JZO.js.map → chunk-VP37VUKQ.js.map} +0 -0
- /package/dist/{chunk-52MGURXO.js.map → chunk-WBUHHMLN.js.map} +0 -0
- /package/dist/{chunk-2MG3SW7Q.js.map → chunk-X6Z2SIRF.js.map} +0 -0
- /package/dist/{chunk-5UMK7GRI.js.map → chunk-XPNJH7GN.js.map} +0 -0
- /package/dist/{chunk-KZXDLBY6.js.map → chunk-XPW7T2GN.js.map} +0 -0
- /package/dist/{chunk-FFJFE4T7.js.map → chunk-YJGKOSQD.js.map} +0 -0
- /package/dist/{chunk-4JPMZTJY.js.map → chunk-ZF7KNSLU.js.map} +0 -0
- /package/dist/{chunk-2ODVB6LZ.js.map → chunk-ZGKODRGB.js.map} +0 -0
- /package/dist/{chunk-JIBUPZHA.js.map → chunk-ZNEKQFGF.js.map} +0 -0
- /package/dist/{chunk-DLD5LGDS.js.map → chunk-ZUTUNVFD.js.map} +0 -0
- /package/dist/{classified-marker-SIYKUU5L.js.map → classified-marker-WKP33U2R.js.map} +0 -0
- /package/dist/{collection-facade-CS7CA2XO.js.map → collection-facade-COSGZKLC.js.map} +0 -0
- /package/dist/{computed-FAD7SED4.js.map → computed-WN6V53ZV.js.map} +0 -0
- /package/dist/{dead-filter-4F3LWYKH.js.map → dead-filter-43WL3Y5H.js.map} +0 -0
- /package/dist/{derive-XLOJVXPU.js.map → delegation-5UWT4JGT.js.map} +0 -0
- /package/dist/{executor-FMPVN6DT.js.map → derive-IL5JNLEE.js.map} +0 -0
- /package/dist/{dispatch-JDZNGEB3.js.map → dispatch-LOQQD5JK.js.map} +0 -0
- /package/dist/{dispatch-H4HV32AM.js.map → dispatch-SHKTG57L.js.map} +0 -0
- /package/dist/{executor-LBBBRTN5.js.map → executor-6PQ7WAGV.js.map} +0 -0
- /package/dist/{executor-OSRZST2U.js.map → executor-6ZPQA6HS.js.map} +0 -0
- /package/dist/{export-accessible-RAOJAAU5.js.map → executor-OXRA64TY.js.map} +0 -0
- /package/dist/{extract-partition-JD5CUSTG.js.map → export-accessible-XG3FKJWW.js.map} +0 -0
- /package/dist/{find-JRN4RNQ5.js.map → extract-partition-33747NY5.js.map} +0 -0
- /package/dist/{fanout-sidecar-L7NHPIOC.js.map → fanout-sidecar-NEB6IYV7.js.map} +0 -0
- /package/dist/{issue-YIVBZUTH.js.map → find-VW543G3J.js.map} +0 -0
- /package/dist/{ledger-5ZMGE44K.js.map → issue-4ZPSY44M.js.map} +0 -0
- /package/dist/{liberate-WZSZM2W6.js.map → ledger-MZ25UFT2.js.map} +0 -0
- /package/dist/{link-set-MFXC24VK.js.map → liberate-OJIP2ZFX.js.map} +0 -0
- /package/dist/{managed-secret-MFTFT22X.js.map → link-set-4FRRAVTH.js.map} +0 -0
- /package/dist/{noydb-ITIGNKUF.js.map → managed-secret-SQWO2EUR.js.map} +0 -0
- /package/dist/{migrate-cek-DZRFFOHW.js.map → migrate-cek-JWEM4RP6.js.map} +0 -0
- /package/dist/{register-DT5HZ2LZ.js.map → noydb-U62OVKXB.js.map} +0 -0
- /package/dist/{pod-handle-A3LET7NO.js.map → pod-handle-R6Y4MILX.js.map} +0 -0
- /package/dist/{post-register-7ND27CF2.js.map → post-register-GRVQHBOH.js.map} +0 -0
- /package/dist/{registry-BHRZGZHF.js.map → register-YJ5YLQ36.js.map} +0 -0
- /package/dist/{registry-ET6ZFFWA.js.map → registry-ICOHBQFD.js.map} +0 -0
- /package/dist/{registry-HXFGLGTG.js.map → registry-MJ7MWCSW.js.map} +0 -0
- /package/dist/{registry-THCPDEOD.js.map → registry-MVEKKGWL.js.map} +0 -0
- /package/dist/{request-withdrawal-AV2MJJKY.js.map → registry-XP744FAP.js.map} +0 -0
- /package/dist/{revoke-6DWIEOCV.js.map → request-withdrawal-LSU4G6W3.js.map} +0 -0
- /package/dist/{reveal-B2TLP4JQ.js.map → reveal-AIHOIK2N.js.map} +0 -0
- /package/dist/{signer-MHGW3OIL.js.map → revoke-QUT7WWG3.js.map} +0 -0
- /package/dist/{stale-6GCFMOOR.js.map → signer-NYR4I3FO.js.map} +0 -0
- /package/dist/{storage-BYN5LO6Z.js.map → stale-PIJPAL5T.js.map} +0 -0
- /package/dist/{walk-4VPK7AS4.js.map → storage-VH6SPXHC.js.map} +0 -0
- /package/dist/{store-coordination-provider-C4BPT5XF.js.map → store-coordination-provider-2KSHCOPU.js.map} +0 -0
- /package/dist/{verify-UKALW7C2.js.map → verify-PCFS4PNS.js.map} +0 -0
- /package/dist/{withdraw-accessible-HL7GACUE.js.map → walk-OZCN6LJS.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/kernel/sync-policy.ts","../src/with-sync/strategy.ts","../src/kernel/rejection-seal.ts"],"sourcesContent":["/**\n * Sync scheduling policy.\n *\n * ## What it controls\n *\n * A {@link SyncPolicy} has two halves:\n * - **push** ({@link PushPolicy}) — when dirty local writes are sent to the remote.\n * - **pull** ({@link PullPolicy}) — when the remote is polled for new data.\n *\n * ## Choosing a policy\n *\n * The right policy depends on the backend's operational characteristics:\n *\n * | Backend type | Recommended policy |\n * |---|---|\n * | Per-record (DynamoDB, S3, IDB) | {@link INDEXED_STORE_POLICY} — `on-change` push, `manual` pull |\n * | Bundle (Drive, WebDAV, Git) | {@link POD_STORE_POLICY} — `debounce` push, `interval` pull |\n *\n * Consumers can override via `createNoydb({ syncPolicy: { ... } })`:\n *\n * ```ts\n * const db = await createNoydb({\n * store: toFile({ dir: './data' }),\n * syncPolicy: {\n * push: { mode: 'debounce', debounceMs: 5_000 },\n * pull: { mode: 'on-focus' },\n * },\n * })\n * ```\n *\n * ## Scheduler lifecycle\n *\n * {@link SyncScheduler} owns all timers, debounce logic, and browser lifecycle\n * hooks (`visibilitychange`, `pagehide`, `beforeExit`). Call `scheduler.start()`\n * after opening a vault and `scheduler.stop()` when closing it. The scheduler\n * delegates actual push/pull work to {@link SyncSchedulerCallbacks} provided\n * by the {@link SyncEngine}.\n *\n * @module\n */\n\n// ─── Policy types ───────────────────────────────────────────────────────\n\n/**\n * When push operations are triggered automatically.\n *\n * - `'manual'` — only on explicit `sync.push()` calls.\n * - `'on-change'` — immediately after every local write (respecting `minIntervalMs`).\n * - `'debounce'` — after `debounceMs` of inactivity following a write.\n * - `'interval'` — on a fixed timer regardless of writes.\n */\nexport type PushMode = 'manual' | 'on-change' | 'debounce' | 'interval'\n\n/**\n * When pull operations are triggered automatically.\n *\n * - `'manual'` — only on explicit `sync.pull()` calls.\n * - `'interval'` — on a fixed `intervalMs` timer.\n * - `'on-focus'` — when the browser tab regains visibility.\n * - `'phased'` — pull the collections named in `sequence`, in order, one at a\n * time, then settle into steady state. For thin clients that need their\n * navigation-critical collections before bulk history.\n */\nexport type PullMode = 'manual' | 'interval' | 'on-focus' | 'phased'\n\n/**\n * Push half of a sync policy. Controls the trigger mode and timing guards\n * for outbound sync operations.\n */\nexport interface PushPolicy {\n /** Push trigger mode. */\n readonly mode: PushMode\n /** Debounce delay in ms. Only used when `mode: 'debounce'`. Default: 30_000. */\n readonly debounceMs?: number\n /** Interval in ms between automatic pushes. Used by `'interval'` and as floor for `'debounce'`. */\n readonly intervalMs?: number\n /**\n * Hard floor between pushes regardless of mode. Prevents burst writes\n * from hammering the remote. Default: 0 (no floor).\n */\n readonly minIntervalMs?: number\n /**\n * Force a push on page unload (`pagehide` / `visibilitychange → hidden`)\n * in browsers, `beforeExit` in Node. Default: true for non-manual modes.\n */\n readonly onUnload?: boolean\n}\n\n/**\n * Pull half of a sync policy. Controls when and how often inbound sync\n * operations are triggered.\n */\nexport interface PullPolicy {\n /** Pull trigger mode. */\n readonly mode: PullMode\n /**\n * Interval in ms between automatic pulls. Used by `'interval'` mode. Default: 60_000.\n * Under `'phased'` it is the steady-state cadence adopted *after* the sequence\n * completes; omit it to go idle instead.\n */\n readonly intervalMs?: number\n /**\n * Collection names to pull in order, one at a time. Required when\n * `mode: 'phased'` and rejected otherwise. Entries must be non-empty and\n * unique — without period narrowing a repeated collection can only be a\n * mistake, so it is rejected rather than silently merged.\n *\n * Period-scoped phases (`collection@period`) are deferred to `partitions`;\n * use `db.pull(vault, { periods })` explicitly meanwhile.\n */\n readonly sequence?: readonly string[]\n}\n\n/**\n * Combined push + pull sync scheduling policy for a vault.\n *\n * Pass via `createNoydb({ syncPolicy })` to override the default policy\n * derived from the active store type. Pre-built defaults are available\n * as `INDEXED_STORE_POLICY` and `POD_STORE_POLICY`.\n */\nexport interface SyncPolicy {\n readonly push: PushPolicy\n readonly pull: PullPolicy\n}\n\n// ─── Default policies by store category ─────────────────────────────────\n\n/** Default for per-record stores (DynamoDB, S3, file, IDB). */\nexport const INDEXED_STORE_POLICY: SyncPolicy = {\n push: { mode: 'on-change', minIntervalMs: 0, onUnload: true },\n pull: { mode: 'manual' },\n}\n\n/** Default for bundle stores (Drive, WebDAV, Git). */\nexport const POD_STORE_POLICY: SyncPolicy = {\n push: { mode: 'debounce', debounceMs: 30_000, minIntervalMs: 120_000, onUnload: true },\n pull: { mode: 'interval', intervalMs: 60_000 },\n}\n\n\n// ─── Sync scheduler ─────────────────────────────────────────────────────\n\n/**\n * Current operational state of the `SyncScheduler`.\n *\n * - `'idle'` — no pending or active sync operations.\n * - `'pending'` — local writes are queued, waiting for debounce/interval to fire.\n * - `'pushing'` — push in progress.\n * - `'pulling'` — pull in progress.\n * - `'error'` — last sync operation failed; `lastError` holds the cause.\n */\nexport type SyncSchedulerState = 'idle' | 'pending' | 'pushing' | 'pulling' | 'error'\n\n/**\n * How much of a collection a caller may rely on, under a `'phased'` pull.\n *\n * - `'cold'` — not pulled yet, or its phase did not complete cleanly. A miss\n * from `get()` proves nothing.\n * - `'pulling'` — its phase is in flight. Never terminal: a phase always ends\n * in `'live'` or back in `'cold'`, because a stuck `'pulling'` would leave a\n * permanent skeleton in the UI.\n * - `'live'` — its phase completed cleanly, so a miss is a real absence.\n */\nexport type ReadinessState = 'cold' | 'pulling' | 'live'\n\n/**\n * What a scheduler-initiated pull achieved, as reported by the callback.\n *\n * `'incomplete'` covers both a pull that reported errors (`PullResult.errors`\n * accumulates without throwing) and one that was skipped — e.g. role-gated on a\n * backup target. Either way nothing may be claimed about completeness.\n */\nexport type PullPhaseOutcome = 'complete' | 'incomplete'\n\n/**\n * Snapshot of the sync scheduler's state, returned by `SyncScheduler.status`.\n * Safe to expose in a reactive UI status indicator.\n */\nexport interface SyncSchedulerStatus {\n readonly state: SyncSchedulerState\n readonly lastPushAt: string | null\n readonly lastPullAt: string | null\n readonly lastError: Error | null\n readonly pendingWrites: number\n /**\n * Per-collection readiness. Empty unless `pull.mode === 'phased'`.\n *\n * A collection the sequence never names is **absent** from the map, and\n * `undefined` means *\"no claim made\"* — never a reason to gate a UI.\n */\n readonly readiness: ReadonlyMap<string, ReadinessState>\n /** 1-based position in the sequence, or `null` outside a phased run. */\n readonly phase: { readonly index: number; readonly total: number } | null\n}\n\n/**\n * Callbacks injected into `SyncScheduler` by the SyncEngine.\n *\n * The scheduler owns timers and lifecycle hooks; it delegates actual push/pull\n * work to these callbacks to stay decoupled from the sync implementation.\n */\nexport interface SyncSchedulerCallbacks {\n push(): Promise<void>\n /**\n * @param collections - Narrow the pull to these collections. Passed by a\n * `'phased'` sequence, one collection per phase; omitted for a whole-vault pull.\n * @returns Whether the pull may be treated as complete. Returning `void` reads\n * as `'complete'`, so callers with nothing to report need not opt in.\n */\n pull(collections?: readonly string[]): Promise<PullPhaseOutcome | void>\n getDirtyCount(): number\n}\n\n/**\n * Reject a policy that cannot mean anything, at construction rather than on\n * the first tick. Module-private: `SyncScheduler` is the choke point every\n * policy that can actually schedule must pass through — primary and per-target\n * alike — so validating here needs no new public surface and costs the kernel\n * floor nothing.\n */\nfunction validatePullPolicy(pull: PullPolicy): void {\n if (pull.mode !== 'phased') {\n if (pull.sequence !== undefined) {\n throw new Error(\n `syncPolicy.pull.sequence is only meaningful with mode: 'phased' (got '${pull.mode}'). ` +\n `Set mode: 'phased' to run the sequence, or drop the field.`,\n )\n }\n return\n }\n\n const { sequence } = pull\n if (!sequence || sequence.length === 0) {\n throw new Error(\n `syncPolicy.pull.mode: 'phased' requires a non-empty 'sequence' of collection names.`,\n )\n }\n for (const name of sequence) {\n if (typeof name !== 'string' || name.length === 0) {\n throw new Error(\n `syncPolicy.pull.sequence entries must be non-empty collection names (got ${JSON.stringify(name)}).`,\n )\n }\n }\n const duplicate = sequence.find((name, i) => sequence.indexOf(name) !== i)\n if (duplicate !== undefined) {\n throw new Error(\n `syncPolicy.pull.sequence lists \"${duplicate}\" more than once. ` +\n `Each collection is pulled whole, so a repeat does no additional work.`,\n )\n }\n}\n\n/**\n * Manages sync timing according to a `SyncPolicy`.\n *\n * The scheduler owns all timers and lifecycle hooks. It delegates actual\n * push/pull work to callbacks provided by the SyncEngine.\n */\nexport class SyncScheduler {\n private readonly policy: SyncPolicy\n private readonly callbacks: SyncSchedulerCallbacks\n\n private _state: SyncSchedulerState = 'idle'\n private _lastPushAt: string | null = null\n private _lastPullAt: string | null = null\n private _lastError: Error | null = null\n private _lastPushTime = 0 // monotonic ms for minIntervalMs enforcement\n\n // Phased-pull progress. Empty for every other mode, so non-adopters carry\n // an empty Map and a null — no per-read cost, nothing to interpret.\n private readonly _readiness = new Map<string, ReadinessState>()\n private _phase: { readonly index: number; readonly total: number } | null = null\n\n // Timers\n private debounceTimer: ReturnType<typeof setTimeout> | null = null\n private pushIntervalTimer: ReturnType<typeof setInterval> | null = null\n private pullIntervalTimer: ReturnType<typeof setInterval> | null = null\n\n // Bound handlers for cleanup\n private readonly boundOnVisibilityChange: (() => void) | null = null\n private readonly boundOnBeforeExit: (() => void) | null = null\n private readonly boundOnPageHide: (() => void) | null = null\n\n private started = false\n\n constructor(policy: SyncPolicy, callbacks: SyncSchedulerCallbacks) {\n validatePullPolicy(policy.pull)\n this.policy = policy\n this.callbacks = callbacks\n\n // Pre-bind handlers\n if (this.shouldRegisterUnload()) {\n this.boundOnVisibilityChange = this.handleVisibilityChange.bind(this)\n this.boundOnPageHide = this.handlePageHide.bind(this)\n this.boundOnBeforeExit = this.handleBeforeExit.bind(this)\n }\n }\n\n /** Current scheduler status snapshot. */\n get status(): SyncSchedulerStatus {\n return {\n state: this._state,\n lastPushAt: this._lastPushAt,\n lastPullAt: this._lastPullAt,\n lastError: this._lastError,\n pendingWrites: this.callbacks.getDirtyCount(),\n // Copied, not aliased — a status snapshot must not mutate under its reader.\n readiness: new Map(this._readiness),\n phase: this._phase,\n }\n }\n\n /** Start the scheduler — registers timers, event listeners. */\n start(): void {\n if (this.started) return\n this.started = true\n\n // Push: interval mode\n if (this.policy.push.mode === 'interval' && this.policy.push.intervalMs) {\n this.pushIntervalTimer = setInterval(() => {\n void this.executePush()\n }, this.policy.push.intervalMs)\n }\n\n // Pull: interval mode\n if (this.policy.pull.mode === 'interval') {\n this.startPullInterval()\n }\n\n // Pull: phased mode — walk the sequence in order, then settle into steady\n // state. Unawaited by design: start() is synchronous and the caller\n // (vault open) must not block on a bootstrap pull.\n if (this.policy.pull.mode === 'phased') {\n const sequence = this.policy.pull.sequence ?? []\n // Every named collection is 'cold' from the moment we start, so a reader\n // that races the first phase sees \"not ready\", never a missing entry.\n for (const collection of sequence) this._readiness.set(collection, 'cold')\n void this.runSequence(sequence)\n }\n\n // Pull: on-focus mode\n if (this.policy.pull.mode === 'on-focus' && typeof document !== 'undefined') {\n document.addEventListener('visibilitychange', this.handleFocusPull)\n }\n\n // Unload hooks\n if (this.shouldRegisterUnload()) {\n if (typeof document !== 'undefined' && this.boundOnVisibilityChange) {\n document.addEventListener('visibilitychange', this.boundOnVisibilityChange)\n }\n if (typeof globalThis.addEventListener === 'function' && this.boundOnPageHide) {\n globalThis.addEventListener('pagehide', this.boundOnPageHide)\n }\n if (typeof process !== 'undefined' && this.boundOnBeforeExit) {\n process.on('beforeExit', this.boundOnBeforeExit)\n }\n }\n }\n\n /** Stop the scheduler — clears timers, removes event listeners. */\n stop(): void {\n if (!this.started) return\n this.started = false\n\n // A sequence cut mid-phase must not leave that collection 'pulling' —\n // a reader would show a skeleton that never resolves.\n for (const [collection, state] of this._readiness) {\n if (state === 'pulling') this._readiness.set(collection, 'cold')\n }\n this._phase = null\n\n if (this.debounceTimer) {\n clearTimeout(this.debounceTimer)\n this.debounceTimer = null\n }\n if (this.pushIntervalTimer) {\n clearInterval(this.pushIntervalTimer)\n this.pushIntervalTimer = null\n }\n if (this.pullIntervalTimer) {\n clearInterval(this.pullIntervalTimer)\n this.pullIntervalTimer = null\n }\n\n // Focus pull\n if (this.policy.pull.mode === 'on-focus' && typeof document !== 'undefined') {\n document.removeEventListener('visibilitychange', this.handleFocusPull)\n }\n\n // Unload hooks\n if (typeof document !== 'undefined' && this.boundOnVisibilityChange) {\n document.removeEventListener('visibilitychange', this.boundOnVisibilityChange)\n }\n if (typeof globalThis.removeEventListener === 'function' && this.boundOnPageHide) {\n globalThis.removeEventListener('pagehide', this.boundOnPageHide)\n }\n if (typeof process !== 'undefined' && this.boundOnBeforeExit) {\n process.removeListener('beforeExit', this.boundOnBeforeExit)\n }\n }\n\n /**\n * Notify the scheduler that a local write occurred.\n * For `on-change` mode: triggers immediate push (respecting minIntervalMs).\n * For `debounce` mode: resets the debounce timer.\n * For `manual` / `interval`: no-op.\n */\n notifyChange(): void {\n if (!this.started) return\n\n if (this.policy.push.mode === 'on-change') {\n void this.executePush()\n } else if (this.policy.push.mode === 'debounce') {\n this.resetDebounce()\n }\n }\n\n /** Force an immediate push, bypassing the scheduler. */\n async forcePush(): Promise<void> {\n await this.executePush()\n }\n\n /** Force an immediate pull, bypassing the scheduler. */\n async forcePull(): Promise<void> {\n await this.executePull()\n }\n\n // ─── Internal ─────────────────────────────────────────────────────\n\n /**\n * Arm the steady-state pull timer, if the policy specifies a cadence.\n * Shared by `'interval'` mode and by `'phased'` once its sequence drains.\n */\n private startPullInterval(): void {\n if (this.pullIntervalTimer || !this.policy.pull.intervalMs) return\n this.pullIntervalTimer = setInterval(() => {\n void this.executePull()\n }, this.policy.pull.intervalMs)\n }\n\n /**\n * Pull each collection in turn, then hand over to steady state.\n *\n * Strictly sequential — running phases concurrently would defeat the\n * prioritisation that is the entire point of a sequence. Each phase is an\n * ordinary scoped pull, so a phase that reports errors does not abort the\n * ones behind it; `executePull` records the failure and the walk continues.\n * `started` is re-checked between phases so `stop()` cuts a sequence short\n * instead of letting it run on against a closed vault.\n */\n private async runSequence(sequence: readonly string[]): Promise<void> {\n for (const [i, collection] of sequence.entries()) {\n if (!this.started) return\n this._readiness.set(collection, 'pulling')\n this._phase = { index: i + 1, total: sequence.length }\n\n const outcome = await this.executePull([collection])\n\n // 'live' only on a clean phase. Anything else — reported errors, a\n // role-gated skip, a throw — goes back to 'cold', because 'live' is a\n // promise that a miss from get() is a real absence.\n this._readiness.set(collection, outcome === 'complete' ? 'live' : 'cold')\n }\n this._phase = null\n if (this.started) this.startPullInterval()\n }\n\n private async executePush(): Promise<void> {\n if (this._state === 'pushing') return // already in progress\n\n // minIntervalMs enforcement\n const minInterval = this.policy.push.minIntervalMs ?? 0\n if (minInterval > 0) {\n const elapsed = Date.now() - this._lastPushTime\n if (elapsed < minInterval) {\n // Schedule for later if debounce mode\n if (this.policy.push.mode === 'debounce') {\n this.scheduleDebounce(minInterval - elapsed)\n }\n return\n }\n }\n\n // Nothing to push\n if (this.callbacks.getDirtyCount() === 0) {\n this._state = 'idle'\n return\n }\n\n this._state = 'pushing'\n try {\n await this.callbacks.push()\n this._lastPushAt = new Date().toISOString()\n this._lastPushTime = Date.now()\n this._lastError = null\n this._state = this.callbacks.getDirtyCount() > 0 ? 'pending' : 'idle'\n } catch (err) {\n this._lastError = err instanceof Error ? err : new Error(String(err))\n this._state = 'error'\n }\n }\n\n private async executePull(collections?: readonly string[]): Promise<PullPhaseOutcome> {\n if (this._state === 'pulling') return 'incomplete'\n\n const previousState = this._state\n this._state = 'pulling'\n try {\n const outcome = await this.callbacks.pull(collections)\n this._lastPullAt = new Date().toISOString()\n this._lastError = null\n this._state = previousState === 'pending' ? 'pending' : 'idle'\n return outcome ?? 'complete'\n } catch (err) {\n this._lastError = err instanceof Error ? err : new Error(String(err))\n this._state = 'error'\n return 'incomplete'\n }\n }\n\n private resetDebounce(): void {\n if (this.debounceTimer) clearTimeout(this.debounceTimer)\n const ms = this.policy.push.debounceMs ?? 30_000\n this._state = 'pending'\n this.scheduleDebounce(ms)\n }\n\n private scheduleDebounce(ms: number): void {\n if (this.debounceTimer) clearTimeout(this.debounceTimer)\n this.debounceTimer = setTimeout(() => {\n this.debounceTimer = null\n void this.executePush()\n }, ms)\n }\n\n private shouldRegisterUnload(): boolean {\n const onUnload = this.policy.push.onUnload\n if (onUnload !== undefined) return onUnload\n return this.policy.push.mode !== 'manual'\n }\n\n // ─── Event handlers ───────────────────────────────────────────────\n\n private handleVisibilityChange(): void {\n if (typeof document !== 'undefined' && document.visibilityState === 'hidden') {\n this.fireUnloadPush()\n }\n }\n\n private handlePageHide(): void {\n this.fireUnloadPush()\n }\n\n private handleBeforeExit(): void {\n this.fireUnloadPush()\n }\n\n private handleFocusPull = (): void => {\n if (typeof document !== 'undefined' && document.visibilityState === 'visible') {\n void this.executePull()\n }\n }\n\n private fireUnloadPush(): void {\n if (this.callbacks.getDirtyCount() === 0) return\n // Best-effort synchronous-ish push on unload\n void this.callbacks.push().catch(() => {})\n }\n}\n","/**\n * Strategy seam for the optional sync engine + presence service.\n * Core imports `SyncStrategy` type-only + `NO_SYNC` stub; the real\n * `SyncEngine`, `SyncTransaction`, and `PresenceHandle` constructors\n * are only reachable via `withSync()` in `./sync-active.ts`.\n *\n * Solo apps that never configure `sync` and never call\n * `collection.presence()` ship none of the ~856 LOC behind this seam\n * (`sync.ts` + `sync-transaction.ts` + `presence.ts`).\n *\n * Note: `keyring.ts` (~746 LOC) stays in core because it's required\n * for any multi-user vault — even single-owner vaults use a keyring\n * to wrap the DEK. The team package's grant/revoke/magic-link/\n * delegation modules tree-shake naturally via direct named imports.\n *\n * Behavior under NO_SYNC:\n *\n * - **buildSyncEngine** — throws. Only fires when `createNoydb({ sync })`\n * passes a remote target.\n * - **buildSyncTransaction** — throws. Only fires when `db.transaction(vault)`\n * is called on a vault with sync configured.\n * - **buildPresence** — throws. Only fires when user code calls\n * `collection.presence()`.\n *\n * @internal\n */\n\nimport type {\n NoydbStore,\n ConflictStrategy,\n SyncTargetRole,\n} from '../kernel/types.js'\nimport type { MergeAuthority } from '../port/with/merge-authority.js'\nimport type { NoydbEventEmitter } from '../kernel/events.js'\nimport type { SyncPolicy } from '../kernel/sync-policy.js'\nimport type { SyncEngine } from './engine.js'\nimport type { SyncTransaction } from './transaction.js'\nimport type { PresenceHandle, PresenceHandleOpts } from './presence.js'\nimport type { Vault } from '../kernel/vault.js'\n\n/**\n * Options accepted by `SyncStrategy.buildSyncEngine`. Mirrors the\n * `SyncEngine` constructor verbatim — kept here so core code never\n * imports the sync module at runtime.\n *\n * @internal\n */\nexport interface BuildSyncEngineOptions {\n local: NoydbStore\n remote: NoydbStore\n vault: string\n strategy: ConflictStrategy\n emitter: NoydbEventEmitter\n syncPolicy?: SyncPolicy\n role?: SyncTargetRole\n label?: string\n /** #1042 — the merge's verify/re-stamp capability, bound to the keys by the caller. */\n mergeAuthority?: MergeAuthority\n /** core#107 — this device is the vault's arbiter: its admission refusals replicate. */\n arbiter?: boolean\n}\n\n/**\n * @internal\n */\nexport interface SyncStrategy {\n buildSyncEngine(opts: BuildSyncEngineOptions): SyncEngine\n /**\n * core#75 — open-path roster bootstrap: an EMPTY local store is not a new\n * vault when a `sync-peer` already carries the roster. Runs inside keyring\n * resolution, BEFORE any engine exists; the un-opted-in stub is a no-op\n * (no sync ⇒ no target to bootstrap from).\n */\n bootstrapKeyrings(local: NoydbStore, peer: NoydbStore | undefined, vault: string): Promise<void>\n buildSyncTransaction(vault: Vault, engine: SyncEngine): SyncTransaction\n buildPresence<P>(opts: PresenceHandleOpts): PresenceHandle<P>\n}\n\nfunction notEnabled(op: string): Error {\n return new Error(\n `${op} requires the sync strategy. Import ` +\n '`{ withSync }` from \"@noy-db/hub/sync\" and pass it to ' +\n '`createNoydb({ syncStrategy: withSync() })`.',\n )\n}\n\n/**\n * No-sync stub. Every constructor throws with an actionable pointer\n * — there is no useful \"off\" mode for sync engine / presence /\n * sync-transaction; if the consumer reached one of these surfaces,\n * they intended to use it.\n *\n * @internal\n */\nexport const NO_SYNC: SyncStrategy = {\n buildSyncEngine() { throw notEnabled('SyncEngine') },\n async bootstrapKeyrings() { /* no sync ⇒ nothing to bootstrap from */ },\n buildSyncTransaction() { throw notEnabled('SyncTransaction') },\n buildPresence() { throw notEnabled('collection.presence()') },\n}\n","/**\n * core#107 — sealing and opening a replicated admission refusal.\n *\n * Lives outside `vault.ts` for the reason the kernel-surface ceiling exists:\n * the vault owns the KEY LOOKUP and stays a thin caller, the crypto lives\n * here. Shape follows `team/delegation.ts`'s token seal exactly — an AAD-bound\n * record envelope under a DEK the recipient already holds.\n *\n * The DEK is the refused record's OWN collection DEK; `port/with/rejection-courier.ts`\n * carries why, and why core#107's proposed `_sync` DEK does not exist.\n */\nimport { buildRecordAad, buildRecordEnvelope, encrypt, openEnvelopeJson } from '../capsule/index.js'\nimport type { EnclaveKey } from '../capsule/index.js'\nimport type { EncryptedEnvelope, SyncRejection } from './types.js'\n\n/** core#107 — where replicated refusals live. Reserved, declared in `reserved-mirror.ts`. */\nexport const REJECTIONS_COLLECTION = '_sync_rejections'\n\n/** `<collection>::<id>` — one live refusal per record, newer `_v` supersedes. */\nexport const rejectionKey = (collection: string, id: string): string => `${collection}::${id}`\n\nexport async function sealRejection(\n collection: string,\n id: string,\n rejection: SyncRejection,\n dek: EnclaveKey,\n version: number,\n): Promise<EncryptedEnvelope> {\n const key = rejectionKey(collection, id)\n const identity = { collection: REJECTIONS_COLLECTION, id: key, by: rejection.by, version }\n const { iv, data } = await encrypt(JSON.stringify(rejection), dek, buildRecordAad(identity))\n return buildRecordEnvelope(identity, { ts: rejection.at, iv, data })\n}\n\n/**\n * `null` when this device cannot open it. Never throws: a member who does not\n * hold the collection's DEK receives the envelope like everybody else (the\n * mirror is DEK-free and copies it unconditionally) and must skip it quietly.\n */\nexport async function openRejection(\n collection: string,\n id: string,\n envelope: EncryptedEnvelope,\n dek: EnclaveKey,\n): Promise<SyncRejection | null> {\n try {\n // `openEnvelopeJson` returns the decrypted STRING; the parse is ours.\n const plaintext = await openEnvelopeJson(\n { collection: REJECTIONS_COLLECTION, id: rejectionKey(collection, id) }, envelope, dek,\n )\n return JSON.parse(plaintext) as SyncRejection\n } catch {\n return null\n }\n}\n"],"mappings":";;;;;;;;AAgIO,IAAM,uBAAmC;AAAA,EAC9C,MAAM,EAAE,MAAM,aAAa,eAAe,GAAG,UAAU,KAAK;AAAA,EAC5D,MAAM,EAAE,MAAM,SAAS;AACzB;AAGO,IAAM,mBAA+B;AAAA,EAC1C,MAAM,EAAE,MAAM,YAAY,YAAY,KAAQ,eAAe,MAAS,UAAU,KAAK;AAAA,EACrF,MAAM,EAAE,MAAM,YAAY,YAAY,IAAO;AAC/C;AAmFA,SAAS,mBAAmB,MAAwB;AAClD,MAAI,KAAK,SAAS,UAAU;AAC1B,QAAI,KAAK,aAAa,QAAW;AAC/B,YAAM,IAAI;AAAA,QACR,yEAAyE,KAAK,IAAI;AAAA,MAEpF;AAAA,IACF;AACA;AAAA,EACF;AAEA,QAAM,EAAE,SAAS,IAAI;AACrB,MAAI,CAAC,YAAY,SAAS,WAAW,GAAG;AACtC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,aAAW,QAAQ,UAAU;AAC3B,QAAI,OAAO,SAAS,YAAY,KAAK,WAAW,GAAG;AACjD,YAAM,IAAI;AAAA,QACR,4EAA4E,KAAK,UAAU,IAAI,CAAC;AAAA,MAClG;AAAA,IACF;AAAA,EACF;AACA,QAAM,YAAY,SAAS,KAAK,CAAC,MAAM,MAAM,SAAS,QAAQ,IAAI,MAAM,CAAC;AACzE,MAAI,cAAc,QAAW;AAC3B,UAAM,IAAI;AAAA,MACR,mCAAmC,SAAS;AAAA,IAE9C;AAAA,EACF;AACF;AAQO,IAAM,gBAAN,MAAoB;AAAA,EACR;AAAA,EACA;AAAA,EAET,SAA6B;AAAA,EAC7B,cAA6B;AAAA,EAC7B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iBAAiB;AAAA,EAAE;AAAA,EAC7D,gBAAgB;AAAE,UAAM,WAAW,uBAAuB;AAAA,EAAE;AAC9D;;;ACnFO,IAAM,wBAAwB;AAG9B,IAAM,eAAe,CAAC,YAAoB,OAAuB,GAAG,UAAU,KAAK,EAAE;AAE5F,eAAsB,cACpB,YACA,IACA,WACA,KACA,SAC4B;AAC5B,QAAM,MAAM,aAAa,YAAY,EAAE;AACvC,QAAM,WAAW,EAAE,YAAY,uBAAuB,IAAI,KAAK,IAAI,UAAU,IAAI,QAAQ;AACzF,QAAM,EAAE,IAAI,KAAK,IAAI,MAAM,QAAQ,KAAK,UAAU,SAAS,GAAG,KAAK,eAAe,QAAQ,CAAC;AAC3F,SAAO,oBAAoB,UAAU,EAAE,IAAI,UAAU,IAAI,IAAI,KAAK,CAAC;AACrE;AAOA,eAAsB,cACpB,YACA,IACA,UACA,KAC+B;AAC/B,MAAI;AAEF,UAAM,YAAY,MAAM;AAAA,MACtB,EAAE,YAAY,uBAAuB,IAAI,aAAa,YAAY,EAAE,EAAE;AAAA,MAAG;AAAA,MAAU;AAAA,IACrF;AACA,WAAO,KAAK,MAAM,SAAS;AAAA,EAC7B,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SealedRecordNotEnabledError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IKPQ2GGB.js";
|
|
4
4
|
|
|
5
5
|
// src/with-audit/sealed-record/strategy.ts
|
|
6
6
|
var NO_SEALED_RECORD = {
|
|
@@ -18,4 +18,4 @@ var NO_SEALED_RECORD = {
|
|
|
18
18
|
export {
|
|
19
19
|
NO_SEALED_RECORD
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-ADCXTW7L.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-SUZKW6UR.js";
|
|
4
4
|
import {
|
|
5
5
|
readPath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GIQJGXV7.js";
|
|
7
7
|
|
|
8
8
|
// src/with-lookup/reduce/reducers.ts
|
|
9
9
|
function count(opts) {
|
|
@@ -453,4 +453,4 @@ export {
|
|
|
453
453
|
moneyPercentile,
|
|
454
454
|
reducerBuilder
|
|
455
455
|
};
|
|
456
|
-
//# sourceMappingURL=chunk-
|
|
456
|
+
//# sourceMappingURL=chunk-AGGPT4UE.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAtPath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PR7ILCIH.js";
|
|
4
4
|
import {
|
|
5
5
|
SearchNotEnabledError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IKPQ2GGB.js";
|
|
7
7
|
|
|
8
8
|
// src/with-lookup/search/tokenize.ts
|
|
9
9
|
var WORD = /[\p{L}\p{N}]+/gu;
|
|
@@ -421,31 +421,31 @@ function buildBlobFieldEntries(filenamesByField) {
|
|
|
421
421
|
function withSearch() {
|
|
422
422
|
return {
|
|
423
423
|
async search(ctx, field, query, opts) {
|
|
424
|
-
const { search } = await import("./collection-facade-
|
|
424
|
+
const { search } = await import("./collection-facade-COSGZKLC.js");
|
|
425
425
|
return search(ctx, field, query, opts);
|
|
426
426
|
},
|
|
427
427
|
async retrieve(ctx, query, opts) {
|
|
428
|
-
const { retrieve } = await import("./collection-facade-
|
|
428
|
+
const { retrieve } = await import("./collection-facade-COSGZKLC.js");
|
|
429
429
|
return retrieve(ctx, query, opts);
|
|
430
430
|
},
|
|
431
431
|
async similarTo(ctx, vector, opts) {
|
|
432
|
-
const { similarTo } = await import("./collection-facade-
|
|
432
|
+
const { similarTo } = await import("./collection-facade-COSGZKLC.js");
|
|
433
433
|
return similarTo(ctx, vector, opts);
|
|
434
434
|
},
|
|
435
435
|
async warmIndex(ctx) {
|
|
436
|
-
const { warmIndex } = await import("./collection-facade-
|
|
436
|
+
const { warmIndex } = await import("./collection-facade-COSGZKLC.js");
|
|
437
437
|
return warmIndex(ctx);
|
|
438
438
|
},
|
|
439
439
|
async flushIndex(ctx) {
|
|
440
|
-
const { flushIndex } = await import("./collection-facade-
|
|
440
|
+
const { flushIndex } = await import("./collection-facade-COSGZKLC.js");
|
|
441
441
|
return flushIndex(ctx);
|
|
442
442
|
},
|
|
443
443
|
async embedOnWrite(ctx, id, record, version) {
|
|
444
|
-
const { embedOnWrite } = await import("./collection-facade-
|
|
444
|
+
const { embedOnWrite } = await import("./collection-facade-COSGZKLC.js");
|
|
445
445
|
return embedOnWrite(ctx, id, record, version);
|
|
446
446
|
},
|
|
447
447
|
async rebuildEmbeddings(ctx) {
|
|
448
|
-
const { rebuildEmbeddings } = await import("./collection-facade-
|
|
448
|
+
const { rebuildEmbeddings } = await import("./collection-facade-COSGZKLC.js");
|
|
449
449
|
return rebuildEmbeddings(ctx);
|
|
450
450
|
}
|
|
451
451
|
};
|
|
@@ -492,4 +492,4 @@ export {
|
|
|
492
492
|
buildBlobFieldEntries,
|
|
493
493
|
withSearch
|
|
494
494
|
};
|
|
495
|
-
//# sourceMappingURL=chunk-
|
|
495
|
+
//# sourceMappingURL=chunk-AKIEBFIJ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildRecordEnvelope
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WRLWEYHY.js";
|
|
4
4
|
|
|
5
5
|
// src/with-party/policy/storage.ts
|
|
6
6
|
var META_COLLECTION = "_meta";
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
loadVaultPolicy,
|
|
37
37
|
saveVaultPolicy
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-B3B6HV5S.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
signBytes,
|
|
3
3
|
verifyBytes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WRLWEYHY.js";
|
|
5
5
|
|
|
6
6
|
// src/with-audit/attestation/scheme.ts
|
|
7
7
|
var ENCLAVE_SCHEME = { sign: signBytes, verify: verifyBytes };
|
|
@@ -9,4 +9,4 @@ var ENCLAVE_SCHEME = { sign: signBytes, verify: verifyBytes };
|
|
|
9
9
|
export {
|
|
10
10
|
ENCLAVE_SCHEME
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-B6EWMGFX.js.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
walkClosure
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UL6MTRMJ.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveManagedSecret
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NTVKHQ3L.js";
|
|
7
7
|
import {
|
|
8
8
|
parseExtractedPartitionBody,
|
|
9
9
|
readPod,
|
|
10
10
|
readPodHeader
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XPW7T2GN.js";
|
|
12
12
|
import {
|
|
13
13
|
createOwnerKeyring,
|
|
14
14
|
mintRosterTag,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./chunk-
|
|
15
|
+
requireRosterKey,
|
|
16
|
+
stampAuthority
|
|
17
|
+
} from "./chunk-V7AKGAXY.js";
|
|
18
18
|
import {
|
|
19
19
|
LedgerStore
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ONZ3B5EW.js";
|
|
21
21
|
import {
|
|
22
22
|
LEDGER_COLLECTION
|
|
23
23
|
} from "./chunk-I7FD46FF.js";
|
|
@@ -30,18 +30,18 @@ import {
|
|
|
30
30
|
importTransferKey,
|
|
31
31
|
openEnvelopeJson,
|
|
32
32
|
wrapKey
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-WRLWEYHY.js";
|
|
34
34
|
import {
|
|
35
35
|
AdoptionStateError,
|
|
36
36
|
TransferSealError,
|
|
37
37
|
ValidationError
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-IKPQ2GGB.js";
|
|
39
39
|
|
|
40
40
|
// src/with-cargo/active.ts
|
|
41
41
|
function withCargo() {
|
|
42
42
|
return {
|
|
43
43
|
async extractPartition(vault, opts) {
|
|
44
|
-
const { extractPartitionCore } = await import("./extract-partition-
|
|
44
|
+
const { extractPartitionCore } = await import("./extract-partition-33747NY5.js");
|
|
45
45
|
return extractPartitionCore(vault, opts);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
@@ -218,10 +218,10 @@ async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
|
|
|
218
218
|
mergedDeks[collection] = await wrapKey(dek, kek);
|
|
219
219
|
}
|
|
220
220
|
const merged = { ...keyringFile, deks: mergedDeks };
|
|
221
|
-
const withEpoch =
|
|
221
|
+
const withEpoch = stampAuthority(merged, keyringFile.roster_epoch);
|
|
222
222
|
const rosterKey = requireRosterKey(unlocked, "adoptPartition");
|
|
223
223
|
const mergedFile = { ...withEpoch, roster_tag: await mintRosterTag(withEpoch, rosterKey) };
|
|
224
|
-
await store.put(vaultName, "_keyring", userId, { ...env, _data: JSON.stringify(mergedFile) });
|
|
224
|
+
await store.put(vaultName, "_keyring", userId, { ...env, _v: env._v + 1, _data: JSON.stringify(mergedFile) }, env._v);
|
|
225
225
|
}
|
|
226
226
|
const ledgerDek = partitionDeks.get(LEDGER_COLLECTION);
|
|
227
227
|
if (ledgerDek) {
|
|
@@ -243,7 +243,7 @@ async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
if (isManaged(opts)) {
|
|
246
|
-
const { createNoydb } = await import("./noydb-
|
|
246
|
+
const { createNoydb } = await import("./noydb-U62OVKXB.js");
|
|
247
247
|
const db = await createNoydb({
|
|
248
248
|
store,
|
|
249
249
|
user: userId,
|
|
@@ -298,4 +298,4 @@ export {
|
|
|
298
298
|
withCargo,
|
|
299
299
|
describeExtraction
|
|
300
300
|
};
|
|
301
|
-
//# sourceMappingURL=chunk-
|
|
301
|
+
//# sourceMappingURL=chunk-B7Y2BRQA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../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 * 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 {\n base64ToBuffer, bufferToBase64, wrapKey, importTransferKey, decryptBytes, importDekSet,\n type EnclaveKey,\n} from '../capsule/index.js'\nimport { TransferSealError, AdoptionStateError, ValidationError } from '../kernel/errors.js'\nimport type { NoydbStore, VaultSnapshot, KeyringFile } from '../kernel/types.js'\nimport { createOwnerKeyring, requireRosterKey } from '../with-party/team/keyring.js'\nimport { mintRosterTag } from '../with-party/team/roster-tag.js' // #1115\nimport { stampAuthority } from '../with-party/team/roster-tag.js'\nimport { resolveManagedSecret } from '../with-party/team/managed-secret.js'\nimport type { NoydbSealer } from '../with-party/team/managed-secret.js'\nimport type { NoydbShamir } from '../with-party/team/noydb-shamir.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 { buildRecordEnvelope } from '../capsule/index.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 importTransferKey(transferKey)\n const raw = base64ToBuffer(seal.payload)\n let plaintext: Uint8Array\n try {\n plaintext = await decryptBytes(bufferToBase64(raw.slice(0, 12)), bufferToBase64(raw.slice(12)), key)\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 // Extractable: the recipient re-wraps these under their own KEK (AES-KW)\n // at owner-creation — importDekSet mints them the way generateDEK does.\n return importDekSet(dekMap)\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 buildRecordEnvelope({ collection: '_meta', id: 'adoption', version: 1 },\n { ts: adoptedAt, iv: '', data: JSON.stringify(adoption) }))\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 `NoydbSealer` (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: NoydbSealer\n readonly recovery: ReadonlyArray<RecoveryEnrollmentInput>\n readonly shamirRecovery: NoydbShamir\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 `NoydbSealer` 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 // #1115 — RESTAMP. The roster tag now covers the DEK key SET, and this merge\n // is precisely a change to that set: adoption joins the partition's\n // collections to a keyring `createOwnerKeyring` stamped moments earlier\n // without them. Writing the merged file under the old tag would leave every\n // adopted vault failing `roster-tag-mismatch` on its first open.\n //\n // The roster key is the one just minted for this NEW vault — unlike\n // `liberateVault`, which joins an EXISTING vault and must keep the\n // incumbent key so co-members can still verify each other.\n const merged: KeyringFile = { ...keyringFile, deks: mergedDeks }\n // #1097 — stamped BEFORE the tag is minted, so it lands inside the\n // authenticated canonical and a store can neither edit nor strip it.\n const withEpoch = stampAuthority(merged, keyringFile.roster_epoch)\n const rosterKey = requireRosterKey(unlocked, 'adoptPartition')\n const mergedFile: KeyringFile = { ...withEpoch, roster_tag: await mintRosterTag(withEpoch, rosterKey) }\n // core#132 — CAS on the envelope this merge was computed from; see liberate.ts.\n await store.put(vaultName, '_keyring', userId, { ...env, _v: env._v + 1, _data: JSON.stringify(mergedFile) }, env._v)\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 '../capsule/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({ collection, id }, 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,YAA2B;AACzC,SAAO;AAAA,IACL,MAAM,iBAAiB,OAAO,MAAM;AAClC,YAAM,EAAE,qBAAqB,IAAI,MAAM,OAAO,iCAAwB;AACtE,aAAO,qBAAqB,OAAO,IAAI;AAAA,IACzC;AAAA,EACF;AACF;;;ACkBA,eAAsB,mBACpB,OACA,MAC4B;AAC5B,QAAM,EAAE,SAAS,OAAO,aAAa,IAAI,MAAM,YAAY,OAAO,IAAI;AAEtE,QAAM,EAAE,MAAM,WAAW,QAAQ,IAAI,MAAM,iBAAiB;AAC5D,QAAM,UAAU,IAAI,YAAY;AAEhC,QAAM,eAED,CAAC;AACN,QAAM,eAA0D,CAAC;AACjE,MAAI,aAAa;AACjB,MAAI,eAAe;AAEnB,aAAW,CAAC,gBAAgB,GAAG,KAAK,SAAS;AAC3C,QAAI,QAAQ;AACZ,QAAI;AACJ,QAAI;AACJ,QAAI,cAAc;AAElB,eAAW,MAAM,KAAK;AACpB,YAAM,MAAM,MAAM,QAAQ,IAAI,WAAW,gBAAgB,EAAE;AAC3D,UAAI,CAAC,KAAK;AAGR,qBAAa,KAAK,EAAE,YAAY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|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4TG2ITRW.js";
|
|
8
8
|
import {
|
|
9
9
|
distinctKeyOf
|
|
10
10
|
} from "./chunk-SUZKW6UR.js";
|
|
11
11
|
import {
|
|
12
12
|
MaintenanceMethods
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YJGKOSQD.js";
|
|
14
14
|
import {
|
|
15
15
|
groupKeyName,
|
|
16
16
|
isDateTruncKey,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-XBKH4FOC.js";
|
|
19
19
|
import {
|
|
20
20
|
ScanBuilder
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-7K42TSCY.js";
|
|
22
22
|
import {
|
|
23
23
|
installMethods
|
|
24
24
|
} from "./chunk-F6NCB7KT.js";
|
|
@@ -29,14 +29,14 @@ import {
|
|
|
29
29
|
executeClausePipeline,
|
|
30
30
|
filterRecords,
|
|
31
31
|
fnViewDecoder
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-DWCFGF2K.js";
|
|
33
33
|
import {
|
|
34
34
|
readPath
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-GIQJGXV7.js";
|
|
36
36
|
import {
|
|
37
37
|
FieldNotQueryableError,
|
|
38
38
|
GroupCardinalityError
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-IKPQ2GGB.js";
|
|
40
40
|
|
|
41
41
|
// src/kernel/query/relate/join-reduce.ts
|
|
42
42
|
function liftToAlias(alias, path, inner) {
|
|
@@ -295,6 +295,12 @@ var ReduceMethods = class {
|
|
|
295
295
|
}
|
|
296
296
|
const derived = keys.filter(isDateTruncKey);
|
|
297
297
|
const fields = keys.map(groupKeyName);
|
|
298
|
+
const groupVia = this.source.via;
|
|
299
|
+
if (groupVia) {
|
|
300
|
+
for (const f of fields) {
|
|
301
|
+
if (groupVia.postureFor(f)?.queryable === "none") throw new FieldNotQueryableError(f);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
298
304
|
const aliases = this.aliasNames();
|
|
299
305
|
const keyIsAliased = this.plan.joins.length > 0 && fields.some((f) => this.addressesAlias(f, aliases));
|
|
300
306
|
const source = this.source;
|
|
@@ -521,4 +527,4 @@ function installReduce() {
|
|
|
521
527
|
export {
|
|
522
528
|
installReduce
|
|
523
529
|
};
|
|
524
|
-
//# sourceMappingURL=chunk-
|
|
530
|
+
//# sourceMappingURL=chunk-BFJE2GPP.js.map
|