promptfoo 0.121.1 → 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-xrUGFA6n.js → accounts-B2XmGjty.js} +5 -5
- package/dist/src/{accounts-Bx-x3bmW.cjs → accounts-BPyfpSeU.cjs} +5 -5
- package/dist/src/{accounts-CMqkzrVf.js → accounts-CFLK3mnD.js} +6 -6
- package/dist/src/{accounts-BgNJDBE6.js → accounts-Xatc0RYb.js} +5 -5
- package/dist/src/{agentic-utils-BKIN5PKu.js → agentic-utils-36epdqwB.js} +3 -3
- package/dist/src/{cometapi-DkXrKi5z.js → agentic-utils-D8yXo5Lm.js} +4 -61
- package/dist/src/{cometapi-vY6aDZgo.cjs → agentic-utils-DAVsChuB.cjs} +24 -62
- package/dist/src/agentic-utils-DIYAAYE7.js +153 -0
- package/dist/src/{agents-C-dDThPK.js → agents-BBVJCIYr.js} +226 -13
- package/dist/src/{agents-CErsqg5U.cjs → agents-BBWxKSM0.cjs} +7 -7
- package/dist/src/{agents-Dy2YpZpa.js → agents-Bqgfdokm.js} +227 -14
- package/dist/src/{agents-B0f4HICh.cjs → agents-CAYbM7qD.cjs} +226 -13
- package/dist/src/{agents-CVIn-Utx.js → agents-CLQ-P15P.js} +7 -7
- package/dist/src/{agents-DeH4Gu94.js → agents-CgBniSlI.js} +8 -8
- package/dist/src/{agents-CXknwsFX.js → agents-DSSTV4bv.js} +226 -13
- package/dist/src/{agents-aF4-T121.js → agents-wg3ohknq.js} +7 -7
- package/dist/src/{aimlapi-tg0Gkcvr.cjs → aimlapi-Bv8Fmc-b.cjs} +14 -14
- package/dist/src/{aimlapi-BNfTBexL.js → aimlapi-BwGC1TtS.js} +13 -13
- package/dist/src/{aimlapi-BAGZDo5G.js → aimlapi-DaC3qZ-o.js} +14 -14
- package/dist/src/{aimlapi-DHRKlBEA.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-charts-BnDWwBlI.js +36 -0
- package/dist/src/app/assets/vendor-markdown-Bz7N-ca6.js +29 -0
- package/dist/src/app/index.html +4 -4
- package/dist/src/{audio-tf_NBjlC.js → audio-Bn44pQxv.js} +4 -4
- package/dist/src/{audio-CHQ4r-RV.js → audio-DDA5WHdx.js} +4 -4
- package/dist/src/{audio-BWeaWovU.cjs → audio-DVFjQ67_.cjs} +4 -4
- package/dist/src/{audio-BRODU0UK.js → audio-DjU9GswO.js} +5 -5
- package/dist/src/{base-DBtwl2FR.cjs → base-BboXIF_0.cjs} +3 -3
- package/dist/src/{base-B4QJRyFS.js → base-CKjwebIH.js} +3 -3
- package/dist/src/{base-B0tcrnq_.js → base-CqzQ4K8j.js} +3 -3
- package/dist/src/{base-fEDN28WM.js → base-Cz2ZC_iA.js} +3 -3
- package/dist/src/{blobs-BAU-dXan.js → blobs-B1JriOyi.js} +3 -3
- package/dist/src/{blobs-qTYm-1PY.js → blobs-BUWmKWzo.js} +3 -3
- package/dist/src/{blobs-DvS-O6be.cjs → blobs-C6j0bvFz.cjs} +3 -3
- package/dist/src/{blobs-Bpg5rH6i.js → blobs-DXTl6J3H.js} +3 -3
- package/dist/src/{cache-COish3-W.cjs → cache-C5yFZ4gC.cjs} +75 -58
- package/dist/src/{cache-8XhNqPKW.js → cache-CaT5tPgo.js} +75 -58
- package/dist/src/cache-CyCanoMu.js +6 -0
- package/dist/src/{cache-CG0SlR1d.js → cache-DSqR6ezl.js} +75 -58
- package/dist/src/cache-Df_QFDNu.cjs +5 -0
- package/dist/src/{cache-D3eqDYGU.js → cache-HP0NP4k3.js} +75 -58
- package/dist/src/{chat-DHMH-N64.js → chat-B-52XYI1.js} +12 -12
- package/dist/src/{chat-BKm79wib.js → chat-B0iaWhoh.js} +16 -14
- package/dist/src/{chat-DxysjBvt.js → chat-BE0qTA8e.js} +13 -13
- package/dist/src/{chat-CRWNNq73.js → chat-BEwdgGEg.js} +16 -14
- package/dist/src/{chat-2K608PeQ.cjs → chat-BtIKkLKx.cjs} +13 -13
- package/dist/src/{chat-DaqekjFr.cjs → chat-CM8qWR3_.cjs} +17 -15
- package/dist/src/{chat-CM_kyI8B.js → chat-DK1U-eZ-.js} +12 -12
- package/dist/src/{chat-CznLWr_D.js → chat-pxmiVpWe.js} +16 -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-CJH22shf.cjs → claude-agent-sdk-8ddRp1L2.cjs} +35 -17
- package/dist/src/{claude-agent-sdk-Dy5lT-Tx.js → claude-agent-sdk-Bq5EArsX.js} +33 -15
- package/dist/src/{claude-agent-sdk-BLTu0WBO.js → claude-agent-sdk-CMjh4LFH.js} +33 -15
- package/dist/src/{claude-agent-sdk-D6_k9FKA.js → claude-agent-sdk-HgbFioFw.js} +33 -15
- package/dist/src/cloud-DE3t1-ZI.js +4 -0
- package/dist/src/{cloud-Bc9526yV.js → cloud-z8KZpUoa.js} +3 -3
- package/dist/src/{cloudflare-ai-CWWJCRim.js → cloudflare-ai-BGyXlpXJ.js} +13 -13
- package/dist/src/{cloudflare-ai-C9r2sRhw.js → cloudflare-ai-Bbp26N0L.js} +13 -13
- package/dist/src/{cloudflare-ai-ClWSdor4.cjs → cloudflare-ai-C62x6MQG.cjs} +14 -14
- package/dist/src/{cloudflare-ai-ICsOuD-z.js → cloudflare-ai-DdKP9TKT.js} +14 -14
- package/dist/src/{cloudflare-gateway-D6xFc5pa.js → cloudflare-gateway-BwAaUgeW.js} +14 -14
- package/dist/src/{cloudflare-gateway-D6O7AlYb.js → cloudflare-gateway-D-e9i1Sn.js} +15 -15
- package/dist/src/{cloudflare-gateway-pXGHxJ47.js → cloudflare-gateway-DXhtXDRb.js} +15 -163
- package/dist/src/{cloudflare-gateway-C2_-KG5o.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-Bbjp5V4x.js → cometapi-hhL4TAh3.js} +14 -14
- package/dist/src/{cometapi-BasUi7-_.js → cometapi-sp7sJpBD.js} +15 -15
- package/dist/src/{completion-C_P3ypkJ.js → completion-BCimtq-h.js} +6 -6
- package/dist/src/{completion-6Mx_iXxK.js → completion-DCjv7RZ3.js} +6 -6
- package/dist/src/{completion-CDOouNzq.cjs → completion-DlXUhj5c.cjs} +6 -6
- package/dist/src/{completion-C5rtR_9P.js → completion-DoYy49ti.js} +6 -6
- package/dist/src/{createHash-CfZSc0b4.cjs → createHash-BYwImsYv.cjs} +2 -2
- package/dist/src/{docker-BwsKwxFs.cjs → docker-Cqj2-QVi.cjs} +14 -14
- package/dist/src/{docker-CZnqU1XV.js → docker-CxCkwMzc.js} +13 -13
- package/dist/src/{docker-DzxyDPIj.js → docker-DpguQj-w.js} +14 -14
- package/dist/src/{docker-5KcG-_86.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-DmFyWU7i.js → eval-BTqTn7lb.js} +10 -10
- package/dist/src/{evalResult-CDQiuUuf.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-CTG2AHOS.js → evalResult-DUDShQrm.js} +7 -7
- package/dist/src/{evalResult-Dap2CekP.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-DPFRbFIL.js → evaluator-BcvOGaam.js} +833 -79
- package/dist/src/{extractor-YMU_Gvt8.js → extractor-C8XwivI9.js} +6 -6
- package/dist/src/{extractor-CFG6bcWJ.js → extractor-CAZ2G3Kh.js} +6 -6
- package/dist/src/{extractor-DX36oYEv.cjs → extractor-DG3sSfXE.cjs} +6 -6
- package/dist/src/{extractor-M67RUtg6.js → extractor-D_wd8jxt.js} +6 -6
- package/dist/src/{fetch-4M3YRaqL.js → fetch-BiYv2BZc.js} +3 -3
- package/dist/src/{fetch-BxUk8odA.cjs → fetch-BnR9wSnm.cjs} +3 -3
- package/dist/src/{fetch-60Gzydls.js → fetch-CVAtKnI3.js} +3 -3
- package/dist/src/{fetch-BMv0O527.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-DOXycdlG.cjs → graders-BElhu9ZY.cjs} +126 -55
- package/dist/src/{graders-R9rYUM0d.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-CpdqD9PI.js → graders-DG7mhg-b.js} +120 -55
- package/dist/src/graders-DjCXfj0l.cjs +32 -0
- package/dist/src/{graders-CHO8EPM4.js → graders-RjHF8VfG.js} +120 -55
- package/dist/src/graders-kHzIWOKu.js +32 -0
- package/dist/src/{image-DTedmQPg.cjs → image--F58eEIn.cjs} +6 -6
- package/dist/src/{image-DJEvKveK.js → image-6WQXK8m8.js} +4 -4
- package/dist/src/{image-pAX56tPG.js → image-B8b6f36E.js} +6 -6
- package/dist/src/{image-BmEZqVmk.js → image-CoxZp9PZ.js} +6 -6
- package/dist/src/{image-gvmivTEe.js → image-DO0RYnjH.js} +5 -5
- package/dist/src/{image-CBBVXWuT.js → image-PoF6DN3x.js} +6 -6
- package/dist/src/{image-CDLQOcqT.cjs → image-fza3zuKs.cjs} +4 -4
- package/dist/src/{image-tL5hIOFh.js → image-xNbw5ph2.js} +4 -4
- package/dist/src/index.cjs +863 -110
- package/dist/src/index.d.cts +833 -60
- package/dist/src/index.d.ts +833 -60
- package/dist/src/index.js +860 -108
- package/dist/src/{interactiveCheck-BgLZUIt3.js → interactiveCheck-BnMYOjMu.js} +2 -2
- package/dist/src/{knowledgeBase-CoU-UQBg.js → knowledgeBase-Bi7CmDbx.js} +7 -7
- package/dist/src/{knowledgeBase-CLJybhnF.js → knowledgeBase-Ce3ofVan.js} +8 -8
- package/dist/src/{knowledgeBase-DjWPVqSb.js → knowledgeBase-DFRXPZl_.js} +7 -7
- package/dist/src/{knowledgeBase-wkxuRFhA.cjs → knowledgeBase-DqrLX8fy.cjs} +7 -7
- package/dist/src/{litellm-B9Hysuri.js → litellm-Bo2gQXpo.js} +16 -15
- package/dist/src/{litellm-ePxtr9F1.js → litellm-CKiAxnoM.js} +15 -14
- package/dist/src/{litellm-NYpQ8RQu.cjs → litellm-CnHI69aj.cjs} +16 -15
- package/dist/src/{litellm-CTfa0hqi.js → litellm-Tc294Jhj.js} +15 -14
- 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-BW9IRGIc.js → luma-ray-0ehMPt5N.js} +10 -10
- package/dist/src/{luma-ray-BE2mOt6N.js → luma-ray-C9q8rdQe.js} +9 -9
- package/dist/src/{luma-ray-Cm1KZBhs.js → luma-ray-DP0QA9qn.js} +9 -9
- package/dist/src/{luma-ray-B0GGNRc1.cjs → luma-ray-m9Ku2meV.cjs} +9 -9
- package/dist/src/main.js +69 -71
- package/dist/src/{messages-1x9atZmP.js → messages-DJNo37Ko.js} +14 -9
- package/dist/src/{messages-BLbWdsyt.js → messages-Dy9QecMs.js} +14 -9
- package/dist/src/{messages-1JrJs91T.cjs → messages-HJsyEh4o.cjs} +15 -10
- package/dist/src/{messages-D8EA0oDc.js → messages-biC_ex-p.js} +14 -9
- package/dist/src/{modelslab-C1OLRmVX.js → modelslab-B5J-ZM5c.js} +9 -9
- package/dist/src/{modelslab-CqXBy3U8.js → modelslab-BI458moT.js} +10 -10
- package/dist/src/{modelslab-X5-4LroM.js → modelslab-BTOT8FUO.js} +9 -9
- package/dist/src/{modelslab-DcOSFwKh.cjs → modelslab-IQbNg-r7.cjs} +9 -9
- package/dist/src/{nova-reel-DihqLeol.js → nova-reel-BZ9y-Y5s.js} +9 -9
- package/dist/src/{nova-reel-D9xfaMBs.cjs → nova-reel-CE5etkv9.cjs} +9 -9
- package/dist/src/{nova-reel-D2ZkOSyr.js → nova-reel-DEeQlnOJ.js} +10 -10
- package/dist/src/{nova-reel-BgS1ZWuK.js → nova-reel-Xw1SXLpg.js} +9 -9
- package/dist/src/{nova-sonic-Q3BOJeig.js → nova-sonic-DWswpN1E.js} +7 -7
- package/dist/src/{nova-sonic-DezhVUYT.js → nova-sonic-DXTLpi-r.js} +6 -6
- package/dist/src/{nova-sonic-DVu3mMIy.cjs → nova-sonic-N0yCm0vb.cjs} +6 -6
- package/dist/src/{nova-sonic-P-CdUMlV.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-Bv1DINsX.js → openclaw-0Sv7AK3O.js} +172 -109
- package/dist/src/{openclaw-DAfWQn-o.cjs → openclaw-CXxbKgDH.cjs} +174 -110
- package/dist/src/{openclaw-BiSZPL7J.js → openclaw-D1FSCps-.js} +172 -109
- package/dist/src/{openclaw-D1D_ej1z.js → openclaw-D2ENvu7a.js} +173 -110
- package/dist/src/{opencode-sdk-D95s6SnR.js → opencode-sdk-C71Z0ehR.js} +13 -13
- package/dist/src/{opencode-sdk-DxUPkLT7.js → opencode-sdk-CHCs7dEb.js} +12 -12
- package/dist/src/{opencode-sdk-C7m-wRfI.js → opencode-sdk-DDxj4QqH.js} +12 -12
- package/dist/src/{opencode-sdk-CfaLN8PY.cjs → opencode-sdk-WWJhnbKr.cjs} +16 -16
- package/dist/src/{otlpReceiver-g3ByGaXs.js → otlpReceiver-C9KlUtxh.js} +6 -6
- package/dist/src/{otlpReceiver--AIRW_S4.js → otlpReceiver-CZL48YfC.js} +6 -6
- package/dist/src/{otlpReceiver-Bn5wGB1v.js → otlpReceiver-CavGAA6k.js} +6 -6
- package/dist/src/{otlpReceiver-Diec4cln.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-CFu-TZl-.cjs → providers-CScd1wN6.cjs} +733 -464
- package/dist/src/{providers-CFLy1_ji.js → providers-Ch6Mr0gn.js} +795 -526
- package/dist/src/{providers-BKRJTjBz.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-B3HvufyI.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-CI6gYJVI.js → quiverai-BeofbLVc.js} +4 -4
- package/dist/src/{quiverai-MHSxbmmZ.js → quiverai-CCQn73lq.js} +5 -5
- package/dist/src/{quiverai-CLkWkyZc.cjs → quiverai-CcUhPIBg.cjs} +4 -4
- package/dist/src/{quiverai-C2jVwbH1.js → quiverai-DVSEqJiq.js} +4 -4
- package/dist/src/{render-Drod8m7K.js → render-BHl6QVq9.js} +3 -3
- package/dist/src/{responses-CGw0DCzh.js → responses-BKP_WYis.js} +16 -12
- package/dist/src/{responses-BKqJmhhc.js → responses-CQb1Tj69.js} +16 -12
- package/dist/src/{responses-jxdehPkC.js → responses-CgNyTPsY.js} +16 -12
- package/dist/src/{responses-tD4Bd4dc.cjs → responses-mo0KQDbu.cjs} +16 -12
- 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-BK4Zb993.js → sagemaker-CVv8W7so.js} +17 -17
- package/dist/src/{sagemaker-D2Q1c-sD.js → sagemaker-CqeASYE5.js} +17 -17
- package/dist/src/{sagemaker-BfiWTmvn.js → sagemaker-MUbD5V3v.js} +18 -18
- package/dist/src/{sagemaker-CcQHM1jV.cjs → sagemaker-jiw1wQa-.cjs} +17 -17
- package/dist/src/{scanner-J8CA3LsV.js → scanner-DVDeUz1r.js} +10 -10
- package/dist/src/server/index.js +864 -112
- package/dist/src/server-B0Xh1Gx-.js +7 -0
- package/dist/src/{server-B0PPuDw-.cjs → server-BtoCXeXI.cjs} +4 -4
- package/dist/src/{server-BC7XJFgr.js → server-CP9qKM40.js} +4 -4
- package/dist/src/{server-OAs3nBRT.js → server-Cns05F1j.js} +5 -5
- package/dist/src/server-DJTKu9IR.cjs +5 -0
- package/dist/src/{server-DbFphssR.js → server-DZ9MtCn0.js} +6 -6
- package/dist/src/{signal-BOTbd53Z.js → signal-C3ZTsUgi.js} +3 -3
- package/dist/src/{slack-DXMKtA-f.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-DOdy_kyv.js → slack-DCEV-vWP.js} +2 -2
- package/dist/src/store-C5u6MgC8.js +6 -0
- package/dist/src/{store-BSc-TF2w.cjs → store-CLyU7AtI.cjs} +17 -5
- package/dist/src/store-CNHk-De4.cjs +5 -0
- package/dist/src/{store-DQLEjuEO.js → store-Cj258DgL.js} +17 -5
- package/dist/src/{store-D1tv90v3.js → store-P8OKm19S.js} +17 -5
- package/dist/src/{store-Ub2vaGJ1.js → store-VB0GP46K.js} +17 -5
- package/dist/src/{tables-xKANLRBD.js → tables-BEIFz2tM.js} +3 -3
- package/dist/src/{tables-C7K-XKWp.cjs → tables-BdZQEpRz.cjs} +3 -3
- package/dist/src/{tables-D36WTqKX.js → tables-DmzvLbeZ.js} +3 -3
- package/dist/src/{tables-5EvT_Bwn.js → tables-kC7R5kiK.js} +3 -3
- package/dist/src/{telemetry-C2YDkUQH.js → telemetry-BnH5VJAU.js} +4 -4
- package/dist/src/{telemetry-C15ziL8u.js → telemetry-BugWqKiu.js} +4 -4
- package/dist/src/{telemetry-DMb2Mpfm.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-CbrnxHp_.cjs → telemetry-re627Lre.cjs} +4 -4
- package/dist/src/{transcription-CL78qbOU.cjs → transcription-BvtsrzRG.cjs} +13 -13
- package/dist/src/{transcription-DAtxHhAM.js → transcription-CaMivnjG.js} +13 -13
- package/dist/src/{transcription-QHh3AH6Z.js → transcription-DOMMTu01.js} +14 -14
- package/dist/src/{transcription-LNZTNUUL.js → transcription-Hb3VnC4M.js} +13 -13
- package/dist/src/{transform-DOcQeLld.cjs → transform-0BwoBsvO.cjs} +19 -5
- package/dist/src/{transform-DGxXocjk.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-Cgi24fJ7.js → transform-DrleutM3.js} +8 -6
- package/dist/src/{transform-DGLazrMm.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-CH3Ge2sE.js → types-CIhFeUC4.js} +45 -11
- package/dist/src/{types-CN_TZ2GJ.js → types-Cd3ygw8W.js} +45 -11
- package/dist/src/{types-LJ0r3wbR.cjs → types-D8cGDZbL.cjs} +46 -12
- package/dist/src/{types-CLKiCBW3.js → types-q8GXGF65.js} +45 -11
- package/dist/src/{util-CchiqXh_.cjs → util--9u9UVCt.cjs} +3 -3
- package/dist/src/{util-5cB-L7U3.js → util-BLvy9qfE.js} +7 -11
- package/dist/src/{util-YT5HPZaS.js → util-Bm3E9jpK.js} +7 -11
- package/dist/src/{util-6-GqIvzS.js → util-BtoGs5Cb.js} +18 -4
- package/dist/src/{util-Db0a0AFH.cjs → util-CFj4YKIn.cjs} +18 -4
- package/dist/src/{util-Dlz_Wvgm.js → util-CMMkIxfU.js} +7 -11
- package/dist/src/{util-Betm42rL.js → util-CgDCK4KI.js} +18 -4
- package/dist/src/{util-Yz-1aEhW.cjs → util-CuLo2pMR.cjs} +7 -11
- package/dist/src/{util-C-PPYSMq.js → util-DM2rTn_6.js} +18 -4
- package/dist/src/{util-B7T3SiBS.js → util-DMFeUvLz.js} +3 -3
- package/dist/src/{util-ZZH-3QZz.js → util-DbVG-yZU.js} +3 -3
- package/dist/src/{util-DaWTWKBK.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 +38 -38
- package/dist/src/app/assets/index-BFCZg7hQ.js +0 -439
- package/dist/src/app/assets/index-NCn4eVBv.css +0 -1
- package/dist/src/app/assets/sync-9qqYcY-B.js +0 -4
- package/dist/src/app/assets/vendor-charts-CCl15Imd.js +0 -36
- package/dist/src/app/assets/vendor-markdown-0tekx3KX.js +0 -29
- package/dist/src/cache-Bbn1Nyrd.cjs +0 -5
- package/dist/src/cache-BwsMSda7.js +0 -6
- package/dist/src/cloud-DmE0EwsY.js +0 -4
- package/dist/src/eval-17JizQIv.js +0 -15
- package/dist/src/evalResult-Cqj8pldJ.js +0 -12
- package/dist/src/evalResult-DvcJAWJU.cjs +0 -10
- package/dist/src/evalResult-Hftn-S_i.js +0 -10
- package/dist/src/evaluator-B2CFNt-P.js +0 -36
- package/dist/src/fetch-KV5kNASw.js +0 -5
- package/dist/src/graders-Bu0H9nXi.js +0 -32
- package/dist/src/graders-Cfhkvx-e.js +0 -34
- package/dist/src/graders-DClJVpGP.cjs +0 -32
- package/dist/src/graders-DcnJsrMO.js +0 -32
- package/dist/src/providers-C1rOSHiR.js +0 -32
- package/dist/src/providers-CxmDwEFf.cjs +0 -31
- package/dist/src/providers-Dodakqr0.js +0 -30
- package/dist/src/providers-GIQ2TcsA.js +0 -30
- package/dist/src/rubyUtils-BUHu6PhO.js +0 -5
- package/dist/src/rubyUtils-CP42kMvq.cjs +0 -4
- package/dist/src/server-B1vi21hA.js +0 -7
- package/dist/src/server-Cm9Kai_h.cjs +0 -5
- package/dist/src/store-BNmZ1KAz.cjs +0 -5
- package/dist/src/store-BltJg2cd.js +0 -6
- package/dist/src/telemetry-5BCRNBbe.cjs +0 -5
- package/dist/src/telemetry-D4W5hboe.js +0 -7
- package/dist/src/transform-DTGDnAzW.js +0 -6
- package/dist/src/transform-m3qNw4KP.cjs +0 -5
|
@@ -1,90 +1,111 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as VERSION, p as REQUEST_TIMEOUT_MS, t as fetchWithProxy } from "./fetch-
|
|
3
|
-
import "./esm-
|
|
4
|
-
import "./types-
|
|
5
|
-
import "./cache-
|
|
1
|
+
import { C as getEnvString, a as logger } from "./logger-BnkjG2jt.js";
|
|
2
|
+
import { P as VERSION, p as REQUEST_TIMEOUT_MS, t as fetchWithProxy } from "./fetch-BiYv2BZc.js";
|
|
3
|
+
import "./esm-CKWP3u_P.js";
|
|
4
|
+
import "./types-Cd3ygw8W.js";
|
|
5
|
+
import "./cache-HP0NP4k3.js";
|
|
6
6
|
import "./genaiTracer-70Z8BIuV.js";
|
|
7
|
-
import "./pythonUtils-
|
|
8
|
-
import "./util-
|
|
9
|
-
import { t as OpenAiChatCompletionProvider } from "./chat-
|
|
10
|
-
import "./transform-
|
|
11
|
-
import { t as OpenAiResponsesProvider } from "./responses-
|
|
12
|
-
import "./openai-
|
|
13
|
-
import "./util-
|
|
7
|
+
import "./pythonUtils-Bzwbgpbg.js";
|
|
8
|
+
import "./util-BLvy9qfE.js";
|
|
9
|
+
import { t as OpenAiChatCompletionProvider } from "./chat-B0iaWhoh.js";
|
|
10
|
+
import "./transform-B2-jIv68.js";
|
|
11
|
+
import { t as OpenAiResponsesProvider } from "./responses-CgNyTPsY.js";
|
|
12
|
+
import "./openai-D6wITiVn.js";
|
|
13
|
+
import "./util-BtoGs5Cb.js";
|
|
14
14
|
import fs from "fs";
|
|
15
15
|
import path from "path";
|
|
16
16
|
import os from "os";
|
|
17
17
|
import crypto from "crypto";
|
|
18
18
|
import WebSocket from "ws";
|
|
19
|
+
import JSON5 from "json5";
|
|
19
20
|
//#region src/providers/openclaw/shared.ts
|
|
20
21
|
const DEFAULT_GATEWAY_PORT = 18789;
|
|
21
22
|
const DEFAULT_GATEWAY_HOST = "127.0.0.1";
|
|
22
23
|
/**
|
|
23
|
-
* Strip JSON5 syntax (comments and trailing commas) for JSON.parse compatibility.
|
|
24
|
-
* Uses a state machine to avoid corrupting strings containing // or slash characters.
|
|
25
|
-
*/
|
|
26
|
-
function stripJson5Syntax(raw) {
|
|
27
|
-
let result = "";
|
|
28
|
-
let i = 0;
|
|
29
|
-
let inString = false;
|
|
30
|
-
let stringQuote = "";
|
|
31
|
-
let escape = false;
|
|
32
|
-
while (i < raw.length) {
|
|
33
|
-
const ch = raw[i];
|
|
34
|
-
if (inString) {
|
|
35
|
-
result += ch;
|
|
36
|
-
if (escape) escape = false;
|
|
37
|
-
else if (ch === "\\") escape = true;
|
|
38
|
-
else if (ch === stringQuote) inString = false;
|
|
39
|
-
i++;
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
if (ch === "\"" || ch === "'") {
|
|
43
|
-
inString = true;
|
|
44
|
-
stringQuote = ch;
|
|
45
|
-
result += ch;
|
|
46
|
-
i++;
|
|
47
|
-
} else if (ch === "/" && raw[i + 1] === "/") while (i < raw.length && raw[i] !== "\n") i++;
|
|
48
|
-
else if (ch === "/" && raw[i + 1] === "*") {
|
|
49
|
-
i += 2;
|
|
50
|
-
while (i < raw.length - 1 && !(raw[i] === "*" && raw[i + 1] === "/")) i++;
|
|
51
|
-
if (i < raw.length - 1 && raw[i] === "*" && raw[i + 1] === "/") i += 2;
|
|
52
|
-
} else if (ch === ",") {
|
|
53
|
-
let j = i + 1;
|
|
54
|
-
while (j < raw.length && (raw[j] === " " || raw[j] === " " || raw[j] === "\n" || raw[j] === "\r")) j++;
|
|
55
|
-
if (j < raw.length && (raw[j] === "}" || raw[j] === "]")) i++;
|
|
56
|
-
else {
|
|
57
|
-
result += ch;
|
|
58
|
-
i++;
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
result += ch;
|
|
62
|
-
i++;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
24
|
* Cached config to avoid re-reading the file multiple times during provider init.
|
|
69
25
|
*/
|
|
70
26
|
let cachedConfig;
|
|
27
|
+
let cachedConfigPath;
|
|
28
|
+
function resolveConfigPath(env) {
|
|
29
|
+
return env?.OPENCLAW_CONFIG_PATH || getEnvString("OPENCLAW_CONFIG_PATH") || path.join(os.homedir(), ".openclaw", "openclaw.json");
|
|
30
|
+
}
|
|
31
|
+
function normalizeGatewayUrl(url, transport) {
|
|
32
|
+
const trimmed = url.trim();
|
|
33
|
+
if (!trimmed) return;
|
|
34
|
+
if (transport === "http") {
|
|
35
|
+
if (trimmed.startsWith("wss://")) return `https://${trimmed.slice(6)}`;
|
|
36
|
+
if (trimmed.startsWith("ws://")) return `http://${trimmed.slice(5)}`;
|
|
37
|
+
return trimmed;
|
|
38
|
+
}
|
|
39
|
+
if (trimmed.startsWith("https://")) return `wss://${trimmed.slice(8)}`;
|
|
40
|
+
if (trimmed.startsWith("http://")) return `ws://${trimmed.slice(7)}`;
|
|
41
|
+
return trimmed;
|
|
42
|
+
}
|
|
43
|
+
function resolveGatewayHost(gatewayConfig) {
|
|
44
|
+
const bind = gatewayConfig?.bind?.trim();
|
|
45
|
+
const customBindHost = gatewayConfig?.customBindHost?.trim();
|
|
46
|
+
if (!bind || bind === "auto" || bind === "loopback" || bind === "lan" || bind === "tailnet" || bind === "0.0.0.0" || bind === "::" || bind === "127.0.0.1" || bind === "localhost" || bind === "::1") return DEFAULT_GATEWAY_HOST;
|
|
47
|
+
if (bind === "custom") {
|
|
48
|
+
if (!customBindHost || customBindHost === "0.0.0.0" || customBindHost === "::" || customBindHost === "127.0.0.1" || customBindHost === "localhost" || customBindHost === "::1") return DEFAULT_GATEWAY_HOST;
|
|
49
|
+
return customBindHost;
|
|
50
|
+
}
|
|
51
|
+
return bind;
|
|
52
|
+
}
|
|
53
|
+
function buildLocalGatewayUrl(gatewayConfig, transport) {
|
|
54
|
+
const scheme = transport === "ws" ? gatewayConfig?.tls?.enabled ? "wss" : "ws" : gatewayConfig?.tls?.enabled ? "https" : "http";
|
|
55
|
+
const port = gatewayConfig?.port ?? 18789;
|
|
56
|
+
return `${scheme}://${resolveGatewayHost(gatewayConfig)}:${port}`;
|
|
57
|
+
}
|
|
58
|
+
function resolveGatewayUrlFromConfig(openclawConfig, transport) {
|
|
59
|
+
const gatewayConfig = openclawConfig?.gateway;
|
|
60
|
+
if (!gatewayConfig) return;
|
|
61
|
+
if (gatewayConfig.mode === "remote") {
|
|
62
|
+
const remoteUrl = normalizeGatewayUrl(gatewayConfig.remote?.url ?? "", transport);
|
|
63
|
+
if (remoteUrl) return remoteUrl;
|
|
64
|
+
}
|
|
65
|
+
return buildLocalGatewayUrl(gatewayConfig, transport);
|
|
66
|
+
}
|
|
67
|
+
function toAuthSecret(kind, value) {
|
|
68
|
+
const trimmed = value?.trim();
|
|
69
|
+
return trimmed ? {
|
|
70
|
+
kind,
|
|
71
|
+
value: trimmed
|
|
72
|
+
} : void 0;
|
|
73
|
+
}
|
|
74
|
+
function resolveAuthSecretFromConfig(openclawConfig) {
|
|
75
|
+
const gatewayConfig = openclawConfig?.gateway;
|
|
76
|
+
const authMode = gatewayConfig?.auth?.mode?.trim();
|
|
77
|
+
const preferRemoteCredentials = gatewayConfig?.mode === "remote";
|
|
78
|
+
const localToken = toAuthSecret("token", gatewayConfig?.auth?.token);
|
|
79
|
+
const localPassword = toAuthSecret("password", gatewayConfig?.auth?.password);
|
|
80
|
+
const remoteToken = toAuthSecret("token", gatewayConfig?.remote?.token);
|
|
81
|
+
const remotePassword = toAuthSecret("password", gatewayConfig?.remote?.password);
|
|
82
|
+
if (preferRemoteCredentials) {
|
|
83
|
+
if (authMode === "password") return remotePassword || localPassword || remoteToken || localToken;
|
|
84
|
+
if (authMode === "token") return remoteToken || localToken || remotePassword || localPassword;
|
|
85
|
+
return remoteToken || remotePassword || localToken || localPassword;
|
|
86
|
+
}
|
|
87
|
+
if (authMode === "password") return localPassword || remotePassword || localToken || remoteToken;
|
|
88
|
+
if (authMode === "token") return localToken || remoteToken || localPassword || remotePassword;
|
|
89
|
+
return localToken || localPassword || remoteToken || remotePassword;
|
|
90
|
+
}
|
|
71
91
|
/**
|
|
72
|
-
* Read and parse the OpenClaw configuration file.
|
|
92
|
+
* Read and parse the active OpenClaw configuration file.
|
|
73
93
|
* Results are cached based on file modification time.
|
|
74
94
|
* Returns undefined if the file doesn't exist or can't be parsed.
|
|
75
95
|
*/
|
|
76
|
-
function readOpenClawConfig() {
|
|
77
|
-
const configPath =
|
|
96
|
+
function readOpenClawConfig(env) {
|
|
97
|
+
const configPath = resolveConfigPath(env);
|
|
78
98
|
try {
|
|
79
99
|
if (!fs.existsSync(configPath)) return;
|
|
80
100
|
const mtime = fs.statSync(configPath).mtimeMs;
|
|
81
|
-
if (cachedConfig && cachedConfig.mtime === mtime) return cachedConfig.config;
|
|
82
|
-
const
|
|
83
|
-
const config =
|
|
101
|
+
if (cachedConfig && cachedConfigPath === configPath && cachedConfig.mtime === mtime) return cachedConfig.config;
|
|
102
|
+
const raw = fs.readFileSync(configPath, "utf-8");
|
|
103
|
+
const config = JSON5.parse(raw);
|
|
84
104
|
cachedConfig = {
|
|
85
105
|
config,
|
|
86
106
|
mtime
|
|
87
107
|
};
|
|
108
|
+
cachedConfigPath = configPath;
|
|
88
109
|
return config;
|
|
89
110
|
} catch (err) {
|
|
90
111
|
logger.debug(`Failed to read OpenClaw config at ${configPath}: ${err}`);
|
|
@@ -92,28 +113,50 @@ function readOpenClawConfig() {
|
|
|
92
113
|
}
|
|
93
114
|
}
|
|
94
115
|
/**
|
|
95
|
-
* Auto-detect the OpenClaw gateway URL from config, env overrides, or
|
|
116
|
+
* Auto-detect the OpenClaw gateway URL from config, env overrides, or the active config file.
|
|
96
117
|
*/
|
|
97
118
|
function resolveGatewayUrl(config, env) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return
|
|
119
|
+
return resolveGatewayTransportUrl(config, env, "http");
|
|
120
|
+
}
|
|
121
|
+
function resolveGatewayWsUrl(config, env) {
|
|
122
|
+
return resolveGatewayTransportUrl(config, env, "ws");
|
|
123
|
+
}
|
|
124
|
+
function resolveGatewayTransportUrl(config, env, transport) {
|
|
125
|
+
const configUrl = config?.gateway_url?.trim();
|
|
126
|
+
if (configUrl) return normalizeGatewayUrl(configUrl, transport) || configUrl;
|
|
127
|
+
const trimmedEnvUrl = (env?.OPENCLAW_GATEWAY_URL || getEnvString("OPENCLAW_GATEWAY_URL") || env?.CLAWDBOT_GATEWAY_URL || getEnvString("CLAWDBOT_GATEWAY_URL"))?.trim();
|
|
128
|
+
if (trimmedEnvUrl) return normalizeGatewayUrl(trimmedEnvUrl, transport) || trimmedEnvUrl;
|
|
129
|
+
const resolvedUrl = resolveGatewayUrlFromConfig(readOpenClawConfig(env), transport);
|
|
130
|
+
if (resolvedUrl) return resolvedUrl;
|
|
131
|
+
return `${transport === "ws" ? "ws" : "http"}://${DEFAULT_GATEWAY_HOST}:${DEFAULT_GATEWAY_PORT}`;
|
|
132
|
+
}
|
|
133
|
+
function resolveAuthSecret(config, env) {
|
|
134
|
+
if (config?.auth_token) return {
|
|
135
|
+
kind: "token",
|
|
136
|
+
value: config.auth_token
|
|
137
|
+
};
|
|
138
|
+
if (config?.auth_password) return {
|
|
139
|
+
kind: "password",
|
|
140
|
+
value: config.auth_password
|
|
141
|
+
};
|
|
142
|
+
const envToken = env?.OPENCLAW_GATEWAY_TOKEN || getEnvString("OPENCLAW_GATEWAY_TOKEN") || env?.CLAWDBOT_GATEWAY_TOKEN || getEnvString("CLAWDBOT_GATEWAY_TOKEN");
|
|
143
|
+
if (envToken) return {
|
|
144
|
+
kind: "token",
|
|
145
|
+
value: envToken
|
|
146
|
+
};
|
|
147
|
+
const envPassword = env?.OPENCLAW_GATEWAY_PASSWORD || getEnvString("OPENCLAW_GATEWAY_PASSWORD") || env?.CLAWDBOT_GATEWAY_PASSWORD || getEnvString("CLAWDBOT_GATEWAY_PASSWORD");
|
|
148
|
+
if (envPassword) return {
|
|
149
|
+
kind: "password",
|
|
150
|
+
value: envPassword
|
|
151
|
+
};
|
|
152
|
+
return resolveAuthSecretFromConfig(readOpenClawConfig(env));
|
|
108
153
|
}
|
|
109
154
|
/**
|
|
110
|
-
* Auto-detect the OpenClaw gateway
|
|
155
|
+
* Auto-detect the OpenClaw gateway bearer secret from config, env overrides, or the active
|
|
156
|
+
* config file. OpenClaw accepts either a token or password as the HTTP bearer secret.
|
|
111
157
|
*/
|
|
112
158
|
function resolveAuthToken(config, env) {
|
|
113
|
-
|
|
114
|
-
const envToken = env?.OPENCLAW_GATEWAY_TOKEN || getEnvString("OPENCLAW_GATEWAY_TOKEN");
|
|
115
|
-
if (envToken) return envToken;
|
|
116
|
-
return readOpenClawConfig()?.gateway?.auth?.token;
|
|
159
|
+
return resolveAuthSecret(config, env)?.value;
|
|
117
160
|
}
|
|
118
161
|
/**
|
|
119
162
|
* Build common OpenClaw headers for agent-id and session-key.
|
|
@@ -173,7 +216,8 @@ const OPENCLAW_PROTOCOL_VERSION = 3;
|
|
|
173
216
|
var OpenClawAgentProvider = class {
|
|
174
217
|
agentId;
|
|
175
218
|
gatewayUrl;
|
|
176
|
-
|
|
219
|
+
authKind;
|
|
220
|
+
authSecret;
|
|
177
221
|
openclawConfig;
|
|
178
222
|
timeoutMs;
|
|
179
223
|
activeConnections = /* @__PURE__ */ new Set();
|
|
@@ -181,8 +225,10 @@ var OpenClawAgentProvider = class {
|
|
|
181
225
|
this.agentId = agentId;
|
|
182
226
|
this.openclawConfig = providerOptions.config || {};
|
|
183
227
|
const env = providerOptions.env;
|
|
184
|
-
this.gatewayUrl =
|
|
185
|
-
|
|
228
|
+
this.gatewayUrl = resolveGatewayWsUrl(this.openclawConfig, env);
|
|
229
|
+
const authSecret = resolveAuthSecret(this.openclawConfig, env);
|
|
230
|
+
this.authKind = authSecret?.kind;
|
|
231
|
+
this.authSecret = authSecret?.value;
|
|
186
232
|
this.timeoutMs = this.openclawConfig.timeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
187
233
|
}
|
|
188
234
|
id() {
|
|
@@ -199,9 +245,9 @@ var OpenClawAgentProvider = class {
|
|
|
199
245
|
this.activeConnections.clear();
|
|
200
246
|
}
|
|
201
247
|
async callApi(prompt) {
|
|
202
|
-
const
|
|
248
|
+
const sessionKey = this.openclawConfig.session_key || `promptfoo-${crypto.randomUUID()}`;
|
|
203
249
|
return new Promise((resolve) => {
|
|
204
|
-
const ws = new WebSocket(
|
|
250
|
+
const ws = new WebSocket(this.gatewayUrl);
|
|
205
251
|
this.activeConnections.add(ws);
|
|
206
252
|
const agentRequestId = crypto.randomUUID();
|
|
207
253
|
const waitRequestId = crypto.randomUUID();
|
|
@@ -210,27 +256,23 @@ var OpenClawAgentProvider = class {
|
|
|
210
256
|
let runId;
|
|
211
257
|
let connected = false;
|
|
212
258
|
let resolved = false;
|
|
213
|
-
const
|
|
214
|
-
if (!resolved) {
|
|
215
|
-
resolved = true;
|
|
216
|
-
ws.close();
|
|
217
|
-
resolve({ error: `OpenClaw agent request timed out after ${this.timeoutMs}ms` });
|
|
218
|
-
}
|
|
219
|
-
}, this.timeoutMs);
|
|
220
|
-
const finish = (result) => {
|
|
259
|
+
const finish = (result, closeSocket = true) => {
|
|
221
260
|
if (resolved) return;
|
|
222
261
|
resolved = true;
|
|
223
262
|
clearTimeout(timeout);
|
|
224
263
|
this.activeConnections.delete(ws);
|
|
225
|
-
ws.close();
|
|
264
|
+
if (closeSocket) ws.close();
|
|
226
265
|
resolve(result);
|
|
227
266
|
};
|
|
267
|
+
const timeout = setTimeout(() => {
|
|
268
|
+
finish({ error: `OpenClaw agent request timed out after ${this.timeoutMs}ms` });
|
|
269
|
+
}, this.timeoutMs);
|
|
228
270
|
ws.on("error", (err) => {
|
|
229
271
|
finish({ error: `OpenClaw WebSocket error: ${err.message}` });
|
|
230
272
|
});
|
|
231
273
|
ws.on("close", () => {
|
|
232
274
|
this.activeConnections.delete(ws);
|
|
233
|
-
if (!resolved) finish({ error: "OpenClaw WebSocket connection closed unexpectedly" });
|
|
275
|
+
if (!resolved) finish({ error: "OpenClaw WebSocket connection closed unexpectedly" }, false);
|
|
234
276
|
});
|
|
235
277
|
ws.on("message", (data) => {
|
|
236
278
|
let frame;
|
|
@@ -265,7 +307,7 @@ var OpenClawAgentProvider = class {
|
|
|
265
307
|
caps: [],
|
|
266
308
|
commands: [],
|
|
267
309
|
permissions: {},
|
|
268
|
-
...this.
|
|
310
|
+
...this.authSecret && this.authKind && { auth: this.authKind === "password" ? { password: this.authSecret } : { token: this.authSecret } }
|
|
269
311
|
}
|
|
270
312
|
}));
|
|
271
313
|
return;
|
|
@@ -284,8 +326,9 @@ var OpenClawAgentProvider = class {
|
|
|
284
326
|
message: prompt,
|
|
285
327
|
agentId: this.agentId,
|
|
286
328
|
idempotencyKey,
|
|
287
|
-
|
|
288
|
-
...this.openclawConfig.thinking_level && { thinking: this.openclawConfig.thinking_level }
|
|
329
|
+
sessionKey,
|
|
330
|
+
...this.openclawConfig.thinking_level && { thinking: this.openclawConfig.thinking_level },
|
|
331
|
+
...this.openclawConfig.extra_system_prompt && { extraSystemPrompt: this.openclawConfig.extra_system_prompt }
|
|
289
332
|
}
|
|
290
333
|
}));
|
|
291
334
|
return;
|
|
@@ -295,8 +338,17 @@ var OpenClawAgentProvider = class {
|
|
|
295
338
|
finish({ error: `OpenClaw agent error: ${frame.error?.message || "unknown error"}` });
|
|
296
339
|
return;
|
|
297
340
|
}
|
|
298
|
-
|
|
299
|
-
|
|
341
|
+
const payload = frame.payload;
|
|
342
|
+
runId = typeof payload?.runId === "string" && payload.runId.trim() ? payload.runId : void 0;
|
|
343
|
+
if (!runId) {
|
|
344
|
+
logger.warn("[OpenClaw Agent] Missing runId in accepted response", {
|
|
345
|
+
agentId: this.agentId,
|
|
346
|
+
payload
|
|
347
|
+
});
|
|
348
|
+
finish({ error: "OpenClaw agent error: gateway accepted request without a runId" });
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
ws.send(JSON.stringify({
|
|
300
352
|
type: "req",
|
|
301
353
|
id: waitRequestId,
|
|
302
354
|
method: "agent.wait",
|
|
@@ -328,10 +380,11 @@ var OpenClawAgentProvider = class {
|
|
|
328
380
|
* OpenClaw chat provider extends OpenAI chat completion provider.
|
|
329
381
|
*
|
|
330
382
|
* OpenClaw exposes an OpenAI-compatible HTTP API at /v1/chat/completions.
|
|
331
|
-
* This provider auto-detects gateway URL and auth
|
|
332
|
-
* 1. Explicit config (gateway_url, auth_token)
|
|
333
|
-
* 2. Environment variables (OPENCLAW_GATEWAY_URL, OPENCLAW_GATEWAY_TOKEN)
|
|
334
|
-
* 3. ~/.openclaw/openclaw.json
|
|
383
|
+
* This provider auto-detects gateway URL and bearer auth from:
|
|
384
|
+
* 1. Explicit config (gateway_url, auth_token, auth_password)
|
|
385
|
+
* 2. Environment variables (OPENCLAW_GATEWAY_URL, OPENCLAW_GATEWAY_TOKEN, OPENCLAW_GATEWAY_PASSWORD)
|
|
386
|
+
* 3. The active OpenClaw config file (OPENCLAW_CONFIG_PATH or ~/.openclaw/openclaw.json),
|
|
387
|
+
* including gateway.remote.url and gateway.tls.enabled
|
|
335
388
|
*
|
|
336
389
|
* Usage:
|
|
337
390
|
* openclaw - default agent (main)
|
|
@@ -408,14 +461,19 @@ var OpenClawResponsesProvider = class extends OpenAiResponsesProvider {
|
|
|
408
461
|
* OpenClaw Tool Invoke Provider
|
|
409
462
|
*
|
|
410
463
|
* Simple HTTP provider for direct tool invocation via POST /tools/invoke.
|
|
411
|
-
* The tool name is extracted from the provider path:
|
|
464
|
+
* The tool name is extracted from the provider path:
|
|
465
|
+
* openclaw:tools:sessions_list → tool="sessions_list"
|
|
412
466
|
*
|
|
413
467
|
* The prompt is parsed as JSON for tool arguments. If it's not valid JSON,
|
|
414
468
|
* it's passed as a single `input` argument.
|
|
415
469
|
*
|
|
416
470
|
* Usage:
|
|
417
|
-
* openclaw:tools:
|
|
418
|
-
* openclaw:tools:
|
|
471
|
+
* openclaw:tools:sessions_list - invoke the sessions_list tool
|
|
472
|
+
* openclaw:tools:session_status - invoke the session_status tool
|
|
473
|
+
*
|
|
474
|
+
* Optional config:
|
|
475
|
+
* action - tool sub-action, forwarded as body.action
|
|
476
|
+
* dry_run - dry-run hint, forwarded as body.dryRun
|
|
419
477
|
*/
|
|
420
478
|
var OpenClawToolInvokeProvider = class {
|
|
421
479
|
toolName;
|
|
@@ -448,11 +506,16 @@ var OpenClawToolInvokeProvider = class {
|
|
|
448
506
|
args = { input: prompt };
|
|
449
507
|
}
|
|
450
508
|
const url = `${this.gatewayUrl}/tools/invoke`;
|
|
451
|
-
const headers = {
|
|
509
|
+
const headers = {
|
|
510
|
+
"Content-Type": "application/json",
|
|
511
|
+
...this.openclawConfig.headers || {}
|
|
512
|
+
};
|
|
452
513
|
if (this.authToken) headers["Authorization"] = `Bearer ${this.authToken}`;
|
|
453
514
|
const body = {
|
|
454
515
|
tool: this.toolName,
|
|
516
|
+
...this.openclawConfig.action && { action: this.openclawConfig.action },
|
|
455
517
|
args,
|
|
518
|
+
...typeof this.openclawConfig.dry_run === "boolean" && { dryRun: this.openclawConfig.dry_run },
|
|
456
519
|
...this.openclawConfig.session_key && { sessionKey: this.openclawConfig.session_key }
|
|
457
520
|
};
|
|
458
521
|
logger.debug(`[OpenClaw Tool] POST ${url}`, {
|
|
@@ -493,7 +556,7 @@ var OpenClawToolInvokeProvider = class {
|
|
|
493
556
|
* openclaw:responses:X → OpenClawResponsesProvider('X')
|
|
494
557
|
* openclaw:agent → OpenClawAgentProvider('main')
|
|
495
558
|
* openclaw:agent:X → OpenClawAgentProvider('X')
|
|
496
|
-
* openclaw:tools:
|
|
559
|
+
* openclaw:tools:sessions_list → OpenClawToolInvokeProvider('sessions_list')
|
|
497
560
|
*/
|
|
498
561
|
function createOpenClawProvider(providerPath, providerOptions = {}, env) {
|
|
499
562
|
const splits = providerPath.split(":");
|
|
@@ -514,4 +577,4 @@ function createOpenClawProvider(providerPath, providerOptions = {}, env) {
|
|
|
514
577
|
//#endregion
|
|
515
578
|
export { createOpenClawProvider };
|
|
516
579
|
|
|
517
|
-
//# sourceMappingURL=openclaw-
|
|
580
|
+
//# sourceMappingURL=openclaw-D1FSCps-.js.map
|