promptfoo 0.120.27 → 0.121.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/src/{ListApp-8WOe2nT6.js → ListApp-Du7YVwj5.js} +2 -4
- package/dist/src/accounts-BgNJDBE6.js +206 -0
- package/dist/src/{accounts-Fl2J3_Fu.cjs → accounts-Bx-x3bmW.cjs} +77 -78
- package/dist/src/{accounts-DVINui-2.js → accounts-CMqkzrVf.js} +39 -34
- package/dist/src/{accounts-CPDRAMND.js → accounts-xrUGFA6n.js} +38 -33
- package/dist/src/{agentic-utils-D922n6mm.js → agentic-utils-BKIN5PKu.js} +9 -10
- package/dist/src/{agents-BO2n8Z0d.cjs → agents-B0f4HICh.cjs} +37 -40
- package/dist/src/{agents-BXLmVsxR.js → agents-C-dDThPK.js} +37 -37
- package/dist/src/{agents-DgJf2-ez.cjs → agents-CErsqg5U.cjs} +16 -17
- package/dist/src/{agents-BcsN_BgB.js → agents-CVIn-Utx.js} +16 -12
- package/dist/src/{agents-hqgSV-3o.js → agents-CXknwsFX.js} +37 -40
- package/dist/src/{agents-pMfppv9Z.js → agents-DeH4Gu94.js} +18 -18
- package/dist/src/{agents-BdUTAwi-.js → agents-Dy2YpZpa.js} +38 -41
- package/dist/src/{agents-DNvSH78i.js → agents-aF4-T121.js} +16 -20
- package/dist/src/{aimlapi-DOib86oE.js → aimlapi-BAGZDo5G.js} +16 -18
- package/dist/src/{aimlapi-DtgPI0nE.js → aimlapi-BNfTBexL.js} +15 -17
- package/dist/src/{aimlapi-DTPACCB1.js → aimlapi-DHRKlBEA.js} +15 -4
- package/dist/src/{aimlapi-BE_Tg9Fl.cjs → aimlapi-tg0Gkcvr.cjs} +15 -16
- package/dist/src/app/assets/index-BFCZg7hQ.js +439 -0
- package/dist/src/app/index.html +1 -1
- package/dist/src/{audio-BRYU0BFo.js → audio-BRODU0UK.js} +7 -9
- package/dist/src/{audio-Cwo68yZS.cjs → audio-BWeaWovU.cjs} +6 -7
- package/dist/src/{audio-BnRUGAm_.js → audio-CHQ4r-RV.js} +6 -5
- package/dist/src/{audio-MSRki4JU.js → audio-tf_NBjlC.js} +6 -8
- package/dist/src/{base-h961VXYk.js → base-B0tcrnq_.js} +11 -13
- package/dist/src/{base-XB2tDJrB.js → base-B4QJRyFS.js} +11 -13
- package/dist/src/{base-pGVmXNl4.cjs → base-DBtwl2FR.cjs} +36 -38
- package/dist/src/base-fEDN28WM.js +193 -0
- package/dist/src/{blobs-BM_e6hCa.js → blobs-BAU-dXan.js} +9 -12
- package/dist/src/{blobs-CR5C4Ihh.js → blobs-Bpg5rH6i.js} +9 -12
- package/dist/src/{blobs-B-KQAFhX.cjs → blobs-DvS-O6be.cjs} +34 -37
- package/dist/src/blobs-qTYm-1PY.js +236 -0
- package/dist/src/{cache-CIpsoBZR.js → cache-8XhNqPKW.js} +64 -67
- package/dist/src/cache-Bbn1Nyrd.cjs +5 -0
- package/dist/src/cache-BwsMSda7.js +6 -0
- package/dist/src/{cache-jsiwsAJv.js → cache-CG0SlR1d.js} +64 -66
- package/dist/src/{cache-BTVYfbka.cjs → cache-COish3-W.cjs} +114 -117
- package/dist/src/cache-D3eqDYGU.js +739 -0
- package/dist/src/{chat-D31K7C4u.cjs → chat-2K608PeQ.cjs} +20 -21
- package/dist/src/chat-BKm79wib.js +764 -0
- package/dist/src/{chat-B84t99NW.js → chat-CM_kyI8B.js} +20 -9
- package/dist/src/{chat-BcPjZXIp.js → chat-CRWNNq73.js} +41 -44
- package/dist/src/{chat-CcUCysjU.js → chat-CznLWr_D.js} +41 -44
- package/dist/src/{chat-DwWifjxi.js → chat-DHMH-N64.js} +20 -22
- package/dist/src/{chat-BE44YOc6.cjs → chat-DaqekjFr.cjs} +61 -64
- package/dist/src/{chat-DZM2GUHO.js → chat-DxysjBvt.js} +21 -23
- package/dist/src/{chatkit-D67HS_0b.js → chatkit-65VXf5SR.js} +58 -58
- package/dist/src/{chatkit-DAB_qfzI.js → chatkit-Be-Q-a9F.js} +58 -60
- package/dist/src/{chatkit-Biqb_wsD.js → chatkit-BxFvW8KY.js} +58 -60
- package/dist/src/{chatkit-PGG4ZYIn.cjs → chatkit-DKyPi1Gs.cjs} +58 -60
- package/dist/src/chunk-DEq-mXcV.js +15 -0
- package/dist/src/chunk-DRamLcfz.js +16 -0
- package/dist/src/{claude-agent-sdk-SVM6AdBu.js → claude-agent-sdk-BLTu0WBO.js} +31 -31
- package/dist/src/{claude-agent-sdk-C9SiaQub.cjs → claude-agent-sdk-CJH22shf.cjs} +31 -28
- package/dist/src/{claude-agent-sdk-C-IOTPfo.js → claude-agent-sdk-D6_k9FKA.js} +31 -29
- package/dist/src/{claude-agent-sdk-CiluSyW1.js → claude-agent-sdk-Dy5lT-Tx.js} +33 -20
- package/dist/src/{cloud-CZ-q9Ier.js → cloud-Bc9526yV.js} +7 -9
- package/dist/src/cloud-DmE0EwsY.js +4 -0
- package/dist/src/{cloudflare-ai-BahKHyhh.js → cloudflare-ai-C9r2sRhw.js} +16 -18
- package/dist/src/{cloudflare-ai-Dxyt50Nl.js → cloudflare-ai-CWWJCRim.js} +16 -4
- package/dist/src/{cloudflare-ai-Dfahv5SY.cjs → cloudflare-ai-ClWSdor4.cjs} +16 -17
- package/dist/src/{cloudflare-ai-v_qZD6_q.js → cloudflare-ai-ICsOuD-z.js} +17 -19
- package/dist/src/{cloudflare-gateway-BPWoZIzJ.cjs → cloudflare-gateway-C2_-KG5o.cjs} +21 -22
- package/dist/src/{cloudflare-gateway-Bi_FpOFy.js → cloudflare-gateway-D6O7AlYb.js} +23 -23
- package/dist/src/{cloudflare-gateway-btS7h1OZ.js → cloudflare-gateway-D6xFc5pa.js} +21 -25
- package/dist/src/{cloudflare-gateway-C0guUNwk.js → cloudflare-gateway-pXGHxJ47.js} +26 -14
- package/dist/src/{codex-sdk-DSxAnbfT.js → codex-sdk-C6UMlxwV.js} +28 -29
- package/dist/src/{codex-sdk-IYVi9fuM.js → codex-sdk-DUwKWezN.js} +28 -27
- package/dist/src/{codex-sdk-DulY0ZRq.js → codex-sdk-GGAw0qbD.js} +28 -29
- package/dist/src/{codex-sdk-DFKMtAyf.cjs → codex-sdk-fAO0c3yA.cjs} +28 -29
- package/dist/src/{cometapi-DkNBMk0G.js → cometapi-BasUi7-_.js} +17 -19
- package/dist/src/{cometapi-DzrR3SR_.js → cometapi-Bbjp5V4x.js} +16 -4
- package/dist/src/{cometapi-C9EEpJzT.js → cometapi-DkXrKi5z.js} +21 -24
- package/dist/src/{cometapi-DIO64tf4.cjs → cometapi-vY6aDZgo.cjs} +21 -22
- package/dist/src/{completion-CG29bfKX.js → completion-6Mx_iXxK.js} +11 -13
- package/dist/src/{completion-Bgf1VJoq.js → completion-C5rtR_9P.js} +11 -13
- package/dist/src/{completion-CCRT4kX1.cjs → completion-CDOouNzq.cjs} +21 -23
- package/dist/src/completion-C_P3ypkJ.js +120 -0
- package/dist/src/{createHash-Dw_iLu31.js → createHash-CTQmL3G2.js} +2 -3
- package/dist/src/{createHash-CYQy4YeL.cjs → createHash-CfZSc0b4.cjs} +13 -14
- package/dist/src/{createHash-CJcfskIZ.js → createHash-Da8fMwqB.js} +2 -3
- package/dist/src/createHash-DmPQkvBh.js +15 -0
- package/dist/src/{docker-D-ayp2FW.js → docker-5KcG-_86.js} +18 -20
- package/dist/src/{docker-DNcLR4Ig.cjs → docker-BwsKwxFs.cjs} +18 -19
- package/dist/src/{docker-egERKxCF.js → docker-CZnqU1XV.js} +18 -7
- package/dist/src/{docker-B81N0t4e.js → docker-DzxyDPIj.js} +19 -21
- package/dist/src/entrypoint.js +2 -3
- package/dist/src/{errors-DnGCbnx8.js → errors-P6ll7XSJ.js} +2 -2
- package/dist/src/{esm-B9dPm_BF.js → esm-C03C-mv3.js} +17 -20
- package/dist/src/{esm-D2pZ87fL.js → esm-CaIwzWR5.js} +18 -21
- package/dist/src/esm-Cd1AjG1D.js +379 -0
- package/dist/src/{esm-Ct-Joyue.cjs → esm-CnNt7sI4.cjs} +47 -49
- package/dist/src/eval-17JizQIv.js +15 -0
- package/dist/src/{eval-C-Nr6wX_.js → eval-DmFyWU7i.js} +47 -54
- package/dist/src/{evalResult-4BzI2tmj.js → evalResult-CDQiuUuf.js} +16 -12
- package/dist/src/{evalResult-DXMWJ3sx.js → evalResult-CTG2AHOS.js} +10 -11
- package/dist/src/evalResult-Cqj8pldJ.js +12 -0
- package/dist/src/{evalResult-CX8wQecI.cjs → evalResult-Dap2CekP.cjs} +20 -21
- package/dist/src/evalResult-DvcJAWJU.cjs +10 -0
- package/dist/src/evalResult-Hftn-S_i.js +10 -0
- package/dist/src/evaluator-B2CFNt-P.js +36 -0
- package/dist/src/{evaluator-8aGyV12L.js → evaluator-DPFRbFIL.js} +201 -229
- package/dist/src/{extractor-CD5yKL-G.js → extractor-CFG6bcWJ.js} +22 -24
- package/dist/src/{extractor-C031XmTA.cjs → extractor-DX36oYEv.cjs} +37 -39
- package/dist/src/{extractor-V5x_m1i0.js → extractor-M67RUtg6.js} +22 -24
- package/dist/src/extractor-YMU_Gvt8.js +374 -0
- package/dist/src/{fetch-D3OHf-lV.js → fetch-4M3YRaqL.js} +40 -45
- package/dist/src/fetch-60Gzydls.js +777 -0
- package/dist/src/{fetch-CXZI9RRr.js → fetch-BMv0O527.js} +23 -35
- package/dist/src/{fetch-BmbD-v1L.cjs → fetch-BxUk8odA.cjs} +244 -277
- package/dist/src/fetch-KV5kNASw.js +5 -0
- package/dist/src/{fileExtensions-ePDqouxn.js → fileExtensions-DnqA1y9x.js} +2 -2
- package/dist/src/{fileExtensions-BpuMmaFL.js → fileExtensions-Ds-foDzt.js} +2 -2
- package/dist/src/fileExtensions-LcDYkU4v.js +85 -0
- package/dist/src/{fileExtensions-DkJYkWUy.cjs → fileExtensions-bYh77CN8.cjs} +27 -28
- package/dist/src/{formatDuration-CdevI3An.js → formatDuration-DgBVMN65.js} +2 -2
- package/dist/src/{genaiTracer-Ce19n68P.js → genaiTracer-70Z8BIuV.js} +2 -3
- package/dist/src/{genaiTracer-CqNnnXrE.js → genaiTracer-C1rxGO8Q.js} +2 -3
- package/dist/src/genaiTracer-D3fD9dNV.js +256 -0
- package/dist/src/{genaiTracer-Dres3qrN.cjs → genaiTracer-DN4dQywX.cjs} +13 -14
- package/dist/src/graders-Bu0H9nXi.js +32 -0
- package/dist/src/{graders-DTeBrzWp.js → graders-CHO8EPM4.js} +349 -397
- package/dist/src/graders-Cfhkvx-e.js +34 -0
- package/dist/src/{graders--1y2u9HO.js → graders-CpdqD9PI.js} +349 -397
- package/dist/src/graders-DClJVpGP.cjs +32 -0
- package/dist/src/{graders-DohM2dir.cjs → graders-DOXycdlG.cjs} +684 -732
- package/dist/src/graders-DcnJsrMO.js +32 -0
- package/dist/src/graders-R9rYUM0d.js +13466 -0
- package/dist/src/{image-C3wHC9_h.js → image-BmEZqVmk.js} +9 -10
- package/dist/src/{image-O1u4bCFg.js → image-CBBVXWuT.js} +9 -10
- package/dist/src/{image-DpKl2F15.cjs → image-CDLQOcqT.cjs} +6 -7
- package/dist/src/{image-DmE-niFE.js → image-DJEvKveK.js} +6 -5
- package/dist/src/{image-CuKHuccK.cjs → image-DTedmQPg.cjs} +29 -30
- package/dist/src/{image-B0U4Hqll.js → image-gvmivTEe.js} +7 -9
- package/dist/src/image-pAX56tPG.js +257 -0
- package/dist/src/{image-DNEIf_aI.js → image-tL5hIOFh.js} +6 -8
- package/dist/src/index.cjs +605 -689
- package/dist/src/index.d.cts +11 -7
- package/dist/src/index.d.ts +11 -3
- package/dist/src/index.js +570 -658
- package/dist/src/{interactiveCheck-Bxj1Swex.js → interactiveCheck-BgLZUIt3.js} +7 -8
- package/dist/src/{invariant-DT20jrBd.js → invariant-BtWWVVhl.js} +2 -2
- package/dist/src/{invariant-1pAf2CD1.js → invariant-Ddh24eXh.js} +2 -2
- package/dist/src/{invariant-CKcJAQ6M.cjs → invariant-kfQ8Bu82.cjs} +7 -8
- package/dist/src/invariant-vgHWClmd.js +25 -0
- package/dist/src/{knowledgeBase-Be_zyW4L.js → knowledgeBase-CLJybhnF.js} +16 -16
- package/dist/src/{knowledgeBase-CEzQobWX.js → knowledgeBase-CoU-UQBg.js} +14 -9
- package/dist/src/{knowledgeBase-BZ41IFwq.js → knowledgeBase-DjWPVqSb.js} +14 -18
- package/dist/src/{knowledgeBase-D-5BMXlr.cjs → knowledgeBase-wkxuRFhA.cjs} +14 -15
- package/dist/src/{litellm-DnbRJ2if.js → litellm-B9Hysuri.js} +16 -18
- package/dist/src/{litellm-CRDqPhNI.js → litellm-CTfa0hqi.js} +15 -17
- package/dist/src/{litellm-hUSNM_M2.cjs → litellm-NYpQ8RQu.cjs} +15 -16
- package/dist/src/{litellm-9vR8zpfU.js → litellm-ePxtr9F1.js} +15 -4
- package/dist/src/{logger-CG1uZPbQ.js → logger-CT3IKMKA.js} +10 -29
- package/dist/src/{logger-B7sBeGa0.cjs → logger-Cp1GPUjj.cjs} +152 -180
- package/dist/src/logger-DLcq4dWf.js +713 -0
- package/dist/src/{logger-LSBxlt7a.js → logger-KkObSCzq.js} +13 -31
- package/dist/src/{luma-ray-Hm3d6VJE.cjs → luma-ray-B0GGNRc1.cjs} +20 -21
- package/dist/src/{luma-ray-drvgdpP9.js → luma-ray-BE2mOt6N.js} +20 -13
- package/dist/src/{luma-ray-4blv9iZ2.js → luma-ray-BW9IRGIc.js} +22 -21
- package/dist/src/{luma-ray-B2__8lYH.js → luma-ray-Cm1KZBhs.js} +20 -23
- package/dist/src/main.js +1170 -1321
- package/dist/src/{messages-XhiwCbi4.cjs → messages-1JrJs91T.cjs} +32 -34
- package/dist/src/{messages-CGPPidQr.js → messages-1x9atZmP.js} +22 -24
- package/dist/src/{messages-Uee41Mj5.js → messages-BLbWdsyt.js} +22 -24
- package/dist/src/messages-D8EA0oDc.js +240 -0
- package/dist/src/{meteor-BYykdXrV.js → meteor-44VjEACX.js} +3 -4
- package/dist/src/{meteor-CsopaHrH.js → meteor-D-SotUw9.js} +3 -4
- package/dist/src/{meteor-e-E-2vVl.cjs → meteor-DLZZ3osF.cjs} +3 -4
- package/dist/src/{meteor-C8lGP6P4.js → meteor-DUiCJRC-.js} +3 -4
- package/dist/src/{modelslab-yKz-ZNB4.js → modelslab-C1OLRmVX.js} +17 -10
- package/dist/src/{modelslab-E9gO-bYd.js → modelslab-CqXBy3U8.js} +18 -20
- package/dist/src/{modelslab-lUVW0cmB.cjs → modelslab-DcOSFwKh.cjs} +17 -18
- package/dist/src/{modelslab-ClBkr8_9.js → modelslab-X5-4LroM.js} +17 -19
- package/dist/src/{nova-reel-Dk8jNpId.js → nova-reel-BgS1ZWuK.js} +20 -13
- package/dist/src/{nova-reel-u2eF2Cxm.js → nova-reel-D2ZkOSyr.js} +22 -21
- package/dist/src/{nova-reel-D8CuO6QH.cjs → nova-reel-D9xfaMBs.cjs} +20 -21
- package/dist/src/{nova-reel-P9bwvtYX.js → nova-reel-DihqLeol.js} +20 -23
- package/dist/src/{nova-sonic-Ds1C-dpm.cjs → nova-sonic-DVu3mMIy.cjs} +30 -31
- package/dist/src/{nova-sonic-CK2rAiKi.js → nova-sonic-DezhVUYT.js} +30 -26
- package/dist/src/{nova-sonic-BaqWlkds.js → nova-sonic-P-CdUMlV.js} +30 -31
- package/dist/src/{nova-sonic-yZapPLv7.js → nova-sonic-Q3BOJeig.js} +31 -32
- package/dist/src/{openai-DUFopMrH.cjs → openai-Cuif0GEt.cjs} +8 -9
- package/dist/src/{openai-PblZ3jUE.js → openai-DElQ-fPX.js} +3 -4
- package/dist/src/{openai-CcN1B8Sb.js → openai-DhbB7eWK.js} +3 -4
- package/dist/src/openai-j-sE2O7r.js +44 -0
- package/dist/src/{openclaw-A-3_loM7.js → openclaw-BiSZPL7J.js} +20 -14
- package/dist/src/{openclaw-COn6QzDi.js → openclaw-Bv1DINsX.js} +20 -27
- package/dist/src/{openclaw-a3lylB-V.js → openclaw-D1D_ej1z.js} +21 -28
- package/dist/src/{openclaw-B6qqDr_u.cjs → openclaw-DAfWQn-o.cjs} +33 -39
- package/dist/src/opencode-sdk-C7m-wRfI.js +560 -0
- package/dist/src/opencode-sdk-CfaLN8PY.cjs +564 -0
- package/dist/src/opencode-sdk-D95s6SnR.js +562 -0
- package/dist/src/opencode-sdk-DxUPkLT7.js +560 -0
- package/dist/src/{otlpReceiver-oyf5wLGC.js → otlpReceiver--AIRW_S4.js} +53 -51
- package/dist/src/{otlpReceiver-BmmTiMjA.js → otlpReceiver-Bn5wGB1v.js} +53 -55
- package/dist/src/{otlpReceiver-lXsYVbpj.cjs → otlpReceiver-Diec4cln.cjs} +53 -55
- package/dist/src/{otlpReceiver-94URx7UW.js → otlpReceiver-g3ByGaXs.js} +53 -55
- package/dist/src/{providerRegistry-Cq_JK_CJ.js → providerRegistry-B0RUOLI_.js} +7 -8
- package/dist/src/{providerRegistry-DSSHjMKf.js → providerRegistry-CD8MEar9.js} +7 -8
- package/dist/src/{providerRegistry-CvHEVJad.cjs → providerRegistry-Civky8Ar.cjs} +12 -13
- package/dist/src/providerRegistry-DM8rZYol.js +45 -0
- package/dist/src/providers-B3HvufyI.js +33246 -0
- package/dist/src/{providers-BnFpbY_s.js → providers-BKRJTjBz.js} +1536 -1669
- package/dist/src/providers-C1rOSHiR.js +32 -0
- package/dist/src/{providers-Iil64vk9.js → providers-CFLy1_ji.js} +1543 -1676
- package/dist/src/{providers-DHbjzW2e.cjs → providers-CFu-TZl-.cjs} +1896 -2029
- package/dist/src/providers-CxmDwEFf.cjs +31 -0
- package/dist/src/providers-Dodakqr0.js +30 -0
- package/dist/src/providers-GIQ2TcsA.js +30 -0
- package/dist/src/{pythonUtils-CcT5LH1M.js → pythonUtils-C3py6GC1.js} +18 -19
- package/dist/src/{pythonUtils-DBbuI3QJ.cjs → pythonUtils-CTU3Y3lw.cjs} +42 -43
- package/dist/src/{pythonUtils-hZ8LeQLv.js → pythonUtils-D5nxkQ0P.js} +18 -19
- package/dist/src/pythonUtils-D6fwaDSg.js +249 -0
- package/dist/src/{quiverai-BuI0tE39.js → quiverai-C2jVwbH1.js} +8 -7
- package/dist/src/{quiverai-DCGSZt4U.js → quiverai-CI6gYJVI.js} +8 -10
- package/dist/src/{quiverai-DiMVJQDz.cjs → quiverai-CLkWkyZc.cjs} +8 -9
- package/dist/src/{quiverai-fQNkExW4.js → quiverai-MHSxbmmZ.js} +9 -11
- package/dist/src/{render-Dj1smHEb.js → render-Drod8m7K.js} +4 -5
- package/dist/src/{responses-DOAFFENS.js → responses-BKqJmhhc.js} +22 -25
- package/dist/src/{responses-CxzoQoBe.js → responses-CGw0DCzh.js} +22 -25
- package/dist/src/responses-jxdehPkC.js +660 -0
- package/dist/src/{responses-ghR3IOfy.cjs → responses-tD4Bd4dc.cjs} +37 -40
- package/dist/src/rubyUtils-BUHu6PhO.js +5 -0
- package/dist/src/{rubyUtils-CwbGmgYN.js → rubyUtils-BUVePouc.js} +27 -20
- package/dist/src/rubyUtils-BcuGX77l.js +222 -0
- package/dist/src/{rubyUtils-DudlFZed.js → rubyUtils-Boc4HZzX.js} +18 -19
- package/dist/src/rubyUtils-CP42kMvq.cjs +4 -0
- package/dist/src/{rubyUtils-C8MhKGHb.cjs → rubyUtils-DhCAlxZr.cjs} +48 -50
- package/dist/src/{sagemaker-gmskuyre.js → sagemaker-BK4Zb993.js} +75 -70
- package/dist/src/{sagemaker-DuM71dVU.js → sagemaker-BfiWTmvn.js} +77 -77
- package/dist/src/{sagemaker-77zbJ2Q2.cjs → sagemaker-CcQHM1jV.cjs} +75 -76
- package/dist/src/{sagemaker-CcxhlOAR.js → sagemaker-D2Q1c-sD.js} +75 -79
- package/dist/src/{scanner-DJYiSXQj.js → scanner-J8CA3LsV.js} +100 -121
- package/dist/src/server/index.js +5505 -67416
- package/dist/src/{server-B5v33lvE.cjs → server-B0PPuDw-.cjs} +57 -67
- package/dist/src/server-B1vi21hA.js +7 -0
- package/dist/src/{server-RV_i_YX5.js → server-BC7XJFgr.js} +19 -24
- package/dist/src/server-Cm9Kai_h.cjs +5 -0
- package/dist/src/{server-BJ4m4f1D.js → server-DbFphssR.js} +26 -29
- package/dist/src/server-OAs3nBRT.js +229 -0
- package/dist/src/{signal-BW33JuId.js → signal-BOTbd53Z.js} +9 -11
- package/dist/src/{slack-DEURelTy.cjs → slack-BmVAVGaK.cjs} +7 -8
- package/dist/src/{slack-BQYeW9L3.js → slack-DCUPTzS2.js} +8 -8
- package/dist/src/{slack-BB6yuZzp.js → slack-DOdy_kyv.js} +7 -8
- package/dist/src/{slack-2pRrhhgJ.js → slack-DXMKtA-f.js} +7 -9
- package/dist/src/store-BNmZ1KAz.cjs +5 -0
- package/dist/src/{store-D7CgQzAR.cjs → store-BSc-TF2w.cjs} +44 -45
- package/dist/src/store-BltJg2cd.js +6 -0
- package/dist/src/{store-s3SftUwF.js → store-D1tv90v3.js} +34 -35
- package/dist/src/{store-DJNsD1iC.js → store-DQLEjuEO.js} +40 -36
- package/dist/src/store-Ub2vaGJ1.js +228 -0
- package/dist/src/{tables-DfTsNN7X.js → tables-5EvT_Bwn.js} +19 -21
- package/dist/src/{tables-BKTmd6u7.cjs → tables-C7K-XKWp.cjs} +89 -91
- package/dist/src/{tables-DMegD0Xf.js → tables-D36WTqKX.js} +21 -23
- package/dist/src/tables-xKANLRBD.js +288 -0
- package/dist/src/telemetry-5BCRNBbe.cjs +5 -0
- package/dist/src/{telemetry-BedSm-bZ.js → telemetry-C15ziL8u.js} +17 -14
- package/dist/src/{telemetry--WAdAfVi.js → telemetry-C2YDkUQH.js} +11 -13
- package/dist/src/{telemetry-DQgVBCAb.cjs → telemetry-CbrnxHp_.cjs} +21 -24
- package/dist/src/telemetry-D4W5hboe.js +7 -0
- package/dist/src/telemetry-DMb2Mpfm.js +171 -0
- package/dist/src/{text-oiSbwSOI.js → text-B_UCRPp2.js} +2 -2
- package/dist/src/{text-oKzCBnK6.cjs → text-CW1cyrwj.cjs} +12 -13
- package/dist/src/{text-B_IrO4GZ.js → text-Db-Wt2u2.js} +2 -2
- package/dist/src/text-TIv0QYnd.js +22 -0
- package/dist/src/{tokenUsageUtils-FZd5O_4A.js → tokenUsageUtils-BDGe-iyI.js} +2 -2
- package/dist/src/{tokenUsageUtils-DmZSD2eU.js → tokenUsageUtils-DflFMjS0.js} +2 -2
- package/dist/src/tokenUsageUtils-NYT-WKS6.js +138 -0
- package/dist/src/{tokenUsageUtils-CXhxVj72.cjs → tokenUsageUtils-bVa1ga6f.cjs} +32 -33
- package/dist/src/{transcription-BO1AHegO.cjs → transcription-CL78qbOU.cjs} +14 -15
- package/dist/src/{transcription-mYS9vd5v.js → transcription-DAtxHhAM.js} +14 -7
- package/dist/src/{transcription-X2-B4vkX.js → transcription-LNZTNUUL.js} +14 -16
- package/dist/src/{transcription-lzBLiTFJ.js → transcription-QHh3AH6Z.js} +15 -17
- package/dist/src/{transform-DeGlxb0D.js → transform-Cgi24fJ7.js} +39 -47
- package/dist/src/{transform-B1Hi5lWS.cjs → transform-CzK1Q0zl.cjs} +24 -26
- package/dist/src/{transform-CYDILYDe.js → transform-DECvGmzp.js} +15 -13
- package/dist/src/{transform-Dfl89yi4.js → transform-DGLazrMm.js} +39 -47
- package/dist/src/transform-DGxXocjk.js +1506 -0
- package/dist/src/{transform-D5PjiWiZ.cjs → transform-DOcQeLld.cjs} +179 -187
- package/dist/src/transform-DTGDnAzW.js +6 -0
- package/dist/src/{transform-BEgStbHK.js → transform-DilY9wbS.js} +10 -12
- package/dist/src/transform-aa6tmVpZ.js +216 -0
- package/dist/src/transform-m3qNw4KP.cjs +5 -0
- package/dist/src/{transformersAvailability-SZnTS3pJ.js → transformersAvailability-CEVM2GNQ.js} +2 -2
- package/dist/src/{transformersAvailability-D-glmEy7.cjs → transformersAvailability-CwayUSlh.cjs} +2 -3
- package/dist/src/{transformersAvailability-CjeFXhuJ.js → transformersAvailability-D6c6ROpT.js} +2 -2
- package/dist/src/{types-CXQduE9o.js → types-CH3Ge2sE.js} +30 -90
- package/dist/src/{types-C5hEkb-x.js → types-CLKiCBW3.js} +25 -89
- package/dist/src/types-CN_TZ2GJ.js +3260 -0
- package/dist/src/{types-DWNf48sT.cjs → types-LJ0r3wbR.cjs} +500 -564
- package/dist/src/util-5cB-L7U3.js +1430 -0
- package/dist/src/util-6-GqIvzS.js +599 -0
- package/dist/src/{util-CoQjmE3u.js → util-B7T3SiBS.js} +4 -5
- package/dist/src/{util-D9eLdGfa.js → util-Betm42rL.js} +5 -6
- package/dist/src/{util-Bm_-UMD_.js → util-C-PPYSMq.js} +5 -6
- package/dist/src/{util-CyUdMzV0.cjs → util-CchiqXh_.cjs} +34 -35
- package/dist/src/{util-Du96oyYS.js → util-DaWTWKBK.js} +4 -5
- package/dist/src/{util-1wWM599Z.cjs → util-Db0a0AFH.cjs} +50 -51
- package/dist/src/{util-DQ984syk.js → util-Dlz_Wvgm.js} +37 -48
- package/dist/src/{util-_h4pVqrz.js → util-YT5HPZaS.js} +37 -48
- package/dist/src/{util-aLhtl3fe.cjs → util-Yz-1aEhW.cjs} +209 -220
- package/dist/src/util-ZZH-3QZz.js +293 -0
- package/dist/src/{utils-BjLy-Q72.cjs → utils-Cz9qXqII.cjs} +29 -32
- package/dist/src/{utils-CFMn2yHW.js → utils-XiOAgly5.js} +4 -7
- package/dist/src/utils-dLokC-eR.js +94 -0
- package/dist/src/{utils-DvWMzuMx.js → utils-f2-Moju7.js} +4 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -30
- package/dist/src/app/assets/index-B2D0bCSI.js +0 -439
- package/dist/src/app/tsconfig.app.tsbuildinfo +0 -1
- package/dist/src/cache-ChPcurj7.js +0 -6
- package/dist/src/cache-VVu_W-yg.js +0 -8
- package/dist/src/cache-YLNCFEM2.cjs +0 -6
- package/dist/src/chunk-DHDDz29n.js +0 -22
- package/dist/src/chunk-FhC4c-0y.js +0 -21
- package/dist/src/cloud-BndfXy4H.js +0 -5
- package/dist/src/eval-BhHvMY82.js +0 -17
- package/dist/src/evalResult-Dq2gFNQY.js +0 -12
- package/dist/src/evalResult-nmcP5VKH.cjs +0 -12
- package/dist/src/evalResult-trqZjVYh.js +0 -14
- package/dist/src/evaluator-CnfPstzT.js +0 -39
- package/dist/src/fetch-IDPDue6F.cjs +0 -4
- package/dist/src/fetch-hKJ-It8q.js +0 -6
- package/dist/src/fetch-ouKnrWK-.js +0 -4
- package/dist/src/graders-CQn7WUsd.cjs +0 -34
- package/dist/src/graders-DC6QAbpW.js +0 -35
- package/dist/src/graders-DUWz3Y7j.js +0 -37
- package/dist/src/opencode-sdk-4bL9n-Gk.js +0 -382
- package/dist/src/opencode-sdk-BfC2zWcR.js +0 -376
- package/dist/src/opencode-sdk-DMJyuwMg.js +0 -380
- package/dist/src/opencode-sdk-Da-9adza.cjs +0 -383
- package/dist/src/providers-CsXB2Ix-.js +0 -35
- package/dist/src/providers-DO8ltjLC.js +0 -33
- package/dist/src/providers-Dtq-xnXd.cjs +0 -33
- package/dist/src/rubyUtils-BUbcND2f.js +0 -6
- package/dist/src/rubyUtils-Cr55X_KE.js +0 -5
- package/dist/src/rubyUtils-DlIiqoYo.cjs +0 -5
- package/dist/src/server-C2eQH4Gu.js +0 -6
- package/dist/src/server-CXWycu7H.cjs +0 -6
- package/dist/src/server-Q6OGlxxT.js +0 -8
- package/dist/src/store-B3EDO9Q3.js +0 -7
- package/dist/src/store-Dl9F8aw5.js +0 -6
- package/dist/src/store-SnrGrlt9.cjs +0 -6
- package/dist/src/telemetry-BGhiPZtl.js +0 -8
- package/dist/src/telemetry-CFfiYan6.cjs +0 -6
- package/dist/src/telemetry-DHzEduxX.js +0 -6
- package/dist/src/transform-C1x1ZlMQ.cjs +0 -6
- package/dist/src/transform-DYHjFmQu.js +0 -8
- package/dist/src/transform-rmwJT5JQ.js +0 -7
- package/dist/src/transformersAvailability-eJooj0gX.js +0 -35
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { _ as getEnvBool, i as logger } from "./logger-DLcq4dWf.js";
|
|
2
|
+
import { o as cloudConfig } from "./fetch-4M3YRaqL.js";
|
|
3
|
+
import { c as isLoggedIntoCloud } from "./accounts-BgNJDBE6.js";
|
|
4
|
+
import { i as storeBlob, r as recordBlobReference } from "./blobs-qTYm-1PY.js";
|
|
5
|
+
//#region src/blobs/remoteUpload.ts
|
|
6
|
+
function buildRemoteUrl() {
|
|
7
|
+
const baseUrl = cloudConfig.getApiHost();
|
|
8
|
+
const apiKey = cloudConfig.getApiKey();
|
|
9
|
+
if (!baseUrl || !apiKey || !isLoggedIntoCloud()) return null;
|
|
10
|
+
try {
|
|
11
|
+
return new URL("/api/blobs", baseUrl).toString();
|
|
12
|
+
} catch (error) {
|
|
13
|
+
logger.debug("[RemoteBlob] Invalid remote blob URL", {
|
|
14
|
+
error: error instanceof Error ? error.message : String(error),
|
|
15
|
+
baseUrl
|
|
16
|
+
});
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function shouldAttemptRemoteBlobUpload() {
|
|
21
|
+
return buildRemoteUrl() !== null;
|
|
22
|
+
}
|
|
23
|
+
async function uploadBlobRemote(buffer, mimeType, context) {
|
|
24
|
+
const url = buildRemoteUrl();
|
|
25
|
+
const apiKey = cloudConfig.getApiKey();
|
|
26
|
+
if (!url || !apiKey) return null;
|
|
27
|
+
try {
|
|
28
|
+
const { fetchWithProxy } = await import("./fetch-4M3YRaqL.js").then((n) => n.i);
|
|
29
|
+
const response = await fetchWithProxy(url, {
|
|
30
|
+
method: "POST",
|
|
31
|
+
headers: {
|
|
32
|
+
"Content-Type": "application/json",
|
|
33
|
+
Authorization: `Bearer ${apiKey}`
|
|
34
|
+
},
|
|
35
|
+
body: JSON.stringify({
|
|
36
|
+
data: buffer.toString("base64"),
|
|
37
|
+
mimeType,
|
|
38
|
+
context
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
if (response.status === 404 || response.status === 400) {
|
|
42
|
+
logger.debug("[RemoteBlob] Remote blob upload unavailable", { status: response.status });
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
if (!response.ok) {
|
|
46
|
+
const text = await response.text();
|
|
47
|
+
logger.debug("[RemoteBlob] Failed to upload blob", {
|
|
48
|
+
status: response.status,
|
|
49
|
+
statusText: response.statusText,
|
|
50
|
+
body: text
|
|
51
|
+
});
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const data = await response.json();
|
|
55
|
+
if (!data?.ref?.hash) {
|
|
56
|
+
logger.debug("[RemoteBlob] Remote upload returned malformed response");
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return data;
|
|
60
|
+
} catch (error) {
|
|
61
|
+
logger.debug("[RemoteBlob] Error uploading blob", { error: error instanceof Error ? error.message : String(error) });
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/blobs/extractor.ts
|
|
67
|
+
const BLOB_URI_REGEX = /^promptfoo:\/\/blob\/([a-f0-9]{64})$/i;
|
|
68
|
+
const BLOB_HASH_REGEX = /^[a-f0-9]{64}$/i;
|
|
69
|
+
function isDataUrl(value) {
|
|
70
|
+
return /^data:(audio|image)\/[^;]+;base64,/.test(value);
|
|
71
|
+
}
|
|
72
|
+
function extractBase64(value) {
|
|
73
|
+
const match = value.match(/^data:([^;]+);base64,(.+)$/);
|
|
74
|
+
if (!match) return null;
|
|
75
|
+
const mimeType = match[1];
|
|
76
|
+
try {
|
|
77
|
+
return {
|
|
78
|
+
buffer: Buffer.from(match[2], "base64"),
|
|
79
|
+
mimeType
|
|
80
|
+
};
|
|
81
|
+
} catch (error) {
|
|
82
|
+
logger.warn("[BlobExtractor] Failed to parse base64 data URL", { error });
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function shouldExternalize(buffer) {
|
|
87
|
+
const size = buffer.length;
|
|
88
|
+
return size >= 1024 && size <= 52428800;
|
|
89
|
+
}
|
|
90
|
+
function getKindFromMimeType(mimeType) {
|
|
91
|
+
return mimeType.startsWith("audio/") ? "audio" : "image";
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Normalize audio format to proper MIME type.
|
|
95
|
+
* Some providers return just 'wav' instead of 'audio/wav'.
|
|
96
|
+
* @internal Exported for testing
|
|
97
|
+
*/
|
|
98
|
+
function normalizeAudioMimeType(format) {
|
|
99
|
+
if (!format) return "audio/wav";
|
|
100
|
+
const trimmedFormat = format.trim();
|
|
101
|
+
if (/^audio\/[a-z0-9_+-]+$/i.test(trimmedFormat)) return trimmedFormat;
|
|
102
|
+
const formatLower = trimmedFormat.toLowerCase();
|
|
103
|
+
const mimeMap = {
|
|
104
|
+
wav: "audio/wav",
|
|
105
|
+
mp3: "audio/mpeg",
|
|
106
|
+
ogg: "audio/ogg",
|
|
107
|
+
flac: "audio/flac",
|
|
108
|
+
aac: "audio/aac",
|
|
109
|
+
m4a: "audio/mp4",
|
|
110
|
+
webm: "audio/webm"
|
|
111
|
+
};
|
|
112
|
+
if (mimeMap[formatLower]) return mimeMap[formatLower];
|
|
113
|
+
if (!/^[a-z0-9_-]+$/i.test(formatLower)) {
|
|
114
|
+
logger.warn("[BlobExtractor] Invalid audio format, using default", { format });
|
|
115
|
+
return "audio/wav";
|
|
116
|
+
}
|
|
117
|
+
return `audio/${formatLower}`;
|
|
118
|
+
}
|
|
119
|
+
function parseBinary(base64OrDataUrl, defaultMimeType) {
|
|
120
|
+
if (isDataUrl(base64OrDataUrl)) {
|
|
121
|
+
const parsed = extractBase64(base64OrDataUrl);
|
|
122
|
+
if (!parsed) return null;
|
|
123
|
+
return parsed;
|
|
124
|
+
}
|
|
125
|
+
try {
|
|
126
|
+
return {
|
|
127
|
+
buffer: Buffer.from(base64OrDataUrl, "base64"),
|
|
128
|
+
mimeType: defaultMimeType
|
|
129
|
+
};
|
|
130
|
+
} catch (error) {
|
|
131
|
+
logger.warn("[BlobExtractor] Failed to parse base64 data", { error });
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async function maybeStore(base64OrDataUrl, defaultMimeType, context, location, kind) {
|
|
136
|
+
const parsed = parseBinary(base64OrDataUrl, defaultMimeType);
|
|
137
|
+
if (!parsed || !shouldExternalize(parsed.buffer)) return null;
|
|
138
|
+
if (!isBlobStorageEnabled()) return null;
|
|
139
|
+
const mimeType = parsed.mimeType || "application/octet-stream";
|
|
140
|
+
const { ref } = await storeBlob(parsed.buffer, mimeType, {
|
|
141
|
+
...context,
|
|
142
|
+
location,
|
|
143
|
+
kind
|
|
144
|
+
});
|
|
145
|
+
if (shouldAttemptRemoteBlobUpload()) uploadBlobRemote(parsed.buffer, mimeType, {
|
|
146
|
+
evalId: context.evalId,
|
|
147
|
+
testIdx: context.testIdx,
|
|
148
|
+
promptIdx: context.promptIdx,
|
|
149
|
+
location,
|
|
150
|
+
kind
|
|
151
|
+
}).catch((error) => {
|
|
152
|
+
logger.debug("[BlobExtractor] Cloud upload failed (non-fatal)", {
|
|
153
|
+
error: error instanceof Error ? error.message : String(error),
|
|
154
|
+
hash: ref.hash
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
return ref;
|
|
158
|
+
}
|
|
159
|
+
async function externalizeDataUrls(value, context, location) {
|
|
160
|
+
if (typeof value === "string") {
|
|
161
|
+
if (!isDataUrl(value)) return {
|
|
162
|
+
value,
|
|
163
|
+
mutated: false
|
|
164
|
+
};
|
|
165
|
+
const parsed = extractBase64(value);
|
|
166
|
+
if (!parsed || !shouldExternalize(parsed.buffer)) return {
|
|
167
|
+
value,
|
|
168
|
+
mutated: false
|
|
169
|
+
};
|
|
170
|
+
const storedRef = await maybeStore(parsed.buffer.toString("base64"), parsed.mimeType, context, location, getKindFromMimeType(parsed.mimeType)) || null;
|
|
171
|
+
if (!storedRef) return {
|
|
172
|
+
value,
|
|
173
|
+
mutated: false
|
|
174
|
+
};
|
|
175
|
+
return {
|
|
176
|
+
value: storedRef.uri,
|
|
177
|
+
mutated: true
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
if (Array.isArray(value)) {
|
|
181
|
+
let mutated = false;
|
|
182
|
+
const nextValues = await Promise.all(value.map(async (item, idx) => {
|
|
183
|
+
const { value: nextValue, mutated: childMutated } = await externalizeDataUrls(item, context, `${location}[${idx}]`);
|
|
184
|
+
mutated ||= childMutated;
|
|
185
|
+
return nextValue;
|
|
186
|
+
}));
|
|
187
|
+
return mutated ? {
|
|
188
|
+
value: nextValues,
|
|
189
|
+
mutated
|
|
190
|
+
} : {
|
|
191
|
+
value,
|
|
192
|
+
mutated: false
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
if (value && typeof value === "object") {
|
|
196
|
+
let mutated = false;
|
|
197
|
+
const nextObject = { ...value };
|
|
198
|
+
for (const [key, child] of Object.entries(value)) {
|
|
199
|
+
const { value: nextValue, mutated: childMutated } = await externalizeDataUrls(child, context, location ? `${location}.${key}` : key);
|
|
200
|
+
if (childMutated) {
|
|
201
|
+
nextObject[key] = nextValue;
|
|
202
|
+
mutated = true;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return mutated ? {
|
|
206
|
+
value: nextObject,
|
|
207
|
+
mutated: true
|
|
208
|
+
} : {
|
|
209
|
+
value,
|
|
210
|
+
mutated: false
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
value,
|
|
215
|
+
mutated: false
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Best-effort extraction of binary data from provider responses.
|
|
220
|
+
* Currently focuses on audio.data fields and data URL outputs.
|
|
221
|
+
*/
|
|
222
|
+
async function extractAndStoreBinaryData(response, context) {
|
|
223
|
+
if (!response) return response;
|
|
224
|
+
let mutated = false;
|
|
225
|
+
const next = { ...response };
|
|
226
|
+
const blobContext = context || {};
|
|
227
|
+
if (response.audio?.data && typeof response.audio.data === "string") {
|
|
228
|
+
const stored = await maybeStore(response.audio.data, normalizeAudioMimeType(response.audio.format), blobContext, "response.audio.data", "audio");
|
|
229
|
+
if (stored) {
|
|
230
|
+
next.audio = {
|
|
231
|
+
...response.audio,
|
|
232
|
+
data: void 0,
|
|
233
|
+
blobRef: stored
|
|
234
|
+
};
|
|
235
|
+
mutated = true;
|
|
236
|
+
logger.debug("[BlobExtractor] Stored audio blob", {
|
|
237
|
+
...context,
|
|
238
|
+
hash: stored.hash
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
if (response.images?.length) next.images = await Promise.all(response.images.map(async (img, idx) => {
|
|
243
|
+
if (!img.data || typeof img.data !== "string" || !isDataUrl(img.data)) return img;
|
|
244
|
+
const stored = await maybeStore(img.data, img.mimeType || "image/png", blobContext, `response.images[${idx}].data`, "image");
|
|
245
|
+
if (stored) {
|
|
246
|
+
mutated = true;
|
|
247
|
+
logger.debug("[BlobExtractor] Stored image blob", {
|
|
248
|
+
...context,
|
|
249
|
+
hash: stored.hash
|
|
250
|
+
});
|
|
251
|
+
return {
|
|
252
|
+
...img,
|
|
253
|
+
data: void 0,
|
|
254
|
+
blobRef: stored
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
return img;
|
|
258
|
+
}));
|
|
259
|
+
const turns = response.turns;
|
|
260
|
+
if (Array.isArray(turns)) next.turns = await Promise.all(turns.map(async (turn, idx) => {
|
|
261
|
+
if (turn?.audio?.data && typeof turn.audio.data === "string") {
|
|
262
|
+
const stored = await maybeStore(turn.audio.data, normalizeAudioMimeType(turn.audio.format), blobContext, `response.turns[${idx}].audio.data`, "audio");
|
|
263
|
+
if (stored) {
|
|
264
|
+
mutated = true;
|
|
265
|
+
return {
|
|
266
|
+
...turn,
|
|
267
|
+
audio: {
|
|
268
|
+
...turn.audio,
|
|
269
|
+
data: void 0,
|
|
270
|
+
blobRef: stored
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return turn;
|
|
276
|
+
}));
|
|
277
|
+
if (typeof response.output === "string" && isDataUrl(response.output)) {
|
|
278
|
+
const parsed = extractBase64(response.output);
|
|
279
|
+
if (parsed && shouldExternalize(parsed.buffer)) {
|
|
280
|
+
const stored = await maybeStore(parsed.buffer.toString("base64"), parsed.mimeType, blobContext, "response.output", getKindFromMimeType(parsed.mimeType));
|
|
281
|
+
if (stored) {
|
|
282
|
+
next.output = stored.uri;
|
|
283
|
+
mutated = true;
|
|
284
|
+
logger.debug("[BlobExtractor] Stored output blob", {
|
|
285
|
+
...context,
|
|
286
|
+
hash: stored.hash
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (typeof response.output === "string" && response.output.trim().startsWith("{") && (response.isBase64 && response.format === "json" || response.output.includes("\"b64_json\"") || response.output.includes("b64_json"))) try {
|
|
292
|
+
const parsed = JSON.parse(response.output);
|
|
293
|
+
if (Array.isArray(parsed.data)) {
|
|
294
|
+
let jsonMutated = false;
|
|
295
|
+
const storedUris = [];
|
|
296
|
+
for (const item of parsed.data) if (item?.b64_json && typeof item.b64_json === "string") {
|
|
297
|
+
const stored = await maybeStore(item.b64_json, "image/png", blobContext, "response.output.data[].b64_json", "image");
|
|
298
|
+
if (stored) {
|
|
299
|
+
item.b64_json = stored.uri;
|
|
300
|
+
storedUris.push(stored.uri);
|
|
301
|
+
jsonMutated = true;
|
|
302
|
+
mutated = true;
|
|
303
|
+
logger.debug("[BlobExtractor] Stored image blob from b64_json", {
|
|
304
|
+
...context,
|
|
305
|
+
hash: stored.hash
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (jsonMutated) {
|
|
310
|
+
if (storedUris.length === 1) next.output = storedUris[0];
|
|
311
|
+
else if (storedUris.length > 1) next.output = JSON.stringify(storedUris);
|
|
312
|
+
else next.output = JSON.stringify(parsed);
|
|
313
|
+
next.metadata = {
|
|
314
|
+
...response.metadata || {},
|
|
315
|
+
blobUris: storedUris,
|
|
316
|
+
originalFormat: response.format
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
} catch (err) {
|
|
321
|
+
logger.debug("[BlobExtractor] Failed to parse base64 JSON output", {
|
|
322
|
+
error: err instanceof Error ? err.message : String(err),
|
|
323
|
+
location: "response.output"
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
if (response.metadata) {
|
|
327
|
+
const { value, mutated: metadataMutated } = await externalizeDataUrls(response.metadata, blobContext, "response.metadata");
|
|
328
|
+
if (metadataMutated) {
|
|
329
|
+
next.metadata = value;
|
|
330
|
+
mutated = true;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
const finalResponse = mutated ? next : response;
|
|
334
|
+
if (blobContext.evalId) await recordExistingBlobReferences(finalResponse, blobContext, "response");
|
|
335
|
+
return finalResponse;
|
|
336
|
+
}
|
|
337
|
+
function isBlobStorageEnabled() {
|
|
338
|
+
return !getEnvBool("PROMPTFOO_INLINE_MEDIA", false);
|
|
339
|
+
}
|
|
340
|
+
function parseBlobHashFromValue(value) {
|
|
341
|
+
if (!value) return null;
|
|
342
|
+
if (typeof value === "string") {
|
|
343
|
+
const match = value.match(BLOB_URI_REGEX);
|
|
344
|
+
return match ? match[1] : null;
|
|
345
|
+
}
|
|
346
|
+
if (typeof value === "object") {
|
|
347
|
+
const candidate = value;
|
|
348
|
+
if (candidate.hash && BLOB_HASH_REGEX.test(candidate.hash)) return candidate.hash;
|
|
349
|
+
if (candidate.uri && typeof candidate.uri === "string") {
|
|
350
|
+
const match = candidate.uri.match(BLOB_URI_REGEX);
|
|
351
|
+
if (match) return match[1];
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
async function recordExistingBlobReferences(value, context, location) {
|
|
357
|
+
const hash = parseBlobHashFromValue(value);
|
|
358
|
+
if (hash) {
|
|
359
|
+
await recordBlobReference(hash, {
|
|
360
|
+
...context,
|
|
361
|
+
location
|
|
362
|
+
});
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (Array.isArray(value)) {
|
|
366
|
+
await Promise.all(value.map((child, idx) => recordExistingBlobReferences(child, context, `${location}[${idx}]`)));
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
if (value && typeof value === "object") for (const [key, child] of Object.entries(value)) await recordExistingBlobReferences(child, context, location ? `${location}.${key}` : key);
|
|
370
|
+
}
|
|
371
|
+
//#endregion
|
|
372
|
+
export { isBlobStorageEnabled as n, shouldAttemptRemoteBlobUpload as r, extractAndStoreBinaryData as t };
|
|
373
|
+
|
|
374
|
+
//# sourceMappingURL=extractor-YMU_Gvt8.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./chunk-DEq-mXcV.js";
|
|
2
|
+
import { _ as getEnvBool, b as getEnvString, c as sanitizeUrl, g as getConfigDirectoryPath, i as logger, r as logRequestResponse, w as state, y as getEnvInt } from "./logger-DLcq4dWf.js";
|
|
3
|
+
import { t as invariant } from "./invariant-vgHWClmd.js";
|
|
3
4
|
import * as fs$1 from "fs";
|
|
4
5
|
import * as path$1 from "path";
|
|
5
6
|
import path from "path";
|
|
6
7
|
import yaml from "js-yaml";
|
|
7
|
-
import { promisify } from "util";
|
|
8
8
|
import * as fsPromises from "fs/promises";
|
|
9
9
|
import { getProxyForUrl } from "proxy-from-env";
|
|
10
10
|
import { Agent, ProxyAgent } from "undici";
|
|
11
|
+
import { promisify } from "util";
|
|
11
12
|
import { gzip } from "zlib";
|
|
12
|
-
|
|
13
13
|
//#region src/providers/constants.ts
|
|
14
14
|
const FILE_METADATA_KEY = "_promptfooFileMetadata";
|
|
15
15
|
/**
|
|
@@ -17,28 +17,21 @@ const FILE_METADATA_KEY = "_promptfooFileMetadata";
|
|
|
17
17
|
* Used to distinguish human ratings from automated assertions.
|
|
18
18
|
*/
|
|
19
19
|
const HUMAN_ASSERTION_TYPE = "human";
|
|
20
|
-
|
|
21
20
|
//#endregion
|
|
22
21
|
//#region src/version.ts
|
|
23
22
|
/**
|
|
24
23
|
* Application version from package.json.
|
|
25
24
|
* Injected at build time, or read from npm environment in development.
|
|
26
25
|
*/
|
|
27
|
-
const VERSION = "0.
|
|
26
|
+
const VERSION = "0.121.1";
|
|
28
27
|
/**
|
|
29
28
|
* PostHog analytics key.
|
|
30
29
|
* Only populated during production builds via PROMPTFOO_POSTHOG_KEY env var.
|
|
31
30
|
* Empty string in development/test.
|
|
32
31
|
*/
|
|
33
32
|
const POSTHOG_KEY = "phc_E5n5uHnDo2eREJL1uqX1cIlbkoRby4yFWt3V94HqRRg";
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
//#region src/constants.ts
|
|
37
|
-
const DEFAULT_QUERY_LIMIT = 100;
|
|
38
|
-
const DEFAULT_MAX_CONCURRENCY = 4;
|
|
39
|
-
const DEFAULT_API_BASE_URL = "https://api.promptfoo.app";
|
|
40
33
|
function getShareApiBaseUrl() {
|
|
41
|
-
return getEnvString("PROMPTFOO_REMOTE_API_BASE_URL") ||
|
|
34
|
+
return getEnvString("PROMPTFOO_REMOTE_API_BASE_URL") || "https://api.promptfoo.app";
|
|
42
35
|
}
|
|
43
36
|
function getDefaultShareViewBaseUrl() {
|
|
44
37
|
return getEnvString("PROMPTFOO_SHARING_APP_BASE_URL", `https://promptfoo.app`);
|
|
@@ -46,12 +39,14 @@ function getDefaultShareViewBaseUrl() {
|
|
|
46
39
|
function getShareViewBaseUrl() {
|
|
47
40
|
return getEnvString("PROMPTFOO_REMOTE_APP_BASE_URL") || getDefaultShareViewBaseUrl();
|
|
48
41
|
}
|
|
42
|
+
function getDefaultPort() {
|
|
43
|
+
return getEnvInt("API_PORT", 15500);
|
|
44
|
+
}
|
|
49
45
|
const TERMINAL_MAX_WIDTH = process?.stdout?.isTTY && process?.stdout?.columns && process?.stdout?.columns > 10 ? process?.stdout?.columns - 10 : 120;
|
|
50
46
|
const CLOUD_PROVIDER_PREFIX = "promptfoo://provider/";
|
|
51
47
|
const CONSENT_ENDPOINT = "https://api.promptfoo.dev/consent";
|
|
52
48
|
const EVENTS_ENDPOINT = "https://a.promptfoo.app";
|
|
53
49
|
const R_ENDPOINT = "https://r.promptfoo.app/";
|
|
54
|
-
|
|
55
50
|
//#endregion
|
|
56
51
|
//#region src/providers/shared.ts
|
|
57
52
|
/**
|
|
@@ -290,14 +285,12 @@ function transformTools(tools, format) {
|
|
|
290
285
|
default: return tools;
|
|
291
286
|
}
|
|
292
287
|
}
|
|
293
|
-
|
|
294
288
|
//#endregion
|
|
295
289
|
//#region src/util/time.ts
|
|
296
290
|
function getCurrentTimestamp() {
|
|
297
291
|
return Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3);
|
|
298
292
|
}
|
|
299
293
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
300
|
-
|
|
301
294
|
//#endregion
|
|
302
295
|
//#region src/globalConfig/globalConfig.ts
|
|
303
296
|
/**
|
|
@@ -338,11 +331,7 @@ function writeGlobalConfigPartial(partialConfig) {
|
|
|
338
331
|
});
|
|
339
332
|
writeGlobalConfig(updatedConfig);
|
|
340
333
|
}
|
|
341
|
-
|
|
342
|
-
//#endregion
|
|
343
|
-
//#region src/globalConfig/cloud.ts
|
|
344
|
-
const CLOUD_API_HOST = "https://api.promptfoo.app";
|
|
345
|
-
const API_HOST = getEnvString("API_HOST", CLOUD_API_HOST);
|
|
334
|
+
const API_HOST = getEnvString("API_HOST", "https://api.promptfoo.app");
|
|
346
335
|
const SHARING_CUTOFF_DATE = /* @__PURE__ */ new Date("2026-03-09T00:00:00Z");
|
|
347
336
|
var CloudConfig = class {
|
|
348
337
|
config;
|
|
@@ -431,11 +420,11 @@ var CloudConfig = class {
|
|
|
431
420
|
}
|
|
432
421
|
async validateAndSetApiToken(token, apiHost) {
|
|
433
422
|
try {
|
|
434
|
-
const { fetchWithProxy } = await
|
|
423
|
+
const { fetchWithProxy } = await Promise.resolve().then(() => fetch_exports);
|
|
435
424
|
const response = await fetchWithProxy(`${apiHost}/api/v1/users/me`, { headers: { Authorization: `Bearer ${token}` } });
|
|
436
425
|
if (!response.ok) {
|
|
437
426
|
const errorMessage = await response.text();
|
|
438
|
-
|
|
427
|
+
logger.error(`[Cloud] Failed to validate API token: ${errorMessage}. HTTP Status: ${response.status} - ${response.statusText}.`);
|
|
439
428
|
throw new Error("Failed to validate API token: " + response.statusText);
|
|
440
429
|
}
|
|
441
430
|
const { user, organization, app, hasActiveLicense } = await response.json();
|
|
@@ -456,8 +445,8 @@ var CloudConfig = class {
|
|
|
456
445
|
} catch (err) {
|
|
457
446
|
const error = err;
|
|
458
447
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
459
|
-
|
|
460
|
-
if (error.cause)
|
|
448
|
+
logger.error(`[Cloud] Failed to validate API token with host ${apiHost}: ${errorMessage}`);
|
|
449
|
+
if (error.cause) logger.error(`Cause: ${error.cause}`);
|
|
461
450
|
throw error;
|
|
462
451
|
}
|
|
463
452
|
}
|
|
@@ -504,7 +493,6 @@ var CloudConfig = class {
|
|
|
504
493
|
}
|
|
505
494
|
};
|
|
506
495
|
const cloudConfig = new CloudConfig();
|
|
507
|
-
|
|
508
496
|
//#endregion
|
|
509
497
|
//#region src/util/fetch/monkeyPatchFetch.ts
|
|
510
498
|
const gzipAsync = promisify(gzip);
|
|
@@ -531,9 +519,9 @@ async function monkeyPatchFetch(url, options) {
|
|
|
531
519
|
"Content-Encoding": "gzip"
|
|
532
520
|
};
|
|
533
521
|
} catch (e) {
|
|
534
|
-
|
|
522
|
+
logger.warn(`Failed to compress request body: ${e}`);
|
|
535
523
|
}
|
|
536
|
-
if (typeof url === "string" && url.startsWith(
|
|
524
|
+
if (typeof url === "string" && url.startsWith("https://api.promptfoo.app") || url instanceof URL && url.host === "https://api.promptfoo.app".replace(/^https?:\/\//, "")) {
|
|
537
525
|
const token = cloudConfig.getApiKey();
|
|
538
526
|
opts.headers = {
|
|
539
527
|
...opts.headers || {},
|
|
@@ -558,17 +546,24 @@ async function monkeyPatchFetch(url, options) {
|
|
|
558
546
|
response: null
|
|
559
547
|
});
|
|
560
548
|
if (isConnectionError(e)) {
|
|
561
|
-
|
|
549
|
+
logger.debug(`Connection error, please check your network connectivity to the host: ${url} ${process.env.HTTP_PROXY || process.env.HTTPS_PROXY ? `or Proxy: ${process.env.HTTP_PROXY || process.env.HTTPS_PROXY}` : ""}`);
|
|
562
550
|
throw e;
|
|
563
551
|
}
|
|
564
|
-
|
|
552
|
+
logger.debug(`Error in fetch: ${JSON.stringify(e, Object.getOwnPropertyNames(e), 2)} ${e instanceof Error ? e.stack : ""}`);
|
|
565
553
|
}
|
|
566
554
|
throw e;
|
|
567
555
|
}
|
|
568
556
|
}
|
|
569
|
-
|
|
570
557
|
//#endregion
|
|
571
558
|
//#region src/util/fetch/index.ts
|
|
559
|
+
var fetch_exports = /* @__PURE__ */ __exportAll({
|
|
560
|
+
fetchWithProxy: () => fetchWithProxy,
|
|
561
|
+
fetchWithRetries: () => fetchWithRetries,
|
|
562
|
+
fetchWithTimeout: () => fetchWithTimeout,
|
|
563
|
+
handleRateLimit: () => handleRateLimit,
|
|
564
|
+
isRateLimited: () => isRateLimited,
|
|
565
|
+
isTransientError: () => isTransientError
|
|
566
|
+
});
|
|
572
567
|
let cachedAgent = null;
|
|
573
568
|
let cachedAgentConcurrency;
|
|
574
569
|
let cachedProxyAgents = /* @__PURE__ */ new Map();
|
|
@@ -584,7 +579,7 @@ function getConnectionPoolSize() {
|
|
|
584
579
|
const parsed = parseInt(envConnections, 10);
|
|
585
580
|
if (!isNaN(parsed)) return parsed;
|
|
586
581
|
}
|
|
587
|
-
return
|
|
582
|
+
return state.maxConcurrency || 4;
|
|
588
583
|
}
|
|
589
584
|
function getOrCreateAgent(tlsOptions) {
|
|
590
585
|
const concurrency = getConnectionPoolSize();
|
|
@@ -638,7 +633,7 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
|
|
|
638
633
|
if (typeof url === "string") try {
|
|
639
634
|
const parsedUrl = new URL(url);
|
|
640
635
|
if (parsedUrl.username || parsedUrl.password) {
|
|
641
|
-
if (finalOptions.headers && "Authorization" in finalOptions.headers)
|
|
636
|
+
if (finalOptions.headers && "Authorization" in finalOptions.headers) logger.warn("Both URL credentials and Authorization header present - URL credentials will be ignored");
|
|
642
637
|
else {
|
|
643
638
|
const username = parsedUrl.username || "";
|
|
644
639
|
const password = parsedUrl.password || "";
|
|
@@ -654,20 +649,20 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
|
|
|
654
649
|
finalUrlString = finalUrl.toString();
|
|
655
650
|
}
|
|
656
651
|
} catch (e) {
|
|
657
|
-
|
|
652
|
+
logger.debug(`URL parsing failed in fetchWithProxy: ${e}`);
|
|
658
653
|
}
|
|
659
654
|
const tlsOptions = { rejectUnauthorized: !getEnvBool("PROMPTFOO_INSECURE_SSL", true) };
|
|
660
655
|
const caCertPath = getEnvString("PROMPTFOO_CA_CERT_PATH");
|
|
661
656
|
if (caCertPath) try {
|
|
662
|
-
const resolvedPath = path.resolve(
|
|
657
|
+
const resolvedPath = path.resolve(state.basePath || "", caCertPath);
|
|
663
658
|
tlsOptions.ca = await fsPromises.readFile(resolvedPath, "utf8");
|
|
664
|
-
|
|
659
|
+
logger.debug(`Using custom CA certificate from ${resolvedPath}`);
|
|
665
660
|
} catch (e) {
|
|
666
|
-
|
|
661
|
+
logger.warn(`Failed to read CA certificate from ${caCertPath}: ${e}`);
|
|
667
662
|
}
|
|
668
663
|
const proxyUrl = finalUrlString ? getProxyForUrl(finalUrlString) : "";
|
|
669
664
|
if (!finalOptions.dispatcher) if (proxyUrl) {
|
|
670
|
-
|
|
665
|
+
logger.debug(`Using proxy: ${sanitizeUrl(proxyUrl)}`);
|
|
671
666
|
finalOptions.dispatcher = getOrCreateProxyAgent(proxyUrl, tlsOptions);
|
|
672
667
|
} else finalOptions.dispatcher = getOrCreateAgent(tlsOptions);
|
|
673
668
|
const maxTransientRetries = options.disableTransientRetries ? 0 : 3;
|
|
@@ -675,7 +670,7 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
|
|
|
675
670
|
const response = await monkeyPatchFetch(finalUrl, finalOptions);
|
|
676
671
|
if (!options.disableTransientRetries && isTransientError(response) && attempt < maxTransientRetries) {
|
|
677
672
|
const backoffMs = Math.pow(2, attempt) * 1e3;
|
|
678
|
-
|
|
673
|
+
logger.debug(`Transient error (${response.status} ${response.statusText}), retry ${attempt + 1}/${maxTransientRetries} after ${backoffMs}ms`);
|
|
679
674
|
await sleep(backoffMs);
|
|
680
675
|
continue;
|
|
681
676
|
}
|
|
@@ -725,7 +720,7 @@ async function handleRateLimit(response) {
|
|
|
725
720
|
const now = /* @__PURE__ */ new Date();
|
|
726
721
|
waitTime = Math.max(resetTime.getTime() - now.getTime() + 1e3, 0);
|
|
727
722
|
} else if (retryAfter) waitTime = Number.parseInt(retryAfter) * 1e3;
|
|
728
|
-
|
|
723
|
+
logger.debug(`Rate limited, waiting ${waitTime}ms before retry`);
|
|
729
724
|
await sleep(waitTime);
|
|
730
725
|
}
|
|
731
726
|
/**
|
|
@@ -757,7 +752,7 @@ async function fetchWithRetries(url, options = {}, timeout, maxRetries) {
|
|
|
757
752
|
}, timeout);
|
|
758
753
|
if (getEnvBool("PROMPTFOO_RETRY_5XX") && response.status >= 500 && response.status < 600) throw new Error(`Internal Server Error: ${response.status} ${response.statusText}`);
|
|
759
754
|
if (response && isRateLimited(response)) {
|
|
760
|
-
|
|
755
|
+
logger.debug(`Rate limited on URL ${url}: ${response.status} ${response.statusText}, attempt ${i + 1}/${maxRetries + 1}, waiting before retry...`);
|
|
761
756
|
lastErrorMessage = `Rate limited: ${response.status} ${response.statusText}`;
|
|
762
757
|
await handleRateLimit(response);
|
|
763
758
|
continue;
|
|
@@ -772,14 +767,14 @@ async function fetchWithRetries(url, options = {}, timeout, maxRetries) {
|
|
|
772
767
|
if (typedError.cause) errorMessage += ` (Cause: ${typedError.cause})`;
|
|
773
768
|
if (typedError.code) errorMessage += ` (Code: ${typedError.code})`;
|
|
774
769
|
} else errorMessage = String(error);
|
|
775
|
-
|
|
770
|
+
logger.debug(`Request to ${url} failed (attempt #${i + 1}), retrying: ${errorMessage}`);
|
|
776
771
|
if (i < maxRetries) await sleep(Math.pow(2, i) * (backoff + 1e3 * Math.random()));
|
|
777
772
|
lastErrorMessage = errorMessage;
|
|
778
773
|
}
|
|
779
774
|
}
|
|
780
775
|
throw new Error(`Request failed after ${maxRetries} retries: ${lastErrorMessage}`);
|
|
781
776
|
}
|
|
782
|
-
|
|
783
777
|
//#endregion
|
|
784
|
-
export {
|
|
785
|
-
|
|
778
|
+
export { getDefaultShareViewBaseUrl as A, transformTools as C, R_ENDPOINT as D, EVENTS_ENDPOINT as E, FILE_METADATA_KEY as F, HUMAN_ASSERTION_TYPE as I, getShareViewBaseUrl as M, POSTHOG_KEY as N, TERMINAL_MAX_WIDTH as O, VERSION as P, transformToolChoice as S, CONSENT_ENDPOINT as T, isPromptfooSampleTarget as _, CloudConfig as a, parseChatPrompt as b, writeGlobalConfig as c, sleep as d, LONG_RUNNING_MODEL_TIMEOUT_MS as f, isOpenAIToolChoice as g, isOpenAIToolArray as h, fetch_exports as i, getShareApiBaseUrl as j, getDefaultPort as k, writeGlobalConfigPartial as l, calculateCost as m, fetchWithRetries as n, cloudConfig as o, REQUEST_TIMEOUT_MS as p, fetchWithTimeout as r, readGlobalConfig as s, fetchWithProxy as t, getCurrentTimestamp as u, openaiToolChoiceToBedrock as v, CLOUD_PROVIDER_PREFIX as w, toTitleCase as x, openaiToolsToBedrock as y };
|
|
779
|
+
|
|
780
|
+
//# sourceMappingURL=fetch-4M3YRaqL.js.map
|