promptfoo 0.121.3 → 0.121.4
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-Du7YVwj5.js → ListApp-DQkFNqE9.js} +1 -1
- package/dist/src/{accounts-Xatc0RYb.js → accounts-DdJ2pHMI.js} +5 -5
- package/dist/src/{accounts-B2XmGjty.js → accounts-DhMYUUbu.js} +5 -5
- package/dist/src/{accounts-BPyfpSeU.cjs → accounts-Dy17bs4D.cjs} +5 -5
- package/dist/src/{accounts-CFLK3mnD.js → accounts-F9d_5sMC.js} +6 -6
- package/dist/src/{agentic-utils-DAVsChuB.cjs → agentic-utils-BpX5b23w.cjs} +3 -3
- package/dist/src/{agentic-utils-DIYAAYE7.js → agentic-utils-P172hM8B.js} +3 -3
- package/dist/src/{agentic-utils-D8yXo5Lm.js → agentic-utils-qFlm6zes.js} +4 -4
- package/dist/src/{agentic-utils-36epdqwB.js → agentic-utils-w68v6_Dz.js} +3 -3
- package/dist/src/{agents-CLQ-P15P.js → agents-8FDnTriG.js} +6 -7
- package/dist/src/{agents-CAYbM7qD.cjs → agents-BahDpe5G.cjs} +34 -12
- package/dist/src/{agents-DSSTV4bv.js → agents-C-R_jfzI.js} +35 -13
- package/dist/src/{agents-wg3ohknq.js → agents-CgaMXvLM.js} +5 -7
- package/dist/src/{agents-BBWxKSM0.cjs → agents-D7-HGxUj.cjs} +5 -7
- package/dist/src/{agents-BBVJCIYr.js → agents-DJ35I3Nt.js} +35 -13
- package/dist/src/{agents-CgBniSlI.js → agents-aYPQLf8W.js} +5 -9
- package/dist/src/{agents-Bqgfdokm.js → agents-pQeBEXMm.js} +35 -14
- package/dist/src/{aimlapi-BwGC1TtS.js → aimlapi-BCq3MHeL.js} +8 -14
- package/dist/src/{aimlapi-MgSLdvy7.js → aimlapi-BD6J9oKt.js} +7 -14
- package/dist/src/{aimlapi-Bv8Fmc-b.cjs → aimlapi-qcK4OT55.cjs} +8 -15
- package/dist/src/{aimlapi-DaC3qZ-o.js → aimlapi-sgYnkE54.js} +7 -16
- package/dist/src/app/app/tsconfig.app.tsbuildinfo +1 -0
- package/dist/src/app/assets/Report-CQYFezYu.js +1 -0
- package/dist/src/app/assets/index-BXGkeMwh.css +1 -0
- package/dist/src/app/assets/index-BzJt18Jz.js +385 -0
- package/dist/src/app/assets/rolldown-runtime-COnpUsM8.js +1 -0
- package/dist/src/app/assets/scroll-timeline-D9IT_e8Z.js +1 -0
- package/dist/src/app/assets/sync-IjzpWrOE.js +4 -0
- package/dist/src/app/assets/vendor-charts-BNdH8TCw.js +36 -0
- package/dist/src/app/assets/vendor-markdown-Ch00wnNI.js +29 -0
- package/dist/src/app/assets/vendor-react-CVvmk1UB.js +9 -0
- package/dist/src/app/assets/vendor-utils-BnEYbx2Q.js +37 -0
- package/dist/src/app/index.html +7 -7
- package/dist/src/{audio-DjU9GswO.js → audio-B7izf48x.js} +4 -5
- package/dist/src/{audio-DVFjQ67_.cjs → audio-BQtNuYBj.cjs} +4 -4
- package/dist/src/{audio-Bn44pQxv.js → audio-COrn8rM6.js} +4 -4
- package/dist/src/{audio-DDA5WHdx.js → audio-DcVKoInv.js} +4 -4
- package/dist/src/{base-BboXIF_0.cjs → base-D-670DX8.cjs} +3 -3
- package/dist/src/{base-CqzQ4K8j.js → base-PYJvBE1i.js} +3 -3
- package/dist/src/{base-CKjwebIH.js → base-fZ9wgg50.js} +3 -3
- package/dist/src/{base-Cz2ZC_iA.js → base-yrI1Yal4.js} +3 -3
- package/dist/src/{blobs-BUWmKWzo.js → blobs-BCZavS8s.js} +4 -4
- package/dist/src/{blobs-B1JriOyi.js → blobs-BQWqnnvL.js} +4 -4
- package/dist/src/{blobs-DXTl6J3H.js → blobs-C-F78Kfn.js} +3 -3
- package/dist/src/{blobs-C6j0bvFz.cjs → blobs-D2FAd1Q5.cjs} +3 -3
- package/dist/src/cache-BIyPcp5v.cjs +376 -0
- package/dist/src/cache-C4Xb-hNb.js +310 -0
- package/dist/src/cache-Cr9oLMUa.js +3 -0
- package/dist/src/cache-D5NZmMiT.js +310 -0
- package/dist/src/cache-DbLsVWB2.cjs +3 -0
- package/dist/src/cache-mb7c8hbp.js +280 -0
- package/dist/src/{chat-DK1U-eZ-.js → chat-0bwXjVP0.js} +3 -13
- package/dist/src/{chat-BtIKkLKx.cjs → chat-BPXSW8Bv.cjs} +3 -13
- package/dist/src/{chat-B0iaWhoh.js → chat-BfPaS15_.js} +63 -37
- package/dist/src/{chat-CM8qWR3_.cjs → chat-CclRbxGf.cjs} +63 -37
- package/dist/src/{chat-BEwdgGEg.js → chat-Dr3DUQ0D.js} +63 -37
- package/dist/src/{chat-pxmiVpWe.js → chat-I9izLm49.js} +62 -36
- package/dist/src/{chat-B-52XYI1.js → chat-MKxMnZJZ.js} +3 -13
- package/dist/src/{chat-BE0qTA8e.js → chat-mW0ORo8G.js} +3 -14
- package/dist/src/{chatkit-Cx174XI3.cjs → chatkit-BoWoSgXl.cjs} +4 -4
- package/dist/src/{chatkit-BYGQlHlV.js → chatkit-CJnHRRMM.js} +4 -4
- package/dist/src/{chatkit-a2D6mY6s.js → chatkit-Cv6AhukM.js} +4 -4
- package/dist/src/{chatkit-_8eJqKcD.js → chatkit-zUIVoDos.js} +4 -4
- package/dist/src/{claude-agent-sdk-CMjh4LFH.js → claude-agent-sdk-BQNuLaAK.js} +19 -14
- package/dist/src/{claude-agent-sdk-8ddRp1L2.cjs → claude-agent-sdk-CPJo3dBQ.cjs} +21 -16
- package/dist/src/{claude-agent-sdk-HgbFioFw.js → claude-agent-sdk-Dtq_L-Sc.js} +20 -15
- package/dist/src/{claude-agent-sdk-Bq5EArsX.js → claude-agent-sdk-nfAIcxNf.js} +21 -17
- package/dist/src/{cloud-z8KZpUoa.js → cloud-DQZ5sVjW.js} +25 -13
- package/dist/src/cloud-Hphvo8kr.js +3 -0
- package/dist/src/{cloudflare-ai-Bbp26N0L.js → cloudflare-ai-BIB567w6.js} +5 -14
- package/dist/src/{cloudflare-ai-BGyXlpXJ.js → cloudflare-ai-DGLte7Py.js} +5 -14
- package/dist/src/{cloudflare-ai-C62x6MQG.cjs → cloudflare-ai-Dl3N9OVD.cjs} +6 -15
- package/dist/src/{cloudflare-ai-DdKP9TKT.js → cloudflare-ai-DlKr0rY7.js} +5 -15
- package/dist/src/{cloudflare-gateway-D-e9i1Sn.js → cloudflare-gateway-BDZrYydE.js} +4 -16
- package/dist/src/{cloudflare-gateway-Dx36ftqF.cjs → cloudflare-gateway-BYDp495F.cjs} +4 -15
- package/dist/src/{cloudflare-gateway-DXhtXDRb.js → cloudflare-gateway-CiIZHU0Q.js} +4 -15
- package/dist/src/{cloudflare-gateway-BwAaUgeW.js → cloudflare-gateway-DI1HNP5F.js} +4 -15
- package/dist/src/codex-sdk-BAmYE7qy.js +3 -0
- package/dist/src/codex-sdk-C2_M2pl_.cjs +1172 -0
- package/dist/src/codex-sdk-CErXn7qh.js +1165 -0
- package/dist/src/codex-sdk-CWEnH70W.cjs +2 -0
- package/dist/src/codex-sdk-CpqiOqDO.js +1164 -0
- package/dist/src/codex-sdk-Rtky3M4I.js +1165 -0
- package/dist/src/{cometapi-BDyV-NNm.js → cometapi-BUlt_ELa.js} +8 -15
- package/dist/src/{cometapi-hhL4TAh3.js → cometapi-CtJ-mS8R.js} +9 -15
- package/dist/src/{cometapi-sp7sJpBD.js → cometapi-DT-jlVCB.js} +8 -17
- package/dist/src/{cometapi-C3hOlM7-.cjs → cometapi-UVOryo4W.cjs} +9 -16
- package/dist/src/{completion-DlXUhj5c.cjs → completion-BozdoXba.cjs} +7 -62
- package/dist/src/{completion-BCimtq-h.js → completion-Dnxn7E-j.js} +8 -57
- package/dist/src/{completion-DCjv7RZ3.js → completion-HUe8wDhZ.js} +8 -57
- package/dist/src/{completion-DoYy49ti.js → completion-x0a_c2y1.js} +8 -57
- package/dist/src/{createHash-CTQmL3G2.js → createHash-4gFQpDDv.js} +3 -3
- package/dist/src/{createHash-BYwImsYv.cjs → createHash-B7KvgoOD.cjs} +4 -4
- package/dist/src/{createHash-Da8fMwqB.js → createHash-ChI45QR1.js} +3 -3
- package/dist/src/{createHash-DmPQkvBh.js → createHash-CwDVU5xr.js} +3 -3
- package/dist/src/{docker-FeBni2dw.js → docker-CQmlA2NU.js} +7 -14
- package/dist/src/{docker-CxCkwMzc.js → docker-ClnmCf1Z.js} +6 -14
- package/dist/src/{docker-DpguQj-w.js → docker-DCgsveLD.js} +6 -16
- package/dist/src/{docker-Cqj2-QVi.cjs → docker-DS4_Osau.cjs} +7 -15
- package/dist/src/embedding-D3xTseo7.js +59 -0
- package/dist/src/embedding-DD9wa3ae.js +58 -0
- package/dist/src/embedding-I45KG3o7.cjs +63 -0
- package/dist/src/embedding-nFbumxcv.js +58 -0
- package/dist/src/entrypoint.js +69 -6
- package/dist/src/{errors-P6ll7XSJ.js → errors-Cw810C93.js} +1 -1
- package/dist/src/{esm-SUNIX1x3.js → esm-C7PnfdF8.js} +15 -6
- package/dist/src/{esm-CipptfDu.cjs → esm-CtEPLdAj.cjs} +15 -6
- package/dist/src/{esm-CKWP3u_P.js → esm-Dh4dOLlt.js} +16 -7
- package/dist/src/{esm-7UIl0pPM.js → esm-tVgYPY-f.js} +27 -18
- package/dist/src/eval-CzJFfFO9.js +3 -0
- package/dist/src/{eval-BTqTn7lb.js → eval-u4UVafl6.js} +49 -20
- package/dist/src/{evalResult-BkIhRdTe.js → evalResult-Bgm9ZH31.js} +7 -7
- package/dist/src/{evalResult-DUDShQrm.js → evalResult-D3hVYFis.js} +7 -7
- package/dist/src/evalResult-D8MT9p0s.js +3 -0
- package/dist/src/evalResult-DElBuddX.js +2 -0
- package/dist/src/evalResult-Dvc-iucu.cjs +2 -0
- package/dist/src/{evalResult-DpARzUCb.cjs → evalResult-KZqXl4XP.cjs} +7 -7
- package/dist/src/evaluator-CVessDWe.js +3 -0
- package/dist/src/{evaluator-BcvOGaam.js → evaluator-IvuDYSvQ.js} +3178 -2102
- package/dist/src/{extractor-C8XwivI9.js → extractor-CAfTSraf.js} +6 -6
- package/dist/src/{extractor-CAZ2G3Kh.js → extractor-DNSeBVOJ.js} +6 -6
- package/dist/src/{extractor-D_wd8jxt.js → extractor-Dk6bRWkv.js} +6 -6
- package/dist/src/{extractor-DG3sSfXE.cjs → extractor-WVPOrH43.cjs} +6 -6
- package/dist/src/{fetch-BiYv2BZc.js → fetch-B0Z3Oe4k.js} +218 -55
- package/dist/src/{fetch-DoVRJZhJ.js → fetch-BEWnXrrG.js} +195 -45
- package/dist/src/fetch-C7bGKDlQ.js +3 -0
- package/dist/src/{fetch-BnR9wSnm.cjs → fetch-CJU5ELPa.cjs} +223 -48
- package/dist/src/{fetch-CVAtKnI3.js → fetch-Di00EQrc.js} +218 -55
- package/dist/src/{fileExtensions-Ds-foDzt.js → fileExtensions-AWa2ZML4.js} +1 -1
- package/dist/src/{fileExtensions-LcDYkU4v.js → fileExtensions-BArZuxsI.js} +1 -1
- package/dist/src/{formatDuration-DgBVMN65.js → formatDuration-DZzPsexs.js} +1 -1
- package/dist/src/{genaiTracer-70Z8BIuV.js → genaiTracer-COYDi-tC.js} +6 -2
- package/dist/src/{genaiTracer-C1rxGO8Q.js → genaiTracer-DWdZ28hY.js} +6 -2
- package/dist/src/{genaiTracer-D3fD9dNV.js → genaiTracer-XnrcgDCe.js} +6 -2
- package/dist/src/{genaiTracer-BfxrvSUb.cjs → genaiTracer-yRuxj9-L.cjs} +7 -3
- package/dist/src/golang/wrapper.go +1 -1
- package/dist/src/{graders-BElhu9ZY.cjs → graders--zknU_uk.cjs} +3772 -1302
- package/dist/src/graders-BOAzQEUe.cjs +2 -0
- package/dist/src/graders-D4BTsZdG2.js +3 -0
- package/dist/src/graders-DOJK1XpV.js +2 -0
- package/dist/src/graders-NAv9LcBn.js +2 -0
- package/dist/src/{graders-DG7mhg-b.js → graders-Zy3x0zqX.js} +5691 -3247
- package/dist/src/{graders-RjHF8VfG.js → graders-eIHhRqoC.js} +5683 -3239
- package/dist/src/{graders-BXAJ0sbS.js → graders-pvbReLLn.js} +5692 -3248
- package/dist/src/{image-6WQXK8m8.js → image-9302QVqR.js} +4 -4
- package/dist/src/{image-B8b6f36E.js → image-B5Mv-Z3h.js} +8 -8
- package/dist/src/{image-PoF6DN3x.js → image-DVz2RiMF.js} +8 -8
- package/dist/src/{image-fza3zuKs.cjs → image-De2FBmYV.cjs} +4 -4
- package/dist/src/{image-DO0RYnjH.js → image-dnoUgPrC.js} +4 -5
- package/dist/src/{image-CoxZp9PZ.js → image-qUpPvmNZ.js} +8 -8
- package/dist/src/{image-xNbw5ph2.js → image-u7-rKnYU.js} +4 -4
- package/dist/src/{image--F58eEIn.cjs → image-x6KqLQl4.cjs} +8 -8
- package/dist/src/index.cjs +3641 -2144
- package/dist/src/index.d.cts +2660 -20
- package/dist/src/index.d.ts +2660 -20
- package/dist/src/index.js +3649 -2152
- package/dist/src/{interactiveCheck-BnMYOjMu.js → interactiveCheck-CLERUB0c.js} +2 -2
- package/dist/src/{knowledgeBase-DqrLX8fy.cjs → knowledgeBase-Bpoe_nLu.cjs} +6 -8
- package/dist/src/{knowledgeBase-Bi7CmDbx.js → knowledgeBase-Dgc7CBWF.js} +6 -8
- package/dist/src/{knowledgeBase-DFRXPZl_.js → knowledgeBase-RhFPGWDc.js} +6 -8
- package/dist/src/{knowledgeBase-Ce3ofVan.js → knowledgeBase-lm9RXSAm.js} +6 -9
- package/dist/src/{litellm-CKiAxnoM.js → litellm-C2kqjxqp.js} +6 -14
- package/dist/src/{litellm-CnHI69aj.cjs → litellm-CoyI4IAl.cjs} +6 -15
- package/dist/src/{litellm-Tc294Jhj.js → litellm-DRjpcSa7.js} +5 -14
- package/dist/src/{litellm-Bo2gQXpo.js → litellm-p37R1dzQ.js} +5 -16
- package/dist/src/{logger-BnkjG2jt.js → logger-B88EkIn6.js} +40 -11
- package/dist/src/{logger-D5iKBpu_.cjs → logger-COuQb2xB.cjs} +51 -10
- package/dist/src/{logger-DO8_zM18.js → logger-Ct2S6Yx-.js} +40 -11
- package/dist/src/{logger-BcJBzSSA.js → logger-DksKw1Qc.js} +40 -11
- package/dist/src/{luma-ray-C9q8rdQe.js → luma-ray-B863CmuZ.js} +6 -10
- package/dist/src/{luma-ray-DP0QA9qn.js → luma-ray-BTTLtqQ8.js} +7 -10
- package/dist/src/{luma-ray-m9Ku2meV.cjs → luma-ray-BxVKaW2a.cjs} +6 -10
- package/dist/src/{luma-ray-0ehMPt5N.js → luma-ray-KgTCXrZC.js} +6 -12
- package/dist/src/main.d.ts +1 -26
- package/dist/src/main.js +985 -520
- package/dist/src/{messages-HJsyEh4o.cjs → messages-811uVVW5.cjs} +69 -19
- package/dist/src/{messages-Dy9QecMs.js → messages-BTQz42fn.js} +69 -19
- package/dist/src/{messages-biC_ex-p.js → messages-MYTQ2TWp.js} +69 -19
- package/dist/src/{messages-DJNo37Ko.js → messages-zWbkLLHz.js} +69 -19
- package/dist/src/{meteor-D-SotUw9.js → meteor-CU5UAE-H.js} +1 -1
- package/dist/src/{meteor-DLZZ3osF.cjs → meteor-Co1VQ1u5.cjs} +1 -1
- package/dist/src/{meteor-44VjEACX.js → meteor-DHdzY1Ss.js} +1 -1
- package/dist/src/{meteor-DUiCJRC-.js → meteor-DuAFv6gF.js} +1 -1
- package/dist/src/{modelslab-B5J-ZM5c.js → modelslab-D0erNWKe.js} +7 -10
- package/dist/src/{modelslab-BTOT8FUO.js → modelslab-DIq-6y7x.js} +7 -10
- package/dist/src/{modelslab-IQbNg-r7.cjs → modelslab-Dk1JAtVo.cjs} +7 -10
- package/dist/src/{modelslab-BI458moT.js → modelslab-wu9yi5GE.js} +7 -11
- package/dist/src/{nova-reel-BZ9y-Y5s.js → nova-reel-CCFRfeRb.js} +7 -10
- package/dist/src/{nova-reel-CE5etkv9.cjs → nova-reel-CrLXVKQf.cjs} +6 -10
- package/dist/src/{nova-reel-Xw1SXLpg.js → nova-reel-DQrm74ng.js} +6 -10
- package/dist/src/{nova-reel-DEeQlnOJ.js → nova-reel-gr11WG7f.js} +6 -12
- package/dist/src/{nova-sonic-Ogqf-csn.js → nova-sonic-BYdp-QLs.js} +5 -7
- package/dist/src/{nova-sonic-DXTLpi-r.js → nova-sonic-B_ZXcUJB.js} +4 -7
- package/dist/src/{nova-sonic-DWswpN1E.js → nova-sonic-TDgrlTk7.js} +4 -9
- package/dist/src/{nova-sonic-N0yCm0vb.cjs → nova-sonic-i5tUvXKn.cjs} +4 -7
- package/dist/src/{openai-BcB5KlTk.js → openai-DhVEmgeZ.js} +6 -3
- package/dist/src/{openai-BMcwgD5C.js → openai-Qsvz25mV.js} +6 -3
- package/dist/src/{openai-CoxGAQwn.cjs → openai-URNyItar.cjs} +6 -3
- package/dist/src/{openai-D6wITiVn.js → openai-iYtrXzOX.js} +6 -3
- package/dist/src/openclaw-CLWrW03k.js +1200 -0
- package/dist/src/openclaw-CnQ363Wi.js +1199 -0
- package/dist/src/openclaw-CwzlQSQX.js +1199 -0
- package/dist/src/openclaw-wX9rtfke.cjs +1205 -0
- package/dist/src/{opencode-sdk-CHCs7dEb.js → opencode-sdk-BUu5Nevv.js} +6 -8
- package/dist/src/{opencode-sdk-WWJhnbKr.cjs → opencode-sdk-BZ2idgYA.cjs} +6 -8
- package/dist/src/{opencode-sdk-DDxj4QqH.js → opencode-sdk-BxD8vXp_.js} +7 -8
- package/dist/src/{opencode-sdk-C71Z0ehR.js → opencode-sdk-GI2KaAXq.js} +6 -10
- package/dist/src/{otlpReceiver-CZL48YfC.js → otlpReceiver-B2z58l4e.js} +154 -98
- package/dist/src/{otlpReceiver-DHKqJlsz.cjs → otlpReceiver-BfcVq2Nq.cjs} +154 -98
- package/dist/src/{otlpReceiver-CavGAA6k.js → otlpReceiver-BntK801g.js} +154 -98
- package/dist/src/{otlpReceiver-C9KlUtxh.js → otlpReceiver-DmVulbhC.js} +154 -98
- package/dist/src/{providerRegistry-BkzVH5Ba.js → providerRegistry-Bvh8mv85.js} +2 -2
- package/dist/src/{providerRegistry-CUWki5mQ.js → providerRegistry-CPQ_CmVO.js} +2 -2
- package/dist/src/{providerRegistry-BTDgfV5h.cjs → providerRegistry-CQMdTmHP.cjs} +2 -2
- package/dist/src/{providerRegistry-B9lh-_tx.js → providerRegistry-CWoPjKFZ.js} +2 -2
- package/dist/src/{providers-CScd1wN6.cjs → providers-1eKkXBKp.cjs} +792 -556
- package/dist/src/{providers-Ch6Mr0gn.js → providers-BV_KMZje.js} +699 -493
- package/dist/src/providers-Bp4S-FvO.js +2 -0
- package/dist/src/providers-DV3ax9e_.cjs +3 -0
- package/dist/src/{providers-DvddrgxL.js → providers-Domz_llv.js} +707 -501
- package/dist/src/{providers-Cn73d5sr.js → providers-DruaQfwu.js} +704 -498
- package/dist/src/providers-iUt5fbAN.js +3 -0
- package/dist/src/providers-u9Enmfok.js +2 -0
- package/dist/src/python/persistent_wrapper.py +0 -5
- package/dist/src/{pythonUtils-Cpo0Ez1p.js → pythonUtils-C2UQ30Rz.js} +3 -3
- package/dist/src/{pythonUtils-Bzwbgpbg.js → pythonUtils-Cldx7huE.js} +3 -3
- package/dist/src/{pythonUtils-wIqk7zAf.js → pythonUtils-CnndUbW-.js} +3 -3
- package/dist/src/{pythonUtils-dAVigVK-.cjs → pythonUtils-tAJvvpS-.cjs} +3 -3
- package/dist/src/{quiverai-BeofbLVc.js → quiverai-CtWi6x_g.js} +4 -4
- package/dist/src/{quiverai-CcUhPIBg.cjs → quiverai-DFotyafY.cjs} +4 -4
- package/dist/src/{quiverai-DVSEqJiq.js → quiverai-DR0SnIQV.js} +4 -4
- package/dist/src/{quiverai-CCQn73lq.js → quiverai-aPPvXOgn.js} +4 -5
- package/dist/src/render-CH-62LbA.js +135 -0
- package/dist/src/render-CMEpfLaO.js +136 -0
- package/dist/src/{render-BHl6QVq9.js → render-CgVDrJmM.js} +2 -3
- package/dist/src/render-DHIZ6_k8.js +135 -0
- package/dist/src/render-DfQSFxGE.cjs +165 -0
- package/dist/src/{responses-CQb1Tj69.js → responses--OsX2aYW.js} +17 -12
- package/dist/src/{responses-mo0KQDbu.cjs → responses-Bi9vBuW_.cjs} +18 -13
- package/dist/src/{responses-CgNyTPsY.js → responses-C-flexAY.js} +18 -13
- package/dist/src/{responses-BKP_WYis.js → responses-DL9m8CyY.js} +18 -13
- package/dist/src/{rubyUtils-CGeUtCfW.cjs → rubyUtils-B6eljPuh.cjs} +3 -3
- package/dist/src/{rubyUtils-DECSbsfY.js → rubyUtils-CYSQEG4a.js} +3 -3
- package/dist/src/rubyUtils-D1L2d3jb.js +3 -0
- package/dist/src/rubyUtils-DUbq4tff.cjs +2 -0
- package/dist/src/{rubyUtils-PgU-gHmx.js → rubyUtils-DVLeA2jg.js} +3 -3
- package/dist/src/{rubyUtils-CiVfln3g.js → rubyUtils-DsGrTx8R.js} +3 -3
- package/dist/src/{sagemaker-CqeASYE5.js → sagemaker-BVkaG2-l.js} +14 -18
- package/dist/src/{sagemaker-CVv8W7so.js → sagemaker-BveBvuxm.js} +14 -18
- package/dist/src/{sagemaker-MUbD5V3v.js → sagemaker-D67yzMzs.js} +14 -19
- package/dist/src/{sagemaker-jiw1wQa-.cjs → sagemaker-XnfhheQv.cjs} +14 -18
- package/dist/src/{scanner-DVDeUz1r.js → scanner-1DqWi1Ej.js} +130 -35
- package/dist/src/server/golang/wrapper.go +1 -1
- package/dist/src/server/index.js +3596 -2098
- package/dist/src/server/python/persistent_wrapper.py +0 -5
- package/dist/src/{server-DZ9MtCn0.js → server-BNYztJkh.js} +128 -9
- package/dist/src/{server-Cns05F1j.js → server-BSB45Nt9.js} +127 -8
- package/dist/src/{server-CP9qKM40.js → server-D6Il2Sob.js} +126 -7
- package/dist/src/server-DCtHUqlp.js +3 -0
- package/dist/src/server-DaA2eR26.cjs +2 -0
- package/dist/src/{server-BtoCXeXI.cjs → server-Dx2TyCH2.cjs} +140 -6
- package/dist/src/{signal-C3ZTsUgi.js → signal-CE5G3a7x.js} +3 -3
- package/dist/src/{slack-94iG3T0s.cjs → slack-1Rhq0EoV.cjs} +2 -2
- package/dist/src/{slack-BR0HtO3K.js → slack-D5Wpy8LM.js} +2 -2
- package/dist/src/{slack-DCEV-vWP.js → slack-DDUe-5MC.js} +2 -2
- package/dist/src/{slack-2sdpGzbt.js → slack-acRb0IqQ.js} +2 -2
- package/dist/src/store-CWOSz6D_.cjs +2 -0
- package/dist/src/{store-P8OKm19S.js → store-CYEy5J2D.js} +3 -3
- package/dist/src/{store-CLyU7AtI.cjs → store-DAAyxcy6.cjs} +3 -3
- package/dist/src/store-DCDBhv7B.js +3 -0
- package/dist/src/{store-VB0GP46K.js → store-Dn9HUkdW.js} +3 -3
- package/dist/src/{store-Cj258DgL.js → store-M0b1WfYb.js} +3 -3
- package/dist/src/{tables-DmzvLbeZ.js → tables-C4CH3zRr.js} +3 -3
- package/dist/src/{tables-BEIFz2tM.js → tables-CsWou1Bx.js} +3 -3
- package/dist/src/{tables-kC7R5kiK.js → tables-DQ4WU5tX.js} +3 -3
- package/dist/src/{tables-BdZQEpRz.cjs → tables-DUfh1F7Z.cjs} +3 -3
- package/dist/src/telemetry-C1IqxcdW.js +3 -0
- package/dist/src/telemetry-C4ZEa_es.cjs +2 -0
- package/dist/src/{telemetry-BnH5VJAU.js → telemetry-CQPez_Jp.js} +4 -4
- package/dist/src/{telemetry-re627Lre.cjs → telemetry-Dsw_faFj.cjs} +4 -4
- package/dist/src/{telemetry-BugWqKiu.js → telemetry-Dvqxv3YC.js} +4 -4
- package/dist/src/{telemetry-DPXLd7UE.js → telemetry-dbaJ0E98.js} +4 -4
- package/dist/src/{text-CW1cyrwj.cjs → text-BVi-cLPJ.cjs} +1 -1
- package/dist/src/{text-B_UCRPp2.js → text-CZr46tp_.js} +1 -1
- package/dist/src/{text-TIv0QYnd.js → text-DHxdyQqT.js} +1 -1
- package/dist/src/{text-Db-Wt2u2.js → text-KvuD2Iko.js} +1 -1
- package/dist/src/{tokenUsageUtils-bVa1ga6f.cjs → tokenUsageUtils-Bb7DkZPz.cjs} +7 -3
- package/dist/src/{tokenUsageUtils-BDGe-iyI.js → tokenUsageUtils-C-bmyHoE.js} +7 -3
- package/dist/src/{tokenUsageUtils-DflFMjS0.js → tokenUsageUtils-CXrvO-wA.js} +7 -3
- package/dist/src/{transcription-BvtsrzRG.cjs → transcription-BvjmiYB1.cjs} +9 -13
- package/dist/src/{transcription-Hb3VnC4M.js → transcription-CJspiD2c.js} +8 -11
- package/dist/src/{transcription-CaMivnjG.js → transcription-DuWDupG7.js} +7 -11
- package/dist/src/{transcription-DOMMTu01.js → transcription-V2HaAmy2.js} +7 -13
- package/dist/src/{transform-BqPkNPYm.js → transform-Bbg6A8Jk.js} +4 -4
- package/dist/src/{transform-DrleutM3.js → transform-CG0ehZNG.js} +9 -8
- package/dist/src/{transform-0BwoBsvO.cjs → transform-CTeuTR3S.cjs} +16 -8
- package/dist/src/{transform-ZrG2dvlo.cjs → transform-CUnzlsbn.cjs} +4 -4
- package/dist/src/{transform-BzK09Q_9.js → transform-DYX1_Xnh.js} +5 -5
- package/dist/src/transform-DgKlRr73.cjs +2 -0
- package/dist/src/transform-M6ITAESf.js +3 -0
- package/dist/src/{transform-ljLYHEPh.js → transform-UN5UGu8U.js} +5 -5
- package/dist/src/{transform-B2-jIv68.js → transform-lQrDE1BQ.js} +8 -6
- package/dist/src/{transform-DyDAwEpE.js → transform-zDhMmzwX.js} +10 -7
- package/dist/src/{transformersAvailability-BGkzavwb.js → transformersAvailability-CcHusyhw.js} +1 -1
- package/dist/src/{transformersAvailability-DKoRtQLy.cjs → transformersAvailability-Cju9mHgR.cjs} +1 -1
- package/dist/src/{transformersAvailability-D6c6ROpT.js → transformersAvailability-DLlROWhg.js} +1 -1
- package/dist/src/{types-q8GXGF65.js → types-BGQDAP8i.js} +351 -22
- package/dist/src/{types-Cd3ygw8W.js → types-Bgh5SOn6.js} +352 -24
- package/dist/src/{types-D8cGDZbL.cjs → types-CeaeaZdP.cjs} +387 -22
- package/dist/src/{types-CIhFeUC4.js → types-Dm9JM6Vb.js} +362 -23
- package/dist/src/{util-vNmDL5DT.js → util-BYvQUPp7.js} +138 -36
- package/dist/src/{util-CuLo2pMR.cjs → util-Bxn8emtE.cjs} +14 -167
- package/dist/src/{util-BLvy9qfE.js → util-C8e5uydV.js} +18 -141
- package/dist/src/{util-DM2rTn_6.js → util-C9J8ahRn.js} +4 -4
- package/dist/src/{util-CFj4YKIn.cjs → util-CN3SrLT4.cjs} +4 -4
- package/dist/src/{util-BtoGs5Cb.js → util-D3q0WQ-0.js} +4 -4
- package/dist/src/{util-CgDCK4KI.js → util-D9TisOyk.js} +4 -4
- package/dist/src/{util-DMFeUvLz.js → util-DDs-7g6-.js} +138 -36
- package/dist/src/{util-DbVG-yZU.js → util-DvU2Pw8c.js} +138 -36
- package/dist/src/{util-Bm3E9jpK.js → util-DxWpWjhc.js} +12 -135
- package/dist/src/{util-CMMkIxfU.js → util-oGMLA7vc.js} +16 -139
- package/dist/src/{util--9u9UVCt.cjs → util-olYL5C6N.cjs} +143 -35
- package/dist/src/{utils-DKw8mrgr.cjs → utils-B05gLxER.cjs} +6 -4
- package/dist/src/{utils-DEuL4VNB.js → utils-BLJKfv0y.js} +6 -4
- package/dist/src/{utils-DOjD4dTC.js → utils-DJfvjyMj.js} +6 -4
- package/dist/src/{utils-CFxO9KGo.js → utils-hXtCYanr.js} +6 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +51 -42
- package/dist/src/app/assets/index-B6l9CVVb.js +0 -439
- package/dist/src/app/assets/index-DyZ0Ep37.css +0 -1
- package/dist/src/app/assets/scroll-timeline-BdJZVXlz.js +0 -1
- package/dist/src/app/assets/sync-CStkzc6u.js +0 -4
- package/dist/src/app/assets/vendor-charts-BnDWwBlI.js +0 -36
- package/dist/src/app/assets/vendor-markdown-Bz7N-ca6.js +0 -29
- package/dist/src/app/assets/vendor-react-AtKqiNEf.js +0 -4
- package/dist/src/app/assets/vendor-syntax-D06x6TQF.js +0 -2
- package/dist/src/app/assets/vendor-utils-BvMHZmO7.js +0 -37
- package/dist/src/cache-C5yFZ4gC.cjs +0 -816
- package/dist/src/cache-CaT5tPgo.js +0 -756
- package/dist/src/cache-CyCanoMu.js +0 -6
- package/dist/src/cache-DSqR6ezl.js +0 -726
- package/dist/src/cache-Df_QFDNu.cjs +0 -5
- package/dist/src/cache-HP0NP4k3.js +0 -756
- package/dist/src/cloud-DE3t1-ZI.js +0 -4
- package/dist/src/codex-sdk-BQEw16R_.js +0 -834
- package/dist/src/codex-sdk-C_07GuVS.js +0 -834
- package/dist/src/codex-sdk-DE5G18dx.js +0 -835
- package/dist/src/codex-sdk-ZLKfDjqP.cjs +0 -838
- package/dist/src/eval-7aEqoMs3.js +0 -15
- package/dist/src/evalResult-CYNHkk5A.js +0 -12
- package/dist/src/evalResult-CuvJeNiM.js +0 -10
- package/dist/src/evalResult-tGdilrWt.cjs +0 -10
- package/dist/src/evaluator-BBUqRhz1.js +0 -36
- package/dist/src/fetch-UWU706qb.js +0 -5
- package/dist/src/graders-BxfEguVY.js +0 -32
- package/dist/src/graders-CzVMbEnv.js +0 -34
- package/dist/src/graders-DjCXfj0l.cjs +0 -32
- package/dist/src/graders-kHzIWOKu.js +0 -32
- package/dist/src/openclaw-0Sv7AK3O.js +0 -580
- package/dist/src/openclaw-CXxbKgDH.cjs +0 -586
- package/dist/src/openclaw-D1FSCps-.js +0 -580
- package/dist/src/openclaw-D2ENvu7a.js +0 -582
- package/dist/src/providers-BSLEaIQG.js +0 -32
- package/dist/src/providers-D-FnDg8k.cjs +0 -31
- package/dist/src/providers-DEYiFVAo.js +0 -30
- package/dist/src/providers-sS2WI8YD.js +0 -30
- package/dist/src/rubyUtils-B1HXG4ej.cjs +0 -4
- package/dist/src/rubyUtils-Rt6pKA96.js +0 -5
- package/dist/src/server-B0Xh1Gx-.js +0 -7
- package/dist/src/server-DJTKu9IR.cjs +0 -5
- package/dist/src/store-C5u6MgC8.js +0 -6
- package/dist/src/store-CNHk-De4.cjs +0 -5
- package/dist/src/telemetry-Yig0Tino.js +0 -7
- package/dist/src/telemetry-p8Pwqm1i.cjs +0 -5
- package/dist/src/tokenUsageUtils-NYT-WKS6.js +0 -138
- package/dist/src/transform-ChNIpHz7.js +0 -6
- package/dist/src/transform-PtQ6rAE3.cjs +0 -5
|
@@ -66,11 +66,6 @@ def _init_tracing():
|
|
|
66
66
|
_tracer = trace.get_tracer("promptfoo.python.provider")
|
|
67
67
|
_tracing_enabled = True
|
|
68
68
|
|
|
69
|
-
print(
|
|
70
|
-
f"[PythonProvider] OpenTelemetry tracing enabled, endpoint: {endpoint}",
|
|
71
|
-
file=sys.stderr,
|
|
72
|
-
flush=True,
|
|
73
|
-
)
|
|
74
69
|
except ImportError:
|
|
75
70
|
print(
|
|
76
71
|
"[PythonProvider] OpenTelemetry packages not installed, tracing disabled. "
|
|
@@ -1,11 +1,130 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { c as isLoggedIntoCloud } from "./accounts-
|
|
5
|
-
import { r as CloudConfig } from "./cloud-
|
|
2
|
+
import { N as state, O as getEnvString, T as getEnvBool, s as logger } from "./logger-DksKw1Qc.js";
|
|
3
|
+
import { A as getDefaultPort, n as fetchWithProxy } from "./fetch-BEWnXrrG.js";
|
|
4
|
+
import { c as isLoggedIntoCloud } from "./accounts-F9d_5sMC.js";
|
|
5
|
+
import { r as CloudConfig } from "./cloud-DQZ5sVjW.js";
|
|
6
|
+
import { i as resolvePackageEntryPoint, t as getDirectory } from "./esm-tVgYPY-f.js";
|
|
7
|
+
import { t as OpenAICodexSDKProvider } from "./codex-sdk-CpqiOqDO.js";
|
|
6
8
|
import chalk from "chalk";
|
|
9
|
+
import fs from "fs";
|
|
10
|
+
import path from "path";
|
|
11
|
+
import os from "os";
|
|
7
12
|
import opener from "opener";
|
|
8
13
|
import readline from "readline";
|
|
14
|
+
//#region src/providers/openai/codexDefaults.ts
|
|
15
|
+
const CODEX_AUTH_FILENAME = "auth.json";
|
|
16
|
+
const CODEX_SDK_PACKAGE_NAME = "@openai/codex-sdk";
|
|
17
|
+
let codexDefaultWorkingDir;
|
|
18
|
+
const CODEX_GRADING_OUTPUT_SCHEMA = {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
pass: { type: "boolean" },
|
|
22
|
+
score: { type: "number" },
|
|
23
|
+
reason: { type: "string" }
|
|
24
|
+
},
|
|
25
|
+
required: [
|
|
26
|
+
"pass",
|
|
27
|
+
"score",
|
|
28
|
+
"reason"
|
|
29
|
+
],
|
|
30
|
+
additionalProperties: false
|
|
31
|
+
};
|
|
32
|
+
const codexDefaultProvidersByCacheKey = /* @__PURE__ */ new Map();
|
|
33
|
+
const codexSdkAvailabilityByBaseDir = /* @__PURE__ */ new Map();
|
|
34
|
+
function getCodexEnvString(env, key) {
|
|
35
|
+
return env?.[key] || getEnvString(key);
|
|
36
|
+
}
|
|
37
|
+
function getCodexHome(env) {
|
|
38
|
+
const homeDir = os.homedir?.();
|
|
39
|
+
const defaultHome = typeof homeDir === "string" && homeDir ? path.join(homeDir, ".codex") : void 0;
|
|
40
|
+
const codexHome = getCodexEnvString(env, "CODEX_HOME") || defaultHome || ".codex";
|
|
41
|
+
return path.resolve(codexHome);
|
|
42
|
+
}
|
|
43
|
+
function getTempDirectory() {
|
|
44
|
+
const tempDir = os.tmpdir?.();
|
|
45
|
+
return typeof tempDir === "string" && tempDir ? tempDir : process.cwd();
|
|
46
|
+
}
|
|
47
|
+
function getCodexDefaultWorkingDir() {
|
|
48
|
+
if (!codexDefaultWorkingDir) codexDefaultWorkingDir = fs.mkdtempSync(path.join(getTempDirectory(), "promptfoo-codex-default-"));
|
|
49
|
+
return codexDefaultWorkingDir;
|
|
50
|
+
}
|
|
51
|
+
function hasCodexAuthFile(env) {
|
|
52
|
+
try {
|
|
53
|
+
const stats = fs.statSync(path.join(getCodexHome(env), CODEX_AUTH_FILENAME));
|
|
54
|
+
return stats.isFile() && stats.size > 0;
|
|
55
|
+
} catch {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function hasCodexSdkPackage(baseDir) {
|
|
60
|
+
const cached = codexSdkAvailabilityByBaseDir.get(baseDir);
|
|
61
|
+
if (cached !== void 0) return cached;
|
|
62
|
+
const hasPackage = resolvePackageEntryPoint(CODEX_SDK_PACKAGE_NAME, baseDir) !== null;
|
|
63
|
+
codexSdkAvailabilityByBaseDir.set(baseDir, hasPackage);
|
|
64
|
+
return hasPackage;
|
|
65
|
+
}
|
|
66
|
+
function canLoadCodexSdkPackage() {
|
|
67
|
+
return [process.cwd(), getDirectory()].some((baseDir) => hasCodexSdkPackage(baseDir));
|
|
68
|
+
}
|
|
69
|
+
function hasCodexDefaultCredentials(env) {
|
|
70
|
+
return (Boolean(getCodexEnvString(env, "CODEX_API_KEY")) || hasCodexAuthFile(env)) && canLoadCodexSdkPackage();
|
|
71
|
+
}
|
|
72
|
+
function getCodexDefaultProviderConfig(env, config, defaultWorkingDir = getCodexDefaultWorkingDir()) {
|
|
73
|
+
const codexHome = getCodexEnvString(env, "CODEX_HOME");
|
|
74
|
+
const workingDir = config?.working_dir || defaultWorkingDir;
|
|
75
|
+
fs.mkdirSync(workingDir, { recursive: true });
|
|
76
|
+
const cliEnv = {
|
|
77
|
+
...codexHome ? { CODEX_HOME: path.resolve(codexHome) } : {},
|
|
78
|
+
...config?.cli_env
|
|
79
|
+
};
|
|
80
|
+
return {
|
|
81
|
+
approval_policy: "never",
|
|
82
|
+
sandbox_mode: "read-only",
|
|
83
|
+
skip_git_repo_check: true,
|
|
84
|
+
working_dir: workingDir,
|
|
85
|
+
...config,
|
|
86
|
+
...Object.keys(cliEnv).length > 0 ? { cli_env: cliEnv } : {}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function getCodexDefaultProvidersCacheKey(env) {
|
|
90
|
+
return JSON.stringify({
|
|
91
|
+
CODEX_HOME: getCodexEnvString(env, "CODEX_HOME"),
|
|
92
|
+
hasCodexApiKey: Boolean(getCodexEnvString(env, "CODEX_API_KEY")),
|
|
93
|
+
hasOpenAiApiKey: Boolean(getCodexEnvString(env, "OPENAI_API_KEY"))
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function getCodexDefaultProviders(env) {
|
|
97
|
+
const cacheKey = getCodexDefaultProvidersCacheKey(env);
|
|
98
|
+
const cachedProviders = codexDefaultProvidersByCacheKey.get(cacheKey);
|
|
99
|
+
if (cachedProviders) return cachedProviders;
|
|
100
|
+
const defaultWorkingDir = getCodexDefaultWorkingDir();
|
|
101
|
+
const gradingProvider = new OpenAICodexSDKProvider({
|
|
102
|
+
config: getCodexDefaultProviderConfig(env, void 0, defaultWorkingDir),
|
|
103
|
+
env
|
|
104
|
+
});
|
|
105
|
+
const gradingJsonProvider = new OpenAICodexSDKProvider({
|
|
106
|
+
config: getCodexDefaultProviderConfig(env, { output_schema: CODEX_GRADING_OUTPUT_SCHEMA }, defaultWorkingDir),
|
|
107
|
+
env
|
|
108
|
+
});
|
|
109
|
+
const providers = {
|
|
110
|
+
gradingJsonProvider,
|
|
111
|
+
gradingProvider,
|
|
112
|
+
llmRubricProvider: gradingJsonProvider,
|
|
113
|
+
suggestionsProvider: gradingProvider,
|
|
114
|
+
synthesizeProvider: gradingProvider,
|
|
115
|
+
webSearchProvider: new OpenAICodexSDKProvider({
|
|
116
|
+
config: getCodexDefaultProviderConfig(env, {
|
|
117
|
+
network_access_enabled: true,
|
|
118
|
+
output_schema: CODEX_GRADING_OUTPUT_SCHEMA,
|
|
119
|
+
web_search_mode: "live"
|
|
120
|
+
}, defaultWorkingDir),
|
|
121
|
+
env
|
|
122
|
+
})
|
|
123
|
+
};
|
|
124
|
+
codexDefaultProvidersByCacheKey.set(cacheKey, providers);
|
|
125
|
+
return providers;
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
9
128
|
//#region src/redteam/remoteGeneration.ts
|
|
10
129
|
/**
|
|
11
130
|
* Gets the remote generation API endpoint URL.
|
|
@@ -72,10 +191,10 @@ function getRemoteVersionUrl() {
|
|
|
72
191
|
* Determines if remote generation should be used based on configuration.
|
|
73
192
|
* @returns true if remote generation should be used
|
|
74
193
|
*/
|
|
75
|
-
function shouldGenerateRemote() {
|
|
194
|
+
function shouldGenerateRemote(options) {
|
|
76
195
|
if (neverGenerateRemote()) return false;
|
|
77
196
|
if (isLoggedIntoCloud()) return true;
|
|
78
|
-
return !getEnvString("OPENAI_API_KEY") || (state.remote ?? false);
|
|
197
|
+
return !(Boolean(getEnvString("OPENAI_API_KEY")) || options?.canUseCodexDefaultProvider && !options?.requireEmbeddingProvider && hasCodexDefaultCredentials()) || (state.remote ?? false);
|
|
79
198
|
}
|
|
80
199
|
/**
|
|
81
200
|
* Gets the URL for unaligned model inference (harmful content generation).
|
|
@@ -193,7 +312,7 @@ async function checkServerRunning(port = getDefaultPort()) {
|
|
|
193
312
|
logger.debug(`Checking for existing server on port ${port}...`);
|
|
194
313
|
try {
|
|
195
314
|
const data = await (await fetchWithProxy(`http://localhost:${port}/health`, { headers: { "x-promptfoo-silent": "true" } })).json();
|
|
196
|
-
return data.status === "OK" && data.version === "0.121.
|
|
315
|
+
return data.status === "OK" && data.version === "0.121.4";
|
|
197
316
|
} catch (err) {
|
|
198
317
|
logger.debug(`No existing server found - this is expected on first startup. ${String(err)}`);
|
|
199
318
|
return false;
|
|
@@ -261,6 +380,6 @@ async function openAuthBrowser(authUrl, welcomeUrl, browserBehavior) {
|
|
|
261
380
|
} else await doOpen();
|
|
262
381
|
}
|
|
263
382
|
//#endregion
|
|
264
|
-
export { openAuthBrowser as a, promptYesNo as c, getRemoteHealthUrl as d, neverGenerateRemote as f, checkServerRunning as i, getRemoteGenerationUrl as l, shouldGenerateRemote as m, BrowserBehaviorNames as n, openBrowser as o, neverGenerateRemoteForRegularEvals as p, checkServerFeatureSupport as r, promptUser as s, BrowserBehavior as t, getRemoteGenerationUrlForUnaligned as u };
|
|
383
|
+
export { openAuthBrowser as a, promptYesNo as c, getRemoteHealthUrl as d, neverGenerateRemote as f, hasCodexDefaultCredentials as g, getCodexDefaultProviders as h, checkServerRunning as i, getRemoteGenerationUrl as l, shouldGenerateRemote as m, BrowserBehaviorNames as n, openBrowser as o, neverGenerateRemoteForRegularEvals as p, checkServerFeatureSupport as r, promptUser as s, BrowserBehavior as t, getRemoteGenerationUrlForUnaligned as u };
|
|
265
384
|
|
|
266
|
-
//# sourceMappingURL=server-
|
|
385
|
+
//# sourceMappingURL=server-BNYztJkh.js.map
|
|
@@ -1,10 +1,129 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-DEq-mXcV.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as CloudConfig,
|
|
4
|
-
import { c as isLoggedIntoCloud } from "./accounts-
|
|
2
|
+
import { S as getEnvBool, T as getEnvString, a as logger, k as state } from "./logger-B88EkIn6.js";
|
|
3
|
+
import { a as CloudConfig, j as getDefaultPort, t as fetchWithProxy } from "./fetch-B0Z3Oe4k.js";
|
|
4
|
+
import { c as isLoggedIntoCloud } from "./accounts-DdJ2pHMI.js";
|
|
5
|
+
import { i as resolvePackageEntryPoint, t as getDirectory } from "./esm-Dh4dOLlt.js";
|
|
6
|
+
import { t as OpenAICodexSDKProvider } from "./codex-sdk-Rtky3M4I.js";
|
|
7
|
+
import fs from "fs";
|
|
8
|
+
import path from "path";
|
|
5
9
|
import "chalk";
|
|
10
|
+
import os from "os";
|
|
6
11
|
import opener from "opener";
|
|
7
12
|
import readline from "readline";
|
|
13
|
+
//#region src/providers/openai/codexDefaults.ts
|
|
14
|
+
const CODEX_AUTH_FILENAME = "auth.json";
|
|
15
|
+
const CODEX_SDK_PACKAGE_NAME = "@openai/codex-sdk";
|
|
16
|
+
let codexDefaultWorkingDir;
|
|
17
|
+
const CODEX_GRADING_OUTPUT_SCHEMA = {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
pass: { type: "boolean" },
|
|
21
|
+
score: { type: "number" },
|
|
22
|
+
reason: { type: "string" }
|
|
23
|
+
},
|
|
24
|
+
required: [
|
|
25
|
+
"pass",
|
|
26
|
+
"score",
|
|
27
|
+
"reason"
|
|
28
|
+
],
|
|
29
|
+
additionalProperties: false
|
|
30
|
+
};
|
|
31
|
+
const codexDefaultProvidersByCacheKey = /* @__PURE__ */ new Map();
|
|
32
|
+
const codexSdkAvailabilityByBaseDir = /* @__PURE__ */ new Map();
|
|
33
|
+
function getCodexEnvString(env, key) {
|
|
34
|
+
return env?.[key] || getEnvString(key);
|
|
35
|
+
}
|
|
36
|
+
function getCodexHome(env) {
|
|
37
|
+
const homeDir = os.homedir?.();
|
|
38
|
+
const defaultHome = typeof homeDir === "string" && homeDir ? path.join(homeDir, ".codex") : void 0;
|
|
39
|
+
const codexHome = getCodexEnvString(env, "CODEX_HOME") || defaultHome || ".codex";
|
|
40
|
+
return path.resolve(codexHome);
|
|
41
|
+
}
|
|
42
|
+
function getTempDirectory() {
|
|
43
|
+
const tempDir = os.tmpdir?.();
|
|
44
|
+
return typeof tempDir === "string" && tempDir ? tempDir : process.cwd();
|
|
45
|
+
}
|
|
46
|
+
function getCodexDefaultWorkingDir() {
|
|
47
|
+
if (!codexDefaultWorkingDir) codexDefaultWorkingDir = fs.mkdtempSync(path.join(getTempDirectory(), "promptfoo-codex-default-"));
|
|
48
|
+
return codexDefaultWorkingDir;
|
|
49
|
+
}
|
|
50
|
+
function hasCodexAuthFile(env) {
|
|
51
|
+
try {
|
|
52
|
+
const stats = fs.statSync(path.join(getCodexHome(env), CODEX_AUTH_FILENAME));
|
|
53
|
+
return stats.isFile() && stats.size > 0;
|
|
54
|
+
} catch {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function hasCodexSdkPackage(baseDir) {
|
|
59
|
+
const cached = codexSdkAvailabilityByBaseDir.get(baseDir);
|
|
60
|
+
if (cached !== void 0) return cached;
|
|
61
|
+
const hasPackage = resolvePackageEntryPoint(CODEX_SDK_PACKAGE_NAME, baseDir) !== null;
|
|
62
|
+
codexSdkAvailabilityByBaseDir.set(baseDir, hasPackage);
|
|
63
|
+
return hasPackage;
|
|
64
|
+
}
|
|
65
|
+
function canLoadCodexSdkPackage() {
|
|
66
|
+
return [process.cwd(), getDirectory()].some((baseDir) => hasCodexSdkPackage(baseDir));
|
|
67
|
+
}
|
|
68
|
+
function hasCodexDefaultCredentials(env) {
|
|
69
|
+
return (Boolean(getCodexEnvString(env, "CODEX_API_KEY")) || hasCodexAuthFile(env)) && canLoadCodexSdkPackage();
|
|
70
|
+
}
|
|
71
|
+
function getCodexDefaultProviderConfig(env, config, defaultWorkingDir = getCodexDefaultWorkingDir()) {
|
|
72
|
+
const codexHome = getCodexEnvString(env, "CODEX_HOME");
|
|
73
|
+
const workingDir = config?.working_dir || defaultWorkingDir;
|
|
74
|
+
fs.mkdirSync(workingDir, { recursive: true });
|
|
75
|
+
const cliEnv = {
|
|
76
|
+
...codexHome ? { CODEX_HOME: path.resolve(codexHome) } : {},
|
|
77
|
+
...config?.cli_env
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
approval_policy: "never",
|
|
81
|
+
sandbox_mode: "read-only",
|
|
82
|
+
skip_git_repo_check: true,
|
|
83
|
+
working_dir: workingDir,
|
|
84
|
+
...config,
|
|
85
|
+
...Object.keys(cliEnv).length > 0 ? { cli_env: cliEnv } : {}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function getCodexDefaultProvidersCacheKey(env) {
|
|
89
|
+
return JSON.stringify({
|
|
90
|
+
CODEX_HOME: getCodexEnvString(env, "CODEX_HOME"),
|
|
91
|
+
hasCodexApiKey: Boolean(getCodexEnvString(env, "CODEX_API_KEY")),
|
|
92
|
+
hasOpenAiApiKey: Boolean(getCodexEnvString(env, "OPENAI_API_KEY"))
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function getCodexDefaultProviders(env) {
|
|
96
|
+
const cacheKey = getCodexDefaultProvidersCacheKey(env);
|
|
97
|
+
const cachedProviders = codexDefaultProvidersByCacheKey.get(cacheKey);
|
|
98
|
+
if (cachedProviders) return cachedProviders;
|
|
99
|
+
const defaultWorkingDir = getCodexDefaultWorkingDir();
|
|
100
|
+
const gradingProvider = new OpenAICodexSDKProvider({
|
|
101
|
+
config: getCodexDefaultProviderConfig(env, void 0, defaultWorkingDir),
|
|
102
|
+
env
|
|
103
|
+
});
|
|
104
|
+
const gradingJsonProvider = new OpenAICodexSDKProvider({
|
|
105
|
+
config: getCodexDefaultProviderConfig(env, { output_schema: CODEX_GRADING_OUTPUT_SCHEMA }, defaultWorkingDir),
|
|
106
|
+
env
|
|
107
|
+
});
|
|
108
|
+
const providers = {
|
|
109
|
+
gradingJsonProvider,
|
|
110
|
+
gradingProvider,
|
|
111
|
+
llmRubricProvider: gradingJsonProvider,
|
|
112
|
+
suggestionsProvider: gradingProvider,
|
|
113
|
+
synthesizeProvider: gradingProvider,
|
|
114
|
+
webSearchProvider: new OpenAICodexSDKProvider({
|
|
115
|
+
config: getCodexDefaultProviderConfig(env, {
|
|
116
|
+
network_access_enabled: true,
|
|
117
|
+
output_schema: CODEX_GRADING_OUTPUT_SCHEMA,
|
|
118
|
+
web_search_mode: "live"
|
|
119
|
+
}, defaultWorkingDir),
|
|
120
|
+
env
|
|
121
|
+
})
|
|
122
|
+
};
|
|
123
|
+
codexDefaultProvidersByCacheKey.set(cacheKey, providers);
|
|
124
|
+
return providers;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
8
127
|
//#region src/redteam/remoteGeneration.ts
|
|
9
128
|
/**
|
|
10
129
|
* Gets the remote generation API endpoint URL.
|
|
@@ -71,10 +190,10 @@ function getRemoteVersionUrl() {
|
|
|
71
190
|
* Determines if remote generation should be used based on configuration.
|
|
72
191
|
* @returns true if remote generation should be used
|
|
73
192
|
*/
|
|
74
|
-
function shouldGenerateRemote() {
|
|
193
|
+
function shouldGenerateRemote(options) {
|
|
75
194
|
if (neverGenerateRemote()) return false;
|
|
76
195
|
if (isLoggedIntoCloud()) return true;
|
|
77
|
-
return !getEnvString("OPENAI_API_KEY") || (state.remote ?? false);
|
|
196
|
+
return !(Boolean(getEnvString("OPENAI_API_KEY")) || options?.canUseCodexDefaultProvider && !options?.requireEmbeddingProvider && hasCodexDefaultCredentials()) || (state.remote ?? false);
|
|
78
197
|
}
|
|
79
198
|
/**
|
|
80
199
|
* Gets the URL for unaligned model inference (harmful content generation).
|
|
@@ -199,7 +318,7 @@ async function checkServerRunning(port = getDefaultPort()) {
|
|
|
199
318
|
logger.debug(`Checking for existing server on port ${port}...`);
|
|
200
319
|
try {
|
|
201
320
|
const data = await (await fetchWithProxy(`http://localhost:${port}/health`, { headers: { "x-promptfoo-silent": "true" } })).json();
|
|
202
|
-
return data.status === "OK" && data.version === "0.121.
|
|
321
|
+
return data.status === "OK" && data.version === "0.121.4";
|
|
203
322
|
} catch (err) {
|
|
204
323
|
logger.debug(`No existing server found - this is expected on first startup. ${String(err)}`);
|
|
205
324
|
return false;
|
|
@@ -224,6 +343,6 @@ async function openBrowser(browserBehavior, port = getDefaultPort()) {
|
|
|
224
343
|
} else if (browserBehavior !== BrowserBehavior.SKIP) await doOpen();
|
|
225
344
|
}
|
|
226
345
|
//#endregion
|
|
227
|
-
export { openBrowser as a, getRemoteGenerationUrl as c, neverGenerateRemote as d, neverGenerateRemoteForRegularEvals as f, checkServerRunning as i, getRemoteGenerationUrlForUnaligned as l, BrowserBehaviorNames as n, server_exports as o, shouldGenerateRemote as p, checkServerFeatureSupport as r, promptYesNo as s, BrowserBehavior as t, getRemoteHealthUrl as u };
|
|
346
|
+
export { openBrowser as a, getRemoteGenerationUrl as c, neverGenerateRemote as d, neverGenerateRemoteForRegularEvals as f, hasCodexDefaultCredentials as h, checkServerRunning as i, getRemoteGenerationUrlForUnaligned as l, getCodexDefaultProviders as m, BrowserBehaviorNames as n, server_exports as o, shouldGenerateRemote as p, checkServerFeatureSupport as r, promptYesNo as s, BrowserBehavior as t, getRemoteHealthUrl as u };
|
|
228
347
|
|
|
229
|
-
//# sourceMappingURL=server-
|
|
348
|
+
//# sourceMappingURL=server-BSB45Nt9.js.map
|
|
@@ -1,10 +1,129 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-DEq-mXcV.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { S as getEnvBool, T as getEnvString, a as logger, k as state } from "./logger-Ct2S6Yx-.js";
|
|
3
|
+
import { i as resolvePackageEntryPoint, t as getDirectory } from "./esm-C7PnfdF8.js";
|
|
4
|
+
import { a as CloudConfig, t as fetchWithProxy } from "./fetch-Di00EQrc.js";
|
|
5
|
+
import { t as OpenAICodexSDKProvider } from "./codex-sdk-CErXn7qh.js";
|
|
6
|
+
import { o as isLoggedIntoCloud } from "./accounts-DhMYUUbu.js";
|
|
7
|
+
import fs from "fs";
|
|
8
|
+
import path from "path";
|
|
5
9
|
import "chalk";
|
|
10
|
+
import os from "os";
|
|
6
11
|
import "opener";
|
|
7
12
|
import readline from "readline";
|
|
13
|
+
//#region src/providers/openai/codexDefaults.ts
|
|
14
|
+
const CODEX_AUTH_FILENAME = "auth.json";
|
|
15
|
+
const CODEX_SDK_PACKAGE_NAME = "@openai/codex-sdk";
|
|
16
|
+
let codexDefaultWorkingDir;
|
|
17
|
+
const CODEX_GRADING_OUTPUT_SCHEMA = {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
pass: { type: "boolean" },
|
|
21
|
+
score: { type: "number" },
|
|
22
|
+
reason: { type: "string" }
|
|
23
|
+
},
|
|
24
|
+
required: [
|
|
25
|
+
"pass",
|
|
26
|
+
"score",
|
|
27
|
+
"reason"
|
|
28
|
+
],
|
|
29
|
+
additionalProperties: false
|
|
30
|
+
};
|
|
31
|
+
const codexDefaultProvidersByCacheKey = /* @__PURE__ */ new Map();
|
|
32
|
+
const codexSdkAvailabilityByBaseDir = /* @__PURE__ */ new Map();
|
|
33
|
+
function getCodexEnvString(env, key) {
|
|
34
|
+
return env?.[key] || getEnvString(key);
|
|
35
|
+
}
|
|
36
|
+
function getCodexHome(env) {
|
|
37
|
+
const homeDir = os.homedir?.();
|
|
38
|
+
const defaultHome = typeof homeDir === "string" && homeDir ? path.join(homeDir, ".codex") : void 0;
|
|
39
|
+
const codexHome = getCodexEnvString(env, "CODEX_HOME") || defaultHome || ".codex";
|
|
40
|
+
return path.resolve(codexHome);
|
|
41
|
+
}
|
|
42
|
+
function getTempDirectory() {
|
|
43
|
+
const tempDir = os.tmpdir?.();
|
|
44
|
+
return typeof tempDir === "string" && tempDir ? tempDir : process.cwd();
|
|
45
|
+
}
|
|
46
|
+
function getCodexDefaultWorkingDir() {
|
|
47
|
+
if (!codexDefaultWorkingDir) codexDefaultWorkingDir = fs.mkdtempSync(path.join(getTempDirectory(), "promptfoo-codex-default-"));
|
|
48
|
+
return codexDefaultWorkingDir;
|
|
49
|
+
}
|
|
50
|
+
function hasCodexAuthFile(env) {
|
|
51
|
+
try {
|
|
52
|
+
const stats = fs.statSync(path.join(getCodexHome(env), CODEX_AUTH_FILENAME));
|
|
53
|
+
return stats.isFile() && stats.size > 0;
|
|
54
|
+
} catch {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function hasCodexSdkPackage(baseDir) {
|
|
59
|
+
const cached = codexSdkAvailabilityByBaseDir.get(baseDir);
|
|
60
|
+
if (cached !== void 0) return cached;
|
|
61
|
+
const hasPackage = resolvePackageEntryPoint(CODEX_SDK_PACKAGE_NAME, baseDir) !== null;
|
|
62
|
+
codexSdkAvailabilityByBaseDir.set(baseDir, hasPackage);
|
|
63
|
+
return hasPackage;
|
|
64
|
+
}
|
|
65
|
+
function canLoadCodexSdkPackage() {
|
|
66
|
+
return [process.cwd(), getDirectory()].some((baseDir) => hasCodexSdkPackage(baseDir));
|
|
67
|
+
}
|
|
68
|
+
function hasCodexDefaultCredentials(env) {
|
|
69
|
+
return (Boolean(getCodexEnvString(env, "CODEX_API_KEY")) || hasCodexAuthFile(env)) && canLoadCodexSdkPackage();
|
|
70
|
+
}
|
|
71
|
+
function getCodexDefaultProviderConfig(env, config, defaultWorkingDir = getCodexDefaultWorkingDir()) {
|
|
72
|
+
const codexHome = getCodexEnvString(env, "CODEX_HOME");
|
|
73
|
+
const workingDir = config?.working_dir || defaultWorkingDir;
|
|
74
|
+
fs.mkdirSync(workingDir, { recursive: true });
|
|
75
|
+
const cliEnv = {
|
|
76
|
+
...codexHome ? { CODEX_HOME: path.resolve(codexHome) } : {},
|
|
77
|
+
...config?.cli_env
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
approval_policy: "never",
|
|
81
|
+
sandbox_mode: "read-only",
|
|
82
|
+
skip_git_repo_check: true,
|
|
83
|
+
working_dir: workingDir,
|
|
84
|
+
...config,
|
|
85
|
+
...Object.keys(cliEnv).length > 0 ? { cli_env: cliEnv } : {}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function getCodexDefaultProvidersCacheKey(env) {
|
|
89
|
+
return JSON.stringify({
|
|
90
|
+
CODEX_HOME: getCodexEnvString(env, "CODEX_HOME"),
|
|
91
|
+
hasCodexApiKey: Boolean(getCodexEnvString(env, "CODEX_API_KEY")),
|
|
92
|
+
hasOpenAiApiKey: Boolean(getCodexEnvString(env, "OPENAI_API_KEY"))
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function getCodexDefaultProviders(env) {
|
|
96
|
+
const cacheKey = getCodexDefaultProvidersCacheKey(env);
|
|
97
|
+
const cachedProviders = codexDefaultProvidersByCacheKey.get(cacheKey);
|
|
98
|
+
if (cachedProviders) return cachedProviders;
|
|
99
|
+
const defaultWorkingDir = getCodexDefaultWorkingDir();
|
|
100
|
+
const gradingProvider = new OpenAICodexSDKProvider({
|
|
101
|
+
config: getCodexDefaultProviderConfig(env, void 0, defaultWorkingDir),
|
|
102
|
+
env
|
|
103
|
+
});
|
|
104
|
+
const gradingJsonProvider = new OpenAICodexSDKProvider({
|
|
105
|
+
config: getCodexDefaultProviderConfig(env, { output_schema: CODEX_GRADING_OUTPUT_SCHEMA }, defaultWorkingDir),
|
|
106
|
+
env
|
|
107
|
+
});
|
|
108
|
+
const providers = {
|
|
109
|
+
gradingJsonProvider,
|
|
110
|
+
gradingProvider,
|
|
111
|
+
llmRubricProvider: gradingJsonProvider,
|
|
112
|
+
suggestionsProvider: gradingProvider,
|
|
113
|
+
synthesizeProvider: gradingProvider,
|
|
114
|
+
webSearchProvider: new OpenAICodexSDKProvider({
|
|
115
|
+
config: getCodexDefaultProviderConfig(env, {
|
|
116
|
+
network_access_enabled: true,
|
|
117
|
+
output_schema: CODEX_GRADING_OUTPUT_SCHEMA,
|
|
118
|
+
web_search_mode: "live"
|
|
119
|
+
}, defaultWorkingDir),
|
|
120
|
+
env
|
|
121
|
+
})
|
|
122
|
+
};
|
|
123
|
+
codexDefaultProvidersByCacheKey.set(cacheKey, providers);
|
|
124
|
+
return providers;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
8
127
|
//#region src/redteam/remoteGeneration.ts
|
|
9
128
|
/**
|
|
10
129
|
* Gets the remote generation API endpoint URL.
|
|
@@ -71,10 +190,10 @@ function getRemoteVersionUrl() {
|
|
|
71
190
|
* Determines if remote generation should be used based on configuration.
|
|
72
191
|
* @returns true if remote generation should be used
|
|
73
192
|
*/
|
|
74
|
-
function shouldGenerateRemote() {
|
|
193
|
+
function shouldGenerateRemote(options) {
|
|
75
194
|
if (neverGenerateRemote()) return false;
|
|
76
195
|
if (isLoggedIntoCloud()) return true;
|
|
77
|
-
return !getEnvString("OPENAI_API_KEY") || (state.remote ?? false);
|
|
196
|
+
return !(Boolean(getEnvString("OPENAI_API_KEY")) || options?.canUseCodexDefaultProvider && !options?.requireEmbeddingProvider && hasCodexDefaultCredentials()) || (state.remote ?? false);
|
|
78
197
|
}
|
|
79
198
|
/**
|
|
80
199
|
* Gets the URL for unaligned model inference (harmful content generation).
|
|
@@ -186,6 +305,6 @@ async function checkServerFeatureSupport(featureName, requiredBuildDate) {
|
|
|
186
305
|
return supported;
|
|
187
306
|
}
|
|
188
307
|
//#endregion
|
|
189
|
-
export { getRemoteGenerationUrlForUnaligned as a, neverGenerateRemoteForRegularEvals as c, getRemoteGenerationUrl as i, shouldGenerateRemote as l, server_exports as n, getRemoteHealthUrl as o, promptYesNo as r, neverGenerateRemote as s, checkServerFeatureSupport as t };
|
|
308
|
+
export { getRemoteGenerationUrlForUnaligned as a, neverGenerateRemoteForRegularEvals as c, hasCodexDefaultCredentials as d, getRemoteGenerationUrl as i, shouldGenerateRemote as l, server_exports as n, getRemoteHealthUrl as o, promptYesNo as r, neverGenerateRemote as s, checkServerFeatureSupport as t, getCodexDefaultProviders as u };
|
|
190
309
|
|
|
191
|
-
//# sourceMappingURL=server-
|
|
310
|
+
//# sourceMappingURL=server-D6Il2Sob.js.map
|