@noy-db/hub 0.7.1-pre.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +147 -14
- package/LICENSE +202 -21
- package/NOTICE +1 -0
- package/README.md +5 -5
- package/codemods/0.8.0-pre.json +61 -0
- package/dist/api-OS747DS4.js +18 -0
- package/dist/as/index.js +11 -12
- package/dist/as/index.js.map +1 -1
- package/dist/at/index.js +9 -10
- package/dist/attestation/index.js +37 -26
- package/dist/attestation/index.js.map +1 -1
- package/dist/{backup-XKCXVKV3.js → backup-YE2VQ26S.js} +15 -16
- package/dist/backup-YE2VQ26S.js.map +1 -0
- package/dist/blobs/index.js +13 -14
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +12 -13
- package/dist/broker/index.js.map +1 -1
- package/dist/by/index.js +2 -2
- package/dist/capsule/contract.d.ts +159 -0
- package/dist/capsule/contract.js +95 -0
- package/dist/capsule/enclave-aes/bound.d.ts +52 -0
- package/dist/capsule/enclave-aes/capabilities.d.ts +2 -0
- package/dist/capsule/enclave-aes/classify/compare.d.ts +20 -0
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/find.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/reveal.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/verify.d.ts +2 -2
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/write.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/crypto.d.ts +33 -129
- package/dist/capsule/enclave-aes/index.d.ts +113 -0
- package/dist/capsule/enclave-aes/index.js +335 -0
- package/dist/capsule/enclave-aes/index.js.map +1 -0
- package/dist/capsule/enclave-aes/primitives.d.ts +29 -0
- package/dist/capsule/index.d.ts +27 -0
- package/dist/capsule/plumbing/ct-equal.d.ts +11 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/deterministic.d.ts +8 -21
- package/dist/capsule/plumbing/digest.d.ts +122 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/envelope-body.d.ts +44 -48
- package/dist/capsule/plumbing/index.d.ts +100 -0
- package/dist/capsule/plumbing/lifecycle.d.ts +50 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/record-codec.d.ts +80 -20
- package/dist/{kernel/enclave → capsule/plumbing}/record-envelope.d.ts +1 -1
- package/dist/capsule/plumbing/rekey-blob.d.ts +33 -0
- package/dist/capsule/plumbing/rekey.d.ts +44 -0
- package/dist/capsule/plumbing/sealed-slot.d.ts +22 -0
- package/dist/capsule/plumbing/sealed-slots.d.ts +37 -0
- package/dist/capsule/plumbing/sealing.d.ts +29 -0
- package/dist/capsule/plumbing/sign.d.ts +9 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/tombstone.d.ts +2 -2
- package/dist/capsule-VOLX3QRQ.js +209 -0
- package/dist/cargo/index.js +39 -36
- package/dist/{chunk-Q2MPFCQ7.js → chunk-23D6M6VM.js} +5 -5
- package/dist/chunk-23D6M6VM.js.map +1 -0
- package/dist/{chunk-R7BX2NB3.js → chunk-244QBK7Z.js} +4 -4
- package/dist/chunk-244QBK7Z.js.map +1 -0
- package/dist/chunk-2AFX33YA.js +936 -0
- package/dist/chunk-2AFX33YA.js.map +1 -0
- package/dist/{chunk-MVMXZYXT.js → chunk-2GHDLTPE.js} +2 -2
- package/dist/{chunk-GYGLAVCX.js → chunk-2MG3SW7Q.js} +6 -2
- package/dist/chunk-2MG3SW7Q.js.map +1 -0
- package/dist/{chunk-XLMEZIAJ.js → chunk-2ODVB6LZ.js} +2 -2
- package/dist/{chunk-HJUWN7JN.js → chunk-2PVXF5CS.js} +33 -8
- package/dist/chunk-2PVXF5CS.js.map +1 -0
- package/dist/{chunk-YJRT5UQM.js → chunk-2RH777HH.js} +21 -20
- package/dist/{chunk-YJRT5UQM.js.map → chunk-2RH777HH.js.map} +1 -1
- package/dist/{chunk-7O3Y4PPD.js → chunk-37EPTBBR.js} +153 -16
- package/dist/chunk-37EPTBBR.js.map +1 -0
- package/dist/{chunk-2ENE6445.js → chunk-3A5DUZ56.js} +102 -16
- package/dist/chunk-3A5DUZ56.js.map +1 -0
- package/dist/chunk-3EWS67C7.js +461 -0
- package/dist/chunk-3EWS67C7.js.map +1 -0
- package/dist/{chunk-SGZAIJCV.js → chunk-3L2NBKDR.js} +4 -8
- package/dist/chunk-3L2NBKDR.js.map +1 -0
- package/dist/{chunk-YMUFFJCO.js → chunk-3TDUWVWB.js} +5 -2
- package/dist/chunk-3TDUWVWB.js.map +1 -0
- package/dist/{chunk-4GVM6QZA.js → chunk-3XJQBBZD.js} +26 -28
- package/dist/chunk-3XJQBBZD.js.map +1 -0
- package/dist/{chunk-4ZS56W5S.js → chunk-42ALPZ2B.js} +672 -664
- package/dist/chunk-42ALPZ2B.js.map +1 -0
- package/dist/chunk-4CIQDWRB.js +524 -0
- package/dist/chunk-4CIQDWRB.js.map +1 -0
- package/dist/{chunk-RMS3NEA3.js → chunk-4JPMZTJY.js} +2 -2
- package/dist/{chunk-P3MG6QCN.js → chunk-4T3SE27M.js} +5 -9
- package/dist/chunk-4T3SE27M.js.map +1 -0
- package/dist/chunk-4V3Q35WG.js +204 -0
- package/dist/chunk-4V3Q35WG.js.map +1 -0
- package/dist/{chunk-NQKIUNW5.js → chunk-52MGURXO.js} +2 -2
- package/dist/{chunk-EQEYOJBM.js → chunk-5A4345TG.js} +4 -4
- package/dist/chunk-5A4345TG.js.map +1 -0
- package/dist/{chunk-334WSVOW.js → chunk-5FE75J4S.js} +6 -6
- package/dist/chunk-5FE75J4S.js.map +1 -0
- package/dist/chunk-5KC7QYEC.js +565 -0
- package/dist/chunk-5KC7QYEC.js.map +1 -0
- package/dist/{chunk-RSGLUIO6.js → chunk-5UMK7GRI.js} +13 -12
- package/dist/chunk-5UMK7GRI.js.map +1 -0
- package/dist/chunk-5WWDGFOS.js +275 -0
- package/dist/chunk-5WWDGFOS.js.map +1 -0
- package/dist/{chunk-QPQUVOZ2.js → chunk-6QVKPHBF.js} +3 -5
- package/dist/chunk-6QVKPHBF.js.map +1 -0
- package/dist/{chunk-ACAQ2DSG.js → chunk-747G6CT3.js} +2 -2
- package/dist/chunk-747G6CT3.js.map +1 -0
- package/dist/{chunk-QTQUH4DS.js → chunk-7R2Q7CPL.js} +16 -16
- package/dist/chunk-7R2Q7CPL.js.map +1 -0
- package/dist/{chunk-UGTBXF5U.js → chunk-7XMHMVTS.js} +3 -3
- package/dist/{chunk-YJX7EOJD.js → chunk-A4XMIZT3.js} +6 -6
- package/dist/{chunk-YJX7EOJD.js.map → chunk-A4XMIZT3.js.map} +1 -1
- package/dist/{chunk-A66I4JOA.js → chunk-AEQGFRU4.js} +4 -4
- package/dist/chunk-AEQGFRU4.js.map +1 -0
- package/dist/chunk-AL6ML4LA.js +1558 -0
- package/dist/chunk-AL6ML4LA.js.map +1 -0
- package/dist/{chunk-BZ3534YM.js → chunk-AUKKUPVB.js} +2 -2
- package/dist/{chunk-CUZLNGD5.js → chunk-B2YY6WDD.js} +1 -1
- package/dist/chunk-B2YY6WDD.js.map +1 -0
- package/dist/chunk-BKT776R5.js +1 -0
- package/dist/chunk-BNWA3WG5.js +22 -0
- package/dist/chunk-BNWA3WG5.js.map +1 -0
- package/dist/{chunk-VXANTWBJ.js → chunk-BPWYQ25R.js} +92 -6
- package/dist/{chunk-VXANTWBJ.js.map → chunk-BPWYQ25R.js.map} +1 -1
- package/dist/{chunk-6LKOJBV6.js → chunk-BVCUTXE3.js} +2 -2
- package/dist/chunk-CY2CYVWZ.js +41 -0
- package/dist/chunk-CY2CYVWZ.js.map +1 -0
- package/dist/{chunk-M4YPHYEH.js → chunk-DHHGL42E.js} +70 -25
- package/dist/chunk-DHHGL42E.js.map +1 -0
- package/dist/{chunk-VTFVLCUH.js → chunk-DIZLQVAA.js} +2 -2
- package/dist/{chunk-G73UVHCA.js → chunk-DLD5LGDS.js} +11 -12
- package/dist/chunk-DLD5LGDS.js.map +1 -0
- package/dist/{chunk-WQBG4SZS.js → chunk-DQESF6RP.js} +60 -49
- package/dist/chunk-DQESF6RP.js.map +1 -0
- package/dist/{chunk-LWBCUYZW.js → chunk-E2N2T5ZO.js} +2 -2
- package/dist/{chunk-3PGS7TYR.js → chunk-EGVJ7TM4.js} +29 -32
- package/dist/chunk-EGVJ7TM4.js.map +1 -0
- package/dist/{chunk-JVIBCBC7.js → chunk-EJLV62NI.js} +2 -2
- package/dist/{chunk-KKEESNPE.js → chunk-EYG2CY2X.js} +126 -19
- package/dist/chunk-EYG2CY2X.js.map +1 -0
- package/dist/{enclave-55PAM4YO.js → chunk-EZGV6F47.js} +83 -56
- package/dist/chunk-EZGV6F47.js.map +1 -0
- package/dist/{chunk-CHQCZZWC.js → chunk-EZOAKKTB.js} +36 -27
- package/dist/chunk-EZOAKKTB.js.map +1 -0
- package/dist/chunk-F6NCB7KT.js +13 -0
- package/dist/chunk-F6NCB7KT.js.map +1 -0
- package/dist/chunk-FFJFE4T7.js +100 -0
- package/dist/chunk-FFJFE4T7.js.map +1 -0
- package/dist/{chunk-JMGDHKQF.js → chunk-FLPCETP6.js} +2 -2
- package/dist/chunk-FOEDQATO.js +53 -0
- package/dist/chunk-FOEDQATO.js.map +1 -0
- package/dist/{chunk-DGOZ4UZD.js → chunk-FVH5QYY2.js} +2 -2
- package/dist/{chunk-HIWCKBEY.js → chunk-G2MVBDFP.js} +54 -28
- package/dist/chunk-G2MVBDFP.js.map +1 -0
- package/dist/chunk-GMKGGY7V.js +234 -0
- package/dist/chunk-GMKGGY7V.js.map +1 -0
- package/dist/{chunk-EIPVYUEP.js → chunk-GQ4MF3CM.js} +3 -3
- package/dist/chunk-GQ4MF3CM.js.map +1 -0
- package/dist/{chunk-PEOZ34EM.js → chunk-GSAK56VF.js} +1 -1
- package/dist/chunk-GSAK56VF.js.map +1 -0
- package/dist/{chunk-5VCRVKOZ.js → chunk-GUZET4SG.js} +12 -4
- package/dist/chunk-GUZET4SG.js.map +1 -0
- package/dist/{chunk-JBDFMYKQ.js → chunk-GZT3NQRA.js} +2 -2
- package/dist/{chunk-K23VKTN4.js → chunk-H23XHRTT.js} +19 -34
- package/dist/chunk-H23XHRTT.js.map +1 -0
- package/dist/{chunk-TFR7DSOV.js → chunk-H427H63K.js} +2 -2
- package/dist/{chunk-DFMWUOU5.js → chunk-H7JBY4P7.js} +23 -32
- package/dist/chunk-H7JBY4P7.js.map +1 -0
- package/dist/{chunk-SKGMN35F.js → chunk-HS554XAF.js} +3 -3
- package/dist/chunk-HS554XAF.js.map +1 -0
- package/dist/{chunk-HK67PX4J.js → chunk-HW7CMKUG.js} +1 -1
- package/dist/chunk-HW7CMKUG.js.map +1 -0
- package/dist/{chunk-3BVH633C.js → chunk-IMQKWR46.js} +5 -7
- package/dist/chunk-IMQKWR46.js.map +1 -0
- package/dist/{chunk-R42NSZI6.js → chunk-IUBMZPHM.js} +7 -7
- package/dist/chunk-IUBMZPHM.js.map +1 -0
- package/dist/{chunk-CUQPWYRX.js → chunk-IUT3GWP3.js} +75 -386
- package/dist/chunk-IUT3GWP3.js.map +1 -0
- package/dist/{chunk-RF6D3Y5E.js → chunk-JDEYF3PJ.js} +4 -8
- package/dist/{chunk-RF6D3Y5E.js.map → chunk-JDEYF3PJ.js.map} +1 -1
- package/dist/{chunk-PPTHY5QO.js → chunk-JIBUPZHA.js} +99 -8
- package/dist/chunk-JIBUPZHA.js.map +1 -0
- package/dist/{chunk-SMH6SRX7.js → chunk-JOSPH3E5.js} +2 -2
- package/dist/chunk-JQYKPKG6.js +193 -0
- package/dist/chunk-JQYKPKG6.js.map +1 -0
- package/dist/{chunk-7APJ6CO6.js → chunk-JSMTXZR3.js} +45 -13
- package/dist/chunk-JSMTXZR3.js.map +1 -0
- package/dist/chunk-JWWYRR4Q.js +12 -0
- package/dist/chunk-JWWYRR4Q.js.map +1 -0
- package/dist/{chunk-BVN6KXL2.js → chunk-KZXDLBY6.js} +14 -9
- package/dist/chunk-KZXDLBY6.js.map +1 -0
- package/dist/chunk-LGNDFRYC.js +23 -0
- package/dist/chunk-LGNDFRYC.js.map +1 -0
- package/dist/{chunk-XKWGNJ26.js → chunk-LIOVX5TJ.js} +7 -11
- package/dist/chunk-LIOVX5TJ.js.map +1 -0
- package/dist/{chunk-AYX7AINO.js → chunk-LNSVGRHO.js} +5 -7
- package/dist/chunk-LNSVGRHO.js.map +1 -0
- package/dist/chunk-M5B2W6YY.js +293 -0
- package/dist/chunk-M5B2W6YY.js.map +1 -0
- package/dist/chunk-MBMTND6D.js +456 -0
- package/dist/chunk-MBMTND6D.js.map +1 -0
- package/dist/{chunk-3BZZJJMQ.js → chunk-MILI22XQ.js} +3 -3
- package/dist/{chunk-A2HKRLPV.js → chunk-MXKI4ABF.js} +18 -59
- package/dist/chunk-MXKI4ABF.js.map +1 -0
- package/dist/{chunk-ZYIYHJ5R.js → chunk-MXOQ5JCG.js} +869 -238
- package/dist/chunk-MXOQ5JCG.js.map +1 -0
- package/dist/{chunk-V7ZRRCRJ.js → chunk-N7EVQD5S.js} +9 -13
- package/dist/chunk-N7EVQD5S.js.map +1 -0
- package/dist/chunk-N7UDP5VU.js +757 -0
- package/dist/chunk-N7UDP5VU.js.map +1 -0
- package/dist/chunk-NBQ3KK6X.js +270 -0
- package/dist/chunk-NBQ3KK6X.js.map +1 -0
- package/dist/{chunk-ZORTV6NH.js → chunk-NCO25JZO.js} +88 -4
- package/dist/chunk-NCO25JZO.js.map +1 -0
- package/dist/chunk-NH2UOV3B.js +18 -0
- package/dist/chunk-NH2UOV3B.js.map +1 -0
- package/dist/chunk-NYMLINRP.js +28 -0
- package/dist/chunk-NYMLINRP.js.map +1 -0
- package/dist/{chunk-YYP7WSEB.js → chunk-O2IMQSNA.js} +2 -2
- package/dist/chunk-O46CHQT7.js +215 -0
- package/dist/chunk-O46CHQT7.js.map +1 -0
- package/dist/chunk-OIEO4WDL.js +27 -0
- package/dist/chunk-OIEO4WDL.js.map +1 -0
- package/dist/{chunk-TRGTKX5E.js → chunk-OKSTSITU.js} +27 -4
- package/dist/chunk-OKSTSITU.js.map +1 -0
- package/dist/chunk-OYW3I5M4.js +31 -0
- package/dist/chunk-OYW3I5M4.js.map +1 -0
- package/dist/{chunk-Q7HZX3IF.js → chunk-PD64727P.js} +2 -2
- package/dist/chunk-PD64727P.js.map +1 -0
- package/dist/{chunk-FET5XCAT.js → chunk-PP3K67AJ.js} +34 -6
- package/dist/chunk-PP3K67AJ.js.map +1 -0
- package/dist/chunk-Q2XRFWOI.js +40 -0
- package/dist/chunk-Q2XRFWOI.js.map +1 -0
- package/dist/{chunk-QIZPZMUI.js → chunk-Q4UHJ5SN.js} +2 -2
- package/dist/{chunk-FAHMLERK.js → chunk-QBLT6POL.js} +2 -2
- package/dist/chunk-QMWY2FDS.js +157 -0
- package/dist/chunk-QMWY2FDS.js.map +1 -0
- package/dist/{chunk-LH5A3ZPG.js → chunk-RB4DOPGZ.js} +150 -22
- package/dist/chunk-RB4DOPGZ.js.map +1 -0
- package/dist/chunk-RHVMZSUU.js +7 -0
- package/dist/chunk-RHVMZSUU.js.map +1 -0
- package/dist/{chunk-BUE2D7PX.js → chunk-SMV2HRDU.js} +2 -2
- package/dist/chunk-SUZKW6UR.js +25 -0
- package/dist/chunk-SUZKW6UR.js.map +1 -0
- package/dist/{chunk-7MG7SJT7.js → chunk-SV2PM2OY.js} +1 -1
- package/dist/chunk-SV2PM2OY.js.map +1 -0
- package/dist/{chunk-UXVWEX5L.js → chunk-SYNY3VB5.js} +6 -2
- package/dist/chunk-SYNY3VB5.js.map +1 -0
- package/dist/{chunk-4GFX6MPA.js → chunk-TEHHROZL.js} +6 -8
- package/dist/chunk-TEHHROZL.js.map +1 -0
- package/dist/chunk-TKVUE4JF.js +1289 -0
- package/dist/chunk-TKVUE4JF.js.map +1 -0
- package/dist/{chunk-SFAWCTEM.js → chunk-TZZBXPZK.js} +2 -2
- package/dist/{chunk-F3W6YMDC.js → chunk-U2FZNEWJ.js} +4 -4
- package/dist/chunk-U2FZNEWJ.js.map +1 -0
- package/dist/{chunk-BLN54W3L.js → chunk-UA372JHH.js} +56 -3
- package/dist/chunk-UA372JHH.js.map +1 -0
- package/dist/{chunk-6YXCPL4T.js → chunk-UEFOQH74.js} +2 -2
- package/dist/chunk-UEFOQH74.js.map +1 -0
- package/dist/{chunk-2N5ML6HT.js → chunk-UIYESRD6.js} +9 -11
- package/dist/chunk-UIYESRD6.js.map +1 -0
- package/dist/{chunk-UHHPLO3I.js → chunk-V3RWOOSO.js} +4 -4
- package/dist/{chunk-KTFRCC5C.js → chunk-V7ADQF5O.js} +82 -8
- package/dist/chunk-V7ADQF5O.js.map +1 -0
- package/dist/{chunk-453F654R.js → chunk-VAORSCSU.js} +3 -3
- package/dist/chunk-VAORSCSU.js.map +1 -0
- package/dist/{chunk-GPNTB4Y7.js → chunk-VFHCKG5M.js} +6 -10
- package/dist/chunk-VFHCKG5M.js.map +1 -0
- package/dist/{chunk-2577DKXB.js → chunk-VHBKYN2J.js} +3 -3
- package/dist/chunk-VHBKYN2J.js.map +1 -0
- package/dist/chunk-VHM7HCKB.js +220 -0
- package/dist/chunk-VHM7HCKB.js.map +1 -0
- package/dist/{chunk-ZHKOPKE3.js → chunk-VKI2EB3N.js} +3 -3
- package/dist/chunk-VKI2EB3N.js.map +1 -0
- package/dist/{chunk-UDHWDSRL.js → chunk-VMV5SBE4.js} +16 -17
- package/dist/chunk-VMV5SBE4.js.map +1 -0
- package/dist/{chunk-SPYWXKJN.js → chunk-VQDZYB2B.js} +3 -3
- package/dist/chunk-VQDZYB2B.js.map +1 -0
- package/dist/{chunk-Q2PU57HC.js → chunk-VVOLDVIR.js} +2 -2
- package/dist/{chunk-3VF3WQ4F.js → chunk-WPOYWFSE.js} +7 -7
- package/dist/{chunk-3VF3WQ4F.js.map → chunk-WPOYWFSE.js.map} +1 -1
- package/dist/{chunk-OTQZ7ZWU.js → chunk-WXE4W2U6.js} +7 -11
- package/dist/chunk-WXE4W2U6.js.map +1 -0
- package/dist/chunk-XBKH4FOC.js +195 -0
- package/dist/chunk-XBKH4FOC.js.map +1 -0
- package/dist/{chunk-TUFM4UZP.js → chunk-XQRFSKYM.js} +2 -2
- package/dist/{chunk-3V4KWFX7.js → chunk-XSPFDUDG.js} +58 -53
- package/dist/chunk-XSPFDUDG.js.map +1 -0
- package/dist/{chunk-GY4WYNNG.js → chunk-Y2RKVFKR.js} +2 -2
- package/dist/{chunk-UP4BECPY.js → chunk-Y3LPTBG7.js} +89 -27
- package/dist/chunk-Y3LPTBG7.js.map +1 -0
- package/dist/{chunk-4OZNXTO4.js → chunk-YRXFFWG4.js} +2 -2
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-BWOFVYAC.js → classified-marker-SIYKUU5L.js} +3 -3
- package/dist/classified-marker-SIYKUU5L.js.map +1 -0
- package/dist/collection-facade-CS7CA2XO.js +47 -0
- package/dist/{computed-VPOKQK4N.js → computed-FAD7SED4.js} +3 -3
- package/dist/consent/index.js +10 -11
- package/dist/consent/index.js.map +1 -1
- package/dist/cover/index.js +10 -11
- package/dist/coverage/index.js +306 -0
- package/dist/coverage/index.js.map +1 -0
- package/dist/custody/index.js +12 -13
- package/dist/{dead-filter-PKQDLOT4.js → dead-filter-4F3LWYKH.js} +11 -3
- package/dist/dead-filter-4F3LWYKH.js.map +1 -0
- package/dist/debug/index.js +11 -2
- package/dist/debug/index.js.map +1 -1
- package/dist/{delegation-DS5NRILW.js → delegation-NANZDG4N.js} +13 -16
- package/dist/delegation-NANZDG4N.js.map +1 -0
- package/dist/derivations/index.js +25 -23
- package/dist/derive-XLOJVXPU.js +20 -0
- package/dist/directory/index.js +10 -11
- package/dist/{dispatch-IEPAVQUM.js → dispatch-H4HV32AM.js} +5 -5
- package/dist/{dispatch-Q6MWLOJY.js → dispatch-JDZNGEB3.js} +20 -21
- package/dist/dispatch-JDZNGEB3.js.map +1 -0
- package/dist/executor-FMPVN6DT.js +35 -0
- package/dist/executor-LBBBRTN5.js +8 -0
- package/dist/executor-OSRZST2U.js +8 -0
- package/dist/export-accessible-RAOJAAU5.js +22 -0
- package/dist/extract-partition-JD5CUSTG.js +37 -0
- package/dist/{fanout-sidecar-S3QL53YX.js → fanout-sidecar-L7NHPIOC.js} +13 -15
- package/dist/fanout-sidecar-L7NHPIOC.js.map +1 -0
- package/dist/find-JRN4RNQ5.js +10 -0
- package/dist/forget/index.js +9 -10
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +13 -14
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +14 -15
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +36 -14
- package/dist/index.js +970 -163
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +13 -5
- package/dist/indexing/index.js.map +1 -1
- package/dist/introspection/index.js +11 -12
- package/dist/issue-YIVBZUTH.js +19 -0
- package/dist/ivf-flat-UZ6DQDLS.js +314 -0
- package/dist/ivf-flat-UZ6DQDLS.js.map +1 -0
- package/dist/{json-schema-V3M5MUCM.js → json-schema-3SHX72CC.js} +2 -1
- package/dist/json-schema-3SHX72CC.js.map +1 -0
- package/dist/kernel/attestation-types.d.ts +62 -0
- package/dist/kernel/collection-config.d.ts +5 -68
- package/dist/kernel/collection.d.ts +30 -9
- package/dist/kernel/cutover-transform.d.ts +1 -1
- package/dist/kernel/errors.d.ts +257 -38
- package/dist/kernel/generation-map.d.ts +48 -0
- package/dist/kernel/merge-authority.d.ts +1 -1
- package/dist/kernel/noydb.d.ts +6 -1
- package/dist/kernel/paths.d.ts +29 -5
- package/dist/kernel/prepared-write.d.ts +1 -1
- package/dist/kernel/present-cache.d.ts +58 -0
- package/dist/kernel/query/all.d.ts +7 -0
- package/dist/kernel/query/builder.d.ts +601 -270
- package/dist/kernel/query/civil-date.d.ts +64 -0
- package/dist/kernel/query/cursor.d.ts +40 -0
- package/dist/kernel/query/distinct-key.d.ts +98 -0
- package/dist/kernel/query/hydration.d.ts +76 -0
- package/dist/kernel/query/index.d.ts +31 -15
- package/dist/kernel/query/internal/core.d.ts +30 -0
- package/dist/kernel/query/internal/hooks.d.ts +22 -0
- package/dist/kernel/query/internal/maintenance.d.ts +43 -0
- package/dist/kernel/query/live/incremental.d.ts +314 -0
- package/dist/kernel/query/live/index.d.ts +22 -0
- package/dist/kernel/query/live/install.d.ts +2 -0
- package/dist/kernel/query/{live.d.ts → live/live.d.ts} +39 -9
- package/dist/kernel/query/live/methods.d.ts +107 -0
- package/dist/kernel/query/predicate.d.ts +119 -1
- package/dist/kernel/query/reduce/date-trunc.d.ts +75 -0
- package/dist/kernel/query/reduce/index.d.ts +36 -0
- package/dist/kernel/query/reduce/install.d.ts +2 -0
- package/dist/kernel/query/reduce/methods.d.ts +259 -0
- package/dist/kernel/query/reduce/scan-methods.d.ts +121 -0
- package/dist/kernel/query/relate/explain.d.ts +199 -0
- package/dist/kernel/query/relate/index.d.ts +48 -0
- package/dist/kernel/query/relate/install.d.ts +2 -0
- package/dist/kernel/query/relate/join-on.d.ts +126 -0
- package/dist/kernel/query/relate/join-reduce.d.ts +16 -0
- package/dist/kernel/query/relate/join.d.ts +452 -0
- package/dist/kernel/query/relate/methods.d.ts +426 -0
- package/dist/kernel/query/relate/partition.d.ts +87 -0
- package/dist/kernel/query/relate/scan-methods.d.ts +163 -0
- package/dist/kernel/query/relate/traverse.d.ts +109 -0
- package/dist/kernel/query/scan-builder.d.ts +79 -176
- package/dist/kernel/query/sort-key.d.ts +52 -0
- package/dist/kernel/secret-mode.d.ts +1 -1
- package/dist/kernel/tx-write-gate.d.ts +77 -0
- package/dist/kernel/types.d.ts +113 -8
- package/dist/kernel/validation.d.ts +27 -10
- package/dist/kernel/vault.d.ts +11 -6
- package/dist/kernel/via/compose.d.ts +3 -0
- package/dist/kernel/via/index.d.ts +56 -0
- package/dist/kernel/via/pipeline.d.ts +48 -0
- package/dist/kernel/write-queue.d.ts +17 -0
- package/dist/{ledger-EDXFFZQL.js → ledger-5ZMGE44K.js} +11 -12
- package/dist/liberate-WZSZM2W6.js +24 -0
- package/dist/link-set-MFXC24VK.js +29 -0
- package/dist/{managed-secret-NCWEMPUQ.js → managed-secret-MFTFT22X.js} +10 -11
- package/dist/materialized-views/index.js +30 -24
- package/dist/{migrate-cek-5ENH64AA.js → migrate-cek-DZRFFOHW.js} +2 -2
- package/dist/money/index.js +5 -5
- package/dist/noydb-ITIGNKUF.js +96 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +12 -13
- package/dist/pod/index.js +74 -67
- package/dist/{pod-handle-ECVCDIXW.js → pod-handle-A3LET7NO.js} +10 -11
- package/dist/pod-handle-A3LET7NO.js.map +1 -0
- package/dist/policy/index.js +10 -11
- package/dist/port/on/index.d.ts +1 -1
- package/dist/port/to/index.d.ts +1 -1
- package/dist/port/with/blob-strategy.d.ts +10 -1
- package/dist/port/with/classified-strategy.d.ts +1 -1
- package/dist/port/with/collection-options.d.ts +6 -1
- package/dist/port/with/collection-registries.d.ts +1 -1
- package/dist/port/with/coverage-strategy.d.ts +83 -0
- package/dist/port/with/lookup-strategy.d.ts +2 -2
- package/dist/port/with/service-bus.d.ts +46 -0
- package/dist/port/with/strategies.d.ts +2 -0
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-3IPCSG6Q.js → post-register-7ND27CF2.js} +6 -6
- package/dist/post-register-7ND27CF2.js.map +1 -0
- package/dist/query/all/index.js +31 -0
- package/dist/query/index.js +20 -32
- package/dist/query/live/index.js +21 -0
- package/dist/query/live/index.js.map +1 -0
- package/dist/query/reduce/index.js +33 -0
- package/dist/query/reduce/index.js.map +1 -0
- package/dist/query/relate/index.js +56 -0
- package/dist/query/relate/index.js.map +1 -0
- package/dist/reduce/index.js +72 -18
- package/dist/reduce/index.js.map +1 -1
- package/dist/register-DT5HZ2LZ.js +30 -0
- package/dist/registry-BHRZGZHF.js +8 -0
- package/dist/registry-ET6ZFFWA.js +34 -0
- package/dist/registry-HXFGLGTG.js +8 -0
- package/dist/registry-THCPDEOD.js +23 -0
- package/dist/request-withdrawal-AV2MJJKY.js +30 -0
- package/dist/{reveal-QZDHSGD4.js → reveal-B2TLP4JQ.js} +10 -9
- package/dist/reveal-B2TLP4JQ.js.map +1 -0
- package/dist/revoke-6DWIEOCV.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +2 -2
- package/dist/sealed-record/index.js +16 -18
- package/dist/sealed-record/index.js.map +1 -1
- package/dist/search/index.js +11 -5
- package/dist/{seed-X5CC22CQ.js → seed-XNSE4U3S.js} +15 -18
- package/dist/seed-XNSE4U3S.js.map +1 -0
- package/dist/sequence/index.js +9 -10
- package/dist/session/index.js +9 -10
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.js +2 -2
- package/dist/signer-MHGW3OIL.js +23 -0
- package/dist/snapshots/index.js +11 -11
- package/dist/stale-6GCFMOOR.js +28 -0
- package/dist/storage-BYN5LO6Z.js +21 -0
- package/dist/storage-BYN5LO6Z.js.map +1 -0
- package/dist/store/index.js +1 -1
- package/dist/{store-coordination-provider-4WZAIRHC.js → store-coordination-provider-C4BPT5XF.js} +11 -12
- package/dist/store-coordination-provider-C4BPT5XF.js.map +1 -0
- package/dist/sync/index.js +10 -11
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +17 -16
- package/dist/tiers/index.js +13 -12
- package/dist/to/index.js +2 -2
- package/dist/transactions/index.js +3 -3
- package/dist/util/index.js +1 -1
- package/dist/vault-head/index.js +11 -14
- package/dist/vault-head/index.js.map +1 -1
- package/dist/{verify-6MDTIUEV.js → verify-UKALW7C2.js} +14 -12
- package/dist/verify-UKALW7C2.js.map +1 -0
- package/dist/via/blob/index.d.ts +1 -0
- package/dist/via/classified/binding.d.ts +2 -2
- package/dist/via/classified/config-drift.d.ts +2 -2
- package/dist/via/classified/errors.d.ts +1 -1
- package/dist/via/geo/binding.d.ts +31 -0
- package/dist/via/geo/descriptor.d.ts +54 -0
- package/dist/via/geo/geohash.d.ts +95 -0
- package/dist/via/geo/index.d.ts +13 -0
- package/dist/via/geo/where.d.ts +50 -0
- package/dist/via/i18n/core.d.ts +1 -1
- package/dist/via/lookup/handle.d.ts +4 -4
- package/dist/via/lookup/registry.d.ts +1 -1
- package/dist/via/lookup/snapshot.d.ts +3 -3
- package/dist/walk-4VPK7AS4.js +20 -0
- package/dist/walk-4VPK7AS4.js.map +1 -0
- package/dist/with-audit/attestation/index.d.ts +2 -1
- package/dist/with-audit/attestation/issue.d.ts +2 -2
- package/dist/with-audit/attestation/revoke.d.ts +2 -2
- package/dist/with-audit/attestation/scheme.d.ts +7 -0
- package/dist/with-audit/attestation/signer.d.ts +1 -1
- package/dist/with-audit/attestation/strategy.d.ts +2 -2
- package/dist/with-audit/attestation/types.d.ts +10 -0
- package/dist/with-audit/attestation/vault-facade.d.ts +2 -2
- package/dist/with-audit/attestation/verifier.d.ts +6 -0
- package/dist/with-audit/consent/consent.d.ts +1 -1
- package/dist/with-audit/consent/strategy.d.ts +1 -1
- package/dist/with-audit/coverage/accounting.d.ts +112 -0
- package/dist/with-audit/coverage/active.d.ts +29 -0
- package/dist/with-audit/coverage/index.d.ts +61 -0
- package/dist/with-audit/coverage/sketch.d.ts +75 -0
- package/dist/with-audit/forget/subject-index.d.ts +1 -1
- package/dist/with-audit/periods/periods.d.ts +55 -7
- package/dist/with-audit/periods/reserved-collections.d.ts +3 -0
- package/dist/with-audit/periods/vault-facade.d.ts +18 -1
- package/dist/with-audit/sealed-record/index.d.ts +2 -2
- package/dist/with-audit/sealed-record/strategy.d.ts +1 -1
- package/dist/with-audit/tiers/index.d.ts +53 -2
- package/dist/with-audit/tiers/strategy.d.ts +8 -0
- package/dist/with-cargo/adopt-partition.d.ts +1 -1
- package/dist/with-cargo/extract-partition.d.ts +1 -1
- package/dist/with-cargo/floor.d.ts +3 -3
- package/dist/with-commit/history/history.d.ts +2 -2
- package/dist/with-commit/history/index.d.ts +1 -1
- package/dist/with-commit/history/ledger/store.d.ts +1 -1
- package/dist/with-commit/history/strategy.d.ts +1 -1
- package/dist/with-commit/history/time-machine.d.ts +1 -1
- package/dist/with-commit/numbering/index.d.ts +1 -1
- package/dist/with-commit/sequence/index.d.ts +1 -1
- package/dist/with-commit/tx/invariants.d.ts +1 -1
- package/dist/with-commit/tx/transaction.d.ts +13 -3
- package/dist/with-commit/vault-head/head.d.ts +1 -1
- package/dist/with-commit/vault-head/index.d.ts +1 -1
- package/dist/with-commit/vault-head/strategy.d.ts +1 -1
- package/dist/with-commit/vault-head/verify.d.ts +1 -1
- package/dist/with-formula/derivations/dispatch.d.ts +1 -1
- package/dist/with-formula/derivations/fanout-sidecar.d.ts +1 -1
- package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +4 -3
- package/dist/with-formula/materialized-views/emit-memo.d.ts +40 -0
- package/dist/with-formula/materialized-views/executor.d.ts +8 -0
- package/dist/with-formula/materialized-views/index.d.ts +1 -1
- package/dist/with-formula/materialized-views/registry.d.ts +15 -0
- package/dist/with-formula/materialized-views/types.d.ts +106 -14
- package/dist/with-formula/materialized-views/window-stage.d.ts +11 -0
- package/dist/with-formula/overlay-views/types.d.ts +1 -1
- package/dist/with-formula/overlay-views/virtual-collection.d.ts +13 -4
- package/dist/with-lookup/embeddings/chunks.d.ts +79 -0
- package/dist/with-lookup/embeddings/descriptor.d.ts +21 -0
- package/dist/with-lookup/embeddings/index.d.ts +3 -0
- package/dist/with-lookup/embeddings/ivf-flat.d.ts +93 -0
- package/dist/with-lookup/embeddings/vector-index.d.ts +73 -0
- package/dist/with-lookup/embeddings/vector-set.d.ts +94 -1
- package/dist/with-lookup/embeddings/with-vector-index.d.ts +67 -0
- package/dist/with-lookup/indexing/collection-facade.d.ts +86 -3
- package/dist/with-lookup/indexing/compound-indexes.d.ts +129 -0
- package/dist/with-lookup/indexing/eager-indexes.d.ts +170 -1
- package/dist/with-lookup/indexing/index-snapshot.d.ts +62 -0
- package/dist/with-lookup/indexing/lazy-builder.d.ts +33 -0
- package/dist/with-lookup/indexing/persisted-field-indexes.d.ts +104 -0
- package/dist/with-lookup/indexing/persisted-indexes.d.ts +12 -0
- package/dist/with-lookup/indexing/sorted-indexes.d.ts +117 -0
- package/dist/with-lookup/indexing/unique-constraints.d.ts +106 -23
- package/dist/with-lookup/reduce/active.d.ts +2 -24
- package/dist/with-lookup/reduce/group-core.d.ts +43 -0
- package/dist/with-lookup/reduce/groupby.d.ts +195 -36
- package/dist/with-lookup/reduce/incremental-group.d.ts +153 -0
- package/dist/with-lookup/reduce/index.d.ts +26 -5
- package/dist/with-lookup/reduce/reducers.d.ts +255 -1
- package/dist/with-lookup/reduce/reduction.d.ts +44 -13
- package/dist/with-lookup/reduce/strategy.d.ts +43 -3
- package/dist/with-lookup/reduce/window.d.ts +262 -0
- package/dist/with-lookup/search/collection-facade.d.ts +45 -9
- package/dist/with-lookup/search/index-store.d.ts +5 -3
- package/dist/with-lookup/search/index.d.ts +4 -2
- package/dist/with-lookup/search/inverted-index.d.ts +38 -2
- package/dist/with-lookup/search/persisted-index-store.d.ts +5 -2
- package/dist/with-lookup/search/phrase.d.ts +28 -0
- package/dist/with-lookup/search/retrieve-types.d.ts +57 -1
- package/dist/with-lookup/search/serialize.d.ts +29 -3
- package/dist/with-lookup/search/strategy.d.ts +2 -6
- package/dist/with-party/broker/index.d.ts +3 -3
- package/dist/with-party/directory/cover/index.d.ts +1 -1
- package/dist/with-party/directory/cover/storage.d.ts +1 -1
- package/dist/with-party/directory/cover/types.d.ts +1 -1
- package/dist/with-party/directory/index.d.ts +1 -1
- package/dist/with-party/directory/types.d.ts +1 -1
- package/dist/with-party/directory/user-envelope/api.d.ts +1 -1
- package/dist/with-party/directory/user-envelope/storage.d.ts +1 -1
- package/dist/with-party/policy/engine.d.ts +1 -1
- package/dist/with-party/policy/index.d.ts +1 -1
- package/dist/with-party/policy/presets.d.ts +1 -1
- package/dist/with-party/team/authenticators.d.ts +91 -1
- package/dist/with-party/team/delegation.d.ts +1 -1
- package/dist/with-party/team/echo-secret.d.ts +2 -2
- package/dist/with-party/team/index.d.ts +4 -3
- package/dist/with-party/team/keyring.d.ts +2 -2
- package/dist/with-party/team/magic-link-grant.d.ts +1 -1
- package/dist/with-party/team/managed-secret.d.ts +1 -1
- package/dist/with-party/team/noydb-facade.d.ts +12 -3
- package/dist/with-party/team/recovery.d.ts +1 -1
- package/dist/with-party/team/roster-tag.d.ts +1 -1
- package/dist/with-party/team/rotate-recover.d.ts +1 -1
- package/dist/with-party/team/wrapped-deks.d.ts +1 -1
- package/dist/with-pod/format.d.ts +1 -1
- package/dist/with-pod/index.d.ts +1 -1
- package/dist/with-pod/pod.d.ts +1 -1
- package/dist/with-shape/blobs/blob-compaction.d.ts +17 -1
- package/dist/with-shape/blobs/blob-intent.d.ts +1 -1
- package/dist/with-shape/blobs/blob-set.d.ts +23 -4
- package/dist/with-shape/blobs/legacy-sweep.d.ts +35 -0
- package/dist/with-shape/introspection/describe.d.ts +7 -1
- package/dist/with-shape/introspection/field-meta.d.ts +18 -0
- package/dist/with-shape/introspection/types.d.ts +57 -1
- package/dist/with-shape/introspection/walk.d.ts +1 -1
- package/dist/with-shape/links/lazy-handle.d.ts +1 -1
- package/dist/with-shape/links/link-set.d.ts +1 -1
- package/dist/with-shape/links/vault-facade.d.ts +1 -1
- package/dist/with-shape/manifest/derive.d.ts +1 -1
- package/dist/with-shape/manifest/storage.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/register.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/storage.d.ts +1 -1
- package/dist/with-shape/satellites/dead-filter.d.ts +1 -1
- package/dist/with-shape/satellites/declare.d.ts +1 -1
- package/dist/with-shape/satellites/marker.d.ts +1 -1
- package/dist/with-shape/satellites/post-register.d.ts +1 -1
- package/dist/with-store/partitioned/index.d.ts +337 -0
- package/dist/with-sync/change-broadcast.d.ts +153 -0
- package/dist/with-sync/presence.d.ts +5 -10
- package/dist/withdraw-accessible-HL7GACUE.js +27 -0
- package/dist/withdraw-accessible-HL7GACUE.js.map +1 -0
- package/package.json +48 -12
- package/dist/api-WYW4YEQG.js +0 -19
- package/dist/backup-XKCXVKV3.js.map +0 -1
- package/dist/chunk-2577DKXB.js.map +0 -1
- package/dist/chunk-2ENE6445.js.map +0 -1
- package/dist/chunk-2N5ML6HT.js.map +0 -1
- package/dist/chunk-334WSVOW.js.map +0 -1
- package/dist/chunk-3BVH633C.js.map +0 -1
- package/dist/chunk-3PGS7TYR.js.map +0 -1
- package/dist/chunk-3V4KWFX7.js.map +0 -1
- package/dist/chunk-453F654R.js.map +0 -1
- package/dist/chunk-4GFX6MPA.js.map +0 -1
- package/dist/chunk-4GVM6QZA.js.map +0 -1
- package/dist/chunk-4ZS56W5S.js.map +0 -1
- package/dist/chunk-5VCRVKOZ.js.map +0 -1
- package/dist/chunk-6YXCPL4T.js.map +0 -1
- package/dist/chunk-7APJ6CO6.js.map +0 -1
- package/dist/chunk-7MG2LHO5.js +0 -1616
- package/dist/chunk-7MG2LHO5.js.map +0 -1
- package/dist/chunk-7MG7SJT7.js.map +0 -1
- package/dist/chunk-7O3Y4PPD.js.map +0 -1
- package/dist/chunk-A2HKRLPV.js.map +0 -1
- package/dist/chunk-A66I4JOA.js.map +0 -1
- package/dist/chunk-ACAQ2DSG.js.map +0 -1
- package/dist/chunk-ATL3ZVXT.js +0 -151
- package/dist/chunk-ATL3ZVXT.js.map +0 -1
- package/dist/chunk-AYX7AINO.js.map +0 -1
- package/dist/chunk-BLN54W3L.js.map +0 -1
- package/dist/chunk-BRLKZUBT.js +0 -95
- package/dist/chunk-BRLKZUBT.js.map +0 -1
- package/dist/chunk-BTDR2PXY.js +0 -29
- package/dist/chunk-BTDR2PXY.js.map +0 -1
- package/dist/chunk-BVN6KXL2.js.map +0 -1
- package/dist/chunk-CHQCZZWC.js.map +0 -1
- package/dist/chunk-CUQPWYRX.js.map +0 -1
- package/dist/chunk-CUZLNGD5.js.map +0 -1
- package/dist/chunk-DFMWUOU5.js.map +0 -1
- package/dist/chunk-EIPVYUEP.js.map +0 -1
- package/dist/chunk-EQEYOJBM.js.map +0 -1
- package/dist/chunk-F3W6YMDC.js.map +0 -1
- package/dist/chunk-FET5XCAT.js.map +0 -1
- package/dist/chunk-G73UVHCA.js.map +0 -1
- package/dist/chunk-GPNTB4Y7.js.map +0 -1
- package/dist/chunk-GYGLAVCX.js.map +0 -1
- package/dist/chunk-HIWCKBEY.js.map +0 -1
- package/dist/chunk-HJUWN7JN.js.map +0 -1
- package/dist/chunk-HK67PX4J.js.map +0 -1
- package/dist/chunk-HPVZCW43.js +0 -479
- package/dist/chunk-HPVZCW43.js.map +0 -1
- package/dist/chunk-I3ISCYT7.js +0 -159
- package/dist/chunk-I3ISCYT7.js.map +0 -1
- package/dist/chunk-K23VKTN4.js.map +0 -1
- package/dist/chunk-KKEESNPE.js.map +0 -1
- package/dist/chunk-KTFRCC5C.js.map +0 -1
- package/dist/chunk-LH5A3ZPG.js.map +0 -1
- package/dist/chunk-LP7BEXCT.js +0 -32
- package/dist/chunk-LP7BEXCT.js.map +0 -1
- package/dist/chunk-M4YPHYEH.js.map +0 -1
- package/dist/chunk-NSITFOCJ.js +0 -99
- package/dist/chunk-NSITFOCJ.js.map +0 -1
- package/dist/chunk-OTQZ7ZWU.js.map +0 -1
- package/dist/chunk-P3MG6QCN.js.map +0 -1
- package/dist/chunk-PEOZ34EM.js.map +0 -1
- package/dist/chunk-PPTHY5QO.js.map +0 -1
- package/dist/chunk-Q2MPFCQ7.js.map +0 -1
- package/dist/chunk-Q7HZX3IF.js.map +0 -1
- package/dist/chunk-QPQUVOZ2.js.map +0 -1
- package/dist/chunk-QTQUH4DS.js.map +0 -1
- package/dist/chunk-R42NSZI6.js.map +0 -1
- package/dist/chunk-R7BX2NB3.js.map +0 -1
- package/dist/chunk-RSGLUIO6.js.map +0 -1
- package/dist/chunk-RTBJ5IOO.js +0 -87
- package/dist/chunk-RTBJ5IOO.js.map +0 -1
- package/dist/chunk-SGZAIJCV.js.map +0 -1
- package/dist/chunk-SKGMN35F.js.map +0 -1
- package/dist/chunk-SPYWXKJN.js.map +0 -1
- package/dist/chunk-SZJ3DLZA.js +0 -66
- package/dist/chunk-SZJ3DLZA.js.map +0 -1
- package/dist/chunk-TRGTKX5E.js.map +0 -1
- package/dist/chunk-UDHWDSRL.js.map +0 -1
- package/dist/chunk-UP4BECPY.js.map +0 -1
- package/dist/chunk-UXVWEX5L.js.map +0 -1
- package/dist/chunk-V7ZRRCRJ.js.map +0 -1
- package/dist/chunk-WQBG4SZS.js.map +0 -1
- package/dist/chunk-XKWGNJ26.js.map +0 -1
- package/dist/chunk-YMUFFJCO.js.map +0 -1
- package/dist/chunk-ZHKOPKE3.js.map +0 -1
- package/dist/chunk-ZN4FD4PE.js +0 -364
- package/dist/chunk-ZN4FD4PE.js.map +0 -1
- package/dist/chunk-ZORTV6NH.js.map +0 -1
- package/dist/chunk-ZYIYHJ5R.js.map +0 -1
- package/dist/classified-marker-BWOFVYAC.js.map +0 -1
- package/dist/collection-facade-JSJYIKS4.js +0 -45
- package/dist/dead-filter-PKQDLOT4.js.map +0 -1
- package/dist/delegation-DS5NRILW.js.map +0 -1
- package/dist/derive-E642AOUB.js +0 -21
- package/dist/dispatch-Q6MWLOJY.js.map +0 -1
- package/dist/executor-5NIMLSKZ.js +0 -8
- package/dist/executor-7UQ3BZ4F.js +0 -29
- package/dist/executor-AQVXV5GZ.js +0 -8
- package/dist/export-accessible-ORMKLA3E.js +0 -22
- package/dist/extract-partition-NKYO3WNG.js +0 -37
- package/dist/fanout-sidecar-S3QL53YX.js.map +0 -1
- package/dist/find-NOGJ25VX.js +0 -10
- package/dist/issue-3DTQ7VJJ.js +0 -18
- package/dist/json-schema-V3M5MUCM.js.map +0 -1
- package/dist/kernel/enclave/classify/compare.d.ts +0 -10
- package/dist/kernel/enclave/index.d.ts +0 -87
- package/dist/kernel/enclave/record-keys/lifecycle.d.ts +0 -124
- package/dist/kernel/enclave/record-keys/rekey-blob.d.ts +0 -88
- package/dist/kernel/enclave/record-keys/rekey.d.ts +0 -91
- package/dist/kernel/enclave/record-keys/sealed-slot.d.ts +0 -14
- package/dist/kernel/enclave/record-keys/sealed-slots.d.ts +0 -123
- package/dist/kernel/enclave/record-keys/sealing.d.ts +0 -70
- package/dist/kernel/query/join.d.ts +0 -232
- package/dist/liberate-V35QUHJP.js +0 -24
- package/dist/link-set-2TTM3IZC.js +0 -30
- package/dist/noydb-62MX4QUG.js +0 -90
- package/dist/pod-handle-ECVCDIXW.js.map +0 -1
- package/dist/post-register-3IPCSG6Q.js.map +0 -1
- package/dist/register-HHLXEQDN.js +0 -31
- package/dist/registry-23WF3TGH.js +0 -8
- package/dist/registry-4AYVUNXK.js +0 -8
- package/dist/registry-JS3YFQQM.js +0 -18
- package/dist/registry-XX2Z7B46.js +0 -32
- package/dist/request-withdrawal-CHPATE4G.js +0 -30
- package/dist/reveal-QZDHSGD4.js.map +0 -1
- package/dist/revoke-7M2VW4ON.js +0 -23
- package/dist/seed-X5CC22CQ.js.map +0 -1
- package/dist/signer-SJQJVSM6.js +0 -24
- package/dist/stale-BZS6H2RY.js +0 -29
- package/dist/storage-RW4QBS23.js +0 -22
- package/dist/store-coordination-provider-4WZAIRHC.js.map +0 -1
- package/dist/verify-6MDTIUEV.js.map +0 -1
- package/dist/walk-ZURCH6RZ.js +0 -21
- package/dist/withdraw-accessible-PXR4IXDX.js +0 -27
- /package/dist/{api-WYW4YEQG.js.map → api-OS747DS4.js.map} +0 -0
- /package/dist/{computed-VPOKQK4N.js.map → capsule/contract.js.map} +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/broker/proof.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/bidx.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/digest.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/vdig.d.ts +0 -0
- /package/dist/{kernel/enclave/classify → capsule/plumbing}/kofn.d.ts +0 -0
- /package/dist/{kernel/enclave/classify → capsule/plumbing}/normalize.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/plumbing}/record-aad.d.ts +0 -0
- /package/dist/{collection-facade-JSJYIKS4.js.map → capsule-VOLX3QRQ.js.map} +0 -0
- /package/dist/{chunk-MVMXZYXT.js.map → chunk-2GHDLTPE.js.map} +0 -0
- /package/dist/{chunk-XLMEZIAJ.js.map → chunk-2ODVB6LZ.js.map} +0 -0
- /package/dist/{chunk-RMS3NEA3.js.map → chunk-4JPMZTJY.js.map} +0 -0
- /package/dist/{chunk-NQKIUNW5.js.map → chunk-52MGURXO.js.map} +0 -0
- /package/dist/{chunk-UGTBXF5U.js.map → chunk-7XMHMVTS.js.map} +0 -0
- /package/dist/{chunk-BZ3534YM.js.map → chunk-AUKKUPVB.js.map} +0 -0
- /package/dist/{derive-E642AOUB.js.map → chunk-BKT776R5.js.map} +0 -0
- /package/dist/{chunk-6LKOJBV6.js.map → chunk-BVCUTXE3.js.map} +0 -0
- /package/dist/{chunk-VTFVLCUH.js.map → chunk-DIZLQVAA.js.map} +0 -0
- /package/dist/{chunk-LWBCUYZW.js.map → chunk-E2N2T5ZO.js.map} +0 -0
- /package/dist/{chunk-JVIBCBC7.js.map → chunk-EJLV62NI.js.map} +0 -0
- /package/dist/{chunk-JMGDHKQF.js.map → chunk-FLPCETP6.js.map} +0 -0
- /package/dist/{chunk-DGOZ4UZD.js.map → chunk-FVH5QYY2.js.map} +0 -0
- /package/dist/{chunk-JBDFMYKQ.js.map → chunk-GZT3NQRA.js.map} +0 -0
- /package/dist/{chunk-TFR7DSOV.js.map → chunk-H427H63K.js.map} +0 -0
- /package/dist/{chunk-SMH6SRX7.js.map → chunk-JOSPH3E5.js.map} +0 -0
- /package/dist/{chunk-3BZZJJMQ.js.map → chunk-MILI22XQ.js.map} +0 -0
- /package/dist/{chunk-YYP7WSEB.js.map → chunk-O2IMQSNA.js.map} +0 -0
- /package/dist/{chunk-QIZPZMUI.js.map → chunk-Q4UHJ5SN.js.map} +0 -0
- /package/dist/{chunk-FAHMLERK.js.map → chunk-QBLT6POL.js.map} +0 -0
- /package/dist/{chunk-BUE2D7PX.js.map → chunk-SMV2HRDU.js.map} +0 -0
- /package/dist/{chunk-SFAWCTEM.js.map → chunk-TZZBXPZK.js.map} +0 -0
- /package/dist/{chunk-UHHPLO3I.js.map → chunk-V3RWOOSO.js.map} +0 -0
- /package/dist/{chunk-Q2PU57HC.js.map → chunk-VVOLDVIR.js.map} +0 -0
- /package/dist/{chunk-TUFM4UZP.js.map → chunk-XQRFSKYM.js.map} +0 -0
- /package/dist/{chunk-GY4WYNNG.js.map → chunk-Y2RKVFKR.js.map} +0 -0
- /package/dist/{chunk-4OZNXTO4.js.map → chunk-YRXFFWG4.js.map} +0 -0
- /package/dist/{enclave-55PAM4YO.js.map → collection-facade-CS7CA2XO.js.map} +0 -0
- /package/dist/{executor-5NIMLSKZ.js.map → computed-FAD7SED4.js.map} +0 -0
- /package/dist/{executor-7UQ3BZ4F.js.map → derive-XLOJVXPU.js.map} +0 -0
- /package/dist/{dispatch-IEPAVQUM.js.map → dispatch-H4HV32AM.js.map} +0 -0
- /package/dist/{executor-AQVXV5GZ.js.map → executor-FMPVN6DT.js.map} +0 -0
- /package/dist/{export-accessible-ORMKLA3E.js.map → executor-LBBBRTN5.js.map} +0 -0
- /package/dist/{extract-partition-NKYO3WNG.js.map → executor-OSRZST2U.js.map} +0 -0
- /package/dist/{find-NOGJ25VX.js.map → export-accessible-RAOJAAU5.js.map} +0 -0
- /package/dist/{issue-3DTQ7VJJ.js.map → extract-partition-JD5CUSTG.js.map} +0 -0
- /package/dist/{ledger-EDXFFZQL.js.map → find-JRN4RNQ5.js.map} +0 -0
- /package/dist/{liberate-V35QUHJP.js.map → issue-YIVBZUTH.js.map} +0 -0
- /package/dist/{link-set-2TTM3IZC.js.map → ledger-5ZMGE44K.js.map} +0 -0
- /package/dist/{managed-secret-NCWEMPUQ.js.map → liberate-WZSZM2W6.js.map} +0 -0
- /package/dist/{noydb-62MX4QUG.js.map → link-set-MFXC24VK.js.map} +0 -0
- /package/dist/{register-HHLXEQDN.js.map → managed-secret-MFTFT22X.js.map} +0 -0
- /package/dist/{migrate-cek-5ENH64AA.js.map → migrate-cek-DZRFFOHW.js.map} +0 -0
- /package/dist/{registry-23WF3TGH.js.map → noydb-ITIGNKUF.js.map} +0 -0
- /package/dist/{registry-4AYVUNXK.js.map → query/all/index.js.map} +0 -0
- /package/dist/{registry-JS3YFQQM.js.map → register-DT5HZ2LZ.js.map} +0 -0
- /package/dist/{registry-XX2Z7B46.js.map → registry-BHRZGZHF.js.map} +0 -0
- /package/dist/{request-withdrawal-CHPATE4G.js.map → registry-ET6ZFFWA.js.map} +0 -0
- /package/dist/{revoke-7M2VW4ON.js.map → registry-HXFGLGTG.js.map} +0 -0
- /package/dist/{signer-SJQJVSM6.js.map → registry-THCPDEOD.js.map} +0 -0
- /package/dist/{stale-BZS6H2RY.js.map → request-withdrawal-AV2MJJKY.js.map} +0 -0
- /package/dist/{storage-RW4QBS23.js.map → revoke-6DWIEOCV.js.map} +0 -0
- /package/dist/{walk-ZURCH6RZ.js.map → signer-MHGW3OIL.js.map} +0 -0
- /package/dist/{withdraw-accessible-PXR4IXDX.js.map → stale-6GCFMOOR.js.map} +0 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-group incremental maintenance for `groupBy().aggregate().live()` —
|
|
3
|
+
* #1341's second half.
|
|
4
|
+
*
|
|
5
|
+
* #1341 shipped delta maintenance for `live()` and for the UNGROUPED
|
|
6
|
+
* `.aggregate().live()`: the match set is patched per change event instead of
|
|
7
|
+
* re-scanned. A grouped live query got none of it — every change re-ran the
|
|
8
|
+
* whole pipeline: scan N records, re-evaluate every clause, re-bucket the
|
|
9
|
+
* whole match set, and re-fold every bucket. This module closes that.
|
|
10
|
+
*
|
|
11
|
+
* ## What is maintained, and what is not
|
|
12
|
+
*
|
|
13
|
+
* Two layers, and only the outer one is new:
|
|
14
|
+
*
|
|
15
|
+
* 1. **The match set** is maintained by `LiveMaintainer` (the #1341 engine),
|
|
16
|
+
* unchanged and un-forked. Membership and snapshot sequence are ITS
|
|
17
|
+
* answers, delegated exactly as the ungrouped path delegates them.
|
|
18
|
+
* 2. **The buckets** are maintained here. A change reaches this layer as a
|
|
19
|
+
* `PatchOutcome` — a record left the set, joined it, or both — and only
|
|
20
|
+
* the one or two buckets it touches are marked dirty. A dirty bucket is
|
|
21
|
+
* re-folded from its own records on the next read; every other bucket
|
|
22
|
+
* serves the row it already computed.
|
|
23
|
+
*
|
|
24
|
+
* ⛔ **Reducer states are NOT patched, deliberately** — the same call the
|
|
25
|
+
* ungrouped path made. The reducer protocol carries an optional `remove()`,
|
|
26
|
+
* and inverting `sum`/`count`/`avg` per delta would make a change O(1) instead
|
|
27
|
+
* of O(bucket). It is not wired, because *inverting a float `sum` does not
|
|
28
|
+
* reproduce a re-run's answer*: `(a + b + c) - b !== a + c` in IEEE-754, so an
|
|
29
|
+
* inverted state would drift from the eager one and the equivalence property
|
|
30
|
+
* this module is built on would be false. `min`/`max` are not invertible at
|
|
31
|
+
* all. Re-folding a dirty bucket from its records is bit-identical to a
|
|
32
|
+
* re-run by construction, and still turns O(matches) per change into
|
|
33
|
+
* O(largest touched bucket).
|
|
34
|
+
*
|
|
35
|
+
* ## The correctness contract
|
|
36
|
+
*
|
|
37
|
+
* `rows()` must equal `groupAndReduce(<the eager record set>, fields, spec)`
|
|
38
|
+
* at every step. Four things buy that, and three of them are group membership
|
|
39
|
+
* transitions a naive per-group patch gets wrong:
|
|
40
|
+
*
|
|
41
|
+
* - **Bucket CONTENTS.** A record's group key is read from the record, so a
|
|
42
|
+
* write that CHANGES the key arrives here as `removed` + `inserted` with
|
|
43
|
+
* the BEFORE record on one side and the AFTER record on the other. It
|
|
44
|
+
* leaves the old bucket and joins the new one. Reading the key off the
|
|
45
|
+
* after-state alone — the obvious shortcut — would leave a ghost row in
|
|
46
|
+
* the old bucket forever.
|
|
47
|
+
* - **Bucket DISAPPEARANCE.** A bucket that loses its last member is
|
|
48
|
+
* deleted, not left empty: `groupAndReduce` never creates a bucket with no
|
|
49
|
+
* records, so an empty bucket would emit a row that a re-run does not.
|
|
50
|
+
* - **Bucket APPEARANCE, in the right PLACE.** Buckets are emitted in
|
|
51
|
+
* first-seen order, which is the order of each bucket's MINIMUM snapshot
|
|
52
|
+
* sequence — not the order buckets happened to be created in. Those differ
|
|
53
|
+
* the moment a group key changes: with records at seq 0 (group A) and
|
|
54
|
+
* seq 1 (group B), rewriting seq 0's key to C makes a re-run emit
|
|
55
|
+
* `[C, B]`, while appending the new bucket would emit `[B, C]`. So each
|
|
56
|
+
* bucket keeps its members ordered by sequence and the emission order is
|
|
57
|
+
* recomputed from `members[0].seq` whenever a membership change could have
|
|
58
|
+
* moved a minimum.
|
|
59
|
+
* - **The key VALUES on the row** come from the bucket's first-seen record,
|
|
60
|
+
* which is `members[0]` — re-read whenever the bucket changes, because the
|
|
61
|
+
* first-seen record itself can leave.
|
|
62
|
+
*
|
|
63
|
+
* ## The fallback
|
|
64
|
+
*
|
|
65
|
+
* Anything not provably patchable rebuilds: a payload-less change event, a
|
|
66
|
+
* plan `canMaintainIncrementally()` refuses (the maintainer is then never
|
|
67
|
+
* built at all), a `LiveMaintainer` that rebuilt underneath us, an error
|
|
68
|
+
* thrown mid-patch, or an internal inconsistency this module refuses to paper
|
|
69
|
+
* over. `stats()` counts both paths so a test can assert WHICH one ran —
|
|
70
|
+
* without that, a fallback that silently swallowed every case would pass every
|
|
71
|
+
* behavioural test while delivering nothing.
|
|
72
|
+
*/
|
|
73
|
+
import type { GroupMaintenanceSource, SourceChange } from '../../kernel/query/live/incremental.js';
|
|
74
|
+
import type { ReduceSpec } from './reduction.js';
|
|
75
|
+
/** Counters exposed by {@link GroupedMaintainer.stats}. */
|
|
76
|
+
export interface GroupMaintenanceStats {
|
|
77
|
+
/** Change events folded in as a patch. */
|
|
78
|
+
readonly patches: number;
|
|
79
|
+
/** Full rebuilds of the bucket map — the fallback path. */
|
|
80
|
+
readonly rebuilds: number;
|
|
81
|
+
/** Buckets re-folded. One per dirty bucket per read, plus one per bucket per rebuild. */
|
|
82
|
+
readonly bucketsReduced: number;
|
|
83
|
+
/** Records stepped through a reducer. The work a full re-run would do every time. */
|
|
84
|
+
readonly recordsFolded: number;
|
|
85
|
+
}
|
|
86
|
+
/** Everything the grouped maintainer needs, supplied by `GroupedReduction`. */
|
|
87
|
+
export interface GroupedMaintainerConfig {
|
|
88
|
+
readonly source: GroupMaintenanceSource;
|
|
89
|
+
readonly fields: readonly string[];
|
|
90
|
+
readonly spec: ReduceSpec;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The maintained bucket map behind one grouped live reduction.
|
|
94
|
+
*
|
|
95
|
+
* Lifecycle mirrors `LiveMaintainer`: `attach()` when the subscription opens,
|
|
96
|
+
* `apply(change)` per upstream event, `rows()` to read, `detach()` on
|
|
97
|
+
* teardown. Before `attach()` (and after any fallback) `rows()` rebuilds from
|
|
98
|
+
* the snapshot, so a detached maintainer is simply an eager executor.
|
|
99
|
+
*/
|
|
100
|
+
export declare class GroupedMaintainer {
|
|
101
|
+
private readonly inner;
|
|
102
|
+
private readonly fields;
|
|
103
|
+
private readonly spec;
|
|
104
|
+
private readonly reducerKeys;
|
|
105
|
+
private readonly fieldLabel;
|
|
106
|
+
private readonly project;
|
|
107
|
+
private buckets;
|
|
108
|
+
/** Dedup keys in emission (first-seen) order. Recomputed when `orderDirty`. */
|
|
109
|
+
private order;
|
|
110
|
+
private orderDirty;
|
|
111
|
+
private stale;
|
|
112
|
+
private attached;
|
|
113
|
+
private patches;
|
|
114
|
+
private rebuilds;
|
|
115
|
+
private bucketsReduced;
|
|
116
|
+
private recordsFolded;
|
|
117
|
+
constructor(cfg: GroupedMaintainerConfig);
|
|
118
|
+
/**
|
|
119
|
+
* Start accepting deltas. Call in the SAME synchronous turn as the initial
|
|
120
|
+
* read — `LiveReduction` computes its first value in its constructor and
|
|
121
|
+
* subscribes immediately after, so attaching there is that turn.
|
|
122
|
+
*/
|
|
123
|
+
attach(): void;
|
|
124
|
+
/** Stop accepting deltas; every later read rebuilds. */
|
|
125
|
+
detach(): void;
|
|
126
|
+
/** Force the next read to rebuild. */
|
|
127
|
+
invalidate(): void;
|
|
128
|
+
/** Patch/rebuild counters — the observable difference between the two paths. */
|
|
129
|
+
stats(): GroupMaintenanceStats;
|
|
130
|
+
/**
|
|
131
|
+
* Fold one upstream change into the maintained buckets.
|
|
132
|
+
*
|
|
133
|
+
* The match-set layer runs first and unconditionally — even when THIS layer
|
|
134
|
+
* is stale, keeping the inner maintainer current is what makes the rebuild
|
|
135
|
+
* below cost O(matches) instead of O(collection).
|
|
136
|
+
*/
|
|
137
|
+
apply(change: SourceChange | undefined): void;
|
|
138
|
+
/** The current grouped rows — a fresh array on every call. */
|
|
139
|
+
rows(): unknown[];
|
|
140
|
+
/**
|
|
141
|
+
* Rebuild every bucket from the maintained match set. Equivalent to the
|
|
142
|
+
* eager path by construction: the inner maintainer hands back exactly the
|
|
143
|
+
* records `executeRecords()` would produce, in exactly that order, and
|
|
144
|
+
* `join()` below is the same bucketing loop `groupAndReduce` runs.
|
|
145
|
+
*/
|
|
146
|
+
private rebuild;
|
|
147
|
+
/** A record left the match set, or left one group on its way to another. */
|
|
148
|
+
private leave;
|
|
149
|
+
/** A record joined the match set, or joined a new group. */
|
|
150
|
+
private join;
|
|
151
|
+
private reduce;
|
|
152
|
+
private dedupKey;
|
|
153
|
+
}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Groups every file whose reason-for-existing is record reduction:
|
|
7
7
|
* - `reduction` (`Reduction<R>`, `reduceRecords`, `buildLiveReduction`)
|
|
8
8
|
* - `groupby` (`GroupedQuery`, `GroupedReduction`, cardinality guards)
|
|
9
|
-
* - `reducers` (`count`, `sum`, `avg`, `min`, `max` factories
|
|
9
|
+
* - `reducers` (`count`, `countDistinct`, `sum`, `avg`, `min`, `max` factories,
|
|
10
|
+
* plus the statistical five — `median`, `percentile`, `variance`, `stddev`, `mode`)
|
|
10
11
|
*
|
|
11
12
|
* The root barrel (`@noy-db/hub`) and the `@noy-db/hub/query` subpath
|
|
12
13
|
* continue to re-export the same symbols for backward compatibility
|
|
@@ -14,13 +15,31 @@
|
|
|
14
15
|
* prefer this subpath.
|
|
15
16
|
*/
|
|
16
17
|
export { withReduce } from './active.js';
|
|
17
|
-
export type { ReduceStrategy } from './strategy.js';
|
|
18
|
+
export type { ReduceStrategy, ReduceOptions } from './strategy.js';
|
|
18
19
|
export { Reduction, reduceRecords, buildLiveReduction } from './reduction.js';
|
|
19
20
|
export type { ReduceSpec, ReduceResult, ReductionUpstream, LiveReduction, } from './reduction.js';
|
|
20
21
|
export { GroupedQuery, GroupedQueryN, GroupedReduction, groupAndReduce, resetGroupByWarnings, GROUPBY_WARN_CARDINALITY, GROUPBY_MAX_CARDINALITY, } from './groupby.js';
|
|
21
|
-
export type { GroupedRow, GroupedRowN } from './groupby.js';
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
export type { GroupedRow, GroupedRowN, LiveGroupedReduction } from './groupby.js';
|
|
23
|
+
/**
|
|
24
|
+
* #1341 (grouped half) — per-group delta maintenance for
|
|
25
|
+
* `.groupBy().aggregate().live()`. `GroupedMaintainer` is exported so the
|
|
26
|
+
* engine can be driven (and its fallback observed) directly; ordinary
|
|
27
|
+
* consumers reach it through `LiveGroupedReduction.maintenanceStats()`.
|
|
28
|
+
*/
|
|
29
|
+
export { GroupedMaintainer } from './incremental-group.js';
|
|
30
|
+
export type { GroupMaintenanceStats, GroupedMaintainerConfig } from './incremental-group.js';
|
|
31
|
+
export { count, countDistinct, sum, avg, min, max, moneySum, moneyMin, moneyMax, reducerBuilder, bindDistinctReducers } from './reducers.js';
|
|
32
|
+
export type { Reducer, ReducerOptions, ReducerBuilder, CountDistinctState } from './reducers.js';
|
|
33
|
+
/** The statistical reducers (#1353) and the money variants of the two quantile ones. */
|
|
34
|
+
export { median, percentile, variance, stddev, mode, moneyMedian, moneyPercentile } from './reducers.js';
|
|
35
|
+
/**
|
|
36
|
+
* States and option bags named by the signatures directly above (#843a) — a
|
|
37
|
+
* caller must be able to annotate `variance()`'s state or pass
|
|
38
|
+
* `{ approx: true }` without reaching past the subpath.
|
|
39
|
+
*/
|
|
40
|
+
export type { WelfordState, DispersionOptions, PercentileOptions, QuantileState, ExactQuantileState, TDigestState, Centroid, ModeState, } from './reducers.js';
|
|
41
|
+
export { withWindow, rowNumber, rank, lag, lead, runningSum, runningMoneySum, applyWindow, WindowedQuery, WindowSelection, } from './window.js';
|
|
42
|
+
export type { WindowFactory, WindowSpec, WindowOrderInput, WindowFn, WindowSelectSpec, WindowRow, } from './window.js';
|
|
24
43
|
/** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
|
|
25
44
|
export { NO_REDUCE } from './strategy.js';
|
|
26
45
|
/**
|
|
@@ -32,3 +51,5 @@ export { NO_REDUCE } from './strategy.js';
|
|
|
32
51
|
export type { MinMaxState } from './reducers.js';
|
|
33
52
|
export type { MoneyString } from '../../via/money/branded.js';
|
|
34
53
|
export type { MoneyDescriptor } from '../../via/money/descriptor.js';
|
|
54
|
+
/** Named by `bindDistinctReducers`'s signature (#1347) — see #843a above. */
|
|
55
|
+
export type { BucketKeyCanonicalizer } from '../../kernel/query/distinct-key.js';
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* `remove` per delta), without blocking the simpler "full re-run on
|
|
24
24
|
* source change" that ships.
|
|
25
25
|
*/
|
|
26
|
+
import { type BucketKeyCanonicalizer } from '../../kernel/query/distinct-key.js';
|
|
26
27
|
import type { MoneyString } from '../../via/money/branded.js';
|
|
27
28
|
import type { QueryField } from '../../kernel/types.js';
|
|
28
29
|
/**
|
|
@@ -72,7 +73,7 @@ export interface Reducer<R, S = R> {
|
|
|
72
73
|
* render human-readable aggregate descriptors in `dumpSchema()`.
|
|
73
74
|
* Optional so third-party custom reducers are unaffected.
|
|
74
75
|
*/
|
|
75
|
-
readonly op?: 'count' | 'sum' | 'avg' | 'min' | 'max';
|
|
76
|
+
readonly op?: 'count' | 'countDistinct' | 'sum' | 'avg' | 'min' | 'max' | 'median' | 'percentile' | 'variance' | 'stddev' | 'mode';
|
|
76
77
|
/**
|
|
77
78
|
* Field name for field-based reducers (`sum`, `avg`, `min`, `max`).
|
|
78
79
|
* Absent on `count` which aggregates over record count, not a field.
|
|
@@ -88,6 +89,19 @@ export interface Reducer<R, S = R> {
|
|
|
88
89
|
* Money-only: FX rate map (`'USD->EUR' → rate`) used with `convertTo`.
|
|
89
90
|
*/
|
|
90
91
|
readonly fx?: Record<string, number | string>;
|
|
92
|
+
/**
|
|
93
|
+
* Quantile reducers only (#1353): the probability in `[0, 1]`. Carried as
|
|
94
|
+
* metadata so `wrapMoneyReducers` can rebuild the reducer on the exact
|
|
95
|
+
* BigInt path — a rewrite that must reproduce the SAME p, not guess one.
|
|
96
|
+
* `median` stamps `0.5`.
|
|
97
|
+
*/
|
|
98
|
+
readonly p?: number;
|
|
99
|
+
/**
|
|
100
|
+
* `percentile` only (#1353): `true` when the reducer is the bounded-memory
|
|
101
|
+
* t-digest rather than the exact O(n) one. Read by `wrapMoneyReducers`,
|
|
102
|
+
* which refuses it over a money field — a t-digest is a float structure.
|
|
103
|
+
*/
|
|
104
|
+
readonly approx?: boolean;
|
|
91
105
|
}
|
|
92
106
|
/**
|
|
93
107
|
* Common options accepted by every reducer factory.
|
|
@@ -120,6 +134,47 @@ export interface ReducerOptions<TSeed = unknown> {
|
|
|
120
134
|
* the number of non-null field values in any column.
|
|
121
135
|
*/
|
|
122
136
|
export declare function count(opts?: ReducerOptions<number>): Reducer<number>;
|
|
137
|
+
/**
|
|
138
|
+
* Multiset state behind {@link countDistinct}: canonical distinct key →
|
|
139
|
+
* how many records currently contribute it. The COUNT, not a bare Set, is
|
|
140
|
+
* what makes `remove()` correct — dropping one of three records holding
|
|
141
|
+
* `'c1'` must not drop `'c1'` from the distinct set.
|
|
142
|
+
*/
|
|
143
|
+
export interface CountDistinctState {
|
|
144
|
+
readonly counts: ReadonlyMap<string, number>;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Number of DISTINCT non-nullish values of `field` across matching records
|
|
148
|
+
* (#1347) — `COUNT(DISTINCT field)`.
|
|
149
|
+
*
|
|
150
|
+
* Distinctness is decided on the canonical index key, not on the stored
|
|
151
|
+
* string and not on any formatted rendering, so a money field's `'0100'` and
|
|
152
|
+
* `'100'` count once; see `kernel/query/distinct-key.ts` for why, and for why
|
|
153
|
+
* nullish values are excluded rather than counted as a value of their own.
|
|
154
|
+
*
|
|
155
|
+
* The canonicalizer is bound LATE, by {@link bindDistinctReducers}, at the
|
|
156
|
+
* same two points `wrapReducers` runs — a bare `countDistinct('amount')` in a
|
|
157
|
+
* spec has no way to know which collection it will be reduced against, so a
|
|
158
|
+
* constructor argument would be a footgun. Unbound, it falls back to the raw
|
|
159
|
+
* stringified key, which is exactly what a non-Via field wants.
|
|
160
|
+
*
|
|
161
|
+
* Incremental complexity: O(1) `step` and `remove`, O(1) `finalize`.
|
|
162
|
+
*/
|
|
163
|
+
export declare function countDistinct(field: string, opts?: ReducerOptions<number> & {
|
|
164
|
+
readonly canonicalize?: BucketKeyCanonicalizer;
|
|
165
|
+
}): Reducer<number, CountDistinctState>;
|
|
166
|
+
/**
|
|
167
|
+
* Rebind every `countDistinct` reducer in a spec to a Via canonicalizer.
|
|
168
|
+
*
|
|
169
|
+
* Called wherever `ViaPipeline.wrapReducers` is called — the two are the same
|
|
170
|
+
* seam, kept separate only because `wrapReducers` folds over BINDINGS (money
|
|
171
|
+
* rewriting its own `sum`) while this one is brand-agnostic: any binding that
|
|
172
|
+
* canonicalizes an index key canonicalizes a distinct key, by definition.
|
|
173
|
+
*
|
|
174
|
+
* Returns the spec unchanged when there is nothing to bind, so the common
|
|
175
|
+
* path allocates nothing.
|
|
176
|
+
*/
|
|
177
|
+
export declare function bindDistinctReducers<Spec>(spec: Spec, via: BucketKeyCanonicalizer | undefined): Spec;
|
|
123
178
|
/**
|
|
124
179
|
* Sum a numeric field across all matching records. Non-number values
|
|
125
180
|
* at the field path are coerced to 0 — consumers who want a different
|
|
@@ -186,6 +241,169 @@ export declare function min(field: string, opts?: ReducerOptions<number>): Reduc
|
|
|
186
241
|
* behavior, and the O(N) removal caveat.
|
|
187
242
|
*/
|
|
188
243
|
export declare function max(field: string, opts?: ReducerOptions<number>): Reducer<number | null, MinMaxState>;
|
|
244
|
+
/**
|
|
245
|
+
* ⚠️ MEMORY, stated once for the whole section.
|
|
246
|
+
*
|
|
247
|
+
* `variance` / `stddev` are **streaming** — three numbers of state regardless
|
|
248
|
+
* of how many records pass through, so they are free in a `.groupBy()` and
|
|
249
|
+
* free as a running window aggregate (#1349).
|
|
250
|
+
*
|
|
251
|
+
* `median`, `percentile` (exact) and `mode` are **O(n) per group**: the first
|
|
252
|
+
* two keep every contributing value, `mode` keeps one entry per distinct value.
|
|
253
|
+
* Multiplied by the `GROUPBY_MAX_CARDINALITY` ceiling (100,000 groups) that is
|
|
254
|
+
* the one place in the reduce vocabulary where a legal query can exhaust
|
|
255
|
+
* memory, so it is not "free like `sum`". Two ways out, in order of preference:
|
|
256
|
+
* narrow with `.where()` before grouping, or pass
|
|
257
|
+
* `percentile(field, p, { approx: true })` for the bounded-memory t-digest —
|
|
258
|
+
* O(compression) state per group instead of O(n), at a small, measured error.
|
|
259
|
+
*
|
|
260
|
+
* Unlike `count` / `sum` / `min` / `max`, whose states are copied on every
|
|
261
|
+
* `step`, the reducers in this section MUTATE their state in place and return
|
|
262
|
+
* it (the shape `via/money/money-reducer.ts` already uses). Copy-on-write here
|
|
263
|
+
* would make a median over a group quadratic in the group size, which is a
|
|
264
|
+
* worse bug than the inconsistency. States are built fresh by `init()` on every
|
|
265
|
+
* reduction run and never shared, so the mutation is not observable — except
|
|
266
|
+
* through `merge`, which therefore always returns a NEW state.
|
|
267
|
+
*/
|
|
268
|
+
/**
|
|
269
|
+
* Welford state behind {@link variance} and {@link stddev}.
|
|
270
|
+
*
|
|
271
|
+
* `m2` is the running sum of squared deviations **from the running mean**, not
|
|
272
|
+
* a sum of squares — that is the entire point. The textbook one-pass identity
|
|
273
|
+
* `(Σx² − (Σx)²/n)` subtracts two enormous nearly-equal numbers, and on an
|
|
274
|
+
* accounting column (invoice totals clustered around a large figure) the
|
|
275
|
+
* cancellation eats every significant digit: four totals just over 1e9 with a
|
|
276
|
+
* true sample variance of 30 come back as **−170.67**, so `stddev` is `NaN`.
|
|
277
|
+
* Welford never forms the large intermediate.
|
|
278
|
+
*/
|
|
279
|
+
export interface WelfordState {
|
|
280
|
+
/** Number of contributing records. */
|
|
281
|
+
readonly n: number;
|
|
282
|
+
/** Running arithmetic mean. */
|
|
283
|
+
readonly mean: number;
|
|
284
|
+
/** Running sum of squared deviations from `mean`. */
|
|
285
|
+
readonly m2: number;
|
|
286
|
+
}
|
|
287
|
+
/** Options for {@link variance} / {@link stddev}. */
|
|
288
|
+
export interface DispersionOptions extends ReducerOptions<WelfordState> {
|
|
289
|
+
/**
|
|
290
|
+
* `true` → **population** dispersion (÷ n). Default `false` → **sample**
|
|
291
|
+
* dispersion (÷ n−1), which is Postgres's `var_samp` / `stddev_samp`, the
|
|
292
|
+
* unqualified spelling in every SQL dialect this library is measured
|
|
293
|
+
* against.
|
|
294
|
+
*
|
|
295
|
+
* The divisor is not cosmetic and the wrong one is a silently wrong answer,
|
|
296
|
+
* so the two disagree loudly at n = 1: sample is `null` (n−1 = 0 is not a
|
|
297
|
+
* denominator), population is `0`.
|
|
298
|
+
*/
|
|
299
|
+
readonly population?: boolean;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Variance of a numeric field — **sample (n−1) by default**, `{ population:
|
|
303
|
+
* true }` for the n divisor. See {@link DispersionOptions}.
|
|
304
|
+
*
|
|
305
|
+
* Streaming (Welford): O(1) state, O(1) `step`, O(1) `remove`, associative
|
|
306
|
+
* `merge`. Safe as a running window aggregate.
|
|
307
|
+
*
|
|
308
|
+
* `null` for an empty result set, and `null` for a single record in sample
|
|
309
|
+
* mode (population mode returns `0`) — see `avg()` for why null rather than
|
|
310
|
+
* `NaN` or a throw.
|
|
311
|
+
*
|
|
312
|
+
* ⛔ Not available over a declared money field: dispersion is inherently a
|
|
313
|
+
* float computation, so `wrapMoneyReducers` refuses rather than let
|
|
314
|
+
* `readNumber` read a scaled-integer string as `0`.
|
|
315
|
+
*/
|
|
316
|
+
export declare function variance(field: string, opts?: DispersionOptions): Reducer<number | null, WelfordState>;
|
|
317
|
+
/**
|
|
318
|
+
* Standard deviation of a numeric field — the square root of {@link variance},
|
|
319
|
+
* with the same divisor rule, the same empty/single-element answers, the same
|
|
320
|
+
* streaming Welford state, and the same money refusal.
|
|
321
|
+
*/
|
|
322
|
+
export declare function stddev(field: string, opts?: DispersionOptions): Reducer<number | null, WelfordState>;
|
|
323
|
+
/**
|
|
324
|
+
* Exact quantile state: every contributing value, unsorted (sorting happens
|
|
325
|
+
* once, in `finalize`, on a copy — so a running window aggregate does not
|
|
326
|
+
* disturb the multiset it is still being appended to).
|
|
327
|
+
*/
|
|
328
|
+
export interface ExactQuantileState {
|
|
329
|
+
readonly kind: 'exact';
|
|
330
|
+
readonly values: number[];
|
|
331
|
+
}
|
|
332
|
+
/** One t-digest centroid: a weighted summary of `count` nearby values. */
|
|
333
|
+
export interface Centroid {
|
|
334
|
+
readonly mean: number;
|
|
335
|
+
readonly count: number;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* t-digest state: compressed centroids plus a small unmerged buffer.
|
|
339
|
+
*
|
|
340
|
+
* Implemented here rather than taken from npm — `hub/src/**` adds no
|
|
341
|
+
* dependency, and this one is ~60 lines.
|
|
342
|
+
*/
|
|
343
|
+
export interface TDigestState {
|
|
344
|
+
readonly kind: 'tdigest';
|
|
345
|
+
centroids: Centroid[];
|
|
346
|
+
buffer: number[];
|
|
347
|
+
n: number;
|
|
348
|
+
}
|
|
349
|
+
/** State of {@link median} / {@link percentile}; the arm depends on `approx`. */
|
|
350
|
+
export type QuantileState = ExactQuantileState | TDigestState;
|
|
351
|
+
/** Options for {@link percentile}. */
|
|
352
|
+
export interface PercentileOptions extends ReducerOptions<number> {
|
|
353
|
+
/**
|
|
354
|
+
* `true` → bounded-memory t-digest instead of keeping every value. O(1)-ish
|
|
355
|
+
* state per group, at a small error (under 1% of the value range at every
|
|
356
|
+
* quantile on a 10k uniform scan, exact at p = 0 and p = 1).
|
|
357
|
+
*
|
|
358
|
+
* The trade is real: an approximate reducer cannot `remove()`, so it does
|
|
359
|
+
* not participate in incremental live maintenance, and it is refused over a
|
|
360
|
+
* money field.
|
|
361
|
+
*/
|
|
362
|
+
readonly approx?: boolean;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Median of a numeric field — exactly `percentile(field, 0.5)`, and therefore
|
|
366
|
+
* **`percentile_cont`**: an even-sized input INTERPOLATES (`[1,2,3,4]` → `2.5`)
|
|
367
|
+
* rather than picking a member. See {@link quantileOf} for why only the
|
|
368
|
+
* interpolating definition ships.
|
|
369
|
+
*
|
|
370
|
+
* `null` on an empty result set. O(n) memory per group — read the memory note
|
|
371
|
+
* at the top of this section before using it under `.groupBy()`.
|
|
372
|
+
*
|
|
373
|
+
* Over a declared money field the reducer is rewritten onto the exact BigInt
|
|
374
|
+
* path; {@link moneyMedian} is the same call with the honest return type.
|
|
375
|
+
*/
|
|
376
|
+
export declare function median(field: string, opts?: ReducerOptions<number>): Reducer<number | null, QuantileState>;
|
|
377
|
+
/**
|
|
378
|
+
* The `p` quantile of a numeric field, `p ∈ [0, 1]`, by the **`percentile_cont`
|
|
379
|
+
* (interpolating)** definition — `percentile(f, 0.9)` over `1..10` is `9.1`,
|
|
380
|
+
* not `9`. `p = 0` is the minimum and `p = 1` the maximum, exactly.
|
|
381
|
+
*
|
|
382
|
+
* Throws for a `p` outside `[0, 1]` or a non-finite one, at construction time.
|
|
383
|
+
*
|
|
384
|
+
* Exact by default and O(n) per group; pass `{ approx: true }` for the
|
|
385
|
+
* bounded-memory t-digest (see {@link PercentileOptions}).
|
|
386
|
+
*/
|
|
387
|
+
export declare function percentile(field: string, p: number, opts?: PercentileOptions): Reducer<number | null, QuantileState>;
|
|
388
|
+
/** Frequency table behind {@link mode}: value → how many records hold it. */
|
|
389
|
+
export interface ModeState {
|
|
390
|
+
readonly counts: Map<number, number>;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Most frequent value of a numeric field.
|
|
394
|
+
*
|
|
395
|
+
* **Tie rule: the LOWEST value wins.** Two values with equal frequency is the
|
|
396
|
+
* common case on real data, not an edge case, and the alternatives are worse:
|
|
397
|
+
* "first seen" makes the answer depend on store iteration order (so the same
|
|
398
|
+
* query answers differently after a compaction, and `merge` stops being
|
|
399
|
+
* commutative), and "all of them" changes the result TYPE based on the data.
|
|
400
|
+
* Lowest-wins is total, order-independent, and mergeable.
|
|
401
|
+
*
|
|
402
|
+
* `null` on an empty result set. O(distinct values) memory per group.
|
|
403
|
+
*
|
|
404
|
+
* ⛔ Numeric only, and not available over a declared money field.
|
|
405
|
+
*/
|
|
406
|
+
export declare function mode(field: string, opts?: ReducerOptions<number>): Reducer<number | null, ModeState>;
|
|
189
407
|
/**
|
|
190
408
|
* `sum()` for a **declared money field**, typed to match the runtime.
|
|
191
409
|
*
|
|
@@ -217,6 +435,34 @@ export declare function moneyMin(field: string, opts?: ReducerOptions<number>):
|
|
|
217
435
|
* {@link moneyMin} for the `convertTo`/`fx` and multi-currency caveats.
|
|
218
436
|
*/
|
|
219
437
|
export declare function moneyMax(field: string, opts?: ReducerOptions<number>): Reducer<MoneyString | null>;
|
|
438
|
+
/**
|
|
439
|
+
* `median()` for a **declared money field**, typed `Reducer<MoneyString | null>`.
|
|
440
|
+
*
|
|
441
|
+
* Same late-binding rewrite as {@link moneySum}: `wrapMoneyReducers` swaps in a
|
|
442
|
+
* reducer that keeps the stored scaled integers as `bigint`s and interpolates
|
|
443
|
+
* the two middle values IN SCALED SPACE with half-even rounding — the money
|
|
444
|
+
* module's rounding everywhere else. Nothing round-trips through a float, so
|
|
445
|
+
* the answer is exact past `Number.MAX_SAFE_INTEGER`, where two distinct cent
|
|
446
|
+
* amounts stop being distinct numbers at all.
|
|
447
|
+
*
|
|
448
|
+
* An even-sized input can therefore land on a half unit (`0.10` and `0.15` →
|
|
449
|
+
* `12.5` cents): that is the one place money median rounds, and it rounds
|
|
450
|
+
* half-to-even (`0.12`), never away from zero.
|
|
451
|
+
*
|
|
452
|
+
* In multi-currency mode the runtime returns a per-currency map, as `moneyMin`
|
|
453
|
+
* does; an empty result is `null` in fixed mode and `{}` in multi.
|
|
454
|
+
*/
|
|
455
|
+
export declare function moneyMedian(field: string, opts?: ReducerOptions<number>): Reducer<MoneyString | null>;
|
|
456
|
+
/**
|
|
457
|
+
* `percentile()` for a declared money field — see {@link moneyMedian} for the
|
|
458
|
+
* exactness and rounding contract, which is the same code path (`median` is
|
|
459
|
+
* `p = 0.5`). The interpolation weight is taken from `p`'s DECIMAL spelling as
|
|
460
|
+
* an exact rational, so `p = 0.9` is `9/10`, not the float nearest to it.
|
|
461
|
+
*
|
|
462
|
+
* There is deliberately no `approx` here: the t-digest is a float structure and
|
|
463
|
+
* `wrapMoneyReducers` refuses it over a money field.
|
|
464
|
+
*/
|
|
465
|
+
export declare function moneyPercentile(field: string, p: number, opts?: ReducerOptions<number>): Reducer<MoneyString | null>;
|
|
220
466
|
/**
|
|
221
467
|
* Typed builder passed to the `aggregate(b => spec)` overload.
|
|
222
468
|
*
|
|
@@ -234,6 +480,7 @@ export declare function moneyMax(field: string, opts?: ReducerOptions<number>):
|
|
|
234
480
|
*/
|
|
235
481
|
export interface ReducerBuilder<T, S extends keyof T = never, M extends keyof T & string = never> {
|
|
236
482
|
count(opts?: ReducerOptions<number>): Reducer<number>;
|
|
483
|
+
countDistinct(field: QueryField<T, S>, opts?: ReducerOptions<number>): Reducer<number, CountDistinctState>;
|
|
237
484
|
sum<F extends QueryField<T, S>>(field: F, opts?: ReducerOptions<number>): [F] extends [M] ? Reducer<MoneyString> : Reducer<number>;
|
|
238
485
|
avg(field: QueryField<T, S>, opts?: ReducerOptions<{
|
|
239
486
|
sum: number;
|
|
@@ -241,9 +488,16 @@ export interface ReducerBuilder<T, S extends keyof T = never, M extends keyof T
|
|
|
241
488
|
}>): ReturnType<typeof avg>;
|
|
242
489
|
min<F extends QueryField<T, S>>(field: F, opts?: ReducerOptions<number>): [F] extends [M] ? Reducer<MoneyString | null> : ReturnType<typeof min>;
|
|
243
490
|
max<F extends QueryField<T, S>>(field: F, opts?: ReducerOptions<number>): [F] extends [M] ? Reducer<MoneyString | null> : ReturnType<typeof max>;
|
|
491
|
+
median<F extends QueryField<T, S>>(field: F, opts?: ReducerOptions<number>): [F] extends [M] ? Reducer<MoneyString | null> : ReturnType<typeof median>;
|
|
492
|
+
percentile<F extends QueryField<T, S>>(field: F, p: number, opts?: PercentileOptions): [F] extends [M] ? Reducer<MoneyString | null> : ReturnType<typeof percentile>;
|
|
493
|
+
variance(field: QueryField<T, S>, opts?: DispersionOptions): ReturnType<typeof variance>;
|
|
494
|
+
stddev(field: QueryField<T, S>, opts?: DispersionOptions): ReturnType<typeof stddev>;
|
|
495
|
+
mode(field: QueryField<T, S>, opts?: ReducerOptions<number>): ReturnType<typeof mode>;
|
|
244
496
|
moneySum(field: QueryField<T, S>, opts?: ReducerOptions<number>): Reducer<MoneyString>;
|
|
245
497
|
moneyMin(field: QueryField<T, S>, opts?: ReducerOptions<number>): Reducer<MoneyString | null>;
|
|
246
498
|
moneyMax(field: QueryField<T, S>, opts?: ReducerOptions<number>): Reducer<MoneyString | null>;
|
|
499
|
+
moneyMedian(field: QueryField<T, S>, opts?: ReducerOptions<number>): Reducer<MoneyString | null>;
|
|
500
|
+
moneyPercentile(field: QueryField<T, S>, p: number, opts?: ReducerOptions<number>): Reducer<MoneyString | null>;
|
|
247
501
|
}
|
|
248
502
|
/**
|
|
249
503
|
* Shared runtime instance for the `aggregate(b => spec)` builder form.
|
|
@@ -9,11 +9,20 @@
|
|
|
9
9
|
* existing `Query.toArray()` / `.first()` / `.count()` style.
|
|
10
10
|
* - `.live(): LiveReduction<R>` — reactive primitive that
|
|
11
11
|
* re-runs the reduction whenever the query's source notifies of
|
|
12
|
-
* a change.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* a change. Since #1341 the RECORD SET it reduces is maintained
|
|
13
|
+
* incrementally upstream (see `kernel/query/live/incremental.ts`), so a
|
|
14
|
+
* change costs one predicate evaluation instead of a full scan — but
|
|
15
|
+
* the reducers themselves still run a complete `init → step* →
|
|
16
|
+
* finalize` fold over that set. Driving `remove()` per delta (the
|
|
17
|
+
* reducer protocol admits it) would make a change O(1) rather than
|
|
18
|
+
* O(matches); it is deliberately NOT wired, because folding the same
|
|
19
|
+
* array a re-run would fold makes the incremental value bit-identical
|
|
20
|
+
* to the eager one, while inverting a float `sum` does not.
|
|
21
|
+
*
|
|
22
|
+
* `GroupedReduction.live()` goes one step further (#1341, grouped half): its
|
|
23
|
+
* BUCKETS are maintained too, so a change re-folds only the groups it touched.
|
|
24
|
+
* See `incremental-group.ts`. The reasoning above is why neither path inverts
|
|
25
|
+
* a reducer state.
|
|
17
26
|
*
|
|
18
27
|
* The `Reduction<R>` wrapper is deliberately tiny — it exists so
|
|
19
28
|
* `.aggregate(spec)` can be chained with either `.run()` or `.live()`
|
|
@@ -27,6 +36,8 @@
|
|
|
27
36
|
* surface with plain record arrays, without spinning up a Collection.
|
|
28
37
|
*/
|
|
29
38
|
import type { Reducer } from './reducers.js';
|
|
39
|
+
import type { SourceChange } from '../../kernel/query/live/incremental.js';
|
|
40
|
+
import type { HydrationGate } from '../../kernel/query/hydration.js';
|
|
30
41
|
/**
|
|
31
42
|
* A named set of reducers, keyed by output field name. Each key
|
|
32
43
|
* becomes a field on the aggregated result.
|
|
@@ -105,7 +116,14 @@ export interface LiveReduction<R> {
|
|
|
105
116
|
* query's source and wires them into a single re-run trigger.
|
|
106
117
|
*/
|
|
107
118
|
export interface ReductionUpstream {
|
|
108
|
-
|
|
119
|
+
/**
|
|
120
|
+
* `cb` MAY be handed the delta that caused the notification (#1341), which
|
|
121
|
+
* is what lets `GroupedReduction.live()` patch the buckets a change touches
|
|
122
|
+
* instead of re-grouping. Calling it with NO argument is always valid and
|
|
123
|
+
* always correct — it means "something changed, I can't say what", and every
|
|
124
|
+
* consumer answers that with a full re-run.
|
|
125
|
+
*/
|
|
126
|
+
subscribe(cb: (change?: SourceChange) => void): () => void;
|
|
109
127
|
}
|
|
110
128
|
/**
|
|
111
129
|
* Chainable wrapper returned by `Query.aggregate(spec)`. Holds the
|
|
@@ -127,7 +145,21 @@ export declare class Reduction<R> {
|
|
|
127
145
|
private readonly executeRecords;
|
|
128
146
|
private readonly spec;
|
|
129
147
|
private readonly upstreams;
|
|
130
|
-
|
|
148
|
+
/**
|
|
149
|
+
* #1414 — the backing collection's cold gate, when the reduction came
|
|
150
|
+
* from a collection-backed query. `run()` is SYNCHRONOUS, so a reduction
|
|
151
|
+
* over a never-loaded collection used to answer `0` / `null` with total
|
|
152
|
+
* confidence — the shape a guard's Σ-over-siblings invariant takes.
|
|
153
|
+
*/
|
|
154
|
+
private readonly gate?;
|
|
155
|
+
constructor(executeRecords: () => readonly unknown[], spec: ReduceSpec, upstreams: readonly ReductionUpstream[],
|
|
156
|
+
/**
|
|
157
|
+
* #1414 — the backing collection's cold gate, when the reduction came
|
|
158
|
+
* from a collection-backed query. `run()` is SYNCHRONOUS, so a reduction
|
|
159
|
+
* over a never-loaded collection used to answer `0` / `null` with total
|
|
160
|
+
* confidence — the shape a guard's Σ-over-siblings invariant takes.
|
|
161
|
+
*/
|
|
162
|
+
gate?: HydrationGate | undefined);
|
|
131
163
|
/**
|
|
132
164
|
* Execute the query and reduce the results synchronously.
|
|
133
165
|
* Returns the reduced shape matching the spec — e.g. a spec of
|
|
@@ -146,12 +178,11 @@ export declare class Reduction<R> {
|
|
|
146
178
|
* place.
|
|
147
179
|
*
|
|
148
180
|
* **Implementation note:** every upstream change triggers a full
|
|
149
|
-
* re-reduction
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* delta-based maintenance without changing this API.
|
|
181
|
+
* re-reduction over the matching records — but since #1341 that record
|
|
182
|
+
* set is itself maintained per delta rather than re-scanned, so the cost
|
|
183
|
+
* is O(matches) rather than O(collection). Reducer-level `remove()`
|
|
184
|
+
* (O(1) per delta for sum/count/avg) remains unwired; see the file
|
|
185
|
+
* docstring for why folding beats inverting here.
|
|
155
186
|
*/
|
|
156
187
|
live(): LiveReduction<R>;
|
|
157
188
|
}
|