@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,456 @@
|
|
|
1
|
+
import {
|
|
2
|
+
distinctKeyOf
|
|
3
|
+
} from "./chunk-SUZKW6UR.js";
|
|
4
|
+
import {
|
|
5
|
+
readPath
|
|
6
|
+
} from "./chunk-5WWDGFOS.js";
|
|
7
|
+
|
|
8
|
+
// src/with-lookup/reduce/reducers.ts
|
|
9
|
+
function count(opts) {
|
|
10
|
+
const _seed = opts?.seed;
|
|
11
|
+
void _seed;
|
|
12
|
+
return {
|
|
13
|
+
op: "count",
|
|
14
|
+
init: () => 0,
|
|
15
|
+
step: (state) => state + 1,
|
|
16
|
+
remove: (state) => state - 1,
|
|
17
|
+
finalize: (state) => state,
|
|
18
|
+
merge: (a, b) => a + b
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function countDistinct(field, opts) {
|
|
22
|
+
const _seed = opts?.seed;
|
|
23
|
+
void _seed;
|
|
24
|
+
const via = opts?.canonicalize;
|
|
25
|
+
const keyOf = (record) => distinctKeyOf(field, readPath(record, field), via);
|
|
26
|
+
return {
|
|
27
|
+
op: "countDistinct",
|
|
28
|
+
field,
|
|
29
|
+
init: () => ({ counts: /* @__PURE__ */ new Map() }),
|
|
30
|
+
step: (state, record) => {
|
|
31
|
+
const key = keyOf(record);
|
|
32
|
+
if (key === void 0) return state;
|
|
33
|
+
const counts = new Map(state.counts);
|
|
34
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
35
|
+
return { counts };
|
|
36
|
+
},
|
|
37
|
+
remove: (state, record) => {
|
|
38
|
+
const key = keyOf(record);
|
|
39
|
+
if (key === void 0) return state;
|
|
40
|
+
const current = state.counts.get(key);
|
|
41
|
+
if (current === void 0) return state;
|
|
42
|
+
const counts = new Map(state.counts);
|
|
43
|
+
if (current <= 1) counts.delete(key);
|
|
44
|
+
else counts.set(key, current - 1);
|
|
45
|
+
return { counts };
|
|
46
|
+
},
|
|
47
|
+
finalize: (state) => state.counts.size,
|
|
48
|
+
merge: (a, b) => {
|
|
49
|
+
const counts = new Map(a.counts);
|
|
50
|
+
for (const [k, n] of b.counts) counts.set(k, (counts.get(k) ?? 0) + n);
|
|
51
|
+
return { counts };
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function bindDistinctReducers(spec, via) {
|
|
56
|
+
if (!via) return spec;
|
|
57
|
+
const entries = Object.entries(spec);
|
|
58
|
+
let changed = false;
|
|
59
|
+
const out = {};
|
|
60
|
+
for (const [key, reducer] of entries) {
|
|
61
|
+
if (reducer?.op === "countDistinct" && typeof reducer.field === "string") {
|
|
62
|
+
out[key] = countDistinct(reducer.field, { canonicalize: via });
|
|
63
|
+
changed = true;
|
|
64
|
+
} else {
|
|
65
|
+
out[key] = reducer;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return changed ? out : spec;
|
|
69
|
+
}
|
|
70
|
+
function sum(field, opts) {
|
|
71
|
+
const _seed = opts?.seed;
|
|
72
|
+
void _seed;
|
|
73
|
+
return {
|
|
74
|
+
op: "sum",
|
|
75
|
+
field,
|
|
76
|
+
// Money-only metadata, read by `wrapMoneyReducers`. No effect on a
|
|
77
|
+
// generic numeric sum.
|
|
78
|
+
...opts?.convertTo !== void 0 ? { convertTo: opts.convertTo } : {},
|
|
79
|
+
...opts?.fx !== void 0 ? { fx: opts.fx } : {},
|
|
80
|
+
init: () => 0,
|
|
81
|
+
step: (state, record) => state + readNumber(record, field),
|
|
82
|
+
remove: (state, record) => state - readNumber(record, field),
|
|
83
|
+
finalize: (state) => state,
|
|
84
|
+
merge: (a, b) => a + b
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function avg(field, opts) {
|
|
88
|
+
const _seed = opts?.seed;
|
|
89
|
+
void _seed;
|
|
90
|
+
return {
|
|
91
|
+
op: "avg",
|
|
92
|
+
field,
|
|
93
|
+
init: () => ({ sum: 0, count: 0 }),
|
|
94
|
+
step: (state, record) => ({
|
|
95
|
+
sum: state.sum + readNumber(record, field),
|
|
96
|
+
count: state.count + 1
|
|
97
|
+
}),
|
|
98
|
+
remove: (state, record) => ({
|
|
99
|
+
sum: state.sum - readNumber(record, field),
|
|
100
|
+
count: state.count - 1
|
|
101
|
+
}),
|
|
102
|
+
finalize: (state) => state.count === 0 ? null : state.sum / state.count,
|
|
103
|
+
merge: (a, b) => ({ sum: a.sum + b.sum, count: a.count + b.count })
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function pushValue(state, value) {
|
|
107
|
+
return { values: [...state.values, value] };
|
|
108
|
+
}
|
|
109
|
+
function removeValue(state, value) {
|
|
110
|
+
const idx = state.values.indexOf(value);
|
|
111
|
+
if (idx < 0) return state;
|
|
112
|
+
const next = state.values.slice();
|
|
113
|
+
next.splice(idx, 1);
|
|
114
|
+
return { values: next };
|
|
115
|
+
}
|
|
116
|
+
function min(field, opts) {
|
|
117
|
+
const _seed = opts?.seed;
|
|
118
|
+
void _seed;
|
|
119
|
+
return {
|
|
120
|
+
op: "min",
|
|
121
|
+
field,
|
|
122
|
+
init: () => ({ values: [] }),
|
|
123
|
+
step: (state, record) => pushValue(state, readNumber(record, field)),
|
|
124
|
+
remove: (state, record) => removeValue(state, readNumber(record, field)),
|
|
125
|
+
finalize: (state) => {
|
|
126
|
+
if (state.values.length === 0) return null;
|
|
127
|
+
let out = state.values[0];
|
|
128
|
+
for (let i = 1; i < state.values.length; i++) {
|
|
129
|
+
const v = state.values[i];
|
|
130
|
+
if (v < out) out = v;
|
|
131
|
+
}
|
|
132
|
+
return out;
|
|
133
|
+
},
|
|
134
|
+
merge: (a, b) => ({ values: [...a.values, ...b.values] })
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function max(field, opts) {
|
|
138
|
+
const _seed = opts?.seed;
|
|
139
|
+
void _seed;
|
|
140
|
+
return {
|
|
141
|
+
op: "max",
|
|
142
|
+
field,
|
|
143
|
+
init: () => ({ values: [] }),
|
|
144
|
+
step: (state, record) => pushValue(state, readNumber(record, field)),
|
|
145
|
+
remove: (state, record) => removeValue(state, readNumber(record, field)),
|
|
146
|
+
finalize: (state) => {
|
|
147
|
+
if (state.values.length === 0) return null;
|
|
148
|
+
let out = state.values[0];
|
|
149
|
+
for (let i = 1; i < state.values.length; i++) {
|
|
150
|
+
const v = state.values[i];
|
|
151
|
+
if (v > out) out = v;
|
|
152
|
+
}
|
|
153
|
+
return out;
|
|
154
|
+
},
|
|
155
|
+
merge: (a, b) => ({ values: [...a.values, ...b.values] })
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function welfordReducer(op, field, population) {
|
|
159
|
+
return {
|
|
160
|
+
op,
|
|
161
|
+
field,
|
|
162
|
+
init: () => ({ n: 0, mean: 0, m2: 0 }),
|
|
163
|
+
step: (state, record) => {
|
|
164
|
+
const x = readNumber(record, field);
|
|
165
|
+
const n = state.n + 1;
|
|
166
|
+
const delta = x - state.mean;
|
|
167
|
+
const mean = state.mean + delta / n;
|
|
168
|
+
return { n, mean, m2: state.m2 + delta * (x - mean) };
|
|
169
|
+
},
|
|
170
|
+
remove: (state, record) => {
|
|
171
|
+
const x = readNumber(record, field);
|
|
172
|
+
const n = state.n - 1;
|
|
173
|
+
if (n <= 0) return { n: 0, mean: 0, m2: 0 };
|
|
174
|
+
const mean = (state.mean * state.n - x) / n;
|
|
175
|
+
return { n, mean, m2: state.m2 - (x - state.mean) * (x - mean) };
|
|
176
|
+
},
|
|
177
|
+
// Chan et al.'s parallel combination — the reason a reduction can be
|
|
178
|
+
// sharded and rolled up without re-reading the leaves.
|
|
179
|
+
merge: (a, b) => {
|
|
180
|
+
if (a.n === 0) return b;
|
|
181
|
+
if (b.n === 0) return a;
|
|
182
|
+
const n = a.n + b.n;
|
|
183
|
+
const delta = b.mean - a.mean;
|
|
184
|
+
return {
|
|
185
|
+
n,
|
|
186
|
+
mean: a.mean + delta * b.n / n,
|
|
187
|
+
m2: a.m2 + b.m2 + delta * delta * a.n * b.n / n
|
|
188
|
+
};
|
|
189
|
+
},
|
|
190
|
+
finalize: (state) => {
|
|
191
|
+
const divisor = population ? state.n : state.n - 1;
|
|
192
|
+
if (divisor <= 0) return null;
|
|
193
|
+
const v = state.m2 / divisor;
|
|
194
|
+
return op === "stddev" ? Math.sqrt(v) : v;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function variance(field, opts) {
|
|
199
|
+
const _seed = opts?.seed;
|
|
200
|
+
void _seed;
|
|
201
|
+
return welfordReducer("variance", field, opts?.population === true);
|
|
202
|
+
}
|
|
203
|
+
function stddev(field, opts) {
|
|
204
|
+
const _seed = opts?.seed;
|
|
205
|
+
void _seed;
|
|
206
|
+
return welfordReducer("stddev", field, opts?.population === true);
|
|
207
|
+
}
|
|
208
|
+
function assertProbability(op, p) {
|
|
209
|
+
if (!Number.isFinite(p) || p < 0 || p > 1) {
|
|
210
|
+
throw new Error(`${op}(): p must be a number between 0 and 1, got ${p}.`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function asExact(state) {
|
|
214
|
+
if (state.kind !== "exact") throw new Error("percentile: expected the exact quantile state");
|
|
215
|
+
return state;
|
|
216
|
+
}
|
|
217
|
+
function asDigest(state) {
|
|
218
|
+
if (state.kind !== "tdigest") throw new Error("percentile: expected the t-digest state");
|
|
219
|
+
return state;
|
|
220
|
+
}
|
|
221
|
+
function quantileOf(values, p) {
|
|
222
|
+
const n = values.length;
|
|
223
|
+
if (n === 0) return null;
|
|
224
|
+
if (n === 1) return values[0];
|
|
225
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
226
|
+
const x = p * (n - 1);
|
|
227
|
+
const lo = Math.floor(x);
|
|
228
|
+
const frac = x - lo;
|
|
229
|
+
if (frac === 0) return sorted[lo];
|
|
230
|
+
return sorted[lo] + (sorted[lo + 1] - sorted[lo]) * frac;
|
|
231
|
+
}
|
|
232
|
+
var TDIGEST_COMPRESSION = 100;
|
|
233
|
+
var TDIGEST_BUFFER = 256;
|
|
234
|
+
function tdigestFlush(state, force = false) {
|
|
235
|
+
if (state.buffer.length === 0 && !force) return;
|
|
236
|
+
const all = state.centroids.concat(state.buffer.map((mean) => ({ mean, count: 1 })));
|
|
237
|
+
state.buffer = [];
|
|
238
|
+
if (all.length === 0) return;
|
|
239
|
+
all.sort((a, b) => a.mean - b.mean);
|
|
240
|
+
const total = state.n;
|
|
241
|
+
const out = [];
|
|
242
|
+
let curMean = all[0].mean;
|
|
243
|
+
let curCount = all[0].count;
|
|
244
|
+
let before = 0;
|
|
245
|
+
for (let i = 1; i < all.length; i++) {
|
|
246
|
+
const c = all[i];
|
|
247
|
+
const q = (before + curCount + c.count / 2) / total;
|
|
248
|
+
const limit = 4 * total * q * (1 - q) / TDIGEST_COMPRESSION;
|
|
249
|
+
if (curCount + c.count <= Math.max(limit, 1)) {
|
|
250
|
+
const count2 = curCount + c.count;
|
|
251
|
+
curMean = curMean + (c.mean - curMean) * c.count / count2;
|
|
252
|
+
curCount = count2;
|
|
253
|
+
} else {
|
|
254
|
+
out.push({ mean: curMean, count: curCount });
|
|
255
|
+
before += curCount;
|
|
256
|
+
curMean = c.mean;
|
|
257
|
+
curCount = c.count;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
out.push({ mean: curMean, count: curCount });
|
|
261
|
+
state.centroids = out;
|
|
262
|
+
}
|
|
263
|
+
function tdigestQuantile(state, p) {
|
|
264
|
+
tdigestFlush(state);
|
|
265
|
+
const cs = state.centroids;
|
|
266
|
+
if (cs.length === 0) return null;
|
|
267
|
+
if (cs.length === 1) return cs[0].mean;
|
|
268
|
+
const centres = [];
|
|
269
|
+
let acc = 0;
|
|
270
|
+
for (const c of cs) {
|
|
271
|
+
centres.push(acc + (c.count - 1) / 2);
|
|
272
|
+
acc += c.count;
|
|
273
|
+
}
|
|
274
|
+
const target = p * (state.n - 1);
|
|
275
|
+
const last = cs.length - 1;
|
|
276
|
+
if (target <= centres[0]) return cs[0].mean;
|
|
277
|
+
if (target >= centres[last]) return cs[last].mean;
|
|
278
|
+
for (let i = 0; i < last; i++) {
|
|
279
|
+
const a = centres[i];
|
|
280
|
+
const b = centres[i + 1];
|
|
281
|
+
if (target <= b) {
|
|
282
|
+
const t = b === a ? 0 : (target - a) / (b - a);
|
|
283
|
+
return cs[i].mean + (cs[i + 1].mean - cs[i].mean) * t;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return cs[last].mean;
|
|
287
|
+
}
|
|
288
|
+
function exactQuantileReducer(op, field, p) {
|
|
289
|
+
return {
|
|
290
|
+
op,
|
|
291
|
+
field,
|
|
292
|
+
p,
|
|
293
|
+
init: () => ({ kind: "exact", values: [] }),
|
|
294
|
+
step: (state, record) => {
|
|
295
|
+
asExact(state).values.push(readNumber(record, field));
|
|
296
|
+
return state;
|
|
297
|
+
},
|
|
298
|
+
remove: (state, record) => {
|
|
299
|
+
const values = asExact(state).values;
|
|
300
|
+
const idx = values.indexOf(readNumber(record, field));
|
|
301
|
+
if (idx >= 0) values.splice(idx, 1);
|
|
302
|
+
return state;
|
|
303
|
+
},
|
|
304
|
+
merge: (a, b) => ({ kind: "exact", values: [...asExact(a).values, ...asExact(b).values] }),
|
|
305
|
+
finalize: (state) => quantileOf(asExact(state).values, p)
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
function approxQuantileReducer(field, p) {
|
|
309
|
+
return {
|
|
310
|
+
op: "percentile",
|
|
311
|
+
field,
|
|
312
|
+
p,
|
|
313
|
+
approx: true,
|
|
314
|
+
init: () => ({ kind: "tdigest", centroids: [], buffer: [], n: 0 }),
|
|
315
|
+
step: (state, record) => {
|
|
316
|
+
const d = asDigest(state);
|
|
317
|
+
d.buffer.push(readNumber(record, field));
|
|
318
|
+
d.n += 1;
|
|
319
|
+
if (d.buffer.length >= TDIGEST_BUFFER) tdigestFlush(d);
|
|
320
|
+
return state;
|
|
321
|
+
},
|
|
322
|
+
// No `remove`: a centroid has forgotten which values it absorbed, so an
|
|
323
|
+
// un-fold is not expressible. Deliberate, and asserted by a test.
|
|
324
|
+
merge: (a, b) => {
|
|
325
|
+
const A = asDigest(a);
|
|
326
|
+
const B = asDigest(b);
|
|
327
|
+
const s = {
|
|
328
|
+
kind: "tdigest",
|
|
329
|
+
centroids: [...A.centroids, ...B.centroids],
|
|
330
|
+
buffer: [...A.buffer, ...B.buffer],
|
|
331
|
+
n: A.n + B.n
|
|
332
|
+
};
|
|
333
|
+
tdigestFlush(s, true);
|
|
334
|
+
return s;
|
|
335
|
+
},
|
|
336
|
+
finalize: (state) => tdigestQuantile(asDigest(state), p)
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
function median(field, opts) {
|
|
340
|
+
const _seed = opts?.seed;
|
|
341
|
+
void _seed;
|
|
342
|
+
return exactQuantileReducer("median", field, 0.5);
|
|
343
|
+
}
|
|
344
|
+
function percentile(field, p, opts) {
|
|
345
|
+
assertProbability("percentile", p);
|
|
346
|
+
const _seed = opts?.seed;
|
|
347
|
+
void _seed;
|
|
348
|
+
return opts?.approx === true ? approxQuantileReducer(field, p) : exactQuantileReducer("percentile", field, p);
|
|
349
|
+
}
|
|
350
|
+
function mode(field, opts) {
|
|
351
|
+
const _seed = opts?.seed;
|
|
352
|
+
void _seed;
|
|
353
|
+
return {
|
|
354
|
+
op: "mode",
|
|
355
|
+
field,
|
|
356
|
+
init: () => ({ counts: /* @__PURE__ */ new Map() }),
|
|
357
|
+
step: (state, record) => {
|
|
358
|
+
const v = readNumber(record, field);
|
|
359
|
+
state.counts.set(v, (state.counts.get(v) ?? 0) + 1);
|
|
360
|
+
return state;
|
|
361
|
+
},
|
|
362
|
+
remove: (state, record) => {
|
|
363
|
+
const v = readNumber(record, field);
|
|
364
|
+
const current = state.counts.get(v);
|
|
365
|
+
if (current === void 0) return state;
|
|
366
|
+
if (current <= 1) state.counts.delete(v);
|
|
367
|
+
else state.counts.set(v, current - 1);
|
|
368
|
+
return state;
|
|
369
|
+
},
|
|
370
|
+
merge: (a, b) => {
|
|
371
|
+
const counts = new Map(a.counts);
|
|
372
|
+
for (const [v, c] of b.counts) counts.set(v, (counts.get(v) ?? 0) + c);
|
|
373
|
+
return { counts };
|
|
374
|
+
},
|
|
375
|
+
finalize: (state) => {
|
|
376
|
+
let best = null;
|
|
377
|
+
let bestCount = 0;
|
|
378
|
+
for (const [v, c] of state.counts) {
|
|
379
|
+
if (c > bestCount || c === bestCount && best !== null && v < best) {
|
|
380
|
+
best = v;
|
|
381
|
+
bestCount = c;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return best;
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
function moneySum(field, opts) {
|
|
389
|
+
return sum(field, opts);
|
|
390
|
+
}
|
|
391
|
+
function moneyMin(field, opts) {
|
|
392
|
+
return min(field, opts);
|
|
393
|
+
}
|
|
394
|
+
function moneyMax(field, opts) {
|
|
395
|
+
return max(field, opts);
|
|
396
|
+
}
|
|
397
|
+
function moneyMedian(field, opts) {
|
|
398
|
+
return median(field, opts);
|
|
399
|
+
}
|
|
400
|
+
function moneyPercentile(field, p, opts) {
|
|
401
|
+
return percentile(field, p, opts);
|
|
402
|
+
}
|
|
403
|
+
var reducerBuilder = {
|
|
404
|
+
count,
|
|
405
|
+
countDistinct,
|
|
406
|
+
// The generic F parameter on sum/min/max in the interface is type-only; the
|
|
407
|
+
// standalone factories are plain `(field: string)` functions. With M=never the
|
|
408
|
+
// conditional return collapses to the numeric branch, matching the factories'
|
|
409
|
+
// return type, but TypeScript cannot verify that collapse for a generic method
|
|
410
|
+
// signature — so each factory is cast directly to the method's type.
|
|
411
|
+
sum,
|
|
412
|
+
avg,
|
|
413
|
+
min,
|
|
414
|
+
max,
|
|
415
|
+
median,
|
|
416
|
+
percentile,
|
|
417
|
+
variance,
|
|
418
|
+
stddev,
|
|
419
|
+
mode,
|
|
420
|
+
moneySum,
|
|
421
|
+
moneyMin,
|
|
422
|
+
moneyMax,
|
|
423
|
+
moneyMedian,
|
|
424
|
+
moneyPercentile
|
|
425
|
+
};
|
|
426
|
+
function readNumber(record, field) {
|
|
427
|
+
const value = readPath(record, field);
|
|
428
|
+
if (typeof value === "object" && value !== null && "amount" in value && "currency" in value) {
|
|
429
|
+
throw new Error(
|
|
430
|
+
`aggregate: field "${field}" holds a money value but was not money-aware \u2014 declare it in the collection's moneyFields so sum/min/max stay exact`
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export {
|
|
437
|
+
count,
|
|
438
|
+
countDistinct,
|
|
439
|
+
bindDistinctReducers,
|
|
440
|
+
sum,
|
|
441
|
+
avg,
|
|
442
|
+
min,
|
|
443
|
+
max,
|
|
444
|
+
variance,
|
|
445
|
+
stddev,
|
|
446
|
+
median,
|
|
447
|
+
percentile,
|
|
448
|
+
mode,
|
|
449
|
+
moneySum,
|
|
450
|
+
moneyMin,
|
|
451
|
+
moneyMax,
|
|
452
|
+
moneyMedian,
|
|
453
|
+
moneyPercentile,
|
|
454
|
+
reducerBuilder
|
|
455
|
+
};
|
|
456
|
+
//# sourceMappingURL=chunk-MBMTND6D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-lookup/reduce/reducers.ts"],"sourcesContent":["/**\n * Reduction reducers for the query DSL.\n *\n * the reducer protocol plus five built-in factories\n * (`count`, `sum`, `avg`, `min`, `max`) consumed by `Query.aggregate()`\n * and, in the future, `Scan.aggregate()`. Every factory accepts\n * an optional `{ seed }` parameter that is plumbed through the\n * protocol but unused by the executor — that's the load-bearing\n * half of constraint #2. When partition-aware reduction\n * lands, the seed carries the previous partition's running total into\n * the next partition without requiring a protocol change.\n *\n * Reducers are intentionally generic over their internal state type\n * `S` so compound reducers (avg keeps `{sum, count}`, min/max keep a\n * value bag) can model internal bookkeeping without leaking the\n * implementation through the accumulator's public shape. `finalize`\n * collapses `S` back into the user-visible `R`.\n *\n * Reducers are pure data — `init` / `step` / `finalize` / optional\n * `remove` are stateless functions that receive and return `S`. This\n * is the shape that admits O(1) incremental maintenance in a future\n * optimization (delta-aware `LiveReduction` applies `step` or\n * `remove` per delta), without blocking the simpler \"full re-run on\n * source change\" that ships.\n */\n\nimport { readPath } from '../../kernel/query/predicate.js'\nimport { distinctKeyOf, type BucketKeyCanonicalizer } from '../../kernel/query/distinct-key.js'\nimport type { MoneyString } from '../../via/money/branded.js'\nimport type { QueryField } from '../../kernel/types.js'\n\n/**\n * A single reducer: factory-produced, ready to plug into an\n * `.aggregate()` spec.\n *\n * Type parameters:\n * - `R` — user-visible result type (what the reduction returns\n * for this slot, e.g. `number` for `sum()`)\n * - `S` — internal state type, defaults to `R` for simple reducers\n * that don't need compound bookkeeping\n *\n * A reducer is stateless: every method is pure over `S`. `init()` is\n * called once per reduction run to build the initial state; `step()`\n * folds a record into the state; `remove()` (optional) un-folds a\n * record, enabling incremental live maintenance; `finalize()` reads\n * the final answer out of the state at the end of the run.\n */\nexport interface Reducer<R, S = R> {\n /** Build the initial state for a fresh reduction run. */\n init(): S\n /** Fold a record into the state. Returns the new state. */\n step(state: S, record: unknown): S\n /**\n * Un-fold a record from the state. Returns the new state.\n *\n * Optional — reducers without `remove` cannot be maintained\n * incrementally and must be re-run from scratch when the underlying\n * record set changes. `sum`, `count`, `avg` implement `remove` in\n * O(1); `min` and `max` implement it in O(N) worst case (when the\n * extremum itself is removed and the next extremum must be\n * recomputed from the remaining contributing values).\n */\n remove?(state: S, record: unknown): S\n /** Collapse the internal state into the user-visible result. */\n finalize(state: S): R\n /**\n * Combine two independent partial states into one (then `finalize` once).\n * Optional. MUST be associative + commutative with `init()` as identity.\n * Never merge finalized results — only states. Enables parallel /\n * hierarchical reduction (e.g. cross-shard or advisor→firm rollup).\n */\n merge?(a: S, b: S): S\n /**\n * Identifying operation tag stamped by each built-in factory.\n * Used by `summariseAggregateOp` in the introspection walker to\n * render human-readable aggregate descriptors in `dumpSchema()`.\n * Optional so third-party custom reducers are unaffected.\n */\n readonly op?:\n | 'count'\n | 'countDistinct'\n | 'sum'\n | 'avg'\n | 'min'\n | 'max'\n | 'median'\n | 'percentile'\n | 'variance'\n | 'stddev'\n | 'mode'\n /**\n * Field name for field-based reducers (`sum`, `avg`, `min`, `max`).\n * Absent on `count` which aggregates over record count, not a field.\n */\n readonly field?: string\n /**\n * Money-only: target currency for `sum` over a multi-currency money\n * field. Consumed by `wrapMoneyReducers` to convert per-currency\n * subtotals to one figure. Ignored for non-money fields.\n */\n readonly convertTo?: string\n /**\n * Money-only: FX rate map (`'USD->EUR' → rate`) used with `convertTo`.\n */\n readonly fx?: Record<string, number | string>\n /**\n * Quantile reducers only (#1353): the probability in `[0, 1]`. Carried as\n * metadata so `wrapMoneyReducers` can rebuild the reducer on the exact\n * BigInt path — a rewrite that must reproduce the SAME p, not guess one.\n * `median` stamps `0.5`.\n */\n readonly p?: number\n /**\n * `percentile` only (#1353): `true` when the reducer is the bounded-memory\n * t-digest rather than the exact O(n) one. Read by `wrapMoneyReducers`,\n * which refuses it over a money field — a t-digest is a float structure.\n */\n readonly approx?: boolean\n}\n\n/**\n * Common options accepted by every reducer factory.\n *\n * `seed` — optional initial value for the internal state. **Unused by\n * the executor**, plumbed through the protocol for constraint\n * #2 (partition-aware reduction seam). In, partitioned\n * reductions will pass the previous partition's carry as `seed` so\n * a long time series can be rolled forward one partition at a time\n * without re-reducing closed partitions.\n *\n * always uses `init()` with the factory's zero value, regardless\n * of whether `seed` was passed. Do not remove the parameter — that's\n * the whole point of having it exist now.\n */\nexport interface ReducerOptions<TSeed = unknown> {\n /** constraint #2 — seed is plumbed through but unused in. */\n readonly seed?: TSeed\n /**\n * Money-only (honored by `sum` over a multi-currency money field):\n * convert per-currency subtotals to this currency for a single figure.\n */\n readonly convertTo?: string\n /** Money-only: FX rate map (`'USD->EUR' → rate`) used with `convertTo`. */\n readonly fx?: Record<string, number | string>\n}\n\n// ---------------------------------------------------------------------------\n// Factories\n// ---------------------------------------------------------------------------\n\n/**\n * Count the number of records that match the query. Ignores field\n * values entirely — the count is over the number of records, not over\n * the number of non-null field values in any column.\n */\nexport function count(opts?: ReducerOptions<number>): Reducer<number> {\n // Seed captured on the closure but unused at execution time in\n //. The reference in _seed keeps lint happy.\n const _seed = opts?.seed\n void _seed\n return {\n op: 'count',\n init: () => 0,\n step: (state) => state + 1,\n remove: (state) => state - 1,\n finalize: (state) => state,\n merge: (a, b) => a + b,\n }\n}\n\n/**\n * Multiset state behind {@link countDistinct}: canonical distinct key →\n * how many records currently contribute it. The COUNT, not a bare Set, is\n * what makes `remove()` correct — dropping one of three records holding\n * `'c1'` must not drop `'c1'` from the distinct set.\n */\nexport interface CountDistinctState {\n readonly counts: ReadonlyMap<string, number>\n}\n\n/**\n * Number of DISTINCT non-nullish values of `field` across matching records\n * (#1347) — `COUNT(DISTINCT field)`.\n *\n * Distinctness is decided on the canonical index key, not on the stored\n * string and not on any formatted rendering, so a money field's `'0100'` and\n * `'100'` count once; see `kernel/query/distinct-key.ts` for why, and for why\n * nullish values are excluded rather than counted as a value of their own.\n *\n * The canonicalizer is bound LATE, by {@link bindDistinctReducers}, at the\n * same two points `wrapReducers` runs — a bare `countDistinct('amount')` in a\n * spec has no way to know which collection it will be reduced against, so a\n * constructor argument would be a footgun. Unbound, it falls back to the raw\n * stringified key, which is exactly what a non-Via field wants.\n *\n * Incremental complexity: O(1) `step` and `remove`, O(1) `finalize`.\n */\nexport function countDistinct(\n field: string,\n opts?: ReducerOptions<number> & { readonly canonicalize?: BucketKeyCanonicalizer },\n): Reducer<number, CountDistinctState> {\n const _seed = opts?.seed\n void _seed\n const via = opts?.canonicalize\n const keyOf = (record: unknown): string | undefined =>\n distinctKeyOf(field, readPath(record, field), via)\n return {\n op: 'countDistinct',\n field,\n init: () => ({ counts: new Map() }),\n step: (state, record) => {\n const key = keyOf(record)\n if (key === undefined) return state\n const counts = new Map(state.counts)\n counts.set(key, (counts.get(key) ?? 0) + 1)\n return { counts }\n },\n remove: (state, record) => {\n const key = keyOf(record)\n if (key === undefined) return state\n const current = state.counts.get(key)\n if (current === undefined) return state\n const counts = new Map(state.counts)\n if (current <= 1) counts.delete(key)\n else counts.set(key, current - 1)\n return { counts }\n },\n finalize: (state) => state.counts.size,\n merge: (a, b) => {\n const counts = new Map(a.counts)\n for (const [k, n] of b.counts) counts.set(k, (counts.get(k) ?? 0) + n)\n return { counts }\n },\n }\n}\n\n/**\n * Rebind every `countDistinct` reducer in a spec to a Via canonicalizer.\n *\n * Called wherever `ViaPipeline.wrapReducers` is called — the two are the same\n * seam, kept separate only because `wrapReducers` folds over BINDINGS (money\n * rewriting its own `sum`) while this one is brand-agnostic: any binding that\n * canonicalizes an index key canonicalizes a distinct key, by definition.\n *\n * Returns the spec unchanged when there is nothing to bind, so the common\n * path allocates nothing.\n */\nexport function bindDistinctReducers<Spec>(spec: Spec, via: BucketKeyCanonicalizer | undefined): Spec {\n if (!via) return spec\n const entries = Object.entries(spec as Record<string, Reducer<unknown, unknown>>)\n let changed = false\n const out: Record<string, unknown> = {}\n for (const [key, reducer] of entries) {\n if (reducer?.op === 'countDistinct' && typeof reducer.field === 'string') {\n out[key] = countDistinct(reducer.field, { canonicalize: via })\n changed = true\n } else {\n out[key] = reducer\n }\n }\n return changed ? (out as Spec) : spec\n}\n\n/**\n * Sum a numeric field across all matching records. Non-number values\n * at the field path are coerced to 0 — consumers who want a different\n * behavior (throw, skip, treat as NaN) should filter upstream via\n * `.where()` or write a custom reducer.\n *\n * KNOWN LIMITATION (type imprecision): the declared result type is `number`,\n * but when `field` is a **money** field the runtime returns a decimal *string*\n * (e.g. `'0.30'`, or `{ EUR: '0.30' }` in multi-currency mode) — money sums are\n * BigInt-exact in scaled space and never collapse to a float. The `number` type\n * is therefore a lie for money fields; narrow the result yourself at the call\n * site. A precise fix requires threading money-field declarations into the type\n * system (tracked separately).\n */\nexport function sum(\n field: string,\n opts?: ReducerOptions<number>,\n): Reducer<number> {\n const _seed = opts?.seed\n void _seed\n return {\n op: 'sum',\n field,\n // Money-only metadata, read by `wrapMoneyReducers`. No effect on a\n // generic numeric sum.\n ...(opts?.convertTo !== undefined ? { convertTo: opts.convertTo } : {}),\n ...(opts?.fx !== undefined ? { fx: opts.fx } : {}),\n init: () => 0,\n step: (state, record) => state + readNumber(record, field),\n remove: (state, record) => state - readNumber(record, field),\n finalize: (state) => state,\n merge: (a, b) => a + b,\n }\n}\n\n/**\n * Arithmetic mean of a numeric field across all matching records.\n *\n * Returns `null` for an empty result set (zero records is not a\n * well-defined denominator — returning NaN would poison downstream\n * arithmetic, and throwing would force every consumer to wrap in\n * try/catch just to handle \"no matches\"). Consumers who want an\n * explicit zero should coalesce with `?? 0`.\n *\n * Internal state is `{sum, count}` so the running average can be\n * maintained incrementally — on each delta, both fields update in\n * O(1) and `finalize` divides. Directly storing `avg` as state would\n * not admit incremental removal without also tracking count.\n */\nexport function avg(\n field: string,\n opts?: ReducerOptions<{ sum: number; count: number }>,\n): Reducer<number | null, { sum: number; count: number }> {\n const _seed = opts?.seed\n void _seed\n return {\n op: 'avg',\n field,\n init: () => ({ sum: 0, count: 0 }),\n step: (state, record) => ({\n sum: state.sum + readNumber(record, field),\n count: state.count + 1,\n }),\n remove: (state, record) => ({\n sum: state.sum - readNumber(record, field),\n count: state.count - 1,\n }),\n finalize: (state) => (state.count === 0 ? null : state.sum / state.count),\n merge: (a, b) => ({ sum: a.sum + b.sum, count: a.count + b.count }),\n }\n}\n\nexport interface MinMaxState {\n /**\n * Multiset of contributing field values. Stored as a plain array\n * because we need to support `remove` and a plain array gives us\n * O(1) push + O(N) worst-case removal — which matches the\n * documented min/max removal complexity. A sorted structure would\n * let us drop the O(N) rescan but adds complexity that doesn't\n * need; consumers hitting the O(N) ceiling should file an issue.\n */\n readonly values: number[]\n}\n\nfunction pushValue(state: MinMaxState, value: number): MinMaxState {\n return { values: [...state.values, value] }\n}\n\nfunction removeValue(state: MinMaxState, value: number): MinMaxState {\n // Remove the first matching value — duplicates are fine, we only\n // need to drop one instance per `remove()` call so the multiset\n // count stays consistent with the record count.\n const idx = state.values.indexOf(value)\n if (idx < 0) return state\n const next = state.values.slice()\n next.splice(idx, 1)\n return { values: next }\n}\n\n/**\n * Smallest numeric value of a field across all matching records.\n * Returns `null` for an empty result set. See `avg()` for the\n * reasoning on `null` vs NaN vs throwing.\n *\n * Incremental complexity: O(1) for `step`, O(N) worst case for\n * `remove` when the current minimum is removed (the state holds the\n * full multiset of contributing values and `finalize` scans for the\n * new minimum). Consumers with very large result sets and frequent\n * removals of the current extremum should either accept the cost or\n * wait for a future optimization.\n */\nexport function min(\n field: string,\n opts?: ReducerOptions<number>,\n): Reducer<number | null, MinMaxState> {\n const _seed = opts?.seed\n void _seed\n return {\n op: 'min',\n field,\n init: () => ({ values: [] }),\n step: (state, record) => pushValue(state, readNumber(record, field)),\n remove: (state, record) => removeValue(state, readNumber(record, field)),\n finalize: (state) => {\n if (state.values.length === 0) return null\n let out = state.values[0]!\n for (let i = 1; i < state.values.length; i++) {\n const v = state.values[i]!\n if (v < out) out = v\n }\n return out\n },\n merge: (a, b) => ({ values: [...a.values, ...b.values] }),\n }\n}\n\n/**\n * Largest numeric value of a field across all matching records.\n * Mirror of `min()` — see that doc for semantics, null-on-empty\n * behavior, and the O(N) removal caveat.\n */\nexport function max(\n field: string,\n opts?: ReducerOptions<number>,\n): Reducer<number | null, MinMaxState> {\n const _seed = opts?.seed\n void _seed\n return {\n op: 'max',\n field,\n init: () => ({ values: [] }),\n step: (state, record) => pushValue(state, readNumber(record, field)),\n remove: (state, record) => removeValue(state, readNumber(record, field)),\n finalize: (state) => {\n if (state.values.length === 0) return null\n let out = state.values[0]!\n for (let i = 1; i < state.values.length; i++) {\n const v = state.values[i]!\n if (v > out) out = v\n }\n return out\n },\n merge: (a, b) => ({ values: [...a.values, ...b.values] }),\n }\n}\n\n// ---------------------------------------------------------------------------\n// Statistical reducers (#1353)\n// ---------------------------------------------------------------------------\n\n/**\n * ⚠️ MEMORY, stated once for the whole section.\n *\n * `variance` / `stddev` are **streaming** — three numbers of state regardless\n * of how many records pass through, so they are free in a `.groupBy()` and\n * free as a running window aggregate (#1349).\n *\n * `median`, `percentile` (exact) and `mode` are **O(n) per group**: the first\n * two keep every contributing value, `mode` keeps one entry per distinct value.\n * Multiplied by the `GROUPBY_MAX_CARDINALITY` ceiling (100,000 groups) that is\n * the one place in the reduce vocabulary where a legal query can exhaust\n * memory, so it is not \"free like `sum`\". Two ways out, in order of preference:\n * narrow with `.where()` before grouping, or pass\n * `percentile(field, p, { approx: true })` for the bounded-memory t-digest —\n * O(compression) state per group instead of O(n), at a small, measured error.\n *\n * Unlike `count` / `sum` / `min` / `max`, whose states are copied on every\n * `step`, the reducers in this section MUTATE their state in place and return\n * it (the shape `via/money/money-reducer.ts` already uses). Copy-on-write here\n * would make a median over a group quadratic in the group size, which is a\n * worse bug than the inconsistency. States are built fresh by `init()` on every\n * reduction run and never shared, so the mutation is not observable — except\n * through `merge`, which therefore always returns a NEW state.\n */\n\n/**\n * Welford state behind {@link variance} and {@link stddev}.\n *\n * `m2` is the running sum of squared deviations **from the running mean**, not\n * a sum of squares — that is the entire point. The textbook one-pass identity\n * `(Σx² − (Σx)²/n)` subtracts two enormous nearly-equal numbers, and on an\n * accounting column (invoice totals clustered around a large figure) the\n * cancellation eats every significant digit: four totals just over 1e9 with a\n * true sample variance of 30 come back as **−170.67**, so `stddev` is `NaN`.\n * Welford never forms the large intermediate.\n */\nexport interface WelfordState {\n /** Number of contributing records. */\n readonly n: number\n /** Running arithmetic mean. */\n readonly mean: number\n /** Running sum of squared deviations from `mean`. */\n readonly m2: number\n}\n\n/** Options for {@link variance} / {@link stddev}. */\nexport interface DispersionOptions extends ReducerOptions<WelfordState> {\n /**\n * `true` → **population** dispersion (÷ n). Default `false` → **sample**\n * dispersion (÷ n−1), which is Postgres's `var_samp` / `stddev_samp`, the\n * unqualified spelling in every SQL dialect this library is measured\n * against.\n *\n * The divisor is not cosmetic and the wrong one is a silently wrong answer,\n * so the two disagree loudly at n = 1: sample is `null` (n−1 = 0 is not a\n * denominator), population is `0`.\n */\n readonly population?: boolean\n}\n\nfunction welfordReducer(\n op: 'variance' | 'stddev',\n field: string,\n population: boolean,\n): Reducer<number | null, WelfordState> {\n return {\n op,\n field,\n init: () => ({ n: 0, mean: 0, m2: 0 }),\n step: (state, record) => {\n const x = readNumber(record, field)\n const n = state.n + 1\n const delta = x - state.mean\n const mean = state.mean + delta / n\n // (x - mean) uses the UPDATED mean; delta the previous one. Using the\n // same mean twice is the naive formula wearing a Welford costume.\n return { n, mean, m2: state.m2 + delta * (x - mean) }\n },\n remove: (state, record) => {\n const x = readNumber(record, field)\n const n = state.n - 1\n if (n <= 0) return { n: 0, mean: 0, m2: 0 }\n const mean = (state.mean * state.n - x) / n\n return { n, mean, m2: state.m2 - (x - state.mean) * (x - mean) }\n },\n // Chan et al.'s parallel combination — the reason a reduction can be\n // sharded and rolled up without re-reading the leaves.\n merge: (a, b) => {\n if (a.n === 0) return b\n if (b.n === 0) return a\n const n = a.n + b.n\n const delta = b.mean - a.mean\n return {\n n,\n mean: a.mean + (delta * b.n) / n,\n m2: a.m2 + b.m2 + (delta * delta * a.n * b.n) / n,\n }\n },\n finalize: (state) => {\n const divisor = population ? state.n : state.n - 1\n if (divisor <= 0) return null\n const v = state.m2 / divisor\n return op === 'stddev' ? Math.sqrt(v) : v\n },\n }\n}\n\n/**\n * Variance of a numeric field — **sample (n−1) by default**, `{ population:\n * true }` for the n divisor. See {@link DispersionOptions}.\n *\n * Streaming (Welford): O(1) state, O(1) `step`, O(1) `remove`, associative\n * `merge`. Safe as a running window aggregate.\n *\n * `null` for an empty result set, and `null` for a single record in sample\n * mode (population mode returns `0`) — see `avg()` for why null rather than\n * `NaN` or a throw.\n *\n * ⛔ Not available over a declared money field: dispersion is inherently a\n * float computation, so `wrapMoneyReducers` refuses rather than let\n * `readNumber` read a scaled-integer string as `0`.\n */\nexport function variance(field: string, opts?: DispersionOptions): Reducer<number | null, WelfordState> {\n const _seed = opts?.seed\n void _seed\n return welfordReducer('variance', field, opts?.population === true)\n}\n\n/**\n * Standard deviation of a numeric field — the square root of {@link variance},\n * with the same divisor rule, the same empty/single-element answers, the same\n * streaming Welford state, and the same money refusal.\n */\nexport function stddev(field: string, opts?: DispersionOptions): Reducer<number | null, WelfordState> {\n const _seed = opts?.seed\n void _seed\n return welfordReducer('stddev', field, opts?.population === true)\n}\n\n/**\n * Exact quantile state: every contributing value, unsorted (sorting happens\n * once, in `finalize`, on a copy — so a running window aggregate does not\n * disturb the multiset it is still being appended to).\n */\nexport interface ExactQuantileState {\n readonly kind: 'exact'\n readonly values: number[]\n}\n\n/** One t-digest centroid: a weighted summary of `count` nearby values. */\nexport interface Centroid {\n readonly mean: number\n readonly count: number\n}\n\n/**\n * t-digest state: compressed centroids plus a small unmerged buffer.\n *\n * Implemented here rather than taken from npm — `hub/src/**` adds no\n * dependency, and this one is ~60 lines.\n */\nexport interface TDigestState {\n readonly kind: 'tdigest'\n centroids: Centroid[]\n buffer: number[]\n n: number\n}\n\n/** State of {@link median} / {@link percentile}; the arm depends on `approx`. */\nexport type QuantileState = ExactQuantileState | TDigestState\n\n/** Options for {@link percentile}. */\nexport interface PercentileOptions extends ReducerOptions<number> {\n /**\n * `true` → bounded-memory t-digest instead of keeping every value. O(1)-ish\n * state per group, at a small error (under 1% of the value range at every\n * quantile on a 10k uniform scan, exact at p = 0 and p = 1).\n *\n * The trade is real: an approximate reducer cannot `remove()`, so it does\n * not participate in incremental live maintenance, and it is refused over a\n * money field.\n */\n readonly approx?: boolean\n}\n\nfunction assertProbability(op: string, p: number): void {\n if (!Number.isFinite(p) || p < 0 || p > 1) {\n throw new Error(`${op}(): p must be a number between 0 and 1, got ${p}.`)\n }\n}\n\nfunction asExact(state: QuantileState): ExactQuantileState {\n if (state.kind !== 'exact') throw new Error('percentile: expected the exact quantile state')\n return state\n}\n\nfunction asDigest(state: QuantileState): TDigestState {\n if (state.kind !== 'tdigest') throw new Error('percentile: expected the t-digest state')\n return state\n}\n\n/**\n * `percentile_cont` over an in-memory multiset — the INTERPOLATING definition.\n *\n * `x = p * (n − 1)`; when `x` lands between two ranks the answer is the linear\n * blend of the two neighbours. So the median of `[1,2,3,4]` is `2.5`, a value\n * that is not in the input. `percentile_disc` would answer `2`. Postgres names\n * both; this library ships only `_cont`, because it is the one `median` has to\n * agree with — a `median` that returned `2` while `percentile(f, 0.5)`\n * returned `2.5` would be the worse surprise.\n */\nfunction quantileOf(values: readonly number[], p: number): number | null {\n const n = values.length\n if (n === 0) return null\n if (n === 1) return values[0]!\n const sorted = [...values].sort((a, b) => a - b)\n const x = p * (n - 1)\n const lo = Math.floor(x)\n const frac = x - lo\n if (frac === 0) return sorted[lo]!\n return sorted[lo]! + (sorted[lo + 1]! - sorted[lo]!) * frac\n}\n\n/** Centroid budget. Larger ⇒ more accurate and more memory; 100 is the usual default. */\nconst TDIGEST_COMPRESSION = 100\n/** Unmerged values tolerated before a compression pass. */\nconst TDIGEST_BUFFER = 256\n\n/**\n * Fold the buffer into the centroid list and compress.\n *\n * The size rule is the standard one: a centroid sitting at estimated quantile\n * `q` may hold at most `4·n·q·(1−q)/compression` values, which is ~0 at the\n * tails and widest in the middle. That is what keeps p = 0 and p = 1 EXACT\n * (the extreme centroids stay singletons) while the middle compresses hard.\n */\nfunction tdigestFlush(state: TDigestState, force = false): void {\n if (state.buffer.length === 0 && !force) return\n const all: Centroid[] = state.centroids.concat(state.buffer.map((mean) => ({ mean, count: 1 })))\n state.buffer = []\n if (all.length === 0) return\n all.sort((a, b) => a.mean - b.mean)\n const total = state.n\n const out: Centroid[] = []\n let curMean = all[0]!.mean\n let curCount = all[0]!.count\n let before = 0\n for (let i = 1; i < all.length; i++) {\n const c = all[i]!\n const q = (before + curCount + c.count / 2) / total\n const limit = (4 * total * q * (1 - q)) / TDIGEST_COMPRESSION\n if (curCount + c.count <= Math.max(limit, 1)) {\n const count = curCount + c.count\n curMean = curMean + ((c.mean - curMean) * c.count) / count\n curCount = count\n } else {\n out.push({ mean: curMean, count: curCount })\n before += curCount\n curMean = c.mean\n curCount = c.count\n }\n }\n out.push({ mean: curMean, count: curCount })\n state.centroids = out\n}\n\n/**\n * Estimate the `p` quantile off the centroids, interpolating between centroid\n * CENTRES so the answer degrades to `quantileOf` exactly when no compression\n * has happened (every centroid a singleton ⇒ its centre is its rank).\n */\nfunction tdigestQuantile(state: TDigestState, p: number): number | null {\n tdigestFlush(state)\n const cs = state.centroids\n if (cs.length === 0) return null\n if (cs.length === 1) return cs[0]!.mean\n const centres: number[] = []\n let acc = 0\n for (const c of cs) {\n centres.push(acc + (c.count - 1) / 2)\n acc += c.count\n }\n const target = p * (state.n - 1)\n const last = cs.length - 1\n if (target <= centres[0]!) return cs[0]!.mean\n if (target >= centres[last]!) return cs[last]!.mean\n for (let i = 0; i < last; i++) {\n const a = centres[i]!\n const b = centres[i + 1]!\n if (target <= b) {\n const t = b === a ? 0 : (target - a) / (b - a)\n return cs[i]!.mean + (cs[i + 1]!.mean - cs[i]!.mean) * t\n }\n }\n return cs[last]!.mean\n}\n\nfunction exactQuantileReducer(\n op: 'median' | 'percentile',\n field: string,\n p: number,\n): Reducer<number | null, QuantileState> {\n return {\n op,\n field,\n p,\n init: (): QuantileState => ({ kind: 'exact', values: [] }),\n step: (state, record) => {\n asExact(state).values.push(readNumber(record, field))\n return state\n },\n remove: (state, record) => {\n const values = asExact(state).values\n const idx = values.indexOf(readNumber(record, field))\n if (idx >= 0) values.splice(idx, 1)\n return state\n },\n merge: (a, b) => ({ kind: 'exact', values: [...asExact(a).values, ...asExact(b).values] }),\n finalize: (state) => quantileOf(asExact(state).values, p),\n }\n}\n\nfunction approxQuantileReducer(field: string, p: number): Reducer<number | null, QuantileState> {\n return {\n op: 'percentile',\n field,\n p,\n approx: true,\n init: (): QuantileState => ({ kind: 'tdigest', centroids: [], buffer: [], n: 0 }),\n step: (state, record) => {\n const d = asDigest(state)\n d.buffer.push(readNumber(record, field))\n d.n += 1\n if (d.buffer.length >= TDIGEST_BUFFER) tdigestFlush(d)\n return state\n },\n // No `remove`: a centroid has forgotten which values it absorbed, so an\n // un-fold is not expressible. Deliberate, and asserted by a test.\n merge: (a, b) => {\n const A = asDigest(a)\n const B = asDigest(b)\n const s: TDigestState = {\n kind: 'tdigest',\n centroids: [...A.centroids, ...B.centroids],\n buffer: [...A.buffer, ...B.buffer],\n n: A.n + B.n,\n }\n tdigestFlush(s, true)\n return s\n },\n finalize: (state) => tdigestQuantile(asDigest(state), p),\n }\n}\n\n/**\n * Median of a numeric field — exactly `percentile(field, 0.5)`, and therefore\n * **`percentile_cont`**: an even-sized input INTERPOLATES (`[1,2,3,4]` → `2.5`)\n * rather than picking a member. See {@link quantileOf} for why only the\n * interpolating definition ships.\n *\n * `null` on an empty result set. O(n) memory per group — read the memory note\n * at the top of this section before using it under `.groupBy()`.\n *\n * Over a declared money field the reducer is rewritten onto the exact BigInt\n * path; {@link moneyMedian} is the same call with the honest return type.\n */\nexport function median(field: string, opts?: ReducerOptions<number>): Reducer<number | null, QuantileState> {\n const _seed = opts?.seed\n void _seed\n return exactQuantileReducer('median', field, 0.5)\n}\n\n/**\n * The `p` quantile of a numeric field, `p ∈ [0, 1]`, by the **`percentile_cont`\n * (interpolating)** definition — `percentile(f, 0.9)` over `1..10` is `9.1`,\n * not `9`. `p = 0` is the minimum and `p = 1` the maximum, exactly.\n *\n * Throws for a `p` outside `[0, 1]` or a non-finite one, at construction time.\n *\n * Exact by default and O(n) per group; pass `{ approx: true }` for the\n * bounded-memory t-digest (see {@link PercentileOptions}).\n */\nexport function percentile(\n field: string,\n p: number,\n opts?: PercentileOptions,\n): Reducer<number | null, QuantileState> {\n assertProbability('percentile', p)\n const _seed = opts?.seed\n void _seed\n return opts?.approx === true ? approxQuantileReducer(field, p) : exactQuantileReducer('percentile', field, p)\n}\n\n/** Frequency table behind {@link mode}: value → how many records hold it. */\nexport interface ModeState {\n readonly counts: Map<number, number>\n}\n\n/**\n * Most frequent value of a numeric field.\n *\n * **Tie rule: the LOWEST value wins.** Two values with equal frequency is the\n * common case on real data, not an edge case, and the alternatives are worse:\n * \"first seen\" makes the answer depend on store iteration order (so the same\n * query answers differently after a compaction, and `merge` stops being\n * commutative), and \"all of them\" changes the result TYPE based on the data.\n * Lowest-wins is total, order-independent, and mergeable.\n *\n * `null` on an empty result set. O(distinct values) memory per group.\n *\n * ⛔ Numeric only, and not available over a declared money field.\n */\nexport function mode(field: string, opts?: ReducerOptions<number>): Reducer<number | null, ModeState> {\n const _seed = opts?.seed\n void _seed\n return {\n op: 'mode',\n field,\n init: () => ({ counts: new Map<number, number>() }),\n step: (state, record) => {\n const v = readNumber(record, field)\n state.counts.set(v, (state.counts.get(v) ?? 0) + 1)\n return state\n },\n remove: (state, record) => {\n const v = readNumber(record, field)\n const current = state.counts.get(v)\n if (current === undefined) return state\n if (current <= 1) state.counts.delete(v)\n else state.counts.set(v, current - 1)\n return state\n },\n merge: (a, b) => {\n const counts = new Map(a.counts)\n for (const [v, c] of b.counts) counts.set(v, (counts.get(v) ?? 0) + c)\n return { counts }\n },\n finalize: (state) => {\n let best: number | null = null\n let bestCount = 0\n for (const [v, c] of state.counts) {\n if (c > bestCount || (c === bestCount && best !== null && v < best)) {\n best = v\n bestCount = c\n }\n }\n return best\n },\n }\n}\n\n// ---------------------------------------------------------------------------\n// Money-typed reducer constructors\n// ---------------------------------------------------------------------------\n\n/**\n * `sum()` for a **declared money field**, typed to match the runtime.\n *\n * `sum()` returns `Reducer<number>`, but `wrapMoneyReducers` (applied at\n * `query.aggregate()` time, once `moneyFields` is known) rewrites any\n * `sum`/`min`/`max` over a money field to a money reducer that finalizes to a\n * `MoneyString` decimal — so the `number` type is a lie for money fields and\n * consumers need a cast at every read site. `moneySum` is the same reducer with\n * the correct `Reducer<MoneyString>` return type, so no read-site cast is\n * needed. It is the caller's assertion that `field` is a money field; use plain\n * `sum()` for non-money fields. (For a multi-currency money field WITHOUT\n * `convertTo`, the runtime returns a per-currency `Record<string, MoneyString>`\n * rather than a single `MoneyString` — pass `convertTo` to collapse to one\n * currency, or read the map at the boundary.)\n */\nexport function moneySum(field: string, opts?: ReducerOptions<number>): Reducer<MoneyString> {\n // The constructed reducer is the plain numeric `sum`; `wrapMoneyReducers`\n // swaps in the MoneyString-producing money reducer at aggregate() time.\n return sum(field, opts) as unknown as Reducer<MoneyString>\n}\n\n/**\n * `min()` for a declared money field, typed `Reducer<MoneyString | null>`\n * (null on an empty result set in fixed-currency mode, mirroring `min()`). See\n * {@link moneySum} for the late-binding rewrite. Note: `convertTo`/`fx` on\n * `opts` have no effect on min/max (cross-currency min/max is unsupported — use\n * {@link moneySum} for currency conversion). In multi-currency mode the runtime\n * returns a per-currency map and an empty result is `{}` rather than `null`.\n */\nexport function moneyMin(field: string, opts?: ReducerOptions<number>): Reducer<MoneyString | null> {\n return min(field, opts) as unknown as Reducer<MoneyString | null>\n}\n\n/**\n * `max()` for a declared money field, typed `Reducer<MoneyString | null>`\n * (null on an empty result set in fixed-currency mode, mirroring `max()`). See\n * {@link moneyMin} for the `convertTo`/`fx` and multi-currency caveats.\n */\nexport function moneyMax(field: string, opts?: ReducerOptions<number>): Reducer<MoneyString | null> {\n return max(field, opts) as unknown as Reducer<MoneyString | null>\n}\n\n/**\n * `median()` for a **declared money field**, typed `Reducer<MoneyString | null>`.\n *\n * Same late-binding rewrite as {@link moneySum}: `wrapMoneyReducers` swaps in a\n * reducer that keeps the stored scaled integers as `bigint`s and interpolates\n * the two middle values IN SCALED SPACE with half-even rounding — the money\n * module's rounding everywhere else. Nothing round-trips through a float, so\n * the answer is exact past `Number.MAX_SAFE_INTEGER`, where two distinct cent\n * amounts stop being distinct numbers at all.\n *\n * An even-sized input can therefore land on a half unit (`0.10` and `0.15` →\n * `12.5` cents): that is the one place money median rounds, and it rounds\n * half-to-even (`0.12`), never away from zero.\n *\n * In multi-currency mode the runtime returns a per-currency map, as `moneyMin`\n * does; an empty result is `null` in fixed mode and `{}` in multi.\n */\nexport function moneyMedian(field: string, opts?: ReducerOptions<number>): Reducer<MoneyString | null> {\n return median(field, opts) as unknown as Reducer<MoneyString | null>\n}\n\n/**\n * `percentile()` for a declared money field — see {@link moneyMedian} for the\n * exactness and rounding contract, which is the same code path (`median` is\n * `p = 0.5`). The interpolation weight is taken from `p`'s DECIMAL spelling as\n * an exact rational, so `p = 0.9` is `9/10`, not the float nearest to it.\n *\n * There is deliberately no `approx` here: the t-digest is a float structure and\n * `wrapMoneyReducers` refuses it over a money field.\n */\nexport function moneyPercentile(\n field: string,\n p: number,\n opts?: ReducerOptions<number>,\n): Reducer<MoneyString | null> {\n return percentile(field, p, opts) as unknown as Reducer<MoneyString | null>\n}\n\n// ---------------------------------------------------------------------------\n// Builder (typed spec-builder for aggregate())\n// ---------------------------------------------------------------------------\n\n/**\n * Typed builder passed to the `aggregate(b => spec)` overload.\n *\n * Each field-taking method narrows `field` to `QueryField<T, S>`, which\n * excludes any field listed in the collection's `sensitive` option at\n * compile time. `count()` carries no field argument and is always allowed.\n *\n * The type parameters match the `Query<T, S>` they come from:\n * - `T` — the record type of the collection\n * - `S` — the union of sensitive field keys (defaults to `never`)\n *\n * ONE shared runtime instance (`reducerBuilder`) serves all `T`/`S`\n * combinations — the field narrowing is type-only; the methods delegate\n * directly to the standalone factories.\n */\nexport interface ReducerBuilder<T, S extends keyof T = never, M extends keyof T & string = never> {\n count(opts?: ReducerOptions<number>): Reducer<number>\n countDistinct(field: QueryField<T, S>, opts?: ReducerOptions<number>): Reducer<number, CountDistinctState>\n sum<F extends QueryField<T, S>>(field: F, opts?: ReducerOptions<number>): [F] extends [M] ? Reducer<MoneyString> : Reducer<number>\n avg(field: QueryField<T, S>, opts?: ReducerOptions<{ sum: number; count: number }>): ReturnType<typeof avg>\n min<F extends QueryField<T, S>>(field: F, opts?: ReducerOptions<number>): [F] extends [M] ? Reducer<MoneyString | null> : ReturnType<typeof min>\n max<F extends QueryField<T, S>>(field: F, opts?: ReducerOptions<number>): [F] extends [M] ? Reducer<MoneyString | null> : ReturnType<typeof max>\n median<F extends QueryField<T, S>>(field: F, opts?: ReducerOptions<number>): [F] extends [M] ? Reducer<MoneyString | null> : ReturnType<typeof median>\n percentile<F extends QueryField<T, S>>(field: F, p: number, opts?: PercentileOptions): [F] extends [M] ? Reducer<MoneyString | null> : ReturnType<typeof percentile>\n variance(field: QueryField<T, S>, opts?: DispersionOptions): ReturnType<typeof variance>\n stddev(field: QueryField<T, S>, opts?: DispersionOptions): ReturnType<typeof stddev>\n mode(field: QueryField<T, S>, opts?: ReducerOptions<number>): ReturnType<typeof mode>\n moneySum(field: QueryField<T, S>, opts?: ReducerOptions<number>): Reducer<MoneyString>\n moneyMin(field: QueryField<T, S>, opts?: ReducerOptions<number>): Reducer<MoneyString | null>\n moneyMax(field: QueryField<T, S>, opts?: ReducerOptions<number>): Reducer<MoneyString | null>\n moneyMedian(field: QueryField<T, S>, opts?: ReducerOptions<number>): Reducer<MoneyString | null>\n moneyPercentile(field: QueryField<T, S>, p: number, opts?: ReducerOptions<number>): Reducer<MoneyString | null>\n}\n\n/**\n * Shared runtime instance for the `aggregate(b => spec)` builder form.\n *\n * The field-narrowing to `QueryField<T, S>` is type-only — each method\n * delegates directly to its standalone factory. A `(field: string) => R`\n * factory is assignable to a `(field: QueryField<T,S>) => R` method by\n * parameter-contravariance, so this single instance works for all `T`/`S`.\n */\nexport const reducerBuilder: ReducerBuilder<Record<string, unknown>> = {\n count,\n countDistinct,\n // The generic F parameter on sum/min/max in the interface is type-only; the\n // standalone factories are plain `(field: string)` functions. With M=never the\n // conditional return collapses to the numeric branch, matching the factories'\n // return type, but TypeScript cannot verify that collapse for a generic method\n // signature — so each factory is cast directly to the method's type.\n sum: sum as ReducerBuilder<Record<string, unknown>>['sum'],\n avg,\n min: min as ReducerBuilder<Record<string, unknown>>['min'],\n max: max as ReducerBuilder<Record<string, unknown>>['max'],\n median: median as ReducerBuilder<Record<string, unknown>>['median'],\n percentile: percentile as ReducerBuilder<Record<string, unknown>>['percentile'],\n variance,\n stddev,\n mode,\n moneySum, moneyMin, moneyMax, moneyMedian, moneyPercentile,\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Read a numeric field from a record. Non-number values (null,\n * undefined, strings, objects) coerce to 0 so sum/avg/min/max don't\n * produce NaN on one bad row. Consumers who want strict typing should\n * validate upstream with Standard Schema, which NOYDB already runs on\n * every `put()`.\n */\nfunction readNumber(record: unknown, field: string): number {\n const value = readPath(record, field)\n // Defensive: a `{ amount, currency }` value means a multi-currency\n // money field reached a generic numeric reducer instead of being\n // rewritten by `wrapMoneyReducers` — that would silently produce a\n // wrong total. Surface it loudly rather than coercing to 0.\n if (\n typeof value === 'object' &&\n value !== null &&\n 'amount' in value &&\n 'currency' in value\n ) {\n throw new Error(\n `aggregate: field \"${field}\" holds a money value but was not money-aware — ` +\n `declare it in the collection's moneyFields so sum/min/max stay exact`,\n )\n }\n return typeof value === 'number' && Number.isFinite(value) ? value : 0\n}\n"],"mappings":";;;;;;;;AA2JO,SAAS,MAAM,MAAgD;AAGpE,QAAM,QAAQ,MAAM;AACpB,OAAK;AACL,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,MAAM,MAAM;AAAA,IACZ,MAAM,CAAC,UAAU,QAAQ;AAAA,IACzB,QAAQ,CAAC,UAAU,QAAQ;AAAA,IAC3B,UAAU,CAAC,UAAU;AAAA,IACrB,OAAO,CAAC,GAAG,MAAM,IAAI;AAAA,EACvB;AACF;AA6BO,SAAS,cACd,OACA,MACqC;AACrC,QAAM,QAAQ,MAAM;AACpB,OAAK;AACL,QAAM,MAAM,MAAM;AAClB,QAAM,QAAQ,CAAC,WACb,cAAc,OAAO,SAAS,QAAQ,KAAK,GAAG,GAAG;AACnD,SAAO;AAAA,IACL,IAAI;AAAA,IACJ;AAAA,IACA,MAAM,OAAO,EAAE,QAAQ,oBAAI,IAAI,EAAE;AAAA,IACjC,MAAM,CAAC,OAAO,WAAW;AACvB,YAAM,MAAM,MAAM,MAAM;AACxB,UAAI,QAAQ,OAAW,QAAO;AAC9B,YAAM,SAAS,IAAI,IAAI,MAAM,MAAM;AACnC,aAAO,IAAI,MAAM,OAAO,IAAI,GAAG,KAAK,KAAK,CAAC;AAC1C,aAAO,EAAE,OAAO;AAAA,IAClB;AAAA,IACA,QAAQ,CAAC,OAAO,WAAW;AACzB,YAAM,MAAM,MAAM,MAAM;AACxB,UAAI,QAAQ,OAAW,QAAO;AAC9B,YAAM,UAAU,MAAM,OAAO,IAAI,GAAG;AACpC,UAAI,YAAY,OAAW,QAAO;AAClC,YAAM,SAAS,IAAI,IAAI,MAAM,MAAM;AACnC,UAAI,WAAW,EAAG,QAAO,OAAO,GAAG;AAAA,UAC9B,QAAO,IAAI,KAAK,UAAU,CAAC;AAChC,aAAO,EAAE,OAAO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AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAAU;AAAA,EAAU;AAAA,EAAU;AAAA,EAAa;AAC7C;AAaA,SAAS,WAAW,QAAiB,OAAuB;AAC1D,QAAM,QAAQ,SAAS,QAAQ,KAAK;AAKpC,MACE,OAAO,UAAU,YACjB,UAAU,QACV,YAAY,SACZ,cAAc,OACd;AACA,UAAM,IAAI;AAAA,MACR,qBAAqB,KAAK;AAAA,IAE5B;AAAA,EACF;AACA,SAAO,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,IAAI,QAAQ;AACvE;","names":["count"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
matchesReferencingValue
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-244QBK7Z.js";
|
|
4
4
|
import {
|
|
5
5
|
PeriodClosedError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-37EPTBBR.js";
|
|
7
7
|
|
|
8
8
|
// src/kernel/via/dispatch.ts
|
|
9
9
|
function touchFor(batch, collection) {
|
|
@@ -173,4 +173,4 @@ export {
|
|
|
173
173
|
forgetDerivedFanout,
|
|
174
174
|
selfWriteFieldEqual
|
|
175
175
|
};
|
|
176
|
-
//# sourceMappingURL=chunk-
|
|
176
|
+
//# sourceMappingURL=chunk-MILI22XQ.js.map
|