promptfoo 0.121.2 → 0.121.3
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 +2 -0
- package/dist/src/{accounts-CiBLOnA7.js → accounts-B2XmGjty.js} +5 -5
- package/dist/src/{accounts-gtkH-5KX.cjs → accounts-BPyfpSeU.cjs} +5 -5
- package/dist/src/{accounts-Bm2D8Db9.js → accounts-CFLK3mnD.js} +6 -6
- package/dist/src/{accounts-B0pgC1oV.js → accounts-Xatc0RYb.js} +5 -5
- package/dist/src/{agentic-utils-DS1g3GLF.js → agentic-utils-36epdqwB.js} +3 -3
- package/dist/src/{cometapi-CUQq3H_a.js → agentic-utils-D8yXo5Lm.js} +4 -61
- package/dist/src/{cometapi-C4xSqeID.cjs → agentic-utils-DAVsChuB.cjs} +24 -62
- package/dist/src/agentic-utils-DIYAAYE7.js +153 -0
- package/dist/src/{agents-CBr9A01V.js → agents-BBVJCIYr.js} +226 -13
- package/dist/src/{agents-Di9DKPzn.cjs → agents-BBWxKSM0.cjs} +7 -7
- package/dist/src/{agents-DgF2zDag.js → agents-Bqgfdokm.js} +228 -13
- package/dist/src/{agents-DbRtpYxR.cjs → agents-CAYbM7qD.cjs} +226 -13
- package/dist/src/{agents-9qiOy0ho.js → agents-CLQ-P15P.js} +7 -7
- package/dist/src/{agents-cLXA8a_8.js → agents-CgBniSlI.js} +8 -8
- package/dist/src/{agents-D__IdAlg.js → agents-DSSTV4bv.js} +226 -15
- package/dist/src/{agents-CmvBq8LV.js → agents-wg3ohknq.js} +7 -7
- package/dist/src/{aimlapi-BvlNH0gr.cjs → aimlapi-Bv8Fmc-b.cjs} +14 -14
- package/dist/src/{aimlapi-DHJU_kcV.js → aimlapi-BwGC1TtS.js} +13 -13
- package/dist/src/{aimlapi-CnkC2HqE.js → aimlapi-DaC3qZ-o.js} +14 -14
- package/dist/src/{aimlapi-B4rcnZgv.js → aimlapi-MgSLdvy7.js} +13 -13
- package/dist/src/app/assets/index-B6l9CVVb.js +439 -0
- package/dist/src/app/assets/index-DyZ0Ep37.css +1 -0
- package/dist/src/app/assets/sync-CStkzc6u.js +4 -0
- package/dist/src/app/assets/vendor-markdown-Bz7N-ca6.js +29 -0
- package/dist/src/app/index.html +3 -3
- package/dist/src/{audio-Bkv46et0.js → audio-Bn44pQxv.js} +4 -4
- package/dist/src/{audio-ClI_AFre.js → audio-DDA5WHdx.js} +4 -4
- package/dist/src/{audio-CGMyULza.cjs → audio-DVFjQ67_.cjs} +4 -4
- package/dist/src/{audio-Dz3z7s3J.js → audio-DjU9GswO.js} +5 -5
- package/dist/src/{base-CGrhspbK.cjs → base-BboXIF_0.cjs} +3 -3
- package/dist/src/{base-Dy1V8--Z.js → base-CKjwebIH.js} +3 -3
- package/dist/src/{base-DLKtKMFh.js → base-CqzQ4K8j.js} +3 -3
- package/dist/src/{base-CpjcHe4e.js → base-Cz2ZC_iA.js} +3 -3
- package/dist/src/{blobs-CMHN0Qcz.js → blobs-B1JriOyi.js} +3 -3
- package/dist/src/{blobs-BDbfYdrJ.js → blobs-BUWmKWzo.js} +3 -3
- package/dist/src/{blobs-D23XLin-.cjs → blobs-C6j0bvFz.cjs} +3 -3
- package/dist/src/{blobs-CBO20krR.js → blobs-DXTl6J3H.js} +3 -3
- package/dist/src/{cache-Dh5WtQps.cjs → cache-C5yFZ4gC.cjs} +3 -3
- package/dist/src/{cache-C4Nxf52C.js → cache-CaT5tPgo.js} +3 -3
- package/dist/src/cache-CyCanoMu.js +6 -0
- package/dist/src/{cache-BVeDlD87.js → cache-DSqR6ezl.js} +3 -3
- package/dist/src/cache-Df_QFDNu.cjs +5 -0
- package/dist/src/{cache-i1P6crbO.js → cache-HP0NP4k3.js} +3 -3
- package/dist/src/{chat-CzkrVDfz.js → chat-B-52XYI1.js} +12 -12
- package/dist/src/{chat-DJIw17u0.js → chat-B0iaWhoh.js} +14 -14
- package/dist/src/{chat-qmatte1u.js → chat-BE0qTA8e.js} +13 -13
- package/dist/src/{chat-BiKyneZl.js → chat-BEwdgGEg.js} +14 -14
- package/dist/src/{chat-C1Qst7jL.cjs → chat-BtIKkLKx.cjs} +13 -13
- package/dist/src/{chat-CgF-J-Jj.cjs → chat-CM8qWR3_.cjs} +15 -15
- package/dist/src/{chat-C2jrdPMx.js → chat-DK1U-eZ-.js} +12 -12
- package/dist/src/{chat-DqxYYtWA.js → chat-pxmiVpWe.js} +14 -14
- package/dist/src/{chatkit-65VXf5SR.js → chatkit-BYGQlHlV.js} +4 -4
- package/dist/src/{chatkit-DKyPi1Gs.cjs → chatkit-Cx174XI3.cjs} +4 -4
- package/dist/src/{chatkit-BxFvW8KY.js → chatkit-_8eJqKcD.js} +4 -4
- package/dist/src/{chatkit-Be-Q-a9F.js → chatkit-a2D6mY6s.js} +4 -4
- package/dist/src/{claude-agent-sdk-D9Z5Pr9X.cjs → claude-agent-sdk-8ddRp1L2.cjs} +35 -17
- package/dist/src/{claude-agent-sdk-DfCoW0E6.js → claude-agent-sdk-Bq5EArsX.js} +33 -15
- package/dist/src/{claude-agent-sdk-Apiy0iaz.js → claude-agent-sdk-CMjh4LFH.js} +33 -15
- package/dist/src/{claude-agent-sdk-D2bJee9S.js → claude-agent-sdk-HgbFioFw.js} +33 -15
- package/dist/src/cloud-DE3t1-ZI.js +4 -0
- package/dist/src/{cloud-C0dlstV_.js → cloud-z8KZpUoa.js} +3 -3
- package/dist/src/{cloudflare-ai-g7PB6VHR.js → cloudflare-ai-BGyXlpXJ.js} +13 -13
- package/dist/src/{cloudflare-ai-8TDxHR0x.js → cloudflare-ai-Bbp26N0L.js} +13 -13
- package/dist/src/{cloudflare-ai-CknbZ5LJ.cjs → cloudflare-ai-C62x6MQG.cjs} +14 -14
- package/dist/src/{cloudflare-ai-BxAGvfju.js → cloudflare-ai-DdKP9TKT.js} +14 -14
- package/dist/src/{cloudflare-gateway-CP9QEWYS.js → cloudflare-gateway-BwAaUgeW.js} +14 -14
- package/dist/src/{cloudflare-gateway-B9HWA5wf.js → cloudflare-gateway-D-e9i1Sn.js} +15 -15
- package/dist/src/{cloudflare-gateway-CKDb4dJ8.js → cloudflare-gateway-DXhtXDRb.js} +15 -163
- package/dist/src/{cloudflare-gateway-BSnDmHYo.cjs → cloudflare-gateway-Dx36ftqF.cjs} +15 -15
- package/dist/src/{codex-sdk-DUwKWezN.js → codex-sdk-BQEw16R_.js} +180 -11
- package/dist/src/{codex-sdk-C6UMlxwV.js → codex-sdk-C_07GuVS.js} +180 -11
- package/dist/src/{codex-sdk-GGAw0qbD.js → codex-sdk-DE5G18dx.js} +180 -11
- package/dist/src/{codex-sdk-fAO0c3yA.cjs → codex-sdk-ZLKfDjqP.cjs} +181 -12
- package/dist/src/cometapi-BDyV-NNm.js +62 -0
- package/dist/src/cometapi-C3hOlM7-.cjs +62 -0
- package/dist/src/{cometapi-BL9yvj_f.js → cometapi-hhL4TAh3.js} +14 -14
- package/dist/src/{cometapi-DFNiKmSz.js → cometapi-sp7sJpBD.js} +15 -15
- package/dist/src/{completion-5MzrpJxT.js → completion-BCimtq-h.js} +6 -6
- package/dist/src/{completion-qRoZAYRB.js → completion-DCjv7RZ3.js} +6 -6
- package/dist/src/{completion-CM6oK8PS.cjs → completion-DlXUhj5c.cjs} +6 -6
- package/dist/src/{completion-DZ083F31.js → completion-DoYy49ti.js} +6 -6
- package/dist/src/{createHash-CfZSc0b4.cjs → createHash-BYwImsYv.cjs} +2 -2
- package/dist/src/{docker-DcF2pRrj.cjs → docker-Cqj2-QVi.cjs} +14 -14
- package/dist/src/{docker-Bb5dcxr8.js → docker-CxCkwMzc.js} +13 -13
- package/dist/src/{docker-BvfL2BrW.js → docker-DpguQj-w.js} +14 -14
- package/dist/src/{docker-ExVyLp0S.js → docker-FeBni2dw.js} +13 -13
- package/dist/src/{esm-C03C-mv3.js → esm-7UIl0pPM.js} +2 -2
- package/dist/src/{esm-Cd1AjG1D.js → esm-CKWP3u_P.js} +3 -3
- package/dist/src/{esm-CnNt7sI4.cjs → esm-CipptfDu.cjs} +2 -2
- package/dist/src/{esm-CaIwzWR5.js → esm-SUNIX1x3.js} +3 -3
- package/dist/src/eval-7aEqoMs3.js +15 -0
- package/dist/src/{eval-Dg2nG4v2.js → eval-BTqTn7lb.js} +10 -10
- package/dist/src/{evalResult-BDMqrapS.js → evalResult-BkIhRdTe.js} +7 -7
- package/dist/src/evalResult-CYNHkk5A.js +12 -0
- package/dist/src/evalResult-CuvJeNiM.js +10 -0
- package/dist/src/{evalResult-BBRNtX4I.js → evalResult-DUDShQrm.js} +7 -7
- package/dist/src/{evalResult-fuaI8HkH.cjs → evalResult-DpARzUCb.cjs} +7 -7
- package/dist/src/evalResult-tGdilrWt.cjs +10 -0
- package/dist/src/evaluator-BBUqRhz1.js +36 -0
- package/dist/src/{evaluator-BhoWwp5b.js → evaluator-BcvOGaam.js} +823 -73
- package/dist/src/{extractor-D25qpmGX.js → extractor-C8XwivI9.js} +6 -6
- package/dist/src/{extractor-DReVID0K.js → extractor-CAZ2G3Kh.js} +6 -6
- package/dist/src/{extractor-pYLLi3wS.cjs → extractor-DG3sSfXE.cjs} +6 -6
- package/dist/src/{extractor-C0EVHewb.js → extractor-D_wd8jxt.js} +6 -6
- package/dist/src/{fetch-HaqdX7U1.js → fetch-BiYv2BZc.js} +3 -3
- package/dist/src/{fetch-BPkYtG8K.cjs → fetch-BnR9wSnm.cjs} +3 -3
- package/dist/src/{fetch-Cwxnd8zz.js → fetch-CVAtKnI3.js} +3 -3
- package/dist/src/{fetch-Dxpd4_sr.js → fetch-DoVRJZhJ.js} +4 -4
- package/dist/src/fetch-UWU706qb.js +5 -0
- package/dist/src/{genaiTracer-DN4dQywX.cjs → genaiTracer-BfxrvSUb.cjs} +2 -2
- package/dist/src/{graders-DU49_J8Y.cjs → graders-BElhu9ZY.cjs} +126 -55
- package/dist/src/{graders-DP7KFFo-.js → graders-BXAJ0sbS.js} +120 -55
- package/dist/src/graders-BxfEguVY.js +32 -0
- package/dist/src/graders-CzVMbEnv.js +34 -0
- package/dist/src/{graders-BTeBGqjJ.js → graders-DG7mhg-b.js} +120 -55
- package/dist/src/graders-DjCXfj0l.cjs +32 -0
- package/dist/src/{graders-Bj_Odv7c.js → graders-RjHF8VfG.js} +120 -55
- package/dist/src/graders-kHzIWOKu.js +32 -0
- package/dist/src/{image-BLmROtN3.cjs → image--F58eEIn.cjs} +6 -6
- package/dist/src/{image-B0h9VEMc.js → image-6WQXK8m8.js} +4 -4
- package/dist/src/{image-Dpxa1Jt6.js → image-B8b6f36E.js} +6 -6
- package/dist/src/{image-CHfWvljl.js → image-CoxZp9PZ.js} +6 -6
- package/dist/src/{image-B02ogr_b.js → image-DO0RYnjH.js} +5 -5
- package/dist/src/{image-DS-o-0ph.js → image-PoF6DN3x.js} +6 -6
- package/dist/src/{image-C1madmKh.cjs → image-fza3zuKs.cjs} +4 -4
- package/dist/src/{image-Bb4vWQLM.js → image-xNbw5ph2.js} +4 -4
- package/dist/src/index.cjs +853 -104
- package/dist/src/index.d.cts +573 -60
- package/dist/src/index.d.ts +573 -60
- package/dist/src/index.js +850 -102
- package/dist/src/{interactiveCheck-BgLZUIt3.js → interactiveCheck-BnMYOjMu.js} +2 -2
- package/dist/src/{knowledgeBase-B3OoKIej.js → knowledgeBase-Bi7CmDbx.js} +7 -7
- package/dist/src/{knowledgeBase-CYTLHOt1.js → knowledgeBase-Ce3ofVan.js} +8 -8
- package/dist/src/{knowledgeBase-D33Ty2l6.js → knowledgeBase-DFRXPZl_.js} +7 -7
- package/dist/src/{knowledgeBase-DOO_BM9b.cjs → knowledgeBase-DqrLX8fy.cjs} +7 -7
- package/dist/src/{litellm-AaeZcZQF.js → litellm-Bo2gQXpo.js} +14 -14
- package/dist/src/{litellm-NbjknEh6.js → litellm-CKiAxnoM.js} +13 -13
- package/dist/src/{litellm-I_hbp_dc.cjs → litellm-CnHI69aj.cjs} +14 -14
- package/dist/src/{litellm-TrljxD9G.js → litellm-Tc294Jhj.js} +13 -13
- package/dist/src/{logger-KkObSCzq.js → logger-BcJBzSSA.js} +10 -14
- package/dist/src/{logger-DLcq4dWf.js → logger-BnkjG2jt.js} +10 -14
- package/dist/src/{logger-Cp1GPUjj.cjs → logger-D5iKBpu_.cjs} +27 -13
- package/dist/src/{logger-CT3IKMKA.js → logger-DO8_zM18.js} +10 -14
- package/dist/src/{luma-ray-BS2_tY8L.js → luma-ray-0ehMPt5N.js} +10 -10
- package/dist/src/{luma-ray-DDsjcgZZ.js → luma-ray-C9q8rdQe.js} +9 -9
- package/dist/src/{luma-ray-f6I2fft-.js → luma-ray-DP0QA9qn.js} +9 -9
- package/dist/src/{luma-ray-Due0n7di.cjs → luma-ray-m9Ku2meV.cjs} +9 -9
- package/dist/src/main.js +69 -71
- package/dist/src/{messages-D0lx5qK7.js → messages-DJNo37Ko.js} +14 -9
- package/dist/src/{messages-BS17jdMx.js → messages-Dy9QecMs.js} +14 -9
- package/dist/src/{messages-Bs1kC7P4.cjs → messages-HJsyEh4o.cjs} +15 -10
- package/dist/src/{messages-ZJk778GH.js → messages-biC_ex-p.js} +14 -9
- package/dist/src/{modelslab-DRb74SP4.js → modelslab-B5J-ZM5c.js} +9 -9
- package/dist/src/{modelslab-Bx9IrZfS.js → modelslab-BI458moT.js} +10 -10
- package/dist/src/{modelslab-Bmni6skY.js → modelslab-BTOT8FUO.js} +9 -9
- package/dist/src/{modelslab-CoUX6Jc_.cjs → modelslab-IQbNg-r7.cjs} +9 -9
- package/dist/src/{nova-reel-bgjxilYW.js → nova-reel-BZ9y-Y5s.js} +9 -9
- package/dist/src/{nova-reel-C_QM18Xn.cjs → nova-reel-CE5etkv9.cjs} +9 -9
- package/dist/src/{nova-reel-D_W1tjMH.js → nova-reel-DEeQlnOJ.js} +10 -10
- package/dist/src/{nova-reel-BfPq-0Yk.js → nova-reel-Xw1SXLpg.js} +9 -9
- package/dist/src/{nova-sonic-De1HW5fD.js → nova-sonic-DWswpN1E.js} +7 -7
- package/dist/src/{nova-sonic-CFb5GYhg.js → nova-sonic-DXTLpi-r.js} +6 -6
- package/dist/src/{nova-sonic-zfcljeRp.cjs → nova-sonic-N0yCm0vb.cjs} +6 -6
- package/dist/src/{nova-sonic-DIGQNR07.js → nova-sonic-Ogqf-csn.js} +6 -6
- package/dist/src/{openai-DhbB7eWK.js → openai-BMcwgD5C.js} +2 -2
- package/dist/src/{openai-j-sE2O7r.js → openai-BcB5KlTk.js} +2 -2
- package/dist/src/{openai-Cuif0GEt.cjs → openai-CoxGAQwn.cjs} +2 -2
- package/dist/src/{openai-DElQ-fPX.js → openai-D6wITiVn.js} +2 -2
- package/dist/src/{openclaw-tiVYRtr-.js → openclaw-0Sv7AK3O.js} +13 -13
- package/dist/src/{openclaw-CSugPYAr.cjs → openclaw-CXxbKgDH.cjs} +14 -14
- package/dist/src/{openclaw-DuvJKEW5.js → openclaw-D1FSCps-.js} +13 -13
- package/dist/src/{openclaw-DiSz3I5L.js → openclaw-D2ENvu7a.js} +14 -14
- package/dist/src/{opencode-sdk-0j6rTWNb.js → opencode-sdk-C71Z0ehR.js} +13 -13
- package/dist/src/{opencode-sdk-B3CWY9h_.js → opencode-sdk-CHCs7dEb.js} +12 -12
- package/dist/src/{opencode-sdk-C2y6UkP2.js → opencode-sdk-DDxj4QqH.js} +12 -12
- package/dist/src/{opencode-sdk-BL764Jdi.cjs → opencode-sdk-WWJhnbKr.cjs} +16 -16
- package/dist/src/{otlpReceiver-C99PPb48.js → otlpReceiver-C9KlUtxh.js} +6 -6
- package/dist/src/{otlpReceiver-CdNBdbsk.js → otlpReceiver-CZL48YfC.js} +6 -6
- package/dist/src/{otlpReceiver-D89fR-rC.js → otlpReceiver-CavGAA6k.js} +6 -6
- package/dist/src/{otlpReceiver-CGq6LspY.cjs → otlpReceiver-DHKqJlsz.cjs} +6 -6
- package/dist/src/{providerRegistry-B0RUOLI_.js → providerRegistry-B9lh-_tx.js} +2 -2
- package/dist/src/{providerRegistry-Civky8Ar.cjs → providerRegistry-BTDgfV5h.cjs} +2 -2
- package/dist/src/{providerRegistry-CD8MEar9.js → providerRegistry-BkzVH5Ba.js} +2 -2
- package/dist/src/{providerRegistry-DM8rZYol.js → providerRegistry-CUWki5mQ.js} +2 -2
- package/dist/src/providers-BSLEaIQG.js +32 -0
- package/dist/src/{providers-CgKOSgTR.cjs → providers-CScd1wN6.cjs} +733 -464
- package/dist/src/{providers-BlqUifFg.js → providers-Ch6Mr0gn.js} +795 -526
- package/dist/src/{providers-Dk_6ocUX.js → providers-Cn73d5sr.js} +795 -526
- package/dist/src/providers-D-FnDg8k.cjs +31 -0
- package/dist/src/providers-DEYiFVAo.js +30 -0
- package/dist/src/{providers-D8lF1sqW.js → providers-DvddrgxL.js} +795 -526
- package/dist/src/providers-sS2WI8YD.js +30 -0
- package/dist/src/{pythonUtils-D6fwaDSg.js → pythonUtils-Bzwbgpbg.js} +3 -3
- package/dist/src/{pythonUtils-D5nxkQ0P.js → pythonUtils-Cpo0Ez1p.js} +3 -3
- package/dist/src/{pythonUtils-CTU3Y3lw.cjs → pythonUtils-dAVigVK-.cjs} +3 -3
- package/dist/src/{pythonUtils-C3py6GC1.js → pythonUtils-wIqk7zAf.js} +3 -3
- package/dist/src/{quiverai-CIaELU_m.js → quiverai-BeofbLVc.js} +4 -4
- package/dist/src/{quiverai-uH-dcTIr.js → quiverai-CCQn73lq.js} +5 -5
- package/dist/src/{quiverai-PdShCPox.cjs → quiverai-CcUhPIBg.cjs} +4 -4
- package/dist/src/{quiverai-BbOUOn2L.js → quiverai-DVSEqJiq.js} +4 -4
- package/dist/src/{render-Drod8m7K.js → render-BHl6QVq9.js} +3 -3
- package/dist/src/{responses-WNGNYe3K.js → responses-BKP_WYis.js} +14 -10
- package/dist/src/{responses-DIR9Ud3j.js → responses-CQb1Tj69.js} +14 -10
- package/dist/src/{responses-CB2jwoAr.js → responses-CgNyTPsY.js} +14 -10
- package/dist/src/{responses-D8SBTL64.cjs → responses-mo0KQDbu.cjs} +14 -10
- package/dist/src/rubyUtils-B1HXG4ej.cjs +4 -0
- package/dist/src/{rubyUtils-DhCAlxZr.cjs → rubyUtils-CGeUtCfW.cjs} +3 -3
- package/dist/src/{rubyUtils-Boc4HZzX.js → rubyUtils-CiVfln3g.js} +3 -3
- package/dist/src/{rubyUtils-BcuGX77l.js → rubyUtils-DECSbsfY.js} +3 -3
- package/dist/src/{rubyUtils-BUVePouc.js → rubyUtils-PgU-gHmx.js} +3 -3
- package/dist/src/rubyUtils-Rt6pKA96.js +5 -0
- package/dist/src/{sagemaker-CNBxx5CJ.js → sagemaker-CVv8W7so.js} +17 -17
- package/dist/src/{sagemaker-CemTFp2h.js → sagemaker-CqeASYE5.js} +17 -17
- package/dist/src/{sagemaker-YSyBXQQh.js → sagemaker-MUbD5V3v.js} +18 -18
- package/dist/src/{sagemaker-Cl28mZU2.cjs → sagemaker-jiw1wQa-.cjs} +17 -17
- package/dist/src/{scanner-BsBlNXNn.js → scanner-DVDeUz1r.js} +10 -10
- package/dist/src/server/index.js +854 -106
- package/dist/src/server-B0Xh1Gx-.js +7 -0
- package/dist/src/{server-C_7Ax-hA.cjs → server-BtoCXeXI.cjs} +4 -4
- package/dist/src/{server-VWgWb00X.js → server-CP9qKM40.js} +4 -4
- package/dist/src/{server-CuxBbeSY.js → server-Cns05F1j.js} +5 -5
- package/dist/src/server-DJTKu9IR.cjs +5 -0
- package/dist/src/{server-CqzrVGpF.js → server-DZ9MtCn0.js} +6 -6
- package/dist/src/{signal-4U3mfRvL.js → signal-C3ZTsUgi.js} +3 -3
- package/dist/src/{slack-DOdy_kyv.js → slack-2sdpGzbt.js} +2 -2
- package/dist/src/{slack-BmVAVGaK.cjs → slack-94iG3T0s.cjs} +2 -2
- package/dist/src/{slack-DCUPTzS2.js → slack-BR0HtO3K.js} +2 -2
- package/dist/src/{slack-DXMKtA-f.js → slack-DCEV-vWP.js} +2 -2
- package/dist/src/store-C5u6MgC8.js +6 -0
- package/dist/src/{store-DLlFCC4h.cjs → store-CLyU7AtI.cjs} +17 -5
- package/dist/src/store-CNHk-De4.cjs +5 -0
- package/dist/src/{store-DXilxTl-.js → store-Cj258DgL.js} +17 -5
- package/dist/src/{store-Dim__MDd.js → store-P8OKm19S.js} +17 -5
- package/dist/src/{store-CXGFv4aR.js → store-VB0GP46K.js} +17 -5
- package/dist/src/{tables-DLJPUdUE.js → tables-BEIFz2tM.js} +3 -3
- package/dist/src/{tables-DPi7wKeM.cjs → tables-BdZQEpRz.cjs} +3 -3
- package/dist/src/{tables-gftXzE9I.js → tables-DmzvLbeZ.js} +3 -3
- package/dist/src/{tables-6YKwjN9-.js → tables-kC7R5kiK.js} +3 -3
- package/dist/src/{telemetry-CMrFgtPB.js → telemetry-BnH5VJAU.js} +4 -4
- package/dist/src/{telemetry-Dthj_BbD.js → telemetry-BugWqKiu.js} +4 -4
- package/dist/src/{telemetry-Cps3mIU-.js → telemetry-DPXLd7UE.js} +4 -4
- package/dist/src/telemetry-Yig0Tino.js +7 -0
- package/dist/src/telemetry-p8Pwqm1i.cjs +5 -0
- package/dist/src/{telemetry-DaX14Chu.cjs → telemetry-re627Lre.cjs} +4 -4
- package/dist/src/{transcription-NLVG9MT1.cjs → transcription-BvtsrzRG.cjs} +13 -13
- package/dist/src/{transcription-BNYURcXg.js → transcription-CaMivnjG.js} +13 -13
- package/dist/src/{transcription-s6A-bNrZ.js → transcription-DOMMTu01.js} +14 -14
- package/dist/src/{transcription-B_OdaHp7.js → transcription-Hb3VnC4M.js} +13 -13
- package/dist/src/{transform-DuHvhZpj.cjs → transform-0BwoBsvO.cjs} +19 -5
- package/dist/src/{transform-uAytVuyX.js → transform-B2-jIv68.js} +8 -6
- package/dist/src/{transform-DECvGmzp.js → transform-BqPkNPYm.js} +4 -4
- package/dist/src/{transform-aa6tmVpZ.js → transform-BzK09Q_9.js} +4 -4
- package/dist/src/transform-ChNIpHz7.js +6 -0
- package/dist/src/{transform-D5HsjduX.js → transform-DrleutM3.js} +8 -6
- package/dist/src/{transform-vNucnNr0.js → transform-DyDAwEpE.js} +8 -6
- package/dist/src/transform-PtQ6rAE3.cjs +5 -0
- package/dist/src/{transform-CzK1Q0zl.cjs → transform-ZrG2dvlo.cjs} +4 -4
- package/dist/src/{transform-DilY9wbS.js → transform-ljLYHEPh.js} +4 -4
- package/dist/src/{transformersAvailability-CEVM2GNQ.js → transformersAvailability-BGkzavwb.js} +1 -1
- package/dist/src/{transformersAvailability-CwayUSlh.cjs → transformersAvailability-DKoRtQLy.cjs} +1 -1
- package/dist/src/{types-Cbd8uOMq.js → types-CIhFeUC4.js} +7 -1
- package/dist/src/{types-CzW2QFyi.js → types-Cd3ygw8W.js} +7 -1
- package/dist/src/{types-C_7nyzr1.cjs → types-D8cGDZbL.cjs} +8 -2
- package/dist/src/{types-DmyIJ-sR.js → types-q8GXGF65.js} +7 -1
- package/dist/src/{util-DGNOS1db.cjs → util--9u9UVCt.cjs} +3 -3
- package/dist/src/{util-ZzmqNPlg.js → util-BLvy9qfE.js} +7 -7
- package/dist/src/{util-C1CeHl-P.js → util-Bm3E9jpK.js} +7 -7
- package/dist/src/{util-BV4XUC0n.js → util-BtoGs5Cb.js} +18 -4
- package/dist/src/{util-BzMcevZc.cjs → util-CFj4YKIn.cjs} +18 -4
- package/dist/src/{util-BRYkYPTd.js → util-CMMkIxfU.js} +7 -7
- package/dist/src/{util-Dnmk2mBQ.js → util-CgDCK4KI.js} +18 -4
- package/dist/src/{util-B9vlHIIh.cjs → util-CuLo2pMR.cjs} +7 -7
- package/dist/src/{util-CMy69ZgQ.js → util-DM2rTn_6.js} +18 -4
- package/dist/src/{util-B3xGByQh.js → util-DMFeUvLz.js} +3 -3
- package/dist/src/{util-BHGHw5G1.js → util-DbVG-yZU.js} +3 -3
- package/dist/src/{util-Bv6uGDfH.js → util-vNmDL5DT.js} +3 -3
- package/dist/src/{utils-XiOAgly5.js → utils-CFxO9KGo.js} +2 -2
- package/dist/src/{utils-f2-Moju7.js → utils-DEuL4VNB.js} +2 -2
- package/dist/src/{utils-Cz9qXqII.cjs → utils-DKw8mrgr.cjs} +3 -3
- package/dist/src/{utils-dLokC-eR.js → utils-DOjD4dTC.js} +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -32
- package/dist/src/app/assets/index-4LKxG2CG.js +0 -439
- package/dist/src/app/assets/index-C3zcsZFQ.css +0 -1
- package/dist/src/app/assets/sync-9qqYcY-B.js +0 -4
- package/dist/src/app/assets/vendor-markdown-0tekx3KX.js +0 -29
- package/dist/src/app/tsconfig.app.tsbuildinfo +0 -1
- package/dist/src/cache-CeUpFm3M.cjs +0 -5
- package/dist/src/cache-n-RCJ-hL.js +0 -6
- package/dist/src/cloud-BBh91EUK.js +0 -4
- package/dist/src/eval-B3r2CVXr.js +0 -15
- package/dist/src/evalResult-5xwYnECe.js +0 -12
- package/dist/src/evalResult-71lY93Kj.cjs +0 -10
- package/dist/src/evalResult-Dx5P5cIv.js +0 -10
- package/dist/src/evaluator-Jx6bRZV6.js +0 -36
- package/dist/src/fetch-BxNb_Lp3.js +0 -5
- package/dist/src/graders-B_pgMLS2.js +0 -34
- package/dist/src/graders-DErokPDO.cjs +0 -32
- package/dist/src/graders-DR_uNe54.js +0 -32
- package/dist/src/graders-w3176Wz-.js +0 -32
- package/dist/src/providers-B7V0njNs.js +0 -32
- package/dist/src/providers-BEwbhv0X.js +0 -30
- package/dist/src/providers-CH3C7zf7.js +0 -30
- package/dist/src/providers-zyB6k_38.cjs +0 -31
- package/dist/src/rubyUtils-BUHu6PhO.js +0 -5
- package/dist/src/rubyUtils-CP42kMvq.cjs +0 -4
- package/dist/src/server-DA4Cyrrq.js +0 -7
- package/dist/src/server-Dulb-4-K.cjs +0 -5
- package/dist/src/store-CXS-Q_91.js +0 -6
- package/dist/src/store-eYkaKMwq.cjs +0 -5
- package/dist/src/telemetry-BpMfhthR.cjs +0 -5
- package/dist/src/telemetry-Dw38hanS.js +0 -7
- package/dist/src/transform-DTGDnAzW.js +0 -6
- package/dist/src/transform-m3qNw4KP.cjs +0 -5
|
@@ -1,9 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as OpenAiGenericProvider } from "./openai-
|
|
1
|
+
import { D as state, a as logger } from "./logger-DO8_zM18.js";
|
|
2
|
+
import { r as importModule } from "./esm-SUNIX1x3.js";
|
|
3
|
+
import { t as fetchWithProxy } from "./fetch-CVAtKnI3.js";
|
|
4
|
+
import { t as OpenAiGenericProvider } from "./openai-BcB5KlTk.js";
|
|
5
5
|
import path from "path";
|
|
6
|
-
import { BatchTraceProcessor, addTraceProcessor, getOrCreateTrace, run, startTraceExportLoop } from "@openai/agents";
|
|
6
|
+
import { Agent, BatchTraceProcessor, addTraceProcessor, getOrCreateTrace, handoff, retryPolicies, run, startTraceExportLoop, tool } from "@openai/agents";
|
|
7
|
+
//#region src/providers/openai/agents-model-settings.ts
|
|
8
|
+
function resolveModelSettings(modelSettings) {
|
|
9
|
+
if (!modelSettings) return;
|
|
10
|
+
const retry = modelSettings.retry ? {
|
|
11
|
+
...modelSettings.retry,
|
|
12
|
+
policy: resolveRetryPolicy(modelSettings.retry.policy)
|
|
13
|
+
} : void 0;
|
|
14
|
+
return {
|
|
15
|
+
...modelSettings,
|
|
16
|
+
retry
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function resolveRetryPolicy(policy) {
|
|
20
|
+
if (!policy) return;
|
|
21
|
+
if (typeof policy === "function") return policy;
|
|
22
|
+
if (typeof policy === "string") switch (policy) {
|
|
23
|
+
case "never": return retryPolicies.never();
|
|
24
|
+
case "providerSuggested": return retryPolicies.providerSuggested();
|
|
25
|
+
case "networkError": return retryPolicies.networkError();
|
|
26
|
+
case "retryAfter": return retryPolicies.retryAfter();
|
|
27
|
+
default: return;
|
|
28
|
+
}
|
|
29
|
+
if ("httpStatus" in policy) return retryPolicies.httpStatus(policy.httpStatus);
|
|
30
|
+
if ("any" in policy) {
|
|
31
|
+
const policies = policy.any.map((nestedPolicy) => resolveRetryPolicy(nestedPolicy)).filter((nestedPolicy) => !!nestedPolicy);
|
|
32
|
+
return policies.length ? retryPolicies.any(...policies) : void 0;
|
|
33
|
+
}
|
|
34
|
+
if ("all" in policy) {
|
|
35
|
+
const policies = policy.all.map((nestedPolicy) => resolveRetryPolicy(nestedPolicy)).filter((nestedPolicy) => !!nestedPolicy);
|
|
36
|
+
return policies.length ? retryPolicies.all(...policies) : void 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
7
40
|
//#region src/providers/openai/agents-loader.ts
|
|
8
41
|
/**
|
|
9
42
|
* Load agent definition from file path or return inline definition
|
|
@@ -28,6 +61,82 @@ async function loadAgentDefinition(agentConfig) {
|
|
|
28
61
|
throw new Error("Invalid agent configuration: expected Agent instance, file:// URL, or inline definition");
|
|
29
62
|
}
|
|
30
63
|
/**
|
|
64
|
+
* Load tools from file path or return inline definitions
|
|
65
|
+
*/
|
|
66
|
+
async function loadTools(toolsConfig) {
|
|
67
|
+
if (!toolsConfig) return;
|
|
68
|
+
if (typeof toolsConfig === "string" && toolsConfig.startsWith("file://")) {
|
|
69
|
+
logger.debug("[AgentsLoader] Loading tools from file", { path: toolsConfig });
|
|
70
|
+
return await loadToolsFromFile(toolsConfig);
|
|
71
|
+
}
|
|
72
|
+
if (Array.isArray(toolsConfig)) {
|
|
73
|
+
logger.debug("[AgentsLoader] Using inline tool definitions");
|
|
74
|
+
return normalizeTools(toolsConfig);
|
|
75
|
+
}
|
|
76
|
+
logger.debug("[AgentsLoader] Invalid tools configuration", {
|
|
77
|
+
type: typeof toolsConfig,
|
|
78
|
+
isArray: Array.isArray(toolsConfig)
|
|
79
|
+
});
|
|
80
|
+
throw new Error("Invalid tools configuration: expected file:// URL or array");
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Load handoffs from file path or return inline definitions
|
|
84
|
+
*/
|
|
85
|
+
async function loadHandoffs(handoffsConfig) {
|
|
86
|
+
if (!handoffsConfig) return;
|
|
87
|
+
if (typeof handoffsConfig === "string" && handoffsConfig.startsWith("file://")) {
|
|
88
|
+
logger.debug("[AgentsLoader] Loading handoffs from file", { path: handoffsConfig });
|
|
89
|
+
return await loadHandoffsFromFile(handoffsConfig);
|
|
90
|
+
}
|
|
91
|
+
if (Array.isArray(handoffsConfig)) {
|
|
92
|
+
logger.debug("[AgentsLoader] Using inline handoff definitions");
|
|
93
|
+
return normalizeHandoffs(handoffsConfig);
|
|
94
|
+
}
|
|
95
|
+
logger.debug("[AgentsLoader] Invalid handoffs configuration", {
|
|
96
|
+
type: typeof handoffsConfig,
|
|
97
|
+
isArray: Array.isArray(handoffsConfig)
|
|
98
|
+
});
|
|
99
|
+
throw new Error("Invalid handoffs configuration: expected file:// URL or array");
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Load input guardrails from file path or return inline definitions
|
|
103
|
+
*/
|
|
104
|
+
async function loadInputGuardrails(guardrailsConfig) {
|
|
105
|
+
if (!guardrailsConfig) return;
|
|
106
|
+
if (typeof guardrailsConfig === "string" && guardrailsConfig.startsWith("file://")) {
|
|
107
|
+
logger.debug("[AgentsLoader] Loading input guardrails from file", { path: guardrailsConfig });
|
|
108
|
+
return await loadArrayFromFile(guardrailsConfig, "input guardrails");
|
|
109
|
+
}
|
|
110
|
+
if (Array.isArray(guardrailsConfig)) {
|
|
111
|
+
logger.debug("[AgentsLoader] Using inline input guardrails");
|
|
112
|
+
return guardrailsConfig;
|
|
113
|
+
}
|
|
114
|
+
logger.debug("[AgentsLoader] Invalid input guardrails configuration", {
|
|
115
|
+
type: typeof guardrailsConfig,
|
|
116
|
+
isArray: Array.isArray(guardrailsConfig)
|
|
117
|
+
});
|
|
118
|
+
throw new Error("Invalid input guardrails configuration: expected file:// URL or array");
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Load output guardrails from file path or return inline definitions
|
|
122
|
+
*/
|
|
123
|
+
async function loadOutputGuardrails(guardrailsConfig) {
|
|
124
|
+
if (!guardrailsConfig) return;
|
|
125
|
+
if (typeof guardrailsConfig === "string" && guardrailsConfig.startsWith("file://")) {
|
|
126
|
+
logger.debug("[AgentsLoader] Loading output guardrails from file", { path: guardrailsConfig });
|
|
127
|
+
return await loadArrayFromFile(guardrailsConfig, "output guardrails");
|
|
128
|
+
}
|
|
129
|
+
if (Array.isArray(guardrailsConfig)) {
|
|
130
|
+
logger.debug("[AgentsLoader] Using inline output guardrails");
|
|
131
|
+
return guardrailsConfig;
|
|
132
|
+
}
|
|
133
|
+
logger.debug("[AgentsLoader] Invalid output guardrails configuration", {
|
|
134
|
+
type: typeof guardrailsConfig,
|
|
135
|
+
isArray: Array.isArray(guardrailsConfig)
|
|
136
|
+
});
|
|
137
|
+
throw new Error("Invalid output guardrails configuration: expected file:// URL or array");
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
31
140
|
* Load agent from file
|
|
32
141
|
*/
|
|
33
142
|
async function loadAgentFromFile(filePath) {
|
|
@@ -47,19 +156,39 @@ async function loadAgentFromFile(filePath) {
|
|
|
47
156
|
}
|
|
48
157
|
}
|
|
49
158
|
/**
|
|
159
|
+
* Load tools from file
|
|
160
|
+
*/
|
|
161
|
+
async function loadToolsFromFile(filePath) {
|
|
162
|
+
return await normalizeTools(await loadArrayFromFile(filePath, "tools")) ?? [];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Load handoffs from file
|
|
166
|
+
*/
|
|
167
|
+
async function loadHandoffsFromFile(filePath) {
|
|
168
|
+
return await normalizeHandoffs(await loadArrayFromFile(filePath, "handoffs")) ?? [];
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
50
171
|
* Create an Agent instance from an inline definition
|
|
51
172
|
*/
|
|
52
173
|
async function createAgentFromDefinition(definition) {
|
|
53
174
|
try {
|
|
54
|
-
const
|
|
175
|
+
const tools = await normalizeTools(definition.tools);
|
|
176
|
+
const handoffs = await normalizeHandoffs(definition.handoffs);
|
|
55
177
|
return new Agent({
|
|
56
178
|
name: definition.name,
|
|
57
179
|
instructions: definition.instructions,
|
|
180
|
+
prompt: definition.prompt,
|
|
58
181
|
model: definition.model,
|
|
182
|
+
modelSettings: resolveModelSettings(definition.modelSettings),
|
|
59
183
|
handoffDescription: definition.handoffDescription,
|
|
60
184
|
outputType: definition.outputType,
|
|
61
|
-
tools
|
|
62
|
-
handoffs
|
|
185
|
+
tools,
|
|
186
|
+
handoffs,
|
|
187
|
+
inputGuardrails: definition.inputGuardrails,
|
|
188
|
+
outputGuardrails: definition.outputGuardrails,
|
|
189
|
+
mcpServers: definition.mcpServers,
|
|
190
|
+
toolUseBehavior: definition.toolUseBehavior,
|
|
191
|
+
resetToolChoice: definition.resetToolChoice
|
|
63
192
|
});
|
|
64
193
|
} catch (error) {
|
|
65
194
|
logger.error("[AgentsLoader] Failed to create agent from definition", {
|
|
@@ -76,7 +205,52 @@ async function createAgentFromDefinition(definition) {
|
|
|
76
205
|
* Check if a value is an Agent instance
|
|
77
206
|
*/
|
|
78
207
|
function isAgentInstance(value) {
|
|
79
|
-
return value
|
|
208
|
+
return value instanceof Agent;
|
|
209
|
+
}
|
|
210
|
+
function isToolInstance(value) {
|
|
211
|
+
return !!value && typeof value === "object" && "type" in value && typeof value.type === "string";
|
|
212
|
+
}
|
|
213
|
+
function isHandoffInstance(value) {
|
|
214
|
+
return !!value && typeof value === "object" && "agent" in value && "getHandoffAsFunctionTool" in value && typeof value.getHandoffAsFunctionTool === "function";
|
|
215
|
+
}
|
|
216
|
+
async function normalizeTools(definitions) {
|
|
217
|
+
if (!definitions?.length) return;
|
|
218
|
+
return definitions.map((definition) => {
|
|
219
|
+
if (isToolInstance(definition)) return definition;
|
|
220
|
+
return tool({
|
|
221
|
+
name: definition.name,
|
|
222
|
+
description: definition.description,
|
|
223
|
+
parameters: definition.parameters,
|
|
224
|
+
strict: definition.strict ?? true,
|
|
225
|
+
deferLoading: definition.deferLoading,
|
|
226
|
+
execute: typeof definition.execute === "function" ? definition.execute : async () => definition.execute
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
async function normalizeHandoffs(definitions) {
|
|
231
|
+
if (!definitions?.length) return;
|
|
232
|
+
return Promise.all(definitions.map(async (definition) => {
|
|
233
|
+
if (isAgentInstance(definition) || isHandoffInstance(definition)) return definition;
|
|
234
|
+
const agent = await loadAgentDefinition(definition.agent);
|
|
235
|
+
if (!definition.description) return agent;
|
|
236
|
+
return handoff(agent, { toolDescriptionOverride: definition.description });
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
async function loadArrayFromFile(filePath, label) {
|
|
240
|
+
const resolvedPath = resolveFilePath(filePath);
|
|
241
|
+
logger.debug(`[AgentsLoader] Loading ${label} from resolved path`, { path: resolvedPath });
|
|
242
|
+
try {
|
|
243
|
+
const module = await importModule(resolvedPath);
|
|
244
|
+
const exported = module.default || module;
|
|
245
|
+
if (!Array.isArray(exported)) throw new Error(`File ${resolvedPath} does not export an array of ${label}`);
|
|
246
|
+
return exported;
|
|
247
|
+
} catch (error) {
|
|
248
|
+
logger.error(`[AgentsLoader] Failed to load ${label} from file`, {
|
|
249
|
+
path: resolvedPath,
|
|
250
|
+
error
|
|
251
|
+
});
|
|
252
|
+
throw new Error(`Failed to load ${label} from ${resolvedPath}: ${error}`);
|
|
253
|
+
}
|
|
80
254
|
}
|
|
81
255
|
/**
|
|
82
256
|
* Resolve file:// path to absolute file system path
|
|
@@ -328,8 +502,27 @@ var OpenAiAgentsProvider = class extends OpenAiGenericProvider {
|
|
|
328
502
|
if (!this.agentConfig.agent) throw new Error("No agent configuration provided");
|
|
329
503
|
try {
|
|
330
504
|
const agent = await loadAgentDefinition(this.agentConfig.agent);
|
|
331
|
-
|
|
332
|
-
|
|
505
|
+
const [tools, handoffs, inputGuardrails, outputGuardrails] = await Promise.all([
|
|
506
|
+
loadTools(this.agentConfig.tools),
|
|
507
|
+
loadHandoffs(this.agentConfig.handoffs),
|
|
508
|
+
loadInputGuardrails(this.agentConfig.inputGuardrails),
|
|
509
|
+
loadOutputGuardrails(this.agentConfig.outputGuardrails)
|
|
510
|
+
]);
|
|
511
|
+
const configuredAgent = agent.clone({
|
|
512
|
+
tools: mergeArrays(agent.tools, tools),
|
|
513
|
+
handoffs: mergeArrays(agent.handoffs, handoffs),
|
|
514
|
+
inputGuardrails: mergeArrays(agent.inputGuardrails, inputGuardrails),
|
|
515
|
+
outputGuardrails: mergeArrays(agent.outputGuardrails, outputGuardrails)
|
|
516
|
+
});
|
|
517
|
+
const mockAwareAgent = this.wrapToolsIfNeeded(configuredAgent);
|
|
518
|
+
logger.debug("[AgentsProvider] Agent initialized successfully", {
|
|
519
|
+
name: mockAwareAgent.name,
|
|
520
|
+
toolCount: mockAwareAgent.tools.length,
|
|
521
|
+
handoffCount: mockAwareAgent.handoffs.length,
|
|
522
|
+
inputGuardrailCount: mockAwareAgent.inputGuardrails.length,
|
|
523
|
+
outputGuardrailCount: mockAwareAgent.outputGuardrails.length
|
|
524
|
+
});
|
|
525
|
+
return mockAwareAgent;
|
|
333
526
|
} catch (error) {
|
|
334
527
|
logger.error("[AgentsProvider] Failed to initialize agent", { error });
|
|
335
528
|
throw new Error(`Failed to initialize agent: ${error}`);
|
|
@@ -388,7 +581,7 @@ var OpenAiAgentsProvider = class extends OpenAiGenericProvider {
|
|
|
388
581
|
signal: callApiOptions?.abortSignal
|
|
389
582
|
};
|
|
390
583
|
if (this.agentConfig.model || this.modelName) runOptions.model = this.agentConfig.model || this.modelName;
|
|
391
|
-
if (this.agentConfig.modelSettings) runOptions.modelSettings = this.agentConfig.modelSettings;
|
|
584
|
+
if (this.agentConfig.modelSettings) runOptions.modelSettings = resolveModelSettings(this.agentConfig.modelSettings);
|
|
392
585
|
const result = await getOrCreateTrace(async () => {
|
|
393
586
|
return await run(this.agent, prompt, runOptions);
|
|
394
587
|
});
|
|
@@ -423,8 +616,28 @@ var OpenAiAgentsProvider = class extends OpenAiGenericProvider {
|
|
|
423
616
|
* Calculate cost from agent result
|
|
424
617
|
*/
|
|
425
618
|
calculateCost(_result) {}
|
|
619
|
+
wrapToolsIfNeeded(agent) {
|
|
620
|
+
if (this.agentConfig.executeTools !== false && this.agentConfig.executeTools !== "mock") return agent;
|
|
621
|
+
const toolMocks = this.agentConfig.toolMocks ?? {};
|
|
622
|
+
const tools = agent.tools.map((tool) => {
|
|
623
|
+
if (tool.type !== "function") return tool;
|
|
624
|
+
const mockValue = toolMocks[tool.name];
|
|
625
|
+
return {
|
|
626
|
+
...tool,
|
|
627
|
+
invoke: async () => mockValue ?? {
|
|
628
|
+
mocked: true,
|
|
629
|
+
tool: tool.name
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
});
|
|
633
|
+
return agent.clone({ tools });
|
|
634
|
+
}
|
|
426
635
|
};
|
|
636
|
+
function mergeArrays(existing, additions) {
|
|
637
|
+
if (!existing?.length && !additions?.length) return;
|
|
638
|
+
return [...existing ?? [], ...additions ?? []];
|
|
639
|
+
}
|
|
427
640
|
//#endregion
|
|
428
641
|
export { OpenAiAgentsProvider };
|
|
429
642
|
|
|
430
|
-
//# sourceMappingURL=agents-
|
|
643
|
+
//# sourceMappingURL=agents-BBVJCIYr.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_logger = require("./logger-
|
|
2
|
-
require("./fetch-
|
|
3
|
-
const require_cache = require("./cache-
|
|
4
|
-
require("./accounts-
|
|
5
|
-
const require_telemetry = require("./telemetry-
|
|
6
|
-
const require_base = require("./base-
|
|
1
|
+
const require_logger = require("./logger-D5iKBpu_.cjs");
|
|
2
|
+
require("./fetch-BnR9wSnm.cjs");
|
|
3
|
+
const require_cache = require("./cache-C5yFZ4gC.cjs");
|
|
4
|
+
require("./accounts-BPyfpSeU.cjs");
|
|
5
|
+
const require_telemetry = require("./telemetry-re627Lre.cjs");
|
|
6
|
+
const require_base = require("./base-BboXIF_0.cjs");
|
|
7
7
|
//#region src/providers/bedrock/agents.ts
|
|
8
8
|
/**
|
|
9
9
|
* AWS Bedrock Agents provider for invoking deployed AI agents.
|
|
@@ -230,4 +230,4 @@ var AwsBedrockAgentsProvider = class extends require_base.AwsBedrockGenericProvi
|
|
|
230
230
|
//#endregion
|
|
231
231
|
exports.AwsBedrockAgentsProvider = AwsBedrockAgentsProvider;
|
|
232
232
|
|
|
233
|
-
//# sourceMappingURL=agents-
|
|
233
|
+
//# sourceMappingURL=agents-BBWxKSM0.cjs.map
|
|
@@ -1,9 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { j as state, s as logger } from "./logger-BcJBzSSA.js";
|
|
3
|
+
import { n as fetchWithProxy } from "./fetch-DoVRJZhJ.js";
|
|
4
|
+
import "./cloud-z8KZpUoa.js";
|
|
5
|
+
import { r as importModule } from "./esm-7UIl0pPM.js";
|
|
6
|
+
import { t as OpenAiGenericProvider } from "./openai-BMcwgD5C.js";
|
|
5
7
|
import path from "path";
|
|
6
|
-
import { BatchTraceProcessor, addTraceProcessor, getOrCreateTrace, run, startTraceExportLoop } from "@openai/agents";
|
|
8
|
+
import { Agent, BatchTraceProcessor, addTraceProcessor, getOrCreateTrace, handoff, retryPolicies, run, startTraceExportLoop, tool } from "@openai/agents";
|
|
9
|
+
//#region src/providers/openai/agents-model-settings.ts
|
|
10
|
+
function resolveModelSettings(modelSettings) {
|
|
11
|
+
if (!modelSettings) return;
|
|
12
|
+
const retry = modelSettings.retry ? {
|
|
13
|
+
...modelSettings.retry,
|
|
14
|
+
policy: resolveRetryPolicy(modelSettings.retry.policy)
|
|
15
|
+
} : void 0;
|
|
16
|
+
return {
|
|
17
|
+
...modelSettings,
|
|
18
|
+
retry
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function resolveRetryPolicy(policy) {
|
|
22
|
+
if (!policy) return;
|
|
23
|
+
if (typeof policy === "function") return policy;
|
|
24
|
+
if (typeof policy === "string") switch (policy) {
|
|
25
|
+
case "never": return retryPolicies.never();
|
|
26
|
+
case "providerSuggested": return retryPolicies.providerSuggested();
|
|
27
|
+
case "networkError": return retryPolicies.networkError();
|
|
28
|
+
case "retryAfter": return retryPolicies.retryAfter();
|
|
29
|
+
default: return;
|
|
30
|
+
}
|
|
31
|
+
if ("httpStatus" in policy) return retryPolicies.httpStatus(policy.httpStatus);
|
|
32
|
+
if ("any" in policy) {
|
|
33
|
+
const policies = policy.any.map((nestedPolicy) => resolveRetryPolicy(nestedPolicy)).filter((nestedPolicy) => !!nestedPolicy);
|
|
34
|
+
return policies.length ? retryPolicies.any(...policies) : void 0;
|
|
35
|
+
}
|
|
36
|
+
if ("all" in policy) {
|
|
37
|
+
const policies = policy.all.map((nestedPolicy) => resolveRetryPolicy(nestedPolicy)).filter((nestedPolicy) => !!nestedPolicy);
|
|
38
|
+
return policies.length ? retryPolicies.all(...policies) : void 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
7
42
|
//#region src/providers/openai/agents-loader.ts
|
|
8
43
|
/**
|
|
9
44
|
* Load agent definition from file path or return inline definition
|
|
@@ -28,6 +63,82 @@ async function loadAgentDefinition(agentConfig) {
|
|
|
28
63
|
throw new Error("Invalid agent configuration: expected Agent instance, file:// URL, or inline definition");
|
|
29
64
|
}
|
|
30
65
|
/**
|
|
66
|
+
* Load tools from file path or return inline definitions
|
|
67
|
+
*/
|
|
68
|
+
async function loadTools(toolsConfig) {
|
|
69
|
+
if (!toolsConfig) return;
|
|
70
|
+
if (typeof toolsConfig === "string" && toolsConfig.startsWith("file://")) {
|
|
71
|
+
logger.debug("[AgentsLoader] Loading tools from file", { path: toolsConfig });
|
|
72
|
+
return await loadToolsFromFile(toolsConfig);
|
|
73
|
+
}
|
|
74
|
+
if (Array.isArray(toolsConfig)) {
|
|
75
|
+
logger.debug("[AgentsLoader] Using inline tool definitions");
|
|
76
|
+
return normalizeTools(toolsConfig);
|
|
77
|
+
}
|
|
78
|
+
logger.debug("[AgentsLoader] Invalid tools configuration", {
|
|
79
|
+
type: typeof toolsConfig,
|
|
80
|
+
isArray: Array.isArray(toolsConfig)
|
|
81
|
+
});
|
|
82
|
+
throw new Error("Invalid tools configuration: expected file:// URL or array");
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Load handoffs from file path or return inline definitions
|
|
86
|
+
*/
|
|
87
|
+
async function loadHandoffs(handoffsConfig) {
|
|
88
|
+
if (!handoffsConfig) return;
|
|
89
|
+
if (typeof handoffsConfig === "string" && handoffsConfig.startsWith("file://")) {
|
|
90
|
+
logger.debug("[AgentsLoader] Loading handoffs from file", { path: handoffsConfig });
|
|
91
|
+
return await loadHandoffsFromFile(handoffsConfig);
|
|
92
|
+
}
|
|
93
|
+
if (Array.isArray(handoffsConfig)) {
|
|
94
|
+
logger.debug("[AgentsLoader] Using inline handoff definitions");
|
|
95
|
+
return normalizeHandoffs(handoffsConfig);
|
|
96
|
+
}
|
|
97
|
+
logger.debug("[AgentsLoader] Invalid handoffs configuration", {
|
|
98
|
+
type: typeof handoffsConfig,
|
|
99
|
+
isArray: Array.isArray(handoffsConfig)
|
|
100
|
+
});
|
|
101
|
+
throw new Error("Invalid handoffs configuration: expected file:// URL or array");
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Load input guardrails from file path or return inline definitions
|
|
105
|
+
*/
|
|
106
|
+
async function loadInputGuardrails(guardrailsConfig) {
|
|
107
|
+
if (!guardrailsConfig) return;
|
|
108
|
+
if (typeof guardrailsConfig === "string" && guardrailsConfig.startsWith("file://")) {
|
|
109
|
+
logger.debug("[AgentsLoader] Loading input guardrails from file", { path: guardrailsConfig });
|
|
110
|
+
return await loadArrayFromFile(guardrailsConfig, "input guardrails");
|
|
111
|
+
}
|
|
112
|
+
if (Array.isArray(guardrailsConfig)) {
|
|
113
|
+
logger.debug("[AgentsLoader] Using inline input guardrails");
|
|
114
|
+
return guardrailsConfig;
|
|
115
|
+
}
|
|
116
|
+
logger.debug("[AgentsLoader] Invalid input guardrails configuration", {
|
|
117
|
+
type: typeof guardrailsConfig,
|
|
118
|
+
isArray: Array.isArray(guardrailsConfig)
|
|
119
|
+
});
|
|
120
|
+
throw new Error("Invalid input guardrails configuration: expected file:// URL or array");
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Load output guardrails from file path or return inline definitions
|
|
124
|
+
*/
|
|
125
|
+
async function loadOutputGuardrails(guardrailsConfig) {
|
|
126
|
+
if (!guardrailsConfig) return;
|
|
127
|
+
if (typeof guardrailsConfig === "string" && guardrailsConfig.startsWith("file://")) {
|
|
128
|
+
logger.debug("[AgentsLoader] Loading output guardrails from file", { path: guardrailsConfig });
|
|
129
|
+
return await loadArrayFromFile(guardrailsConfig, "output guardrails");
|
|
130
|
+
}
|
|
131
|
+
if (Array.isArray(guardrailsConfig)) {
|
|
132
|
+
logger.debug("[AgentsLoader] Using inline output guardrails");
|
|
133
|
+
return guardrailsConfig;
|
|
134
|
+
}
|
|
135
|
+
logger.debug("[AgentsLoader] Invalid output guardrails configuration", {
|
|
136
|
+
type: typeof guardrailsConfig,
|
|
137
|
+
isArray: Array.isArray(guardrailsConfig)
|
|
138
|
+
});
|
|
139
|
+
throw new Error("Invalid output guardrails configuration: expected file:// URL or array");
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
31
142
|
* Load agent from file
|
|
32
143
|
*/
|
|
33
144
|
async function loadAgentFromFile(filePath) {
|
|
@@ -47,19 +158,39 @@ async function loadAgentFromFile(filePath) {
|
|
|
47
158
|
}
|
|
48
159
|
}
|
|
49
160
|
/**
|
|
161
|
+
* Load tools from file
|
|
162
|
+
*/
|
|
163
|
+
async function loadToolsFromFile(filePath) {
|
|
164
|
+
return await normalizeTools(await loadArrayFromFile(filePath, "tools")) ?? [];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Load handoffs from file
|
|
168
|
+
*/
|
|
169
|
+
async function loadHandoffsFromFile(filePath) {
|
|
170
|
+
return await normalizeHandoffs(await loadArrayFromFile(filePath, "handoffs")) ?? [];
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
50
173
|
* Create an Agent instance from an inline definition
|
|
51
174
|
*/
|
|
52
175
|
async function createAgentFromDefinition(definition) {
|
|
53
176
|
try {
|
|
54
|
-
const
|
|
177
|
+
const tools = await normalizeTools(definition.tools);
|
|
178
|
+
const handoffs = await normalizeHandoffs(definition.handoffs);
|
|
55
179
|
return new Agent({
|
|
56
180
|
name: definition.name,
|
|
57
181
|
instructions: definition.instructions,
|
|
182
|
+
prompt: definition.prompt,
|
|
58
183
|
model: definition.model,
|
|
184
|
+
modelSettings: resolveModelSettings(definition.modelSettings),
|
|
59
185
|
handoffDescription: definition.handoffDescription,
|
|
60
186
|
outputType: definition.outputType,
|
|
61
|
-
tools
|
|
62
|
-
handoffs
|
|
187
|
+
tools,
|
|
188
|
+
handoffs,
|
|
189
|
+
inputGuardrails: definition.inputGuardrails,
|
|
190
|
+
outputGuardrails: definition.outputGuardrails,
|
|
191
|
+
mcpServers: definition.mcpServers,
|
|
192
|
+
toolUseBehavior: definition.toolUseBehavior,
|
|
193
|
+
resetToolChoice: definition.resetToolChoice
|
|
63
194
|
});
|
|
64
195
|
} catch (error) {
|
|
65
196
|
logger.error("[AgentsLoader] Failed to create agent from definition", {
|
|
@@ -76,7 +207,52 @@ async function createAgentFromDefinition(definition) {
|
|
|
76
207
|
* Check if a value is an Agent instance
|
|
77
208
|
*/
|
|
78
209
|
function isAgentInstance(value) {
|
|
79
|
-
return value
|
|
210
|
+
return value instanceof Agent;
|
|
211
|
+
}
|
|
212
|
+
function isToolInstance(value) {
|
|
213
|
+
return !!value && typeof value === "object" && "type" in value && typeof value.type === "string";
|
|
214
|
+
}
|
|
215
|
+
function isHandoffInstance(value) {
|
|
216
|
+
return !!value && typeof value === "object" && "agent" in value && "getHandoffAsFunctionTool" in value && typeof value.getHandoffAsFunctionTool === "function";
|
|
217
|
+
}
|
|
218
|
+
async function normalizeTools(definitions) {
|
|
219
|
+
if (!definitions?.length) return;
|
|
220
|
+
return definitions.map((definition) => {
|
|
221
|
+
if (isToolInstance(definition)) return definition;
|
|
222
|
+
return tool({
|
|
223
|
+
name: definition.name,
|
|
224
|
+
description: definition.description,
|
|
225
|
+
parameters: definition.parameters,
|
|
226
|
+
strict: definition.strict ?? true,
|
|
227
|
+
deferLoading: definition.deferLoading,
|
|
228
|
+
execute: typeof definition.execute === "function" ? definition.execute : async () => definition.execute
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
async function normalizeHandoffs(definitions) {
|
|
233
|
+
if (!definitions?.length) return;
|
|
234
|
+
return Promise.all(definitions.map(async (definition) => {
|
|
235
|
+
if (isAgentInstance(definition) || isHandoffInstance(definition)) return definition;
|
|
236
|
+
const agent = await loadAgentDefinition(definition.agent);
|
|
237
|
+
if (!definition.description) return agent;
|
|
238
|
+
return handoff(agent, { toolDescriptionOverride: definition.description });
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
241
|
+
async function loadArrayFromFile(filePath, label) {
|
|
242
|
+
const resolvedPath = resolveFilePath(filePath);
|
|
243
|
+
logger.debug(`[AgentsLoader] Loading ${label} from resolved path`, { path: resolvedPath });
|
|
244
|
+
try {
|
|
245
|
+
const module = await importModule(resolvedPath);
|
|
246
|
+
const exported = module.default || module;
|
|
247
|
+
if (!Array.isArray(exported)) throw new Error(`File ${resolvedPath} does not export an array of ${label}`);
|
|
248
|
+
return exported;
|
|
249
|
+
} catch (error) {
|
|
250
|
+
logger.error(`[AgentsLoader] Failed to load ${label} from file`, {
|
|
251
|
+
path: resolvedPath,
|
|
252
|
+
error
|
|
253
|
+
});
|
|
254
|
+
throw new Error(`Failed to load ${label} from ${resolvedPath}: ${error}`);
|
|
255
|
+
}
|
|
80
256
|
}
|
|
81
257
|
/**
|
|
82
258
|
* Resolve file:// path to absolute file system path
|
|
@@ -328,8 +504,27 @@ var OpenAiAgentsProvider = class extends OpenAiGenericProvider {
|
|
|
328
504
|
if (!this.agentConfig.agent) throw new Error("No agent configuration provided");
|
|
329
505
|
try {
|
|
330
506
|
const agent = await loadAgentDefinition(this.agentConfig.agent);
|
|
331
|
-
|
|
332
|
-
|
|
507
|
+
const [tools, handoffs, inputGuardrails, outputGuardrails] = await Promise.all([
|
|
508
|
+
loadTools(this.agentConfig.tools),
|
|
509
|
+
loadHandoffs(this.agentConfig.handoffs),
|
|
510
|
+
loadInputGuardrails(this.agentConfig.inputGuardrails),
|
|
511
|
+
loadOutputGuardrails(this.agentConfig.outputGuardrails)
|
|
512
|
+
]);
|
|
513
|
+
const configuredAgent = agent.clone({
|
|
514
|
+
tools: mergeArrays(agent.tools, tools),
|
|
515
|
+
handoffs: mergeArrays(agent.handoffs, handoffs),
|
|
516
|
+
inputGuardrails: mergeArrays(agent.inputGuardrails, inputGuardrails),
|
|
517
|
+
outputGuardrails: mergeArrays(agent.outputGuardrails, outputGuardrails)
|
|
518
|
+
});
|
|
519
|
+
const mockAwareAgent = this.wrapToolsIfNeeded(configuredAgent);
|
|
520
|
+
logger.debug("[AgentsProvider] Agent initialized successfully", {
|
|
521
|
+
name: mockAwareAgent.name,
|
|
522
|
+
toolCount: mockAwareAgent.tools.length,
|
|
523
|
+
handoffCount: mockAwareAgent.handoffs.length,
|
|
524
|
+
inputGuardrailCount: mockAwareAgent.inputGuardrails.length,
|
|
525
|
+
outputGuardrailCount: mockAwareAgent.outputGuardrails.length
|
|
526
|
+
});
|
|
527
|
+
return mockAwareAgent;
|
|
333
528
|
} catch (error) {
|
|
334
529
|
logger.error("[AgentsProvider] Failed to initialize agent", { error });
|
|
335
530
|
throw new Error(`Failed to initialize agent: ${error}`);
|
|
@@ -388,7 +583,7 @@ var OpenAiAgentsProvider = class extends OpenAiGenericProvider {
|
|
|
388
583
|
signal: callApiOptions?.abortSignal
|
|
389
584
|
};
|
|
390
585
|
if (this.agentConfig.model || this.modelName) runOptions.model = this.agentConfig.model || this.modelName;
|
|
391
|
-
if (this.agentConfig.modelSettings) runOptions.modelSettings = this.agentConfig.modelSettings;
|
|
586
|
+
if (this.agentConfig.modelSettings) runOptions.modelSettings = resolveModelSettings(this.agentConfig.modelSettings);
|
|
392
587
|
const result = await getOrCreateTrace(async () => {
|
|
393
588
|
return await run(this.agent, prompt, runOptions);
|
|
394
589
|
});
|
|
@@ -423,8 +618,28 @@ var OpenAiAgentsProvider = class extends OpenAiGenericProvider {
|
|
|
423
618
|
* Calculate cost from agent result
|
|
424
619
|
*/
|
|
425
620
|
calculateCost(_result) {}
|
|
621
|
+
wrapToolsIfNeeded(agent) {
|
|
622
|
+
if (this.agentConfig.executeTools !== false && this.agentConfig.executeTools !== "mock") return agent;
|
|
623
|
+
const toolMocks = this.agentConfig.toolMocks ?? {};
|
|
624
|
+
const tools = agent.tools.map((tool) => {
|
|
625
|
+
if (tool.type !== "function") return tool;
|
|
626
|
+
const mockValue = toolMocks[tool.name];
|
|
627
|
+
return {
|
|
628
|
+
...tool,
|
|
629
|
+
invoke: async () => mockValue ?? {
|
|
630
|
+
mocked: true,
|
|
631
|
+
tool: tool.name
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
});
|
|
635
|
+
return agent.clone({ tools });
|
|
636
|
+
}
|
|
426
637
|
};
|
|
638
|
+
function mergeArrays(existing, additions) {
|
|
639
|
+
if (!existing?.length && !additions?.length) return;
|
|
640
|
+
return [...existing ?? [], ...additions ?? []];
|
|
641
|
+
}
|
|
427
642
|
//#endregion
|
|
428
643
|
export { OpenAiAgentsProvider };
|
|
429
644
|
|
|
430
|
-
//# sourceMappingURL=agents-
|
|
645
|
+
//# sourceMappingURL=agents-Bqgfdokm.js.map
|