promptfoo 0.121.1 → 0.121.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/{accounts-BgNJDBE6.js → accounts-B0pgC1oV.js} +4 -4
- package/dist/src/{accounts-CMqkzrVf.js → accounts-Bm2D8Db9.js} +5 -5
- package/dist/src/{accounts-xrUGFA6n.js → accounts-CiBLOnA7.js} +4 -4
- package/dist/src/{accounts-Bx-x3bmW.cjs → accounts-gtkH-5KX.cjs} +4 -4
- package/dist/src/{agentic-utils-BKIN5PKu.js → agentic-utils-DS1g3GLF.js} +2 -2
- package/dist/src/{agents-CVIn-Utx.js → agents-9qiOy0ho.js} +6 -6
- package/dist/src/{agents-CXknwsFX.js → agents-CBr9A01V.js} +2 -2
- package/dist/src/{agents-aF4-T121.js → agents-CmvBq8LV.js} +6 -6
- package/dist/src/{agents-Dy2YpZpa.js → agents-D__IdAlg.js} +3 -3
- package/dist/src/{agents-B0f4HICh.cjs → agents-DbRtpYxR.cjs} +2 -2
- package/dist/src/{agents-C-dDThPK.js → agents-DgF2zDag.js} +2 -2
- package/dist/src/{agents-CErsqg5U.cjs → agents-Di9DKPzn.cjs} +6 -6
- package/dist/src/{agents-DeH4Gu94.js → agents-cLXA8a_8.js} +7 -7
- package/dist/src/{aimlapi-DHRKlBEA.js → aimlapi-B4rcnZgv.js} +9 -9
- package/dist/src/{aimlapi-tg0Gkcvr.cjs → aimlapi-BvlNH0gr.cjs} +9 -9
- package/dist/src/{aimlapi-BAGZDo5G.js → aimlapi-CnkC2HqE.js} +10 -10
- package/dist/src/{aimlapi-BNfTBexL.js → aimlapi-DHJU_kcV.js} +9 -9
- package/dist/src/app/assets/{index-BFCZg7hQ.js → index-4LKxG2CG.js} +84 -84
- package/dist/src/app/assets/{index-NCn4eVBv.css → index-C3zcsZFQ.css} +1 -1
- package/dist/src/app/assets/vendor-charts-BnDWwBlI.js +36 -0
- package/dist/src/app/index.html +3 -3
- package/dist/src/app/tsconfig.app.tsbuildinfo +1 -0
- package/dist/src/{audio-CHQ4r-RV.js → audio-Bkv46et0.js} +3 -3
- package/dist/src/{audio-BWeaWovU.cjs → audio-CGMyULza.cjs} +3 -3
- package/dist/src/{audio-tf_NBjlC.js → audio-ClI_AFre.js} +3 -3
- package/dist/src/{audio-BRODU0UK.js → audio-Dz3z7s3J.js} +4 -4
- package/dist/src/{base-DBtwl2FR.cjs → base-CGrhspbK.cjs} +2 -2
- package/dist/src/{base-fEDN28WM.js → base-CpjcHe4e.js} +2 -2
- package/dist/src/{base-B0tcrnq_.js → base-DLKtKMFh.js} +2 -2
- package/dist/src/{base-B4QJRyFS.js → base-Dy1V8--Z.js} +2 -2
- package/dist/src/{blobs-qTYm-1PY.js → blobs-BDbfYdrJ.js} +2 -2
- package/dist/src/{blobs-Bpg5rH6i.js → blobs-CBO20krR.js} +2 -2
- package/dist/src/{blobs-BAU-dXan.js → blobs-CMHN0Qcz.js} +2 -2
- package/dist/src/{blobs-DvS-O6be.cjs → blobs-D23XLin-.cjs} +2 -2
- package/dist/src/{cache-CG0SlR1d.js → cache-BVeDlD87.js} +74 -57
- package/dist/src/{cache-8XhNqPKW.js → cache-C4Nxf52C.js} +74 -57
- package/dist/src/{cache-Bbn1Nyrd.cjs → cache-CeUpFm3M.cjs} +2 -2
- package/dist/src/{cache-COish3-W.cjs → cache-Dh5WtQps.cjs} +74 -57
- package/dist/src/{cache-D3eqDYGU.js → cache-i1P6crbO.js} +74 -57
- package/dist/src/cache-n-RCJ-hL.js +6 -0
- package/dist/src/{chat-CRWNNq73.js → chat-BiKyneZl.js} +10 -8
- package/dist/src/{chat-2K608PeQ.cjs → chat-C1Qst7jL.cjs} +8 -8
- package/dist/src/{chat-CM_kyI8B.js → chat-C2jrdPMx.js} +8 -8
- package/dist/src/{chat-DaqekjFr.cjs → chat-CgF-J-Jj.cjs} +10 -8
- package/dist/src/{chat-DHMH-N64.js → chat-CzkrVDfz.js} +8 -8
- package/dist/src/{chat-BKm79wib.js → chat-DJIw17u0.js} +10 -8
- package/dist/src/{chat-CznLWr_D.js → chat-DqxYYtWA.js} +10 -8
- package/dist/src/{chat-DxysjBvt.js → chat-qmatte1u.js} +9 -9
- package/dist/src/{claude-agent-sdk-BLTu0WBO.js → claude-agent-sdk-Apiy0iaz.js} +8 -8
- package/dist/src/{claude-agent-sdk-D6_k9FKA.js → claude-agent-sdk-D2bJee9S.js} +8 -8
- package/dist/src/{claude-agent-sdk-CJH22shf.cjs → claude-agent-sdk-D9Z5Pr9X.cjs} +8 -8
- package/dist/src/{claude-agent-sdk-Dy5lT-Tx.js → claude-agent-sdk-DfCoW0E6.js} +9 -9
- package/dist/src/{cloud-DmE0EwsY.js → cloud-BBh91EUK.js} +1 -1
- package/dist/src/{cloud-Bc9526yV.js → cloud-C0dlstV_.js} +2 -2
- package/dist/src/{cloudflare-ai-C9r2sRhw.js → cloudflare-ai-8TDxHR0x.js} +9 -9
- package/dist/src/{cloudflare-ai-ICsOuD-z.js → cloudflare-ai-BxAGvfju.js} +10 -10
- package/dist/src/{cloudflare-ai-ClWSdor4.cjs → cloudflare-ai-CknbZ5LJ.cjs} +9 -9
- package/dist/src/{cloudflare-ai-CWWJCRim.js → cloudflare-ai-g7PB6VHR.js} +9 -9
- package/dist/src/{cloudflare-gateway-D6O7AlYb.js → cloudflare-gateway-B9HWA5wf.js} +11 -11
- package/dist/src/{cloudflare-gateway-C2_-KG5o.cjs → cloudflare-gateway-BSnDmHYo.cjs} +10 -10
- package/dist/src/{cloudflare-gateway-pXGHxJ47.js → cloudflare-gateway-CKDb4dJ8.js} +10 -10
- package/dist/src/{cloudflare-gateway-D6xFc5pa.js → cloudflare-gateway-CP9QEWYS.js} +10 -10
- package/dist/src/{cometapi-Bbjp5V4x.js → cometapi-BL9yvj_f.js} +10 -10
- package/dist/src/{cometapi-vY6aDZgo.cjs → cometapi-C4xSqeID.cjs} +10 -10
- package/dist/src/{cometapi-DkXrKi5z.js → cometapi-CUQq3H_a.js} +10 -10
- package/dist/src/{cometapi-BasUi7-_.js → cometapi-DFNiKmSz.js} +11 -11
- package/dist/src/{completion-C_P3ypkJ.js → completion-5MzrpJxT.js} +4 -4
- package/dist/src/{completion-CDOouNzq.cjs → completion-CM6oK8PS.cjs} +4 -4
- package/dist/src/{completion-C5rtR_9P.js → completion-DZ083F31.js} +4 -4
- package/dist/src/{completion-6Mx_iXxK.js → completion-qRoZAYRB.js} +4 -4
- package/dist/src/{docker-CZnqU1XV.js → docker-Bb5dcxr8.js} +9 -9
- package/dist/src/{docker-DzxyDPIj.js → docker-BvfL2BrW.js} +10 -10
- package/dist/src/{docker-BwsKwxFs.cjs → docker-DcF2pRrj.cjs} +9 -9
- package/dist/src/{docker-5KcG-_86.js → docker-ExVyLp0S.js} +9 -9
- package/dist/src/eval-B3r2CVXr.js +15 -0
- package/dist/src/{eval-DmFyWU7i.js → eval-Dg2nG4v2.js} +8 -8
- package/dist/src/evalResult-5xwYnECe.js +12 -0
- package/dist/src/evalResult-71lY93Kj.cjs +10 -0
- package/dist/src/{evalResult-CTG2AHOS.js → evalResult-BBRNtX4I.js} +5 -5
- package/dist/src/{evalResult-CDQiuUuf.js → evalResult-BDMqrapS.js} +5 -5
- package/dist/src/evalResult-Dx5P5cIv.js +10 -0
- package/dist/src/{evalResult-Dap2CekP.cjs → evalResult-fuaI8HkH.cjs} +5 -5
- package/dist/src/{evaluator-DPFRbFIL.js → evaluator-BhoWwp5b.js} +30 -26
- package/dist/src/evaluator-Jx6bRZV6.js +36 -0
- package/dist/src/{extractor-M67RUtg6.js → extractor-C0EVHewb.js} +5 -5
- package/dist/src/{extractor-YMU_Gvt8.js → extractor-D25qpmGX.js} +5 -5
- package/dist/src/{extractor-CFG6bcWJ.js → extractor-DReVID0K.js} +5 -5
- package/dist/src/{extractor-DX36oYEv.cjs → extractor-pYLLi3wS.cjs} +5 -5
- package/dist/src/{fetch-BxUk8odA.cjs → fetch-BPkYtG8K.cjs} +2 -2
- package/dist/src/fetch-BxNb_Lp3.js +5 -0
- package/dist/src/{fetch-60Gzydls.js → fetch-Cwxnd8zz.js} +2 -2
- package/dist/src/{fetch-BMv0O527.js → fetch-Dxpd4_sr.js} +3 -3
- package/dist/src/{fetch-4M3YRaqL.js → fetch-HaqdX7U1.js} +2 -2
- package/dist/src/{graders-CpdqD9PI.js → graders-BTeBGqjJ.js} +13 -13
- package/dist/src/graders-B_pgMLS2.js +34 -0
- package/dist/src/{graders-CHO8EPM4.js → graders-Bj_Odv7c.js} +13 -13
- package/dist/src/graders-DErokPDO.cjs +32 -0
- package/dist/src/{graders-R9rYUM0d.js → graders-DP7KFFo-.js} +13 -13
- package/dist/src/graders-DR_uNe54.js +32 -0
- package/dist/src/{graders-DOXycdlG.cjs → graders-DU49_J8Y.cjs} +13 -13
- package/dist/src/graders-w3176Wz-.js +32 -0
- package/dist/src/{image-gvmivTEe.js → image-B02ogr_b.js} +4 -4
- package/dist/src/{image-tL5hIOFh.js → image-B0h9VEMc.js} +3 -3
- package/dist/src/{image-DTedmQPg.cjs → image-BLmROtN3.cjs} +4 -4
- package/dist/src/{image-DJEvKveK.js → image-Bb4vWQLM.js} +3 -3
- package/dist/src/{image-CDLQOcqT.cjs → image-C1madmKh.cjs} +3 -3
- package/dist/src/{image-BmEZqVmk.js → image-CHfWvljl.js} +4 -4
- package/dist/src/{image-CBBVXWuT.js → image-DS-o-0ph.js} +4 -4
- package/dist/src/{image-pAX56tPG.js → image-Dpxa1Jt6.js} +4 -4
- package/dist/src/index.cjs +38 -34
- package/dist/src/index.d.cts +260 -0
- package/dist/src/index.d.ts +260 -0
- package/dist/src/index.js +38 -34
- package/dist/src/{knowledgeBase-CoU-UQBg.js → knowledgeBase-B3OoKIej.js} +6 -6
- package/dist/src/{knowledgeBase-CLJybhnF.js → knowledgeBase-CYTLHOt1.js} +7 -7
- package/dist/src/{knowledgeBase-DjWPVqSb.js → knowledgeBase-D33Ty2l6.js} +6 -6
- package/dist/src/{knowledgeBase-wkxuRFhA.cjs → knowledgeBase-DOO_BM9b.cjs} +6 -6
- package/dist/src/{litellm-B9Hysuri.js → litellm-AaeZcZQF.js} +12 -11
- package/dist/src/{litellm-NYpQ8RQu.cjs → litellm-I_hbp_dc.cjs} +11 -10
- package/dist/src/{litellm-ePxtr9F1.js → litellm-NbjknEh6.js} +11 -10
- package/dist/src/{litellm-CTfa0hqi.js → litellm-TrljxD9G.js} +11 -10
- package/dist/src/{luma-ray-BW9IRGIc.js → luma-ray-BS2_tY8L.js} +9 -9
- package/dist/src/{luma-ray-BE2mOt6N.js → luma-ray-DDsjcgZZ.js} +8 -8
- package/dist/src/{luma-ray-B0GGNRc1.cjs → luma-ray-Due0n7di.cjs} +8 -8
- package/dist/src/{luma-ray-Cm1KZBhs.js → luma-ray-f6I2fft-.js} +8 -8
- package/dist/src/main.js +33 -33
- package/dist/src/{messages-BLbWdsyt.js → messages-BS17jdMx.js} +7 -7
- package/dist/src/{messages-1JrJs91T.cjs → messages-Bs1kC7P4.cjs} +7 -7
- package/dist/src/{messages-1x9atZmP.js → messages-D0lx5qK7.js} +7 -7
- package/dist/src/{messages-D8EA0oDc.js → messages-ZJk778GH.js} +7 -7
- package/dist/src/{modelslab-X5-4LroM.js → modelslab-Bmni6skY.js} +8 -8
- package/dist/src/{modelslab-CqXBy3U8.js → modelslab-Bx9IrZfS.js} +9 -9
- package/dist/src/{modelslab-DcOSFwKh.cjs → modelslab-CoUX6Jc_.cjs} +8 -8
- package/dist/src/{modelslab-C1OLRmVX.js → modelslab-DRb74SP4.js} +8 -8
- package/dist/src/{nova-reel-BgS1ZWuK.js → nova-reel-BfPq-0Yk.js} +8 -8
- package/dist/src/{nova-reel-D9xfaMBs.cjs → nova-reel-C_QM18Xn.cjs} +8 -8
- package/dist/src/{nova-reel-D2ZkOSyr.js → nova-reel-D_W1tjMH.js} +9 -9
- package/dist/src/{nova-reel-DihqLeol.js → nova-reel-bgjxilYW.js} +8 -8
- package/dist/src/{nova-sonic-DezhVUYT.js → nova-sonic-CFb5GYhg.js} +5 -5
- package/dist/src/{nova-sonic-P-CdUMlV.js → nova-sonic-DIGQNR07.js} +5 -5
- package/dist/src/{nova-sonic-Q3BOJeig.js → nova-sonic-De1HW5fD.js} +6 -6
- package/dist/src/{nova-sonic-DVu3mMIy.cjs → nova-sonic-zfcljeRp.cjs} +5 -5
- package/dist/src/{openclaw-DAfWQn-o.cjs → openclaw-CSugPYAr.cjs} +169 -105
- package/dist/src/{openclaw-D1D_ej1z.js → openclaw-DiSz3I5L.js} +169 -106
- package/dist/src/{openclaw-BiSZPL7J.js → openclaw-DuvJKEW5.js} +168 -105
- package/dist/src/{openclaw-Bv1DINsX.js → openclaw-tiVYRtr-.js} +168 -105
- package/dist/src/{opencode-sdk-D95s6SnR.js → opencode-sdk-0j6rTWNb.js} +5 -5
- package/dist/src/{opencode-sdk-DxUPkLT7.js → opencode-sdk-B3CWY9h_.js} +4 -4
- package/dist/src/{opencode-sdk-CfaLN8PY.cjs → opencode-sdk-BL764Jdi.cjs} +4 -4
- package/dist/src/{opencode-sdk-C7m-wRfI.js → opencode-sdk-C2y6UkP2.js} +4 -4
- package/dist/src/{otlpReceiver-g3ByGaXs.js → otlpReceiver-C99PPb48.js} +4 -4
- package/dist/src/{otlpReceiver-Diec4cln.cjs → otlpReceiver-CGq6LspY.cjs} +4 -4
- package/dist/src/{otlpReceiver--AIRW_S4.js → otlpReceiver-CdNBdbsk.js} +4 -4
- package/dist/src/{otlpReceiver-Bn5wGB1v.js → otlpReceiver-D89fR-rC.js} +4 -4
- package/dist/src/providers-B7V0njNs.js +32 -0
- package/dist/src/providers-BEwbhv0X.js +30 -0
- package/dist/src/{providers-CFLy1_ji.js → providers-BlqUifFg.js} +54 -54
- package/dist/src/providers-CH3C7zf7.js +30 -0
- package/dist/src/{providers-CFu-TZl-.cjs → providers-CgKOSgTR.cjs} +53 -53
- package/dist/src/{providers-B3HvufyI.js → providers-D8lF1sqW.js} +53 -53
- package/dist/src/{providers-BKRJTjBz.js → providers-Dk_6ocUX.js} +53 -53
- package/dist/src/providers-zyB6k_38.cjs +31 -0
- package/dist/src/{quiverai-C2jVwbH1.js → quiverai-BbOUOn2L.js} +3 -3
- package/dist/src/{quiverai-CI6gYJVI.js → quiverai-CIaELU_m.js} +3 -3
- package/dist/src/{quiverai-CLkWkyZc.cjs → quiverai-PdShCPox.cjs} +3 -3
- package/dist/src/{quiverai-MHSxbmmZ.js → quiverai-uH-dcTIr.js} +4 -4
- package/dist/src/{responses-jxdehPkC.js → responses-CB2jwoAr.js} +7 -7
- package/dist/src/{responses-tD4Bd4dc.cjs → responses-D8SBTL64.cjs} +7 -7
- package/dist/src/{responses-BKqJmhhc.js → responses-DIR9Ud3j.js} +7 -7
- package/dist/src/{responses-CGw0DCzh.js → responses-WNGNYe3K.js} +7 -7
- package/dist/src/{sagemaker-BK4Zb993.js → sagemaker-CNBxx5CJ.js} +11 -11
- package/dist/src/{sagemaker-D2Q1c-sD.js → sagemaker-CemTFp2h.js} +11 -11
- package/dist/src/{sagemaker-CcQHM1jV.cjs → sagemaker-Cl28mZU2.cjs} +11 -11
- package/dist/src/{sagemaker-BfiWTmvn.js → sagemaker-YSyBXQQh.js} +12 -12
- package/dist/src/{scanner-J8CA3LsV.js → scanner-BsBlNXNn.js} +7 -7
- package/dist/src/server/index.js +39 -35
- package/dist/src/{server-B0PPuDw-.cjs → server-C_7Ax-hA.cjs} +3 -3
- package/dist/src/{server-DbFphssR.js → server-CqzrVGpF.js} +5 -5
- package/dist/src/{server-OAs3nBRT.js → server-CuxBbeSY.js} +4 -4
- package/dist/src/server-DA4Cyrrq.js +7 -0
- package/dist/src/server-Dulb-4-K.cjs +5 -0
- package/dist/src/{server-BC7XJFgr.js → server-VWgWb00X.js} +3 -3
- package/dist/src/{signal-BOTbd53Z.js → signal-4U3mfRvL.js} +2 -2
- package/dist/src/{store-Ub2vaGJ1.js → store-CXGFv4aR.js} +2 -2
- package/dist/src/store-CXS-Q_91.js +6 -0
- package/dist/src/{store-BSc-TF2w.cjs → store-DLlFCC4h.cjs} +2 -2
- package/dist/src/{store-DQLEjuEO.js → store-DXilxTl-.js} +2 -2
- package/dist/src/{store-D1tv90v3.js → store-Dim__MDd.js} +2 -2
- package/dist/src/store-eYkaKMwq.cjs +5 -0
- package/dist/src/{tables-5EvT_Bwn.js → tables-6YKwjN9-.js} +2 -2
- package/dist/src/{tables-xKANLRBD.js → tables-DLJPUdUE.js} +2 -2
- package/dist/src/{tables-C7K-XKWp.cjs → tables-DPi7wKeM.cjs} +2 -2
- package/dist/src/{tables-D36WTqKX.js → tables-gftXzE9I.js} +2 -2
- package/dist/src/telemetry-BpMfhthR.cjs +5 -0
- package/dist/src/{telemetry-C2YDkUQH.js → telemetry-CMrFgtPB.js} +3 -3
- package/dist/src/{telemetry-DMb2Mpfm.js → telemetry-Cps3mIU-.js} +3 -3
- package/dist/src/{telemetry-CbrnxHp_.cjs → telemetry-DaX14Chu.cjs} +3 -3
- package/dist/src/{telemetry-C15ziL8u.js → telemetry-Dthj_BbD.js} +3 -3
- package/dist/src/telemetry-Dw38hanS.js +7 -0
- package/dist/src/{transcription-DAtxHhAM.js → transcription-BNYURcXg.js} +6 -6
- package/dist/src/{transcription-LNZTNUUL.js → transcription-B_OdaHp7.js} +6 -6
- package/dist/src/{transcription-CL78qbOU.cjs → transcription-NLVG9MT1.cjs} +6 -6
- package/dist/src/{transcription-QHh3AH6Z.js → transcription-s6A-bNrZ.js} +7 -7
- package/dist/src/{transform-Cgi24fJ7.js → transform-D5HsjduX.js} +3 -3
- package/dist/src/{transform-DOcQeLld.cjs → transform-DuHvhZpj.cjs} +3 -3
- package/dist/src/{transform-DGxXocjk.js → transform-uAytVuyX.js} +3 -3
- package/dist/src/{transform-DGLazrMm.js → transform-vNucnNr0.js} +3 -3
- package/dist/src/{types-LJ0r3wbR.cjs → types-C_7nyzr1.cjs} +39 -11
- package/dist/src/{types-CH3Ge2sE.js → types-Cbd8uOMq.js} +39 -11
- package/dist/src/{types-CN_TZ2GJ.js → types-CzW2QFyi.js} +39 -11
- package/dist/src/{types-CLKiCBW3.js → types-DmyIJ-sR.js} +39 -11
- package/dist/src/{util-B7T3SiBS.js → util-B3xGByQh.js} +3 -3
- package/dist/src/{util-Yz-1aEhW.cjs → util-B9vlHIIh.cjs} +3 -7
- package/dist/src/{util-ZZH-3QZz.js → util-BHGHw5G1.js} +3 -3
- package/dist/src/{util-Dlz_Wvgm.js → util-BRYkYPTd.js} +3 -7
- package/dist/src/{util-6-GqIvzS.js → util-BV4XUC0n.js} +3 -3
- package/dist/src/{util-DaWTWKBK.js → util-Bv6uGDfH.js} +3 -3
- package/dist/src/{util-Db0a0AFH.cjs → util-BzMcevZc.cjs} +3 -3
- package/dist/src/{util-YT5HPZaS.js → util-C1CeHl-P.js} +3 -7
- package/dist/src/{util-C-PPYSMq.js → util-CMy69ZgQ.js} +3 -3
- package/dist/src/{util-CchiqXh_.cjs → util-DGNOS1db.cjs} +3 -3
- package/dist/src/{util-Betm42rL.js → util-Dnmk2mBQ.js} +3 -3
- package/dist/src/{util-5cB-L7U3.js → util-ZzmqNPlg.js} +3 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/dist/src/app/assets/vendor-charts-CCl15Imd.js +0 -36
- package/dist/src/cache-BwsMSda7.js +0 -6
- package/dist/src/eval-17JizQIv.js +0 -15
- package/dist/src/evalResult-Cqj8pldJ.js +0 -12
- package/dist/src/evalResult-DvcJAWJU.cjs +0 -10
- package/dist/src/evalResult-Hftn-S_i.js +0 -10
- package/dist/src/evaluator-B2CFNt-P.js +0 -36
- package/dist/src/fetch-KV5kNASw.js +0 -5
- package/dist/src/graders-Bu0H9nXi.js +0 -32
- package/dist/src/graders-Cfhkvx-e.js +0 -34
- package/dist/src/graders-DClJVpGP.cjs +0 -32
- package/dist/src/graders-DcnJsrMO.js +0 -32
- package/dist/src/providers-C1rOSHiR.js +0 -32
- package/dist/src/providers-CxmDwEFf.cjs +0 -31
- package/dist/src/providers-Dodakqr0.js +0 -30
- package/dist/src/providers-GIQ2TcsA.js +0 -30
- package/dist/src/server-B1vi21hA.js +0 -7
- package/dist/src/server-Cm9Kai_h.cjs +0 -5
- package/dist/src/store-BNmZ1KAz.cjs +0 -5
- package/dist/src/store-BltJg2cd.js +0 -6
- package/dist/src/telemetry-5BCRNBbe.cjs +0 -5
- package/dist/src/telemetry-D4W5hboe.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-DEq-mXcV.js";
|
|
2
2
|
import { _ as getEnvBool, b as getEnvString, g as getConfigDirectoryPath, i as logger, y as getEnvInt } from "./logger-CT3IKMKA.js";
|
|
3
|
-
import { d as sleep, n as fetchWithRetries, p as REQUEST_TIMEOUT_MS } from "./fetch-
|
|
3
|
+
import { d as sleep, n as fetchWithRetries, p as REQUEST_TIMEOUT_MS } from "./fetch-Cwxnd8zz.js";
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { createCache } from "cache-manager";
|
|
@@ -607,6 +607,31 @@ function getCache() {
|
|
|
607
607
|
}
|
|
608
608
|
return cacheInstance;
|
|
609
609
|
}
|
|
610
|
+
const inflightFetchResponses = /* @__PURE__ */ new Map();
|
|
611
|
+
function serializeFetchResponse(data, status, statusText, headers, latencyMs) {
|
|
612
|
+
return JSON.stringify({
|
|
613
|
+
data,
|
|
614
|
+
status,
|
|
615
|
+
statusText,
|
|
616
|
+
headers,
|
|
617
|
+
latencyMs
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
function deserializeFetchResponse(response, cached, cache, cacheKey) {
|
|
621
|
+
const parsedResponse = JSON.parse(response);
|
|
622
|
+
return {
|
|
623
|
+
cached,
|
|
624
|
+
data: parsedResponse.data,
|
|
625
|
+
status: parsedResponse.status,
|
|
626
|
+
statusText: parsedResponse.statusText,
|
|
627
|
+
headers: parsedResponse.headers,
|
|
628
|
+
latencyMs: parsedResponse.latencyMs,
|
|
629
|
+
deleteFromCache: async () => {
|
|
630
|
+
await cache.del(cacheKey);
|
|
631
|
+
logger.debug(`Evicted from cache: ${cacheKey}`);
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
}
|
|
610
635
|
async function fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent) {
|
|
611
636
|
const maxBodyRetries = isIdempotent ? 2 : 0;
|
|
612
637
|
for (let bodyAttempt = 0; bodyAttempt <= maxBodyRetries; bodyAttempt++) {
|
|
@@ -636,6 +661,35 @@ async function fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent)
|
|
|
636
661
|
}
|
|
637
662
|
throw new Error("Exhausted body retries without returning or throwing");
|
|
638
663
|
}
|
|
664
|
+
async function prepareFetchResponse(url, options, timeout, maxRetries, isIdempotent, format) {
|
|
665
|
+
const result = await fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent);
|
|
666
|
+
const response = result.resp;
|
|
667
|
+
const responseText = result.respText;
|
|
668
|
+
const fetchLatencyMs = result.fetchLatencyMs;
|
|
669
|
+
const headers = Object.fromEntries(response.headers.entries());
|
|
670
|
+
try {
|
|
671
|
+
const parsedData = format === "json" ? JSON.parse(responseText) : responseText;
|
|
672
|
+
const serializedResponse = serializeFetchResponse(parsedData, response.status, response.statusText, headers, fetchLatencyMs);
|
|
673
|
+
if (!response.ok) return {
|
|
674
|
+
response: responseText === "" ? serializeFetchResponse(`Empty Response: ${response.status}: ${response.statusText}`, response.status, response.statusText, headers, fetchLatencyMs) : serializedResponse,
|
|
675
|
+
cacheable: false
|
|
676
|
+
};
|
|
677
|
+
if (format === "json" && parsedData?.error) {
|
|
678
|
+
logger.debug(`Not caching ${url} because it contains an 'error' key: ${parsedData.error}`);
|
|
679
|
+
return {
|
|
680
|
+
response: serializedResponse,
|
|
681
|
+
cacheable: false
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
logger.debug(`Storing ${url} response in cache with latencyMs=${fetchLatencyMs}: ${serializedResponse}`);
|
|
685
|
+
return {
|
|
686
|
+
response: serializedResponse,
|
|
687
|
+
cacheable: true
|
|
688
|
+
};
|
|
689
|
+
} catch (err) {
|
|
690
|
+
throw new Error(`Error parsing response from ${url}: ${err.message}. Received text: ${responseText}`);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
639
693
|
async function fetchWithCache(url, options = {}, timeout = REQUEST_TIMEOUT_MS, format = "json", bust = false, maxRetries) {
|
|
640
694
|
const method = (options.method ?? (url instanceof Request ? url.method : "GET")).toUpperCase();
|
|
641
695
|
const isIdempotent = [
|
|
@@ -665,61 +719,23 @@ async function fetchWithCache(url, options = {}, timeout = REQUEST_TIMEOUT_MS, f
|
|
|
665
719
|
delete copy.headers;
|
|
666
720
|
const cacheKey = `fetch:v2:${url}:${JSON.stringify(copy)}`;
|
|
667
721
|
const cache = await getCache();
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
latencyMs: fetchLatencyMs
|
|
686
|
-
});
|
|
687
|
-
if (!response.ok) {
|
|
688
|
-
if (responseText == "") errorResponse = JSON.stringify({
|
|
689
|
-
data: `Empty Response: ${response.status}: ${response.statusText}`,
|
|
690
|
-
status: response.status,
|
|
691
|
-
statusText: response.statusText,
|
|
692
|
-
headers,
|
|
693
|
-
latencyMs: fetchLatencyMs
|
|
694
|
-
});
|
|
695
|
-
else errorResponse = data;
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
if (!data) return;
|
|
699
|
-
if (format === "json" && parsedData?.error) {
|
|
700
|
-
logger.debug(`Not caching ${url} because it contains an 'error' key: ${parsedData.error}`);
|
|
701
|
-
return data;
|
|
702
|
-
}
|
|
703
|
-
logger.debug(`Storing ${url} response in cache with latencyMs=${fetchLatencyMs}: ${data}`);
|
|
704
|
-
return data;
|
|
705
|
-
} catch (err) {
|
|
706
|
-
throw new Error(`Error parsing response from ${url}: ${err.message}. Received text: ${responseText}`);
|
|
707
|
-
}
|
|
708
|
-
});
|
|
709
|
-
if (cached && cachedResponse) logger.debug(`Returning cached response for ${url}: ${cachedResponse}`);
|
|
710
|
-
const parsedResponse = JSON.parse(cachedResponse ?? errorResponse);
|
|
711
|
-
return {
|
|
712
|
-
cached,
|
|
713
|
-
data: parsedResponse.data,
|
|
714
|
-
status: parsedResponse.status,
|
|
715
|
-
statusText: parsedResponse.statusText,
|
|
716
|
-
headers: parsedResponse.headers,
|
|
717
|
-
latencyMs: parsedResponse.latencyMs,
|
|
718
|
-
deleteFromCache: async () => {
|
|
719
|
-
await cache.del(cacheKey);
|
|
720
|
-
logger.debug(`Evicted from cache: ${cacheKey}`);
|
|
721
|
-
}
|
|
722
|
-
};
|
|
722
|
+
const cachedResponse = await cache.get(cacheKey);
|
|
723
|
+
if (cachedResponse != null) {
|
|
724
|
+
logger.debug(`Returning cached response for ${url}: ${cachedResponse}`);
|
|
725
|
+
return deserializeFetchResponse(cachedResponse, true, cache, cacheKey);
|
|
726
|
+
}
|
|
727
|
+
let inflightResponse = inflightFetchResponses.get(cacheKey);
|
|
728
|
+
if (!inflightResponse) {
|
|
729
|
+
inflightResponse = (async () => {
|
|
730
|
+
const preparedResponse = await prepareFetchResponse(url, options, timeout, maxRetries, isIdempotent, format);
|
|
731
|
+
if (preparedResponse.cacheable) await cache.set(cacheKey, preparedResponse.response);
|
|
732
|
+
return preparedResponse.response;
|
|
733
|
+
})().finally(() => {
|
|
734
|
+
inflightFetchResponses.delete(cacheKey);
|
|
735
|
+
});
|
|
736
|
+
inflightFetchResponses.set(cacheKey, inflightResponse);
|
|
737
|
+
}
|
|
738
|
+
return deserializeFetchResponse(await inflightResponse, false, cache, cacheKey);
|
|
723
739
|
}
|
|
724
740
|
function enableCache() {
|
|
725
741
|
enabled = true;
|
|
@@ -728,6 +744,7 @@ function disableCache() {
|
|
|
728
744
|
enabled = false;
|
|
729
745
|
}
|
|
730
746
|
async function clearCache() {
|
|
747
|
+
inflightFetchResponses.clear();
|
|
731
748
|
return getCache().clear();
|
|
732
749
|
}
|
|
733
750
|
function isCacheEnabled() {
|
|
@@ -736,4 +753,4 @@ function isCacheEnabled() {
|
|
|
736
753
|
//#endregion
|
|
737
754
|
export { isCacheEnabled as a, isTransientConnectionError as c, getCache as i, disableCache as n, NON_TRANSIENT_HTTP_STATUSES as o, fetchWithCache as r, isNonTransientHttpStatus as s, cache_exports as t };
|
|
738
755
|
|
|
739
|
-
//# sourceMappingURL=cache-
|
|
756
|
+
//# sourceMappingURL=cache-C4Nxf52C.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./logger-Cp1GPUjj.cjs");
|
|
2
|
-
require("./fetch-
|
|
3
|
-
const require_cache = require("./cache-
|
|
2
|
+
require("./fetch-BPkYtG8K.cjs");
|
|
3
|
+
const require_cache = require("./cache-Dh5WtQps.cjs");
|
|
4
4
|
exports.getCache = require_cache.getCache;
|
|
5
5
|
exports.isCacheEnabled = require_cache.isCacheEnabled;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_logger = require("./logger-Cp1GPUjj.cjs");
|
|
2
|
-
const require_fetch = require("./fetch-
|
|
2
|
+
const require_fetch = require("./fetch-BPkYtG8K.cjs");
|
|
3
3
|
let fs = require("fs");
|
|
4
4
|
fs = require_logger.__toESM(fs);
|
|
5
5
|
let path = require("path");
|
|
@@ -608,6 +608,31 @@ function getCache() {
|
|
|
608
608
|
}
|
|
609
609
|
return cacheInstance;
|
|
610
610
|
}
|
|
611
|
+
const inflightFetchResponses = /* @__PURE__ */ new Map();
|
|
612
|
+
function serializeFetchResponse(data, status, statusText, headers, latencyMs) {
|
|
613
|
+
return JSON.stringify({
|
|
614
|
+
data,
|
|
615
|
+
status,
|
|
616
|
+
statusText,
|
|
617
|
+
headers,
|
|
618
|
+
latencyMs
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
function deserializeFetchResponse(response, cached, cache, cacheKey) {
|
|
622
|
+
const parsedResponse = JSON.parse(response);
|
|
623
|
+
return {
|
|
624
|
+
cached,
|
|
625
|
+
data: parsedResponse.data,
|
|
626
|
+
status: parsedResponse.status,
|
|
627
|
+
statusText: parsedResponse.statusText,
|
|
628
|
+
headers: parsedResponse.headers,
|
|
629
|
+
latencyMs: parsedResponse.latencyMs,
|
|
630
|
+
deleteFromCache: async () => {
|
|
631
|
+
await cache.del(cacheKey);
|
|
632
|
+
require_logger.logger.debug(`Evicted from cache: ${cacheKey}`);
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
}
|
|
611
636
|
async function fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent) {
|
|
612
637
|
const maxBodyRetries = isIdempotent ? 2 : 0;
|
|
613
638
|
for (let bodyAttempt = 0; bodyAttempt <= maxBodyRetries; bodyAttempt++) {
|
|
@@ -637,6 +662,35 @@ async function fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent)
|
|
|
637
662
|
}
|
|
638
663
|
throw new Error("Exhausted body retries without returning or throwing");
|
|
639
664
|
}
|
|
665
|
+
async function prepareFetchResponse(url, options, timeout, maxRetries, isIdempotent, format) {
|
|
666
|
+
const result = await fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent);
|
|
667
|
+
const response = result.resp;
|
|
668
|
+
const responseText = result.respText;
|
|
669
|
+
const fetchLatencyMs = result.fetchLatencyMs;
|
|
670
|
+
const headers = Object.fromEntries(response.headers.entries());
|
|
671
|
+
try {
|
|
672
|
+
const parsedData = format === "json" ? JSON.parse(responseText) : responseText;
|
|
673
|
+
const serializedResponse = serializeFetchResponse(parsedData, response.status, response.statusText, headers, fetchLatencyMs);
|
|
674
|
+
if (!response.ok) return {
|
|
675
|
+
response: responseText === "" ? serializeFetchResponse(`Empty Response: ${response.status}: ${response.statusText}`, response.status, response.statusText, headers, fetchLatencyMs) : serializedResponse,
|
|
676
|
+
cacheable: false
|
|
677
|
+
};
|
|
678
|
+
if (format === "json" && parsedData?.error) {
|
|
679
|
+
require_logger.logger.debug(`Not caching ${url} because it contains an 'error' key: ${parsedData.error}`);
|
|
680
|
+
return {
|
|
681
|
+
response: serializedResponse,
|
|
682
|
+
cacheable: false
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
require_logger.logger.debug(`Storing ${url} response in cache with latencyMs=${fetchLatencyMs}: ${serializedResponse}`);
|
|
686
|
+
return {
|
|
687
|
+
response: serializedResponse,
|
|
688
|
+
cacheable: true
|
|
689
|
+
};
|
|
690
|
+
} catch (err) {
|
|
691
|
+
throw new Error(`Error parsing response from ${url}: ${err.message}. Received text: ${responseText}`);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
640
694
|
async function fetchWithCache(url, options = {}, timeout = require_fetch.REQUEST_TIMEOUT_MS, format = "json", bust = false, maxRetries) {
|
|
641
695
|
const method = (options.method ?? (url instanceof Request ? url.method : "GET")).toUpperCase();
|
|
642
696
|
const isIdempotent = [
|
|
@@ -666,61 +720,23 @@ async function fetchWithCache(url, options = {}, timeout = require_fetch.REQUEST
|
|
|
666
720
|
delete copy.headers;
|
|
667
721
|
const cacheKey = `fetch:v2:${url}:${JSON.stringify(copy)}`;
|
|
668
722
|
const cache = await getCache();
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
latencyMs: fetchLatencyMs
|
|
687
|
-
});
|
|
688
|
-
if (!response.ok) {
|
|
689
|
-
if (responseText == "") errorResponse = JSON.stringify({
|
|
690
|
-
data: `Empty Response: ${response.status}: ${response.statusText}`,
|
|
691
|
-
status: response.status,
|
|
692
|
-
statusText: response.statusText,
|
|
693
|
-
headers,
|
|
694
|
-
latencyMs: fetchLatencyMs
|
|
695
|
-
});
|
|
696
|
-
else errorResponse = data;
|
|
697
|
-
return;
|
|
698
|
-
}
|
|
699
|
-
if (!data) return;
|
|
700
|
-
if (format === "json" && parsedData?.error) {
|
|
701
|
-
require_logger.logger.debug(`Not caching ${url} because it contains an 'error' key: ${parsedData.error}`);
|
|
702
|
-
return data;
|
|
703
|
-
}
|
|
704
|
-
require_logger.logger.debug(`Storing ${url} response in cache with latencyMs=${fetchLatencyMs}: ${data}`);
|
|
705
|
-
return data;
|
|
706
|
-
} catch (err) {
|
|
707
|
-
throw new Error(`Error parsing response from ${url}: ${err.message}. Received text: ${responseText}`);
|
|
708
|
-
}
|
|
709
|
-
});
|
|
710
|
-
if (cached && cachedResponse) require_logger.logger.debug(`Returning cached response for ${url}: ${cachedResponse}`);
|
|
711
|
-
const parsedResponse = JSON.parse(cachedResponse ?? errorResponse);
|
|
712
|
-
return {
|
|
713
|
-
cached,
|
|
714
|
-
data: parsedResponse.data,
|
|
715
|
-
status: parsedResponse.status,
|
|
716
|
-
statusText: parsedResponse.statusText,
|
|
717
|
-
headers: parsedResponse.headers,
|
|
718
|
-
latencyMs: parsedResponse.latencyMs,
|
|
719
|
-
deleteFromCache: async () => {
|
|
720
|
-
await cache.del(cacheKey);
|
|
721
|
-
require_logger.logger.debug(`Evicted from cache: ${cacheKey}`);
|
|
722
|
-
}
|
|
723
|
-
};
|
|
723
|
+
const cachedResponse = await cache.get(cacheKey);
|
|
724
|
+
if (cachedResponse != null) {
|
|
725
|
+
require_logger.logger.debug(`Returning cached response for ${url}: ${cachedResponse}`);
|
|
726
|
+
return deserializeFetchResponse(cachedResponse, true, cache, cacheKey);
|
|
727
|
+
}
|
|
728
|
+
let inflightResponse = inflightFetchResponses.get(cacheKey);
|
|
729
|
+
if (!inflightResponse) {
|
|
730
|
+
inflightResponse = (async () => {
|
|
731
|
+
const preparedResponse = await prepareFetchResponse(url, options, timeout, maxRetries, isIdempotent, format);
|
|
732
|
+
if (preparedResponse.cacheable) await cache.set(cacheKey, preparedResponse.response);
|
|
733
|
+
return preparedResponse.response;
|
|
734
|
+
})().finally(() => {
|
|
735
|
+
inflightFetchResponses.delete(cacheKey);
|
|
736
|
+
});
|
|
737
|
+
inflightFetchResponses.set(cacheKey, inflightResponse);
|
|
738
|
+
}
|
|
739
|
+
return deserializeFetchResponse(await inflightResponse, false, cache, cacheKey);
|
|
724
740
|
}
|
|
725
741
|
function enableCache() {
|
|
726
742
|
enabled = true;
|
|
@@ -729,6 +745,7 @@ function disableCache() {
|
|
|
729
745
|
enabled = false;
|
|
730
746
|
}
|
|
731
747
|
async function clearCache() {
|
|
748
|
+
inflightFetchResponses.clear();
|
|
732
749
|
return getCache().clear();
|
|
733
750
|
}
|
|
734
751
|
function isCacheEnabled() {
|
|
@@ -796,4 +813,4 @@ Object.defineProperty(exports, "isTransientConnectionError", {
|
|
|
796
813
|
}
|
|
797
814
|
});
|
|
798
815
|
|
|
799
|
-
//# sourceMappingURL=cache-
|
|
816
|
+
//# sourceMappingURL=cache-Dh5WtQps.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-DEq-mXcV.js";
|
|
2
2
|
import { _ as getEnvBool, b as getEnvString, g as getConfigDirectoryPath, i as logger, y as getEnvInt } from "./logger-DLcq4dWf.js";
|
|
3
|
-
import { d as sleep, n as fetchWithRetries, p as REQUEST_TIMEOUT_MS } from "./fetch-
|
|
3
|
+
import { d as sleep, n as fetchWithRetries, p as REQUEST_TIMEOUT_MS } from "./fetch-HaqdX7U1.js";
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { randomBytes } from "crypto";
|
|
@@ -607,6 +607,31 @@ function getCache() {
|
|
|
607
607
|
}
|
|
608
608
|
return cacheInstance;
|
|
609
609
|
}
|
|
610
|
+
const inflightFetchResponses = /* @__PURE__ */ new Map();
|
|
611
|
+
function serializeFetchResponse(data, status, statusText, headers, latencyMs) {
|
|
612
|
+
return JSON.stringify({
|
|
613
|
+
data,
|
|
614
|
+
status,
|
|
615
|
+
statusText,
|
|
616
|
+
headers,
|
|
617
|
+
latencyMs
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
function deserializeFetchResponse(response, cached, cache, cacheKey) {
|
|
621
|
+
const parsedResponse = JSON.parse(response);
|
|
622
|
+
return {
|
|
623
|
+
cached,
|
|
624
|
+
data: parsedResponse.data,
|
|
625
|
+
status: parsedResponse.status,
|
|
626
|
+
statusText: parsedResponse.statusText,
|
|
627
|
+
headers: parsedResponse.headers,
|
|
628
|
+
latencyMs: parsedResponse.latencyMs,
|
|
629
|
+
deleteFromCache: async () => {
|
|
630
|
+
await cache.del(cacheKey);
|
|
631
|
+
logger.debug(`Evicted from cache: ${cacheKey}`);
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
}
|
|
610
635
|
async function fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent) {
|
|
611
636
|
const maxBodyRetries = isIdempotent ? 2 : 0;
|
|
612
637
|
for (let bodyAttempt = 0; bodyAttempt <= maxBodyRetries; bodyAttempt++) {
|
|
@@ -636,6 +661,35 @@ async function fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent)
|
|
|
636
661
|
}
|
|
637
662
|
throw new Error("Exhausted body retries without returning or throwing");
|
|
638
663
|
}
|
|
664
|
+
async function prepareFetchResponse(url, options, timeout, maxRetries, isIdempotent, format) {
|
|
665
|
+
const result = await fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent);
|
|
666
|
+
const response = result.resp;
|
|
667
|
+
const responseText = result.respText;
|
|
668
|
+
const fetchLatencyMs = result.fetchLatencyMs;
|
|
669
|
+
const headers = Object.fromEntries(response.headers.entries());
|
|
670
|
+
try {
|
|
671
|
+
const parsedData = format === "json" ? JSON.parse(responseText) : responseText;
|
|
672
|
+
const serializedResponse = serializeFetchResponse(parsedData, response.status, response.statusText, headers, fetchLatencyMs);
|
|
673
|
+
if (!response.ok) return {
|
|
674
|
+
response: responseText === "" ? serializeFetchResponse(`Empty Response: ${response.status}: ${response.statusText}`, response.status, response.statusText, headers, fetchLatencyMs) : serializedResponse,
|
|
675
|
+
cacheable: false
|
|
676
|
+
};
|
|
677
|
+
if (format === "json" && parsedData?.error) {
|
|
678
|
+
logger.debug(`Not caching ${url} because it contains an 'error' key: ${parsedData.error}`);
|
|
679
|
+
return {
|
|
680
|
+
response: serializedResponse,
|
|
681
|
+
cacheable: false
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
logger.debug(`Storing ${url} response in cache with latencyMs=${fetchLatencyMs}: ${serializedResponse}`);
|
|
685
|
+
return {
|
|
686
|
+
response: serializedResponse,
|
|
687
|
+
cacheable: true
|
|
688
|
+
};
|
|
689
|
+
} catch (err) {
|
|
690
|
+
throw new Error(`Error parsing response from ${url}: ${err.message}. Received text: ${responseText}`);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
639
693
|
async function fetchWithCache(url, options = {}, timeout = REQUEST_TIMEOUT_MS, format = "json", bust = false, maxRetries) {
|
|
640
694
|
const method = (options.method ?? (url instanceof Request ? url.method : "GET")).toUpperCase();
|
|
641
695
|
const isIdempotent = [
|
|
@@ -665,61 +719,23 @@ async function fetchWithCache(url, options = {}, timeout = REQUEST_TIMEOUT_MS, f
|
|
|
665
719
|
delete copy.headers;
|
|
666
720
|
const cacheKey = `fetch:v2:${url}:${JSON.stringify(copy)}`;
|
|
667
721
|
const cache = await getCache();
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
latencyMs: fetchLatencyMs
|
|
686
|
-
});
|
|
687
|
-
if (!response.ok) {
|
|
688
|
-
if (responseText == "") errorResponse = JSON.stringify({
|
|
689
|
-
data: `Empty Response: ${response.status}: ${response.statusText}`,
|
|
690
|
-
status: response.status,
|
|
691
|
-
statusText: response.statusText,
|
|
692
|
-
headers,
|
|
693
|
-
latencyMs: fetchLatencyMs
|
|
694
|
-
});
|
|
695
|
-
else errorResponse = data;
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
if (!data) return;
|
|
699
|
-
if (format === "json" && parsedData?.error) {
|
|
700
|
-
logger.debug(`Not caching ${url} because it contains an 'error' key: ${parsedData.error}`);
|
|
701
|
-
return data;
|
|
702
|
-
}
|
|
703
|
-
logger.debug(`Storing ${url} response in cache with latencyMs=${fetchLatencyMs}: ${data}`);
|
|
704
|
-
return data;
|
|
705
|
-
} catch (err) {
|
|
706
|
-
throw new Error(`Error parsing response from ${url}: ${err.message}. Received text: ${responseText}`);
|
|
707
|
-
}
|
|
708
|
-
});
|
|
709
|
-
if (cached && cachedResponse) logger.debug(`Returning cached response for ${url}: ${cachedResponse}`);
|
|
710
|
-
const parsedResponse = JSON.parse(cachedResponse ?? errorResponse);
|
|
711
|
-
return {
|
|
712
|
-
cached,
|
|
713
|
-
data: parsedResponse.data,
|
|
714
|
-
status: parsedResponse.status,
|
|
715
|
-
statusText: parsedResponse.statusText,
|
|
716
|
-
headers: parsedResponse.headers,
|
|
717
|
-
latencyMs: parsedResponse.latencyMs,
|
|
718
|
-
deleteFromCache: async () => {
|
|
719
|
-
await cache.del(cacheKey);
|
|
720
|
-
logger.debug(`Evicted from cache: ${cacheKey}`);
|
|
721
|
-
}
|
|
722
|
-
};
|
|
722
|
+
const cachedResponse = await cache.get(cacheKey);
|
|
723
|
+
if (cachedResponse != null) {
|
|
724
|
+
logger.debug(`Returning cached response for ${url}: ${cachedResponse}`);
|
|
725
|
+
return deserializeFetchResponse(cachedResponse, true, cache, cacheKey);
|
|
726
|
+
}
|
|
727
|
+
let inflightResponse = inflightFetchResponses.get(cacheKey);
|
|
728
|
+
if (!inflightResponse) {
|
|
729
|
+
inflightResponse = (async () => {
|
|
730
|
+
const preparedResponse = await prepareFetchResponse(url, options, timeout, maxRetries, isIdempotent, format);
|
|
731
|
+
if (preparedResponse.cacheable) await cache.set(cacheKey, preparedResponse.response);
|
|
732
|
+
return preparedResponse.response;
|
|
733
|
+
})().finally(() => {
|
|
734
|
+
inflightFetchResponses.delete(cacheKey);
|
|
735
|
+
});
|
|
736
|
+
inflightFetchResponses.set(cacheKey, inflightResponse);
|
|
737
|
+
}
|
|
738
|
+
return deserializeFetchResponse(await inflightResponse, false, cache, cacheKey);
|
|
723
739
|
}
|
|
724
740
|
function enableCache() {
|
|
725
741
|
enabled = true;
|
|
@@ -728,6 +744,7 @@ function disableCache() {
|
|
|
728
744
|
enabled = false;
|
|
729
745
|
}
|
|
730
746
|
async function clearCache() {
|
|
747
|
+
inflightFetchResponses.clear();
|
|
731
748
|
return getCache().clear();
|
|
732
749
|
}
|
|
733
750
|
function isCacheEnabled() {
|
|
@@ -736,4 +753,4 @@ function isCacheEnabled() {
|
|
|
736
753
|
//#endregion
|
|
737
754
|
export { isCacheEnabled as a, isTransientConnectionError as c, getCache as i, disableCache as n, NON_TRANSIENT_HTTP_STATUSES as o, fetchWithCache as r, isNonTransientHttpStatus as s, cache_exports as t };
|
|
738
755
|
|
|
739
|
-
//# sourceMappingURL=cache-
|
|
756
|
+
//# sourceMappingURL=cache-i1P6crbO.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { C as getEnvString, O as state, S as getEnvInt, b as getEnvBool, o as logger, x as getEnvFloat } from "./logger-KkObSCzq.js";
|
|
3
|
-
import { S as transformTools, f as REQUEST_TIMEOUT_MS, x as transformToolChoice, y as parseChatPrompt } from "./fetch-
|
|
4
|
-
import { a as fetchWithCache } from "./cache-
|
|
3
|
+
import { S as transformTools, f as REQUEST_TIMEOUT_MS, x as transformToolChoice, y as parseChatPrompt } from "./fetch-Dxpd4_sr.js";
|
|
4
|
+
import { a as fetchWithCache } from "./cache-BVeDlD87.js";
|
|
5
5
|
import { i as isJavascriptFile } from "./fileExtensions-Ds-foDzt.js";
|
|
6
|
-
import { g as maybeLoadToolsFromExternalFile, h as maybeLoadResponseFormatFromExternalFile, m as maybeLoadFromExternalFileWithVars, x as renderVarsInObject } from "./util-
|
|
6
|
+
import { g as maybeLoadToolsFromExternalFile, h as maybeLoadResponseFormatFromExternalFile, m as maybeLoadFromExternalFileWithVars, x as renderVarsInObject } from "./util-C1CeHl-P.js";
|
|
7
7
|
import { r as importModule } from "./esm-C03C-mv3.js";
|
|
8
8
|
import { n as withGenAISpan } from "./genaiTracer-C1rxGO8Q.js";
|
|
9
|
-
import { C as applyQueryParams, D as renderAuthVars, E as getOAuthTokenWithExpiry, T as getAuthQueryParams, i as transformMCPToolsToOpenAi, w as getAuthHeaders } from "./transform-
|
|
9
|
+
import { C as applyQueryParams, D as renderAuthVars, E as getOAuthTokenWithExpiry, T as getAuthQueryParams, i as transformMCPToolsToOpenAi, w as getAuthHeaders } from "./transform-D5HsjduX.js";
|
|
10
10
|
import { t as OpenAiGenericProvider } from "./openai-DhbB7eWK.js";
|
|
11
|
-
import { a as calculateOpenAICost, c as getTokenUsage, t as OPENAI_CHAT_MODELS } from "./util-
|
|
11
|
+
import { a as calculateOpenAICost, c as getTokenUsage, t as OPENAI_CHAT_MODELS } from "./util-CMy69ZgQ.js";
|
|
12
12
|
import path from "path";
|
|
13
13
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
14
14
|
//#region src/util/finishReason.ts
|
|
@@ -445,8 +445,10 @@ var OpenAiChatCompletionProvider = class OpenAiChatCompletionProvider extends Op
|
|
|
445
445
|
const isReasoningModel = this.isReasoningModel();
|
|
446
446
|
const isGPT5Model = this.isGPT5Model();
|
|
447
447
|
const maxCompletionTokens = isReasoningModel ? config.max_completion_tokens ?? getEnvInt("OPENAI_MAX_COMPLETION_TOKENS") : void 0;
|
|
448
|
-
const
|
|
449
|
-
const
|
|
448
|
+
const maxTokensDefault = config.omitDefaults ? getEnvString("OPENAI_MAX_TOKENS") !== void 0 ? getEnvInt("OPENAI_MAX_TOKENS") : void 0 : getEnvInt("OPENAI_MAX_TOKENS", 1024);
|
|
449
|
+
const maxTokens = isReasoningModel || isGPT5Model ? void 0 : config.max_tokens ?? maxTokensDefault;
|
|
450
|
+
const temperatureDefault = config.omitDefaults ? getEnvString("OPENAI_TEMPERATURE") !== void 0 ? getEnvFloat("OPENAI_TEMPERATURE") : void 0 : getEnvFloat("OPENAI_TEMPERATURE", 0);
|
|
451
|
+
const temperature = this.supportsTemperature() ? config.temperature ?? temperatureDefault : void 0;
|
|
450
452
|
const reasoningEffort = isReasoningModel ? renderVarsInObject(config.reasoning_effort, context?.vars) : void 0;
|
|
451
453
|
const mcpTools = this.mcpClient ? transformMCPToolsToOpenAi(this.mcpClient.getAllTools()) : [];
|
|
452
454
|
const fileTools = transformTools(config.tools ? await maybeLoadToolsFromExternalFile(config.tools, context?.vars) || [] : [], "openai");
|
|
@@ -762,4 +764,4 @@ var OpenAiChatCompletionProvider = class OpenAiChatCompletionProvider extends Op
|
|
|
762
764
|
//#endregion
|
|
763
765
|
export { normalizeFinishReason as i, MCPClient as n, FINISH_REASON_MAP as r, OpenAiChatCompletionProvider as t };
|
|
764
766
|
|
|
765
|
-
//# sourceMappingURL=chat-
|
|
767
|
+
//# sourceMappingURL=chat-BiKyneZl.js.map
|
|
@@ -2,15 +2,15 @@ const require_logger = require("./logger-Cp1GPUjj.cjs");
|
|
|
2
2
|
const require_invariant = require("./invariant-kfQ8Bu82.cjs");
|
|
3
3
|
require("./esm-CnNt7sI4.cjs");
|
|
4
4
|
require("./pythonUtils-CTU3Y3lw.cjs");
|
|
5
|
-
require("./types-
|
|
6
|
-
require("./util-
|
|
7
|
-
require("./fetch-
|
|
8
|
-
require("./cache-
|
|
5
|
+
require("./types-C_7nyzr1.cjs");
|
|
6
|
+
require("./util-B9vlHIIh.cjs");
|
|
7
|
+
require("./fetch-BPkYtG8K.cjs");
|
|
8
|
+
require("./cache-Dh5WtQps.cjs");
|
|
9
9
|
require("./genaiTracer-DN4dQywX.cjs");
|
|
10
|
-
const require_chat = require("./chat-
|
|
11
|
-
require("./transform-
|
|
10
|
+
const require_chat = require("./chat-CgF-J-Jj.cjs");
|
|
11
|
+
require("./transform-DuHvhZpj.cjs");
|
|
12
12
|
require("./openai-Cuif0GEt.cjs");
|
|
13
|
-
require("./util-
|
|
13
|
+
require("./util-BzMcevZc.cjs");
|
|
14
14
|
//#region src/providers/hyperbolic/chat.ts
|
|
15
15
|
const HYPERBOLIC_CHAT_MODELS = [
|
|
16
16
|
{
|
|
@@ -296,4 +296,4 @@ function createHyperbolicProvider(providerPath, options = {}) {
|
|
|
296
296
|
//#endregion
|
|
297
297
|
exports.createHyperbolicProvider = createHyperbolicProvider;
|
|
298
298
|
|
|
299
|
-
//# sourceMappingURL=chat-
|
|
299
|
+
//# sourceMappingURL=chat-C1Qst7jL.cjs.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { i as logger } from "./logger-DLcq4dWf.js";
|
|
2
|
-
import "./fetch-
|
|
2
|
+
import "./fetch-HaqdX7U1.js";
|
|
3
3
|
import { t as invariant } from "./invariant-vgHWClmd.js";
|
|
4
4
|
import "./esm-CaIwzWR5.js";
|
|
5
|
-
import "./types-
|
|
6
|
-
import "./cache-
|
|
5
|
+
import "./types-CzW2QFyi.js";
|
|
6
|
+
import "./cache-i1P6crbO.js";
|
|
7
7
|
import "./genaiTracer-70Z8BIuV.js";
|
|
8
8
|
import "./pythonUtils-D6fwaDSg.js";
|
|
9
|
-
import "./util-
|
|
10
|
-
import { t as OpenAiChatCompletionProvider } from "./chat-
|
|
11
|
-
import "./transform-
|
|
9
|
+
import "./util-ZzmqNPlg.js";
|
|
10
|
+
import { t as OpenAiChatCompletionProvider } from "./chat-DJIw17u0.js";
|
|
11
|
+
import "./transform-uAytVuyX.js";
|
|
12
12
|
import "./openai-j-sE2O7r.js";
|
|
13
|
-
import "./util-
|
|
13
|
+
import "./util-BV4XUC0n.js";
|
|
14
14
|
//#region src/providers/hyperbolic/chat.ts
|
|
15
15
|
const HYPERBOLIC_CHAT_MODELS = [
|
|
16
16
|
{
|
|
@@ -296,4 +296,4 @@ function createHyperbolicProvider(providerPath, options = {}) {
|
|
|
296
296
|
//#endregion
|
|
297
297
|
export { createHyperbolicProvider };
|
|
298
298
|
|
|
299
|
-
//# sourceMappingURL=chat-
|
|
299
|
+
//# sourceMappingURL=chat-C2jrdPMx.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const require_logger = require("./logger-Cp1GPUjj.cjs");
|
|
2
2
|
const require_esm = require("./esm-CnNt7sI4.cjs");
|
|
3
3
|
const require_fileExtensions = require("./fileExtensions-bYh77CN8.cjs");
|
|
4
|
-
const require_util = require("./util-
|
|
5
|
-
const require_fetch = require("./fetch-
|
|
6
|
-
const require_cache = require("./cache-
|
|
4
|
+
const require_util = require("./util-B9vlHIIh.cjs");
|
|
5
|
+
const require_fetch = require("./fetch-BPkYtG8K.cjs");
|
|
6
|
+
const require_cache = require("./cache-Dh5WtQps.cjs");
|
|
7
7
|
const require_genaiTracer = require("./genaiTracer-DN4dQywX.cjs");
|
|
8
|
-
const require_transform = require("./transform-
|
|
8
|
+
const require_transform = require("./transform-DuHvhZpj.cjs");
|
|
9
9
|
const require_openai = require("./openai-Cuif0GEt.cjs");
|
|
10
|
-
const require_util$1 = require("./util-
|
|
10
|
+
const require_util$1 = require("./util-BzMcevZc.cjs");
|
|
11
11
|
let path = require("path");
|
|
12
12
|
path = require_logger.__toESM(path);
|
|
13
13
|
let _modelcontextprotocol_sdk_client_index_js = require("@modelcontextprotocol/sdk/client/index.js");
|
|
@@ -445,8 +445,10 @@ var OpenAiChatCompletionProvider = class OpenAiChatCompletionProvider extends re
|
|
|
445
445
|
const isReasoningModel = this.isReasoningModel();
|
|
446
446
|
const isGPT5Model = this.isGPT5Model();
|
|
447
447
|
const maxCompletionTokens = isReasoningModel ? config.max_completion_tokens ?? require_logger.getEnvInt("OPENAI_MAX_COMPLETION_TOKENS") : void 0;
|
|
448
|
-
const
|
|
449
|
-
const
|
|
448
|
+
const maxTokensDefault = config.omitDefaults ? require_logger.getEnvString("OPENAI_MAX_TOKENS") !== void 0 ? require_logger.getEnvInt("OPENAI_MAX_TOKENS") : void 0 : require_logger.getEnvInt("OPENAI_MAX_TOKENS", 1024);
|
|
449
|
+
const maxTokens = isReasoningModel || isGPT5Model ? void 0 : config.max_tokens ?? maxTokensDefault;
|
|
450
|
+
const temperatureDefault = config.omitDefaults ? require_logger.getEnvString("OPENAI_TEMPERATURE") !== void 0 ? require_logger.getEnvFloat("OPENAI_TEMPERATURE") : void 0 : require_logger.getEnvFloat("OPENAI_TEMPERATURE", 0);
|
|
451
|
+
const temperature = this.supportsTemperature() ? config.temperature ?? temperatureDefault : void 0;
|
|
450
452
|
const reasoningEffort = isReasoningModel ? require_util.renderVarsInObject(config.reasoning_effort, context?.vars) : void 0;
|
|
451
453
|
const mcpTools = this.mcpClient ? require_transform.transformMCPToolsToOpenAi(this.mcpClient.getAllTools()) : [];
|
|
452
454
|
const fileTools = require_fetch.transformTools(config.tools ? await require_util.maybeLoadToolsFromExternalFile(config.tools, context?.vars) || [] : [], "openai");
|
|
@@ -785,4 +787,4 @@ Object.defineProperty(exports, "normalizeFinishReason", {
|
|
|
785
787
|
}
|
|
786
788
|
});
|
|
787
789
|
|
|
788
|
-
//# sourceMappingURL=chat-
|
|
790
|
+
//# sourceMappingURL=chat-CgF-J-Jj.cjs.map
|