promptfoo 0.120.27 → 0.121.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/src/{ListApp-8WOe2nT6.js → ListApp-Du7YVwj5.js} +2 -4
- package/dist/src/accounts-B0pgC1oV.js +206 -0
- package/dist/src/{accounts-DVINui-2.js → accounts-Bm2D8Db9.js} +39 -34
- package/dist/src/{accounts-CPDRAMND.js → accounts-CiBLOnA7.js} +38 -33
- package/dist/src/{accounts-Fl2J3_Fu.cjs → accounts-gtkH-5KX.cjs} +77 -78
- package/dist/src/{agentic-utils-D922n6mm.js → agentic-utils-DS1g3GLF.js} +9 -10
- package/dist/src/{agents-BcsN_BgB.js → agents-9qiOy0ho.js} +16 -12
- package/dist/src/{agents-BXLmVsxR.js → agents-CBr9A01V.js} +37 -37
- package/dist/src/{agents-pMfppv9Z.js → agents-CmvBq8LV.js} +16 -18
- package/dist/src/{agents-hqgSV-3o.js → agents-D__IdAlg.js} +39 -40
- package/dist/src/{agents-BO2n8Z0d.cjs → agents-DbRtpYxR.cjs} +37 -40
- package/dist/src/{agents-BdUTAwi-.js → agents-DgF2zDag.js} +37 -42
- package/dist/src/{agents-DgJf2-ez.cjs → agents-Di9DKPzn.cjs} +16 -17
- package/dist/src/{agents-DNvSH78i.js → agents-cLXA8a_8.js} +17 -19
- package/dist/src/{aimlapi-DtgPI0nE.js → aimlapi-B4rcnZgv.js} +15 -17
- package/dist/src/{aimlapi-BE_Tg9Fl.cjs → aimlapi-BvlNH0gr.cjs} +15 -16
- package/dist/src/{aimlapi-DOib86oE.js → aimlapi-CnkC2HqE.js} +16 -18
- package/dist/src/{aimlapi-DTPACCB1.js → aimlapi-DHJU_kcV.js} +15 -4
- package/dist/src/app/assets/index-4LKxG2CG.js +439 -0
- package/dist/src/app/assets/{index-NCn4eVBv.css → index-C3zcsZFQ.css} +1 -1
- package/dist/src/app/assets/vendor-charts-BnDWwBlI.js +36 -0
- package/dist/src/app/index.html +3 -3
- package/dist/src/app/tsconfig.app.tsbuildinfo +1 -1
- package/dist/src/{audio-BnRUGAm_.js → audio-Bkv46et0.js} +6 -5
- package/dist/src/{audio-Cwo68yZS.cjs → audio-CGMyULza.cjs} +6 -7
- package/dist/src/{audio-MSRki4JU.js → audio-ClI_AFre.js} +6 -8
- package/dist/src/{audio-BRYU0BFo.js → audio-Dz3z7s3J.js} +7 -9
- package/dist/src/{base-pGVmXNl4.cjs → base-CGrhspbK.cjs} +36 -38
- package/dist/src/{base-h961VXYk.js → base-CpjcHe4e.js} +11 -13
- package/dist/src/base-DLKtKMFh.js +193 -0
- package/dist/src/{base-XB2tDJrB.js → base-Dy1V8--Z.js} +11 -13
- package/dist/src/blobs-BDbfYdrJ.js +236 -0
- package/dist/src/{blobs-CR5C4Ihh.js → blobs-CBO20krR.js} +9 -12
- package/dist/src/{blobs-BM_e6hCa.js → blobs-CMHN0Qcz.js} +9 -12
- package/dist/src/{blobs-B-KQAFhX.cjs → blobs-D23XLin-.cjs} +34 -37
- package/dist/src/{cache-jsiwsAJv.js → cache-BVeDlD87.js} +132 -117
- package/dist/src/{cache-CIpsoBZR.js → cache-C4Nxf52C.js} +132 -118
- package/dist/src/cache-CeUpFm3M.cjs +5 -0
- package/dist/src/{cache-BTVYfbka.cjs → cache-Dh5WtQps.cjs} +182 -168
- package/dist/src/cache-i1P6crbO.js +756 -0
- package/dist/src/cache-n-RCJ-hL.js +6 -0
- package/dist/src/{chat-BcPjZXIp.js → chat-BiKyneZl.js} +45 -46
- package/dist/src/{chat-D31K7C4u.cjs → chat-C1Qst7jL.cjs} +20 -21
- package/dist/src/{chat-B84t99NW.js → chat-C2jrdPMx.js} +20 -9
- package/dist/src/{chat-BE44YOc6.cjs → chat-CgF-J-Jj.cjs} +65 -66
- package/dist/src/{chat-DwWifjxi.js → chat-CzkrVDfz.js} +20 -22
- package/dist/src/chat-DJIw17u0.js +766 -0
- package/dist/src/{chat-CcUCysjU.js → chat-DqxYYtWA.js} +45 -46
- package/dist/src/{chat-DZM2GUHO.js → chat-qmatte1u.js} +21 -23
- package/dist/src/{chatkit-D67HS_0b.js → chatkit-65VXf5SR.js} +58 -58
- package/dist/src/{chatkit-DAB_qfzI.js → chatkit-Be-Q-a9F.js} +58 -60
- package/dist/src/{chatkit-Biqb_wsD.js → chatkit-BxFvW8KY.js} +58 -60
- package/dist/src/{chatkit-PGG4ZYIn.cjs → chatkit-DKyPi1Gs.cjs} +58 -60
- package/dist/src/chunk-DEq-mXcV.js +15 -0
- package/dist/src/chunk-DRamLcfz.js +16 -0
- package/dist/src/{claude-agent-sdk-SVM6AdBu.js → claude-agent-sdk-Apiy0iaz.js} +31 -31
- package/dist/src/{claude-agent-sdk-C-IOTPfo.js → claude-agent-sdk-D2bJee9S.js} +31 -29
- package/dist/src/{claude-agent-sdk-C9SiaQub.cjs → claude-agent-sdk-D9Z5Pr9X.cjs} +31 -28
- package/dist/src/{claude-agent-sdk-CiluSyW1.js → claude-agent-sdk-DfCoW0E6.js} +33 -20
- package/dist/src/cloud-BBh91EUK.js +4 -0
- package/dist/src/{cloud-CZ-q9Ier.js → cloud-C0dlstV_.js} +7 -9
- package/dist/src/{cloudflare-ai-BahKHyhh.js → cloudflare-ai-8TDxHR0x.js} +16 -18
- package/dist/src/{cloudflare-ai-v_qZD6_q.js → cloudflare-ai-BxAGvfju.js} +17 -19
- package/dist/src/{cloudflare-ai-Dfahv5SY.cjs → cloudflare-ai-CknbZ5LJ.cjs} +16 -17
- package/dist/src/{cloudflare-ai-Dxyt50Nl.js → cloudflare-ai-g7PB6VHR.js} +16 -4
- package/dist/src/{cloudflare-gateway-Bi_FpOFy.js → cloudflare-gateway-B9HWA5wf.js} +23 -23
- package/dist/src/{cloudflare-gateway-BPWoZIzJ.cjs → cloudflare-gateway-BSnDmHYo.cjs} +21 -22
- package/dist/src/{cloudflare-gateway-C0guUNwk.js → cloudflare-gateway-CKDb4dJ8.js} +26 -14
- package/dist/src/{cloudflare-gateway-btS7h1OZ.js → cloudflare-gateway-CP9QEWYS.js} +21 -25
- package/dist/src/{codex-sdk-DSxAnbfT.js → codex-sdk-C6UMlxwV.js} +28 -29
- package/dist/src/{codex-sdk-IYVi9fuM.js → codex-sdk-DUwKWezN.js} +28 -27
- package/dist/src/{codex-sdk-DulY0ZRq.js → codex-sdk-GGAw0qbD.js} +28 -29
- package/dist/src/{codex-sdk-DFKMtAyf.cjs → codex-sdk-fAO0c3yA.cjs} +28 -29
- package/dist/src/{cometapi-DzrR3SR_.js → cometapi-BL9yvj_f.js} +16 -4
- package/dist/src/{cometapi-DIO64tf4.cjs → cometapi-C4xSqeID.cjs} +21 -22
- package/dist/src/{cometapi-C9EEpJzT.js → cometapi-CUQq3H_a.js} +21 -24
- package/dist/src/{cometapi-DkNBMk0G.js → cometapi-DFNiKmSz.js} +17 -19
- package/dist/src/{completion-CG29bfKX.js → completion-5MzrpJxT.js} +11 -13
- package/dist/src/{completion-CCRT4kX1.cjs → completion-CM6oK8PS.cjs} +21 -23
- package/dist/src/{completion-Bgf1VJoq.js → completion-DZ083F31.js} +11 -13
- package/dist/src/completion-qRoZAYRB.js +120 -0
- package/dist/src/{createHash-Dw_iLu31.js → createHash-CTQmL3G2.js} +2 -3
- package/dist/src/{createHash-CYQy4YeL.cjs → createHash-CfZSc0b4.cjs} +13 -14
- package/dist/src/{createHash-CJcfskIZ.js → createHash-Da8fMwqB.js} +2 -3
- package/dist/src/createHash-DmPQkvBh.js +15 -0
- package/dist/src/{docker-D-ayp2FW.js → docker-Bb5dcxr8.js} +18 -20
- package/dist/src/{docker-B81N0t4e.js → docker-BvfL2BrW.js} +19 -21
- package/dist/src/{docker-DNcLR4Ig.cjs → docker-DcF2pRrj.cjs} +18 -19
- package/dist/src/{docker-egERKxCF.js → docker-ExVyLp0S.js} +18 -7
- package/dist/src/entrypoint.js +2 -3
- package/dist/src/{errors-DnGCbnx8.js → errors-P6ll7XSJ.js} +2 -2
- package/dist/src/{esm-B9dPm_BF.js → esm-C03C-mv3.js} +17 -20
- package/dist/src/{esm-D2pZ87fL.js → esm-CaIwzWR5.js} +18 -21
- package/dist/src/esm-Cd1AjG1D.js +379 -0
- package/dist/src/{esm-Ct-Joyue.cjs → esm-CnNt7sI4.cjs} +47 -49
- package/dist/src/eval-B3r2CVXr.js +15 -0
- package/dist/src/{eval-C-Nr6wX_.js → eval-Dg2nG4v2.js} +47 -54
- package/dist/src/evalResult-5xwYnECe.js +12 -0
- package/dist/src/evalResult-71lY93Kj.cjs +10 -0
- package/dist/src/{evalResult-DXMWJ3sx.js → evalResult-BBRNtX4I.js} +10 -11
- package/dist/src/{evalResult-4BzI2tmj.js → evalResult-BDMqrapS.js} +16 -12
- package/dist/src/evalResult-Dx5P5cIv.js +10 -0
- package/dist/src/{evalResult-CX8wQecI.cjs → evalResult-fuaI8HkH.cjs} +20 -21
- package/dist/src/{evaluator-8aGyV12L.js → evaluator-BhoWwp5b.js} +211 -235
- package/dist/src/evaluator-Jx6bRZV6.js +36 -0
- package/dist/src/{extractor-V5x_m1i0.js → extractor-C0EVHewb.js} +22 -24
- package/dist/src/extractor-D25qpmGX.js +374 -0
- package/dist/src/{extractor-CD5yKL-G.js → extractor-DReVID0K.js} +22 -24
- package/dist/src/{extractor-C031XmTA.cjs → extractor-pYLLi3wS.cjs} +37 -39
- package/dist/src/{fetch-BmbD-v1L.cjs → fetch-BPkYtG8K.cjs} +244 -277
- package/dist/src/fetch-BxNb_Lp3.js +5 -0
- package/dist/src/{fetch-D3OHf-lV.js → fetch-Cwxnd8zz.js} +36 -44
- package/dist/src/{fetch-CXZI9RRr.js → fetch-Dxpd4_sr.js} +23 -35
- package/dist/src/fetch-HaqdX7U1.js +780 -0
- package/dist/src/{fileExtensions-ePDqouxn.js → fileExtensions-DnqA1y9x.js} +2 -2
- package/dist/src/{fileExtensions-BpuMmaFL.js → fileExtensions-Ds-foDzt.js} +2 -2
- package/dist/src/fileExtensions-LcDYkU4v.js +85 -0
- package/dist/src/{fileExtensions-DkJYkWUy.cjs → fileExtensions-bYh77CN8.cjs} +27 -28
- package/dist/src/{formatDuration-CdevI3An.js → formatDuration-DgBVMN65.js} +2 -2
- package/dist/src/{genaiTracer-Ce19n68P.js → genaiTracer-70Z8BIuV.js} +2 -3
- package/dist/src/{genaiTracer-CqNnnXrE.js → genaiTracer-C1rxGO8Q.js} +2 -3
- package/dist/src/genaiTracer-D3fD9dNV.js +256 -0
- package/dist/src/{genaiTracer-Dres3qrN.cjs → genaiTracer-DN4dQywX.cjs} +13 -14
- package/dist/src/{graders--1y2u9HO.js → graders-BTeBGqjJ.js} +349 -397
- package/dist/src/graders-B_pgMLS2.js +34 -0
- package/dist/src/{graders-DTeBrzWp.js → graders-Bj_Odv7c.js} +349 -397
- package/dist/src/graders-DErokPDO.cjs +32 -0
- package/dist/src/graders-DP7KFFo-.js +13466 -0
- package/dist/src/graders-DR_uNe54.js +32 -0
- package/dist/src/{graders-DohM2dir.cjs → graders-DU49_J8Y.cjs} +684 -732
- package/dist/src/graders-w3176Wz-.js +32 -0
- package/dist/src/{image-B0U4Hqll.js → image-B02ogr_b.js} +7 -9
- package/dist/src/{image-DmE-niFE.js → image-B0h9VEMc.js} +6 -5
- package/dist/src/{image-CuKHuccK.cjs → image-BLmROtN3.cjs} +29 -30
- package/dist/src/{image-DNEIf_aI.js → image-Bb4vWQLM.js} +6 -8
- package/dist/src/{image-DpKl2F15.cjs → image-C1madmKh.cjs} +6 -7
- package/dist/src/{image-C3wHC9_h.js → image-CHfWvljl.js} +9 -10
- package/dist/src/{image-O1u4bCFg.js → image-DS-o-0ph.js} +9 -10
- package/dist/src/image-Dpxa1Jt6.js +257 -0
- package/dist/src/index.cjs +615 -695
- package/dist/src/index.d.cts +271 -7
- package/dist/src/index.d.ts +271 -3
- package/dist/src/index.js +580 -664
- package/dist/src/{interactiveCheck-Bxj1Swex.js → interactiveCheck-BgLZUIt3.js} +7 -8
- package/dist/src/{invariant-DT20jrBd.js → invariant-BtWWVVhl.js} +2 -2
- package/dist/src/{invariant-1pAf2CD1.js → invariant-Ddh24eXh.js} +2 -2
- package/dist/src/{invariant-CKcJAQ6M.cjs → invariant-kfQ8Bu82.cjs} +7 -8
- package/dist/src/invariant-vgHWClmd.js +25 -0
- package/dist/src/{knowledgeBase-CEzQobWX.js → knowledgeBase-B3OoKIej.js} +14 -9
- package/dist/src/{knowledgeBase-Be_zyW4L.js → knowledgeBase-CYTLHOt1.js} +16 -16
- package/dist/src/{knowledgeBase-BZ41IFwq.js → knowledgeBase-D33Ty2l6.js} +14 -18
- package/dist/src/{knowledgeBase-D-5BMXlr.cjs → knowledgeBase-DOO_BM9b.cjs} +14 -15
- package/dist/src/{litellm-DnbRJ2if.js → litellm-AaeZcZQF.js} +18 -19
- package/dist/src/{litellm-hUSNM_M2.cjs → litellm-I_hbp_dc.cjs} +17 -17
- package/dist/src/{litellm-CRDqPhNI.js → litellm-NbjknEh6.js} +17 -18
- package/dist/src/{litellm-9vR8zpfU.js → litellm-TrljxD9G.js} +17 -5
- package/dist/src/{logger-CG1uZPbQ.js → logger-CT3IKMKA.js} +10 -29
- package/dist/src/{logger-B7sBeGa0.cjs → logger-Cp1GPUjj.cjs} +152 -180
- package/dist/src/logger-DLcq4dWf.js +713 -0
- package/dist/src/{logger-LSBxlt7a.js → logger-KkObSCzq.js} +13 -31
- package/dist/src/{luma-ray-4blv9iZ2.js → luma-ray-BS2_tY8L.js} +22 -21
- package/dist/src/{luma-ray-drvgdpP9.js → luma-ray-DDsjcgZZ.js} +20 -13
- package/dist/src/{luma-ray-Hm3d6VJE.cjs → luma-ray-Due0n7di.cjs} +20 -21
- package/dist/src/{luma-ray-B2__8lYH.js → luma-ray-f6I2fft-.js} +20 -23
- package/dist/src/main.js +1170 -1321
- package/dist/src/{messages-Uee41Mj5.js → messages-BS17jdMx.js} +22 -24
- package/dist/src/{messages-XhiwCbi4.cjs → messages-Bs1kC7P4.cjs} +32 -34
- package/dist/src/{messages-CGPPidQr.js → messages-D0lx5qK7.js} +22 -24
- package/dist/src/messages-ZJk778GH.js +240 -0
- package/dist/src/{meteor-BYykdXrV.js → meteor-44VjEACX.js} +3 -4
- package/dist/src/{meteor-CsopaHrH.js → meteor-D-SotUw9.js} +3 -4
- package/dist/src/{meteor-e-E-2vVl.cjs → meteor-DLZZ3osF.cjs} +3 -4
- package/dist/src/{meteor-C8lGP6P4.js → meteor-DUiCJRC-.js} +3 -4
- package/dist/src/{modelslab-yKz-ZNB4.js → modelslab-Bmni6skY.js} +17 -10
- package/dist/src/{modelslab-E9gO-bYd.js → modelslab-Bx9IrZfS.js} +18 -20
- package/dist/src/{modelslab-lUVW0cmB.cjs → modelslab-CoUX6Jc_.cjs} +17 -18
- package/dist/src/{modelslab-ClBkr8_9.js → modelslab-DRb74SP4.js} +17 -19
- package/dist/src/{nova-reel-Dk8jNpId.js → nova-reel-BfPq-0Yk.js} +20 -13
- package/dist/src/{nova-reel-D8CuO6QH.cjs → nova-reel-C_QM18Xn.cjs} +20 -21
- package/dist/src/{nova-reel-u2eF2Cxm.js → nova-reel-D_W1tjMH.js} +22 -21
- package/dist/src/{nova-reel-P9bwvtYX.js → nova-reel-bgjxilYW.js} +20 -23
- package/dist/src/{nova-sonic-CK2rAiKi.js → nova-sonic-CFb5GYhg.js} +30 -26
- package/dist/src/{nova-sonic-BaqWlkds.js → nova-sonic-DIGQNR07.js} +30 -31
- package/dist/src/{nova-sonic-yZapPLv7.js → nova-sonic-De1HW5fD.js} +31 -32
- package/dist/src/{nova-sonic-Ds1C-dpm.cjs → nova-sonic-zfcljeRp.cjs} +30 -31
- package/dist/src/{openai-DUFopMrH.cjs → openai-Cuif0GEt.cjs} +8 -9
- package/dist/src/{openai-PblZ3jUE.js → openai-DElQ-fPX.js} +3 -4
- package/dist/src/{openai-CcN1B8Sb.js → openai-DhbB7eWK.js} +3 -4
- package/dist/src/openai-j-sE2O7r.js +44 -0
- package/dist/src/{openclaw-B6qqDr_u.cjs → openclaw-CSugPYAr.cjs} +188 -130
- package/dist/src/{openclaw-A-3_loM7.js → openclaw-DiSz3I5L.js} +180 -109
- package/dist/src/{openclaw-a3lylB-V.js → openclaw-DuvJKEW5.js} +178 -124
- package/dist/src/{openclaw-COn6QzDi.js → openclaw-tiVYRtr-.js} +178 -122
- package/dist/src/opencode-sdk-0j6rTWNb.js +562 -0
- package/dist/src/opencode-sdk-B3CWY9h_.js +560 -0
- package/dist/src/opencode-sdk-BL764Jdi.cjs +564 -0
- package/dist/src/opencode-sdk-C2y6UkP2.js +560 -0
- package/dist/src/{otlpReceiver-oyf5wLGC.js → otlpReceiver-C99PPb48.js} +53 -51
- package/dist/src/{otlpReceiver-lXsYVbpj.cjs → otlpReceiver-CGq6LspY.cjs} +53 -55
- package/dist/src/{otlpReceiver-94URx7UW.js → otlpReceiver-CdNBdbsk.js} +53 -55
- package/dist/src/{otlpReceiver-BmmTiMjA.js → otlpReceiver-D89fR-rC.js} +53 -55
- package/dist/src/{providerRegistry-Cq_JK_CJ.js → providerRegistry-B0RUOLI_.js} +7 -8
- package/dist/src/{providerRegistry-DSSHjMKf.js → providerRegistry-CD8MEar9.js} +7 -8
- package/dist/src/{providerRegistry-CvHEVJad.cjs → providerRegistry-Civky8Ar.cjs} +12 -13
- package/dist/src/providerRegistry-DM8rZYol.js +45 -0
- package/dist/src/providers-B7V0njNs.js +32 -0
- package/dist/src/providers-BEwbhv0X.js +30 -0
- package/dist/src/{providers-Iil64vk9.js → providers-BlqUifFg.js} +1543 -1676
- package/dist/src/providers-CH3C7zf7.js +30 -0
- package/dist/src/{providers-DHbjzW2e.cjs → providers-CgKOSgTR.cjs} +1896 -2029
- package/dist/src/providers-D8lF1sqW.js +33246 -0
- package/dist/src/{providers-BnFpbY_s.js → providers-Dk_6ocUX.js} +1536 -1669
- package/dist/src/providers-zyB6k_38.cjs +31 -0
- package/dist/src/{pythonUtils-CcT5LH1M.js → pythonUtils-C3py6GC1.js} +18 -19
- package/dist/src/{pythonUtils-DBbuI3QJ.cjs → pythonUtils-CTU3Y3lw.cjs} +42 -43
- package/dist/src/{pythonUtils-hZ8LeQLv.js → pythonUtils-D5nxkQ0P.js} +18 -19
- package/dist/src/pythonUtils-D6fwaDSg.js +249 -0
- package/dist/src/{quiverai-BuI0tE39.js → quiverai-BbOUOn2L.js} +8 -7
- package/dist/src/{quiverai-DCGSZt4U.js → quiverai-CIaELU_m.js} +8 -10
- package/dist/src/{quiverai-DiMVJQDz.cjs → quiverai-PdShCPox.cjs} +8 -9
- package/dist/src/{quiverai-fQNkExW4.js → quiverai-uH-dcTIr.js} +9 -11
- package/dist/src/{render-Dj1smHEb.js → render-Drod8m7K.js} +4 -5
- package/dist/src/responses-CB2jwoAr.js +660 -0
- package/dist/src/{responses-ghR3IOfy.cjs → responses-D8SBTL64.cjs} +39 -42
- package/dist/src/{responses-DOAFFENS.js → responses-DIR9Ud3j.js} +24 -27
- package/dist/src/{responses-CxzoQoBe.js → responses-WNGNYe3K.js} +24 -27
- package/dist/src/rubyUtils-BUHu6PhO.js +5 -0
- package/dist/src/{rubyUtils-CwbGmgYN.js → rubyUtils-BUVePouc.js} +27 -20
- package/dist/src/rubyUtils-BcuGX77l.js +222 -0
- package/dist/src/{rubyUtils-DudlFZed.js → rubyUtils-Boc4HZzX.js} +18 -19
- package/dist/src/rubyUtils-CP42kMvq.cjs +4 -0
- package/dist/src/{rubyUtils-C8MhKGHb.cjs → rubyUtils-DhCAlxZr.cjs} +48 -50
- package/dist/src/{sagemaker-gmskuyre.js → sagemaker-CNBxx5CJ.js} +75 -70
- package/dist/src/{sagemaker-CcxhlOAR.js → sagemaker-CemTFp2h.js} +75 -79
- package/dist/src/{sagemaker-77zbJ2Q2.cjs → sagemaker-Cl28mZU2.cjs} +75 -76
- package/dist/src/{sagemaker-DuM71dVU.js → sagemaker-YSyBXQQh.js} +77 -77
- package/dist/src/{scanner-DJYiSXQj.js → scanner-BsBlNXNn.js} +100 -121
- package/dist/src/server/index.js +5520 -67427
- package/dist/src/{server-B5v33lvE.cjs → server-C_7Ax-hA.cjs} +57 -67
- package/dist/src/{server-BJ4m4f1D.js → server-CqzrVGpF.js} +26 -29
- package/dist/src/server-CuxBbeSY.js +229 -0
- package/dist/src/server-DA4Cyrrq.js +7 -0
- package/dist/src/server-Dulb-4-K.cjs +5 -0
- package/dist/src/{server-RV_i_YX5.js → server-VWgWb00X.js} +19 -24
- package/dist/src/{signal-BW33JuId.js → signal-4U3mfRvL.js} +9 -11
- package/dist/src/{slack-DEURelTy.cjs → slack-BmVAVGaK.cjs} +7 -8
- package/dist/src/{slack-BQYeW9L3.js → slack-DCUPTzS2.js} +8 -8
- package/dist/src/{slack-BB6yuZzp.js → slack-DOdy_kyv.js} +7 -8
- package/dist/src/{slack-2pRrhhgJ.js → slack-DXMKtA-f.js} +7 -9
- package/dist/src/store-CXGFv4aR.js +228 -0
- package/dist/src/store-CXS-Q_91.js +6 -0
- package/dist/src/{store-D7CgQzAR.cjs → store-DLlFCC4h.cjs} +44 -45
- package/dist/src/{store-DJNsD1iC.js → store-DXilxTl-.js} +40 -36
- package/dist/src/{store-s3SftUwF.js → store-Dim__MDd.js} +34 -35
- package/dist/src/store-eYkaKMwq.cjs +5 -0
- package/dist/src/{tables-DfTsNN7X.js → tables-6YKwjN9-.js} +19 -21
- package/dist/src/tables-DLJPUdUE.js +288 -0
- package/dist/src/{tables-BKTmd6u7.cjs → tables-DPi7wKeM.cjs} +89 -91
- package/dist/src/{tables-DMegD0Xf.js → tables-gftXzE9I.js} +21 -23
- package/dist/src/telemetry-BpMfhthR.cjs +5 -0
- package/dist/src/{telemetry--WAdAfVi.js → telemetry-CMrFgtPB.js} +11 -13
- package/dist/src/telemetry-Cps3mIU-.js +171 -0
- package/dist/src/{telemetry-DQgVBCAb.cjs → telemetry-DaX14Chu.cjs} +21 -24
- package/dist/src/{telemetry-BedSm-bZ.js → telemetry-Dthj_BbD.js} +17 -14
- package/dist/src/telemetry-Dw38hanS.js +7 -0
- package/dist/src/{text-oiSbwSOI.js → text-B_UCRPp2.js} +2 -2
- package/dist/src/{text-oKzCBnK6.cjs → text-CW1cyrwj.cjs} +12 -13
- package/dist/src/{text-B_IrO4GZ.js → text-Db-Wt2u2.js} +2 -2
- package/dist/src/text-TIv0QYnd.js +22 -0
- package/dist/src/{tokenUsageUtils-FZd5O_4A.js → tokenUsageUtils-BDGe-iyI.js} +2 -2
- package/dist/src/{tokenUsageUtils-DmZSD2eU.js → tokenUsageUtils-DflFMjS0.js} +2 -2
- package/dist/src/tokenUsageUtils-NYT-WKS6.js +138 -0
- package/dist/src/{tokenUsageUtils-CXhxVj72.cjs → tokenUsageUtils-bVa1ga6f.cjs} +32 -33
- package/dist/src/{transcription-mYS9vd5v.js → transcription-BNYURcXg.js} +14 -7
- package/dist/src/{transcription-X2-B4vkX.js → transcription-B_OdaHp7.js} +14 -16
- package/dist/src/{transcription-BO1AHegO.cjs → transcription-NLVG9MT1.cjs} +14 -15
- package/dist/src/{transcription-lzBLiTFJ.js → transcription-s6A-bNrZ.js} +15 -17
- package/dist/src/{transform-B1Hi5lWS.cjs → transform-CzK1Q0zl.cjs} +24 -26
- package/dist/src/{transform-DeGlxb0D.js → transform-D5HsjduX.js} +39 -47
- package/dist/src/{transform-CYDILYDe.js → transform-DECvGmzp.js} +15 -13
- package/dist/src/transform-DTGDnAzW.js +6 -0
- package/dist/src/{transform-BEgStbHK.js → transform-DilY9wbS.js} +10 -12
- package/dist/src/{transform-D5PjiWiZ.cjs → transform-DuHvhZpj.cjs} +179 -187
- package/dist/src/transform-aa6tmVpZ.js +216 -0
- package/dist/src/transform-m3qNw4KP.cjs +5 -0
- package/dist/src/transform-uAytVuyX.js +1506 -0
- package/dist/src/{transform-Dfl89yi4.js → transform-vNucnNr0.js} +39 -47
- package/dist/src/{transformersAvailability-SZnTS3pJ.js → transformersAvailability-CEVM2GNQ.js} +2 -2
- package/dist/src/{transformersAvailability-D-glmEy7.cjs → transformersAvailability-CwayUSlh.cjs} +2 -3
- package/dist/src/{transformersAvailability-CjeFXhuJ.js → transformersAvailability-D6c6ROpT.js} +2 -2
- package/dist/src/{types-DWNf48sT.cjs → types-C_7nyzr1.cjs} +538 -574
- package/dist/src/{types-CXQduE9o.js → types-Cbd8uOMq.js} +68 -100
- package/dist/src/types-CzW2QFyi.js +3288 -0
- package/dist/src/{types-C5hEkb-x.js → types-DmyIJ-sR.js} +63 -99
- package/dist/src/{util-CoQjmE3u.js → util-B3xGByQh.js} +4 -5
- package/dist/src/{util-aLhtl3fe.cjs → util-B9vlHIIh.cjs} +208 -223
- package/dist/src/{util-Du96oyYS.js → util-BHGHw5G1.js} +4 -5
- package/dist/src/{util-DQ984syk.js → util-BRYkYPTd.js} +36 -51
- package/dist/src/{util-D9eLdGfa.js → util-BV4XUC0n.js} +5 -6
- package/dist/src/util-Bv6uGDfH.js +293 -0
- package/dist/src/{util-1wWM599Z.cjs → util-BzMcevZc.cjs} +50 -51
- package/dist/src/{util-_h4pVqrz.js → util-C1CeHl-P.js} +36 -51
- package/dist/src/{util-Bm_-UMD_.js → util-CMy69ZgQ.js} +5 -6
- package/dist/src/{util-CyUdMzV0.cjs → util-DGNOS1db.cjs} +34 -35
- package/dist/src/util-Dnmk2mBQ.js +599 -0
- package/dist/src/util-ZzmqNPlg.js +1426 -0
- package/dist/src/{utils-BjLy-Q72.cjs → utils-Cz9qXqII.cjs} +29 -32
- package/dist/src/{utils-CFMn2yHW.js → utils-XiOAgly5.js} +4 -7
- package/dist/src/utils-dLokC-eR.js +94 -0
- package/dist/src/{utils-DvWMzuMx.js → utils-f2-Moju7.js} +4 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -38
- package/dist/src/app/assets/index-B2D0bCSI.js +0 -439
- package/dist/src/app/assets/vendor-charts-CCl15Imd.js +0 -36
- package/dist/src/cache-ChPcurj7.js +0 -6
- package/dist/src/cache-VVu_W-yg.js +0 -8
- package/dist/src/cache-YLNCFEM2.cjs +0 -6
- package/dist/src/chunk-DHDDz29n.js +0 -22
- package/dist/src/chunk-FhC4c-0y.js +0 -21
- package/dist/src/cloud-BndfXy4H.js +0 -5
- package/dist/src/eval-BhHvMY82.js +0 -17
- package/dist/src/evalResult-Dq2gFNQY.js +0 -12
- package/dist/src/evalResult-nmcP5VKH.cjs +0 -12
- package/dist/src/evalResult-trqZjVYh.js +0 -14
- package/dist/src/evaluator-CnfPstzT.js +0 -39
- package/dist/src/fetch-IDPDue6F.cjs +0 -4
- package/dist/src/fetch-hKJ-It8q.js +0 -6
- package/dist/src/fetch-ouKnrWK-.js +0 -4
- package/dist/src/graders-CQn7WUsd.cjs +0 -34
- package/dist/src/graders-DC6QAbpW.js +0 -35
- package/dist/src/graders-DUWz3Y7j.js +0 -37
- package/dist/src/opencode-sdk-4bL9n-Gk.js +0 -382
- package/dist/src/opencode-sdk-BfC2zWcR.js +0 -376
- package/dist/src/opencode-sdk-DMJyuwMg.js +0 -380
- package/dist/src/opencode-sdk-Da-9adza.cjs +0 -383
- package/dist/src/providers-CsXB2Ix-.js +0 -35
- package/dist/src/providers-DO8ltjLC.js +0 -33
- package/dist/src/providers-Dtq-xnXd.cjs +0 -33
- package/dist/src/rubyUtils-BUbcND2f.js +0 -6
- package/dist/src/rubyUtils-Cr55X_KE.js +0 -5
- package/dist/src/rubyUtils-DlIiqoYo.cjs +0 -5
- package/dist/src/server-C2eQH4Gu.js +0 -6
- package/dist/src/server-CXWycu7H.cjs +0 -6
- package/dist/src/server-Q6OGlxxT.js +0 -8
- package/dist/src/store-B3EDO9Q3.js +0 -7
- package/dist/src/store-Dl9F8aw5.js +0 -6
- package/dist/src/store-SnrGrlt9.cjs +0 -6
- package/dist/src/telemetry-BGhiPZtl.js +0 -8
- package/dist/src/telemetry-CFfiYan6.cjs +0 -6
- package/dist/src/telemetry-DHzEduxX.js +0 -6
- package/dist/src/transform-C1x1ZlMQ.cjs +0 -6
- package/dist/src/transform-DYHjFmQu.js +0 -8
- package/dist/src/transform-rmwJT5JQ.js +0 -7
- package/dist/src/transformersAvailability-eJooj0gX.js +0 -35
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const require_logger = require(
|
|
2
|
-
require(
|
|
3
|
-
require(
|
|
4
|
-
require(
|
|
5
|
-
require(
|
|
6
|
-
const require_fetch = require(
|
|
7
|
-
require(
|
|
8
|
-
require(
|
|
9
|
-
const require_chat = require(
|
|
10
|
-
require(
|
|
11
|
-
const require_responses = require(
|
|
12
|
-
require(
|
|
13
|
-
require(
|
|
1
|
+
const require_logger = require("./logger-Cp1GPUjj.cjs");
|
|
2
|
+
require("./esm-CnNt7sI4.cjs");
|
|
3
|
+
require("./pythonUtils-CTU3Y3lw.cjs");
|
|
4
|
+
require("./types-C_7nyzr1.cjs");
|
|
5
|
+
require("./util-B9vlHIIh.cjs");
|
|
6
|
+
const require_fetch = require("./fetch-BPkYtG8K.cjs");
|
|
7
|
+
require("./cache-Dh5WtQps.cjs");
|
|
8
|
+
require("./genaiTracer-DN4dQywX.cjs");
|
|
9
|
+
const require_chat = require("./chat-CgF-J-Jj.cjs");
|
|
10
|
+
require("./transform-DuHvhZpj.cjs");
|
|
11
|
+
const require_responses = require("./responses-D8SBTL64.cjs");
|
|
12
|
+
require("./openai-Cuif0GEt.cjs");
|
|
13
|
+
require("./util-BzMcevZc.cjs");
|
|
14
14
|
let fs = require("fs");
|
|
15
15
|
fs = require_logger.__toESM(fs);
|
|
16
16
|
let path = require("path");
|
|
@@ -21,105 +21,148 @@ let crypto = require("crypto");
|
|
|
21
21
|
crypto = require_logger.__toESM(crypto);
|
|
22
22
|
let ws = require("ws");
|
|
23
23
|
ws = require_logger.__toESM(ws);
|
|
24
|
-
|
|
24
|
+
let json5 = require("json5");
|
|
25
|
+
json5 = require_logger.__toESM(json5);
|
|
25
26
|
//#region src/providers/openclaw/shared.ts
|
|
26
27
|
const DEFAULT_GATEWAY_PORT = 18789;
|
|
27
28
|
const DEFAULT_GATEWAY_HOST = "127.0.0.1";
|
|
28
29
|
/**
|
|
29
|
-
* Strip JSON5 syntax (comments and trailing commas) for JSON.parse compatibility.
|
|
30
|
-
* Uses a state machine to avoid corrupting strings containing // or slash characters.
|
|
31
|
-
*/
|
|
32
|
-
function stripJson5Syntax(raw) {
|
|
33
|
-
let result = "";
|
|
34
|
-
let i = 0;
|
|
35
|
-
let inString = false;
|
|
36
|
-
let stringQuote = "";
|
|
37
|
-
let escape = false;
|
|
38
|
-
while (i < raw.length) {
|
|
39
|
-
const ch = raw[i];
|
|
40
|
-
if (inString) {
|
|
41
|
-
result += ch;
|
|
42
|
-
if (escape) escape = false;
|
|
43
|
-
else if (ch === "\\") escape = true;
|
|
44
|
-
else if (ch === stringQuote) inString = false;
|
|
45
|
-
i++;
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
if (ch === "\"" || ch === "'") {
|
|
49
|
-
inString = true;
|
|
50
|
-
stringQuote = ch;
|
|
51
|
-
result += ch;
|
|
52
|
-
i++;
|
|
53
|
-
} else if (ch === "/" && raw[i + 1] === "/") while (i < raw.length && raw[i] !== "\n") i++;
|
|
54
|
-
else if (ch === "/" && raw[i + 1] === "*") {
|
|
55
|
-
i += 2;
|
|
56
|
-
while (i < raw.length - 1 && !(raw[i] === "*" && raw[i + 1] === "/")) i++;
|
|
57
|
-
if (i < raw.length - 1 && raw[i] === "*" && raw[i + 1] === "/") i += 2;
|
|
58
|
-
} else if (ch === ",") {
|
|
59
|
-
let j = i + 1;
|
|
60
|
-
while (j < raw.length && (raw[j] === " " || raw[j] === " " || raw[j] === "\n" || raw[j] === "\r")) j++;
|
|
61
|
-
if (j < raw.length && (raw[j] === "}" || raw[j] === "]")) i++;
|
|
62
|
-
else {
|
|
63
|
-
result += ch;
|
|
64
|
-
i++;
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
result += ch;
|
|
68
|
-
i++;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return result;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
30
|
* Cached config to avoid re-reading the file multiple times during provider init.
|
|
75
31
|
*/
|
|
76
32
|
let cachedConfig;
|
|
33
|
+
let cachedConfigPath;
|
|
34
|
+
function resolveConfigPath(env) {
|
|
35
|
+
return env?.OPENCLAW_CONFIG_PATH || require_logger.getEnvString("OPENCLAW_CONFIG_PATH") || path.default.join(os.default.homedir(), ".openclaw", "openclaw.json");
|
|
36
|
+
}
|
|
37
|
+
function normalizeGatewayUrl(url, transport) {
|
|
38
|
+
const trimmed = url.trim();
|
|
39
|
+
if (!trimmed) return;
|
|
40
|
+
if (transport === "http") {
|
|
41
|
+
if (trimmed.startsWith("wss://")) return `https://${trimmed.slice(6)}`;
|
|
42
|
+
if (trimmed.startsWith("ws://")) return `http://${trimmed.slice(5)}`;
|
|
43
|
+
return trimmed;
|
|
44
|
+
}
|
|
45
|
+
if (trimmed.startsWith("https://")) return `wss://${trimmed.slice(8)}`;
|
|
46
|
+
if (trimmed.startsWith("http://")) return `ws://${trimmed.slice(7)}`;
|
|
47
|
+
return trimmed;
|
|
48
|
+
}
|
|
49
|
+
function resolveGatewayHost(gatewayConfig) {
|
|
50
|
+
const bind = gatewayConfig?.bind?.trim();
|
|
51
|
+
const customBindHost = gatewayConfig?.customBindHost?.trim();
|
|
52
|
+
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;
|
|
53
|
+
if (bind === "custom") {
|
|
54
|
+
if (!customBindHost || customBindHost === "0.0.0.0" || customBindHost === "::" || customBindHost === "127.0.0.1" || customBindHost === "localhost" || customBindHost === "::1") return DEFAULT_GATEWAY_HOST;
|
|
55
|
+
return customBindHost;
|
|
56
|
+
}
|
|
57
|
+
return bind;
|
|
58
|
+
}
|
|
59
|
+
function buildLocalGatewayUrl(gatewayConfig, transport) {
|
|
60
|
+
const scheme = transport === "ws" ? gatewayConfig?.tls?.enabled ? "wss" : "ws" : gatewayConfig?.tls?.enabled ? "https" : "http";
|
|
61
|
+
const port = gatewayConfig?.port ?? 18789;
|
|
62
|
+
return `${scheme}://${resolveGatewayHost(gatewayConfig)}:${port}`;
|
|
63
|
+
}
|
|
64
|
+
function resolveGatewayUrlFromConfig(openclawConfig, transport) {
|
|
65
|
+
const gatewayConfig = openclawConfig?.gateway;
|
|
66
|
+
if (!gatewayConfig) return;
|
|
67
|
+
if (gatewayConfig.mode === "remote") {
|
|
68
|
+
const remoteUrl = normalizeGatewayUrl(gatewayConfig.remote?.url ?? "", transport);
|
|
69
|
+
if (remoteUrl) return remoteUrl;
|
|
70
|
+
}
|
|
71
|
+
return buildLocalGatewayUrl(gatewayConfig, transport);
|
|
72
|
+
}
|
|
73
|
+
function toAuthSecret(kind, value) {
|
|
74
|
+
const trimmed = value?.trim();
|
|
75
|
+
return trimmed ? {
|
|
76
|
+
kind,
|
|
77
|
+
value: trimmed
|
|
78
|
+
} : void 0;
|
|
79
|
+
}
|
|
80
|
+
function resolveAuthSecretFromConfig(openclawConfig) {
|
|
81
|
+
const gatewayConfig = openclawConfig?.gateway;
|
|
82
|
+
const authMode = gatewayConfig?.auth?.mode?.trim();
|
|
83
|
+
const preferRemoteCredentials = gatewayConfig?.mode === "remote";
|
|
84
|
+
const localToken = toAuthSecret("token", gatewayConfig?.auth?.token);
|
|
85
|
+
const localPassword = toAuthSecret("password", gatewayConfig?.auth?.password);
|
|
86
|
+
const remoteToken = toAuthSecret("token", gatewayConfig?.remote?.token);
|
|
87
|
+
const remotePassword = toAuthSecret("password", gatewayConfig?.remote?.password);
|
|
88
|
+
if (preferRemoteCredentials) {
|
|
89
|
+
if (authMode === "password") return remotePassword || localPassword || remoteToken || localToken;
|
|
90
|
+
if (authMode === "token") return remoteToken || localToken || remotePassword || localPassword;
|
|
91
|
+
return remoteToken || remotePassword || localToken || localPassword;
|
|
92
|
+
}
|
|
93
|
+
if (authMode === "password") return localPassword || remotePassword || localToken || remoteToken;
|
|
94
|
+
if (authMode === "token") return localToken || remoteToken || localPassword || remotePassword;
|
|
95
|
+
return localToken || localPassword || remoteToken || remotePassword;
|
|
96
|
+
}
|
|
77
97
|
/**
|
|
78
|
-
* Read and parse the OpenClaw configuration file.
|
|
98
|
+
* Read and parse the active OpenClaw configuration file.
|
|
79
99
|
* Results are cached based on file modification time.
|
|
80
100
|
* Returns undefined if the file doesn't exist or can't be parsed.
|
|
81
101
|
*/
|
|
82
|
-
function readOpenClawConfig() {
|
|
83
|
-
const configPath =
|
|
102
|
+
function readOpenClawConfig(env) {
|
|
103
|
+
const configPath = resolveConfigPath(env);
|
|
84
104
|
try {
|
|
85
105
|
if (!fs.default.existsSync(configPath)) return;
|
|
86
106
|
const mtime = fs.default.statSync(configPath).mtimeMs;
|
|
87
|
-
if (cachedConfig && cachedConfig.mtime === mtime) return cachedConfig.config;
|
|
88
|
-
const
|
|
89
|
-
const config =
|
|
107
|
+
if (cachedConfig && cachedConfigPath === configPath && cachedConfig.mtime === mtime) return cachedConfig.config;
|
|
108
|
+
const raw = fs.default.readFileSync(configPath, "utf-8");
|
|
109
|
+
const config = json5.default.parse(raw);
|
|
90
110
|
cachedConfig = {
|
|
91
111
|
config,
|
|
92
112
|
mtime
|
|
93
113
|
};
|
|
114
|
+
cachedConfigPath = configPath;
|
|
94
115
|
return config;
|
|
95
116
|
} catch (err) {
|
|
96
|
-
require_logger.
|
|
117
|
+
require_logger.logger.debug(`Failed to read OpenClaw config at ${configPath}: ${err}`);
|
|
97
118
|
return;
|
|
98
119
|
}
|
|
99
120
|
}
|
|
100
121
|
/**
|
|
101
|
-
* Auto-detect the OpenClaw gateway URL from config, env overrides, or
|
|
122
|
+
* Auto-detect the OpenClaw gateway URL from config, env overrides, or the active config file.
|
|
102
123
|
*/
|
|
103
124
|
function resolveGatewayUrl(config, env) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
return
|
|
125
|
+
return resolveGatewayTransportUrl(config, env, "http");
|
|
126
|
+
}
|
|
127
|
+
function resolveGatewayWsUrl(config, env) {
|
|
128
|
+
return resolveGatewayTransportUrl(config, env, "ws");
|
|
129
|
+
}
|
|
130
|
+
function resolveGatewayTransportUrl(config, env, transport) {
|
|
131
|
+
const configUrl = config?.gateway_url?.trim();
|
|
132
|
+
if (configUrl) return normalizeGatewayUrl(configUrl, transport) || configUrl;
|
|
133
|
+
const trimmedEnvUrl = (env?.OPENCLAW_GATEWAY_URL || require_logger.getEnvString("OPENCLAW_GATEWAY_URL") || env?.CLAWDBOT_GATEWAY_URL || require_logger.getEnvString("CLAWDBOT_GATEWAY_URL"))?.trim();
|
|
134
|
+
if (trimmedEnvUrl) return normalizeGatewayUrl(trimmedEnvUrl, transport) || trimmedEnvUrl;
|
|
135
|
+
const resolvedUrl = resolveGatewayUrlFromConfig(readOpenClawConfig(env), transport);
|
|
136
|
+
if (resolvedUrl) return resolvedUrl;
|
|
137
|
+
return `${transport === "ws" ? "ws" : "http"}://${DEFAULT_GATEWAY_HOST}:${DEFAULT_GATEWAY_PORT}`;
|
|
138
|
+
}
|
|
139
|
+
function resolveAuthSecret(config, env) {
|
|
140
|
+
if (config?.auth_token) return {
|
|
141
|
+
kind: "token",
|
|
142
|
+
value: config.auth_token
|
|
143
|
+
};
|
|
144
|
+
if (config?.auth_password) return {
|
|
145
|
+
kind: "password",
|
|
146
|
+
value: config.auth_password
|
|
147
|
+
};
|
|
148
|
+
const envToken = env?.OPENCLAW_GATEWAY_TOKEN || require_logger.getEnvString("OPENCLAW_GATEWAY_TOKEN") || env?.CLAWDBOT_GATEWAY_TOKEN || require_logger.getEnvString("CLAWDBOT_GATEWAY_TOKEN");
|
|
149
|
+
if (envToken) return {
|
|
150
|
+
kind: "token",
|
|
151
|
+
value: envToken
|
|
152
|
+
};
|
|
153
|
+
const envPassword = env?.OPENCLAW_GATEWAY_PASSWORD || require_logger.getEnvString("OPENCLAW_GATEWAY_PASSWORD") || env?.CLAWDBOT_GATEWAY_PASSWORD || require_logger.getEnvString("CLAWDBOT_GATEWAY_PASSWORD");
|
|
154
|
+
if (envPassword) return {
|
|
155
|
+
kind: "password",
|
|
156
|
+
value: envPassword
|
|
157
|
+
};
|
|
158
|
+
return resolveAuthSecretFromConfig(readOpenClawConfig(env));
|
|
114
159
|
}
|
|
115
160
|
/**
|
|
116
|
-
* Auto-detect the OpenClaw gateway
|
|
161
|
+
* Auto-detect the OpenClaw gateway bearer secret from config, env overrides, or the active
|
|
162
|
+
* config file. OpenClaw accepts either a token or password as the HTTP bearer secret.
|
|
117
163
|
*/
|
|
118
164
|
function resolveAuthToken(config, env) {
|
|
119
|
-
|
|
120
|
-
const envToken = env?.OPENCLAW_GATEWAY_TOKEN || require_logger.getEnvString("OPENCLAW_GATEWAY_TOKEN");
|
|
121
|
-
if (envToken) return envToken;
|
|
122
|
-
return readOpenClawConfig()?.gateway?.auth?.token;
|
|
165
|
+
return resolveAuthSecret(config, env)?.value;
|
|
123
166
|
}
|
|
124
167
|
/**
|
|
125
168
|
* Build common OpenClaw headers for agent-id and session-key.
|
|
@@ -154,7 +197,6 @@ function buildOpenClawProviderOptions(agentId, providerOptions) {
|
|
|
154
197
|
}
|
|
155
198
|
};
|
|
156
199
|
}
|
|
157
|
-
|
|
158
200
|
//#endregion
|
|
159
201
|
//#region src/providers/openclaw/agent.ts
|
|
160
202
|
const OPENCLAW_PROTOCOL_VERSION = 3;
|
|
@@ -180,7 +222,8 @@ const OPENCLAW_PROTOCOL_VERSION = 3;
|
|
|
180
222
|
var OpenClawAgentProvider = class {
|
|
181
223
|
agentId;
|
|
182
224
|
gatewayUrl;
|
|
183
|
-
|
|
225
|
+
authKind;
|
|
226
|
+
authSecret;
|
|
184
227
|
openclawConfig;
|
|
185
228
|
timeoutMs;
|
|
186
229
|
activeConnections = /* @__PURE__ */ new Set();
|
|
@@ -188,8 +231,10 @@ var OpenClawAgentProvider = class {
|
|
|
188
231
|
this.agentId = agentId;
|
|
189
232
|
this.openclawConfig = providerOptions.config || {};
|
|
190
233
|
const env = providerOptions.env;
|
|
191
|
-
this.gatewayUrl =
|
|
192
|
-
|
|
234
|
+
this.gatewayUrl = resolveGatewayWsUrl(this.openclawConfig, env);
|
|
235
|
+
const authSecret = resolveAuthSecret(this.openclawConfig, env);
|
|
236
|
+
this.authKind = authSecret?.kind;
|
|
237
|
+
this.authSecret = authSecret?.value;
|
|
193
238
|
this.timeoutMs = this.openclawConfig.timeoutMs ?? require_fetch.REQUEST_TIMEOUT_MS;
|
|
194
239
|
}
|
|
195
240
|
id() {
|
|
@@ -202,14 +247,14 @@ var OpenClawAgentProvider = class {
|
|
|
202
247
|
return { provider: this.id() };
|
|
203
248
|
}
|
|
204
249
|
async cleanup() {
|
|
205
|
-
for (const ws of this.activeConnections) ws.close();
|
|
250
|
+
for (const ws$1 of this.activeConnections) ws$1.close();
|
|
206
251
|
this.activeConnections.clear();
|
|
207
252
|
}
|
|
208
253
|
async callApi(prompt) {
|
|
209
|
-
const
|
|
254
|
+
const sessionKey = this.openclawConfig.session_key || `promptfoo-${crypto.default.randomUUID()}`;
|
|
210
255
|
return new Promise((resolve) => {
|
|
211
|
-
const ws = new ws.default(
|
|
212
|
-
this.activeConnections.add(ws);
|
|
256
|
+
const ws$2 = new ws.default(this.gatewayUrl);
|
|
257
|
+
this.activeConnections.add(ws$2);
|
|
213
258
|
const agentRequestId = crypto.default.randomUUID();
|
|
214
259
|
const waitRequestId = crypto.default.randomUUID();
|
|
215
260
|
const idempotencyKey = crypto.default.randomUUID();
|
|
@@ -217,43 +262,39 @@ var OpenClawAgentProvider = class {
|
|
|
217
262
|
let runId;
|
|
218
263
|
let connected = false;
|
|
219
264
|
let resolved = false;
|
|
220
|
-
const
|
|
221
|
-
if (!resolved) {
|
|
222
|
-
resolved = true;
|
|
223
|
-
ws.close();
|
|
224
|
-
resolve({ error: `OpenClaw agent request timed out after ${this.timeoutMs}ms` });
|
|
225
|
-
}
|
|
226
|
-
}, this.timeoutMs);
|
|
227
|
-
const finish = (result) => {
|
|
265
|
+
const finish = (result, closeSocket = true) => {
|
|
228
266
|
if (resolved) return;
|
|
229
267
|
resolved = true;
|
|
230
268
|
clearTimeout(timeout);
|
|
231
|
-
this.activeConnections.delete(ws);
|
|
232
|
-
ws.close();
|
|
269
|
+
this.activeConnections.delete(ws$2);
|
|
270
|
+
if (closeSocket) ws$2.close();
|
|
233
271
|
resolve(result);
|
|
234
272
|
};
|
|
235
|
-
|
|
273
|
+
const timeout = setTimeout(() => {
|
|
274
|
+
finish({ error: `OpenClaw agent request timed out after ${this.timeoutMs}ms` });
|
|
275
|
+
}, this.timeoutMs);
|
|
276
|
+
ws$2.on("error", (err) => {
|
|
236
277
|
finish({ error: `OpenClaw WebSocket error: ${err.message}` });
|
|
237
278
|
});
|
|
238
|
-
ws.on("close", () => {
|
|
239
|
-
this.activeConnections.delete(ws);
|
|
240
|
-
if (!resolved) finish({ error: "OpenClaw WebSocket connection closed unexpectedly" });
|
|
279
|
+
ws$2.on("close", () => {
|
|
280
|
+
this.activeConnections.delete(ws$2);
|
|
281
|
+
if (!resolved) finish({ error: "OpenClaw WebSocket connection closed unexpectedly" }, false);
|
|
241
282
|
});
|
|
242
|
-
ws.on("message", (data) => {
|
|
283
|
+
ws$2.on("message", (data) => {
|
|
243
284
|
let frame;
|
|
244
285
|
try {
|
|
245
286
|
frame = JSON.parse(data.toString());
|
|
246
287
|
} catch {
|
|
247
|
-
require_logger.
|
|
288
|
+
require_logger.logger.debug("[OpenClaw Agent] Failed to parse WS frame");
|
|
248
289
|
return;
|
|
249
290
|
}
|
|
250
|
-
require_logger.
|
|
291
|
+
require_logger.logger.debug("[OpenClaw Agent] Frame received", {
|
|
251
292
|
type: frame.type,
|
|
252
293
|
event: frame.event,
|
|
253
294
|
id: frame.id
|
|
254
295
|
});
|
|
255
296
|
if (frame.type === "event" && frame.event === "connect.challenge") {
|
|
256
|
-
ws.send(JSON.stringify({
|
|
297
|
+
ws$2.send(JSON.stringify({
|
|
257
298
|
type: "req",
|
|
258
299
|
id: crypto.default.randomUUID(),
|
|
259
300
|
method: "connect",
|
|
@@ -272,7 +313,7 @@ var OpenClawAgentProvider = class {
|
|
|
272
313
|
caps: [],
|
|
273
314
|
commands: [],
|
|
274
315
|
permissions: {},
|
|
275
|
-
...this.
|
|
316
|
+
...this.authSecret && this.authKind && { auth: this.authKind === "password" ? { password: this.authSecret } : { token: this.authSecret } }
|
|
276
317
|
}
|
|
277
318
|
}));
|
|
278
319
|
return;
|
|
@@ -283,7 +324,7 @@ var OpenClawAgentProvider = class {
|
|
|
283
324
|
return;
|
|
284
325
|
}
|
|
285
326
|
connected = true;
|
|
286
|
-
ws.send(JSON.stringify({
|
|
327
|
+
ws$2.send(JSON.stringify({
|
|
287
328
|
type: "req",
|
|
288
329
|
id: agentRequestId,
|
|
289
330
|
method: "agent",
|
|
@@ -291,8 +332,9 @@ var OpenClawAgentProvider = class {
|
|
|
291
332
|
message: prompt,
|
|
292
333
|
agentId: this.agentId,
|
|
293
334
|
idempotencyKey,
|
|
294
|
-
|
|
295
|
-
...this.openclawConfig.thinking_level && { thinking: this.openclawConfig.thinking_level }
|
|
335
|
+
sessionKey,
|
|
336
|
+
...this.openclawConfig.thinking_level && { thinking: this.openclawConfig.thinking_level },
|
|
337
|
+
...this.openclawConfig.extra_system_prompt && { extraSystemPrompt: this.openclawConfig.extra_system_prompt }
|
|
296
338
|
}
|
|
297
339
|
}));
|
|
298
340
|
return;
|
|
@@ -302,8 +344,17 @@ var OpenClawAgentProvider = class {
|
|
|
302
344
|
finish({ error: `OpenClaw agent error: ${frame.error?.message || "unknown error"}` });
|
|
303
345
|
return;
|
|
304
346
|
}
|
|
305
|
-
|
|
306
|
-
|
|
347
|
+
const payload = frame.payload;
|
|
348
|
+
runId = typeof payload?.runId === "string" && payload.runId.trim() ? payload.runId : void 0;
|
|
349
|
+
if (!runId) {
|
|
350
|
+
require_logger.logger.warn("[OpenClaw Agent] Missing runId in accepted response", {
|
|
351
|
+
agentId: this.agentId,
|
|
352
|
+
payload
|
|
353
|
+
});
|
|
354
|
+
finish({ error: "OpenClaw agent error: gateway accepted request without a runId" });
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
ws$2.send(JSON.stringify({
|
|
307
358
|
type: "req",
|
|
308
359
|
id: waitRequestId,
|
|
309
360
|
method: "agent.wait",
|
|
@@ -329,17 +380,17 @@ var OpenClawAgentProvider = class {
|
|
|
329
380
|
});
|
|
330
381
|
}
|
|
331
382
|
};
|
|
332
|
-
|
|
333
383
|
//#endregion
|
|
334
384
|
//#region src/providers/openclaw/chat.ts
|
|
335
385
|
/**
|
|
336
386
|
* OpenClaw chat provider extends OpenAI chat completion provider.
|
|
337
387
|
*
|
|
338
388
|
* OpenClaw exposes an OpenAI-compatible HTTP API at /v1/chat/completions.
|
|
339
|
-
* This provider auto-detects gateway URL and auth
|
|
340
|
-
* 1. Explicit config (gateway_url, auth_token)
|
|
341
|
-
* 2. Environment variables (OPENCLAW_GATEWAY_URL, OPENCLAW_GATEWAY_TOKEN)
|
|
342
|
-
* 3. ~/.openclaw/openclaw.json
|
|
389
|
+
* This provider auto-detects gateway URL and bearer auth from:
|
|
390
|
+
* 1. Explicit config (gateway_url, auth_token, auth_password)
|
|
391
|
+
* 2. Environment variables (OPENCLAW_GATEWAY_URL, OPENCLAW_GATEWAY_TOKEN, OPENCLAW_GATEWAY_PASSWORD)
|
|
392
|
+
* 3. The active OpenClaw config file (OPENCLAW_CONFIG_PATH or ~/.openclaw/openclaw.json),
|
|
393
|
+
* including gateway.remote.url and gateway.tls.enabled
|
|
343
394
|
*
|
|
344
395
|
* Usage:
|
|
345
396
|
* openclaw - default agent (main)
|
|
@@ -368,7 +419,6 @@ var OpenClawChatProvider = class extends require_chat.OpenAiChatCompletionProvid
|
|
|
368
419
|
return this.config.apiBaseUrl || this.getApiUrlDefault();
|
|
369
420
|
}
|
|
370
421
|
};
|
|
371
|
-
|
|
372
422
|
//#endregion
|
|
373
423
|
//#region src/providers/openclaw/responses.ts
|
|
374
424
|
/**
|
|
@@ -411,21 +461,25 @@ var OpenClawResponsesProvider = class extends require_responses.OpenAiResponsesP
|
|
|
411
461
|
return result;
|
|
412
462
|
}
|
|
413
463
|
};
|
|
414
|
-
|
|
415
464
|
//#endregion
|
|
416
465
|
//#region src/providers/openclaw/tools.ts
|
|
417
466
|
/**
|
|
418
467
|
* OpenClaw Tool Invoke Provider
|
|
419
468
|
*
|
|
420
469
|
* Simple HTTP provider for direct tool invocation via POST /tools/invoke.
|
|
421
|
-
* The tool name is extracted from the provider path:
|
|
470
|
+
* The tool name is extracted from the provider path:
|
|
471
|
+
* openclaw:tools:sessions_list → tool="sessions_list"
|
|
422
472
|
*
|
|
423
473
|
* The prompt is parsed as JSON for tool arguments. If it's not valid JSON,
|
|
424
474
|
* it's passed as a single `input` argument.
|
|
425
475
|
*
|
|
426
476
|
* Usage:
|
|
427
|
-
* openclaw:tools:
|
|
428
|
-
* openclaw:tools:
|
|
477
|
+
* openclaw:tools:sessions_list - invoke the sessions_list tool
|
|
478
|
+
* openclaw:tools:session_status - invoke the session_status tool
|
|
479
|
+
*
|
|
480
|
+
* Optional config:
|
|
481
|
+
* action - tool sub-action, forwarded as body.action
|
|
482
|
+
* dry_run - dry-run hint, forwarded as body.dryRun
|
|
429
483
|
*/
|
|
430
484
|
var OpenClawToolInvokeProvider = class {
|
|
431
485
|
toolName;
|
|
@@ -458,14 +512,19 @@ var OpenClawToolInvokeProvider = class {
|
|
|
458
512
|
args = { input: prompt };
|
|
459
513
|
}
|
|
460
514
|
const url = `${this.gatewayUrl}/tools/invoke`;
|
|
461
|
-
const headers = {
|
|
515
|
+
const headers = {
|
|
516
|
+
"Content-Type": "application/json",
|
|
517
|
+
...this.openclawConfig.headers || {}
|
|
518
|
+
};
|
|
462
519
|
if (this.authToken) headers["Authorization"] = `Bearer ${this.authToken}`;
|
|
463
520
|
const body = {
|
|
464
521
|
tool: this.toolName,
|
|
522
|
+
...this.openclawConfig.action && { action: this.openclawConfig.action },
|
|
465
523
|
args,
|
|
524
|
+
...typeof this.openclawConfig.dry_run === "boolean" && { dryRun: this.openclawConfig.dry_run },
|
|
466
525
|
...this.openclawConfig.session_key && { sessionKey: this.openclawConfig.session_key }
|
|
467
526
|
};
|
|
468
|
-
require_logger.
|
|
527
|
+
require_logger.logger.debug(`[OpenClaw Tool] POST ${url}`, {
|
|
469
528
|
tool: this.toolName,
|
|
470
529
|
args
|
|
471
530
|
});
|
|
@@ -490,7 +549,6 @@ var OpenClawToolInvokeProvider = class {
|
|
|
490
549
|
}
|
|
491
550
|
}
|
|
492
551
|
};
|
|
493
|
-
|
|
494
552
|
//#endregion
|
|
495
553
|
//#region src/providers/openclaw/index.ts
|
|
496
554
|
/**
|
|
@@ -504,7 +562,7 @@ var OpenClawToolInvokeProvider = class {
|
|
|
504
562
|
* openclaw:responses:X → OpenClawResponsesProvider('X')
|
|
505
563
|
* openclaw:agent → OpenClawAgentProvider('main')
|
|
506
564
|
* openclaw:agent:X → OpenClawAgentProvider('X')
|
|
507
|
-
* openclaw:tools:
|
|
565
|
+
* openclaw:tools:sessions_list → OpenClawToolInvokeProvider('sessions_list')
|
|
508
566
|
*/
|
|
509
567
|
function createOpenClawProvider(providerPath, providerOptions = {}, env) {
|
|
510
568
|
const splits = providerPath.split(":");
|
|
@@ -522,7 +580,7 @@ function createOpenClawProvider(providerPath, providerOptions = {}, env) {
|
|
|
522
580
|
}
|
|
523
581
|
return new OpenClawChatProvider(splits.length > 1 ? splits.slice(1).join(":") : "main", opts);
|
|
524
582
|
}
|
|
525
|
-
|
|
526
583
|
//#endregion
|
|
527
584
|
exports.createOpenClawProvider = createOpenClawProvider;
|
|
528
|
-
|
|
585
|
+
|
|
586
|
+
//# sourceMappingURL=openclaw-CSugPYAr.cjs.map
|