reeval 0.27.2 → 0.29.0
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/CHANGELOG.md +30 -0
- package/README.md +15 -15
- package/dist/{adapter-BuisZmtg.js → adapter-DpXw5J4g.js} +4 -4
- package/dist/{adapter-BuisZmtg.js.map → adapter-DpXw5J4g.js.map} +1 -1
- package/dist/agent-B1ndNDEu.js +272 -0
- package/dist/agent-B1ndNDEu.js.map +1 -0
- package/dist/agents-BP6F1c6y.d.ts +3 -0
- package/dist/agents-_3iNDMC1.js +400 -0
- package/dist/agents-_3iNDMC1.js.map +1 -0
- package/dist/{api-C8ZbQG7s.js → api-DIzSkDXZ.js} +2 -2
- package/dist/{api-C8ZbQG7s.js.map → api-DIzSkDXZ.js.map} +1 -1
- package/dist/{assemble-Co4noZvq.js → assemble-1bwPTJh1.js} +17 -17
- package/dist/{assemble-Co4noZvq.js.map → assemble-1bwPTJh1.js.map} +1 -1
- package/dist/assemble-B5nrfSs9.js +1 -0
- package/dist/{attach-DP3wc3A7.js → attach-D8MwHm3x.js} +5 -5
- package/dist/{attach-DP3wc3A7.js.map → attach-D8MwHm3x.js.map} +1 -1
- package/dist/{attempt-host-Bo8mbyuQ.js → attempt-host-lpJKcri8.js} +5 -5
- package/dist/{attempt-host-Bo8mbyuQ.js.map → attempt-host-lpJKcri8.js.map} +1 -1
- package/dist/{boat-obBLVWWQ.js → boat-DR71pK8X.js} +1 -1
- package/dist/{boat-BgdwW3_Q.js → boat-RFKQBduR.js} +8 -8
- package/dist/{boat-BgdwW3_Q.js.map → boat-RFKQBduR.js.map} +1 -1
- package/dist/{boat-images-CetjuF_c.js → boat-images-DvO8IPNz.js} +8 -8
- package/dist/{boat-images-CetjuF_c.js.map → boat-images-DvO8IPNz.js.map} +1 -1
- package/dist/{bundle-dK2eveab.js → bundle-Cnq5No9E.js} +20 -15
- package/dist/bundle-Cnq5No9E.js.map +1 -0
- package/dist/capture-L55SSOmN.js +1 -0
- package/dist/{capture-B8_Kx5R-.js → capture-sMi-R9PJ.js} +13 -13
- package/dist/{capture-B8_Kx5R-.js.map → capture-sMi-R9PJ.js.map} +1 -1
- package/dist/{cases-C6vnV-gn.js → cases-B_a7flE8.js} +3 -3
- package/dist/{cases-C6vnV-gn.js.map → cases-B_a7flE8.js.map} +1 -1
- package/dist/cases-D0-dA8q1.js +1 -0
- package/dist/{classify-BIJQ2Xqo.js → classify-gLl11KS8.js} +3 -3
- package/dist/{classify-BIJQ2Xqo.js.map → classify-gLl11KS8.js.map} +1 -1
- package/dist/{cli-eakKMZFR.js → cli-BscLXP46.js} +127 -114
- package/dist/cli-BscLXP46.js.map +1 -0
- package/dist/{cli-spec-DO-RQP-t.js → cli-spec-CYh8vLTE.js} +31 -9
- package/dist/cli-spec-CYh8vLTE.js.map +1 -0
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/{cloud-BQbD0pT8.js → cloud-CcEcnyQh.js} +4 -4
- package/dist/{cloud-BQbD0pT8.js.map → cloud-CcEcnyQh.js.map} +1 -1
- package/dist/{cloud-files-DFLNNUdK.js → cloud-files-D_O9fbR-.js} +9 -9
- package/dist/{cloud-files-DFLNNUdK.js.map → cloud-files-D_O9fbR-.js.map} +1 -1
- package/dist/{cloud-project-D-5mk4oh.js → cloud-project-DLOjhvhB.js} +2 -2
- package/dist/{cloud-project-D-5mk4oh.js.map → cloud-project-DLOjhvhB.js.map} +1 -1
- package/dist/{cloud-project-CV3-AVEe.js → cloud-project-GRKSV6ye.js} +1 -1
- package/dist/{cloud-push-CjBRaPak.js → cloud-push-9n-MskNb.js} +1 -1
- package/dist/{cloud-push-bZL0TUQm.js → cloud-push-CXF92l8Z.js} +11 -11
- package/dist/{cloud-push-bZL0TUQm.js.map → cloud-push-CXF92l8Z.js.map} +1 -1
- package/dist/{cloud-run-BYvtsyiN.js → cloud-run-Bh7k0NT3.js} +1 -1
- package/dist/{cloud-run-CKcBID4J.js → cloud-run-D01Q6bI9.js} +39 -22
- package/dist/cloud-run-D01Q6bI9.js.map +1 -0
- package/dist/{cloud-secrets-OuKaQUlX.js → cloud-secrets-D75oFMh4.js} +75 -57
- package/dist/cloud-secrets-D75oFMh4.js.map +1 -0
- package/dist/cloud-secrets-IAkn5QAu.js +1 -0
- package/dist/{command-CPJuVTme.js → command-BnebWjYe.js} +7 -7
- package/dist/{command-CPJuVTme.js.map → command-BnebWjYe.js.map} +1 -1
- package/dist/{command-C6nA8Fwo.js → command-BvNM0r_3.js} +22 -22
- package/dist/{command-C6nA8Fwo.js.map → command-BvNM0r_3.js.map} +1 -1
- package/dist/{command-CU-A_HL3.js → command-C82cg19k.js} +2 -2
- package/dist/{command-CU-A_HL3.js.map → command-C82cg19k.js.map} +1 -1
- package/dist/{command-BC_zVYDg.js → command-CMP5tLCQ.js} +17 -17
- package/dist/{command-BC_zVYDg.js.map → command-CMP5tLCQ.js.map} +1 -1
- package/dist/{command-CcWqLUbc.js → command-du7_5bzq.js} +12 -12
- package/dist/{command-CcWqLUbc.js.map → command-du7_5bzq.js.map} +1 -1
- package/dist/{commands-CBbpjvzR.js → commands-CeC0GQb3.js} +1 -1
- package/dist/{commands-DzRyz-v9.js → commands-DvU8Kh5T.js} +18 -18
- package/dist/{commands-DzRyz-v9.js.map → commands-DvU8Kh5T.js.map} +1 -1
- package/dist/{config-Ozz1O7Dl.js → config-BUHRiR5M.js} +22 -25
- package/dist/config-BUHRiR5M.js.map +1 -0
- package/dist/{provenance-Cylt_YxT.d.ts → core-C2d0URWs.d.ts} +2 -2
- package/dist/{core-B3Qg8zwG.js → core-tpzE5NhW.js} +8 -8
- package/dist/{core-B3Qg8zwG.js.map → core-tpzE5NhW.js.map} +1 -1
- package/dist/{cost-DQ0ayy6h.js → cost-CSfMv_sp.js} +5 -2
- package/dist/cost-CSfMv_sp.js.map +1 -0
- package/dist/{cost-a_rUSdsf.js → cost-_uinO5Yg.js} +1 -1
- package/dist/{cost-Dp-xFGJ1.js → cost-rRhvzqJo.js} +2 -2
- package/dist/{cost-Dp-xFGJ1.js.map → cost-rRhvzqJo.js.map} +1 -1
- package/dist/{cursor-catalog-pRZm3jCP.js → cursor-catalog-jVblPRFf.js} +15 -5
- package/dist/cursor-catalog-jVblPRFf.js.map +1 -0
- package/dist/{daytona-Bg62QEsJ.js → daytona-B333cRQp.js} +10 -10
- package/dist/{daytona-Bg62QEsJ.js.map → daytona-B333cRQp.js.map} +1 -1
- package/dist/daytona-image-CPdhbuO3.js +1 -0
- package/dist/{daytona-image-DFsZlHaL.js → daytona-image-CZZ7KXhs.js} +4 -4
- package/dist/{daytona-image-DFsZlHaL.js.map → daytona-image-CZZ7KXhs.js.map} +1 -1
- package/dist/db-BPumcvp8.js +1 -0
- package/dist/{db-BQb7-_SX.js → db-t2g-ANto.js} +10 -10
- package/dist/{db-BQb7-_SX.js.map → db-t2g-ANto.js.map} +1 -1
- package/dist/{default-effort-DXPtXTsk.js → default-effort-DgRmptMy.js} +3 -2
- package/dist/default-effort-DgRmptMy.js.map +1 -0
- package/dist/{default-effort-C1Y0LOHo.js → default-effort-MTALS2Gg.js} +1 -1
- package/dist/{docker-BNZw-uhT.js → docker-8FHKmBSq.js} +1 -1
- package/dist/{docker-DzSu1y_e.js → docker-h8mYtGWF.js} +2 -2
- package/dist/{docker-DzSu1y_e.js.map → docker-h8mYtGWF.js.map} +1 -1
- package/dist/{doctor-TkGfyasW.js → doctor-duvpyGzv.js} +27 -26
- package/dist/doctor-duvpyGzv.js.map +1 -0
- package/dist/{env-8x1O8I1M.js → env-ARmqWMQ5.js} +3 -1
- package/dist/env-ARmqWMQ5.js.map +1 -0
- package/dist/{environment-C2i5ggoS.js → environment-ClhvHQzf.js} +4 -3
- package/dist/environment-ClhvHQzf.js.map +1 -0
- package/dist/{errors-xUi3AkBi.js → errors-BQxdlRgT.js} +2 -2
- package/dist/{errors-xUi3AkBi.js.map → errors-BQxdlRgT.js.map} +1 -1
- package/dist/{eval-source-CVx2dMCC.js → eval-source-B0BOsAj8.js} +5 -5
- package/dist/{eval-source-CVx2dMCC.js.map → eval-source-B0BOsAj8.js.map} +1 -1
- package/dist/{evaluate-Nnh0iPuo.d.ts → evaluate-Bhdj1cv0.d.ts} +1 -1
- package/dist/{evaluate-D9hHc00J.js → evaluate-CYk8DFen.js} +70 -55
- package/dist/evaluate-CYk8DFen.js.map +1 -0
- package/dist/events-C7tCnwxF.js +1 -0
- package/dist/{events-CQJ9VK-x.js → events-DrI9kjVf.js} +3 -3
- package/dist/{events-CQJ9VK-x.js.map → events-DrI9kjVf.js.map} +1 -1
- package/dist/{files-DxMU7Qa3.js → files-CLNAE1rM.js} +6 -6
- package/dist/{files-DxMU7Qa3.js.map → files-CLNAE1rM.js.map} +1 -1
- package/dist/files-CjabTKaR.js +1 -0
- package/dist/{files-C0k5nNUu.js → files-CmLgOH3w.js} +3 -3
- package/dist/{files-C0k5nNUu.js.map → files-CmLgOH3w.js.map} +1 -1
- package/dist/{files-CGzUGcN2.js → files-CsJWxr6c.js} +2 -2
- package/dist/{files-CGzUGcN2.js.map → files-CsJWxr6c.js.map} +1 -1
- package/dist/{files-FLbqNavk.js → files-DV9Tfusu.js} +7 -7
- package/dist/{files-FLbqNavk.js.map → files-DV9Tfusu.js.map} +1 -1
- package/dist/{files--mW-Ym3B.js → files-Dc2xVqx1.js} +1 -1
- package/dist/{files-lwByH3UH.js → files-DgRaHy0k.js} +5 -5
- package/dist/{files-lwByH3UH.js.map → files-DgRaHy0k.js.map} +1 -1
- package/dist/files-DrXNXtQR.js +1 -0
- package/dist/files-Ds_hi5Bh.js +1 -0
- package/dist/{files-f7mRGOM3.js → files-uFFwVJZG.js} +4 -4
- package/dist/{files-f7mRGOM3.js.map → files-uFFwVJZG.js.map} +1 -1
- package/dist/gateway.d.ts +1 -1
- package/dist/harness-Dcd3ffkY.js.map +1 -1
- package/dist/{harness-install-CTAsIRk9.js → harness-install-CnO_XOZX.js} +7 -5
- package/dist/harness-install-CnO_XOZX.js.map +1 -0
- package/dist/harness.d.ts +1 -1
- package/dist/{ids-D9QbaaVk.js → ids-cqB_4aeP.js} +3 -3
- package/dist/{ids-D9QbaaVk.js.map → ids-cqB_4aeP.js.map} +1 -1
- package/dist/{images-D-MMgo1d.js → images-DJhOleuR.js} +13 -13
- package/dist/{images-D-MMgo1d.js.map → images-DJhOleuR.js.map} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/{init-DJXSbI19.js → init-BWpCSCwu.js} +5 -5
- package/dist/{init-DJXSbI19.js.map → init-BWpCSCwu.js.map} +1 -1
- package/dist/init-DVPgHVjc.js +1 -0
- package/dist/{ink-list-BsPpwXuw.js → ink-list-Cu48wlm7.js} +2 -2
- package/dist/{ink-list-BsPpwXuw.js.map → ink-list-Cu48wlm7.js.map} +1 -1
- package/dist/{inputs-CTlr7diQ.js → inputs-BWGetwY1.js} +6 -6
- package/dist/{inputs-CTlr7diQ.js.map → inputs-BWGetwY1.js.map} +1 -1
- package/dist/internal/vm.d.ts +2 -2
- package/dist/{invocations-2vDCZ_7f.js → invocations-FUUh2r22.js} +3 -3
- package/dist/{invocations-2vDCZ_7f.js.map → invocations-FUUh2r22.js.map} +1 -1
- package/dist/{judge-3ABSMDa4.js → judge-rxVptB7O.js} +71 -24
- package/dist/judge-rxVptB7O.js.map +1 -0
- package/dist/judge.d.ts +3 -3
- package/dist/judge.js +1 -1
- package/dist/{judgments-CVCUWT-g.js → judgments-8zHsGW8o.js} +2 -2
- package/dist/{judgments-CVCUWT-g.js.map → judgments-8zHsGW8o.js.map} +1 -1
- package/dist/{kinds-DhH1c5u6.js → kinds-DHuWeXVE.js} +7 -7
- package/dist/{kinds-DhH1c5u6.js.map → kinds-DHuWeXVE.js.map} +1 -1
- package/dist/{labels-Dtyf5-pd.js → labels-CbwHtEHq.js} +2 -3
- package/dist/labels-CbwHtEHq.js.map +1 -0
- package/dist/{layout-ChWMCz4x.js → layout-zk3wcJ-D.js} +4 -4
- package/dist/{layout-ChWMCz4x.js.map → layout-zk3wcJ-D.js.map} +1 -1
- package/dist/{link-TH-DivdC.js → link-CAKz8dlf.js} +3 -3
- package/dist/{link-TH-DivdC.js.map → link-CAKz8dlf.js.map} +1 -1
- package/dist/{list-DSm2TZds.js → list-B_bnCkKF.js} +7 -7
- package/dist/{list-DSm2TZds.js.map → list-B_bnCkKF.js.map} +1 -1
- package/dist/{live-D3zHauJd.js → live-BXjhPeBS.js} +5 -5
- package/dist/{live-D3zHauJd.js.map → live-BXjhPeBS.js.map} +1 -1
- package/dist/{live-YXsT5z0d.js → live-CVlGZ5uP.js} +2 -2
- package/dist/{live-YXsT5z0d.js.map → live-CVlGZ5uP.js.map} +1 -1
- package/dist/{machine-service-Bs-09eUN.js → machine-service-CkNS0EDU.js} +3 -3
- package/dist/{machine-service-Bs-09eUN.js.map → machine-service-CkNS0EDU.js.map} +1 -1
- package/dist/{machine-service-DeE4-ueU.js → machine-service-SvzL_fG2.js} +1 -1
- package/dist/{machines-BxWMvCkU.js → machines-HP7b-Xu0.js} +23 -23
- package/dist/{machines-BxWMvCkU.js.map → machines-HP7b-Xu0.js.map} +1 -1
- package/dist/{markdown-COts-jxf.js → markdown-aVaKa5tB.js} +2 -2
- package/dist/{markdown-COts-jxf.js.map → markdown-aVaKa5tB.js.map} +1 -1
- package/dist/{model-U9bZgClN.js → model-CsOxcfcP.js} +25 -17
- package/dist/model-CsOxcfcP.js.map +1 -0
- package/dist/model-DHHW4Eva.js +1 -0
- package/dist/{model-WiM6J5cw.js → model-DmPDqMOT.js} +6 -5
- package/dist/model-DmPDqMOT.js.map +1 -0
- package/dist/{model-B89uRS9X.js → model-EiXnyEi4.js} +13 -13
- package/dist/model-EiXnyEi4.js.map +1 -0
- package/dist/model-Yu4XAseh.js +1 -0
- package/dist/{node-eEX-KpkO.js → node-ChfH6UTx.js} +4 -4
- package/dist/{node-eEX-KpkO.js.map → node-ChfH6UTx.js.map} +1 -1
- package/dist/{openrouter-models-B1sIOTD2.js → openrouter-models-D19R699I.js} +7 -8
- package/dist/openrouter-models-D19R699I.js.map +1 -0
- package/dist/options-BavfXTnZ.js +1 -0
- package/dist/{patch-CudvhNHJ.js → patch-CXAiVJJb.js} +2 -2
- package/dist/{patch-CudvhNHJ.js.map → patch-CXAiVJJb.js.map} +1 -1
- package/dist/pi-providers-C7r3J259.js +1 -0
- package/dist/{plan-CqBiH_vR.js → plan-XPBl8wPX.js} +10 -10
- package/dist/{plan-CqBiH_vR.js.map → plan-XPBl8wPX.js.map} +1 -1
- package/dist/{plugins-4DkJ-SSG.js → plugins-CVb68Csl.js} +6 -15
- package/dist/plugins-CVb68Csl.js.map +1 -0
- package/dist/{preflight-DshE4siP.js → preflight-D8tP_D1t.js} +9 -9
- package/dist/{preflight-DshE4siP.js.map → preflight-D8tP_D1t.js.map} +1 -1
- package/dist/{preflight-DTUzpuHa.js → preflight-DXXJrweW.js} +4 -4
- package/dist/{preflight-DTUzpuHa.js.map → preflight-DXXJrweW.js.map} +1 -1
- package/dist/preflight-DcUhwxb9.js +1 -0
- package/dist/{preflight-VrtpmE-m.js → preflight-XTBtCUST.js} +1 -1
- package/dist/{prepare-neo93PDB.js → prepare-BfkBJx-r.js} +11 -8
- package/dist/prepare-BfkBJx-r.js.map +1 -0
- package/dist/{prepare-B8mcpoSU.js → prepare-DncZcdrN.js} +2 -2
- package/dist/{prices-7Av-R8LY.js → prices-DZa1s6oE.js} +2 -2
- package/dist/{prices-7Av-R8LY.js.map → prices-DZa1s6oE.js.map} +1 -1
- package/dist/prices-DhqfDLI0.js +1 -0
- package/dist/{provenance-DH-yi6D5.js → provenance-BKmmc54i.js} +4 -4
- package/dist/{provenance-DH-yi6D5.js.map → provenance-BKmmc54i.js.map} +1 -1
- package/dist/provider-CImogcxo.js +1 -0
- package/dist/{provider-Cn7lmECy.js → provider-KoKRkRYc.js} +2 -2
- package/dist/{provider-Cn7lmECy.js.map → provider-KoKRkRYc.js.map} +1 -1
- package/dist/{providers-CkS7-mTp.js → providers-B1rFOe9J.js} +1 -1
- package/dist/{providers-CjS_fnib.js → providers-CDxtyguj.js} +26 -26
- package/dist/{providers-CjS_fnib.js.map → providers-CDxtyguj.js.map} +1 -1
- package/dist/{query-B9eLoFkA.js → query-Bb9N_XYo.js} +2 -2
- package/dist/{query-B9eLoFkA.js.map → query-Bb9N_XYo.js.map} +1 -1
- package/dist/query-CIn4l3KN.js +1 -0
- package/dist/{questions-OKDjvm6B.js → questions-B9CvSlT6.js} +6 -6
- package/dist/{questions-OKDjvm6B.js.map → questions-B9CvSlT6.js.map} +1 -1
- package/dist/{recipe-CRoyNF64.js → recipe-COFxUo3D.js} +3 -3
- package/dist/{recipe-CRoyNF64.js.map → recipe-COFxUo3D.js.map} +1 -1
- package/dist/{record-BWy9s9CV.js → record-CB1A6v0V.js} +2 -2
- package/dist/{record-BWy9s9CV.js.map → record-CB1A6v0V.js.map} +1 -1
- package/dist/{remarks-UZpf9-8r.js → remarks-Cf6sylYA.js} +10 -10
- package/dist/{remarks-UZpf9-8r.js.map → remarks-Cf6sylYA.js.map} +1 -1
- package/dist/{remarks-BbMdB_8I.js → remarks-vofg7p1p.js} +3 -3
- package/dist/{remarks-BbMdB_8I.js.map → remarks-vofg7p1p.js.map} +1 -1
- package/dist/{remote-Dr1gXMTr.js → remote-CiT9JKxm.js} +8 -7
- package/dist/remote-CiT9JKxm.js.map +1 -0
- package/dist/renderer/ascii.d.ts +1 -1
- package/dist/renderer/markdown.d.ts +1 -1
- package/dist/renderer/markdown.js +1 -1
- package/dist/{report-B-kavICs.js → report-BQTwKMyw.js} +3 -3
- package/dist/{report-B-kavICs.js.map → report-BQTwKMyw.js.map} +1 -1
- package/dist/{report-inputs-UUAME7ww.js → report-inputs-CfN15NUr.js} +6 -6
- package/dist/{report-inputs-UUAME7ww.js.map → report-inputs-CfN15NUr.js.map} +1 -1
- package/dist/{resolve-ihtFbkZH.js → resolve-C74KVA_E.js} +27 -17
- package/dist/resolve-C74KVA_E.js.map +1 -0
- package/dist/{resolve-C_UGu3ls.js → resolve-Cb2dNF75.js} +2 -2
- package/dist/{resolve-C_UGu3ls.js.map → resolve-Cb2dNF75.js.map} +1 -1
- package/dist/resolve-Dt5W-3CX.js +1 -0
- package/dist/{results-yZWhaeav.js → results-DFfbDGo8.js} +6 -6
- package/dist/{results-yZWhaeav.js.map → results-DFfbDGo8.js.map} +1 -1
- package/dist/{resume-Ds4K9mQc.js → resume-Upez3P-w.js} +6 -6
- package/dist/{resume-Ds4K9mQc.js.map → resume-Upez3P-w.js.map} +1 -1
- package/dist/{retry-Cjf40USW.js → retry-CnNc6eFZ.js} +5 -5
- package/dist/{retry-Cjf40USW.js.map → retry-CnNc6eFZ.js.map} +1 -1
- package/dist/routes-BKMw8O4e.js +629 -0
- package/dist/routes-BKMw8O4e.js.map +1 -0
- package/dist/{run-C_kA5Jzh.js → run-DwLQh41-.js} +3 -3
- package/dist/{run-C_kA5Jzh.js.map → run-DwLQh41-.js.map} +1 -1
- package/dist/{runtime-D1gU5fAJ.js → runtime-Ckm-qUYw.js} +6 -6
- package/dist/{runtime-D1gU5fAJ.js.map → runtime-Ckm-qUYw.js.map} +1 -1
- package/dist/sandbox/boat.d.ts +2 -2
- package/dist/sandbox/boat.js +1 -1
- package/dist/sandbox/daytona.d.ts +2 -2
- package/dist/sandbox/daytona.js +1 -1
- package/dist/{sandbox-Br9klmXq.js → sandbox-CIiuaavT.js} +2 -2
- package/dist/{sandbox-Br9klmXq.js.map → sandbox-CIiuaavT.js.map} +1 -1
- package/dist/sandbox.d.ts +3 -3
- package/dist/sandbox.js +1 -1
- package/dist/secrets-file-BFJSaPHI.js +169 -0
- package/dist/secrets-file-BFJSaPHI.js.map +1 -0
- package/dist/{server-2cICWjvT.js → server-BrBZ0_xA.js} +6 -6
- package/dist/{server-2cICWjvT.js.map → server-BrBZ0_xA.js.map} +1 -1
- package/dist/server-CzilMQ_m.js +1 -0
- package/dist/shared-7f8bQJP4.d.ts +2 -0
- package/dist/{skill-dirs-B7o83G5I.js → skill-dirs-DaHQ463p.js} +2 -2
- package/dist/skill-dirs-DaHQ463p.js.map +1 -0
- package/dist/{source-CFimUGjU.js → source-CfeQ4DL4.js} +2 -2
- package/dist/{source-CFimUGjU.js.map → source-CfeQ4DL4.js.map} +1 -1
- package/dist/source-DqFPDDZU.js +1 -0
- package/dist/{spans-BshoUrAD.js → spans-DUexyi3E.js} +2 -2
- package/dist/spans-DUexyi3E.js.map +1 -0
- package/dist/{src-ZaP7-0pi.js → src-B0ov9X7G.js} +1 -1
- package/dist/{src-CEValY4l.js → src-B3sBDfG2.js} +157 -114
- package/dist/src-B3sBDfG2.js.map +1 -0
- package/dist/src-BF1KIG3s.js +4 -0
- package/dist/{src-kjTrRKQJ.js → src-BRZvsbAC.js} +1 -1
- package/dist/{src-DP-gPQ5B.js → src-CJ-VZA2l.js} +1 -1
- package/dist/{src-B8t-GsRm.js → src-CMsTDH9Y.js} +1 -1
- package/dist/src-Cn5H3izr.js +3079 -0
- package/dist/src-Cn5H3izr.js.map +1 -0
- package/dist/{src-7kshnPZC.js → src-D2ILO3ov.js} +1 -1
- package/dist/{src-CRZg669b.js → src-DIk7y1HM.js} +1 -1
- package/dist/src-hPuCF6xC.js +1 -0
- package/dist/{src-B5r1d23Y.js → src-o0VTS7Rt.js} +5 -2
- package/dist/{src-B5r1d23Y.js.map → src-o0VTS7Rt.js.map} +1 -1
- package/dist/src-zu03lgt2.js +2 -0
- package/dist/ssh-pool-CYCX_JbC.js +1 -0
- package/dist/{ssh-pool-CANmGvdx.js → ssh-pool-CpPNPvOK.js} +7 -7
- package/dist/{ssh-pool-CANmGvdx.js.map → ssh-pool-CpPNPvOK.js.map} +1 -1
- package/dist/{start-D-xFuv0f.js → start-CCbSo9Hw.js} +13 -6
- package/dist/start-CCbSo9Hw.js.map +1 -0
- package/dist/startup-YENEnSa_.js +16 -0
- package/dist/startup-YENEnSa_.js.map +1 -0
- package/dist/{state-DcuHVqLB.js → state-BPIvAS8P.js} +5 -5
- package/dist/{state-DcuHVqLB.js.map → state-BPIvAS8P.js.map} +1 -1
- package/dist/state-Cqcd4_5G.js +1 -0
- package/dist/store/local.d.ts +1 -1
- package/dist/store/s3.d.ts +1 -1
- package/dist/{studio-share-qopKtSPe.js → studio-share-NQDwAWR_.js} +6 -6
- package/dist/{studio-share-qopKtSPe.js.map → studio-share-NQDwAWR_.js.map} +1 -1
- package/dist/suite-BvIl9-41.js +2 -0
- package/dist/{suite-DBbQs15H.js → suite-Bz0uCwd3.js} +4 -4
- package/dist/{suite-DBbQs15H.js.map → suite-Bz0uCwd3.js.map} +1 -1
- package/dist/{summary-CtTtjh3v.js → summary-Bx1qyFwL.js} +8 -8
- package/dist/{summary-CtTtjh3v.js.map → summary-Bx1qyFwL.js.map} +1 -1
- package/dist/{sync-DcFcjYLX.js → sync-BeiDYfR6.js} +6 -6
- package/dist/{sync-DcFcjYLX.js.map → sync-BeiDYfR6.js.map} +1 -1
- package/dist/{tart-CgW8e9RN.d.ts → tart-Brv7Huzv.d.ts} +2 -2
- package/dist/{tart-bake-BksL4gS9.js → tart-bake-Cdk8YaPG.js} +1 -1
- package/dist/{tart-bake-BEzKMVWv.js → tart-bake-Dhj-q9AS.js} +7 -7
- package/dist/{tart-bake-BEzKMVWv.js.map → tart-bake-Dhj-q9AS.js.map} +1 -1
- package/dist/{tart-cli-C05FdPQV.js → tart-cli-B1qZ4EPU.js} +2 -2
- package/dist/{tart-cli-C05FdPQV.js.map → tart-cli-B1qZ4EPU.js.map} +1 -1
- package/dist/{tart-cli-DVI2SWz4.js → tart-cli-B7YKODI8.js} +1 -1
- package/dist/{tart-D4VLu2qF.js → tart-ggAmpJpj.js} +7 -7
- package/dist/{tart-D4VLu2qF.js.map → tart-ggAmpJpj.js.map} +1 -1
- package/dist/{tart-hosts-GDk-lRnT.js → tart-hosts-BaeyUzzq.js} +4 -4
- package/dist/{tart-hosts-GDk-lRnT.js.map → tart-hosts-BaeyUzzq.js.map} +1 -1
- package/dist/{tart-hosts-DESXVcNv.js → tart-hosts-D0tEFNJz.js} +1 -1
- package/dist/{tart-images-CLpWt7Mm.js → tart-images-DOboVDfH.js} +2 -2
- package/dist/{tart-images-CLpWt7Mm.js.map → tart-images-DOboVDfH.js.map} +1 -1
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +4 -4
- package/dist/{tool-class-CB-m4PiF.js → tool-class-DzpZJJWK.js} +2 -2
- package/dist/{tool-class-CB-m4PiF.js.map → tool-class-DzpZJJWK.js.map} +1 -1
- package/dist/{trace-CJQLlAbB.js → trace-BY_rkR5K.js} +2 -2
- package/dist/{trace-CJQLlAbB.js.map → trace-BY_rkR5K.js.map} +1 -1
- package/dist/{types-Buut5yGe.js → types-ByoVW0_V.js} +3 -8
- package/dist/types-ByoVW0_V.js.map +1 -0
- package/dist/{types-CYz4dqAd.d.ts → types-CseRWbr7.d.ts} +1 -1
- package/dist/{types-BZaItiui.d.ts → types-DtRJb-jv.d.ts} +203 -199
- package/dist/{ui-Df1vnh7L.js → ui-DsGOlh5c.js} +5 -5
- package/dist/{ui-Df1vnh7L.js.map → ui-DsGOlh5c.js.map} +1 -1
- package/dist/{usage-CwIRPPZ9.js → usage-Dg_IyU0o.js} +3 -5
- package/dist/usage-Dg_IyU0o.js.map +1 -0
- package/dist/vercel-models-DZxE5QJe.js +14 -0
- package/dist/vercel-models-DZxE5QJe.js.map +1 -0
- package/dist/vertex-C7IbGLJg.js +2 -0
- package/dist/{vertex-DQQGhUn7.js → vertex-Plo5WUxj.js} +20 -91
- package/dist/vertex-Plo5WUxj.js.map +1 -0
- package/dist/view/index.d.ts +3 -3
- package/dist/view/index.js +12 -12
- package/dist/view/report/index.d.ts +3 -3
- package/dist/view/report/index.js +3 -3
- package/dist/views-BrNK-NV6.js +2 -0
- package/dist/{views-BP8ck_JR.js → views-Dv-m2rqd.js} +6 -6
- package/dist/{views-BP8ck_JR.js.map → views-Dv-m2rqd.js.map} +1 -1
- package/dist/{vm-container-Bx3bIlDn.js → vm-container-DOkT5Iki.js} +6 -6
- package/dist/{vm-container-Bx3bIlDn.js.map → vm-container-DOkT5Iki.js.map} +1 -1
- package/dist/{vm-images-CimgmVk6.js → vm-images-BKGyBt9y.js} +13 -13
- package/dist/{vm-images-CimgmVk6.js.map → vm-images-BKGyBt9y.js.map} +1 -1
- package/dist/{worker-entry-CY_GX-KW.js → worker-entry-Dt0KPdT9.js} +3 -3
- package/dist/{worker-entry-CY_GX-KW.js.map → worker-entry-Dt0KPdT9.js.map} +1 -1
- package/dist/{workspace-2wz0BP-V.js → workspace-DZs1aV-E.js} +6 -6
- package/dist/{workspace-2wz0BP-V.js.map → workspace-DZs1aV-E.js.map} +1 -1
- package/dist/workspace-Dtfq6vqG.js +1 -0
- package/package.json +1 -1
- package/dist/agent-ofh_n1XS.js +0 -987
- package/dist/agent-ofh_n1XS.js.map +0 -1
- package/dist/agents-D4H9bKHD.d.ts +0 -2
- package/dist/agents-DGr0kCFD.js +0 -1408
- package/dist/agents-DGr0kCFD.js.map +0 -1
- package/dist/assemble-HOUMVnjQ.js +0 -1
- package/dist/bundle-dK2eveab.js.map +0 -1
- package/dist/capture-BEGBn9e9.js +0 -1
- package/dist/cases-Bsp-G-ZL.js +0 -1
- package/dist/cli-eakKMZFR.js.map +0 -1
- package/dist/cli-spec-DO-RQP-t.js.map +0 -1
- package/dist/cloud-run-CKcBID4J.js.map +0 -1
- package/dist/cloud-secrets-D_IiyGgA.js +0 -1
- package/dist/cloud-secrets-OuKaQUlX.js.map +0 -1
- package/dist/config-Ozz1O7Dl.js.map +0 -1
- package/dist/cost-DQ0ayy6h.js.map +0 -1
- package/dist/cursor-catalog-pRZm3jCP.js.map +0 -1
- package/dist/daytona-image-D8TFfSxM.js +0 -1
- package/dist/db-Djz9zixD.js +0 -1
- package/dist/default-effort-DXPtXTsk.js.map +0 -1
- package/dist/doctor-TkGfyasW.js.map +0 -1
- package/dist/env-8x1O8I1M.js.map +0 -1
- package/dist/environment-C2i5ggoS.js.map +0 -1
- package/dist/evaluate-D9hHc00J.js.map +0 -1
- package/dist/events-CwWpBkkc.js +0 -1
- package/dist/files-1PVfWWXB.js +0 -1
- package/dist/files-CsPOd60N.js +0 -1
- package/dist/files-DOz7Qr5r.js +0 -1
- package/dist/harness-install-CTAsIRk9.js.map +0 -1
- package/dist/init-DkTAnHaf.js +0 -1
- package/dist/judge-3ABSMDa4.js.map +0 -1
- package/dist/labels-Dtyf5-pd.js.map +0 -1
- package/dist/model-B89uRS9X.js.map +0 -1
- package/dist/model-BGc_y-K_.js +0 -1
- package/dist/model-Doy9vFnq.js +0 -1
- package/dist/model-U9bZgClN.js.map +0 -1
- package/dist/model-WiM6J5cw.js.map +0 -1
- package/dist/openrouter-models-B1sIOTD2.js.map +0 -1
- package/dist/options-BK7nMvou.js +0 -1
- package/dist/plugins-4DkJ-SSG.js.map +0 -1
- package/dist/preflight-CjR6YpXu.js +0 -1
- package/dist/prepare-neo93PDB.js.map +0 -1
- package/dist/prices-CZWSNosm.js +0 -1
- package/dist/provider-B24hZX95.js +0 -1
- package/dist/provider-stop-DjBMfZW5.js +0 -69
- package/dist/provider-stop-DjBMfZW5.js.map +0 -1
- package/dist/query-3PjR8hU2.js +0 -1
- package/dist/remote-Dr1gXMTr.js.map +0 -1
- package/dist/resolve-CKRG9k6Z.js +0 -1
- package/dist/resolve-ihtFbkZH.js.map +0 -1
- package/dist/routes-Cp4gAjBZ.js +0 -427
- package/dist/routes-Cp4gAjBZ.js.map +0 -1
- package/dist/secrets-file-B1Yj1WjD.js +0 -100
- package/dist/secrets-file-B1Yj1WjD.js.map +0 -1
- package/dist/server-CzTVzKWG.js +0 -1
- package/dist/shared-B3iLKAiu.d.ts +0 -1
- package/dist/skill-dirs-B7o83G5I.js.map +0 -1
- package/dist/source-CydZOoBv.js +0 -1
- package/dist/spans-BshoUrAD.js.map +0 -1
- package/dist/src-2MDgX3cP.js +0 -3
- package/dist/src-CEValY4l.js.map +0 -1
- package/dist/src-CH8ZNcTe.js +0 -1
- package/dist/src-Con14kZF.js +0 -2
- package/dist/ssh-pool-Du_BZWR1.js +0 -1
- package/dist/start-D-xFuv0f.js.map +0 -1
- package/dist/state-C007zNcM.js +0 -1
- package/dist/suite-BQNoCyRE.js +0 -2
- package/dist/types-Buut5yGe.js.map +0 -1
- package/dist/usage-CwIRPPZ9.js.map +0 -1
- package/dist/vercel-models-Ci33llXz.js +0 -21
- package/dist/vercel-models-Ci33llXz.js.map +0 -1
- package/dist/vertex-DQQGhUn7.js.map +0 -1
- package/dist/vertex-DtWe0Xf6.js +0 -1
- package/dist/views-_yc6K-9E.js +0 -2
- package/dist/workspace-CQxNEvkp.js +0 -1
package/dist/agents-DGr0kCFD.js
DELETED
|
@@ -1,1408 +0,0 @@
|
|
|
1
|
-
import { a as providerEndpoints, c as providerServedModel, o as providerHosts, s as providerModelResponses, u as resolveOpenCodeProvider } from "./opencode-providers-ChJTQRmz.js";
|
|
2
|
-
import { t as piProvider } from "./pi-providers-BjcQv2A1.js";
|
|
3
|
-
import { yt as hostAllowed } from "./src-CEValY4l.js";
|
|
4
|
-
import { O as pluginServerName, a as PLUGIN_PARTS, n as PLUGIN_DIR, r as PLUGIN_MANIFEST, t as PART_PATHS } from "./plugins-4DkJ-SSG.js";
|
|
5
|
-
import { a as VERCEL_HOST, c as fxAskedModel, d as servedOn, f as vercelApi, l as fxVercelCall, n as isRoutingGateway, o as VERCEL_KEY, r as onRoutingGateway, t as ROUTING_GATEWAYS, u as fxVercelEndpoints } from "./routes-Cp4gAjBZ.js";
|
|
6
|
-
import { a as VERTEX_ROUTES, t as SANDBOX_ACCESS_TOKEN } from "./vertex-DQQGhUn7.js";
|
|
7
|
-
import { r as modelLimits } from "./prices-7Av-R8LY.js";
|
|
8
|
-
import { t as InfraError } from "./types-Buut5yGe.js";
|
|
9
|
-
import { a as hostEnv, r as heldSecret } from "./secrets-file-B1Yj1WjD.js";
|
|
10
|
-
import { o as withoutBom } from "./text-B8-W3Cvn.js";
|
|
11
|
-
import { r as SKILL_LAYOUTS } from "./skill-dirs-B7o83G5I.js";
|
|
12
|
-
// src/harness/agents.ts
|
|
13
|
-
const WEB_EVENTS = {
|
|
14
|
-
webSearch: "web-search",
|
|
15
|
-
webFetch: "web-fetch"
|
|
16
|
-
};
|
|
17
|
-
/** `harnessMetadata.cursorSdk.unreportedTools` as transcript event types. */
|
|
18
|
-
function cursorUnreported(harnessMetadata) {
|
|
19
|
-
const tools = harnessMetadata?.cursorSdk?.unreportedTools;
|
|
20
|
-
return Array.isArray(tools) ? tools.flatMap((t) => WEB_EVENTS[t] ? [WEB_EVENTS[t]] : []) : [];
|
|
21
|
-
}
|
|
22
|
-
const usdIn = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0 ? v : void 0;
|
|
23
|
-
/** Claude Code's `total_cost_usd`, its session's cost so far, as its bridge reports it. */
|
|
24
|
-
function claudeCodeCost(harnessMetadata) {
|
|
25
|
-
const meta = harnessMetadata?.["claude-code"];
|
|
26
|
-
const usd = usdIn(meta?.costUsd);
|
|
27
|
-
if (usd === void 0) return void 0;
|
|
28
|
-
return {
|
|
29
|
-
usd,
|
|
30
|
-
session: typeof meta?.sessionId === "string" ? meta.sessionId : ""
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
/** The sum of the turn's model calls' `cost.total`, priced by pi or billed by OpenRouter. */
|
|
34
|
-
function piCost(harnessMetadata) {
|
|
35
|
-
const usd = usdIn(harnessMetadata?.pi?.costUsd);
|
|
36
|
-
return usd === void 0 ? void 0 : { usd };
|
|
37
|
-
}
|
|
38
|
-
/** A Gemini API key's only request: `POST /v1beta/models/<model>:streamGenerateContent`. */
|
|
39
|
-
const GEMINI_ENDPOINTS = [{
|
|
40
|
-
host: "generativelanguage.googleapis.com",
|
|
41
|
-
path: { regex: "^/v1beta/models/[^/]+:streamGenerateContent$" },
|
|
42
|
-
method: ["POST"]
|
|
43
|
-
}];
|
|
44
|
-
/** Antigravity's: its model calls, and the `:generateContent` call its `search_web` tool makes. */
|
|
45
|
-
const ANTIGRAVITY_ENDPOINTS = [{
|
|
46
|
-
host: "generativelanguage.googleapis.com",
|
|
47
|
-
path: { regex: "^/v1beta/models/[\\w.-]+:(?:streamGenerateContent|generateContent)$" },
|
|
48
|
-
method: ["POST"]
|
|
49
|
-
}];
|
|
50
|
-
/** Goose's: the model call, and the model list it fetches with the key at the start of a turn. */
|
|
51
|
-
const GOOSE_ENDPOINTS = [...GEMINI_ENDPOINTS, {
|
|
52
|
-
host: "generativelanguage.googleapis.com",
|
|
53
|
-
path: { regex: "^/v1beta/models$" },
|
|
54
|
-
method: ["GET"]
|
|
55
|
-
}];
|
|
56
|
-
/**
|
|
57
|
-
* What Grok Build sends the key on: the model list and the key's status as a session starts, and
|
|
58
|
-
* its model calls (Chat Completions, and the Responses API for a model or tool that takes it).
|
|
59
|
-
*/
|
|
60
|
-
const XAI_ENDPOINTS = [
|
|
61
|
-
{
|
|
62
|
-
host: "api.x.ai",
|
|
63
|
-
path: { exact: "/v1/models" },
|
|
64
|
-
method: ["GET"]
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
host: "api.x.ai",
|
|
68
|
-
path: { exact: "/v1/api-key" },
|
|
69
|
-
method: ["GET"]
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
host: "api.x.ai",
|
|
73
|
-
path: { exact: "/v1/chat/completions" },
|
|
74
|
-
method: ["POST"]
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
host: "api.x.ai",
|
|
78
|
-
path: { exact: "/v1/responses" },
|
|
79
|
-
method: ["POST"]
|
|
80
|
-
}
|
|
81
|
-
];
|
|
82
|
-
/** xAI's model calls, whose responses name the model that served them. */
|
|
83
|
-
const XAI_MODEL_RESPONSES = XAI_ENDPOINTS.filter((e) => e.path.exact === "/v1/chat/completions" || e.path.exact === "/v1/responses");
|
|
84
|
-
/** The model an xAI response says served it. */
|
|
85
|
-
const xaiServedModel = ({ host, responseModel }) => host === "api.x.ai" ? responseModel : void 0;
|
|
86
|
-
/** The model a Gemini API request names in its URL. */
|
|
87
|
-
const geminiServedModel = ({ host, path }) => host === "generativelanguage.googleapis.com" ? /^\/v1beta\/models\/([^/:]+):streamGenerateContent$/.exec(path)?.[1] : void 0;
|
|
88
|
-
/** Cursor's agent stream: one call per turn, which carries the turn's model output and tool calls. */
|
|
89
|
-
const CURSOR_RUN = {
|
|
90
|
-
host: "api2.cursor.sh",
|
|
91
|
-
path: { exact: "/agent.v1.AgentService/RunSSE" },
|
|
92
|
-
method: ["POST"]
|
|
93
|
-
};
|
|
94
|
-
/** Cursor's key exchange: the only request the Cursor SDK sends the API key on. */
|
|
95
|
-
const CURSOR_EXCHANGE = {
|
|
96
|
-
host: "api2.cursor.sh",
|
|
97
|
-
path: { exact: "/auth/exchange_user_api_key" },
|
|
98
|
-
method: ["POST"]
|
|
99
|
-
};
|
|
100
|
-
/** Codex's model calls: the Responses API, whose response names the served model. */
|
|
101
|
-
const OPENAI_MODEL_ENDPOINTS = [{
|
|
102
|
-
host: "api.openai.com",
|
|
103
|
-
path: { exact: "/v1/responses" },
|
|
104
|
-
method: ["POST"]
|
|
105
|
-
}];
|
|
106
|
-
/** What Codex sends the key on: its model calls, and its web search tool's own endpoint. */
|
|
107
|
-
const OPENAI_ENDPOINTS = [...OPENAI_MODEL_ENDPOINTS, {
|
|
108
|
-
host: "api.openai.com",
|
|
109
|
-
path: { exact: "/v1/alpha/search" },
|
|
110
|
-
method: ["POST"]
|
|
111
|
-
}];
|
|
112
|
-
/**
|
|
113
|
-
* The model the Responses API says served a request, from its response (a dated snapshot for some
|
|
114
|
-
* models), and the reasoning effort Codex resolved for it, e.g. `gpt-5.6-luna[effort=medium]`.
|
|
115
|
-
*/
|
|
116
|
-
const openaiServedModel = ({ host, path, responseModel, responseEffort }) => host === "api.openai.com" && path === "/v1/responses" && responseModel ? `${responseModel}${responseEffort ? `[effort=${responseEffort}]` : ""}` : void 0;
|
|
117
|
-
/**
|
|
118
|
-
* OpenCode on the model's provider (`anthropic/claude-haiku-4-5` is Anthropic's): its key, the
|
|
119
|
-
* requests OpenCode sends it on, its hosts plus Exa's for web search, and the served model from
|
|
120
|
-
* the URL (Gemini's API, Bedrock's) or the response body. Bedrock's hosts are its `AWS_REGION`'s.
|
|
121
|
-
*/
|
|
122
|
-
function opencodeForModel(model, env = process.env) {
|
|
123
|
-
const resolved = resolveOpenCodeProvider(model, env);
|
|
124
|
-
if ("error" in resolved) throw new InfraError(`opencode(): ${resolved.error}`);
|
|
125
|
-
const { provider } = resolved;
|
|
126
|
-
const modelResponses = providerModelResponses(provider);
|
|
127
|
-
return {
|
|
128
|
-
credential: provider.env,
|
|
129
|
-
endpoints: providerEndpoints(provider),
|
|
130
|
-
...modelResponses.length ? { modelResponses } : {},
|
|
131
|
-
modelCalls: providerEndpoints(provider).filter((e) => e.method.includes("POST")),
|
|
132
|
-
servedModel: (request) => providerServedModel(provider, request),
|
|
133
|
-
hosts: [...providerHosts(provider), "mcp.exa.ai"]
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* The variables besides its key that OpenCode's provider takes from the host, as they are:
|
|
138
|
-
* Bedrock's `AWS_REGION` (default `us-east-1`); none for most providers.
|
|
139
|
-
*/
|
|
140
|
-
function opencodeVars(model, env = process.env) {
|
|
141
|
-
const resolved = resolveOpenCodeProvider(model, env);
|
|
142
|
-
if ("error" in resolved) throw new InfraError(`opencode(): ${resolved.error}`);
|
|
143
|
-
return resolved.vars;
|
|
144
|
-
}
|
|
145
|
-
/** The `<provider>` a pi or Goose model id, `<provider>/<model>`, names. */
|
|
146
|
-
const providerOf = (model) => model.slice(0, Math.max(model.indexOf("/"), 0));
|
|
147
|
-
/** The model id pi or Goose asks its provider for: the id without its `<provider>/`. */
|
|
148
|
-
const withoutProvider = (model) => model.slice(model.indexOf("/") + 1);
|
|
149
|
-
/** reeval's name for a provider's key where it isn't the agent's: Google's, which the judge reads too. */
|
|
150
|
-
const HOST_CREDENTIAL = { google: "GOOGLE_GENERATIVE_AI_API_KEY" };
|
|
151
|
-
/** A provider's model calls: the POST requests among those its key is sent on. */
|
|
152
|
-
const modelCallsOf = (endpoints) => endpoints.filter((e) => e.method?.includes("POST"));
|
|
153
|
-
/** The model a response from `hosts`' model calls names. */
|
|
154
|
-
const respondedOn = (...hosts) => (request) => hosts.includes(request.host) && request.method === "POST" ? request.responseModel : void 0;
|
|
155
|
-
/**
|
|
156
|
-
* pi on the model's provider (`xai/grok-4.5` is xAI's), from the table probed on the pinned pi
|
|
157
|
-
* (harness-pi's pi-provider-table.ts): its key, the requests pi sends it on, their hosts, and the
|
|
158
|
-
* served model from a Gemini API's URL or the response body. Throws naming why reeval can't run a
|
|
159
|
-
* provider pi has, or that pi has none of that name.
|
|
160
|
-
*/
|
|
161
|
-
function piForModel(model) {
|
|
162
|
-
const id = providerOf(model);
|
|
163
|
-
const provider = piProvider(id);
|
|
164
|
-
if ("refused" in provider) throw new InfraError(`pi(): ${directProviderRefusal("pi", model)}`);
|
|
165
|
-
const endpoints = provider.endpoints.map(({ host, method, path }) => ({
|
|
166
|
-
host,
|
|
167
|
-
method,
|
|
168
|
-
path
|
|
169
|
-
}));
|
|
170
|
-
const hosts = [...new Set(endpoints.map((e) => e.host))];
|
|
171
|
-
const inUrl = provider.endpoints.some((e) => e.api === "google-generative-ai");
|
|
172
|
-
const modelResponses = provider.endpoints.filter((e) => e.api !== "google-generative-ai").map(({ host, method, path }) => ({
|
|
173
|
-
host,
|
|
174
|
-
method,
|
|
175
|
-
path
|
|
176
|
-
}));
|
|
177
|
-
return {
|
|
178
|
-
credential: HOST_CREDENTIAL[id] ?? provider.credentialEnv,
|
|
179
|
-
authAs: provider.credentialEnv,
|
|
180
|
-
endpoints,
|
|
181
|
-
modelCalls: modelCallsOf(endpoints),
|
|
182
|
-
...modelResponses.length ? { modelResponses } : {},
|
|
183
|
-
servedModel: (request) => openaiServedModel(request) ?? (inUrl && hosts.includes(request.host) ? /\/models\/([^/:]+):streamGenerateContent$/.exec(request.path)?.[1] : void 0) ?? respondedOn(...hosts)(request),
|
|
184
|
-
hosts
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
/** A provider pi runs on its own key; throws naming why reeval can't run one. */
|
|
188
|
-
function keyed(provider) {
|
|
189
|
-
if ("refused" in provider) throw new InfraError(`pi(): ${provider.refused}`);
|
|
190
|
-
return provider;
|
|
191
|
-
}
|
|
192
|
-
/** Anthropic's Messages API, whose response names the model that served it. */
|
|
193
|
-
const ANTHROPIC_MESSAGES = [{
|
|
194
|
-
host: "api.anthropic.com",
|
|
195
|
-
path: { exact: "/v1/messages" },
|
|
196
|
-
method: ["POST"]
|
|
197
|
-
}];
|
|
198
|
-
/** OpenAI's Chat Completions API, whose response names the model that served it. */
|
|
199
|
-
const OPENAI_CHAT = [{
|
|
200
|
-
host: "api.openai.com",
|
|
201
|
-
path: { exact: "/v1/chat/completions" },
|
|
202
|
-
method: ["POST"]
|
|
203
|
-
}];
|
|
204
|
-
/** xAI's Chat Completions API, which Goose's OpenAI-compatible `xai` provider calls. */
|
|
205
|
-
const XAI_CHAT = [{
|
|
206
|
-
host: "api.x.ai",
|
|
207
|
-
path: { exact: "/v1/chat/completions" },
|
|
208
|
-
method: ["POST"]
|
|
209
|
-
}];
|
|
210
|
-
/**
|
|
211
|
-
* Goose on each provider reeval brokers its key for (Goose's `google`, `anthropic`, `openai` and
|
|
212
|
-
* `xai`): its model calls and the model list it fetches.
|
|
213
|
-
*/
|
|
214
|
-
const GOOSE_DIRECT = {
|
|
215
|
-
google: {
|
|
216
|
-
credential: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
217
|
-
authAs: "GOOGLE_API_KEY",
|
|
218
|
-
endpoints: GOOSE_ENDPOINTS,
|
|
219
|
-
servedModel: geminiServedModel,
|
|
220
|
-
hosts: ["generativelanguage.googleapis.com"]
|
|
221
|
-
},
|
|
222
|
-
anthropic: {
|
|
223
|
-
credential: "ANTHROPIC_API_KEY",
|
|
224
|
-
authAs: "ANTHROPIC_API_KEY",
|
|
225
|
-
endpoints: [...ANTHROPIC_MESSAGES, {
|
|
226
|
-
host: "api.anthropic.com",
|
|
227
|
-
path: { exact: "/v1/models" },
|
|
228
|
-
method: ["GET"]
|
|
229
|
-
}],
|
|
230
|
-
modelResponses: ANTHROPIC_MESSAGES,
|
|
231
|
-
servedModel: respondedOn("api.anthropic.com"),
|
|
232
|
-
hosts: ["api.anthropic.com"]
|
|
233
|
-
},
|
|
234
|
-
openai: {
|
|
235
|
-
credential: "OPENAI_API_KEY",
|
|
236
|
-
authAs: "OPENAI_API_KEY",
|
|
237
|
-
endpoints: [
|
|
238
|
-
...OPENAI_CHAT,
|
|
239
|
-
...OPENAI_MODEL_ENDPOINTS,
|
|
240
|
-
{
|
|
241
|
-
host: "api.openai.com",
|
|
242
|
-
path: { exact: "/v1/models" },
|
|
243
|
-
method: ["GET"]
|
|
244
|
-
}
|
|
245
|
-
],
|
|
246
|
-
modelResponses: [...OPENAI_CHAT, ...OPENAI_MODEL_ENDPOINTS],
|
|
247
|
-
servedModel: (request) => openaiServedModel(request) ?? respondedOn("api.openai.com")(request),
|
|
248
|
-
hosts: ["api.openai.com"]
|
|
249
|
-
},
|
|
250
|
-
xai: {
|
|
251
|
-
credential: "XAI_API_KEY",
|
|
252
|
-
authAs: "XAI_API_KEY",
|
|
253
|
-
endpoints: [...XAI_CHAT, {
|
|
254
|
-
host: "api.x.ai",
|
|
255
|
-
path: { exact: "/v1/models" },
|
|
256
|
-
method: ["GET"]
|
|
257
|
-
}],
|
|
258
|
-
modelResponses: XAI_CHAT,
|
|
259
|
-
servedModel: xaiServedModel,
|
|
260
|
-
hosts: ["api.x.ai"]
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
/** The Goose providers reeval runs on their own keys, for messages. */
|
|
264
|
-
const GOOSE_PROVIDERS = Object.keys(GOOSE_DIRECT);
|
|
265
|
-
/** Goose on the model's provider; throws naming the providers reeval brokers a key for. */
|
|
266
|
-
function gooseForModel(model) {
|
|
267
|
-
const direct = GOOSE_DIRECT[providerOf(model)];
|
|
268
|
-
if (!direct) throw new InfraError(`goose(): ${directProviderRefusal("goose", model)}`);
|
|
269
|
-
return {
|
|
270
|
-
...direct,
|
|
271
|
-
modelCalls: modelCallsOf(direct.endpoints)
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
/** Why pi or Goose can't run `model` on its provider's own key, or undefined when it can. */
|
|
275
|
-
function directProviderRefusal(kind, model) {
|
|
276
|
-
if (kind === "goose") return GOOSE_DIRECT[providerOf(model)] ? void 0 : `reeval runs Goose on its own key for its ${GOOSE_PROVIDERS.join(", ")} providers, so not ${model}: where Goose's other providers send their keys isn't probed yet. Run it through a gateway`;
|
|
277
|
-
const provider = piProvider(providerOf(model));
|
|
278
|
-
return "refused" in provider ? `${provider.refused}, so not ${model}` : void 0;
|
|
279
|
-
}
|
|
280
|
-
/** Codex's `config.toml` `[mcp_servers]` shape. */
|
|
281
|
-
function codexMcpServers(servers) {
|
|
282
|
-
return Object.fromEntries(Object.entries(servers).map(([name, s]) => {
|
|
283
|
-
if (s.transport === "sse") throw new InfraError(`Codex has no SSE MCP transport, so it can't use the ${name} server (mcp.sse): use mcp.http or mcp.stdio`);
|
|
284
|
-
return s.transport === "stdio" ? [name, {
|
|
285
|
-
command: s.command,
|
|
286
|
-
args: s.args,
|
|
287
|
-
env: s.env ?? {}
|
|
288
|
-
}] : [name, {
|
|
289
|
-
url: s.url,
|
|
290
|
-
http_headers: s.headers ?? {}
|
|
291
|
-
}];
|
|
292
|
-
}));
|
|
293
|
-
}
|
|
294
|
-
/** The `.mcp.json` shape. */
|
|
295
|
-
function claudeMcpServers(servers) {
|
|
296
|
-
return Object.fromEntries(Object.entries(servers).map(([name, s]) => s.transport === "stdio" ? [name, {
|
|
297
|
-
type: "stdio",
|
|
298
|
-
command: s.command,
|
|
299
|
-
args: s.args,
|
|
300
|
-
env: s.env
|
|
301
|
-
}] : [name, {
|
|
302
|
-
type: s.transport,
|
|
303
|
-
url: s.url,
|
|
304
|
-
headers: s.headers
|
|
305
|
-
}]));
|
|
306
|
-
}
|
|
307
|
-
/** The Antigravity CLI's `mcp_config.json` shape: remote servers take `serverUrl`, not `url`. */
|
|
308
|
-
function antigravityMcpServers(servers) {
|
|
309
|
-
return Object.fromEntries(Object.entries(servers).map(([name, s]) => s.transport === "stdio" ? [name, {
|
|
310
|
-
command: s.command,
|
|
311
|
-
args: s.args,
|
|
312
|
-
env: s.env
|
|
313
|
-
}] : [name, {
|
|
314
|
-
serverUrl: s.url,
|
|
315
|
-
headers: s.headers
|
|
316
|
-
}]));
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* A `{env:…}` or `{file:…}` OpenCode would substitute. It runs `\{env:[^}]+\}`, then
|
|
320
|
-
* `\{file:[^}]+\}`, over its whole config text with no escape, so a reference left open at the end
|
|
321
|
-
* of a value runs on into the JSON after it, and only `{env:}` and `{file:}` are left alone.
|
|
322
|
-
*/
|
|
323
|
-
const OPENCODE_REFERENCE = /\{(?:env|file):(?!\})/;
|
|
324
|
-
const fieldKey = (key) => /^[A-Za-z_$][\w$]*$/.test(key) ? `.${key}` : `[${JSON.stringify(key)}]`;
|
|
325
|
-
/**
|
|
326
|
-
* The first part of a server OpenCode would substitute, as what the server wouldn't get: its name,
|
|
327
|
-
* a value as `mcp.<name>.<field>`, or an env or header name. Names are in the same config text as
|
|
328
|
-
* values, so they're substituted too; a secret's value is never named.
|
|
329
|
-
*/
|
|
330
|
-
function openCodeReference(name, s) {
|
|
331
|
-
if (OPENCODE_REFERENCE.test(name)) return "its name";
|
|
332
|
-
const server = `mcp${fieldKey(name)}`;
|
|
333
|
-
const [map, kind, values] = s.transport === "stdio" ? [
|
|
334
|
-
"env",
|
|
335
|
-
"env",
|
|
336
|
-
s.env ?? {}
|
|
337
|
-
] : [
|
|
338
|
-
"headers",
|
|
339
|
-
"header",
|
|
340
|
-
s.headers ?? {}
|
|
341
|
-
];
|
|
342
|
-
return [...s.transport === "stdio" ? [[`${server}.command`, s.command], ...s.args.map((a, i) => [`${server}.args[${i}]`, a])] : [[`${server}.url`, s.url]], ...Object.entries(values).flatMap(([k, v]) => [[`the ${kind} name ${k} in ${server}.${map}`, k], [`${server}.${map}${fieldKey(k)}`, v]])].find(([, text]) => OPENCODE_REFERENCE.test(text))?.[0];
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* OpenCode's config shape (its `mcp.servers`), which the adapter sets `codemode: false` on.
|
|
346
|
-
* OpenCode has no SSE transport, and refuses a value it would substitute.
|
|
347
|
-
*/
|
|
348
|
-
function opencodeMcpServers(servers) {
|
|
349
|
-
return Object.fromEntries(Object.entries(servers).map(([name, s]) => {
|
|
350
|
-
if (s.transport === "sse") throw new InfraError(`OpenCode has no SSE MCP transport, so it can't use the ${name} server (mcp.sse): use mcp.http or mcp.stdio`);
|
|
351
|
-
const field = openCodeReference(name, s);
|
|
352
|
-
if (field) throw new InfraError(`OpenCode substitutes {env:…} and {file:…} anywhere in its config, with no escape, so the ${name} server wouldn't get ${field} as written: take the reference out, or leave OpenCode out of this cell`);
|
|
353
|
-
return s.transport === "stdio" ? [name, {
|
|
354
|
-
type: "local",
|
|
355
|
-
command: [s.command, ...s.args],
|
|
356
|
-
environment: s.env ?? {}
|
|
357
|
-
}] : [name, {
|
|
358
|
-
type: "remote",
|
|
359
|
-
url: s.url,
|
|
360
|
-
headers: s.headers ?? {},
|
|
361
|
-
oauth: false
|
|
362
|
-
}];
|
|
363
|
-
}));
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* The key Goose keeps an extension by (its `name_to_key`): whitespace dropped, anything but ASCII
|
|
367
|
-
* letters, digits, `_` and `-` made `_`, lower-cased. Of two extensions with one key it keeps one.
|
|
368
|
-
*/
|
|
369
|
-
const gooseKey = (name) => name.replace(/\s/g, "").replace(/[^A-Za-z0-9_-]/g, "_").toLowerCase();
|
|
370
|
-
/** Goose's extension shape (its `config.yaml`); it has no SSE transport. */
|
|
371
|
-
function gooseMcpServers(servers) {
|
|
372
|
-
const byKey = /* @__PURE__ */ new Map();
|
|
373
|
-
for (const name of Object.keys(servers)) {
|
|
374
|
-
const key = gooseKey(name);
|
|
375
|
-
const other = byKey.get(key);
|
|
376
|
-
if (other !== void 0) throw new InfraError(`Goose keys the ${other} and ${name} MCP servers both as ${key}, and keeps only one: rename one`);
|
|
377
|
-
byKey.set(key, name);
|
|
378
|
-
}
|
|
379
|
-
return Object.fromEntries(Object.entries(servers).map(([name, s]) => {
|
|
380
|
-
if (s.transport === "sse") throw new InfraError(`Goose has no SSE MCP transport, so it can't use the ${name} server (mcp.sse): use mcp.http or mcp.stdio`);
|
|
381
|
-
return s.transport === "stdio" ? [name, {
|
|
382
|
-
type: "stdio",
|
|
383
|
-
cmd: s.command,
|
|
384
|
-
args: s.args,
|
|
385
|
-
envs: s.env ?? {}
|
|
386
|
-
}] : [name, {
|
|
387
|
-
type: "streamable_http",
|
|
388
|
-
uri: s.url,
|
|
389
|
-
headers: s.headers ?? {}
|
|
390
|
-
}];
|
|
391
|
-
}));
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* pi's `mcp.json` shape, which the adapter escapes and sets `"exposure": "direct"` on. pi
|
|
395
|
-
* skips a server whose name isn't letters, digits, `_` and `-`, so the plan refuses it instead.
|
|
396
|
-
* A plugin's server, `<plugin>:<server>`, is named `<plugin>_<server>`, so its tools are
|
|
397
|
-
* `mcp__<plugin>_<server>__<tool>`.
|
|
398
|
-
*/
|
|
399
|
-
function piMcpServers(servers) {
|
|
400
|
-
const named = /* @__PURE__ */ new Map();
|
|
401
|
-
return Object.fromEntries(Object.entries(servers).map(([key, s]) => {
|
|
402
|
-
const name = /^[a-z0-9-]+:[^:]+$/.test(key) ? key.replace(":", "_") : key;
|
|
403
|
-
if (!/^[A-Za-z0-9_-]+$/.test(name)) throw new InfraError(`pi takes MCP server names of letters, digits, "_" and "-" only, so it can't use the ${key} server: rename it`);
|
|
404
|
-
const other = named.get(name);
|
|
405
|
-
if (other) throw new InfraError(`pi names the ${key} MCP server ${name}, as it does the ${other} server, and keeps only one: rename one`);
|
|
406
|
-
named.set(name, key);
|
|
407
|
-
if (s.transport === "sse") throw new InfraError(`pi has no SSE MCP transport, so it can't use the ${key} server (mcp.sse): use mcp.http or mcp.stdio`);
|
|
408
|
-
return s.transport === "stdio" ? [name, {
|
|
409
|
-
command: s.command,
|
|
410
|
-
args: s.args,
|
|
411
|
-
env: s.env ?? {}
|
|
412
|
-
}] : [name, {
|
|
413
|
-
url: s.url,
|
|
414
|
-
headers: s.headers ?? {}
|
|
415
|
-
}];
|
|
416
|
-
}));
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* ACP's `McpServer` shape, which fx and Grok Build take on `session/new`: `env` and `headers` as
|
|
420
|
-
* name-value lists.
|
|
421
|
-
*/
|
|
422
|
-
function acpMcpServers(servers) {
|
|
423
|
-
const pairs = (values = {}) => Object.entries(values).map(([name, value]) => ({
|
|
424
|
-
name,
|
|
425
|
-
value
|
|
426
|
-
}));
|
|
427
|
-
return Object.fromEntries(Object.entries(servers).map(([name, s]) => s.transport === "stdio" ? [name, s.command.startsWith("/") ? {
|
|
428
|
-
command: s.command,
|
|
429
|
-
args: s.args,
|
|
430
|
-
env: pairs(s.env)
|
|
431
|
-
} : {
|
|
432
|
-
command: "/usr/bin/env",
|
|
433
|
-
args: [s.command, ...s.args],
|
|
434
|
-
env: pairs(s.env)
|
|
435
|
-
}] : [name, {
|
|
436
|
-
type: s.transport,
|
|
437
|
-
url: s.url,
|
|
438
|
-
headers: pairs(s.headers)
|
|
439
|
-
}]));
|
|
440
|
-
}
|
|
441
|
-
/** fx's ACP `session/new` servers: its `initialize` reports `mcpCapabilities.sse: false`. */
|
|
442
|
-
function fxMcpServers(servers) {
|
|
443
|
-
for (const [name, s] of Object.entries(servers)) if (s.transport === "sse") throw new InfraError(`fx has no SSE MCP transport, so it can't use the ${name} server (mcp.sse): use mcp.http or mcp.stdio`);
|
|
444
|
-
return acpMcpServers(servers);
|
|
445
|
-
}
|
|
446
|
-
/**
|
|
447
|
-
* fx on the model's provider: OpenAI's Chat Completions API for a bare OpenAI id, and Vercel AI
|
|
448
|
-
* Gateway for a gateway id, which only `vercel()` in the gateway list serves. Each response's
|
|
449
|
-
* first `model` names the model that served it.
|
|
450
|
-
*/
|
|
451
|
-
function fxForModel(model) {
|
|
452
|
-
if (!model.includes("/")) {
|
|
453
|
-
const endpoints = [{
|
|
454
|
-
host: "api.openai.com",
|
|
455
|
-
path: { exact: "/v1/chat/completions" },
|
|
456
|
-
method: ["POST"]
|
|
457
|
-
}];
|
|
458
|
-
return {
|
|
459
|
-
credential: "OPENAI_API_KEY",
|
|
460
|
-
endpoints,
|
|
461
|
-
modelResponses: endpoints,
|
|
462
|
-
servedModel: ({ host, responseModel }) => host === "api.openai.com" ? responseModel : void 0,
|
|
463
|
-
hosts: ["api.openai.com"]
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
return {
|
|
467
|
-
credential: VERCEL_KEY,
|
|
468
|
-
endpoints: fxVercelEndpoints(),
|
|
469
|
-
modelResponses: [fxVercelCall()],
|
|
470
|
-
servedModel: servedOn(),
|
|
471
|
-
askedModel: fxAskedModel(),
|
|
472
|
-
hosts: [VERCEL_HOST]
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
/** The Cursor SDK's `McpServerConfig` shape. */
|
|
476
|
-
function cursorMcpServers(servers) {
|
|
477
|
-
return Object.fromEntries(Object.entries(servers).map(([name, s]) => s.transport === "stdio" ? [name, {
|
|
478
|
-
type: "stdio",
|
|
479
|
-
command: s.command,
|
|
480
|
-
args: s.args,
|
|
481
|
-
env: s.env
|
|
482
|
-
}] : [name, {
|
|
483
|
-
type: s.transport,
|
|
484
|
-
url: s.url,
|
|
485
|
-
headers: s.headers
|
|
486
|
-
}]));
|
|
487
|
-
}
|
|
488
|
-
/** Claude Code's hook events as Cursor names them, as the Cursor SDK converts Claude Code's own. */
|
|
489
|
-
const CURSOR_HOOK_EVENTS = {
|
|
490
|
-
SessionStart: "sessionStart",
|
|
491
|
-
SessionEnd: "sessionEnd",
|
|
492
|
-
UserPromptSubmit: "beforeSubmitPrompt",
|
|
493
|
-
PreToolUse: "preToolUse",
|
|
494
|
-
PostToolUse: "postToolUse",
|
|
495
|
-
SubagentStop: "subagentStop",
|
|
496
|
-
PreCompact: "preCompact",
|
|
497
|
-
Stop: "stop"
|
|
498
|
-
};
|
|
499
|
-
/** Claude Code's tool names as Cursor's hooks match them; null for one Cursor has no tool for. */
|
|
500
|
-
const CURSOR_HOOK_TOOLS = {
|
|
501
|
-
Bash: "Shell",
|
|
502
|
-
Read: "Read",
|
|
503
|
-
Write: "Write",
|
|
504
|
-
Edit: "Write",
|
|
505
|
-
Glob: null,
|
|
506
|
-
Grep: "Grep",
|
|
507
|
-
WebFetch: "WebFetch",
|
|
508
|
-
WebSearch: "WebSearch",
|
|
509
|
-
Task: "Task"
|
|
510
|
-
};
|
|
511
|
-
/**
|
|
512
|
-
* A Claude Code hook group's tool matcher as Cursor's, on the tool events only: each name mapped,
|
|
513
|
-
* `mcp__<server>__<tool>` as `MCP:<tool>`; null when it names only tools Cursor lacks.
|
|
514
|
-
*/
|
|
515
|
-
function cursorHookMatcher(event, matcher) {
|
|
516
|
-
if (event !== "PreToolUse" && event !== "PostToolUse") return void 0;
|
|
517
|
-
if (!matcher || matcher === "*") return void 0;
|
|
518
|
-
const out = [];
|
|
519
|
-
for (const raw of matcher.split("|")) {
|
|
520
|
-
const name = raw.trim();
|
|
521
|
-
const parts = name.split("__");
|
|
522
|
-
const tool = name.startsWith("mcp__") && parts.length >= 3 ? `MCP:${parts.slice(2).join("__")}` : CURSOR_HOOK_TOOLS[name] === void 0 ? name : CURSOR_HOOK_TOOLS[name];
|
|
523
|
-
if (tool && !out.includes(tool)) out.push(tool);
|
|
524
|
-
}
|
|
525
|
-
return out.length ? out.join("|") : null;
|
|
526
|
-
}
|
|
527
|
-
/** Where Cursor reads what reeval unpacks from a plugin, in the workspace (settingSources `project`). */
|
|
528
|
-
const CURSOR_PLUGIN_UNPACK = {
|
|
529
|
-
rules: ".cursor/rules",
|
|
530
|
-
agents: ".cursor/agents",
|
|
531
|
-
commands: ".cursor/commands",
|
|
532
|
-
hooks: {
|
|
533
|
-
file: ".cursor/hooks.json",
|
|
534
|
-
events: CURSOR_HOOK_EVENTS,
|
|
535
|
-
matcher: cursorHookMatcher
|
|
536
|
-
}
|
|
537
|
-
};
|
|
538
|
-
/**
|
|
539
|
-
* A plugin subagent's or command's frontmatter as OpenCode 2 takes it: the description, and a
|
|
540
|
-
* subagent's `mode`. OpenCode skips a file whose frontmatter its schema refuses, without saying,
|
|
541
|
-
* and Claude Code's `tools: Read, Grep`, `model: sonnet` and `allowed-tools` are such keys.
|
|
542
|
-
*/
|
|
543
|
-
function opencodeFrontmatter(part, front) {
|
|
544
|
-
const d = front.description;
|
|
545
|
-
const description = typeof d === "string" || typeof d === "number" || typeof d === "boolean" ? String(d) : void 0;
|
|
546
|
-
return {
|
|
547
|
-
...description ? { description } : {},
|
|
548
|
-
...part === "agents" ? { mode: "subagent" } : {}
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
/** Where OpenCode reads plugin subagents and commands, in the workspace's config directory. */
|
|
552
|
-
const OPENCODE_PLUGIN_UNPACK = {
|
|
553
|
-
agents: ".opencode/agents",
|
|
554
|
-
commands: ".opencode/commands",
|
|
555
|
-
frontmatter: opencodeFrontmatter
|
|
556
|
-
};
|
|
557
|
-
/**
|
|
558
|
-
* Where pi reads plugin commands, as prompt templates (`/<name>`), in the workspace, which its
|
|
559
|
-
* `--approve` trusts. Its frontmatter takes `description` and `argument-hint`, and ignores the
|
|
560
|
-
* rest of Claude Code's.
|
|
561
|
-
*/
|
|
562
|
-
const PI_PLUGIN_UNPACK = { commands: ".pi/prompts" };
|
|
563
|
-
/**
|
|
564
|
-
* What Claude Code's plugin format bundles, which Grok Build reads too: every part but rules,
|
|
565
|
-
* which neither loads from a plugin.
|
|
566
|
-
*/
|
|
567
|
-
const CLAUDE_FORMAT_PARTS = PLUGIN_PARTS.filter((p) => p !== "rules");
|
|
568
|
-
/** The marketplace Claude Code's settings name for the session's plugins. */
|
|
569
|
-
const CLAUDE_PLUGIN_MARKETPLACE = "reeval";
|
|
570
|
-
/**
|
|
571
|
-
* Claude Code's settings for the session's plugins: a `directory` marketplace at the directory
|
|
572
|
-
* they were copied to, listing each, and each enabled as `<plugin>@reeval`. Claude Code installs
|
|
573
|
-
* and loads them as it starts, since the bridge leaves every settings source on.
|
|
574
|
-
*/
|
|
575
|
-
function claudePluginFiles(plugins) {
|
|
576
|
-
const [first] = plugins;
|
|
577
|
-
if (!first) return [];
|
|
578
|
-
const json = (value) => `${JSON.stringify(value, null, 2)}\n`;
|
|
579
|
-
const marketplace = {
|
|
580
|
-
name: CLAUDE_PLUGIN_MARKETPLACE,
|
|
581
|
-
owner: { name: "reeval" },
|
|
582
|
-
plugins: plugins.map((p) => ({
|
|
583
|
-
name: p.name,
|
|
584
|
-
source: `./${p.name}`
|
|
585
|
-
}))
|
|
586
|
-
};
|
|
587
|
-
const settings = {
|
|
588
|
-
extraKnownMarketplaces: { [CLAUDE_PLUGIN_MARKETPLACE]: { source: {
|
|
589
|
-
source: "directory",
|
|
590
|
-
path: first.dir.slice(0, first.dir.lastIndexOf("/"))
|
|
591
|
-
} } },
|
|
592
|
-
enabledPlugins: Object.fromEntries(plugins.map((p) => [`${p.name}@${CLAUDE_PLUGIN_MARKETPLACE}`, true]))
|
|
593
|
-
};
|
|
594
|
-
return [{
|
|
595
|
-
path: `${PLUGIN_DIR}/.claude-plugin/marketplace.json`,
|
|
596
|
-
content: json(marketplace)
|
|
597
|
-
}, {
|
|
598
|
-
path: "~/.claude/settings.json",
|
|
599
|
-
content: json(settings),
|
|
600
|
-
merge: true
|
|
601
|
-
}];
|
|
602
|
-
}
|
|
603
|
-
const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
604
|
-
/**
|
|
605
|
-
* Writes the layout's plugin files into the sandbox and returns their paths. A `merge` file's keys
|
|
606
|
-
* go into the JSON object already at its path (an object-valued key merged one level down), so
|
|
607
|
-
* settings an environment's `files` wrote there stay.
|
|
608
|
-
*/
|
|
609
|
-
async function writePluginFiles(sandbox, layout, plugins) {
|
|
610
|
-
const written = [];
|
|
611
|
-
for (const f of layout.pluginFiles?.(plugins) ?? []) {
|
|
612
|
-
const existing = f.merge ? await sandbox.readFile(f.path) : null;
|
|
613
|
-
let content = f.content;
|
|
614
|
-
if (existing?.trim()) {
|
|
615
|
-
let base;
|
|
616
|
-
try {
|
|
617
|
-
base = JSON.parse(withoutBom(existing));
|
|
618
|
-
} catch {}
|
|
619
|
-
if (!isObject(base)) throw new InfraError(`${f.path} isn't a JSON object, so reeval can't enable the session's plugins in it: write it as one in files, or leave it out`);
|
|
620
|
-
const ours = JSON.parse(f.content);
|
|
621
|
-
const merged = { ...base };
|
|
622
|
-
for (const [k, v] of Object.entries(ours)) {
|
|
623
|
-
const was = base[k];
|
|
624
|
-
merged[k] = isObject(v) && isObject(was) ? {
|
|
625
|
-
...was,
|
|
626
|
-
...v
|
|
627
|
-
} : v;
|
|
628
|
-
}
|
|
629
|
-
content = `${JSON.stringify(merged, null, 2)}\n`;
|
|
630
|
-
}
|
|
631
|
-
await sandbox.writeFile(f.path, content);
|
|
632
|
-
written.push(f.path);
|
|
633
|
-
}
|
|
634
|
-
return written;
|
|
635
|
-
}
|
|
636
|
-
/**
|
|
637
|
-
* The MCP servers the agent is given: all of them, less the plugins' own where it takes plugin
|
|
638
|
-
* items namespaced, since it loads those from the plugin and would otherwise start each twice.
|
|
639
|
-
*/
|
|
640
|
-
function agentMcp(layout, mcp, plugins) {
|
|
641
|
-
if (layout.pluginPlacement !== "namespaced") return mcp;
|
|
642
|
-
const own = new Set(plugins.flatMap((p) => p.servers));
|
|
643
|
-
return Object.fromEntries(Object.entries(mcp).filter(([name]) => !own.has(name)));
|
|
644
|
-
}
|
|
645
|
-
/** Where each agent with an image reads rules and skills. */
|
|
646
|
-
const LAYOUTS = {
|
|
647
|
-
cursor: {
|
|
648
|
-
rulesFile: "AGENTS.md",
|
|
649
|
-
...SKILL_LAYOUTS.cursor,
|
|
650
|
-
pluginPlacement: "flat",
|
|
651
|
-
pluginUnpack: CURSOR_PLUGIN_UNPACK,
|
|
652
|
-
pluginHookEvents: Object.keys(CURSOR_HOOK_EVENTS)
|
|
653
|
-
},
|
|
654
|
-
"claude-code": {
|
|
655
|
-
rulesFile: "CLAUDE.md",
|
|
656
|
-
...SKILL_LAYOUTS["claude-code"],
|
|
657
|
-
pluginPlacement: "namespaced",
|
|
658
|
-
pluginFiles: claudePluginFiles
|
|
659
|
-
},
|
|
660
|
-
antigravity: {
|
|
661
|
-
rulesFile: "AGENTS.md",
|
|
662
|
-
...SKILL_LAYOUTS.antigravity,
|
|
663
|
-
pluginPlacement: "namespaced",
|
|
664
|
-
pluginHookEvents: [
|
|
665
|
-
"SessionStart",
|
|
666
|
-
"PreToolUse",
|
|
667
|
-
"PostToolUse",
|
|
668
|
-
"Stop"
|
|
669
|
-
]
|
|
670
|
-
},
|
|
671
|
-
opencode: {
|
|
672
|
-
rulesFile: "AGENTS.md",
|
|
673
|
-
...SKILL_LAYOUTS.opencode,
|
|
674
|
-
pluginPlacement: "flat",
|
|
675
|
-
pluginUnpack: OPENCODE_PLUGIN_UNPACK
|
|
676
|
-
},
|
|
677
|
-
goose: {
|
|
678
|
-
rulesFile: "AGENTS.md",
|
|
679
|
-
...SKILL_LAYOUTS.goose,
|
|
680
|
-
pluginPlacement: "flat"
|
|
681
|
-
},
|
|
682
|
-
pi: {
|
|
683
|
-
rulesFile: "AGENTS.md",
|
|
684
|
-
...SKILL_LAYOUTS.pi,
|
|
685
|
-
pluginPlacement: "flat",
|
|
686
|
-
pluginUnpack: PI_PLUGIN_UNPACK
|
|
687
|
-
},
|
|
688
|
-
codex: {
|
|
689
|
-
rulesFile: "AGENTS.md",
|
|
690
|
-
...SKILL_LAYOUTS.codex,
|
|
691
|
-
pluginPlacement: "namespaced"
|
|
692
|
-
},
|
|
693
|
-
fx: {
|
|
694
|
-
rulesFile: "AGENTS.md",
|
|
695
|
-
...SKILL_LAYOUTS.fx,
|
|
696
|
-
pluginPlacement: "flat"
|
|
697
|
-
},
|
|
698
|
-
"grok-build": {
|
|
699
|
-
rulesFile: "AGENTS.md",
|
|
700
|
-
...SKILL_LAYOUTS["grok-build"],
|
|
701
|
-
pluginPlacement: "namespaced"
|
|
702
|
-
}
|
|
703
|
-
};
|
|
704
|
-
/** Every real agent reeval can drive, by harness kind. */
|
|
705
|
-
const AGENTS = {
|
|
706
|
-
cursor: {
|
|
707
|
-
...LAYOUTS.cursor,
|
|
708
|
-
pluginParts: PLUGIN_PARTS,
|
|
709
|
-
name: "Cursor",
|
|
710
|
-
factory: "cursor",
|
|
711
|
-
platforms: ["linux", "darwin"],
|
|
712
|
-
reasoning: "streamed",
|
|
713
|
-
reasoningTokens: false,
|
|
714
|
-
credential: "CURSOR_API_KEY",
|
|
715
|
-
endpoints: [CURSOR_EXCHANGE],
|
|
716
|
-
modelCalls: [CURSOR_RUN],
|
|
717
|
-
modelStream: true,
|
|
718
|
-
tokens: {
|
|
719
|
-
endpoint: CURSOR_EXCHANGE,
|
|
720
|
-
fields: ["accessToken", "refreshToken"],
|
|
721
|
-
hosts: ["cursor.sh", "*.cursor.sh"]
|
|
722
|
-
},
|
|
723
|
-
unreported: cursorUnreported,
|
|
724
|
-
mcpServers: cursorMcpServers,
|
|
725
|
-
adapter: async ({ auth, mcpServers, descriptor }) => (await import("./src-Con14kZF.js")).createCursorSdk({
|
|
726
|
-
auth,
|
|
727
|
-
...mcpServers ? { mcpServers } : {},
|
|
728
|
-
...descriptor.kind === "cursor" && descriptor.params ? { modelParams: descriptor.params } : {},
|
|
729
|
-
...descriptor.kind === "cursor" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
730
|
-
requireCredentialBrokering: true
|
|
731
|
-
})
|
|
732
|
-
},
|
|
733
|
-
"claude-code": {
|
|
734
|
-
...LAYOUTS["claude-code"],
|
|
735
|
-
pluginParts: CLAUDE_FORMAT_PARTS,
|
|
736
|
-
name: "Claude Code",
|
|
737
|
-
factory: "claudeCode",
|
|
738
|
-
bridgePort: true,
|
|
739
|
-
platforms: ["linux", "darwin"],
|
|
740
|
-
reasoning: "streamed",
|
|
741
|
-
reasoningTokens: true,
|
|
742
|
-
subagentCalls: true,
|
|
743
|
-
reportedCost: claudeCodeCost,
|
|
744
|
-
credential: "ANTHROPIC_API_KEY",
|
|
745
|
-
fallbackCredentials: ["CLAUDE_CODE_OAUTH_TOKEN"],
|
|
746
|
-
modelCalls: [{
|
|
747
|
-
host: "api.anthropic.com",
|
|
748
|
-
path: { exact: "/v1/messages" },
|
|
749
|
-
method: ["POST"]
|
|
750
|
-
}],
|
|
751
|
-
endpoints: [
|
|
752
|
-
{
|
|
753
|
-
host: "api.anthropic.com",
|
|
754
|
-
path: { exact: "/v1/messages" },
|
|
755
|
-
method: ["POST"]
|
|
756
|
-
},
|
|
757
|
-
{
|
|
758
|
-
host: "api.anthropic.com",
|
|
759
|
-
path: { exact: "/v1/messages/count_tokens" },
|
|
760
|
-
method: ["POST"]
|
|
761
|
-
},
|
|
762
|
-
{
|
|
763
|
-
host: "api.anthropic.com",
|
|
764
|
-
path: { exact: "/api/claude_code/settings" },
|
|
765
|
-
method: ["GET"]
|
|
766
|
-
},
|
|
767
|
-
{
|
|
768
|
-
host: "api.anthropic.com",
|
|
769
|
-
path: { exact: "/api/claude_code/policy_limits" },
|
|
770
|
-
method: ["GET"]
|
|
771
|
-
}
|
|
772
|
-
],
|
|
773
|
-
mcpServers: claudeMcpServers,
|
|
774
|
-
adapter: async ({ auth, env, mcpServers, descriptor }) => (await import("./dist-DCG7vZGQ.js")).createClaudeCode({
|
|
775
|
-
auth,
|
|
776
|
-
...mcpServers ? { mcpServers } : {},
|
|
777
|
-
...descriptor.kind === "claude-code" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
778
|
-
env: {
|
|
779
|
-
IS_SANDBOX: "1",
|
|
780
|
-
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1",
|
|
781
|
-
...env
|
|
782
|
-
}
|
|
783
|
-
})
|
|
784
|
-
},
|
|
785
|
-
antigravity: {
|
|
786
|
-
...LAYOUTS.antigravity,
|
|
787
|
-
pluginParts: PLUGIN_PARTS,
|
|
788
|
-
pluginManifestsFirst: [
|
|
789
|
-
"plugin.json",
|
|
790
|
-
".antigravity-plugin/plugin.json",
|
|
791
|
-
".gemini-plugin/plugin.json",
|
|
792
|
-
"gemini-extension.json"
|
|
793
|
-
],
|
|
794
|
-
name: "Antigravity",
|
|
795
|
-
factory: "antigravity",
|
|
796
|
-
keychainTrust: true,
|
|
797
|
-
platforms: ["linux", "darwin"],
|
|
798
|
-
reasoning: "recovered",
|
|
799
|
-
reasoningTokens: true,
|
|
800
|
-
credential: "GEMINI_API_KEY",
|
|
801
|
-
endpoints: ANTIGRAVITY_ENDPOINTS,
|
|
802
|
-
modelCalls: ANTIGRAVITY_ENDPOINTS,
|
|
803
|
-
expectedBlocked: {
|
|
804
|
-
hosts: ["play.googleapis.com", "antigravity-unleash.goog"],
|
|
805
|
-
why: "Antigravity's telemetry and feature flags, which its CLI sends even with telemetry off"
|
|
806
|
-
},
|
|
807
|
-
servedModel: geminiServedModel,
|
|
808
|
-
mcpServers: antigravityMcpServers,
|
|
809
|
-
adapter: async ({ auth, mcpServers, descriptor, plugins, vertex }) => (await import("./src-kjTrRKQJ.js")).createAntigravity({
|
|
810
|
-
auth,
|
|
811
|
-
...vertex ? { vertex } : {},
|
|
812
|
-
...mcpServers ? { mcpServers } : {},
|
|
813
|
-
...plugins.length ? { plugins: plugins.map(({ name, dir }) => ({
|
|
814
|
-
name,
|
|
815
|
-
dir
|
|
816
|
-
})) } : {},
|
|
817
|
-
...descriptor.kind === "antigravity" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
818
|
-
requireCredentialBrokering: true
|
|
819
|
-
})
|
|
820
|
-
},
|
|
821
|
-
opencode: {
|
|
822
|
-
...LAYOUTS.opencode,
|
|
823
|
-
pluginParts: [
|
|
824
|
-
"skills",
|
|
825
|
-
"agents",
|
|
826
|
-
"commands",
|
|
827
|
-
"mcp"
|
|
828
|
-
],
|
|
829
|
-
name: "OpenCode",
|
|
830
|
-
factory: "opencode",
|
|
831
|
-
bridgePort: true,
|
|
832
|
-
platforms: ["linux", "darwin"],
|
|
833
|
-
configuredModelOnStart: true,
|
|
834
|
-
reasoning: "streamed",
|
|
835
|
-
reasoningTokens: "provider",
|
|
836
|
-
storedUsage: async () => {
|
|
837
|
-
const m = await import("./src-2MDgX3cP.js");
|
|
838
|
-
return {
|
|
839
|
-
command: m.openCodeStoredUsageCommand,
|
|
840
|
-
parse: m.parseOpenCodeStoredUsage
|
|
841
|
-
};
|
|
842
|
-
},
|
|
843
|
-
forModel: opencodeForModel,
|
|
844
|
-
mcpServers: opencodeMcpServers,
|
|
845
|
-
adapter: async ({ auth, mcpServers, descriptor, model, vertex }) => (await import("./src-2MDgX3cP.js")).createOpenCode({
|
|
846
|
-
auth,
|
|
847
|
-
model,
|
|
848
|
-
...vertex ? { vertex } : { vars: opencodeVars(model) },
|
|
849
|
-
...descriptor.kind === "opencode" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
850
|
-
...mcpServers ? { mcpServers } : {},
|
|
851
|
-
requireCredentialBrokering: true
|
|
852
|
-
})
|
|
853
|
-
},
|
|
854
|
-
goose: {
|
|
855
|
-
...LAYOUTS.goose,
|
|
856
|
-
pluginParts: ["skills", "mcp"],
|
|
857
|
-
name: "Goose",
|
|
858
|
-
factory: "goose",
|
|
859
|
-
keychainTrust: true,
|
|
860
|
-
bridgePort: true,
|
|
861
|
-
platforms: ["linux", "darwin"],
|
|
862
|
-
configuredModelOnStart: true,
|
|
863
|
-
reasoning: "streamed",
|
|
864
|
-
reasoningTokens: false,
|
|
865
|
-
storedUsage: async () => {
|
|
866
|
-
const m = await import("./src-B8t-GsRm.js");
|
|
867
|
-
return {
|
|
868
|
-
command: m.gooseStoredUsageCommand,
|
|
869
|
-
parse: m.parseGooseStoredUsage,
|
|
870
|
-
mark: m.gooseUsageMark
|
|
871
|
-
};
|
|
872
|
-
},
|
|
873
|
-
forModel: gooseForModel,
|
|
874
|
-
modelId: withoutProvider,
|
|
875
|
-
expectedBlocked: {
|
|
876
|
-
hosts: ["models.dev"],
|
|
877
|
-
why: "Goose's model catalog refresh, which no setting turns off"
|
|
878
|
-
},
|
|
879
|
-
mcpServers: gooseMcpServers,
|
|
880
|
-
adapter: async ({ auth, mcpServers, descriptor, model, vertex }) => {
|
|
881
|
-
const goose = await import("./src-B8t-GsRm.js");
|
|
882
|
-
const direct = {
|
|
883
|
-
google: goose.GEMINI_PROVIDER,
|
|
884
|
-
anthropic: goose.ANTHROPIC_PROVIDER,
|
|
885
|
-
openai: goose.OPENAI_PROVIDER,
|
|
886
|
-
xai: goose.XAI_PROVIDER
|
|
887
|
-
};
|
|
888
|
-
const provider = onRoutingGateway(descriptor, {
|
|
889
|
-
vercel: goose.AI_GATEWAY_PROVIDER,
|
|
890
|
-
openrouter: goose.OPENROUTER_PROVIDER
|
|
891
|
-
}) ?? direct[providerOf(descriptor.model)];
|
|
892
|
-
return goose.createGoose({
|
|
893
|
-
...vertex ? { vertex } : provider ? { provider } : {},
|
|
894
|
-
auth,
|
|
895
|
-
model,
|
|
896
|
-
...descriptor.kind === "goose" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
897
|
-
...mcpServers ? { mcpServers } : {},
|
|
898
|
-
requireCredentialBrokering: true
|
|
899
|
-
});
|
|
900
|
-
}
|
|
901
|
-
},
|
|
902
|
-
pi: {
|
|
903
|
-
...LAYOUTS.pi,
|
|
904
|
-
pluginParts: [
|
|
905
|
-
"skills",
|
|
906
|
-
"commands",
|
|
907
|
-
"mcp"
|
|
908
|
-
],
|
|
909
|
-
name: "pi",
|
|
910
|
-
factory: "pi",
|
|
911
|
-
platforms: ["linux", "darwin"],
|
|
912
|
-
reasoning: "streamed",
|
|
913
|
-
reasoningTokens: true,
|
|
914
|
-
reportedCost: piCost,
|
|
915
|
-
forModel: piForModel,
|
|
916
|
-
modelId: withoutProvider,
|
|
917
|
-
mcpServers: piMcpServers,
|
|
918
|
-
adapter: async ({ auth, mcpServers, descriptor, model, vertex }) => {
|
|
919
|
-
const pi = await import("./src-CRZg669b.js");
|
|
920
|
-
const api = vercelApi();
|
|
921
|
-
const gateway = onRoutingGateway(descriptor, {
|
|
922
|
-
vercel: {
|
|
923
|
-
...pi.PI_AI_GATEWAY,
|
|
924
|
-
openai: api.openai,
|
|
925
|
-
anthropic: api.anthropic
|
|
926
|
-
},
|
|
927
|
-
openrouter: pi.PI_OPENROUTER
|
|
928
|
-
});
|
|
929
|
-
const modelInfo = gateway && model && !pi.piGatewayDescribes(gateway, model) ? await modelLimits(model) : void 0;
|
|
930
|
-
return pi.createPi({
|
|
931
|
-
auth,
|
|
932
|
-
...gateway ? {
|
|
933
|
-
gateway,
|
|
934
|
-
...modelInfo ? { modelInfo } : {}
|
|
935
|
-
} : vertex ? { vertex } : { provider: keyed(piProvider(providerOf(descriptor.model))) },
|
|
936
|
-
...descriptor.kind === "pi" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
937
|
-
...mcpServers ? { mcpServers } : {},
|
|
938
|
-
requireCredentialBrokering: true
|
|
939
|
-
});
|
|
940
|
-
}
|
|
941
|
-
},
|
|
942
|
-
codex: {
|
|
943
|
-
...LAYOUTS.codex,
|
|
944
|
-
pluginParts: ["skills", "mcp"],
|
|
945
|
-
pluginApps: "they need a ChatGPT login",
|
|
946
|
-
pluginManifestsFirst: ["plugin.json", ".codex-plugin/plugin.json"],
|
|
947
|
-
pluginRootManifestNeedsSchema: true,
|
|
948
|
-
pluginServersByName: true,
|
|
949
|
-
name: "Codex",
|
|
950
|
-
factory: "codex",
|
|
951
|
-
keychainTrust: true,
|
|
952
|
-
platforms: ["linux", "darwin"],
|
|
953
|
-
reasoning: "whole",
|
|
954
|
-
reasoningTokens: true,
|
|
955
|
-
storedUsage: async () => {
|
|
956
|
-
const m = await import("./src-ZaP7-0pi.js");
|
|
957
|
-
return {
|
|
958
|
-
command: m.codexStoredUsageCommand,
|
|
959
|
-
parse: m.parseCodexStoredUsage
|
|
960
|
-
};
|
|
961
|
-
},
|
|
962
|
-
fullToolOutput: "all",
|
|
963
|
-
credential: "OPENAI_API_KEY",
|
|
964
|
-
endpoints: OPENAI_ENDPOINTS,
|
|
965
|
-
modelResponses: OPENAI_MODEL_ENDPOINTS,
|
|
966
|
-
expectedBlocked: {
|
|
967
|
-
hosts: [
|
|
968
|
-
"github.com",
|
|
969
|
-
"api.github.com",
|
|
970
|
-
"chatgpt.com"
|
|
971
|
-
],
|
|
972
|
-
why: "Codex's plugin sync, which it runs on every turn once plugins are on",
|
|
973
|
-
withPlugins: true
|
|
974
|
-
},
|
|
975
|
-
servedModel: openaiServedModel,
|
|
976
|
-
mcpServers: codexMcpServers,
|
|
977
|
-
adapter: async ({ auth, mcpServers, descriptor, plugins }) => {
|
|
978
|
-
const codex = await import("./src-ZaP7-0pi.js");
|
|
979
|
-
const provider = onRoutingGateway(descriptor, {
|
|
980
|
-
vercel: {
|
|
981
|
-
...codex.AI_GATEWAY_PROVIDER,
|
|
982
|
-
baseUrl: vercelApi().openai
|
|
983
|
-
},
|
|
984
|
-
openrouter: codex.OPENROUTER_PROVIDER
|
|
985
|
-
});
|
|
986
|
-
return codex.createCodex({
|
|
987
|
-
auth,
|
|
988
|
-
...provider ? { provider } : {},
|
|
989
|
-
...descriptor.kind === "codex" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
990
|
-
...mcpServers ? { mcpServers } : {},
|
|
991
|
-
...plugins.length ? { plugins: plugins.map(({ name, dir }) => ({
|
|
992
|
-
name,
|
|
993
|
-
dir
|
|
994
|
-
})) } : {},
|
|
995
|
-
requireCredentialBrokering: true
|
|
996
|
-
});
|
|
997
|
-
}
|
|
998
|
-
},
|
|
999
|
-
fx: {
|
|
1000
|
-
...LAYOUTS.fx,
|
|
1001
|
-
pluginParts: ["skills", "mcp"],
|
|
1002
|
-
name: "fx",
|
|
1003
|
-
factory: "fx",
|
|
1004
|
-
bridgePort: true,
|
|
1005
|
-
platforms: ["linux", "darwin"],
|
|
1006
|
-
configuredModelOnStart: true,
|
|
1007
|
-
reasoning: "streamed",
|
|
1008
|
-
reasoningTokens: "provider",
|
|
1009
|
-
fullToolOutput: ["bash"],
|
|
1010
|
-
...fxForModel("provider/model"),
|
|
1011
|
-
forModel: fxForModel,
|
|
1012
|
-
mcpServers: fxMcpServers,
|
|
1013
|
-
adapter: async ({ auth, env, mcpServers, model, descriptor }) => (await import("./src-7kshnPZC.js")).createFx({
|
|
1014
|
-
auth,
|
|
1015
|
-
model,
|
|
1016
|
-
...onRoutingGateway(descriptor, {
|
|
1017
|
-
vercel: { gatewayUrl: vercelApi().origin },
|
|
1018
|
-
openrouter: { provider: "openrouter" }
|
|
1019
|
-
}),
|
|
1020
|
-
...env?.FX_VERTEX_PROJECT ? { vertex: {
|
|
1021
|
-
project: env.FX_VERTEX_PROJECT,
|
|
1022
|
-
location: env.FX_VERTEX_LOCATION ?? ""
|
|
1023
|
-
} } : {},
|
|
1024
|
-
...descriptor.kind === "fx" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
1025
|
-
...mcpServers ? { mcpServers } : {},
|
|
1026
|
-
requireCredentialBrokering: true
|
|
1027
|
-
})
|
|
1028
|
-
},
|
|
1029
|
-
"grok-build": {
|
|
1030
|
-
...LAYOUTS["grok-build"],
|
|
1031
|
-
pluginParts: CLAUDE_FORMAT_PARTS,
|
|
1032
|
-
pluginServersByName: true,
|
|
1033
|
-
name: "Grok Build",
|
|
1034
|
-
factory: "grokBuild",
|
|
1035
|
-
keychainTrust: true,
|
|
1036
|
-
bridgePort: true,
|
|
1037
|
-
platforms: ["linux", "darwin"],
|
|
1038
|
-
configuredModelOnStart: true,
|
|
1039
|
-
reasoning: "streamed",
|
|
1040
|
-
reasoningTokens: true,
|
|
1041
|
-
storedUsage: async () => {
|
|
1042
|
-
const m = await import("./src-DP-gPQ5B.js");
|
|
1043
|
-
return {
|
|
1044
|
-
command: m.grokStoredUsageCommand,
|
|
1045
|
-
parse: m.parseGrokStoredUsage
|
|
1046
|
-
};
|
|
1047
|
-
},
|
|
1048
|
-
credential: "XAI_API_KEY",
|
|
1049
|
-
endpoints: XAI_ENDPOINTS,
|
|
1050
|
-
modelResponses: XAI_MODEL_RESPONSES,
|
|
1051
|
-
servedModel: xaiServedModel,
|
|
1052
|
-
mcpServers: acpMcpServers,
|
|
1053
|
-
adapter: async ({ auth, mcpServers, descriptor, plugins, model, vertexChat }) => {
|
|
1054
|
-
const grok = await import("./src-DP-gPQ5B.js");
|
|
1055
|
-
return grok.createGrokBuild({
|
|
1056
|
-
...vertexChat ? {
|
|
1057
|
-
auth: { [grok.VERTEX_TOKEN_ENV]: SANDBOX_ACCESS_TOKEN },
|
|
1058
|
-
provider: grok.vertexProvider(vertexChat.project, vertexChat.region)
|
|
1059
|
-
} : {
|
|
1060
|
-
auth,
|
|
1061
|
-
...onRoutingGateway(descriptor, {
|
|
1062
|
-
vercel: { provider: {
|
|
1063
|
-
...grok.AI_GATEWAY_PROVIDER,
|
|
1064
|
-
baseUrl: vercelApi().openai
|
|
1065
|
-
} },
|
|
1066
|
-
openrouter: { provider: grok.OPENROUTER_PROVIDER }
|
|
1067
|
-
})
|
|
1068
|
-
},
|
|
1069
|
-
model,
|
|
1070
|
-
...plugins.length ? {
|
|
1071
|
-
pluginDirs: plugins.map((p) => p.dir),
|
|
1072
|
-
pluginMcpServers: plugins.flatMap((p) => p.servers.map((s) => s.slice(p.name.length + 1)))
|
|
1073
|
-
} : {},
|
|
1074
|
-
...descriptor.kind === "grok-build" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
1075
|
-
...mcpServers ? { mcpServers } : {},
|
|
1076
|
-
requireCredentialBrokering: true
|
|
1077
|
-
});
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
};
|
|
1081
|
-
/** The harness of a config that names none: Cursor, on Cursor's own model. */
|
|
1082
|
-
const DEFAULT_HARNESS = {
|
|
1083
|
-
kind: "cursor",
|
|
1084
|
-
model: "composer-2.5"
|
|
1085
|
-
};
|
|
1086
|
-
/** A harness to name in messages that ask for one. */
|
|
1087
|
-
const HARNESS_EXAMPLE = "cursor({ model: 'composer-2.5' })";
|
|
1088
|
-
const isAgentKind = (kind) => typeof kind === "string" && Object.hasOwn(AGENTS, kind);
|
|
1089
|
-
/**
|
|
1090
|
-
* A server as the plan knows it: its names, literal values and each `secret.template`'s text. A
|
|
1091
|
-
* host secret's value is read when the attempt starts, so the plan has it as `''`.
|
|
1092
|
-
*/
|
|
1093
|
-
function plannedMcpServer(s) {
|
|
1094
|
-
const literal = (values) => Object.fromEntries(Object.entries(values).map(([k, v]) => [k, typeof v === "string" ? v : v.kind === "secret-template" ? v.template : ""]));
|
|
1095
|
-
return s.transport === "stdio" ? {
|
|
1096
|
-
transport: "stdio",
|
|
1097
|
-
command: s.command,
|
|
1098
|
-
args: s.args,
|
|
1099
|
-
env: literal(s.env)
|
|
1100
|
-
} : {
|
|
1101
|
-
transport: s.transport,
|
|
1102
|
-
url: s.url,
|
|
1103
|
-
headers: literal(s.headers)
|
|
1104
|
-
};
|
|
1105
|
-
}
|
|
1106
|
-
/**
|
|
1107
|
-
* Why a harness's agent can't take the environment's MCP servers (Goose, OpenCode, pi and Codex
|
|
1108
|
-
* take no `mcp.sse`; OpenCode would substitute a `{env:…}` or `{file:…}` in a name or value), in the
|
|
1109
|
-
* agent's own words, so the plan refuses them before any attempt starts; undefined when it can.
|
|
1110
|
-
*/
|
|
1111
|
-
function refusedMcp(harness, layers) {
|
|
1112
|
-
if (!isAgentKind(harness.kind)) return void 0;
|
|
1113
|
-
const servers = /* @__PURE__ */ new Map();
|
|
1114
|
-
for (const { spec } of layers) for (const [name, server] of Object.entries(spec.mcp ?? {})) servers.set(name, plannedMcpServer(server));
|
|
1115
|
-
if (servers.size === 0) return void 0;
|
|
1116
|
-
try {
|
|
1117
|
-
AGENTS[harness.kind].mcpServers(Object.fromEntries(servers));
|
|
1118
|
-
return;
|
|
1119
|
-
} catch (error) {
|
|
1120
|
-
if (error instanceof InfraError) return error.message;
|
|
1121
|
-
throw error;
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
/**
|
|
1125
|
-
* Why a harness's agent can't share a machine with `slots - 1` other attempts: its bridge takes
|
|
1126
|
-
* the one port every session exposes. Undefined when it can.
|
|
1127
|
-
*/
|
|
1128
|
-
function refusedSharedMachine(harness, slots) {
|
|
1129
|
-
if (slots <= 1) return void 0;
|
|
1130
|
-
const kind = isAgentKind(harness.kind) ? harness.kind : harness.kind === "fake" && harness.brokers ? harness.layout ?? "cursor" : void 0;
|
|
1131
|
-
if (!kind || !AGENTS[kind].bridgePort) return void 0;
|
|
1132
|
-
return `${kind}'s bridge listens on a fixed port in the machine, so it runs one attempt per machine: set attemptsPerMachine: 1 for it (got ${slots})`;
|
|
1133
|
-
}
|
|
1134
|
-
/** The first host variable a plugin MCP server reads (`${VAR}`), as `VAR`; undefined for none. */
|
|
1135
|
-
function hostVariable(s) {
|
|
1136
|
-
const values = Object.entries(s.transport === "stdio" ? s.env : s.headers);
|
|
1137
|
-
for (const [key, v] of values) {
|
|
1138
|
-
if (typeof v === "string") continue;
|
|
1139
|
-
if (v.kind === "secret") return v.from ?? key;
|
|
1140
|
-
return /\$\{([A-Za-z_][A-Za-z0-9_]*)\}/.exec(v.template)?.[1] ?? key;
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
const quoted = (parts) => parts.map((p) => `'${p}'`).join(", ");
|
|
1144
|
-
/**
|
|
1145
|
-
* Why a harness's agent can't take the plugins, in the agent's own words: a part it doesn't
|
|
1146
|
-
* load, apps it can't take (`pluginApps`), a hook event or type it doesn't run, a plugin MCP
|
|
1147
|
-
* server it refuses (named `<plugin>:<server>`) or whose `<plugin>:<server>` key `mcp` already has,
|
|
1148
|
-
* or, where it takes plugin items flat, a skill or MCP server whose name another already has, or a
|
|
1149
|
-
* subagent, command or rule another unpacks to the same file. `own` names the
|
|
1150
|
-
* environment's own skills and MCP servers, and `unread` the plugins not fetched yet (git and
|
|
1151
|
-
* npm ones, at plan time) by their call. Undefined when it can take them.
|
|
1152
|
-
*/
|
|
1153
|
-
function refusedPlugins(harness, plugins, own, unread = []) {
|
|
1154
|
-
if (plugins.length === 0 && unread.length === 0) return void 0;
|
|
1155
|
-
const agent = isAgentKind(harness.kind) ? AGENTS[harness.kind] : void 0;
|
|
1156
|
-
const mimics = harness.kind === "fake" && harness.layout ? AGENTS[harness.layout] : void 0;
|
|
1157
|
-
const loads = (agent ?? mimics)?.pluginParts ?? PLUGIN_PARTS;
|
|
1158
|
-
const name = agent?.name ?? (mimics ? `The fake agent with ${mimics.name}'s layout` : "The fake agent");
|
|
1159
|
-
if (loads.length === 0) return `${name} can't load plugins yet: leave ${plugins[0] ? `the ${plugins[0].name} plugin` : unread[0]} out of this cell`;
|
|
1160
|
-
for (const p of plugins) {
|
|
1161
|
-
const refused = p.kept.filter((part) => !loads.includes(part));
|
|
1162
|
-
if (refused.length === 0) continue;
|
|
1163
|
-
const can = p.kept.filter((part) => loads.includes(part));
|
|
1164
|
-
const what = refused.map((part) => `${part} (${PART_PATHS[part]})`).join(" and ");
|
|
1165
|
-
const fix = can.length ? `use only: [${quoted(can)}], or leave` : "leave";
|
|
1166
|
-
return `${name} can't load the ${p.name} plugin's ${what}: ${fix} the plugin out of this cell`;
|
|
1167
|
-
}
|
|
1168
|
-
const reads = agent ?? mimics;
|
|
1169
|
-
const first = reads?.pluginManifestsFirst ?? [];
|
|
1170
|
-
for (const p of plugins) {
|
|
1171
|
-
const other = p.manifests.find((m) => first.includes(m) && (m !== "plugin.json" || !reads?.pluginRootManifestNeedsSchema || p.rootSchema));
|
|
1172
|
-
if (other) return `${name} reads the ${p.name} plugin's ${other} in place of its ${PLUGIN_MANIFEST}, so reeval can't hold it to the parts it places: remove ${other} from the plugin, or leave the plugin out of this cell`;
|
|
1173
|
-
}
|
|
1174
|
-
const apps = (agent ?? mimics)?.pluginApps;
|
|
1175
|
-
const withApps = apps ? plugins.find((p) => p.apps) : void 0;
|
|
1176
|
-
if (withApps) return `${name} can't load the ${withApps.name} plugin's apps: ${apps}`;
|
|
1177
|
-
const layout = layoutOf(harness);
|
|
1178
|
-
const runs = layout.pluginHookEvents;
|
|
1179
|
-
for (const p of runs ? plugins : []) {
|
|
1180
|
-
const event = p.hooks.events.find((e) => !runs?.includes(e));
|
|
1181
|
-
const type = p.hooks.otherTypes[0];
|
|
1182
|
-
if (!event && !type) continue;
|
|
1183
|
-
const rest = p.kept.filter((part) => part !== "hooks");
|
|
1184
|
-
const fix = rest.length ? `use only: [${quoted(rest)}], or leave` : "leave";
|
|
1185
|
-
return event ? `${name} can't run the ${p.name} plugin's ${event} hooks (hooks/hooks.json): it runs ${runs?.join(", ")} hooks; ${fix} the plugin out of this cell` : `${name} can't run the ${p.name} plugin's ${type} hooks (hooks/hooks.json): it runs only command hooks; ${fix} the plugin out of this cell`;
|
|
1186
|
-
}
|
|
1187
|
-
const servers = Object.fromEntries(plugins.flatMap((p) => Object.entries(p.mcp).map(([server, s]) => [pluginServerName(p.name, server), plannedMcpServer(s)])));
|
|
1188
|
-
if (agent && Object.keys(servers).length) {
|
|
1189
|
-
const alongside = agent.pluginPlacement === "flat" ? Object.fromEntries(own.mcp.map((n) => [n, {
|
|
1190
|
-
transport: "stdio",
|
|
1191
|
-
command: "true",
|
|
1192
|
-
args: [],
|
|
1193
|
-
env: {}
|
|
1194
|
-
}])) : {};
|
|
1195
|
-
try {
|
|
1196
|
-
agent.mcpServers({
|
|
1197
|
-
...alongside,
|
|
1198
|
-
...servers
|
|
1199
|
-
});
|
|
1200
|
-
} catch (error) {
|
|
1201
|
-
if (error instanceof InfraError) return error.message;
|
|
1202
|
-
throw error;
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
for (const p of plugins) for (const server of Object.keys(p.mcp)) {
|
|
1206
|
-
const key = pluginServerName(p.name, server);
|
|
1207
|
-
if (own.mcp.includes(key)) return `the ${p.name} plugin's MCP server "${server}" would join mcp as ${key}, which mcp already names: rename mcp["${key}"]`;
|
|
1208
|
-
}
|
|
1209
|
-
if (layout.pluginPlacement === "namespaced") {
|
|
1210
|
-
for (const p of plugins) {
|
|
1211
|
-
if (!p.kept.includes("mcp")) continue;
|
|
1212
|
-
for (const [server, s] of Object.entries(p.mcp)) {
|
|
1213
|
-
const secret = hostVariable(s);
|
|
1214
|
-
if (!secret) continue;
|
|
1215
|
-
const rest = p.kept.filter((part) => part !== "mcp");
|
|
1216
|
-
return `${name} loads the ${p.name} plugin's MCP server "${server}" itself, so reeval can't give it ${secret} from the host: use only: [${quoted(rest)}] and declare the server in mcp, where reeval fills it in`;
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
if (!(agent ?? mimics)?.pluginServersByName) return void 0;
|
|
1220
|
-
const byName = new Map(own.mcp.map((n) => [n, `mcp.${n}`]));
|
|
1221
|
-
for (const p of plugins) for (const server of Object.keys(p.mcp)) {
|
|
1222
|
-
const other = byName.get(server);
|
|
1223
|
-
if (other) return `${name} names the ${p.name} plugin's MCP server "${server}" by its own name, as it does ${other}, and keeps only one: rename one, or leave mcp out of the plugin with only`;
|
|
1224
|
-
byName.set(server, `the ${p.name} plugin's MCP server "${server}"`);
|
|
1225
|
-
}
|
|
1226
|
-
return;
|
|
1227
|
-
}
|
|
1228
|
-
const serverOwner = new Map(own.mcp.map((n) => [n, `mcp.${n}`]));
|
|
1229
|
-
for (const p of plugins) for (const server of Object.keys(p.mcp)) {
|
|
1230
|
-
const other = serverOwner.get(server);
|
|
1231
|
-
if (other) return `the ${p.name} plugin's MCP server "${server}" clashes with ${other}`;
|
|
1232
|
-
serverOwner.set(server, `the ${p.name} plugin's MCP server "${server}"`);
|
|
1233
|
-
}
|
|
1234
|
-
const skillOwner = new Map(own.skills.map((s) => [s.name, `${s.call}'s "${s.name}"`]));
|
|
1235
|
-
for (const p of plugins) for (const { name: skill } of p.skills) {
|
|
1236
|
-
const other = skillOwner.get(skill);
|
|
1237
|
-
if (other) return `the ${p.name} plugin's skill "${skill}" and ${other} would both be placed at ~/${layout.harnessSkillDir}/${skill}: rename one, or narrow it with only or exclude`;
|
|
1238
|
-
skillOwner.set(skill, `the ${p.name} plugin's skill "${skill}"`);
|
|
1239
|
-
}
|
|
1240
|
-
for (const part of ["agents", "commands"]) {
|
|
1241
|
-
const dir = layout.pluginUnpack?.[part];
|
|
1242
|
-
if (!dir) continue;
|
|
1243
|
-
const owner = /* @__PURE__ */ new Map();
|
|
1244
|
-
for (const p of plugins) for (const item of p[part]) {
|
|
1245
|
-
const other = owner.get(item);
|
|
1246
|
-
const what = part === "agents" ? "subagent" : "command";
|
|
1247
|
-
if (other) return `the ${p.name} plugin's ${what} "${item}" and the ${other} plugin's would both be placed at ${dir}/${item}.md: rename one, or narrow one with only`;
|
|
1248
|
-
owner.set(item, p.name);
|
|
1249
|
-
}
|
|
1250
|
-
}
|
|
1251
|
-
const rules = layout.pluginUnpack?.rules;
|
|
1252
|
-
const ruleOwner = /* @__PURE__ */ new Map();
|
|
1253
|
-
for (const p of rules ? plugins : []) for (const rule of p.rules) {
|
|
1254
|
-
const file = `${p.name}-${rule.replace(/\.mdc?$/, "")}.mdc`;
|
|
1255
|
-
const what = `the ${p.name} plugin's rule "${rule}"`;
|
|
1256
|
-
const other = ruleOwner.get(file);
|
|
1257
|
-
if (other) return `${what} and ${other} would both be placed at ${rules}/${file}: rename one, or narrow one with only`;
|
|
1258
|
-
ruleOwner.set(file, what);
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
/**
|
|
1262
|
-
* A real agent's catalog entry, with what its model's provider decides, or its gateway's route:
|
|
1263
|
-
* on Vertex, the attempt's `vertex()` settings decide the project and region.
|
|
1264
|
-
*/
|
|
1265
|
-
function agentFor(h, vertex) {
|
|
1266
|
-
const agent = AGENTS[h.kind];
|
|
1267
|
-
const { fallbackCredentials: _, ...routed } = agent;
|
|
1268
|
-
if (h.gateway === "vertex") {
|
|
1269
|
-
const route = VERTEX_ROUTES[h.kind];
|
|
1270
|
-
if (!route) throw new InfraError(`reeval doesn't run ${agent.name} on Vertex AI`);
|
|
1271
|
-
if (!vertex) throw new InfraError(`${agent.name} on Vertex AI has no vertex() settings`);
|
|
1272
|
-
return {
|
|
1273
|
-
...routed,
|
|
1274
|
-
...route(vertex)
|
|
1275
|
-
};
|
|
1276
|
-
}
|
|
1277
|
-
if (isRoutingGateway(h.gateway)) {
|
|
1278
|
-
const gateway = ROUTING_GATEWAYS[h.gateway];
|
|
1279
|
-
const route = gateway.routes[h.kind];
|
|
1280
|
-
if (!route) throw new InfraError(`reeval doesn't run ${agent.name} on ${gateway.name}`);
|
|
1281
|
-
return {
|
|
1282
|
-
...routed,
|
|
1283
|
-
...route(process.env)
|
|
1284
|
-
};
|
|
1285
|
-
}
|
|
1286
|
-
if (agent.credential === void 0) return {
|
|
1287
|
-
...agent,
|
|
1288
|
-
...agent.forModel(h.model)
|
|
1289
|
-
};
|
|
1290
|
-
return agent.forModel ? {
|
|
1291
|
-
...agent,
|
|
1292
|
-
...agent.forModel(h.model)
|
|
1293
|
-
} : agent;
|
|
1294
|
-
}
|
|
1295
|
-
/** The catalog entry for a harness's agent; undefined for the fake harness. */
|
|
1296
|
-
const agentOf = (h, vertex) => h.kind === "fake" ? void 0 : agentFor(h, vertex);
|
|
1297
|
-
/** The host variables an agent authenticates with, any one of which will do: `credential` first. */
|
|
1298
|
-
const credentialsOf = (agent) => [agent.credential, ...agent.fallbackCredentials ?? []];
|
|
1299
|
-
/** The host variable the agent authenticates with in `env`: the first set, else `credential`. */
|
|
1300
|
-
const credentialIn = (agent, env = process.env) => credentialsOf(agent).find((name) => env[name]) ?? agent.credential;
|
|
1301
|
-
/**
|
|
1302
|
-
* The host variables a harness authenticates with, any one of which will do; none for the fake
|
|
1303
|
-
* harness, and on Vertex, whose token comes from Application Default Credentials.
|
|
1304
|
-
*/
|
|
1305
|
-
const harnessCredentials = (h) => h.kind === "fake" || h.gateway === "vertex" ? [] : credentialsOf(agentFor(h));
|
|
1306
|
-
/** The fake agent's own layout. */
|
|
1307
|
-
const FAKE_LAYOUT = {
|
|
1308
|
-
rulesFile: "AGENTS.md",
|
|
1309
|
-
...SKILL_LAYOUTS.fake,
|
|
1310
|
-
pluginPlacement: "flat"
|
|
1311
|
-
};
|
|
1312
|
-
/** Where a harness's agent reads rules and skills; a fake one with `layout` mimics that agent. */
|
|
1313
|
-
function layoutOf(descriptor) {
|
|
1314
|
-
if (descriptor.kind !== "fake") return LAYOUTS[descriptor.kind];
|
|
1315
|
-
return descriptor.layout ? LAYOUTS[descriptor.layout] : FAKE_LAYOUT;
|
|
1316
|
-
}
|
|
1317
|
-
/**
|
|
1318
|
-
* The hosts a harness's agent is known to try in a session with or without plugins; a fake agent
|
|
1319
|
-
* with `layout` expects that agent's. On Vertex, the attempt's `vertex()` settings pick the route.
|
|
1320
|
-
*/
|
|
1321
|
-
function expectedBlockedFor(descriptor, plugins, vertex) {
|
|
1322
|
-
const expected = descriptor.kind !== "fake" ? agentFor(descriptor, vertex).expectedBlocked : descriptor.layout ? AGENTS[descriptor.layout].expectedBlocked : void 0;
|
|
1323
|
-
return expected?.withPlugins && !plugins ? void 0 : expected;
|
|
1324
|
-
}
|
|
1325
|
-
/**
|
|
1326
|
-
* How the APIs behind the harnesses say they refused a key: an HTTP 401, Anthropic's and OpenAI's
|
|
1327
|
-
* wording, Google's (which answers 400), and OpenCode's for any provider's 401 or 403. A bare 403 isn't here: the gateway and MCP servers send
|
|
1328
|
-
* those for reasons that have nothing to do with the harness's key. Grok Build checks its key as
|
|
1329
|
-
* it starts and, when xAI refuses it (a 400 or 401, not an outage), offers no `xai.api_key`
|
|
1330
|
-
* sign-in, which is all `@ai-sdk/harness-acp` reports.
|
|
1331
|
-
*/
|
|
1332
|
-
const REFUSED_KEY = /\bHTTP 401\b|\b401\b.{0,40}\bunauthori[sz]ed\b|\bunauthori[sz]ed\b.{0,40}\b401\b|\b(?:invalid|incorrect) (?:x-)?api[ _-]?key\b|\bapi key not valid\b|\bAPI_KEY_INVALID\b|\bauthentication_error\b|\bprovider authentication required\b|\bauthentication method "xai\.api_key" is not advertised\b/i;
|
|
1333
|
-
/**
|
|
1334
|
-
* What to do when the harness's API refused its key, naming the variable; else undefined. The
|
|
1335
|
-
* error's wording says so for some CLIs; `refused` is the egress record's word for every one: a
|
|
1336
|
-
* brokered request the API answered with 401, whatever the CLI made of it.
|
|
1337
|
-
*/
|
|
1338
|
-
function authHint(agent, message, refused = false) {
|
|
1339
|
-
if (!refused && !REFUSED_KEY.test(message)) return void 0;
|
|
1340
|
-
if (agent.token) return `The API rejected the access token reeval minted from ${agent.credential}: check gcloud auth application-default login (or GOOGLE_APPLICATION_CREDENTIALS) and the project's Vertex AI access`;
|
|
1341
|
-
return keyRejected(credentialIn(agent));
|
|
1342
|
-
}
|
|
1343
|
-
/** What to do when the API refused the key in `credential`, naming it. */
|
|
1344
|
-
const keyRejected = (credential) => `The API rejected ${credential}: set a valid key in the environment or .env.local`;
|
|
1345
|
-
/**
|
|
1346
|
-
* The agent's credential from the host, as the adapter's explicit `auth`. Fails closed. Empty for
|
|
1347
|
-
* a brokered token, which the adapter never sees.
|
|
1348
|
-
*/
|
|
1349
|
-
function agentAuth(agent, env = hostEnv()) {
|
|
1350
|
-
if (agent.token) return {};
|
|
1351
|
-
const name = credentialIn(agent, env);
|
|
1352
|
-
const value = env[name];
|
|
1353
|
-
const held = heldSecret(name);
|
|
1354
|
-
if (held?.mode === "brokered") {
|
|
1355
|
-
const off = [...new Set(agent.endpoints.map((e) => e.host))].filter((host) => !hostAllowed(held.hosts, host));
|
|
1356
|
-
if (off.length) throw new InfraError(`${name} is brokered to ${held.hosts.join(", ")}, and the ${agent.name} harness sends it to ${off.join(", ")}, which it isn't brokered to.`);
|
|
1357
|
-
}
|
|
1358
|
-
if (!value) {
|
|
1359
|
-
const names = credentialsOf(agent);
|
|
1360
|
-
const unset = names.length === 1 ? `${name} isn't set` : `Neither ${names.join(" nor ")} is set`;
|
|
1361
|
-
throw new InfraError(`${unset}, so the ${agent.name} harness can't authenticate. Set ${names.length === 1 ? "it" : "one"} in the environment or .env.local.`);
|
|
1362
|
-
}
|
|
1363
|
-
return {
|
|
1364
|
-
...agent.authEnv,
|
|
1365
|
-
[name === agent.credential ? agent.authAs ?? name : name]: value
|
|
1366
|
-
};
|
|
1367
|
-
}
|
|
1368
|
-
/**
|
|
1369
|
-
* The key the fake agent brokers with `layout`, and where: the agent's own, or, for one that takes
|
|
1370
|
-
* its model's provider's key, a key of the fake's own on no endpoint.
|
|
1371
|
-
*/
|
|
1372
|
-
function fakeBrokering(layout = "cursor") {
|
|
1373
|
-
const { credential, endpoints } = AGENTS[layout];
|
|
1374
|
-
return credential === void 0 ? {
|
|
1375
|
-
credential: "FAKE_AGENT_API_KEY",
|
|
1376
|
-
endpoints: []
|
|
1377
|
-
} : {
|
|
1378
|
-
credential,
|
|
1379
|
-
endpoints
|
|
1380
|
-
};
|
|
1381
|
-
}
|
|
1382
|
-
function brokeringFor(h, vertex) {
|
|
1383
|
-
if (h.kind === "fake") return h.brokers ? fakeBrokering(h.layout) : void 0;
|
|
1384
|
-
const agent = agentOf(h, vertex);
|
|
1385
|
-
if (!agent) return void 0;
|
|
1386
|
-
const { endpoints, tokens, servedModel, askedModel, modelResponses, upstream } = agent;
|
|
1387
|
-
const { localResponses, modelStream } = agent;
|
|
1388
|
-
const credential = credentialIn(agent);
|
|
1389
|
-
const modelCalls = [...agent.modelCalls ?? [], ...modelResponses ?? []];
|
|
1390
|
-
return {
|
|
1391
|
-
credential,
|
|
1392
|
-
endpoints,
|
|
1393
|
-
...tokens ? { tokens: {
|
|
1394
|
-
name: credential,
|
|
1395
|
-
...tokens
|
|
1396
|
-
} } : {},
|
|
1397
|
-
...servedModel ? { servedModel } : {},
|
|
1398
|
-
...askedModel ? { askedModel } : {},
|
|
1399
|
-
...modelResponses ? { modelResponses } : {},
|
|
1400
|
-
...modelCalls.length ? { modelCalls } : {},
|
|
1401
|
-
...modelStream ? { modelStream } : {},
|
|
1402
|
-
...upstream ? { upstream } : {},
|
|
1403
|
-
...localResponses?.length ? { localResponses } : {}
|
|
1404
|
-
};
|
|
1405
|
-
}
|
|
1406
|
-
export { layoutOf as _, agentFor as a, refusedSharedMachine as b, authHint as c, directProviderRefusal as d, expectedBlockedFor as f, keyRejected as g, isAgentKind as h, agentAuth as i, brokeringFor as l, harnessCredentials as m, DEFAULT_HARNESS as n, agentMcp as o, fakeBrokering as p, HARNESS_EXAMPLE as r, agentOf as s, AGENTS as t, claudeMcpServers as u, refusedMcp as v, writePluginFiles as x, refusedPlugins as y };
|
|
1407
|
-
|
|
1408
|
-
//# sourceMappingURL=agents-DGr0kCFD.js.map
|