promptfoo 0.120.27 → 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/README.md +1 -1
- package/dist/src/{ListApp-8WOe2nT6.js → ListApp-Du7YVwj5.js} +2 -4
- package/dist/src/accounts-B0pgC1oV.js +206 -0
- package/dist/src/{accounts-DVINui-2.js → accounts-Bm2D8Db9.js} +39 -34
- package/dist/src/{accounts-CPDRAMND.js → accounts-CiBLOnA7.js} +38 -33
- package/dist/src/{accounts-Fl2J3_Fu.cjs → accounts-gtkH-5KX.cjs} +77 -78
- package/dist/src/{agentic-utils-D922n6mm.js → agentic-utils-DS1g3GLF.js} +9 -10
- package/dist/src/{agents-BcsN_BgB.js → agents-9qiOy0ho.js} +16 -12
- package/dist/src/{agents-BXLmVsxR.js → agents-CBr9A01V.js} +37 -37
- package/dist/src/{agents-pMfppv9Z.js → agents-CmvBq8LV.js} +16 -18
- package/dist/src/{agents-hqgSV-3o.js → agents-D__IdAlg.js} +39 -40
- package/dist/src/{agents-BO2n8Z0d.cjs → agents-DbRtpYxR.cjs} +37 -40
- package/dist/src/{agents-BdUTAwi-.js → agents-DgF2zDag.js} +37 -42
- package/dist/src/{agents-DgJf2-ez.cjs → agents-Di9DKPzn.cjs} +16 -17
- package/dist/src/{agents-DNvSH78i.js → agents-cLXA8a_8.js} +17 -19
- package/dist/src/{aimlapi-DtgPI0nE.js → aimlapi-B4rcnZgv.js} +15 -17
- package/dist/src/{aimlapi-BE_Tg9Fl.cjs → aimlapi-BvlNH0gr.cjs} +15 -16
- package/dist/src/{aimlapi-DOib86oE.js → aimlapi-CnkC2HqE.js} +16 -18
- package/dist/src/{aimlapi-DTPACCB1.js → aimlapi-DHJU_kcV.js} +15 -4
- package/dist/src/app/assets/index-4LKxG2CG.js +439 -0
- 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 -1
- package/dist/src/{audio-BnRUGAm_.js → audio-Bkv46et0.js} +6 -5
- package/dist/src/{audio-Cwo68yZS.cjs → audio-CGMyULza.cjs} +6 -7
- package/dist/src/{audio-MSRki4JU.js → audio-ClI_AFre.js} +6 -8
- package/dist/src/{audio-BRYU0BFo.js → audio-Dz3z7s3J.js} +7 -9
- package/dist/src/{base-pGVmXNl4.cjs → base-CGrhspbK.cjs} +36 -38
- package/dist/src/{base-h961VXYk.js → base-CpjcHe4e.js} +11 -13
- package/dist/src/base-DLKtKMFh.js +193 -0
- package/dist/src/{base-XB2tDJrB.js → base-Dy1V8--Z.js} +11 -13
- package/dist/src/blobs-BDbfYdrJ.js +236 -0
- package/dist/src/{blobs-CR5C4Ihh.js → blobs-CBO20krR.js} +9 -12
- package/dist/src/{blobs-BM_e6hCa.js → blobs-CMHN0Qcz.js} +9 -12
- package/dist/src/{blobs-B-KQAFhX.cjs → blobs-D23XLin-.cjs} +34 -37
- package/dist/src/{cache-jsiwsAJv.js → cache-BVeDlD87.js} +132 -117
- package/dist/src/{cache-CIpsoBZR.js → cache-C4Nxf52C.js} +132 -118
- package/dist/src/cache-CeUpFm3M.cjs +5 -0
- package/dist/src/{cache-BTVYfbka.cjs → cache-Dh5WtQps.cjs} +182 -168
- package/dist/src/cache-i1P6crbO.js +756 -0
- package/dist/src/cache-n-RCJ-hL.js +6 -0
- package/dist/src/{chat-BcPjZXIp.js → chat-BiKyneZl.js} +45 -46
- package/dist/src/{chat-D31K7C4u.cjs → chat-C1Qst7jL.cjs} +20 -21
- package/dist/src/{chat-B84t99NW.js → chat-C2jrdPMx.js} +20 -9
- package/dist/src/{chat-BE44YOc6.cjs → chat-CgF-J-Jj.cjs} +65 -66
- package/dist/src/{chat-DwWifjxi.js → chat-CzkrVDfz.js} +20 -22
- package/dist/src/chat-DJIw17u0.js +766 -0
- package/dist/src/{chat-CcUCysjU.js → chat-DqxYYtWA.js} +45 -46
- package/dist/src/{chat-DZM2GUHO.js → chat-qmatte1u.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-Apiy0iaz.js} +31 -31
- package/dist/src/{claude-agent-sdk-C-IOTPfo.js → claude-agent-sdk-D2bJee9S.js} +31 -29
- package/dist/src/{claude-agent-sdk-C9SiaQub.cjs → claude-agent-sdk-D9Z5Pr9X.cjs} +31 -28
- package/dist/src/{claude-agent-sdk-CiluSyW1.js → claude-agent-sdk-DfCoW0E6.js} +33 -20
- package/dist/src/cloud-BBh91EUK.js +4 -0
- package/dist/src/{cloud-CZ-q9Ier.js → cloud-C0dlstV_.js} +7 -9
- package/dist/src/{cloudflare-ai-BahKHyhh.js → cloudflare-ai-8TDxHR0x.js} +16 -18
- package/dist/src/{cloudflare-ai-v_qZD6_q.js → cloudflare-ai-BxAGvfju.js} +17 -19
- package/dist/src/{cloudflare-ai-Dfahv5SY.cjs → cloudflare-ai-CknbZ5LJ.cjs} +16 -17
- package/dist/src/{cloudflare-ai-Dxyt50Nl.js → cloudflare-ai-g7PB6VHR.js} +16 -4
- package/dist/src/{cloudflare-gateway-Bi_FpOFy.js → cloudflare-gateway-B9HWA5wf.js} +23 -23
- package/dist/src/{cloudflare-gateway-BPWoZIzJ.cjs → cloudflare-gateway-BSnDmHYo.cjs} +21 -22
- package/dist/src/{cloudflare-gateway-C0guUNwk.js → cloudflare-gateway-CKDb4dJ8.js} +26 -14
- package/dist/src/{cloudflare-gateway-btS7h1OZ.js → cloudflare-gateway-CP9QEWYS.js} +21 -25
- 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-DzrR3SR_.js → cometapi-BL9yvj_f.js} +16 -4
- package/dist/src/{cometapi-DIO64tf4.cjs → cometapi-C4xSqeID.cjs} +21 -22
- package/dist/src/{cometapi-C9EEpJzT.js → cometapi-CUQq3H_a.js} +21 -24
- package/dist/src/{cometapi-DkNBMk0G.js → cometapi-DFNiKmSz.js} +17 -19
- package/dist/src/{completion-CG29bfKX.js → completion-5MzrpJxT.js} +11 -13
- package/dist/src/{completion-CCRT4kX1.cjs → completion-CM6oK8PS.cjs} +21 -23
- package/dist/src/{completion-Bgf1VJoq.js → completion-DZ083F31.js} +11 -13
- package/dist/src/completion-qRoZAYRB.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-Bb5dcxr8.js} +18 -20
- package/dist/src/{docker-B81N0t4e.js → docker-BvfL2BrW.js} +19 -21
- package/dist/src/{docker-DNcLR4Ig.cjs → docker-DcF2pRrj.cjs} +18 -19
- package/dist/src/{docker-egERKxCF.js → docker-ExVyLp0S.js} +18 -7
- 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-B3r2CVXr.js +15 -0
- package/dist/src/{eval-C-Nr6wX_.js → eval-Dg2nG4v2.js} +47 -54
- package/dist/src/evalResult-5xwYnECe.js +12 -0
- package/dist/src/evalResult-71lY93Kj.cjs +10 -0
- package/dist/src/{evalResult-DXMWJ3sx.js → evalResult-BBRNtX4I.js} +10 -11
- package/dist/src/{evalResult-4BzI2tmj.js → evalResult-BDMqrapS.js} +16 -12
- package/dist/src/evalResult-Dx5P5cIv.js +10 -0
- package/dist/src/{evalResult-CX8wQecI.cjs → evalResult-fuaI8HkH.cjs} +20 -21
- package/dist/src/{evaluator-8aGyV12L.js → evaluator-BhoWwp5b.js} +211 -235
- package/dist/src/evaluator-Jx6bRZV6.js +36 -0
- package/dist/src/{extractor-V5x_m1i0.js → extractor-C0EVHewb.js} +22 -24
- package/dist/src/extractor-D25qpmGX.js +374 -0
- package/dist/src/{extractor-CD5yKL-G.js → extractor-DReVID0K.js} +22 -24
- package/dist/src/{extractor-C031XmTA.cjs → extractor-pYLLi3wS.cjs} +37 -39
- package/dist/src/{fetch-BmbD-v1L.cjs → fetch-BPkYtG8K.cjs} +244 -277
- package/dist/src/fetch-BxNb_Lp3.js +5 -0
- package/dist/src/{fetch-D3OHf-lV.js → fetch-Cwxnd8zz.js} +36 -44
- package/dist/src/{fetch-CXZI9RRr.js → fetch-Dxpd4_sr.js} +23 -35
- package/dist/src/fetch-HaqdX7U1.js +780 -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--1y2u9HO.js → graders-BTeBGqjJ.js} +349 -397
- package/dist/src/graders-B_pgMLS2.js +34 -0
- package/dist/src/{graders-DTeBrzWp.js → graders-Bj_Odv7c.js} +349 -397
- package/dist/src/graders-DErokPDO.cjs +32 -0
- package/dist/src/graders-DP7KFFo-.js +13466 -0
- package/dist/src/graders-DR_uNe54.js +32 -0
- package/dist/src/{graders-DohM2dir.cjs → graders-DU49_J8Y.cjs} +684 -732
- package/dist/src/graders-w3176Wz-.js +32 -0
- package/dist/src/{image-B0U4Hqll.js → image-B02ogr_b.js} +7 -9
- package/dist/src/{image-DmE-niFE.js → image-B0h9VEMc.js} +6 -5
- package/dist/src/{image-CuKHuccK.cjs → image-BLmROtN3.cjs} +29 -30
- package/dist/src/{image-DNEIf_aI.js → image-Bb4vWQLM.js} +6 -8
- package/dist/src/{image-DpKl2F15.cjs → image-C1madmKh.cjs} +6 -7
- package/dist/src/{image-C3wHC9_h.js → image-CHfWvljl.js} +9 -10
- package/dist/src/{image-O1u4bCFg.js → image-DS-o-0ph.js} +9 -10
- package/dist/src/image-Dpxa1Jt6.js +257 -0
- package/dist/src/index.cjs +615 -695
- package/dist/src/index.d.cts +271 -7
- package/dist/src/index.d.ts +271 -3
- package/dist/src/index.js +580 -664
- 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-CEzQobWX.js → knowledgeBase-B3OoKIej.js} +14 -9
- package/dist/src/{knowledgeBase-Be_zyW4L.js → knowledgeBase-CYTLHOt1.js} +16 -16
- package/dist/src/{knowledgeBase-BZ41IFwq.js → knowledgeBase-D33Ty2l6.js} +14 -18
- package/dist/src/{knowledgeBase-D-5BMXlr.cjs → knowledgeBase-DOO_BM9b.cjs} +14 -15
- package/dist/src/{litellm-DnbRJ2if.js → litellm-AaeZcZQF.js} +18 -19
- package/dist/src/{litellm-hUSNM_M2.cjs → litellm-I_hbp_dc.cjs} +17 -17
- package/dist/src/{litellm-CRDqPhNI.js → litellm-NbjknEh6.js} +17 -18
- package/dist/src/{litellm-9vR8zpfU.js → litellm-TrljxD9G.js} +17 -5
- 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-4blv9iZ2.js → luma-ray-BS2_tY8L.js} +22 -21
- package/dist/src/{luma-ray-drvgdpP9.js → luma-ray-DDsjcgZZ.js} +20 -13
- package/dist/src/{luma-ray-Hm3d6VJE.cjs → luma-ray-Due0n7di.cjs} +20 -21
- package/dist/src/{luma-ray-B2__8lYH.js → luma-ray-f6I2fft-.js} +20 -23
- package/dist/src/main.js +1170 -1321
- package/dist/src/{messages-Uee41Mj5.js → messages-BS17jdMx.js} +22 -24
- package/dist/src/{messages-XhiwCbi4.cjs → messages-Bs1kC7P4.cjs} +32 -34
- package/dist/src/{messages-CGPPidQr.js → messages-D0lx5qK7.js} +22 -24
- package/dist/src/messages-ZJk778GH.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-Bmni6skY.js} +17 -10
- package/dist/src/{modelslab-E9gO-bYd.js → modelslab-Bx9IrZfS.js} +18 -20
- package/dist/src/{modelslab-lUVW0cmB.cjs → modelslab-CoUX6Jc_.cjs} +17 -18
- package/dist/src/{modelslab-ClBkr8_9.js → modelslab-DRb74SP4.js} +17 -19
- package/dist/src/{nova-reel-Dk8jNpId.js → nova-reel-BfPq-0Yk.js} +20 -13
- package/dist/src/{nova-reel-D8CuO6QH.cjs → nova-reel-C_QM18Xn.cjs} +20 -21
- package/dist/src/{nova-reel-u2eF2Cxm.js → nova-reel-D_W1tjMH.js} +22 -21
- package/dist/src/{nova-reel-P9bwvtYX.js → nova-reel-bgjxilYW.js} +20 -23
- package/dist/src/{nova-sonic-CK2rAiKi.js → nova-sonic-CFb5GYhg.js} +30 -26
- package/dist/src/{nova-sonic-BaqWlkds.js → nova-sonic-DIGQNR07.js} +30 -31
- package/dist/src/{nova-sonic-yZapPLv7.js → nova-sonic-De1HW5fD.js} +31 -32
- package/dist/src/{nova-sonic-Ds1C-dpm.cjs → nova-sonic-zfcljeRp.cjs} +30 -31
- 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-B6qqDr_u.cjs → openclaw-CSugPYAr.cjs} +188 -130
- package/dist/src/{openclaw-A-3_loM7.js → openclaw-DiSz3I5L.js} +180 -109
- package/dist/src/{openclaw-a3lylB-V.js → openclaw-DuvJKEW5.js} +178 -124
- package/dist/src/{openclaw-COn6QzDi.js → openclaw-tiVYRtr-.js} +178 -122
- package/dist/src/opencode-sdk-0j6rTWNb.js +562 -0
- package/dist/src/opencode-sdk-B3CWY9h_.js +560 -0
- package/dist/src/opencode-sdk-BL764Jdi.cjs +564 -0
- package/dist/src/opencode-sdk-C2y6UkP2.js +560 -0
- package/dist/src/{otlpReceiver-oyf5wLGC.js → otlpReceiver-C99PPb48.js} +53 -51
- package/dist/src/{otlpReceiver-lXsYVbpj.cjs → otlpReceiver-CGq6LspY.cjs} +53 -55
- package/dist/src/{otlpReceiver-94URx7UW.js → otlpReceiver-CdNBdbsk.js} +53 -55
- package/dist/src/{otlpReceiver-BmmTiMjA.js → otlpReceiver-D89fR-rC.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-B7V0njNs.js +32 -0
- package/dist/src/providers-BEwbhv0X.js +30 -0
- package/dist/src/{providers-Iil64vk9.js → providers-BlqUifFg.js} +1543 -1676
- package/dist/src/providers-CH3C7zf7.js +30 -0
- package/dist/src/{providers-DHbjzW2e.cjs → providers-CgKOSgTR.cjs} +1896 -2029
- package/dist/src/providers-D8lF1sqW.js +33246 -0
- package/dist/src/{providers-BnFpbY_s.js → providers-Dk_6ocUX.js} +1536 -1669
- package/dist/src/providers-zyB6k_38.cjs +31 -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-BbOUOn2L.js} +8 -7
- package/dist/src/{quiverai-DCGSZt4U.js → quiverai-CIaELU_m.js} +8 -10
- package/dist/src/{quiverai-DiMVJQDz.cjs → quiverai-PdShCPox.cjs} +8 -9
- package/dist/src/{quiverai-fQNkExW4.js → quiverai-uH-dcTIr.js} +9 -11
- package/dist/src/{render-Dj1smHEb.js → render-Drod8m7K.js} +4 -5
- package/dist/src/responses-CB2jwoAr.js +660 -0
- package/dist/src/{responses-ghR3IOfy.cjs → responses-D8SBTL64.cjs} +39 -42
- package/dist/src/{responses-DOAFFENS.js → responses-DIR9Ud3j.js} +24 -27
- package/dist/src/{responses-CxzoQoBe.js → responses-WNGNYe3K.js} +24 -27
- 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-CNBxx5CJ.js} +75 -70
- package/dist/src/{sagemaker-CcxhlOAR.js → sagemaker-CemTFp2h.js} +75 -79
- package/dist/src/{sagemaker-77zbJ2Q2.cjs → sagemaker-Cl28mZU2.cjs} +75 -76
- package/dist/src/{sagemaker-DuM71dVU.js → sagemaker-YSyBXQQh.js} +77 -77
- package/dist/src/{scanner-DJYiSXQj.js → scanner-BsBlNXNn.js} +100 -121
- package/dist/src/server/index.js +5520 -67427
- package/dist/src/{server-B5v33lvE.cjs → server-C_7Ax-hA.cjs} +57 -67
- package/dist/src/{server-BJ4m4f1D.js → server-CqzrVGpF.js} +26 -29
- package/dist/src/server-CuxBbeSY.js +229 -0
- package/dist/src/server-DA4Cyrrq.js +7 -0
- package/dist/src/server-Dulb-4-K.cjs +5 -0
- package/dist/src/{server-RV_i_YX5.js → server-VWgWb00X.js} +19 -24
- package/dist/src/{signal-BW33JuId.js → signal-4U3mfRvL.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-CXGFv4aR.js +228 -0
- package/dist/src/store-CXS-Q_91.js +6 -0
- package/dist/src/{store-D7CgQzAR.cjs → store-DLlFCC4h.cjs} +44 -45
- package/dist/src/{store-DJNsD1iC.js → store-DXilxTl-.js} +40 -36
- package/dist/src/{store-s3SftUwF.js → store-Dim__MDd.js} +34 -35
- package/dist/src/store-eYkaKMwq.cjs +5 -0
- package/dist/src/{tables-DfTsNN7X.js → tables-6YKwjN9-.js} +19 -21
- package/dist/src/tables-DLJPUdUE.js +288 -0
- package/dist/src/{tables-BKTmd6u7.cjs → tables-DPi7wKeM.cjs} +89 -91
- package/dist/src/{tables-DMegD0Xf.js → tables-gftXzE9I.js} +21 -23
- package/dist/src/telemetry-BpMfhthR.cjs +5 -0
- package/dist/src/{telemetry--WAdAfVi.js → telemetry-CMrFgtPB.js} +11 -13
- package/dist/src/telemetry-Cps3mIU-.js +171 -0
- package/dist/src/{telemetry-DQgVBCAb.cjs → telemetry-DaX14Chu.cjs} +21 -24
- package/dist/src/{telemetry-BedSm-bZ.js → telemetry-Dthj_BbD.js} +17 -14
- package/dist/src/telemetry-Dw38hanS.js +7 -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-mYS9vd5v.js → transcription-BNYURcXg.js} +14 -7
- package/dist/src/{transcription-X2-B4vkX.js → transcription-B_OdaHp7.js} +14 -16
- package/dist/src/{transcription-BO1AHegO.cjs → transcription-NLVG9MT1.cjs} +14 -15
- package/dist/src/{transcription-lzBLiTFJ.js → transcription-s6A-bNrZ.js} +15 -17
- package/dist/src/{transform-B1Hi5lWS.cjs → transform-CzK1Q0zl.cjs} +24 -26
- package/dist/src/{transform-DeGlxb0D.js → transform-D5HsjduX.js} +39 -47
- package/dist/src/{transform-CYDILYDe.js → transform-DECvGmzp.js} +15 -13
- package/dist/src/transform-DTGDnAzW.js +6 -0
- package/dist/src/{transform-BEgStbHK.js → transform-DilY9wbS.js} +10 -12
- package/dist/src/{transform-D5PjiWiZ.cjs → transform-DuHvhZpj.cjs} +179 -187
- package/dist/src/transform-aa6tmVpZ.js +216 -0
- package/dist/src/transform-m3qNw4KP.cjs +5 -0
- package/dist/src/transform-uAytVuyX.js +1506 -0
- package/dist/src/{transform-Dfl89yi4.js → transform-vNucnNr0.js} +39 -47
- 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-DWNf48sT.cjs → types-C_7nyzr1.cjs} +538 -574
- package/dist/src/{types-CXQduE9o.js → types-Cbd8uOMq.js} +68 -100
- package/dist/src/types-CzW2QFyi.js +3288 -0
- package/dist/src/{types-C5hEkb-x.js → types-DmyIJ-sR.js} +63 -99
- package/dist/src/{util-CoQjmE3u.js → util-B3xGByQh.js} +4 -5
- package/dist/src/{util-aLhtl3fe.cjs → util-B9vlHIIh.cjs} +208 -223
- package/dist/src/{util-Du96oyYS.js → util-BHGHw5G1.js} +4 -5
- package/dist/src/{util-DQ984syk.js → util-BRYkYPTd.js} +36 -51
- package/dist/src/{util-D9eLdGfa.js → util-BV4XUC0n.js} +5 -6
- package/dist/src/util-Bv6uGDfH.js +293 -0
- package/dist/src/{util-1wWM599Z.cjs → util-BzMcevZc.cjs} +50 -51
- package/dist/src/{util-_h4pVqrz.js → util-C1CeHl-P.js} +36 -51
- package/dist/src/{util-Bm_-UMD_.js → util-CMy69ZgQ.js} +5 -6
- package/dist/src/{util-CyUdMzV0.cjs → util-DGNOS1db.cjs} +34 -35
- package/dist/src/util-Dnmk2mBQ.js +599 -0
- package/dist/src/util-ZzmqNPlg.js +1426 -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 +38 -38
- package/dist/src/app/assets/index-B2D0bCSI.js +0 -439
- package/dist/src/app/assets/vendor-charts-CCl15Imd.js +0 -36
- 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
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
const require_logger = require(
|
|
2
|
-
const require_esm = require(
|
|
3
|
-
const require_fileExtensions = require(
|
|
4
|
-
const require_util = require(
|
|
5
|
-
const require_fetch = require(
|
|
6
|
-
const require_cache = require(
|
|
7
|
-
const require_openai = require(
|
|
8
|
-
const require_util$1 = require(
|
|
1
|
+
const require_logger = require("./logger-Cp1GPUjj.cjs");
|
|
2
|
+
const require_esm = require("./esm-CnNt7sI4.cjs");
|
|
3
|
+
const require_fileExtensions = require("./fileExtensions-bYh77CN8.cjs");
|
|
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
|
+
const require_openai = require("./openai-Cuif0GEt.cjs");
|
|
8
|
+
const require_util$1 = require("./util-BzMcevZc.cjs");
|
|
9
9
|
let path = require("path");
|
|
10
10
|
path = require_logger.__toESM(path);
|
|
11
|
-
|
|
12
11
|
//#region src/providers/functionCallbackUtils.ts
|
|
13
12
|
/**
|
|
14
13
|
* Handles function callback execution for AI providers.
|
|
@@ -46,7 +45,7 @@ var FunctionCallbackHandler = class {
|
|
|
46
45
|
isError: false
|
|
47
46
|
};
|
|
48
47
|
} catch (error) {
|
|
49
|
-
require_logger.
|
|
48
|
+
require_logger.logger.debug(`Function callback failed for ${functionInfo.name}: ${error}`);
|
|
50
49
|
return {
|
|
51
50
|
output: typeof call === "string" ? call : JSON.stringify(call),
|
|
52
51
|
isError: true
|
|
@@ -116,8 +115,8 @@ var FunctionCallbackHandler = class {
|
|
|
116
115
|
if (splits[0] && require_fileExtensions.isJavascriptFile(splits[0])) [filePath, functionName] = splits;
|
|
117
116
|
}
|
|
118
117
|
try {
|
|
119
|
-
const resolvedPath = path.default.resolve(require_logger.
|
|
120
|
-
require_logger.
|
|
118
|
+
const resolvedPath = path.default.resolve(require_logger.state.basePath || "", filePath);
|
|
119
|
+
require_logger.logger.debug(`Loading function from ${resolvedPath}${functionName ? `:${functionName}` : ""}`);
|
|
121
120
|
const mod = await require_esm.importModule(resolvedPath);
|
|
122
121
|
const func = functionName && mod[functionName] ? mod[functionName] : mod.default || mod;
|
|
123
122
|
if (typeof func !== "function") throw new Error(`Expected ${resolvedPath}${functionName ? `:${functionName}` : ""} to export a function, got ${typeof func}`);
|
|
@@ -159,7 +158,7 @@ var FunctionCallbackHandler = class {
|
|
|
159
158
|
};
|
|
160
159
|
} catch (error) {
|
|
161
160
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
162
|
-
require_logger.
|
|
161
|
+
require_logger.logger.debug(`MCP tool execution failed for ${toolName}: ${errorMessage}`);
|
|
163
162
|
return {
|
|
164
163
|
output: `MCP Tool Error (${toolName}): ${errorMessage}`,
|
|
165
164
|
isError: true
|
|
@@ -180,7 +179,6 @@ var FunctionCallbackHandler = class {
|
|
|
180
179
|
this.loadedCallbacks = {};
|
|
181
180
|
}
|
|
182
181
|
};
|
|
183
|
-
|
|
184
182
|
//#endregion
|
|
185
183
|
//#region src/providers/responses/processor.ts
|
|
186
184
|
/**
|
|
@@ -232,7 +230,7 @@ var ResponsesProcessor = class {
|
|
|
232
230
|
this.config = config;
|
|
233
231
|
}
|
|
234
232
|
async processResponseOutput(data, requestConfig, cached) {
|
|
235
|
-
require_logger.
|
|
233
|
+
require_logger.logger.debug(`Processing ${this.config.providerType} responses output`, {
|
|
236
234
|
responseId: data.id,
|
|
237
235
|
model: data.model
|
|
238
236
|
});
|
|
@@ -257,7 +255,7 @@ var ResponsesProcessor = class {
|
|
|
257
255
|
if (requestConfig.response_format?.type === "json_schema" && typeof finalOutput === "string") try {
|
|
258
256
|
finalOutput = JSON.parse(finalOutput);
|
|
259
257
|
} catch (error) {
|
|
260
|
-
require_logger.
|
|
258
|
+
require_logger.logger.error(`Failed to parse JSON output: ${error}`);
|
|
261
259
|
}
|
|
262
260
|
const result = {
|
|
263
261
|
output: finalOutput,
|
|
@@ -277,7 +275,7 @@ var ResponsesProcessor = class {
|
|
|
277
275
|
}
|
|
278
276
|
}
|
|
279
277
|
async processOutput(output, context) {
|
|
280
|
-
if (this.config.modelName.includes("deep-research")) require_logger.
|
|
278
|
+
if (this.config.modelName.includes("deep-research")) require_logger.logger.debug(`Deep research response structure: ${JSON.stringify(context.data, null, 2)}`);
|
|
281
279
|
if (!output || !Array.isArray(output) || output.length === 0) throw new Error("Invalid response format: Missing output array");
|
|
282
280
|
let result = "";
|
|
283
281
|
let refusal = "";
|
|
@@ -285,7 +283,7 @@ var ResponsesProcessor = class {
|
|
|
285
283
|
const annotations = [];
|
|
286
284
|
for (const item of output) {
|
|
287
285
|
if (!item || typeof item !== "object") {
|
|
288
|
-
require_logger.
|
|
286
|
+
require_logger.logger.warn(`Skipping invalid output item: ${JSON.stringify(item)}`);
|
|
289
287
|
continue;
|
|
290
288
|
}
|
|
291
289
|
const processed = await this.processOutputItem(item, context);
|
|
@@ -315,7 +313,7 @@ var ResponsesProcessor = class {
|
|
|
315
313
|
case "mcp_call": return this.processMcpCall(item);
|
|
316
314
|
case "mcp_approval_request": return this.processMcpApprovalRequest(item);
|
|
317
315
|
default:
|
|
318
|
-
require_logger.
|
|
316
|
+
require_logger.logger.debug(`Unknown output item type: ${item.type}`);
|
|
319
317
|
return {};
|
|
320
318
|
}
|
|
321
319
|
}
|
|
@@ -338,7 +336,7 @@ var ResponsesProcessor = class {
|
|
|
338
336
|
const annotations = [];
|
|
339
337
|
if (item.content) for (const contentItem of item.content) {
|
|
340
338
|
if (!contentItem || typeof contentItem !== "object") {
|
|
341
|
-
require_logger.
|
|
339
|
+
require_logger.logger.warn(`Skipping invalid content item: ${JSON.stringify(contentItem)}`);
|
|
342
340
|
continue;
|
|
343
341
|
}
|
|
344
342
|
if (contentItem.type === "output_text") {
|
|
@@ -399,7 +397,6 @@ var ResponsesProcessor = class {
|
|
|
399
397
|
return Promise.resolve({ content });
|
|
400
398
|
}
|
|
401
399
|
};
|
|
402
|
-
|
|
403
400
|
//#endregion
|
|
404
401
|
//#region src/providers/openai/responses.ts
|
|
405
402
|
var OpenAiResponsesProvider = class extends require_openai.OpenAiGenericProvider {
|
|
@@ -568,7 +565,7 @@ var OpenAiResponsesProvider = class extends require_openai.OpenAiGenericProvider
|
|
|
568
565
|
};
|
|
569
566
|
}
|
|
570
567
|
async callApi(prompt, context, callApiOptions) {
|
|
571
|
-
if (!this.getApiKey()) throw new Error("OpenAI API key is not set. Set the OPENAI_API_KEY environment variable or add `apiKey` to the provider config.");
|
|
568
|
+
if (this.requiresApiKey() && !this.getApiKey()) throw new Error("OpenAI API key is not set. Set the OPENAI_API_KEY environment variable or add `apiKey` to the provider config.");
|
|
572
569
|
const { body, config } = await this.getOpenAiBody(prompt, context, callApiOptions);
|
|
573
570
|
const isDeepResearchModel = this.modelName.includes("deep-research");
|
|
574
571
|
if (isDeepResearchModel) {
|
|
@@ -581,7 +578,7 @@ var OpenAiResponsesProvider = class extends require_openai.OpenAiGenericProvider
|
|
|
581
578
|
if (isDeepResearchModel || isGpt5ProModel) {
|
|
582
579
|
const evalTimeout = require_logger.getEnvInt("PROMPTFOO_EVAL_TIMEOUT_MS", 0);
|
|
583
580
|
timeout = evalTimeout > 0 ? evalTimeout : require_fetch.LONG_RUNNING_MODEL_TIMEOUT_MS;
|
|
584
|
-
require_logger.
|
|
581
|
+
require_logger.logger.debug(`Using timeout of ${timeout}ms for long-running model ${this.modelName}`);
|
|
585
582
|
}
|
|
586
583
|
let data;
|
|
587
584
|
let status;
|
|
@@ -594,7 +591,7 @@ var OpenAiResponsesProvider = class extends require_openai.OpenAiGenericProvider
|
|
|
594
591
|
method: "POST",
|
|
595
592
|
headers: {
|
|
596
593
|
"Content-Type": "application/json",
|
|
597
|
-
Authorization: `Bearer ${this.getApiKey()}
|
|
594
|
+
...this.getApiKey() ? { Authorization: `Bearer ${this.getApiKey()}` } : {},
|
|
598
595
|
...this.getOrganization() ? { "OpenAI-Organization": this.getOrganization() } : {},
|
|
599
596
|
...config.headers
|
|
600
597
|
},
|
|
@@ -622,7 +619,7 @@ var OpenAiResponsesProvider = class extends require_openai.OpenAiGenericProvider
|
|
|
622
619
|
};
|
|
623
620
|
}
|
|
624
621
|
} catch (err) {
|
|
625
|
-
require_logger.
|
|
622
|
+
require_logger.logger.error(`API call error: ${String(err)}`);
|
|
626
623
|
await deleteFromCache?.();
|
|
627
624
|
return {
|
|
628
625
|
error: `API call error: ${String(err)}`,
|
|
@@ -658,24 +655,24 @@ var OpenAiResponsesProvider = class extends require_openai.OpenAiGenericProvider
|
|
|
658
655
|
};
|
|
659
656
|
}
|
|
660
657
|
};
|
|
661
|
-
|
|
662
658
|
//#endregion
|
|
663
|
-
Object.defineProperty(exports,
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
659
|
+
Object.defineProperty(exports, "FunctionCallbackHandler", {
|
|
660
|
+
enumerable: true,
|
|
661
|
+
get: function() {
|
|
662
|
+
return FunctionCallbackHandler;
|
|
663
|
+
}
|
|
668
664
|
});
|
|
669
|
-
Object.defineProperty(exports,
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
665
|
+
Object.defineProperty(exports, "OpenAiResponsesProvider", {
|
|
666
|
+
enumerable: true,
|
|
667
|
+
get: function() {
|
|
668
|
+
return OpenAiResponsesProvider;
|
|
669
|
+
}
|
|
674
670
|
});
|
|
675
|
-
Object.defineProperty(exports,
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
671
|
+
Object.defineProperty(exports, "ResponsesProcessor", {
|
|
672
|
+
enumerable: true,
|
|
673
|
+
get: function() {
|
|
674
|
+
return ResponsesProcessor;
|
|
675
|
+
}
|
|
680
676
|
});
|
|
681
|
-
|
|
677
|
+
|
|
678
|
+
//# sourceMappingURL=responses-D8SBTL64.cjs.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { b as getEnvString, i as
|
|
2
|
-
import { r as importModule } from "./esm-
|
|
3
|
-
import { i as isJavascriptFile } from "./fileExtensions-
|
|
4
|
-
import { d as maybeLoadToolsFromExternalFile, g as renderVarsInObject, u as maybeLoadResponseFormatFromExternalFile } from "./util-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as OpenAiGenericProvider } from "./openai-
|
|
8
|
-
import { a as calculateOpenAICost, c as getTokenUsage$1, s as formatOpenAiError } from "./util-
|
|
1
|
+
import { b as getEnvString, i as logger, v as getEnvFloat, w as state, y as getEnvInt } from "./logger-CT3IKMKA.js";
|
|
2
|
+
import { r as importModule } from "./esm-Cd1AjG1D.js";
|
|
3
|
+
import { i as isJavascriptFile } from "./fileExtensions-DnqA1y9x.js";
|
|
4
|
+
import { d as maybeLoadToolsFromExternalFile, g as renderVarsInObject, u as maybeLoadResponseFormatFromExternalFile } from "./util-BRYkYPTd.js";
|
|
5
|
+
import { f as LONG_RUNNING_MODEL_TIMEOUT_MS, p as REQUEST_TIMEOUT_MS } from "./fetch-Cwxnd8zz.js";
|
|
6
|
+
import { r as fetchWithCache } from "./cache-C4Nxf52C.js";
|
|
7
|
+
import { t as OpenAiGenericProvider } from "./openai-DElQ-fPX.js";
|
|
8
|
+
import { a as calculateOpenAICost, c as getTokenUsage$1, s as formatOpenAiError } from "./util-Dnmk2mBQ.js";
|
|
9
9
|
import path from "path";
|
|
10
|
-
|
|
11
10
|
//#region src/providers/functionCallbackUtils.ts
|
|
12
11
|
/**
|
|
13
12
|
* Handles function callback execution for AI providers.
|
|
@@ -45,7 +44,7 @@ var FunctionCallbackHandler = class {
|
|
|
45
44
|
isError: false
|
|
46
45
|
};
|
|
47
46
|
} catch (error) {
|
|
48
|
-
|
|
47
|
+
logger.debug(`Function callback failed for ${functionInfo.name}: ${error}`);
|
|
49
48
|
return {
|
|
50
49
|
output: typeof call === "string" ? call : JSON.stringify(call),
|
|
51
50
|
isError: true
|
|
@@ -115,8 +114,8 @@ var FunctionCallbackHandler = class {
|
|
|
115
114
|
if (splits[0] && isJavascriptFile(splits[0])) [filePath, functionName] = splits;
|
|
116
115
|
}
|
|
117
116
|
try {
|
|
118
|
-
const resolvedPath = path.resolve(
|
|
119
|
-
|
|
117
|
+
const resolvedPath = path.resolve(state.basePath || "", filePath);
|
|
118
|
+
logger.debug(`Loading function from ${resolvedPath}${functionName ? `:${functionName}` : ""}`);
|
|
120
119
|
const mod = await importModule(resolvedPath);
|
|
121
120
|
const func = functionName && mod[functionName] ? mod[functionName] : mod.default || mod;
|
|
122
121
|
if (typeof func !== "function") throw new Error(`Expected ${resolvedPath}${functionName ? `:${functionName}` : ""} to export a function, got ${typeof func}`);
|
|
@@ -158,7 +157,7 @@ var FunctionCallbackHandler = class {
|
|
|
158
157
|
};
|
|
159
158
|
} catch (error) {
|
|
160
159
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
161
|
-
|
|
160
|
+
logger.debug(`MCP tool execution failed for ${toolName}: ${errorMessage}`);
|
|
162
161
|
return {
|
|
163
162
|
output: `MCP Tool Error (${toolName}): ${errorMessage}`,
|
|
164
163
|
isError: true
|
|
@@ -179,7 +178,6 @@ var FunctionCallbackHandler = class {
|
|
|
179
178
|
this.loadedCallbacks = {};
|
|
180
179
|
}
|
|
181
180
|
};
|
|
182
|
-
|
|
183
181
|
//#endregion
|
|
184
182
|
//#region src/providers/responses/processor.ts
|
|
185
183
|
/**
|
|
@@ -231,7 +229,7 @@ var ResponsesProcessor = class {
|
|
|
231
229
|
this.config = config;
|
|
232
230
|
}
|
|
233
231
|
async processResponseOutput(data, requestConfig, cached) {
|
|
234
|
-
|
|
232
|
+
logger.debug(`Processing ${this.config.providerType} responses output`, {
|
|
235
233
|
responseId: data.id,
|
|
236
234
|
model: data.model
|
|
237
235
|
});
|
|
@@ -256,7 +254,7 @@ var ResponsesProcessor = class {
|
|
|
256
254
|
if (requestConfig.response_format?.type === "json_schema" && typeof finalOutput === "string") try {
|
|
257
255
|
finalOutput = JSON.parse(finalOutput);
|
|
258
256
|
} catch (error) {
|
|
259
|
-
|
|
257
|
+
logger.error(`Failed to parse JSON output: ${error}`);
|
|
260
258
|
}
|
|
261
259
|
const result = {
|
|
262
260
|
output: finalOutput,
|
|
@@ -276,7 +274,7 @@ var ResponsesProcessor = class {
|
|
|
276
274
|
}
|
|
277
275
|
}
|
|
278
276
|
async processOutput(output, context) {
|
|
279
|
-
if (this.config.modelName.includes("deep-research"))
|
|
277
|
+
if (this.config.modelName.includes("deep-research")) logger.debug(`Deep research response structure: ${JSON.stringify(context.data, null, 2)}`);
|
|
280
278
|
if (!output || !Array.isArray(output) || output.length === 0) throw new Error("Invalid response format: Missing output array");
|
|
281
279
|
let result = "";
|
|
282
280
|
let refusal = "";
|
|
@@ -284,7 +282,7 @@ var ResponsesProcessor = class {
|
|
|
284
282
|
const annotations = [];
|
|
285
283
|
for (const item of output) {
|
|
286
284
|
if (!item || typeof item !== "object") {
|
|
287
|
-
|
|
285
|
+
logger.warn(`Skipping invalid output item: ${JSON.stringify(item)}`);
|
|
288
286
|
continue;
|
|
289
287
|
}
|
|
290
288
|
const processed = await this.processOutputItem(item, context);
|
|
@@ -314,7 +312,7 @@ var ResponsesProcessor = class {
|
|
|
314
312
|
case "mcp_call": return this.processMcpCall(item);
|
|
315
313
|
case "mcp_approval_request": return this.processMcpApprovalRequest(item);
|
|
316
314
|
default:
|
|
317
|
-
|
|
315
|
+
logger.debug(`Unknown output item type: ${item.type}`);
|
|
318
316
|
return {};
|
|
319
317
|
}
|
|
320
318
|
}
|
|
@@ -337,7 +335,7 @@ var ResponsesProcessor = class {
|
|
|
337
335
|
const annotations = [];
|
|
338
336
|
if (item.content) for (const contentItem of item.content) {
|
|
339
337
|
if (!contentItem || typeof contentItem !== "object") {
|
|
340
|
-
|
|
338
|
+
logger.warn(`Skipping invalid content item: ${JSON.stringify(contentItem)}`);
|
|
341
339
|
continue;
|
|
342
340
|
}
|
|
343
341
|
if (contentItem.type === "output_text") {
|
|
@@ -398,7 +396,6 @@ var ResponsesProcessor = class {
|
|
|
398
396
|
return Promise.resolve({ content });
|
|
399
397
|
}
|
|
400
398
|
};
|
|
401
|
-
|
|
402
399
|
//#endregion
|
|
403
400
|
//#region src/providers/openai/responses.ts
|
|
404
401
|
var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
@@ -567,7 +564,7 @@ var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
|
567
564
|
};
|
|
568
565
|
}
|
|
569
566
|
async callApi(prompt, context, callApiOptions) {
|
|
570
|
-
if (!this.getApiKey()) throw new Error("OpenAI API key is not set. Set the OPENAI_API_KEY environment variable or add `apiKey` to the provider config.");
|
|
567
|
+
if (this.requiresApiKey() && !this.getApiKey()) throw new Error("OpenAI API key is not set. Set the OPENAI_API_KEY environment variable or add `apiKey` to the provider config.");
|
|
571
568
|
const { body, config } = await this.getOpenAiBody(prompt, context, callApiOptions);
|
|
572
569
|
const isDeepResearchModel = this.modelName.includes("deep-research");
|
|
573
570
|
if (isDeepResearchModel) {
|
|
@@ -580,7 +577,7 @@ var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
|
580
577
|
if (isDeepResearchModel || isGpt5ProModel) {
|
|
581
578
|
const evalTimeout = getEnvInt("PROMPTFOO_EVAL_TIMEOUT_MS", 0);
|
|
582
579
|
timeout = evalTimeout > 0 ? evalTimeout : LONG_RUNNING_MODEL_TIMEOUT_MS;
|
|
583
|
-
|
|
580
|
+
logger.debug(`Using timeout of ${timeout}ms for long-running model ${this.modelName}`);
|
|
584
581
|
}
|
|
585
582
|
let data;
|
|
586
583
|
let status;
|
|
@@ -593,7 +590,7 @@ var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
|
593
590
|
method: "POST",
|
|
594
591
|
headers: {
|
|
595
592
|
"Content-Type": "application/json",
|
|
596
|
-
Authorization: `Bearer ${this.getApiKey()}
|
|
593
|
+
...this.getApiKey() ? { Authorization: `Bearer ${this.getApiKey()}` } : {},
|
|
597
594
|
...this.getOrganization() ? { "OpenAI-Organization": this.getOrganization() } : {},
|
|
598
595
|
...config.headers
|
|
599
596
|
},
|
|
@@ -621,7 +618,7 @@ var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
|
621
618
|
};
|
|
622
619
|
}
|
|
623
620
|
} catch (err) {
|
|
624
|
-
|
|
621
|
+
logger.error(`API call error: ${String(err)}`);
|
|
625
622
|
await deleteFromCache?.();
|
|
626
623
|
return {
|
|
627
624
|
error: `API call error: ${String(err)}`,
|
|
@@ -657,7 +654,7 @@ var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
|
657
654
|
};
|
|
658
655
|
}
|
|
659
656
|
};
|
|
660
|
-
|
|
661
657
|
//#endregion
|
|
662
658
|
export { ResponsesProcessor as n, FunctionCallbackHandler as r, OpenAiResponsesProvider as t };
|
|
663
|
-
|
|
659
|
+
|
|
660
|
+
//# sourceMappingURL=responses-DIR9Ud3j.js.map
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as getEnvString, O as
|
|
3
|
-
import { d as LONG_RUNNING_MODEL_TIMEOUT_MS, f as REQUEST_TIMEOUT_MS } from "./fetch-
|
|
4
|
-
import { a as fetchWithCache } from "./cache-
|
|
5
|
-
import { i as isJavascriptFile } from "./fileExtensions-
|
|
6
|
-
import { g as maybeLoadToolsFromExternalFile, h as maybeLoadResponseFormatFromExternalFile, x as renderVarsInObject } from "./util-
|
|
7
|
-
import { r as importModule } from "./esm-
|
|
8
|
-
import { t as OpenAiGenericProvider } from "./openai-
|
|
9
|
-
import { a as calculateOpenAICost, c as getTokenUsage$1, s as formatOpenAiError } from "./util-
|
|
2
|
+
import { C as getEnvString, O as state, S as getEnvInt, o as logger, x as getEnvFloat } from "./logger-KkObSCzq.js";
|
|
3
|
+
import { d as LONG_RUNNING_MODEL_TIMEOUT_MS, f as REQUEST_TIMEOUT_MS } from "./fetch-Dxpd4_sr.js";
|
|
4
|
+
import { a as fetchWithCache } from "./cache-BVeDlD87.js";
|
|
5
|
+
import { i as isJavascriptFile } from "./fileExtensions-Ds-foDzt.js";
|
|
6
|
+
import { g as maybeLoadToolsFromExternalFile, h as maybeLoadResponseFormatFromExternalFile, x as renderVarsInObject } from "./util-C1CeHl-P.js";
|
|
7
|
+
import { r as importModule } from "./esm-C03C-mv3.js";
|
|
8
|
+
import { t as OpenAiGenericProvider } from "./openai-DhbB7eWK.js";
|
|
9
|
+
import { a as calculateOpenAICost, c as getTokenUsage$1, s as formatOpenAiError } from "./util-CMy69ZgQ.js";
|
|
10
10
|
import path from "path";
|
|
11
|
-
|
|
12
11
|
//#region src/providers/functionCallbackUtils.ts
|
|
13
12
|
/**
|
|
14
13
|
* Handles function callback execution for AI providers.
|
|
@@ -46,7 +45,7 @@ var FunctionCallbackHandler = class {
|
|
|
46
45
|
isError: false
|
|
47
46
|
};
|
|
48
47
|
} catch (error) {
|
|
49
|
-
|
|
48
|
+
logger.debug(`Function callback failed for ${functionInfo.name}: ${error}`);
|
|
50
49
|
return {
|
|
51
50
|
output: typeof call === "string" ? call : JSON.stringify(call),
|
|
52
51
|
isError: true
|
|
@@ -116,8 +115,8 @@ var FunctionCallbackHandler = class {
|
|
|
116
115
|
if (splits[0] && isJavascriptFile(splits[0])) [filePath, functionName] = splits;
|
|
117
116
|
}
|
|
118
117
|
try {
|
|
119
|
-
const resolvedPath = path.resolve(
|
|
120
|
-
|
|
118
|
+
const resolvedPath = path.resolve(state.basePath || "", filePath);
|
|
119
|
+
logger.debug(`Loading function from ${resolvedPath}${functionName ? `:${functionName}` : ""}`);
|
|
121
120
|
const mod = await importModule(resolvedPath);
|
|
122
121
|
const func = functionName && mod[functionName] ? mod[functionName] : mod.default || mod;
|
|
123
122
|
if (typeof func !== "function") throw new Error(`Expected ${resolvedPath}${functionName ? `:${functionName}` : ""} to export a function, got ${typeof func}`);
|
|
@@ -159,7 +158,7 @@ var FunctionCallbackHandler = class {
|
|
|
159
158
|
};
|
|
160
159
|
} catch (error) {
|
|
161
160
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
162
|
-
|
|
161
|
+
logger.debug(`MCP tool execution failed for ${toolName}: ${errorMessage}`);
|
|
163
162
|
return {
|
|
164
163
|
output: `MCP Tool Error (${toolName}): ${errorMessage}`,
|
|
165
164
|
isError: true
|
|
@@ -180,7 +179,6 @@ var FunctionCallbackHandler = class {
|
|
|
180
179
|
this.loadedCallbacks = {};
|
|
181
180
|
}
|
|
182
181
|
};
|
|
183
|
-
|
|
184
182
|
//#endregion
|
|
185
183
|
//#region src/providers/responses/processor.ts
|
|
186
184
|
/**
|
|
@@ -232,7 +230,7 @@ var ResponsesProcessor = class {
|
|
|
232
230
|
this.config = config;
|
|
233
231
|
}
|
|
234
232
|
async processResponseOutput(data, requestConfig, cached) {
|
|
235
|
-
|
|
233
|
+
logger.debug(`Processing ${this.config.providerType} responses output`, {
|
|
236
234
|
responseId: data.id,
|
|
237
235
|
model: data.model
|
|
238
236
|
});
|
|
@@ -257,7 +255,7 @@ var ResponsesProcessor = class {
|
|
|
257
255
|
if (requestConfig.response_format?.type === "json_schema" && typeof finalOutput === "string") try {
|
|
258
256
|
finalOutput = JSON.parse(finalOutput);
|
|
259
257
|
} catch (error) {
|
|
260
|
-
|
|
258
|
+
logger.error(`Failed to parse JSON output: ${error}`);
|
|
261
259
|
}
|
|
262
260
|
const result = {
|
|
263
261
|
output: finalOutput,
|
|
@@ -277,7 +275,7 @@ var ResponsesProcessor = class {
|
|
|
277
275
|
}
|
|
278
276
|
}
|
|
279
277
|
async processOutput(output, context) {
|
|
280
|
-
if (this.config.modelName.includes("deep-research"))
|
|
278
|
+
if (this.config.modelName.includes("deep-research")) logger.debug(`Deep research response structure: ${JSON.stringify(context.data, null, 2)}`);
|
|
281
279
|
if (!output || !Array.isArray(output) || output.length === 0) throw new Error("Invalid response format: Missing output array");
|
|
282
280
|
let result = "";
|
|
283
281
|
let refusal = "";
|
|
@@ -285,7 +283,7 @@ var ResponsesProcessor = class {
|
|
|
285
283
|
const annotations = [];
|
|
286
284
|
for (const item of output) {
|
|
287
285
|
if (!item || typeof item !== "object") {
|
|
288
|
-
|
|
286
|
+
logger.warn(`Skipping invalid output item: ${JSON.stringify(item)}`);
|
|
289
287
|
continue;
|
|
290
288
|
}
|
|
291
289
|
const processed = await this.processOutputItem(item, context);
|
|
@@ -315,7 +313,7 @@ var ResponsesProcessor = class {
|
|
|
315
313
|
case "mcp_call": return this.processMcpCall(item);
|
|
316
314
|
case "mcp_approval_request": return this.processMcpApprovalRequest(item);
|
|
317
315
|
default:
|
|
318
|
-
|
|
316
|
+
logger.debug(`Unknown output item type: ${item.type}`);
|
|
319
317
|
return {};
|
|
320
318
|
}
|
|
321
319
|
}
|
|
@@ -338,7 +336,7 @@ var ResponsesProcessor = class {
|
|
|
338
336
|
const annotations = [];
|
|
339
337
|
if (item.content) for (const contentItem of item.content) {
|
|
340
338
|
if (!contentItem || typeof contentItem !== "object") {
|
|
341
|
-
|
|
339
|
+
logger.warn(`Skipping invalid content item: ${JSON.stringify(contentItem)}`);
|
|
342
340
|
continue;
|
|
343
341
|
}
|
|
344
342
|
if (contentItem.type === "output_text") {
|
|
@@ -399,7 +397,6 @@ var ResponsesProcessor = class {
|
|
|
399
397
|
return Promise.resolve({ content });
|
|
400
398
|
}
|
|
401
399
|
};
|
|
402
|
-
|
|
403
400
|
//#endregion
|
|
404
401
|
//#region src/providers/openai/responses.ts
|
|
405
402
|
var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
@@ -568,7 +565,7 @@ var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
|
568
565
|
};
|
|
569
566
|
}
|
|
570
567
|
async callApi(prompt, context, callApiOptions) {
|
|
571
|
-
if (!this.getApiKey()) throw new Error("OpenAI API key is not set. Set the OPENAI_API_KEY environment variable or add `apiKey` to the provider config.");
|
|
568
|
+
if (this.requiresApiKey() && !this.getApiKey()) throw new Error("OpenAI API key is not set. Set the OPENAI_API_KEY environment variable or add `apiKey` to the provider config.");
|
|
572
569
|
const { body, config } = await this.getOpenAiBody(prompt, context, callApiOptions);
|
|
573
570
|
const isDeepResearchModel = this.modelName.includes("deep-research");
|
|
574
571
|
if (isDeepResearchModel) {
|
|
@@ -581,7 +578,7 @@ var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
|
581
578
|
if (isDeepResearchModel || isGpt5ProModel) {
|
|
582
579
|
const evalTimeout = getEnvInt("PROMPTFOO_EVAL_TIMEOUT_MS", 0);
|
|
583
580
|
timeout = evalTimeout > 0 ? evalTimeout : LONG_RUNNING_MODEL_TIMEOUT_MS;
|
|
584
|
-
|
|
581
|
+
logger.debug(`Using timeout of ${timeout}ms for long-running model ${this.modelName}`);
|
|
585
582
|
}
|
|
586
583
|
let data;
|
|
587
584
|
let status;
|
|
@@ -594,7 +591,7 @@ var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
|
594
591
|
method: "POST",
|
|
595
592
|
headers: {
|
|
596
593
|
"Content-Type": "application/json",
|
|
597
|
-
Authorization: `Bearer ${this.getApiKey()}
|
|
594
|
+
...this.getApiKey() ? { Authorization: `Bearer ${this.getApiKey()}` } : {},
|
|
598
595
|
...this.getOrganization() ? { "OpenAI-Organization": this.getOrganization() } : {},
|
|
599
596
|
...config.headers
|
|
600
597
|
},
|
|
@@ -622,7 +619,7 @@ var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
|
622
619
|
};
|
|
623
620
|
}
|
|
624
621
|
} catch (err) {
|
|
625
|
-
|
|
622
|
+
logger.error(`API call error: ${String(err)}`);
|
|
626
623
|
await deleteFromCache?.();
|
|
627
624
|
return {
|
|
628
625
|
error: `API call error: ${String(err)}`,
|
|
@@ -658,7 +655,7 @@ var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
|
658
655
|
};
|
|
659
656
|
}
|
|
660
657
|
};
|
|
661
|
-
|
|
662
658
|
//#endregion
|
|
663
659
|
export { ResponsesProcessor as n, FunctionCallbackHandler as r, OpenAiResponsesProvider as t };
|
|
664
|
-
|
|
660
|
+
|
|
661
|
+
//# sourceMappingURL=responses-WNGNYe3K.js.map
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./chunk-DEq-mXcV.js";
|
|
2
|
+
import { b as getEnvString, i as logger, m as safeJsonStringify } from "./logger-CT3IKMKA.js";
|
|
3
|
+
import { n as getWrapperDir } from "./esm-Cd1AjG1D.js";
|
|
3
4
|
import fs from "fs";
|
|
4
5
|
import path from "path";
|
|
5
6
|
import os from "os";
|
|
6
7
|
import { execFile } from "child_process";
|
|
7
8
|
import { promisify } from "util";
|
|
8
|
-
|
|
9
9
|
//#region src/ruby/rubyUtils.ts
|
|
10
|
+
var rubyUtils_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
+
getSysExecutable: () => getSysExecutable,
|
|
12
|
+
runRuby: () => runRuby,
|
|
13
|
+
state: () => state,
|
|
14
|
+
tryPath: () => tryPath,
|
|
15
|
+
validateRubyPath: () => validateRubyPath
|
|
16
|
+
});
|
|
10
17
|
const execFileAsync = promisify(execFile);
|
|
11
18
|
/**
|
|
12
19
|
* Global state for Ruby executable path caching.
|
|
@@ -26,7 +33,7 @@ async function tryWindowsWhere() {
|
|
|
26
33
|
try {
|
|
27
34
|
const output = (await execFileAsync("where", ["ruby"])).stdout.trim();
|
|
28
35
|
if (!output) {
|
|
29
|
-
|
|
36
|
+
logger.debug("Windows 'where ruby' returned empty output");
|
|
30
37
|
return null;
|
|
31
38
|
}
|
|
32
39
|
const paths = output.split("\n").filter((path) => path.trim());
|
|
@@ -38,8 +45,8 @@ async function tryWindowsWhere() {
|
|
|
38
45
|
}
|
|
39
46
|
} catch (error) {
|
|
40
47
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
41
|
-
|
|
42
|
-
if (errorMsg.includes("Access is denied") || errorMsg.includes("EACCES"))
|
|
48
|
+
logger.debug(`Windows 'where ruby' failed: ${errorMsg}`);
|
|
49
|
+
if (errorMsg.includes("Access is denied") || errorMsg.includes("EACCES")) logger.warn(`Permission denied when searching for Ruby: ${errorMsg}`);
|
|
43
50
|
}
|
|
44
51
|
return null;
|
|
45
52
|
}
|
|
@@ -55,8 +62,8 @@ async function tryRubyCommands(commands) {
|
|
|
55
62
|
if (executablePath && executablePath !== "None") return executablePath;
|
|
56
63
|
} catch (error) {
|
|
57
64
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
58
|
-
|
|
59
|
-
if (errorMsg.includes("Access is denied") || errorMsg.includes("EACCES") || errorMsg.includes("EPERM"))
|
|
65
|
+
logger.debug(`Ruby command "${cmd}" failed: ${errorMsg}`);
|
|
66
|
+
if (errorMsg.includes("Access is denied") || errorMsg.includes("EACCES") || errorMsg.includes("EPERM")) logger.warn(`Permission denied when trying Ruby command "${cmd}": ${errorMsg}`);
|
|
60
67
|
}
|
|
61
68
|
return null;
|
|
62
69
|
}
|
|
@@ -72,8 +79,8 @@ async function tryDirectCommands(commands) {
|
|
|
72
79
|
if (validated) return validated;
|
|
73
80
|
} catch (error) {
|
|
74
81
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
75
|
-
|
|
76
|
-
if (errorMsg.includes("Access is denied") || errorMsg.includes("EACCES") || errorMsg.includes("EPERM"))
|
|
82
|
+
logger.debug(`Direct command "${cmd}" failed: ${errorMsg}`);
|
|
83
|
+
if (errorMsg.includes("Access is denied") || errorMsg.includes("EACCES") || errorMsg.includes("EPERM")) logger.warn(`Permission denied when trying Ruby command "${cmd}": ${errorMsg}`);
|
|
77
84
|
}
|
|
78
85
|
return null;
|
|
79
86
|
}
|
|
@@ -175,7 +182,7 @@ async function runRuby(scriptPath, method, args, options = {}) {
|
|
|
175
182
|
const wrapperPath = path.join(getWrapperDir("ruby"), "wrapper.rb");
|
|
176
183
|
try {
|
|
177
184
|
fs.writeFileSync(tempJsonPath, safeJsonStringify(args), "utf-8");
|
|
178
|
-
|
|
185
|
+
logger.debug(`Running Ruby wrapper with args: ${safeJsonStringify(args)}`);
|
|
179
186
|
const { stdout, stderr } = await execFileAsync(rubyPath, [
|
|
180
187
|
wrapperPath,
|
|
181
188
|
absPath,
|
|
@@ -183,33 +190,33 @@ async function runRuby(scriptPath, method, args, options = {}) {
|
|
|
183
190
|
tempJsonPath,
|
|
184
191
|
outputPath
|
|
185
192
|
]);
|
|
186
|
-
if (stdout)
|
|
187
|
-
if (stderr)
|
|
193
|
+
if (stdout) logger.debug(stdout.trim());
|
|
194
|
+
if (stderr) logger.error(stderr.trim());
|
|
188
195
|
const output = fs.readFileSync(outputPath, "utf-8");
|
|
189
|
-
|
|
196
|
+
logger.debug(`Ruby script ${absPath} returned: ${output}`);
|
|
190
197
|
let result;
|
|
191
198
|
try {
|
|
192
199
|
result = JSON.parse(output);
|
|
193
|
-
|
|
200
|
+
logger.debug(`Ruby script ${absPath} parsed output type: ${typeof result}, structure: ${result ? JSON.stringify(Object.keys(result)) : "undefined"}`);
|
|
194
201
|
} catch (error) {
|
|
195
202
|
throw new Error(`Invalid JSON: ${error.message} when parsing result: ${output}\nStack Trace: ${error.stack}`);
|
|
196
203
|
}
|
|
197
204
|
if (result?.type !== "final_result") throw new Error("The Ruby script `call_api` function must return a hash with an `output`");
|
|
198
205
|
return result.data;
|
|
199
206
|
} catch (error) {
|
|
200
|
-
|
|
207
|
+
logger.error(`Error running Ruby script: ${error.message}\nStack Trace: ${error.stack || "No Ruby traceback available"}`);
|
|
201
208
|
throw new Error(`Error running Ruby script: ${error.message}\nStack Trace: ${error.stack || "No Ruby traceback available"}`);
|
|
202
209
|
} finally {
|
|
203
210
|
[tempJsonPath, outputPath].forEach((file) => {
|
|
204
211
|
try {
|
|
205
212
|
fs.unlinkSync(file);
|
|
206
213
|
} catch (error) {
|
|
207
|
-
|
|
214
|
+
logger.error(`Error removing ${file}: ${error}`);
|
|
208
215
|
}
|
|
209
216
|
});
|
|
210
217
|
}
|
|
211
218
|
}
|
|
212
|
-
|
|
213
219
|
//#endregion
|
|
214
|
-
export {
|
|
215
|
-
|
|
220
|
+
export { runRuby as n, rubyUtils_exports as t };
|
|
221
|
+
|
|
222
|
+
//# sourceMappingURL=rubyUtils-BUVePouc.js.map
|