promptfoo 0.120.24 → 0.120.26
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 +35 -22
- package/dist/src/{ListApp-55OAHww3.js → ListApp-D3DG0F8h.js} +1 -1
- package/dist/src/{accounts-BwVGYllP.cjs → accounts-BzEY8H3v.cjs} +5 -5
- package/dist/src/{accounts-BOlMHrvn.js → accounts-DHHiXsy6.js} +6 -6
- package/dist/src/{accounts-DxR9x_En.js → accounts-R3gfCR_g.js} +5 -5
- package/dist/src/{agentic-utils-t9-1raty.js → agentic-utils-D6_gzOUF.js} +3 -3
- package/dist/src/{agents-DMpQ860j.cjs → agents-C7BiinFI.cjs} +7 -7
- package/dist/src/{agents-9Z7pO8yx.js → agents-Cao4i7AX.js} +8 -8
- package/dist/src/{agents-DjExVR3v.js → agents-Cnph5GLD.js} +2 -2
- package/dist/src/{agents-CI0Ad69d.cjs → agents-CwM7re15.cjs} +5 -5
- package/dist/src/{agents-BwI-Tm5m.js → agents-DETIQHqF.js} +7 -7
- package/dist/src/{agents-CRAmwjo-.js → agents-DYIT-hQy.js} +6 -6
- package/dist/src/{agents-BbIpDhgp.js → agents-GiUianme.js} +5 -5
- package/dist/src/{agents-yL5DzIKY.js → agents-v4cW_ZgC.js} +2 -2
- package/dist/src/{aimlapi-xHHqwNg8.js → aimlapi-CMJpKK-B.js} +13 -13
- package/dist/src/{aimlapi-BM9P45Bp.js → aimlapi-DMF6v_vb.js} +15 -15
- package/dist/src/{aimlapi-DKo7IxJg.cjs → aimlapi-DoGLcQW_.cjs} +14 -14
- package/dist/src/{aimlapi-ivzDkqbs.js → aimlapi-DtSf1ykJ.js} +2 -2
- package/dist/src/app/assets/index-BOgkICuY.css +1 -0
- package/dist/src/app/assets/index-CSgqn_Vd.js +428 -0
- package/dist/src/app/assets/{vendor-charts-DnwydkkY.js → vendor-charts-CYyo8R8v.js} +1 -1
- package/dist/src/app/assets/{vendor-markdown-DjKAU15k.js → vendor-markdown-DSmzq4Jh.js} +1 -1
- package/dist/src/app/assets/vendor-react-AtKqiNEf.js +4 -0
- package/dist/src/app/assets/{vendor-syntax-Dc86c4Bu.js → vendor-syntax-D06x6TQF.js} +1 -1
- package/dist/src/app/index.html +6 -6
- package/dist/src/app/tsconfig.app.tsbuildinfo +1 -1
- package/dist/src/{audio-B3QGL6Nl.cjs → audio-BWjyvHn9.cjs} +4 -4
- package/dist/src/{audio-C-1oBiVZ.js → audio-BrJBFN2b.js} +4 -4
- package/dist/src/{audio-DnfDVjhL.js → audio-DUH4q0Xq.js} +5 -5
- package/dist/src/{audio-DQWHfAr8.js → audio-U580w8jM.js} +2 -2
- package/dist/src/{base-DHam07ip.js → base-BaXmtXYp.js} +3 -3
- package/dist/src/{base-BjsgxJp9.js → base-Dtp8b4_N.js} +3 -3
- package/dist/src/{base-Bso8ccGu.cjs → base-f71xxWai.cjs} +3 -3
- package/dist/src/{blobs-DOdc-E8L.cjs → blobs-673H0jCl.cjs} +3 -3
- package/dist/src/{blobs-Dcm272OH.js → blobs-C9J2mVgo.js} +3 -3
- package/dist/src/{blobs-MlVQyoSc.js → blobs-kt8v3UyH.js} +3 -3
- package/dist/src/{cache-KNsTJLKP.cjs → cache-7xULbvt3.cjs} +35 -8
- package/dist/src/{cache-BMl3AIo5.js → cache-BLLayYEN.js} +24 -9
- package/dist/src/{cache-B0ptF7sO.js → cache-BUPcq0Ad.js} +3 -3
- package/dist/src/cache-CVfRb-HD.cjs +6 -0
- package/dist/src/{cache-DPztwHxt.js → cache-O4EuX2JV.js} +4 -4
- package/dist/src/{cache-DHm8Pc8l.js → cache-mIszOnuz.js} +5 -22
- package/dist/src/{chat-DOQIJx7O.cjs → chat-C4zqjObh.cjs} +10 -10
- package/dist/src/{chat-DDGU7Tik.js → chat-C8Ei4f87.js} +9 -9
- package/dist/src/{chat-BnzIuoTQ.js → chat-CgyGj2hC.js} +12 -12
- package/dist/src/{chat-BRMJOuCv.js → chat-Cpz3O-Xl.js} +14 -14
- package/dist/src/{chat-CVOyOBYk.js → chat-DIywASPG.js} +11 -11
- package/dist/src/{chat-CrnXMbvh.cjs → chat-Fl6TZJRS.cjs} +13 -13
- package/dist/src/{chat-D8GcWK9l.js → chat-XPN9YHhr.js} +2 -2
- package/dist/src/{chatkit-IWIuhxFE.js → chatkit-DEls11hE.js} +4 -4
- package/dist/src/{chatkit-DlOZ-eNb.js → chatkit-DIrJX8xk.js} +4 -4
- package/dist/src/{chatkit-CcktkleS.js → chatkit-Dpxrq4eD.js} +2 -2
- package/dist/src/{chatkit-yeVtURUi.cjs → chatkit-e25Ziu17.cjs} +4 -4
- package/dist/src/{claude-agent-sdk-BiMgSH9g.js → claude-agent-sdk-6-xTaLwM.js} +48 -19
- package/dist/src/{claude-agent-sdk-Yj9Hq0cH.cjs → claude-agent-sdk-BzxF6NIJ.cjs} +48 -19
- package/dist/src/{claude-agent-sdk-rVqlUIJl.js → claude-agent-sdk-CmkTnKGH.js} +49 -20
- package/dist/src/{claude-agent-sdk-yid1kGsL.js → claude-agent-sdk-rXCBLK_o.js} +40 -11
- package/dist/src/{cloud-ByJVRSQI.js → cloud-BMbRVJFw.js} +3 -3
- package/dist/src/cloud-CZ4hytdm.js +5 -0
- package/dist/src/{cloudflare-ai-DmJZcvVx.cjs → cloudflare-ai-BAQ0u_dg.cjs} +14 -14
- package/dist/src/{cloudflare-ai-CWKYPCCF.js → cloudflare-ai-CUg4BTcj.js} +13 -13
- package/dist/src/{cloudflare-ai-goDJ5bwr.js → cloudflare-ai-CobxMTR4.js} +15 -15
- package/dist/src/{cloudflare-ai-CdKv38f6.js → cloudflare-ai-Z9X219gp.js} +2 -2
- package/dist/src/{cloudflare-gateway-BW8hcdB0.cjs → cloudflare-gateway-C0sgfr_z.cjs} +15 -15
- package/dist/src/{cloudflare-gateway-CDCOS1Os.js → cloudflare-gateway-D2_yi-Fh.js} +16 -16
- package/dist/src/{cloudflare-gateway-Dz_HCMGY.js → cloudflare-gateway-Djf3F3_H.js} +2 -2
- package/dist/src/{cloudflare-gateway-gzmTsXcd.js → cloudflare-gateway-_itGuXry.js} +14 -14
- package/dist/src/{codex-sdk-BlvhxMr0.js → codex-sdk-BASDNkIl.js} +90 -34
- package/dist/src/{codex-sdk-BC5qbCjh.js → codex-sdk-dSnGdgIp.js} +92 -36
- package/dist/src/{codex-sdk-CBpm53B8.js → codex-sdk-ibXwdglL.js} +91 -35
- package/dist/src/{codex-sdk-Cf5_CQch.cjs → codex-sdk-wTEpMM_X.cjs} +92 -36
- package/dist/src/{cometapi-DoaO5SLq.js → cometapi-B01btbfb.js} +16 -16
- package/dist/src/{cometapi-BUKGSUCw.js → cometapi-ChAaRjg5.js} +14 -14
- package/dist/src/{cometapi-C6BSw9k3.js → cometapi-DHUAH6nK.js} +2 -2
- package/dist/src/{cometapi-B3TzpkNI.cjs → cometapi-JbvOJSCO.cjs} +15 -15
- package/dist/src/{completion-BLe7SUA4.js → completion-BBJ6zmG3.js} +6 -6
- package/dist/src/{completion-1RAiLcwi.js → completion-D9_MDlnd.js} +6 -6
- package/dist/src/{completion-D6BTVt6e.cjs → completion-DDyL3Cb2.cjs} +6 -6
- package/dist/src/{docker-CkOzlD1W.js → docker-BuButc4D.js} +15 -15
- package/dist/src/{docker-BWsSX8Pn.cjs → docker-Ckw-j7Rr.cjs} +14 -14
- package/dist/src/{docker-CMf5SGLq.js → docker-JAAubMw3.js} +13 -13
- package/dist/src/{docker-C0AzMsuf.js → docker-vnOg96gi.js} +2 -2
- package/dist/src/errors-DnGCbnx8.js +36 -0
- package/dist/src/{esm-gWVPXn3r.cjs → esm-BQkx5roy.cjs} +2 -2
- package/dist/src/{esm-Lh6czAFT.js → esm-CYhseqj4.js} +2 -2
- package/dist/src/{esm-D40XsWlR.js → esm-rDtG_2rg.js} +2 -2
- package/dist/src/eval-CKHWqG9f.js +16 -0
- package/dist/src/{eval-WaSg64w3.js → eval-CYrbG57o.js} +106 -29
- package/dist/src/{evalResult-CGrGU_cG.js → evalResult-6JaUIStC.js} +7 -7
- package/dist/src/{evalResult-C_UM63nn.js → evalResult-COsVttMA.js} +7 -7
- package/dist/src/evalResult-CxTP-LMm.cjs +11 -0
- package/dist/src/evalResult-CzLURDcP.js +13 -0
- package/dist/src/{evalResult-BU4huold.cjs → evalResult-DlRfu_Rq.cjs} +7 -7
- package/dist/src/evalResult-DyttNQ_G.js +11 -0
- package/dist/src/evaluator-0PvfeBYh.js +38 -0
- package/dist/src/{evaluator-gmF3Vddp.js → evaluator-3EJCMTs0.js} +75 -49
- package/dist/src/{extractor-D-RM2m6A.cjs → extractor-DbhlYEeo.cjs} +23 -6
- package/dist/src/{extractor-Da8IxCeS.js → extractor-Hs7la_19.js} +23 -6
- package/dist/src/{extractor-BA90EtLq.js → extractor-LSYjrhK0.js} +23 -6
- package/dist/src/{fetch-BIfcW-Fd.js → fetch-18MuNu9i.js} +21 -7
- package/dist/src/{fetch-CW9GabAi.js → fetch-Bi0o-fdp.js} +2 -2
- package/dist/src/fetch-CMptBDVg.cjs +4 -0
- package/dist/src/fetch-DAZkv3gV.js +6 -0
- package/dist/src/{fetch-Mb7SbeM-.js → fetch-SRsE6Ctl.js} +21 -7
- package/dist/src/{fetch-MvWxCS5U.cjs → fetch-ZMn_oemb.cjs} +21 -7
- package/dist/src/{fileExtensions-CzcPkiKZ.js → fileExtensions-BpuMmaFL.js} +1 -1
- package/dist/src/{formatDuration-CCiZ-wBY.js → formatDuration-Doo0xq-z.js} +1 -1
- package/dist/src/{genaiTracer-BQ8AmajD.cjs → genaiTracer-CQlpZkrp.cjs} +2 -2
- package/dist/src/{genaiTracer-foKtbVa2.js → genaiTracer-CqNnnXrE.js} +1 -1
- package/dist/src/graders-BCytzXrb.js +34 -0
- package/dist/src/{graders-CwtelA9k.js → graders-BaMCwIKp.js} +212 -91
- package/dist/src/graders-CGZQShfJ.cjs +33 -0
- package/dist/src/{graders-2dabIkXs.cjs → graders-DzUUnUjC.cjs} +212 -91
- package/dist/src/{graders-BscQ6O1Q.js → graders-QsALpIdy.js} +211 -90
- package/dist/src/graders-spkuVC-E.js +36 -0
- package/dist/src/{image-Dv0o-Ab7.js → image-BXt_7u0v.js} +4 -4
- package/dist/src/{image-B6TV9l0v.js → image-BiEVdpdP.js} +7 -7
- package/dist/src/{image-DS9hlgSc.cjs → image-C3BjJUAU.cjs} +7 -7
- package/dist/src/{image-_jKUeeh9.js → image-COCWy5dX.js} +2 -2
- package/dist/src/{image-DqElR73O.cjs → image-D10zEe1f.cjs} +4 -4
- package/dist/src/{image-BVEVjrwl.js → image-DB4sHxdJ.js} +5 -5
- package/dist/src/{image-C1i3NoZo.js → image-mhAGP07h.js} +7 -7
- package/dist/src/index.cjs +305 -112
- package/dist/src/index.d.cts +137 -3
- package/dist/src/index.d.ts +137 -3
- package/dist/src/index.js +304 -111
- package/dist/src/{interactiveCheck-CjK2R4rB.js → interactiveCheck-DU-MAhp5.js} +2 -2
- package/dist/src/{knowledgeBase-K5fJN2kC.cjs → knowledgeBase-Bnb00xKs.cjs} +8 -8
- package/dist/src/{knowledgeBase-D-xthvn0.js → knowledgeBase-CMvMlLZR.js} +9 -9
- package/dist/src/{knowledgeBase-DJZHeJqg.js → knowledgeBase-DotRBzUE.js} +2 -2
- package/dist/src/{knowledgeBase-BSs2ldSR.js → knowledgeBase-XJQ0Qyez.js} +8 -8
- package/dist/src/{litellm-kPhaZkzz.js → litellm-BECdjOTx.js} +3 -3
- package/dist/src/{litellm-uRLukY7s.cjs → litellm-BrnZhMcL.cjs} +15 -15
- package/dist/src/{litellm-DH_rVIOd.js → litellm-CHrRmPAe.js} +16 -16
- package/dist/src/{litellm-DoXGHlpD.js → litellm-CrLJrPIm.js} +14 -14
- package/dist/src/{logger-CMp-NS-e.cjs → logger-BdZ-IqBc.cjs} +5 -2
- package/dist/src/{logger-Bzi5o47S.js → logger-BotXmWKW.js} +5 -2
- package/dist/src/{logger-q5I8CByj.js → logger-w8Ozp0Td.js} +5 -2
- package/dist/src/{luma-ray-B3GiVpuq.js → luma-ray-BOeX-h0M.js} +10 -10
- package/dist/src/{luma-ray-CPISsLu-.js → luma-ray-C-w6EsJm.js} +2 -2
- package/dist/src/{luma-ray-BrWrKIIB.cjs → luma-ray-C0RkI3lt.cjs} +10 -10
- package/dist/src/{luma-ray-gyI_GEy2.js → luma-ray-DgKLS0BF.js} +11 -11
- package/dist/src/main.js +3260 -2537
- package/dist/src/{messages-CJgEjRQF.js → messages-CDZYGNlS.js} +13 -10
- package/dist/src/{messages-BMkwrfmt.js → messages-D61tPFQo.js} +14 -11
- package/dist/src/{messages-B5HsO_dM.cjs → messages-DXV3Qh8_.cjs} +14 -11
- package/dist/src/{meteor-CBciquOS.js → meteor-Dj8cTkU_.js} +1 -1
- package/dist/src/{meteor-0cLf9TIn.js → meteor-P2rUE-Uz.js} +1 -1
- package/dist/src/{meteor-BQ6Ws9k2.js → meteor-SLNTgmXm.js} +2 -2
- package/dist/src/{meteor-DRuEfzuQ.cjs → meteor-odmwVbyG.cjs} +1 -1
- package/dist/src/{nova-reel-B5SOonY2.js → nova-reel-Bk5npr2q.js} +11 -11
- package/dist/src/{nova-reel-CT9ZuhJ3.js → nova-reel-C2LFfVTf.js} +2 -2
- package/dist/src/{nova-reel-ByTx85ed.cjs → nova-reel-D9FXq3Mt.cjs} +10 -10
- package/dist/src/{nova-reel-ChM7WaHR.js → nova-reel-DtCjbD5O.js} +10 -10
- package/dist/src/{nova-sonic-D4M3kKYu.js → nova-sonic-BXRfQyF-.js} +8 -8
- package/dist/src/{nova-sonic-C-H3eDvL.cjs → nova-sonic-BoRSY_U6.cjs} +7 -7
- package/dist/src/{nova-sonic-DgifpOKF.js → nova-sonic-CgaWLDM1.js} +7 -7
- package/dist/src/{nova-sonic-BqP59oOu.js → nova-sonic-D_qERM-K.js} +2 -2
- package/dist/src/{openai-BjpdxIOG.cjs → openai-Bigwjgo1.cjs} +2 -2
- package/dist/src/{openai-Cv9pEKxp.js → openai-CT5fwbve.js} +2 -2
- package/dist/src/{openai-CitF-gEN.js → openai-Dz3surb_.js} +2 -2
- package/dist/src/openclaw-B6XY2kUf.js +526 -0
- package/dist/src/openclaw-CpPrXwf6.js +524 -0
- package/dist/src/openclaw-DDSfq5fp.cjs +528 -0
- package/dist/src/openclaw-dHLcXUWZ.js +511 -0
- package/dist/src/{opencode-sdk-Dakn4QMp.js → opencode-sdk-CImWVqy9.js} +7 -7
- package/dist/src/{opencode-sdk-BcLvVMV-.js → opencode-sdk-CuCztr4P.js} +6 -6
- package/dist/src/{opencode-sdk-z7KKOCdB.js → opencode-sdk-DhcfRbBH.js} +3 -3
- package/dist/src/{opencode-sdk-Cqszt4br.cjs → opencode-sdk-mqF-Oj3f.cjs} +6 -6
- package/dist/src/{otlpReceiver-BvmMgacx.cjs → otlpReceiver-B6Xo4KZM.cjs} +6 -6
- package/dist/src/{otlpReceiver-DRNetlJH.js → otlpReceiver-BO0rbDzh.js} +6 -6
- package/dist/src/{otlpReceiver-Bhj_vnzl.js → otlpReceiver-Dg817agV.js} +6 -6
- package/dist/src/{otlpReceiver-Cpnk-Hjf.js → otlpReceiver-DmRb0NBj.js} +2 -2
- package/dist/src/{providerRegistry-D32Lt9vp.js → providerRegistry-Xf0qdqGQ.js} +2 -2
- package/dist/src/{providerRegistry-HGQd2MF6.cjs → providerRegistry-lc7a7utN.cjs} +2 -2
- package/dist/src/{providerRegistry-BdKWcUa8.js → providerRegistry-wCWd7sKQ.js} +2 -2
- package/dist/src/providers-BMZZmPBJ.cjs +32 -0
- package/dist/src/{providers-BWoVY_Wz.cjs → providers-BNKVY53V.cjs} +294 -782
- package/dist/src/{providers-Co_FGgH8.js → providers-BiNq_Iyc.js} +281 -769
- package/dist/src/{providers-CUCHJCHD.js → providers-BlEhY5mi.js} +286 -779
- package/dist/src/providers-CQQrNaJk.js +32 -0
- package/dist/src/providers-Ck8HyrC-.js +34 -0
- package/dist/src/{pythonUtils-rOCm9w_5.cjs → pythonUtils-DZ6EbdY4.cjs} +3 -3
- package/dist/src/{pythonUtils-B9JA-gsC.js → pythonUtils-r1uBuA0n.js} +3 -3
- package/dist/src/{pythonUtils-eNq6Wsfr.js → pythonUtils-vMlk9Qp5.js} +3 -3
- package/dist/src/{quiverai-BpWtOEQZ.cjs → quiverai-BNfIwKCO.cjs} +13 -13
- package/dist/src/{quiverai-Cj-PUa3p.js → quiverai-BQigKdIH.js} +14 -14
- package/dist/src/{quiverai-BN8OVvDE.js → quiverai-Bfy2WnE2.js} +12 -12
- package/dist/src/{quiverai-D5MSsd2c.js → quiverai-CedIP0PJ.js} +2 -2
- package/dist/src/{render-D2710HbA.js → render-CAZvKKkB.js} +4 -4
- package/dist/src/responses-DLLjADw5.js +653 -0
- package/dist/src/responses-TsdODUpm.js +654 -0
- package/dist/src/responses-zOtKtnY_.cjs +671 -0
- package/dist/src/{rubyUtils-Dn6MGcsk.js → rubyUtils-BtjlqyXt.js} +3 -3
- package/dist/src/{rubyUtils-LBsk3zIm.js → rubyUtils-Cs35SDYa.js} +3 -3
- package/dist/src/rubyUtils-D7--T12C.js +6 -0
- package/dist/src/{rubyUtils-rnCVDgH-.cjs → rubyUtils-DCVaJ3mc.cjs} +3 -3
- package/dist/src/rubyUtils-DRRiMFV2.js +5 -0
- package/dist/src/rubyUtils-vb8OYFC-.cjs +5 -0
- package/dist/src/{sagemaker-C8MeZIkH.js → sagemaker-BcgLu0U4.js} +18 -18
- package/dist/src/{sagemaker-4ukMNSN0.js → sagemaker-CLdUAv5z.js} +17 -17
- package/dist/src/{sagemaker-DyVHy2BW.js → sagemaker-Du4LIR97.js} +2 -2
- package/dist/src/{sagemaker-DB3Eojau.cjs → sagemaker-DwNnEVYt.cjs} +17 -17
- package/dist/src/{scanner-C28XVEq2.js → scanner-Dyw21Wg_.js} +12 -12
- package/dist/src/server/index.js +1818 -605
- package/dist/src/server-BUbS0Qfh.js +6 -0
- package/dist/src/{server-BF3HkMhe.js → server-CbMTRQkg.js} +8 -6
- package/dist/src/{server-CSbLW-UI.cjs → server-CgUQ25qW.cjs} +8 -6
- package/dist/src/{server-mycZbUH8.js → server-DWmZLfCy.js} +10 -7
- package/dist/src/server-XpGXFHkS.cjs +6 -0
- package/dist/src/server-gfOx5Zrk.js +8 -0
- package/dist/src/{signal-DM_SPNmi.js → signal-Bl32q42d.js} +3 -3
- package/dist/src/{slack-Ed1yyt_j.js → slack-BfdBx2tO.js} +2 -2
- package/dist/src/{slack-D1F9Y7CH.cjs → slack-BtMkB6xP.cjs} +2 -2
- package/dist/src/{slack-DkAF58Tr.js → slack-DPqj42Ts.js} +2 -2
- package/dist/src/{slack-BK312SXM.js → slack-OZYxoVON.js} +2 -2
- package/dist/src/{store-CT_e5OZX.js → store-2ocbYY9D.js} +3 -3
- package/dist/src/store-5u2yriTV.js +7 -0
- package/dist/src/{store-BpumNYCl.cjs → store-BqwfFEyF.cjs} +3 -3
- package/dist/src/{store-BFLqwuc_.js → store-D4gdn9ih.js} +3 -3
- package/dist/src/store-D_lq_8oQ.js +6 -0
- package/dist/src/store-m5KT6Ly7.cjs +6 -0
- package/dist/src/{tables-Dansasnu.cjs → tables-B9E1kRp-.cjs} +3 -3
- package/dist/src/{tables-BjaApSAB.js → tables-C7TT2XVn.js} +3 -3
- package/dist/src/{tables-Dwexr5Z6.js → tables-D-NSwNIb.js} +3 -3
- package/dist/src/telemetry-5RHFoCJh.js +6 -0
- package/dist/src/{telemetry-MVkZQxt9.js → telemetry-BXyVqyAg.js} +5 -4
- package/dist/src/{telemetry-DFDFKdnr.cjs → telemetry-D0_yFdtU.cjs} +5 -4
- package/dist/src/{telemetry-Ds5Nn81l.js → telemetry-DZ_7PaVq.js} +5 -4
- package/dist/src/telemetry-Do8wMnA-.js +8 -0
- package/dist/src/telemetry-LojxPoFq.cjs +6 -0
- package/dist/src/{text-PYISqVm1.cjs → text-DF2hMKdg.cjs} +1 -1
- package/dist/src/{text-DuYSUYPB.js → text-DgMr_tiM.js} +1 -1
- package/dist/src/{text-Dx0GJOCN.js → text-Dm78AVGG.js} +1 -1
- package/dist/src/{tokenUsageUtils-BtZd3sP7.cjs → tokenUsageUtils-CXhxVj72.cjs} +9 -4
- package/dist/src/{tokenUsageUtils-DoinwgKF.js → tokenUsageUtils-DmZSD2eU.js} +9 -4
- package/dist/src/{tokenUsageUtils-cFdLMERB.js → tokenUsageUtils-FZd5O_4A.js} +9 -4
- package/dist/src/{transcription-Cp19m_Mt.js → transcription-C-M81iDA.js} +2 -2
- package/dist/src/{transcription-CLRpAg07.js → transcription-CYuY5sFO.js} +10 -10
- package/dist/src/{transcription-D8ifIKOv.js → transcription-Ch7S-LWw.js} +11 -11
- package/dist/src/{transcription-CXXFEVM_.cjs → transcription-FNIz3YOe.cjs} +10 -10
- package/dist/src/transform-8eGmaH-7.js +7 -0
- package/dist/src/transform-BRVvWaG4.cjs +6 -0
- package/dist/src/{transform-Bn-lgBE2.js → transform-CoP2bJ7P.js} +44 -5
- package/dist/src/{transform-BFPYuBaW.js → transform-CqTFr7KR.js} +5 -5
- package/dist/src/{transform-DvQWeBSR.js → transform-D8dILpfZ.js} +4 -4
- package/dist/src/{transform-BUrxadlA.js → transform-DMaxQwDx.js} +44 -5
- package/dist/src/transform-GybT0X0u.js +8 -0
- package/dist/src/{transform-DshYLyBq.cjs → transform-Kd6u-oNm.cjs} +4 -4
- package/dist/src/{transform-Bw1IstDE.cjs → transform-ivxEY4f7.cjs} +55 -4
- package/dist/src/{transformersAvailability-BaoWHpu1.cjs → transformersAvailability-Bkep3ka7.cjs} +1 -1
- package/dist/src/{transformersAvailability-Dhh45n5P.js → transformersAvailability-DEU2naS1.js} +1 -1
- package/dist/src/{transformersAvailability-DtpwoeFC.js → transformersAvailability-DkAWaK5B.js} +1 -1
- package/dist/src/{transformersAvailability-O2YaCv9Z.js → transformersAvailability-DwmezkVe.js} +1 -1
- package/dist/src/{types-B-XUqfNs.cjs → types-BIfttHrT.cjs} +22 -2
- package/dist/src/{types-BsU_PxR3.js → types-DMVjYLpx.js} +16 -2
- package/dist/src/{types-CgrxBFgm.js → types-t52w-XsS.js} +19 -3
- package/dist/src/{util-M2MoNCUR.js → util-BSh4a_Q8.js} +7 -7
- package/dist/src/{util-DTJWKLkl.cjs → util-C08Kns6-.cjs} +18 -4
- package/dist/src/{util-DHBpsbZE.js → util-CUEt0Vum.js} +18 -4
- package/dist/src/{util-Bnw6EyZN.js → util-Cl0zfT3V.js} +18 -4
- package/dist/src/{util-C7A-PlKK.cjs → util-DUYOvxAy.cjs} +6 -6
- package/dist/src/{util-WYC3rB_p.js → util-DiCePfDu.js} +6 -6
- package/dist/src/{util-CV99ps44.cjs → util-DkFTvieG.cjs} +17 -5
- package/dist/src/{util-CfepsNVK.js → util-mJ58qbbw.js} +17 -5
- package/dist/src/{util-BZaMVBMq.js → util-vjscpUzy.js} +17 -5
- package/dist/src/{utils-BryuD3vq.js → utils-CVzb4YiI.js} +3 -3
- package/dist/src/{utils-Dezi3MBH.cjs → utils-DFaZa6Rf.cjs} +3 -3
- package/dist/src/{utils-GiyI2K4P.js → utils-JaY9veb5.js} +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +75 -77
- package/dist/src/app/assets/index-07dbAcWK.js +0 -427
- package/dist/src/app/assets/index-DnEcCQgk.css +0 -1
- package/dist/src/app/assets/vendor-react-DHoaNLma.js +0 -4
- package/dist/src/cache-BujOdYlc.cjs +0 -6
- package/dist/src/cloud-BHYz0XkH.js +0 -5
- package/dist/src/eval-0IFf8hON.js +0 -16
- package/dist/src/evalResult-BCCv6FXj.js +0 -13
- package/dist/src/evalResult-C8iVgVvr.js +0 -11
- package/dist/src/evalResult-CqFeWKYx.cjs +0 -11
- package/dist/src/evaluator-DwS5NAEj.js +0 -37
- package/dist/src/fetch-BH9KSaUC.cjs +0 -4
- package/dist/src/fetch-BL6kqunF.js +0 -6
- package/dist/src/graders-BK3LuhJ8.cjs +0 -32
- package/dist/src/graders-Bpjtip-E.js +0 -35
- package/dist/src/graders-KIf6Uej3.js +0 -33
- package/dist/src/providers-41mSodR_.js +0 -31
- package/dist/src/providers-CiZCpIxz.cjs +0 -31
- package/dist/src/providers-G531909f.js +0 -33
- package/dist/src/rubyUtils-BLd6EE1u.cjs +0 -5
- package/dist/src/rubyUtils-CVELPvUH.js +0 -6
- package/dist/src/rubyUtils-_t9Gmf7U.js +0 -5
- package/dist/src/server-Bc4T4XDt.cjs +0 -6
- package/dist/src/server-CMyxJ7ct.js +0 -6
- package/dist/src/server-D9FuxNYE.js +0 -8
- package/dist/src/store-CrMinjmN.cjs +0 -6
- package/dist/src/store-EaWZOoxz.js +0 -7
- package/dist/src/store-KXWnHB15.js +0 -6
- package/dist/src/telemetry-BXD2mCyr.cjs +0 -6
- package/dist/src/telemetry-CYiBm56v.js +0 -8
- package/dist/src/telemetry-lICYKIMB.js +0 -6
- package/dist/src/transform-DZI2t8-9.js +0 -8
- package/dist/src/transform-DZUV3qpO.js +0 -7
- package/dist/src/transform-XcotjzZX.cjs +0 -6
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { D as fetchWithProxy, I as getEnvString, N as VERSION, j as logger_default, k as REQUEST_TIMEOUT_MS, l as OpenAiChatCompletionProvider, s as OpenAiResponsesProvider } from "./server/index.js";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import os from "os";
|
|
5
|
+
import crypto from "crypto";
|
|
6
|
+
import WebSocket from "ws";
|
|
7
|
+
|
|
8
|
+
//#region src/providers/openclaw/shared.ts
|
|
9
|
+
const DEFAULT_GATEWAY_PORT = 18789;
|
|
10
|
+
const DEFAULT_GATEWAY_HOST = "127.0.0.1";
|
|
11
|
+
/**
|
|
12
|
+
* Strip JSON5 syntax (comments and trailing commas) for JSON.parse compatibility.
|
|
13
|
+
* Uses a state machine to avoid corrupting strings containing // or slash characters.
|
|
14
|
+
*/
|
|
15
|
+
function stripJson5Syntax(raw) {
|
|
16
|
+
let result = "";
|
|
17
|
+
let i = 0;
|
|
18
|
+
let inString = false;
|
|
19
|
+
let stringQuote = "";
|
|
20
|
+
let escape = false;
|
|
21
|
+
while (i < raw.length) {
|
|
22
|
+
const ch = raw[i];
|
|
23
|
+
if (inString) {
|
|
24
|
+
result += ch;
|
|
25
|
+
if (escape) escape = false;
|
|
26
|
+
else if (ch === "\\") escape = true;
|
|
27
|
+
else if (ch === stringQuote) inString = false;
|
|
28
|
+
i++;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (ch === "\"" || ch === "'") {
|
|
32
|
+
inString = true;
|
|
33
|
+
stringQuote = ch;
|
|
34
|
+
result += ch;
|
|
35
|
+
i++;
|
|
36
|
+
} else if (ch === "/" && raw[i + 1] === "/") while (i < raw.length && raw[i] !== "\n") i++;
|
|
37
|
+
else if (ch === "/" && raw[i + 1] === "*") {
|
|
38
|
+
i += 2;
|
|
39
|
+
while (i < raw.length - 1 && !(raw[i] === "*" && raw[i + 1] === "/")) i++;
|
|
40
|
+
if (i < raw.length - 1 && raw[i] === "*" && raw[i + 1] === "/") i += 2;
|
|
41
|
+
} else if (ch === ",") {
|
|
42
|
+
let j = i + 1;
|
|
43
|
+
while (j < raw.length && (raw[j] === " " || raw[j] === " " || raw[j] === "\n" || raw[j] === "\r")) j++;
|
|
44
|
+
if (j < raw.length && (raw[j] === "}" || raw[j] === "]")) i++;
|
|
45
|
+
else {
|
|
46
|
+
result += ch;
|
|
47
|
+
i++;
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
result += ch;
|
|
51
|
+
i++;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Cached config to avoid re-reading the file multiple times during provider init.
|
|
58
|
+
*/
|
|
59
|
+
let cachedConfig;
|
|
60
|
+
/**
|
|
61
|
+
* Read and parse the OpenClaw configuration file.
|
|
62
|
+
* Results are cached based on file modification time.
|
|
63
|
+
* Returns undefined if the file doesn't exist or can't be parsed.
|
|
64
|
+
*/
|
|
65
|
+
function readOpenClawConfig() {
|
|
66
|
+
const configPath = path.join(os.homedir(), ".openclaw", "openclaw.json");
|
|
67
|
+
try {
|
|
68
|
+
if (!fs.existsSync(configPath)) return;
|
|
69
|
+
const mtime = fs.statSync(configPath).mtimeMs;
|
|
70
|
+
if (cachedConfig && cachedConfig.mtime === mtime) return cachedConfig.config;
|
|
71
|
+
const cleaned = stripJson5Syntax(fs.readFileSync(configPath, "utf-8"));
|
|
72
|
+
const config = JSON.parse(cleaned);
|
|
73
|
+
cachedConfig = {
|
|
74
|
+
config,
|
|
75
|
+
mtime
|
|
76
|
+
};
|
|
77
|
+
return config;
|
|
78
|
+
} catch (err) {
|
|
79
|
+
logger_default.debug(`Failed to read OpenClaw config at ${configPath}: ${err}`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Auto-detect the OpenClaw gateway URL from config, env overrides, or environment.
|
|
85
|
+
*/
|
|
86
|
+
function resolveGatewayUrl(config, env) {
|
|
87
|
+
if (config?.gateway_url) return config.gateway_url;
|
|
88
|
+
const envUrl = env?.OPENCLAW_GATEWAY_URL || getEnvString("OPENCLAW_GATEWAY_URL");
|
|
89
|
+
if (envUrl) return envUrl;
|
|
90
|
+
const openclawConfig = readOpenClawConfig();
|
|
91
|
+
if (openclawConfig?.gateway) {
|
|
92
|
+
const port = openclawConfig.gateway.port ?? DEFAULT_GATEWAY_PORT;
|
|
93
|
+
const bind = openclawConfig.gateway.bind;
|
|
94
|
+
return `http://${!bind || bind === "loopback" || bind === "0.0.0.0" || bind === "::" ? DEFAULT_GATEWAY_HOST : bind}:${port}`;
|
|
95
|
+
}
|
|
96
|
+
return `http://${DEFAULT_GATEWAY_HOST}:${DEFAULT_GATEWAY_PORT}`;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Auto-detect the OpenClaw gateway auth token from config, env overrides, or environment.
|
|
100
|
+
*/
|
|
101
|
+
function resolveAuthToken(config, env) {
|
|
102
|
+
if (config?.auth_token) return config.auth_token;
|
|
103
|
+
const envToken = env?.OPENCLAW_GATEWAY_TOKEN || getEnvString("OPENCLAW_GATEWAY_TOKEN");
|
|
104
|
+
if (envToken) return envToken;
|
|
105
|
+
return readOpenClawConfig()?.gateway?.auth?.token;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Build common OpenClaw headers for agent-id and session-key.
|
|
109
|
+
* Note: thinking_level is only supported by the WS Agent provider and is
|
|
110
|
+
* passed as an RPC param there, not as an HTTP header.
|
|
111
|
+
*/
|
|
112
|
+
function buildOpenClawHeaders(agentId, config) {
|
|
113
|
+
const headers = { "x-openclaw-agent-id": agentId };
|
|
114
|
+
if (config?.session_key) headers["x-openclaw-session-key"] = config.session_key;
|
|
115
|
+
return headers;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Build provider options for OpenAI-compatible OpenClaw providers (chat, responses).
|
|
119
|
+
* Resolves gateway URL, auth token, and merges OpenClaw-specific headers.
|
|
120
|
+
*/
|
|
121
|
+
function buildOpenClawProviderOptions(agentId, providerOptions) {
|
|
122
|
+
const config = providerOptions.config || {};
|
|
123
|
+
const env = providerOptions.env;
|
|
124
|
+
const gatewayUrl = resolveGatewayUrl(config, env);
|
|
125
|
+
const authToken = resolveAuthToken(config, env);
|
|
126
|
+
return {
|
|
127
|
+
...providerOptions,
|
|
128
|
+
config: {
|
|
129
|
+
...config,
|
|
130
|
+
apiBaseUrl: `${gatewayUrl}/v1`,
|
|
131
|
+
...authToken && { apiKey: authToken },
|
|
132
|
+
apiKeyRequired: false,
|
|
133
|
+
headers: {
|
|
134
|
+
...config.headers,
|
|
135
|
+
...buildOpenClawHeaders(agentId, config)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/providers/openclaw/agent.ts
|
|
143
|
+
const OPENCLAW_PROTOCOL_VERSION = 3;
|
|
144
|
+
/**
|
|
145
|
+
* OpenClaw WebSocket Agent Provider
|
|
146
|
+
*
|
|
147
|
+
* Custom provider that uses the native OpenClaw WS RPC protocol to invoke agents.
|
|
148
|
+
* Supports full streaming with event accumulation.
|
|
149
|
+
*
|
|
150
|
+
* Protocol flow:
|
|
151
|
+
* 1. Open WS connection to gateway
|
|
152
|
+
* 2. Receive connect.challenge event → send connect request
|
|
153
|
+
* 3. Receive hello-ok response → send agent request
|
|
154
|
+
* 4. Receive agent accepted response → send agent.wait
|
|
155
|
+
* 5. Accumulate streaming "agent" events (stream: "assistant")
|
|
156
|
+
* 6. Resolve on agent.wait response
|
|
157
|
+
*
|
|
158
|
+
* Usage:
|
|
159
|
+
* openclaw:agent - default agent (main)
|
|
160
|
+
* openclaw:agent:main - explicit agent ID
|
|
161
|
+
* openclaw:agent:my-agent - custom agent ID
|
|
162
|
+
*/
|
|
163
|
+
var OpenClawAgentProvider = class {
|
|
164
|
+
agentId;
|
|
165
|
+
gatewayUrl;
|
|
166
|
+
authToken;
|
|
167
|
+
openclawConfig;
|
|
168
|
+
timeoutMs;
|
|
169
|
+
activeConnections = /* @__PURE__ */ new Set();
|
|
170
|
+
constructor(agentId, providerOptions = {}) {
|
|
171
|
+
this.agentId = agentId;
|
|
172
|
+
this.openclawConfig = providerOptions.config || {};
|
|
173
|
+
const env = providerOptions.env;
|
|
174
|
+
this.gatewayUrl = resolveGatewayUrl(this.openclawConfig, env);
|
|
175
|
+
this.authToken = resolveAuthToken(this.openclawConfig, env);
|
|
176
|
+
this.timeoutMs = this.openclawConfig.timeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
177
|
+
}
|
|
178
|
+
id() {
|
|
179
|
+
return `openclaw:agent:${this.agentId}`;
|
|
180
|
+
}
|
|
181
|
+
toString() {
|
|
182
|
+
return `[OpenClaw Agent Provider ${this.agentId}]`;
|
|
183
|
+
}
|
|
184
|
+
toJSON() {
|
|
185
|
+
return { provider: this.id() };
|
|
186
|
+
}
|
|
187
|
+
async cleanup() {
|
|
188
|
+
for (const ws of this.activeConnections) ws.close();
|
|
189
|
+
this.activeConnections.clear();
|
|
190
|
+
}
|
|
191
|
+
async callApi(prompt) {
|
|
192
|
+
const wsUrl = this.gatewayUrl.replace(/^http(s?):\/\//, "ws$1://");
|
|
193
|
+
return new Promise((resolve) => {
|
|
194
|
+
const ws = new WebSocket(wsUrl);
|
|
195
|
+
this.activeConnections.add(ws);
|
|
196
|
+
const agentRequestId = crypto.randomUUID();
|
|
197
|
+
const waitRequestId = crypto.randomUUID();
|
|
198
|
+
const idempotencyKey = crypto.randomUUID();
|
|
199
|
+
let lastText = "";
|
|
200
|
+
let runId;
|
|
201
|
+
let connected = false;
|
|
202
|
+
let resolved = false;
|
|
203
|
+
const timeout = setTimeout(() => {
|
|
204
|
+
if (!resolved) {
|
|
205
|
+
resolved = true;
|
|
206
|
+
ws.close();
|
|
207
|
+
resolve({ error: `OpenClaw agent request timed out after ${this.timeoutMs}ms` });
|
|
208
|
+
}
|
|
209
|
+
}, this.timeoutMs);
|
|
210
|
+
const finish = (result) => {
|
|
211
|
+
if (resolved) return;
|
|
212
|
+
resolved = true;
|
|
213
|
+
clearTimeout(timeout);
|
|
214
|
+
this.activeConnections.delete(ws);
|
|
215
|
+
ws.close();
|
|
216
|
+
resolve(result);
|
|
217
|
+
};
|
|
218
|
+
ws.on("error", (err) => {
|
|
219
|
+
finish({ error: `OpenClaw WebSocket error: ${err.message}` });
|
|
220
|
+
});
|
|
221
|
+
ws.on("close", () => {
|
|
222
|
+
this.activeConnections.delete(ws);
|
|
223
|
+
if (!resolved) finish({ error: "OpenClaw WebSocket connection closed unexpectedly" });
|
|
224
|
+
});
|
|
225
|
+
ws.on("message", (data) => {
|
|
226
|
+
let frame;
|
|
227
|
+
try {
|
|
228
|
+
frame = JSON.parse(data.toString());
|
|
229
|
+
} catch {
|
|
230
|
+
logger_default.debug("[OpenClaw Agent] Failed to parse WS frame");
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
logger_default.debug("[OpenClaw Agent] Frame received", {
|
|
234
|
+
type: frame.type,
|
|
235
|
+
event: frame.event,
|
|
236
|
+
id: frame.id
|
|
237
|
+
});
|
|
238
|
+
if (frame.type === "event" && frame.event === "connect.challenge") {
|
|
239
|
+
ws.send(JSON.stringify({
|
|
240
|
+
type: "req",
|
|
241
|
+
id: crypto.randomUUID(),
|
|
242
|
+
method: "connect",
|
|
243
|
+
params: {
|
|
244
|
+
minProtocol: OPENCLAW_PROTOCOL_VERSION,
|
|
245
|
+
maxProtocol: OPENCLAW_PROTOCOL_VERSION,
|
|
246
|
+
client: {
|
|
247
|
+
id: "gateway-client",
|
|
248
|
+
displayName: "promptfoo",
|
|
249
|
+
version: VERSION,
|
|
250
|
+
platform: process.platform,
|
|
251
|
+
mode: "cli"
|
|
252
|
+
},
|
|
253
|
+
role: "operator",
|
|
254
|
+
scopes: ["operator.read", "operator.write"],
|
|
255
|
+
caps: [],
|
|
256
|
+
commands: [],
|
|
257
|
+
permissions: {},
|
|
258
|
+
...this.authToken && { auth: { token: this.authToken } }
|
|
259
|
+
}
|
|
260
|
+
}));
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (frame.type === "res" && !connected) {
|
|
264
|
+
if (!frame.ok) {
|
|
265
|
+
finish({ error: `OpenClaw connect failed: ${frame.error?.message || "unknown error"}` });
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
connected = true;
|
|
269
|
+
ws.send(JSON.stringify({
|
|
270
|
+
type: "req",
|
|
271
|
+
id: agentRequestId,
|
|
272
|
+
method: "agent",
|
|
273
|
+
params: {
|
|
274
|
+
message: prompt,
|
|
275
|
+
agentId: this.agentId,
|
|
276
|
+
idempotencyKey,
|
|
277
|
+
...this.openclawConfig.session_key && { sessionKey: this.openclawConfig.session_key },
|
|
278
|
+
...this.openclawConfig.thinking_level && { thinking: this.openclawConfig.thinking_level }
|
|
279
|
+
}
|
|
280
|
+
}));
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
if (frame.type === "res" && frame.id === agentRequestId) {
|
|
284
|
+
if (!frame.ok) {
|
|
285
|
+
finish({ error: `OpenClaw agent error: ${frame.error?.message || "unknown error"}` });
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
runId = frame.payload?.runId;
|
|
289
|
+
if (runId) ws.send(JSON.stringify({
|
|
290
|
+
type: "req",
|
|
291
|
+
id: waitRequestId,
|
|
292
|
+
method: "agent.wait",
|
|
293
|
+
params: {
|
|
294
|
+
runId,
|
|
295
|
+
timeoutMs: this.timeoutMs
|
|
296
|
+
}
|
|
297
|
+
}));
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
if (frame.type === "event" && frame.event === "agent") {
|
|
301
|
+
const payload = frame.payload;
|
|
302
|
+
if (payload?.runId && runId && payload.runId !== runId) return;
|
|
303
|
+
if (payload?.stream === "assistant" && payload?.data?.text) lastText = payload.data.text;
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
if (frame.type === "res" && frame.id === waitRequestId) {
|
|
307
|
+
if (frame.ok) finish({ output: lastText || "No output from agent" });
|
|
308
|
+
else finish({ error: `OpenClaw agent error: ${frame.error?.message || "unknown error"}` });
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
//#endregion
|
|
317
|
+
//#region src/providers/openclaw/chat.ts
|
|
318
|
+
/**
|
|
319
|
+
* OpenClaw chat provider extends OpenAI chat completion provider.
|
|
320
|
+
*
|
|
321
|
+
* OpenClaw exposes an OpenAI-compatible HTTP API at /v1/chat/completions.
|
|
322
|
+
* This provider auto-detects gateway URL and auth token from:
|
|
323
|
+
* 1. Explicit config (gateway_url, auth_token)
|
|
324
|
+
* 2. Environment variables (OPENCLAW_GATEWAY_URL, OPENCLAW_GATEWAY_TOKEN)
|
|
325
|
+
* 3. ~/.openclaw/openclaw.json
|
|
326
|
+
*
|
|
327
|
+
* Usage:
|
|
328
|
+
* openclaw - default agent (main)
|
|
329
|
+
* openclaw:main - specific agent
|
|
330
|
+
* openclaw:coding-agent - named agent
|
|
331
|
+
*/
|
|
332
|
+
var OpenClawChatProvider = class extends OpenAiChatCompletionProvider {
|
|
333
|
+
agentId;
|
|
334
|
+
constructor(agentId, providerOptions = {}) {
|
|
335
|
+
super(`openclaw:${agentId}`, buildOpenClawProviderOptions(agentId, providerOptions));
|
|
336
|
+
this.agentId = agentId;
|
|
337
|
+
}
|
|
338
|
+
id() {
|
|
339
|
+
return `openclaw:${this.agentId}`;
|
|
340
|
+
}
|
|
341
|
+
toString() {
|
|
342
|
+
return `[OpenClaw Provider ${this.agentId}]`;
|
|
343
|
+
}
|
|
344
|
+
getApiUrlDefault() {
|
|
345
|
+
return `http://${DEFAULT_GATEWAY_HOST}:${DEFAULT_GATEWAY_PORT}/v1`;
|
|
346
|
+
}
|
|
347
|
+
getApiKey() {
|
|
348
|
+
return this.config.apiKey;
|
|
349
|
+
}
|
|
350
|
+
getApiUrl() {
|
|
351
|
+
return this.config.apiBaseUrl || this.getApiUrlDefault();
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/providers/openclaw/responses.ts
|
|
357
|
+
/**
|
|
358
|
+
* OpenClaw Responses API Provider
|
|
359
|
+
*
|
|
360
|
+
* Extends OpenAI Responses API provider with OpenClaw-specific configuration.
|
|
361
|
+
* Routes through the OpenClaw gateway's /v1/responses endpoint.
|
|
362
|
+
*
|
|
363
|
+
* Requires `gateway.http.endpoints.responses.enabled=true` in OpenClaw config.
|
|
364
|
+
*
|
|
365
|
+
* Usage:
|
|
366
|
+
* openclaw:responses - default agent (main)
|
|
367
|
+
* openclaw:responses:main - explicit agent ID
|
|
368
|
+
* openclaw:responses:X - custom agent ID
|
|
369
|
+
*/
|
|
370
|
+
var OpenClawResponsesProvider = class extends OpenAiResponsesProvider {
|
|
371
|
+
agentId;
|
|
372
|
+
constructor(agentId, providerOptions = {}) {
|
|
373
|
+
super(`openclaw:${agentId}`, buildOpenClawProviderOptions(agentId, providerOptions));
|
|
374
|
+
this.agentId = agentId;
|
|
375
|
+
}
|
|
376
|
+
id() {
|
|
377
|
+
return `openclaw:responses:${this.agentId}`;
|
|
378
|
+
}
|
|
379
|
+
toString() {
|
|
380
|
+
return `[OpenClaw Responses Provider ${this.agentId}]`;
|
|
381
|
+
}
|
|
382
|
+
getApiUrlDefault() {
|
|
383
|
+
return `http://${DEFAULT_GATEWAY_HOST}:${DEFAULT_GATEWAY_PORT}/v1`;
|
|
384
|
+
}
|
|
385
|
+
getApiKey() {
|
|
386
|
+
return this.config.apiKey;
|
|
387
|
+
}
|
|
388
|
+
getApiUrl() {
|
|
389
|
+
return this.config.apiBaseUrl || this.getApiUrlDefault();
|
|
390
|
+
}
|
|
391
|
+
async getOpenAiBody(prompt, context, callApiOptions) {
|
|
392
|
+
const result = await super.getOpenAiBody(prompt, context, callApiOptions);
|
|
393
|
+
if ("text" in result.body) delete result.body.text;
|
|
394
|
+
return result;
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region src/providers/openclaw/tools.ts
|
|
400
|
+
/**
|
|
401
|
+
* OpenClaw Tool Invoke Provider
|
|
402
|
+
*
|
|
403
|
+
* Simple HTTP provider for direct tool invocation via POST /tools/invoke.
|
|
404
|
+
* The tool name is extracted from the provider path: openclaw:tools:bash → tool="bash"
|
|
405
|
+
*
|
|
406
|
+
* The prompt is parsed as JSON for tool arguments. If it's not valid JSON,
|
|
407
|
+
* it's passed as a single `input` argument.
|
|
408
|
+
*
|
|
409
|
+
* Usage:
|
|
410
|
+
* openclaw:tools:bash - invoke the bash tool
|
|
411
|
+
* openclaw:tools:agents_list - invoke the agents_list tool
|
|
412
|
+
*/
|
|
413
|
+
var OpenClawToolInvokeProvider = class {
|
|
414
|
+
toolName;
|
|
415
|
+
gatewayUrl;
|
|
416
|
+
authToken;
|
|
417
|
+
openclawConfig;
|
|
418
|
+
timeoutMs;
|
|
419
|
+
constructor(toolName, providerOptions = {}) {
|
|
420
|
+
this.toolName = toolName;
|
|
421
|
+
this.openclawConfig = providerOptions.config || {};
|
|
422
|
+
const env = providerOptions.env;
|
|
423
|
+
this.gatewayUrl = resolveGatewayUrl(this.openclawConfig, env);
|
|
424
|
+
this.authToken = resolveAuthToken(this.openclawConfig, env);
|
|
425
|
+
this.timeoutMs = this.openclawConfig.timeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
426
|
+
}
|
|
427
|
+
id() {
|
|
428
|
+
return `openclaw:tools:${this.toolName}`;
|
|
429
|
+
}
|
|
430
|
+
toString() {
|
|
431
|
+
return `[OpenClaw Tool Provider ${this.toolName}]`;
|
|
432
|
+
}
|
|
433
|
+
toJSON() {
|
|
434
|
+
return { provider: this.id() };
|
|
435
|
+
}
|
|
436
|
+
async callApi(prompt) {
|
|
437
|
+
let args;
|
|
438
|
+
try {
|
|
439
|
+
args = JSON.parse(prompt);
|
|
440
|
+
} catch {
|
|
441
|
+
args = { input: prompt };
|
|
442
|
+
}
|
|
443
|
+
const url = `${this.gatewayUrl}/tools/invoke`;
|
|
444
|
+
const headers = { "Content-Type": "application/json" };
|
|
445
|
+
if (this.authToken) headers["Authorization"] = `Bearer ${this.authToken}`;
|
|
446
|
+
const body = {
|
|
447
|
+
tool: this.toolName,
|
|
448
|
+
args,
|
|
449
|
+
...this.openclawConfig.session_key && { sessionKey: this.openclawConfig.session_key }
|
|
450
|
+
};
|
|
451
|
+
logger_default.debug(`[OpenClaw Tool] POST ${url}`, {
|
|
452
|
+
tool: this.toolName,
|
|
453
|
+
args
|
|
454
|
+
});
|
|
455
|
+
try {
|
|
456
|
+
const controller = new AbortController();
|
|
457
|
+
const fetchTimeout = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
458
|
+
const response = await fetchWithProxy(url, {
|
|
459
|
+
method: "POST",
|
|
460
|
+
headers,
|
|
461
|
+
body: JSON.stringify(body),
|
|
462
|
+
signal: controller.signal
|
|
463
|
+
}).finally(() => clearTimeout(fetchTimeout));
|
|
464
|
+
if (!response.ok) {
|
|
465
|
+
const text = await response.text();
|
|
466
|
+
return { error: `OpenClaw tool invoke failed (${response.status}): ${text}` };
|
|
467
|
+
}
|
|
468
|
+
const data = await response.json();
|
|
469
|
+
if (data.ok) return { output: typeof data.result === "string" ? data.result : JSON.stringify(data.result) };
|
|
470
|
+
return { error: data.error || "Unknown tool error" };
|
|
471
|
+
} catch (err) {
|
|
472
|
+
return { error: `OpenClaw tool invoke error: ${err instanceof Error ? err.message : String(err)}` };
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region src/providers/openclaw/index.ts
|
|
479
|
+
/**
|
|
480
|
+
* Create an OpenClaw provider from a provider path string.
|
|
481
|
+
*
|
|
482
|
+
* Routing:
|
|
483
|
+
* openclaw → OpenClawChatProvider('main')
|
|
484
|
+
* openclaw:main → OpenClawChatProvider('main')
|
|
485
|
+
* openclaw:my-agent → OpenClawChatProvider('my-agent')
|
|
486
|
+
* openclaw:responses → OpenClawResponsesProvider('main')
|
|
487
|
+
* openclaw:responses:X → OpenClawResponsesProvider('X')
|
|
488
|
+
* openclaw:agent → OpenClawAgentProvider('main')
|
|
489
|
+
* openclaw:agent:X → OpenClawAgentProvider('X')
|
|
490
|
+
* openclaw:tools:bash → OpenClawToolInvokeProvider('bash')
|
|
491
|
+
*/
|
|
492
|
+
function createOpenClawProvider(providerPath, providerOptions = {}, env) {
|
|
493
|
+
const splits = providerPath.split(":");
|
|
494
|
+
const keyword = splits[1];
|
|
495
|
+
const opts = {
|
|
496
|
+
...providerOptions,
|
|
497
|
+
env
|
|
498
|
+
};
|
|
499
|
+
if (keyword === "responses") return new OpenClawResponsesProvider(splits[2] || "main", opts);
|
|
500
|
+
if (keyword === "agent") return new OpenClawAgentProvider(splits[2] || "main", opts);
|
|
501
|
+
if (keyword === "tools") {
|
|
502
|
+
const toolName = splits.slice(2).join(":");
|
|
503
|
+
if (!toolName) throw new Error("OpenClaw tools provider requires a tool name: openclaw:tools:<tool-name>");
|
|
504
|
+
return new OpenClawToolInvokeProvider(toolName, opts);
|
|
505
|
+
}
|
|
506
|
+
return new OpenClawChatProvider(splits.length > 1 ? splits.slice(1).join(":") : "main", opts);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
//#endregion
|
|
510
|
+
export { createOpenClawProvider };
|
|
511
|
+
//# sourceMappingURL=openclaw-dHLcXUWZ.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "./chunk-DHDDz29n.js";
|
|
3
|
-
import { C as getEnvString, O as cliState_default, n as getLogLevel, o as logger_default } from "./logger-
|
|
4
|
-
import "./fetch-
|
|
5
|
-
import "./cloud-
|
|
6
|
-
import "./cache-
|
|
7
|
-
import { r as importModule } from "./esm-
|
|
8
|
-
import { n as getCachedResponse, r as initializeAgenticCache, t as cacheResponse } from "./agentic-utils-
|
|
3
|
+
import { C as getEnvString, O as cliState_default, n as getLogLevel, o as logger_default } from "./logger-BotXmWKW.js";
|
|
4
|
+
import "./fetch-SRsE6Ctl.js";
|
|
5
|
+
import "./cloud-BMbRVJFw.js";
|
|
6
|
+
import "./cache-mIszOnuz.js";
|
|
7
|
+
import { r as importModule } from "./esm-CYhseqj4.js";
|
|
8
|
+
import { n as getCachedResponse, r as initializeAgenticCache, t as cacheResponse } from "./agentic-utils-D6_gzOUF.js";
|
|
9
9
|
import { createRequire } from "node:module";
|
|
10
10
|
import fs from "fs";
|
|
11
11
|
import path from "path";
|
|
@@ -379,4 +379,4 @@ var OpenCodeSDKProvider = class {
|
|
|
379
379
|
|
|
380
380
|
//#endregion
|
|
381
381
|
export { OpenCodeSDKProvider };
|
|
382
|
-
//# sourceMappingURL=opencode-sdk-
|
|
382
|
+
//# sourceMappingURL=opencode-sdk-CImWVqy9.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./chunk-FhC4c-0y.js";
|
|
2
|
-
import { b as getEnvString, i as logger_default, t as getLogLevel, w as cliState_default } from "./logger-
|
|
3
|
-
import { r as importModule } from "./esm-
|
|
4
|
-
import "./fetch-
|
|
5
|
-
import "./cache-
|
|
6
|
-
import { n as getCachedResponse, r as initializeAgenticCache, t as cacheResponse } from "./cometapi-
|
|
2
|
+
import { b as getEnvString, i as logger_default, t as getLogLevel, w as cliState_default } from "./logger-w8Ozp0Td.js";
|
|
3
|
+
import { r as importModule } from "./esm-rDtG_2rg.js";
|
|
4
|
+
import "./fetch-18MuNu9i.js";
|
|
5
|
+
import "./cache-BLLayYEN.js";
|
|
6
|
+
import { n as getCachedResponse, r as initializeAgenticCache, t as cacheResponse } from "./cometapi-ChAaRjg5.js";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import fs from "fs";
|
|
9
9
|
import path from "path";
|
|
@@ -377,4 +377,4 @@ var OpenCodeSDKProvider = class {
|
|
|
377
377
|
|
|
378
378
|
//#endregion
|
|
379
379
|
export { OpenCodeSDKProvider };
|
|
380
|
-
//# sourceMappingURL=opencode-sdk-
|
|
380
|
+
//# sourceMappingURL=opencode-sdk-CuCztr4P.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { n as getCachedResponse, r as initializeAgenticCache, t as cacheResponse } from "./cloudflare-gateway-
|
|
1
|
+
import { A as getLogLevel, I as getEnvString, L as cliState_default, T as importModule, j as logger_default } from "./server/index.js";
|
|
2
|
+
import { n as getCachedResponse, r as initializeAgenticCache, t as cacheResponse } from "./cloudflare-gateway-Djf3F3_H.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
import path from "path";
|
|
@@ -373,4 +373,4 @@ var OpenCodeSDKProvider = class {
|
|
|
373
373
|
|
|
374
374
|
//#endregion
|
|
375
375
|
export { OpenCodeSDKProvider };
|
|
376
|
-
//# sourceMappingURL=opencode-sdk-
|
|
376
|
+
//# sourceMappingURL=opencode-sdk-DhcfRbBH.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_logger = require('./logger-
|
|
2
|
-
const require_esm = require('./esm-
|
|
3
|
-
require('./fetch-
|
|
4
|
-
require('./cache-
|
|
5
|
-
const require_cometapi = require('./cometapi-
|
|
1
|
+
const require_logger = require('./logger-BdZ-IqBc.cjs');
|
|
2
|
+
const require_esm = require('./esm-BQkx5roy.cjs');
|
|
3
|
+
require('./fetch-ZMn_oemb.cjs');
|
|
4
|
+
require('./cache-7xULbvt3.cjs');
|
|
5
|
+
const require_cometapi = require('./cometapi-JbvOJSCO.cjs');
|
|
6
6
|
let fs = require("fs");
|
|
7
7
|
fs = require_logger.__toESM(fs);
|
|
8
8
|
let path = require("path");
|
|
@@ -380,4 +380,4 @@ var OpenCodeSDKProvider = class {
|
|
|
380
380
|
|
|
381
381
|
//#endregion
|
|
382
382
|
exports.OpenCodeSDKProvider = OpenCodeSDKProvider;
|
|
383
|
-
//# sourceMappingURL=opencode-sdk-
|
|
383
|
+
//# sourceMappingURL=opencode-sdk-mqF-Oj3f.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_logger = require('./logger-
|
|
2
|
-
const require_esm = require('./esm-
|
|
3
|
-
require('./types-
|
|
4
|
-
require('./tables-
|
|
5
|
-
const require_store = require('./store-
|
|
1
|
+
const require_logger = require('./logger-BdZ-IqBc.cjs');
|
|
2
|
+
const require_esm = require('./esm-BQkx5roy.cjs');
|
|
3
|
+
require('./types-BIfttHrT.cjs');
|
|
4
|
+
require('./tables-B9E1kRp-.cjs');
|
|
5
|
+
const require_store = require('./store-BqwfFEyF.cjs');
|
|
6
6
|
let path = require("path");
|
|
7
7
|
path = require_logger.__toESM(path);
|
|
8
8
|
let express = require("express");
|
|
@@ -412,4 +412,4 @@ async function stopOTLPReceiver() {
|
|
|
412
412
|
//#endregion
|
|
413
413
|
exports.startOTLPReceiver = startOTLPReceiver;
|
|
414
414
|
exports.stopOTLPReceiver = stopOTLPReceiver;
|
|
415
|
-
//# sourceMappingURL=otlpReceiver-
|
|
415
|
+
//# sourceMappingURL=otlpReceiver-B6Xo4KZM.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as logger_default } from "./logger-
|
|
2
|
-
import { t as getDirectory } from "./esm-
|
|
3
|
-
import "./types-
|
|
4
|
-
import "./tables-
|
|
5
|
-
import { n as getTraceStore } from "./store-
|
|
1
|
+
import { i as logger_default } from "./logger-w8Ozp0Td.js";
|
|
2
|
+
import { t as getDirectory } from "./esm-rDtG_2rg.js";
|
|
3
|
+
import "./types-DMVjYLpx.js";
|
|
4
|
+
import "./tables-D-NSwNIb.js";
|
|
5
|
+
import { n as getTraceStore } from "./store-2ocbYY9D.js";
|
|
6
6
|
import path from "path";
|
|
7
7
|
import express from "express";
|
|
8
8
|
import protobuf from "protobufjs";
|
|
@@ -408,4 +408,4 @@ async function stopOTLPReceiver() {
|
|
|
408
408
|
|
|
409
409
|
//#endregion
|
|
410
410
|
export { startOTLPReceiver, stopOTLPReceiver };
|
|
411
|
-
//# sourceMappingURL=otlpReceiver-
|
|
411
|
+
//# sourceMappingURL=otlpReceiver-BO0rbDzh.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { o as logger_default } from "./logger-
|
|
3
|
-
import "./types-
|
|
4
|
-
import { t as getDirectory } from "./esm-
|
|
5
|
-
import "./tables-
|
|
6
|
-
import { n as getTraceStore } from "./store-
|
|
2
|
+
import { o as logger_default } from "./logger-BotXmWKW.js";
|
|
3
|
+
import "./types-t52w-XsS.js";
|
|
4
|
+
import { t as getDirectory } from "./esm-CYhseqj4.js";
|
|
5
|
+
import "./tables-C7TT2XVn.js";
|
|
6
|
+
import { n as getTraceStore } from "./store-D4gdn9ih.js";
|
|
7
7
|
import path from "path";
|
|
8
8
|
import express from "express";
|
|
9
9
|
import protobuf from "protobufjs";
|
|
@@ -409,4 +409,4 @@ async function stopOTLPReceiver() {
|
|
|
409
409
|
|
|
410
410
|
//#endregion
|
|
411
411
|
export { startOTLPReceiver, stopOTLPReceiver };
|
|
412
|
-
//# sourceMappingURL=otlpReceiver-
|
|
412
|
+
//# sourceMappingURL=otlpReceiver-Dg817agV.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as getTraceStore, j as logger_default, w as getDirectory } from "./server/index.js";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import express from "express";
|
|
4
4
|
import protobuf from "protobufjs";
|
|
@@ -404,4 +404,4 @@ async function stopOTLPReceiver() {
|
|
|
404
404
|
|
|
405
405
|
//#endregion
|
|
406
406
|
export { startOTLPReceiver, stopOTLPReceiver };
|
|
407
|
-
//# sourceMappingURL=otlpReceiver-
|
|
407
|
+
//# sourceMappingURL=otlpReceiver-DmRb0NBj.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { o as logger_default } from "./logger-
|
|
2
|
+
import { o as logger_default } from "./logger-BotXmWKW.js";
|
|
3
3
|
|
|
4
4
|
//#region src/providers/providerRegistry.ts
|
|
5
5
|
/**
|
|
@@ -44,4 +44,4 @@ const providerRegistry = new ProviderRegistry();
|
|
|
44
44
|
|
|
45
45
|
//#endregion
|
|
46
46
|
export { providerRegistry as t };
|
|
47
|
-
//# sourceMappingURL=providerRegistry-
|
|
47
|
+
//# sourceMappingURL=providerRegistry-Xf0qdqGQ.js.map
|