reeval 0.17.2 → 0.19.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/README.md +5 -3
- package/THIRD_PARTY_NOTICES.md +5 -5
- package/dist/{adapter-DyvDj4ZN.js → adapter-C8xPuXYq.js} +5 -4
- package/dist/adapter-C8xPuXYq.js.map +1 -0
- package/dist/{agent-v036GEgG.js → agent-CBoLndM7.js} +30 -10
- package/dist/{agent-v036GEgG.js.map → agent-CBoLndM7.js.map} +1 -1
- package/dist/agents-C6zhkxp3.js +1151 -0
- package/dist/agents-C6zhkxp3.js.map +1 -0
- package/dist/{analysis-adKPz-UJ.js → analysis-BnG_1x_O.js} +4 -4
- package/dist/{analysis-adKPz-UJ.js.map → analysis-BnG_1x_O.js.map} +1 -1
- package/dist/{app-files-hpRT5lj_.js → app-files-DT5mJyV4.js} +4 -4
- package/dist/app-files-DT5mJyV4.js.map +1 -0
- package/dist/assemble-UPCRrtOz.js +1 -0
- package/dist/{assemble-Dlh6Xv3U.js → assemble-t6h018An.js} +194 -307
- package/dist/assemble-t6h018An.js.map +1 -0
- package/dist/{attempt-CtKGvaQR.js → attempt-CAdlwlNu.js} +3 -3
- package/dist/{attempt-CtKGvaQR.js.map → attempt-CAdlwlNu.js.map} +1 -1
- package/dist/{attempt-host-DErH-DYV.js → attempt-host-CIm1-11m.js} +18 -10
- package/dist/{attempt-host-DErH-DYV.js.map → attempt-host-CIm1-11m.js.map} +1 -1
- package/dist/boat-BjLqFJIZ.js +108 -0
- package/dist/boat-BjLqFJIZ.js.map +1 -0
- package/dist/boat-CJCtzfB1.js +322 -0
- package/dist/boat-CJCtzfB1.js.map +1 -0
- package/dist/bridge/index.mjs +300 -78
- package/dist/capture-DoxFUN3J.js +1 -0
- package/dist/{capture-Bdcx9Gap.js → capture-iBzFiC0j.js} +406 -625
- package/dist/capture-iBzFiC0j.js.map +1 -0
- package/dist/cases-Dy0mifal.js +1 -0
- package/dist/cases-z9E6DCd5.js +639 -0
- package/dist/cases-z9E6DCd5.js.map +1 -0
- package/dist/{cli-CGd51thd.js → cli-20Fpvs5H.js} +929 -576
- package/dist/cli-20Fpvs5H.js.map +1 -0
- package/dist/{cli-spec-ChkleEVm.js → cli-spec-Dsr79Qy1.js} +46 -18
- package/dist/cli-spec-Dsr79Qy1.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{client-CF-DOjOU.js → client-KM4C5r5_.js} +111 -14
- package/dist/client-KM4C5r5_.js.map +1 -0
- package/dist/{command-CsfcwMyc.js → command-B5OyHpOu.js} +24 -81
- package/dist/command-B5OyHpOu.js.map +1 -0
- package/dist/{command-CtTdCF3B.js → command-BLNVDiIg.js} +10 -10
- package/dist/{command-CtTdCF3B.js.map → command-BLNVDiIg.js.map} +1 -1
- package/dist/{command-CyIb9BSC.js → command-CRh-cb6Z.js} +120 -55
- package/dist/command-CRh-cb6Z.js.map +1 -0
- package/dist/{command-TLmY-rYp.js → command-aUJvENwy.js} +18 -18
- package/dist/command-aUJvENwy.js.map +1 -0
- package/dist/{commands-C54S45d7.js → commands-CWy-WndG.js} +239 -92
- package/dist/commands-CWy-WndG.js.map +1 -0
- package/dist/{commands-jO9Jj35r.js → commands-CfdBX-mc.js} +1 -1
- package/dist/{config-ImY6AlRE.js → config-B9mB1kF5.js} +924 -1729
- package/dist/config-B9mB1kF5.js.map +1 -0
- package/dist/{context-BajfiH0S.js → context-Bkv3ndjq.js} +3 -2
- package/dist/context-Bkv3ndjq.js.map +1 -0
- package/dist/{cost-e4IppZpJ.js → cost-BdRgySQl.js} +4 -4
- package/dist/{cost-e4IppZpJ.js.map → cost-BdRgySQl.js.map} +1 -1
- package/dist/cost-Cr26Alhq.js +1 -0
- package/dist/{cursor-catalog-Bw6-pJjR.js → cursor-catalog-BSn9xjmo.js} +3 -3
- package/dist/{cursor-catalog-Bw6-pJjR.js.map → cursor-catalog-BSn9xjmo.js.map} +1 -1
- package/dist/db-P2fXw4nx.js +2 -0
- package/dist/{db-sHGpaLo9.js → db-zgC1tvKB.js} +178 -74
- package/dist/db-zgC1tvKB.js.map +1 -0
- package/dist/debug-CF4p4Lp_.js +1 -0
- package/dist/{debug-B5jDImcW.js → debug-CIXzB4wK.js} +2 -2
- package/dist/{debug-B5jDImcW.js.map → debug-CIXzB4wK.js.map} +1 -1
- package/dist/{default-effort-fpdbYVKm.js → default-effort-BAy8ixd1.js} +1 -1
- package/dist/{default-effort-BZRa-SQP.js → default-effort-DGhQmu95.js} +8 -5
- package/dist/default-effort-DGhQmu95.js.map +1 -0
- package/dist/{dist-ByYk_wAs.js → dist-CAFD1yfv.js} +28 -6
- package/dist/dist-CAFD1yfv.js.map +1 -0
- package/dist/{docker-CWuSRj7a.js → docker-Cqw-CyWz.js} +4 -4
- package/dist/{docker-CWuSRj7a.js.map → docker-Cqw-CyWz.js.map} +1 -1
- package/dist/{docker--2ytOHcu.js → docker-DAMnm3L9.js} +103 -73
- package/dist/docker-DAMnm3L9.js.map +1 -0
- package/dist/{docker-CIzHzwlC.js → docker-Dr4XeDc8.js} +1 -1
- package/dist/{doctor-eE65YpEv.js → doctor-B2PohneB.js} +86 -29
- package/dist/doctor-B2PohneB.js.map +1 -0
- package/dist/{env-T86lAqUD.js → env-8x1O8I1M.js} +2 -2
- package/dist/{env-T86lAqUD.js.map → env-8x1O8I1M.js.map} +1 -1
- package/dist/{environment-Cy3FVLR5.js → environment-DB8o3hGi.js} +80 -40
- package/dist/environment-DB8o3hGi.js.map +1 -0
- package/dist/{errors-BQV__TzH.js → errors-BZgLSZtV.js} +2 -2
- package/dist/{errors-BQV__TzH.js.map → errors-BZgLSZtV.js.map} +1 -1
- package/dist/{eval-source-BTsTRiBW.js → eval-source-D3sbAzt-.js} +23 -15
- package/dist/eval-source-D3sbAzt-.js.map +1 -0
- package/dist/evaluate-COdzf7Hl.d.ts +92 -0
- package/dist/{evaluate-CFFdyYZX.js → evaluate-CwKeN_fo.js} +472 -159
- package/dist/evaluate-CwKeN_fo.js.map +1 -0
- package/dist/files-B4KQUiM7.js +1 -0
- package/dist/files-BEwfjD8J.js +64 -0
- package/dist/files-BEwfjD8J.js.map +1 -0
- package/dist/{files-CQU08uh4.js → files-BRzV7aPh.js} +5 -5
- package/dist/{files-CQU08uh4.js.map → files-BRzV7aPh.js.map} +1 -1
- package/dist/{files-CIX-pLl4.js → files-BiFU16BW.js} +6 -6
- package/dist/{files-CIX-pLl4.js.map → files-BiFU16BW.js.map} +1 -1
- package/dist/files-C1Rk9FYA.js +1 -0
- package/dist/files-C3mCC8Mn.js +1 -0
- package/dist/{files-tnMgu7-X.js → files-Cl7BQ5gE.js} +55 -14
- package/dist/{files-tnMgu7-X.js.map → files-Cl7BQ5gE.js.map} +1 -1
- package/dist/{files-BGlHnC46.js → files-DgXyaAg6.js} +2 -2
- package/dist/{files-BGlHnC46.js.map → files-DgXyaAg6.js.map} +1 -1
- package/dist/{files-p-uTdOjA.js → files-DlQshsks.js} +3 -2
- package/dist/files-DlQshsks.js.map +1 -0
- package/dist/files-DnlA1A7N.js +1 -0
- package/dist/gate-CgYdaprG.js +49 -0
- package/dist/gate-CgYdaprG.js.map +1 -0
- package/dist/gateway.d.ts +1 -1
- package/dist/{git-BWVkG4Yl.js → git-fDiJ8UIV.js} +3 -3
- package/dist/{git-BWVkG4Yl.js.map → git-fDiJ8UIV.js.map} +1 -1
- package/dist/harness-C2berMiM.js +105 -0
- package/dist/harness-C2berMiM.js.map +1 -0
- package/dist/{harness-Ch2P81sx.js → harness-DXv2gnaT.js} +68 -111
- package/dist/harness-DXv2gnaT.js.map +1 -0
- package/dist/harness.d.ts +1 -1
- package/dist/harness.js +1 -1
- package/dist/{ids-DuK6xl4w.js → ids-C_advdJA.js} +3 -8
- package/dist/ids-C_advdJA.js.map +1 -0
- package/dist/{images-BVZHDf_z.js → images-BNgcR77K.js} +98 -10
- package/dist/images-BNgcR77K.js.map +1 -0
- package/dist/index.d.ts +23 -3
- package/dist/index.js +5 -5
- package/dist/init-4RPeD-K-.js +1 -0
- package/dist/{init-BWnMbUnc.js → init-DbuZVRrW.js} +8 -7
- package/dist/init-DbuZVRrW.js.map +1 -0
- package/dist/ink-list-BpfidQ1h.js +274 -0
- package/dist/ink-list-BpfidQ1h.js.map +1 -0
- package/dist/{invocations-BGRs1r_C.js → invocations-CxGNOlh0.js} +4 -4
- package/dist/{invocations-BGRs1r_C.js.map → invocations-CxGNOlh0.js.map} +1 -1
- package/dist/judge-COMXT1Hx.js +230 -0
- package/dist/judge-COMXT1Hx.js.map +1 -0
- package/dist/judge.d.ts +1 -1
- package/dist/judge.js +1 -1
- package/dist/judgments-CzgpsTqv.js +246 -0
- package/dist/judgments-CzgpsTqv.js.map +1 -0
- package/dist/kinds-C1oY3qyC.js +697 -0
- package/dist/kinds-C1oY3qyC.js.map +1 -0
- package/dist/{summary-zP3cCXDN.js → layout-Cm85tQYk.js} +77 -154
- package/dist/layout-Cm85tQYk.js.map +1 -0
- package/dist/list-DuThsE28.js +1348 -0
- package/dist/list-DuThsE28.js.map +1 -0
- package/dist/live-CJCK11nh.js +1 -0
- package/dist/{live-d_5a5iUv.js → live-CgYbO4Te.js} +24 -4
- package/dist/live-CgYbO4Te.js.map +1 -0
- package/dist/{live-ColieOai.js → live-CnGrRM6j.js} +8 -8
- package/dist/{live-ColieOai.js.map → live-CnGrRM6j.js.map} +1 -1
- package/dist/{matchers-B4ZtlJyP.js → matchers-CXLn-1jm.js} +4 -3
- package/dist/{matchers-B4ZtlJyP.js.map → matchers-CXLn-1jm.js.map} +1 -1
- package/dist/{model-DOXnWH65.js → model-047Dcd-a.js} +1 -1
- package/dist/model-Cv4GuTsZ.js +1 -0
- package/dist/{model-CFSjV-HJ.js → model-CwwkrCb7.js} +5 -5
- package/dist/{model-CFSjV-HJ.js.map → model-CwwkrCb7.js.map} +1 -1
- package/dist/{model-DBpdRXtO.js → model-DJjLw-0r.js} +43 -19
- package/dist/{model-DBpdRXtO.js.map → model-DJjLw-0r.js.map} +1 -1
- package/dist/{model-DOiCiMCD.js → model-V3mMXp6x.js} +213 -559
- package/dist/model-V3mMXp6x.js.map +1 -0
- package/dist/{node-CwP1G178.js → node-D7pAU--0.js} +34 -25
- package/dist/node-D7pAU--0.js.map +1 -0
- package/dist/{opencode-providers-yNKyXD49.js → opencode-providers-BGiXt8_B.js} +107 -49
- package/dist/opencode-providers-BGiXt8_B.js.map +1 -0
- package/dist/{openrouter-models-C8nzPKG2.js → openrouter-models-Cw1z8-sq.js} +2 -2
- package/dist/{openrouter-models-C8nzPKG2.js.map → openrouter-models-Cw1z8-sq.js.map} +1 -1
- package/dist/options-CHubslQf.js +1 -0
- package/dist/{gate-BoDKeuJu.js → pairs-BGb134Vu.js} +3 -49
- package/dist/pairs-BGb134Vu.js.map +1 -0
- package/dist/{patch-DvLr8wCZ.js → patch-DH4e_Gkd.js} +3 -3
- package/dist/{patch-DvLr8wCZ.js.map → patch-DH4e_Gkd.js.map} +1 -1
- package/dist/plain-BYUf_fUV.js +267 -0
- package/dist/plain-BYUf_fUV.js.map +1 -0
- package/dist/{plan-CIfOFhth.js → plan-Cgq9NCEX.js} +117 -45
- package/dist/plan-Cgq9NCEX.js.map +1 -0
- package/dist/{plugins-BEs2Am3L.js → plugins-BkmPxDiY.js} +11 -268
- package/dist/plugins-BkmPxDiY.js.map +1 -0
- package/dist/preflight-4gWSy0Pe.js +1 -0
- package/dist/{preflight-50Qw5e5K.js → preflight-BElE_q0u.js} +16 -9
- package/dist/preflight-BElE_q0u.js.map +1 -0
- package/dist/preflight-CtlloeOQ.js +68 -0
- package/dist/preflight-CtlloeOQ.js.map +1 -0
- package/dist/{preflight-BAIRsTpl.js → preflight-R-InZCQb.js} +1 -1
- package/dist/{prepare-8XhzhLHX.js → prepare-C7f5mPl5.js} +9 -9
- package/dist/{prepare-8XhzhLHX.js.map → prepare-C7f5mPl5.js.map} +1 -1
- package/dist/{prepare-8nvfDFQx.js → prepare-CzkAdbXm.js} +2 -2
- package/dist/{prices-C4BRuSe8.js → prices-5m3SzMZ3.js} +3 -3
- package/dist/{prices-C4BRuSe8.js.map → prices-5m3SzMZ3.js.map} +1 -1
- package/dist/{provenance-Cc8fFE7Z.js → provenance-zsc4--dP.js} +6 -5
- package/dist/provenance-zsc4--dP.js.map +1 -0
- package/dist/provider-BnUoz4KB.js +1 -0
- package/dist/{provider-DZd8t_XW.js → provider-BxzZq3Th.js} +2 -2
- package/dist/{provider-DZd8t_XW.js.map → provider-BxzZq3Th.js.map} +1 -1
- package/dist/{providers-DZSTlC9R.js → providers-B8xYMeah.js} +152 -9
- package/dist/providers-B8xYMeah.js.map +1 -0
- package/dist/providers-CVu8e0xS.js +1 -0
- package/dist/{query-DXpxaaTH.js → query-Bb3SYICk.js} +3 -3
- package/dist/{query-DXpxaaTH.js.map → query-Bb3SYICk.js.map} +1 -1
- package/dist/query-DIfkUcPh.js +1 -0
- package/dist/{questions-C_Y-oXW6.js → questions-CWlR9ffu.js} +41 -11
- package/dist/questions-CWlR9ffu.js.map +1 -0
- package/dist/{record-DhzwkSXc.js → record-6IUzwP9K.js} +5 -3
- package/dist/record-6IUzwP9K.js.map +1 -0
- package/dist/{redact-BEEGc37e.js → redact-BhjtnjrU.js} +11 -7
- package/dist/redact-BhjtnjrU.js.map +1 -0
- package/dist/remarks-CAvTSq16.js +1 -0
- package/dist/{remarks-0EXMh6AD.js → remarks-D9Lcd1fF.js} +3 -2
- package/dist/remarks-D9Lcd1fF.js.map +1 -0
- package/dist/remarks-DPCONFxZ.js +138 -0
- package/dist/remarks-DPCONFxZ.js.map +1 -0
- package/dist/{remarks-E4rpi8Ym.js → remarks-vtkPmQb9.js} +327 -41
- package/dist/remarks-vtkPmQb9.js.map +1 -0
- package/dist/{remote-DZ00A8V_.js → remote-BgYWqogI.js} +6 -6
- package/dist/{remote-DZ00A8V_.js.map → remote-BgYWqogI.js.map} +1 -1
- package/dist/{resolve-B_JlQ0La.js → resolve-Do0ZaYH6.js} +11 -10
- package/dist/resolve-Do0ZaYH6.js.map +1 -0
- package/dist/resolve-amw_2Odz.js +1 -0
- package/dist/{results-BMJHaQbi.js → results-JyuM64gy.js} +7 -7
- package/dist/{results-BMJHaQbi.js.map → results-JyuM64gy.js.map} +1 -1
- package/dist/resume-AW5oXzUc.js +691 -0
- package/dist/resume-AW5oXzUc.js.map +1 -0
- package/dist/retry-ChzISxmy.js +105 -0
- package/dist/retry-ChzISxmy.js.map +1 -0
- package/dist/{runtime-CSZ1hjlN.js → runtime-BpW1f1Mx.js} +26 -7
- package/dist/runtime-BpW1f1Mx.js.map +1 -0
- package/dist/sandbox/boat.d.ts +26 -0
- package/dist/sandbox/boat.js +37 -0
- package/dist/sandbox/boat.js.map +1 -0
- package/dist/{sandbox-B5W8lLL1.js → sandbox-kSgr7vo5.js} +31 -3
- package/dist/sandbox-kSgr7vo5.js.map +1 -0
- package/dist/sandbox.d.ts +20 -2
- package/dist/sandbox.js +1 -1
- package/dist/server-2_gUnVvf.js +1 -0
- package/dist/{server-BfN6q2lH.js → server-Cn8VqO9S.js} +10 -10
- package/dist/{server-BfN6q2lH.js.map → server-Cn8VqO9S.js.map} +1 -1
- package/dist/{shared-ogqPJ0uo.js → shared-Cfi45Bvy.js} +9 -2
- package/dist/shared-Cfi45Bvy.js.map +1 -0
- package/dist/slug-IHh3f770.js +136 -0
- package/dist/slug-IHh3f770.js.map +1 -0
- package/dist/source-CY3etKzw.js +1 -0
- package/dist/{source-BD6Bg0Tr.js → source-CYOhR98B.js} +2 -2
- package/dist/{source-BD6Bg0Tr.js.map → source-CYOhR98B.js.map} +1 -1
- package/dist/src-6Zzyg4Qd.js +2 -0
- package/dist/{src-BC2WXULN.js → src-BDhcPtnI.js} +2 -2
- package/dist/{src-B-L8O1Ld.js → src-BNQznj4z.js} +2 -2
- package/dist/{src-B-L8O1Ld.js.map → src-BNQznj4z.js.map} +1 -1
- package/dist/src-BRMsk9nh.js +2 -0
- package/dist/{src-Dp-fWOfG.js → src-CV_7DkPa.js} +47 -45
- package/dist/{src-Dp-fWOfG.js.map → src-CV_7DkPa.js.map} +1 -1
- package/dist/{src-KlDOGD0B.js → src-Cb2MWozp.js} +3 -1
- package/dist/{src-KlDOGD0B.js.map → src-Cb2MWozp.js.map} +1 -1
- package/dist/{src-Cpy9MNS3.js → src-Ck2r_EMT.js} +617 -74
- package/dist/src-Ck2r_EMT.js.map +1 -0
- package/dist/{src-HTG2SoNz.js → src-DAzaCTcN.js} +2 -2
- package/dist/{src-HTG2SoNz.js.map → src-DAzaCTcN.js.map} +1 -1
- package/dist/src-DB7N8TYJ.js +2 -0
- package/dist/src-DPDaAYwh.js +2 -0
- package/dist/{src-Cx0HJIJ-.js → src-Dbk19BiP.js} +2 -2
- package/dist/src-DtodMT59.js +1 -0
- package/dist/{src-uluei5nU.js → src-DvGns8cz.js} +2 -2
- package/dist/{src-uluei5nU.js.map → src-DvGns8cz.js.map} +1 -1
- package/dist/{src-B_igzM1O.js → src-Dw79VLa3.js} +3 -1
- package/dist/{src-B_igzM1O.js.map → src-Dw79VLa3.js.map} +1 -1
- package/dist/{src-D5t4OiRt.js → src-KxS91P7L.js} +3 -1
- package/dist/{src-D5t4OiRt.js.map → src-KxS91P7L.js.map} +1 -1
- package/dist/src-T-OeuJLr.js +2 -0
- package/dist/{src-BvM0jWuZ.js → src-YvblOrBU.js} +2 -2
- package/dist/{src-BvM0jWuZ.js.map → src-YvblOrBU.js.map} +1 -1
- package/dist/src-zntEDlnx.js +3 -0
- package/dist/{state-CdSjXIfE.js → state-BOLt8pJg.js} +17 -17
- package/dist/{state-CdSjXIfE.js.map → state-BOLt8pJg.js.map} +1 -1
- package/dist/state-kimtIhBP.js +1 -0
- package/dist/{stats-D-Gqwqt0.js → stats-C18W4xPX.js} +63 -8
- package/dist/stats-C18W4xPX.js.map +1 -0
- package/dist/suite-CKBa6MKt.js +2 -0
- package/dist/suite-COglUhPd.js +1272 -0
- package/dist/suite-COglUhPd.js.map +1 -0
- package/dist/summary-DU5zaibx.js +148 -0
- package/dist/summary-DU5zaibx.js.map +1 -0
- package/dist/tart-BTVXp8rz.js +373 -0
- package/dist/tart-BTVXp8rz.js.map +1 -0
- package/dist/tart-cli-BIC9HqPg.js +37 -0
- package/dist/tart-cli-BIC9HqPg.js.map +1 -0
- package/dist/tart-cli-BMrkmBjI.js +1 -0
- package/dist/tart-images-DZ_Mbh-g.js +233 -0
- package/dist/tart-images-DZ_Mbh-g.js.map +1 -0
- package/dist/tart-ref-7Qv3cm3B.js +1 -0
- package/dist/tart-ref-DYZijjrU.js +55 -0
- package/dist/tart-ref-DYZijjrU.js.map +1 -0
- package/dist/testing.d.ts +47 -37
- package/dist/testing.js +4 -4
- package/dist/{text-D--Q5KsA.js → text-B8-W3Cvn.js} +2 -4
- package/dist/{text-D--Q5KsA.js.map → text-B8-W3Cvn.js.map} +1 -1
- package/dist/trace-Dx2NBE1O.js +311 -0
- package/dist/trace-Dx2NBE1O.js.map +1 -0
- package/dist/traits-DKnYkqeK.js +66 -0
- package/dist/traits-DKnYkqeK.js.map +1 -0
- package/dist/{transcript-C_IpYMRk.js → transcript-CCf07UmU.js} +3 -3
- package/dist/{transcript-C_IpYMRk.js.map → transcript-CCf07UmU.js.map} +1 -1
- package/dist/{types-C4OkYhZg.js → types-C2mLpph3.js} +3 -2
- package/dist/types-C2mLpph3.js.map +1 -0
- package/dist/{types-BHR1lGPh.d.ts → types-DBwFsGem.d.ts} +420 -136
- package/dist/{judge-ByEUlzOM.js → vercel-CGlSBv63.js} +3 -229
- package/dist/vercel-CGlSBv63.js.map +1 -0
- package/dist/{vertex-6uSpZ5L8.js → vertex-Eb2wqahk.js} +5 -2
- package/dist/vertex-Eb2wqahk.js.map +1 -0
- package/dist/vertex-O88TCwgY.js +1 -0
- package/dist/view/index.d.ts +238 -90
- package/dist/view/index.js +11 -9
- package/dist/{views-CKoN5NAx.js → views-DAIiLiV3.js} +8 -7
- package/dist/views-DAIiLiV3.js.map +1 -0
- package/dist/views-DtRhj2Tn.js +2 -0
- package/dist/{worker-entry-D5dB8cgT.js → worker-entry-BIROTPX1.js} +11 -8
- package/dist/{worker-entry-D5dB8cgT.js.map → worker-entry-BIROTPX1.js.map} +1 -1
- package/dist/workspace-CcQRT31C.js +1 -0
- package/dist/{workspace-Cho30qlM.js → workspace-uuE51x35.js} +7 -7
- package/dist/{workspace-Cho30qlM.js.map → workspace-uuE51x35.js.map} +1 -1
- package/package.json +26 -11
- package/skills/eval-rubric/SKILL.md +31 -4
- package/dist/adapter-DyvDj4ZN.js.map +0 -1
- package/dist/app-files-hpRT5lj_.js.map +0 -1
- package/dist/assemble-DTXwCL3m.js +0 -1
- package/dist/assemble-Dlh6Xv3U.js.map +0 -1
- package/dist/capture-BT2fAmpZ.js +0 -1
- package/dist/capture-Bdcx9Gap.js.map +0 -1
- package/dist/cli-CGd51thd.js.map +0 -1
- package/dist/cli-spec-ChkleEVm.js.map +0 -1
- package/dist/client-CF-DOjOU.js.map +0 -1
- package/dist/command-CsfcwMyc.js.map +0 -1
- package/dist/command-CyIb9BSC.js.map +0 -1
- package/dist/command-TLmY-rYp.js.map +0 -1
- package/dist/commands-C54S45d7.js.map +0 -1
- package/dist/config-ImY6AlRE.js.map +0 -1
- package/dist/context-BajfiH0S.js.map +0 -1
- package/dist/contrasts-DtSX8E_V.js +0 -101
- package/dist/contrasts-DtSX8E_V.js.map +0 -1
- package/dist/cost-CMzY9VXv.js +0 -1
- package/dist/db-ZIk6S2CD.js +0 -2
- package/dist/db-sHGpaLo9.js.map +0 -1
- package/dist/debug-BnXV7JbX.js +0 -1
- package/dist/default-effort-BZRa-SQP.js.map +0 -1
- package/dist/dist-ByYk_wAs.js.map +0 -1
- package/dist/docker--2ytOHcu.js.map +0 -1
- package/dist/doctor-eE65YpEv.js.map +0 -1
- package/dist/environment-Cy3FVLR5.js.map +0 -1
- package/dist/eval-source-BTsTRiBW.js.map +0 -1
- package/dist/evaluate-CFFdyYZX.js.map +0 -1
- package/dist/evaluate-DnGOaGQc.d.ts +0 -43
- package/dist/files-B3d-8Fe0.js +0 -1
- package/dist/files-COW5JBJM.js +0 -1
- package/dist/files-Do4Rp3yZ.js +0 -1
- package/dist/files-p-uTdOjA.js.map +0 -1
- package/dist/gate-BoDKeuJu.js.map +0 -1
- package/dist/harness-Ch2P81sx.js.map +0 -1
- package/dist/ids-DuK6xl4w.js.map +0 -1
- package/dist/images-BVZHDf_z.js.map +0 -1
- package/dist/init-BWnMbUnc.js.map +0 -1
- package/dist/init-s1jN-PCI.js +0 -1
- package/dist/judge-ByEUlzOM.js.map +0 -1
- package/dist/live-DmJix4c8.js +0 -1
- package/dist/live-d_5a5iUv.js.map +0 -1
- package/dist/model-8uZBYqV5.js +0 -1
- package/dist/model-DOiCiMCD.js.map +0 -1
- package/dist/node-CwP1G178.js.map +0 -1
- package/dist/opencode-providers-yNKyXD49.js.map +0 -1
- package/dist/plan-CIfOFhth.js.map +0 -1
- package/dist/plugins-BEs2Am3L.js.map +0 -1
- package/dist/preflight-50Qw5e5K.js.map +0 -1
- package/dist/provenance-Cc8fFE7Z.js.map +0 -1
- package/dist/provider-DCdTHQpk.js +0 -1
- package/dist/providers-CP_bBtYm.js +0 -1
- package/dist/providers-DZSTlC9R.js.map +0 -1
- package/dist/query-kFPuqBv1.js +0 -1
- package/dist/questions-C_Y-oXW6.js.map +0 -1
- package/dist/record-DhzwkSXc.js.map +0 -1
- package/dist/redact-BEEGc37e.js.map +0 -1
- package/dist/remarks-0EXMh6AD.js.map +0 -1
- package/dist/remarks-BL18Id09.js +0 -1
- package/dist/remarks-DeZZT8PK.js +0 -116
- package/dist/remarks-DeZZT8PK.js.map +0 -1
- package/dist/remarks-E4rpi8Ym.js.map +0 -1
- package/dist/resolve-BJSay360.js +0 -1
- package/dist/resolve-B_JlQ0La.js.map +0 -1
- package/dist/resume-CexsWuGK.js +0 -434
- package/dist/resume-CexsWuGK.js.map +0 -1
- package/dist/runtime-CSZ1hjlN.js.map +0 -1
- package/dist/sandbox-B5W8lLL1.js.map +0 -1
- package/dist/server-SBzrf35T.js +0 -1
- package/dist/shared-ogqPJ0uo.js.map +0 -1
- package/dist/source-Dn1uqPon.js +0 -1
- package/dist/src-BKDZO3ra.js +0 -2
- package/dist/src-BxrHipV0.js +0 -3
- package/dist/src-C9elednc.js +0 -2
- package/dist/src-CM7xdJFA.js +0 -2
- package/dist/src-CWEGknZo.js +0 -2
- package/dist/src-Cpy9MNS3.js.map +0 -1
- package/dist/src-DVaAKCsH.js +0 -1
- package/dist/src-DurP--_D.js +0 -2
- package/dist/state-Cicc9Oa5.js +0 -1
- package/dist/stats-D-Gqwqt0.js.map +0 -1
- package/dist/suite-BYJ2Q0S-.js +0 -2
- package/dist/suite-BtHPBFYL.js +0 -544
- package/dist/suite-BtHPBFYL.js.map +0 -1
- package/dist/summary-zP3cCXDN.js.map +0 -1
- package/dist/types-C4OkYhZg.js.map +0 -1
- package/dist/vertex-6uSpZ5L8.js.map +0 -1
- package/dist/vertex-BaAz44YN.js +0 -1
- package/dist/views-CKoN5NAx.js.map +0 -1
- package/dist/views-CmyX255j.js +0 -2
- package/dist/workspace-Dw9DEZox.js +0 -1
|
@@ -0,0 +1,1151 @@
|
|
|
1
|
+
import { o as withoutBom } from "./text-B8-W3Cvn.js";
|
|
2
|
+
import { d as sandboxKind, f as suggestedSandbox, n as capabilitiesOf, p as takesHarness } from "./kinds-C1oY3qyC.js";
|
|
3
|
+
import { a as providerEndpoints, c as providerServedModel, o as providerHosts, s as providerModelResponses, u as resolveOpenCodeProvider } from "./opencode-providers-BGiXt8_B.js";
|
|
4
|
+
import { a as VERCEL_KEY, c as servedOnVercel, i as VERCEL_HOST, n as FX_VERCEL_ENDPOINTS, r as VERCEL_GATEWAY, s as fxAskedModel, t as FX_VERCEL_CALL, u as OPENROUTER_GATEWAY } from "./vercel-CGlSBv63.js";
|
|
5
|
+
import { a as VERTEX_ROUTES, t as SANDBOX_ACCESS_TOKEN } from "./vertex-Eb2wqahk.js";
|
|
6
|
+
import { D as pluginServerName, a as PLUGIN_PARTS, n as PLUGIN_DIR, r as PLUGIN_MANIFEST, t as PART_PATHS } from "./plugins-BkmPxDiY.js";
|
|
7
|
+
import { t as InfraError } from "./types-C2mLpph3.js";
|
|
8
|
+
// src/gateway/routes.ts
|
|
9
|
+
/** Every gateway that brokers a key, by name. */
|
|
10
|
+
const ROUTING_GATEWAYS = {
|
|
11
|
+
vercel: VERCEL_GATEWAY,
|
|
12
|
+
openrouter: OPENROUTER_GATEWAY
|
|
13
|
+
};
|
|
14
|
+
/** Whether a harness's `gateway` names one of {@link ROUTING_GATEWAYS}. */
|
|
15
|
+
const isRoutingGateway = (name) => name !== void 0 && Object.hasOwn(ROUTING_GATEWAYS, name);
|
|
16
|
+
// src/harness/agents.ts
|
|
17
|
+
const WEB_EVENTS = {
|
|
18
|
+
webSearch: "web-search",
|
|
19
|
+
webFetch: "web-fetch"
|
|
20
|
+
};
|
|
21
|
+
/** `harnessMetadata.cursorSdk.unreportedTools` as transcript event types. */
|
|
22
|
+
function cursorUnreported(harnessMetadata) {
|
|
23
|
+
const tools = harnessMetadata?.cursorSdk?.unreportedTools;
|
|
24
|
+
return Array.isArray(tools) ? tools.flatMap((t) => WEB_EVENTS[t] ? [WEB_EVENTS[t]] : []) : [];
|
|
25
|
+
}
|
|
26
|
+
/** A Gemini API key's only request: `POST /v1beta/models/<model>:streamGenerateContent`. */
|
|
27
|
+
const GEMINI_ENDPOINTS = [{
|
|
28
|
+
host: "generativelanguage.googleapis.com",
|
|
29
|
+
path: { regex: "^/v1beta/models/[^/]+:streamGenerateContent$" },
|
|
30
|
+
method: ["POST"]
|
|
31
|
+
}];
|
|
32
|
+
/** Antigravity's: its model calls, and the `:generateContent` call its `search_web` tool makes. */
|
|
33
|
+
const ANTIGRAVITY_ENDPOINTS = [{
|
|
34
|
+
host: "generativelanguage.googleapis.com",
|
|
35
|
+
path: { regex: "^/v1beta/models/[\\w.-]+:(?:streamGenerateContent|generateContent)$" },
|
|
36
|
+
method: ["POST"]
|
|
37
|
+
}];
|
|
38
|
+
/** Goose's: the model call, and the model list it fetches with the key at the start of a turn. */
|
|
39
|
+
const GOOSE_ENDPOINTS = [...GEMINI_ENDPOINTS, {
|
|
40
|
+
host: "generativelanguage.googleapis.com",
|
|
41
|
+
path: { regex: "^/v1beta/models$" },
|
|
42
|
+
method: ["GET"]
|
|
43
|
+
}];
|
|
44
|
+
/**
|
|
45
|
+
* What Grok Build sends the key on: the model list and the key's status as a session starts, and
|
|
46
|
+
* its model calls (Chat Completions, and the Responses API for a model or tool that takes it).
|
|
47
|
+
*/
|
|
48
|
+
const XAI_ENDPOINTS = [
|
|
49
|
+
{
|
|
50
|
+
host: "api.x.ai",
|
|
51
|
+
path: { exact: "/v1/models" },
|
|
52
|
+
method: ["GET"]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
host: "api.x.ai",
|
|
56
|
+
path: { exact: "/v1/api-key" },
|
|
57
|
+
method: ["GET"]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
host: "api.x.ai",
|
|
61
|
+
path: { exact: "/v1/chat/completions" },
|
|
62
|
+
method: ["POST"]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
host: "api.x.ai",
|
|
66
|
+
path: { exact: "/v1/responses" },
|
|
67
|
+
method: ["POST"]
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
/** xAI's model calls, whose responses name the model that served them. */
|
|
71
|
+
const XAI_MODEL_RESPONSES = XAI_ENDPOINTS.filter((e) => e.path.exact === "/v1/chat/completions" || e.path.exact === "/v1/responses");
|
|
72
|
+
/** The model an xAI response says served it. */
|
|
73
|
+
const xaiServedModel = ({ host, responseModel }) => host === "api.x.ai" ? responseModel : void 0;
|
|
74
|
+
/** The model a Gemini API request names in its URL. */
|
|
75
|
+
const geminiServedModel = ({ host, path }) => host === "generativelanguage.googleapis.com" ? /^\/v1beta\/models\/([^/:]+):streamGenerateContent$/.exec(path)?.[1] : void 0;
|
|
76
|
+
/** Cursor's key exchange: the only request the Cursor SDK sends the API key on. */
|
|
77
|
+
const CURSOR_EXCHANGE = {
|
|
78
|
+
host: "api2.cursor.sh",
|
|
79
|
+
path: { exact: "/auth/exchange_user_api_key" },
|
|
80
|
+
method: ["POST"]
|
|
81
|
+
};
|
|
82
|
+
/** Codex's model calls: the Responses API, whose response names the served model. */
|
|
83
|
+
const OPENAI_MODEL_ENDPOINTS = [{
|
|
84
|
+
host: "api.openai.com",
|
|
85
|
+
path: { exact: "/v1/responses" },
|
|
86
|
+
method: ["POST"]
|
|
87
|
+
}];
|
|
88
|
+
/** What Codex sends the key on: its model calls, and its web search tool's own endpoint. */
|
|
89
|
+
const OPENAI_ENDPOINTS = [...OPENAI_MODEL_ENDPOINTS, {
|
|
90
|
+
host: "api.openai.com",
|
|
91
|
+
path: { exact: "/v1/alpha/search" },
|
|
92
|
+
method: ["POST"]
|
|
93
|
+
}];
|
|
94
|
+
/**
|
|
95
|
+
* The model the Responses API says served a request, from its response (a dated snapshot for some
|
|
96
|
+
* models), and the reasoning effort Codex resolved for it, e.g. `gpt-5.6-luna[effort=medium]`.
|
|
97
|
+
*/
|
|
98
|
+
const openaiServedModel = ({ host, path, responseModel, responseEffort }) => host === "api.openai.com" && path === "/v1/responses" && responseModel ? `${responseModel}${responseEffort ? `[effort=${responseEffort}]` : ""}` : void 0;
|
|
99
|
+
/**
|
|
100
|
+
* OpenCode on the model's provider (`anthropic/claude-haiku-4-5` is Anthropic's): its key, the
|
|
101
|
+
* requests OpenCode sends it on, its hosts plus Exa's for web search, and the served model from
|
|
102
|
+
* the URL (Gemini's API, Bedrock's) or the response body. Bedrock's hosts are its `AWS_REGION`'s.
|
|
103
|
+
*/
|
|
104
|
+
function opencodeForModel(model, env = process.env) {
|
|
105
|
+
const resolved = resolveOpenCodeProvider(model, env);
|
|
106
|
+
if ("error" in resolved) throw new InfraError(`opencode(): ${resolved.error}`);
|
|
107
|
+
const { provider } = resolved;
|
|
108
|
+
const modelResponses = providerModelResponses(provider);
|
|
109
|
+
return {
|
|
110
|
+
credential: provider.env,
|
|
111
|
+
endpoints: providerEndpoints(provider),
|
|
112
|
+
...modelResponses.length ? { modelResponses } : {},
|
|
113
|
+
servedModel: (request) => providerServedModel(provider, request),
|
|
114
|
+
hosts: [...providerHosts(provider), "mcp.exa.ai"]
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The variables besides its key that OpenCode's provider takes from the host, as they are:
|
|
119
|
+
* Bedrock's `AWS_REGION` (default `us-east-1`); none for most providers.
|
|
120
|
+
*/
|
|
121
|
+
function opencodeVars(model, env = process.env) {
|
|
122
|
+
const resolved = resolveOpenCodeProvider(model, env);
|
|
123
|
+
if ("error" in resolved) throw new InfraError(`opencode(): ${resolved.error}`);
|
|
124
|
+
return resolved.vars;
|
|
125
|
+
}
|
|
126
|
+
/** Codex's `config.toml` `[mcp_servers]` shape. */
|
|
127
|
+
function codexMcpServers(servers) {
|
|
128
|
+
return Object.fromEntries(Object.entries(servers).map(([name, s]) => {
|
|
129
|
+
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`);
|
|
130
|
+
return s.transport === "stdio" ? [name, {
|
|
131
|
+
command: s.command,
|
|
132
|
+
args: s.args,
|
|
133
|
+
env: s.env ?? {}
|
|
134
|
+
}] : [name, {
|
|
135
|
+
url: s.url,
|
|
136
|
+
http_headers: s.headers ?? {}
|
|
137
|
+
}];
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
/** The `.mcp.json` shape. */
|
|
141
|
+
function claudeMcpServers(servers) {
|
|
142
|
+
return Object.fromEntries(Object.entries(servers).map(([name, s]) => s.transport === "stdio" ? [name, {
|
|
143
|
+
type: "stdio",
|
|
144
|
+
command: s.command,
|
|
145
|
+
args: s.args,
|
|
146
|
+
env: s.env
|
|
147
|
+
}] : [name, {
|
|
148
|
+
type: s.transport,
|
|
149
|
+
url: s.url,
|
|
150
|
+
headers: s.headers
|
|
151
|
+
}]));
|
|
152
|
+
}
|
|
153
|
+
/** The Antigravity CLI's `mcp_config.json` shape: remote servers take `serverUrl`, not `url`. */
|
|
154
|
+
function antigravityMcpServers(servers) {
|
|
155
|
+
return Object.fromEntries(Object.entries(servers).map(([name, s]) => s.transport === "stdio" ? [name, {
|
|
156
|
+
command: s.command,
|
|
157
|
+
args: s.args,
|
|
158
|
+
env: s.env
|
|
159
|
+
}] : [name, {
|
|
160
|
+
serverUrl: s.url,
|
|
161
|
+
headers: s.headers
|
|
162
|
+
}]));
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* A `{env:…}` or `{file:…}` OpenCode would substitute. It runs `\{env:[^}]+\}`, then
|
|
166
|
+
* `\{file:[^}]+\}`, over its whole config text with no escape, so a reference left open at the end
|
|
167
|
+
* of a value runs on into the JSON after it, and only `{env:}` and `{file:}` are left alone.
|
|
168
|
+
*/
|
|
169
|
+
const OPENCODE_REFERENCE = /\{(?:env|file):(?!\})/;
|
|
170
|
+
const fieldKey = (key) => /^[A-Za-z_$][\w$]*$/.test(key) ? `.${key}` : `[${JSON.stringify(key)}]`;
|
|
171
|
+
/**
|
|
172
|
+
* The first part of a server OpenCode would substitute, as what the server wouldn't get: its name,
|
|
173
|
+
* a value as `mcp.<name>.<field>`, or an env or header name. Names are in the same config text as
|
|
174
|
+
* values, so they're substituted too; a secret's value is never named.
|
|
175
|
+
*/
|
|
176
|
+
function openCodeReference(name, s) {
|
|
177
|
+
if (OPENCODE_REFERENCE.test(name)) return "its name";
|
|
178
|
+
const server = `mcp${fieldKey(name)}`;
|
|
179
|
+
const [map, kind, values] = s.transport === "stdio" ? [
|
|
180
|
+
"env",
|
|
181
|
+
"env",
|
|
182
|
+
s.env ?? {}
|
|
183
|
+
] : [
|
|
184
|
+
"headers",
|
|
185
|
+
"header",
|
|
186
|
+
s.headers ?? {}
|
|
187
|
+
];
|
|
188
|
+
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];
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* OpenCode's config shape (its `mcp.servers`), which the adapter sets `codemode: false` on.
|
|
192
|
+
* OpenCode has no SSE transport, and refuses a value it would substitute.
|
|
193
|
+
*/
|
|
194
|
+
function opencodeMcpServers(servers) {
|
|
195
|
+
return Object.fromEntries(Object.entries(servers).map(([name, s]) => {
|
|
196
|
+
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`);
|
|
197
|
+
const field = openCodeReference(name, s);
|
|
198
|
+
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`);
|
|
199
|
+
return s.transport === "stdio" ? [name, {
|
|
200
|
+
type: "local",
|
|
201
|
+
command: [s.command, ...s.args],
|
|
202
|
+
environment: s.env ?? {}
|
|
203
|
+
}] : [name, {
|
|
204
|
+
type: "remote",
|
|
205
|
+
url: s.url,
|
|
206
|
+
headers: s.headers ?? {},
|
|
207
|
+
oauth: false
|
|
208
|
+
}];
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The key Goose keeps an extension by (its `name_to_key`): whitespace dropped, anything but ASCII
|
|
213
|
+
* letters, digits, `_` and `-` made `_`, lower-cased. Of two extensions with one key it keeps one.
|
|
214
|
+
*/
|
|
215
|
+
const gooseKey = (name) => name.replace(/\s/g, "").replace(/[^A-Za-z0-9_-]/g, "_").toLowerCase();
|
|
216
|
+
/** Goose's extension shape (its `config.yaml`); it has no SSE transport. */
|
|
217
|
+
function gooseMcpServers(servers) {
|
|
218
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
219
|
+
for (const name of Object.keys(servers)) {
|
|
220
|
+
const key = gooseKey(name);
|
|
221
|
+
const other = byKey.get(key);
|
|
222
|
+
if (other !== void 0) throw new InfraError(`Goose keys the ${other} and ${name} MCP servers both as ${key}, and keeps only one: rename one`);
|
|
223
|
+
byKey.set(key, name);
|
|
224
|
+
}
|
|
225
|
+
return Object.fromEntries(Object.entries(servers).map(([name, s]) => {
|
|
226
|
+
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`);
|
|
227
|
+
return s.transport === "stdio" ? [name, {
|
|
228
|
+
type: "stdio",
|
|
229
|
+
cmd: s.command,
|
|
230
|
+
args: s.args,
|
|
231
|
+
envs: s.env ?? {}
|
|
232
|
+
}] : [name, {
|
|
233
|
+
type: "streamable_http",
|
|
234
|
+
uri: s.url,
|
|
235
|
+
headers: s.headers ?? {}
|
|
236
|
+
}];
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* pi's `mcp.json` shape, which the adapter escapes and sets `"exposure": "direct"` on. pi
|
|
241
|
+
* skips a server whose name isn't letters, digits, `_` and `-`, so the plan refuses it instead.
|
|
242
|
+
* A plugin's server, `<plugin>:<server>`, is named `<plugin>_<server>`, so its tools are
|
|
243
|
+
* `mcp__<plugin>_<server>__<tool>`.
|
|
244
|
+
*/
|
|
245
|
+
function piMcpServers(servers) {
|
|
246
|
+
const named = /* @__PURE__ */ new Map();
|
|
247
|
+
return Object.fromEntries(Object.entries(servers).map(([key, s]) => {
|
|
248
|
+
const name = /^[a-z0-9-]+:[^:]+$/.test(key) ? key.replace(":", "_") : key;
|
|
249
|
+
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`);
|
|
250
|
+
const other = named.get(name);
|
|
251
|
+
if (other) throw new InfraError(`pi names the ${key} MCP server ${name}, as it does the ${other} server, and keeps only one: rename one`);
|
|
252
|
+
named.set(name, key);
|
|
253
|
+
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`);
|
|
254
|
+
return s.transport === "stdio" ? [name, {
|
|
255
|
+
command: s.command,
|
|
256
|
+
args: s.args,
|
|
257
|
+
env: s.env ?? {}
|
|
258
|
+
}] : [name, {
|
|
259
|
+
url: s.url,
|
|
260
|
+
headers: s.headers ?? {}
|
|
261
|
+
}];
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* ACP's `McpServer` shape, which fx and Grok Build take on `session/new`: `env` and `headers` as
|
|
266
|
+
* name-value lists.
|
|
267
|
+
*/
|
|
268
|
+
function acpMcpServers(servers) {
|
|
269
|
+
const pairs = (values = {}) => Object.entries(values).map(([name, value]) => ({
|
|
270
|
+
name,
|
|
271
|
+
value
|
|
272
|
+
}));
|
|
273
|
+
return Object.fromEntries(Object.entries(servers).map(([name, s]) => s.transport === "stdio" ? [name, s.command.startsWith("/") ? {
|
|
274
|
+
command: s.command,
|
|
275
|
+
args: s.args,
|
|
276
|
+
env: pairs(s.env)
|
|
277
|
+
} : {
|
|
278
|
+
command: "/usr/bin/env",
|
|
279
|
+
args: [s.command, ...s.args],
|
|
280
|
+
env: pairs(s.env)
|
|
281
|
+
}] : [name, {
|
|
282
|
+
type: s.transport,
|
|
283
|
+
url: s.url,
|
|
284
|
+
headers: pairs(s.headers)
|
|
285
|
+
}]));
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* fx on the model's provider: OpenAI's Chat Completions API for a bare OpenAI id, and Vercel AI
|
|
289
|
+
* Gateway for a gateway id, which only `vercel()` in the gateway list serves. Each response's
|
|
290
|
+
* first `model` names the model that served it.
|
|
291
|
+
*/
|
|
292
|
+
function fxForModel(model) {
|
|
293
|
+
if (!model.includes("/")) {
|
|
294
|
+
const endpoints = [{
|
|
295
|
+
host: "api.openai.com",
|
|
296
|
+
path: { exact: "/v1/chat/completions" },
|
|
297
|
+
method: ["POST"]
|
|
298
|
+
}];
|
|
299
|
+
return {
|
|
300
|
+
credential: "OPENAI_API_KEY",
|
|
301
|
+
endpoints,
|
|
302
|
+
modelResponses: endpoints,
|
|
303
|
+
servedModel: ({ host, responseModel }) => host === "api.openai.com" ? responseModel : void 0,
|
|
304
|
+
hosts: ["api.openai.com"]
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
credential: VERCEL_KEY,
|
|
309
|
+
endpoints: FX_VERCEL_ENDPOINTS,
|
|
310
|
+
modelResponses: [FX_VERCEL_CALL],
|
|
311
|
+
servedModel: servedOnVercel,
|
|
312
|
+
askedModel: fxAskedModel,
|
|
313
|
+
hosts: [VERCEL_HOST]
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
/** The Cursor SDK's `McpServerConfig` shape. */
|
|
317
|
+
function cursorMcpServers(servers) {
|
|
318
|
+
return Object.fromEntries(Object.entries(servers).map(([name, s]) => s.transport === "stdio" ? [name, {
|
|
319
|
+
type: "stdio",
|
|
320
|
+
command: s.command,
|
|
321
|
+
args: s.args,
|
|
322
|
+
env: s.env
|
|
323
|
+
}] : [name, {
|
|
324
|
+
type: s.transport,
|
|
325
|
+
url: s.url,
|
|
326
|
+
headers: s.headers
|
|
327
|
+
}]));
|
|
328
|
+
}
|
|
329
|
+
/** Claude Code's hook events as Cursor names them, as the Cursor SDK converts Claude Code's own. */
|
|
330
|
+
const CURSOR_HOOK_EVENTS = {
|
|
331
|
+
SessionStart: "sessionStart",
|
|
332
|
+
SessionEnd: "sessionEnd",
|
|
333
|
+
UserPromptSubmit: "beforeSubmitPrompt",
|
|
334
|
+
PreToolUse: "preToolUse",
|
|
335
|
+
PostToolUse: "postToolUse",
|
|
336
|
+
SubagentStop: "subagentStop",
|
|
337
|
+
PreCompact: "preCompact",
|
|
338
|
+
Stop: "stop"
|
|
339
|
+
};
|
|
340
|
+
/** Claude Code's tool names as Cursor's hooks match them; null for one Cursor has no tool for. */
|
|
341
|
+
const CURSOR_HOOK_TOOLS = {
|
|
342
|
+
Bash: "Shell",
|
|
343
|
+
Read: "Read",
|
|
344
|
+
Write: "Write",
|
|
345
|
+
Edit: "Write",
|
|
346
|
+
Glob: null,
|
|
347
|
+
Grep: "Grep",
|
|
348
|
+
WebFetch: "WebFetch",
|
|
349
|
+
WebSearch: "WebSearch",
|
|
350
|
+
Task: "Task"
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* A Claude Code hook group's tool matcher as Cursor's, on the tool events only: each name mapped,
|
|
354
|
+
* `mcp__<server>__<tool>` as `MCP:<tool>`; null when it names only tools Cursor lacks.
|
|
355
|
+
*/
|
|
356
|
+
function cursorHookMatcher(event, matcher) {
|
|
357
|
+
if (event !== "PreToolUse" && event !== "PostToolUse") return void 0;
|
|
358
|
+
if (!matcher || matcher === "*") return void 0;
|
|
359
|
+
const out = [];
|
|
360
|
+
for (const raw of matcher.split("|")) {
|
|
361
|
+
const name = raw.trim();
|
|
362
|
+
const parts = name.split("__");
|
|
363
|
+
const tool = name.startsWith("mcp__") && parts.length >= 3 ? `MCP:${parts.slice(2).join("__")}` : CURSOR_HOOK_TOOLS[name] === void 0 ? name : CURSOR_HOOK_TOOLS[name];
|
|
364
|
+
if (tool && !out.includes(tool)) out.push(tool);
|
|
365
|
+
}
|
|
366
|
+
return out.length ? out.join("|") : null;
|
|
367
|
+
}
|
|
368
|
+
/** Where Cursor reads what reeval unpacks from a plugin, in the workspace (settingSources `project`). */
|
|
369
|
+
const CURSOR_PLUGIN_UNPACK = {
|
|
370
|
+
rules: ".cursor/rules",
|
|
371
|
+
agents: ".cursor/agents",
|
|
372
|
+
commands: ".cursor/commands",
|
|
373
|
+
hooks: {
|
|
374
|
+
file: ".cursor/hooks.json",
|
|
375
|
+
events: CURSOR_HOOK_EVENTS,
|
|
376
|
+
matcher: cursorHookMatcher
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* A plugin subagent's or command's frontmatter as OpenCode 2 takes it: the description, and a
|
|
381
|
+
* subagent's `mode`. OpenCode skips a file whose frontmatter its schema refuses, without saying,
|
|
382
|
+
* and Claude Code's `tools: Read, Grep`, `model: sonnet` and `allowed-tools` are such keys.
|
|
383
|
+
*/
|
|
384
|
+
function opencodeFrontmatter(part, front) {
|
|
385
|
+
const d = front.description;
|
|
386
|
+
const description = typeof d === "string" || typeof d === "number" || typeof d === "boolean" ? String(d) : void 0;
|
|
387
|
+
return {
|
|
388
|
+
...description ? { description } : {},
|
|
389
|
+
...part === "agents" ? { mode: "subagent" } : {}
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
/** Where OpenCode reads plugin subagents and commands, in the workspace's config directory. */
|
|
393
|
+
const OPENCODE_PLUGIN_UNPACK = {
|
|
394
|
+
agents: ".opencode/agents",
|
|
395
|
+
commands: ".opencode/commands",
|
|
396
|
+
frontmatter: opencodeFrontmatter
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Where pi reads plugin commands, as prompt templates (`/<name>`), in the workspace, which its
|
|
400
|
+
* `--approve` trusts. Its frontmatter takes `description` and `argument-hint`, and ignores the
|
|
401
|
+
* rest of Claude Code's.
|
|
402
|
+
*/
|
|
403
|
+
const PI_PLUGIN_UNPACK = { commands: ".pi/prompts" };
|
|
404
|
+
/**
|
|
405
|
+
* What Claude Code's plugin format bundles, which Grok Build reads too: every part but rules,
|
|
406
|
+
* which neither loads from a plugin.
|
|
407
|
+
*/
|
|
408
|
+
const CLAUDE_FORMAT_PARTS = PLUGIN_PARTS.filter((p) => p !== "rules");
|
|
409
|
+
/** The marketplace Claude Code's settings name for the session's plugins. */
|
|
410
|
+
const CLAUDE_PLUGIN_MARKETPLACE = "reeval";
|
|
411
|
+
/**
|
|
412
|
+
* Claude Code's settings for the session's plugins: a `directory` marketplace at the directory
|
|
413
|
+
* they were copied to, listing each, and each enabled as `<plugin>@reeval`. Claude Code installs
|
|
414
|
+
* and loads them as it starts, since the bridge leaves every settings source on.
|
|
415
|
+
*/
|
|
416
|
+
function claudePluginFiles(plugins) {
|
|
417
|
+
const [first] = plugins;
|
|
418
|
+
if (!first) return [];
|
|
419
|
+
const json = (value) => `${JSON.stringify(value, null, 2)}\n`;
|
|
420
|
+
const marketplace = {
|
|
421
|
+
name: CLAUDE_PLUGIN_MARKETPLACE,
|
|
422
|
+
owner: { name: "reeval" },
|
|
423
|
+
plugins: plugins.map((p) => ({
|
|
424
|
+
name: p.name,
|
|
425
|
+
source: `./${p.name}`
|
|
426
|
+
}))
|
|
427
|
+
};
|
|
428
|
+
const settings = {
|
|
429
|
+
extraKnownMarketplaces: { [CLAUDE_PLUGIN_MARKETPLACE]: { source: {
|
|
430
|
+
source: "directory",
|
|
431
|
+
path: first.dir.slice(0, first.dir.lastIndexOf("/"))
|
|
432
|
+
} } },
|
|
433
|
+
enabledPlugins: Object.fromEntries(plugins.map((p) => [`${p.name}@${CLAUDE_PLUGIN_MARKETPLACE}`, true]))
|
|
434
|
+
};
|
|
435
|
+
return [{
|
|
436
|
+
path: `${PLUGIN_DIR}/.claude-plugin/marketplace.json`,
|
|
437
|
+
content: json(marketplace)
|
|
438
|
+
}, {
|
|
439
|
+
path: "~/.claude/settings.json",
|
|
440
|
+
content: json(settings),
|
|
441
|
+
merge: true
|
|
442
|
+
}];
|
|
443
|
+
}
|
|
444
|
+
const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
445
|
+
/**
|
|
446
|
+
* Writes the layout's plugin files into the sandbox and returns their paths. A `merge` file's keys
|
|
447
|
+
* go into the JSON object already at its path (an object-valued key merged one level down), so
|
|
448
|
+
* settings an environment's `files` wrote there stay.
|
|
449
|
+
*/
|
|
450
|
+
async function writePluginFiles(sandbox, layout, plugins) {
|
|
451
|
+
const written = [];
|
|
452
|
+
for (const f of layout.pluginFiles?.(plugins) ?? []) {
|
|
453
|
+
const existing = f.merge ? await sandbox.readFile(f.path) : null;
|
|
454
|
+
let content = f.content;
|
|
455
|
+
if (existing?.trim()) {
|
|
456
|
+
let base;
|
|
457
|
+
try {
|
|
458
|
+
base = JSON.parse(withoutBom(existing));
|
|
459
|
+
} catch {}
|
|
460
|
+
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`);
|
|
461
|
+
const ours = JSON.parse(f.content);
|
|
462
|
+
const merged = { ...base };
|
|
463
|
+
for (const [k, v] of Object.entries(ours)) {
|
|
464
|
+
const was = base[k];
|
|
465
|
+
merged[k] = isObject(v) && isObject(was) ? {
|
|
466
|
+
...was,
|
|
467
|
+
...v
|
|
468
|
+
} : v;
|
|
469
|
+
}
|
|
470
|
+
content = `${JSON.stringify(merged, null, 2)}\n`;
|
|
471
|
+
}
|
|
472
|
+
await sandbox.writeFile(f.path, content);
|
|
473
|
+
written.push(f.path);
|
|
474
|
+
}
|
|
475
|
+
return written;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* The MCP servers the agent is given: all of them, less the plugins' own where it takes plugin
|
|
479
|
+
* items namespaced, since it loads those from the plugin and would otherwise start each twice.
|
|
480
|
+
*/
|
|
481
|
+
function agentMcp(layout, mcp, plugins) {
|
|
482
|
+
if (layout.pluginPlacement !== "namespaced") return mcp;
|
|
483
|
+
const own = new Set(plugins.flatMap((p) => p.servers));
|
|
484
|
+
return Object.fromEntries(Object.entries(mcp).filter(([name]) => !own.has(name)));
|
|
485
|
+
}
|
|
486
|
+
/** Where each agent with an image reads rules and skills. */
|
|
487
|
+
const LAYOUTS = {
|
|
488
|
+
cursor: {
|
|
489
|
+
rulesFile: "AGENTS.md",
|
|
490
|
+
workspaceSkillDir: ".cursor/skills",
|
|
491
|
+
harnessSkillDir: ".agents/skills",
|
|
492
|
+
pluginPlacement: "flat",
|
|
493
|
+
pluginUnpack: CURSOR_PLUGIN_UNPACK,
|
|
494
|
+
pluginHookEvents: Object.keys(CURSOR_HOOK_EVENTS)
|
|
495
|
+
},
|
|
496
|
+
"claude-code": {
|
|
497
|
+
rulesFile: "CLAUDE.md",
|
|
498
|
+
workspaceSkillDir: ".claude/skills",
|
|
499
|
+
harnessSkillDir: ".claude/skills",
|
|
500
|
+
pluginPlacement: "namespaced",
|
|
501
|
+
pluginFiles: claudePluginFiles
|
|
502
|
+
},
|
|
503
|
+
antigravity: {
|
|
504
|
+
rulesFile: "AGENTS.md",
|
|
505
|
+
workspaceSkillDir: ".agents/skills",
|
|
506
|
+
harnessSkillDir: ".gemini/config/skills",
|
|
507
|
+
pluginPlacement: "namespaced",
|
|
508
|
+
pluginHookEvents: [
|
|
509
|
+
"SessionStart",
|
|
510
|
+
"PreToolUse",
|
|
511
|
+
"PostToolUse",
|
|
512
|
+
"Stop"
|
|
513
|
+
]
|
|
514
|
+
},
|
|
515
|
+
opencode: {
|
|
516
|
+
rulesFile: "AGENTS.md",
|
|
517
|
+
workspaceSkillDir: ".opencode/skills",
|
|
518
|
+
harnessSkillDir: ".config/opencode/skills",
|
|
519
|
+
pluginPlacement: "flat",
|
|
520
|
+
pluginUnpack: OPENCODE_PLUGIN_UNPACK
|
|
521
|
+
},
|
|
522
|
+
goose: {
|
|
523
|
+
rulesFile: "AGENTS.md",
|
|
524
|
+
workspaceSkillDir: ".goose/skills",
|
|
525
|
+
harnessSkillDir: ".ai-sdk-harness/.harness-bootstrap/goose/home/.config/goose/skills",
|
|
526
|
+
pluginPlacement: "flat"
|
|
527
|
+
},
|
|
528
|
+
pi: {
|
|
529
|
+
rulesFile: "AGENTS.md",
|
|
530
|
+
workspaceSkillDir: ".pi/skills",
|
|
531
|
+
harnessSkillDir: ".pi/agent/skills",
|
|
532
|
+
pluginPlacement: "flat",
|
|
533
|
+
pluginUnpack: PI_PLUGIN_UNPACK
|
|
534
|
+
},
|
|
535
|
+
codex: {
|
|
536
|
+
rulesFile: "AGENTS.md",
|
|
537
|
+
workspaceSkillDir: ".agents/skills",
|
|
538
|
+
harnessSkillDir: ".agents/skills",
|
|
539
|
+
pluginPlacement: "namespaced"
|
|
540
|
+
},
|
|
541
|
+
fx: {
|
|
542
|
+
rulesFile: "AGENTS.md",
|
|
543
|
+
workspaceSkillDir: ".fx/skills",
|
|
544
|
+
harnessSkillDir: ".ai-sdk-harness/.harness-bootstrap/fx/home/.fx/skills",
|
|
545
|
+
pluginPlacement: "flat"
|
|
546
|
+
},
|
|
547
|
+
"grok-build": {
|
|
548
|
+
rulesFile: "AGENTS.md",
|
|
549
|
+
workspaceSkillDir: ".grok/skills",
|
|
550
|
+
harnessSkillDir: ".ai-sdk-harness/.harness-bootstrap/grok-build/home/.grok/skills",
|
|
551
|
+
pluginPlacement: "namespaced"
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
/** Every real agent reeval can drive, by harness kind. */
|
|
555
|
+
const AGENTS = {
|
|
556
|
+
cursor: {
|
|
557
|
+
...LAYOUTS.cursor,
|
|
558
|
+
pluginParts: PLUGIN_PARTS,
|
|
559
|
+
name: "Cursor",
|
|
560
|
+
factory: "cursor",
|
|
561
|
+
platforms: ["linux"],
|
|
562
|
+
reasoning: "streamed",
|
|
563
|
+
reasoningTokens: false,
|
|
564
|
+
credential: "CURSOR_API_KEY",
|
|
565
|
+
endpoints: [CURSOR_EXCHANGE],
|
|
566
|
+
tokens: {
|
|
567
|
+
endpoint: CURSOR_EXCHANGE,
|
|
568
|
+
fields: ["accessToken", "refreshToken"],
|
|
569
|
+
hosts: ["cursor.sh", "*.cursor.sh"]
|
|
570
|
+
},
|
|
571
|
+
unreported: cursorUnreported,
|
|
572
|
+
mcpServers: cursorMcpServers,
|
|
573
|
+
adapter: async ({ auth, mcpServers, descriptor }) => (await import("./src-6Zzyg4Qd.js")).createCursorSdk({
|
|
574
|
+
auth,
|
|
575
|
+
...mcpServers ? { mcpServers } : {},
|
|
576
|
+
...descriptor.kind === "cursor" && descriptor.params ? { modelParams: descriptor.params } : {},
|
|
577
|
+
...descriptor.kind === "cursor" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
578
|
+
requireCredentialBrokering: true
|
|
579
|
+
})
|
|
580
|
+
},
|
|
581
|
+
"claude-code": {
|
|
582
|
+
...LAYOUTS["claude-code"],
|
|
583
|
+
pluginParts: CLAUDE_FORMAT_PARTS,
|
|
584
|
+
name: "Claude Code",
|
|
585
|
+
factory: "claudeCode",
|
|
586
|
+
platforms: ["linux"],
|
|
587
|
+
reasoning: "streamed",
|
|
588
|
+
reasoningTokens: false,
|
|
589
|
+
subagentCalls: true,
|
|
590
|
+
credential: "ANTHROPIC_API_KEY",
|
|
591
|
+
endpoints: [
|
|
592
|
+
{
|
|
593
|
+
host: "api.anthropic.com",
|
|
594
|
+
path: { exact: "/v1/messages" },
|
|
595
|
+
method: ["POST"]
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
host: "api.anthropic.com",
|
|
599
|
+
path: { exact: "/v1/messages/count_tokens" },
|
|
600
|
+
method: ["POST"]
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
host: "api.anthropic.com",
|
|
604
|
+
path: { exact: "/api/claude_code/settings" },
|
|
605
|
+
method: ["GET"]
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
host: "api.anthropic.com",
|
|
609
|
+
path: { exact: "/api/claude_code/policy_limits" },
|
|
610
|
+
method: ["GET"]
|
|
611
|
+
}
|
|
612
|
+
],
|
|
613
|
+
mcpServers: claudeMcpServers,
|
|
614
|
+
adapter: async ({ auth, env, mcpServers, descriptor }) => (await import("./dist-CAFD1yfv.js")).createClaudeCode({
|
|
615
|
+
auth,
|
|
616
|
+
...mcpServers ? { mcpServers } : {},
|
|
617
|
+
...descriptor.kind === "claude-code" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
618
|
+
env: {
|
|
619
|
+
IS_SANDBOX: "1",
|
|
620
|
+
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1",
|
|
621
|
+
...env
|
|
622
|
+
}
|
|
623
|
+
})
|
|
624
|
+
},
|
|
625
|
+
antigravity: {
|
|
626
|
+
...LAYOUTS.antigravity,
|
|
627
|
+
pluginParts: PLUGIN_PARTS,
|
|
628
|
+
pluginManifestsFirst: [
|
|
629
|
+
"plugin.json",
|
|
630
|
+
".antigravity-plugin/plugin.json",
|
|
631
|
+
".gemini-plugin/plugin.json",
|
|
632
|
+
"gemini-extension.json"
|
|
633
|
+
],
|
|
634
|
+
name: "Antigravity",
|
|
635
|
+
factory: "antigravity",
|
|
636
|
+
platforms: ["linux"],
|
|
637
|
+
reasoning: "none",
|
|
638
|
+
reasoningTokens: true,
|
|
639
|
+
credential: "GEMINI_API_KEY",
|
|
640
|
+
endpoints: ANTIGRAVITY_ENDPOINTS,
|
|
641
|
+
expectedBlocked: {
|
|
642
|
+
hosts: ["play.googleapis.com", "antigravity-unleash.goog"],
|
|
643
|
+
why: "Antigravity's telemetry and feature flags, which its CLI sends even with telemetry off"
|
|
644
|
+
},
|
|
645
|
+
servedModel: geminiServedModel,
|
|
646
|
+
mcpServers: antigravityMcpServers,
|
|
647
|
+
adapter: async ({ auth, mcpServers, descriptor, plugins, vertex }) => (await import("./src-T-OeuJLr.js")).createAntigravity({
|
|
648
|
+
auth,
|
|
649
|
+
...vertex ? { vertex } : {},
|
|
650
|
+
...mcpServers ? { mcpServers } : {},
|
|
651
|
+
...plugins.length ? { plugins: plugins.map(({ name, dir }) => ({
|
|
652
|
+
name,
|
|
653
|
+
dir
|
|
654
|
+
})) } : {},
|
|
655
|
+
...descriptor.kind === "antigravity" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
656
|
+
requireCredentialBrokering: true
|
|
657
|
+
})
|
|
658
|
+
},
|
|
659
|
+
opencode: {
|
|
660
|
+
...LAYOUTS.opencode,
|
|
661
|
+
pluginParts: [
|
|
662
|
+
"skills",
|
|
663
|
+
"agents",
|
|
664
|
+
"commands",
|
|
665
|
+
"mcp"
|
|
666
|
+
],
|
|
667
|
+
name: "OpenCode",
|
|
668
|
+
factory: "opencode",
|
|
669
|
+
platforms: ["linux"],
|
|
670
|
+
configuredModelOnStart: true,
|
|
671
|
+
reasoning: "streamed",
|
|
672
|
+
reasoningTokens: "provider",
|
|
673
|
+
credential: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
674
|
+
endpoints: GEMINI_ENDPOINTS,
|
|
675
|
+
servedModel: geminiServedModel,
|
|
676
|
+
forModel: opencodeForModel,
|
|
677
|
+
mcpServers: opencodeMcpServers,
|
|
678
|
+
adapter: async ({ auth, mcpServers, descriptor, model, vertex }) => (await import("./src-zntEDlnx.js")).createOpenCode({
|
|
679
|
+
auth,
|
|
680
|
+
model,
|
|
681
|
+
...vertex ? { vertex } : { vars: opencodeVars(model) },
|
|
682
|
+
...descriptor.kind === "opencode" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
683
|
+
...mcpServers ? { mcpServers } : {},
|
|
684
|
+
requireCredentialBrokering: true
|
|
685
|
+
})
|
|
686
|
+
},
|
|
687
|
+
goose: {
|
|
688
|
+
...LAYOUTS.goose,
|
|
689
|
+
pluginParts: ["skills", "mcp"],
|
|
690
|
+
name: "Goose",
|
|
691
|
+
factory: "goose",
|
|
692
|
+
platforms: ["linux"],
|
|
693
|
+
configuredModelOnStart: true,
|
|
694
|
+
reasoning: "streamed",
|
|
695
|
+
reasoningTokens: false,
|
|
696
|
+
credential: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
697
|
+
endpoints: GOOSE_ENDPOINTS,
|
|
698
|
+
expectedBlocked: {
|
|
699
|
+
hosts: ["models.dev"],
|
|
700
|
+
why: "Goose's model catalog refresh, which no setting turns off"
|
|
701
|
+
},
|
|
702
|
+
servedModel: geminiServedModel,
|
|
703
|
+
mcpServers: gooseMcpServers,
|
|
704
|
+
adapter: async ({ auth, mcpServers, descriptor, model, vertex }) => (await import("./src-BRMsk9nh.js")).createGoose({
|
|
705
|
+
...vertex ? { vertex } : {},
|
|
706
|
+
...auth["AI_GATEWAY_API_KEY"] ? {
|
|
707
|
+
auth,
|
|
708
|
+
provider: (await import("./src-BRMsk9nh.js")).AI_GATEWAY_PROVIDER
|
|
709
|
+
} : auth["OPENROUTER_API_KEY"] ? {
|
|
710
|
+
auth,
|
|
711
|
+
provider: (await import("./src-BRMsk9nh.js")).OPENROUTER_PROVIDER
|
|
712
|
+
} : { auth: { GOOGLE_API_KEY: auth.GOOGLE_GENERATIVE_AI_API_KEY ?? "" } },
|
|
713
|
+
model,
|
|
714
|
+
...descriptor.kind === "goose" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
715
|
+
...mcpServers ? { mcpServers } : {},
|
|
716
|
+
requireCredentialBrokering: true
|
|
717
|
+
})
|
|
718
|
+
},
|
|
719
|
+
pi: {
|
|
720
|
+
...LAYOUTS.pi,
|
|
721
|
+
pluginParts: [
|
|
722
|
+
"skills",
|
|
723
|
+
"commands",
|
|
724
|
+
"mcp"
|
|
725
|
+
],
|
|
726
|
+
name: "pi",
|
|
727
|
+
factory: "pi",
|
|
728
|
+
platforms: ["linux"],
|
|
729
|
+
reasoning: "streamed",
|
|
730
|
+
reasoningTokens: true,
|
|
731
|
+
credential: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
732
|
+
endpoints: GEMINI_ENDPOINTS,
|
|
733
|
+
servedModel: geminiServedModel,
|
|
734
|
+
mcpServers: piMcpServers,
|
|
735
|
+
adapter: async ({ auth, mcpServers, descriptor, vertex }) => (await import("./src-BDhcPtnI.js")).createPi({
|
|
736
|
+
...auth["AI_GATEWAY_API_KEY"] ? {
|
|
737
|
+
auth,
|
|
738
|
+
gateway: (await import("./src-BDhcPtnI.js")).PI_AI_GATEWAY
|
|
739
|
+
} : auth["OPENROUTER_API_KEY"] ? {
|
|
740
|
+
auth,
|
|
741
|
+
gateway: (await import("./src-BDhcPtnI.js")).PI_OPENROUTER
|
|
742
|
+
} : {
|
|
743
|
+
auth: { GEMINI_API_KEY: auth.GOOGLE_GENERATIVE_AI_API_KEY ?? "" },
|
|
744
|
+
...vertex ? { vertex } : {}
|
|
745
|
+
},
|
|
746
|
+
...descriptor.kind === "pi" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
747
|
+
...mcpServers ? { mcpServers } : {},
|
|
748
|
+
requireCredentialBrokering: true
|
|
749
|
+
})
|
|
750
|
+
},
|
|
751
|
+
codex: {
|
|
752
|
+
...LAYOUTS.codex,
|
|
753
|
+
pluginParts: ["skills", "mcp"],
|
|
754
|
+
pluginApps: "they need a ChatGPT login",
|
|
755
|
+
pluginManifestsFirst: ["plugin.json", ".codex-plugin/plugin.json"],
|
|
756
|
+
pluginRootManifestNeedsSchema: true,
|
|
757
|
+
pluginServersByName: true,
|
|
758
|
+
name: "Codex",
|
|
759
|
+
factory: "codex",
|
|
760
|
+
platforms: ["linux"],
|
|
761
|
+
reasoning: "whole",
|
|
762
|
+
reasoningTokens: true,
|
|
763
|
+
credential: "OPENAI_API_KEY",
|
|
764
|
+
endpoints: OPENAI_ENDPOINTS,
|
|
765
|
+
modelResponses: OPENAI_MODEL_ENDPOINTS,
|
|
766
|
+
expectedBlocked: {
|
|
767
|
+
hosts: [
|
|
768
|
+
"github.com",
|
|
769
|
+
"api.github.com",
|
|
770
|
+
"chatgpt.com"
|
|
771
|
+
],
|
|
772
|
+
why: "Codex's plugin sync, which it runs on every turn once plugins are on",
|
|
773
|
+
withPlugins: true
|
|
774
|
+
},
|
|
775
|
+
servedModel: openaiServedModel,
|
|
776
|
+
mcpServers: codexMcpServers,
|
|
777
|
+
adapter: async ({ auth, mcpServers, descriptor, plugins }) => (await import("./src-DB7N8TYJ.js")).createCodex({
|
|
778
|
+
auth,
|
|
779
|
+
...auth["AI_GATEWAY_API_KEY"] ? { provider: (await import("./src-DB7N8TYJ.js")).AI_GATEWAY_PROVIDER } : auth["OPENROUTER_API_KEY"] ? { provider: (await import("./src-DB7N8TYJ.js")).OPENROUTER_PROVIDER } : {},
|
|
780
|
+
...descriptor.kind === "codex" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
781
|
+
...mcpServers ? { mcpServers } : {},
|
|
782
|
+
...plugins.length ? { plugins: plugins.map(({ name, dir }) => ({
|
|
783
|
+
name,
|
|
784
|
+
dir
|
|
785
|
+
})) } : {},
|
|
786
|
+
requireCredentialBrokering: true
|
|
787
|
+
})
|
|
788
|
+
},
|
|
789
|
+
fx: {
|
|
790
|
+
...LAYOUTS.fx,
|
|
791
|
+
pluginParts: ["skills", "mcp"],
|
|
792
|
+
name: "fx",
|
|
793
|
+
factory: "fx",
|
|
794
|
+
platforms: ["linux"],
|
|
795
|
+
configuredModelOnStart: true,
|
|
796
|
+
reasoning: "streamed",
|
|
797
|
+
reasoningTokens: "provider",
|
|
798
|
+
...fxForModel("provider/model"),
|
|
799
|
+
forModel: fxForModel,
|
|
800
|
+
mcpServers: acpMcpServers,
|
|
801
|
+
adapter: async ({ auth, env, mcpServers, model, descriptor }) => (await import("./src-DPDaAYwh.js")).createFx({
|
|
802
|
+
auth,
|
|
803
|
+
model,
|
|
804
|
+
...auth["OPENROUTER_API_KEY"] ? { provider: "openrouter" } : {},
|
|
805
|
+
...env?.FX_VERTEX_PROJECT ? { vertex: {
|
|
806
|
+
project: env.FX_VERTEX_PROJECT,
|
|
807
|
+
location: env.FX_VERTEX_LOCATION ?? ""
|
|
808
|
+
} } : {},
|
|
809
|
+
...descriptor.kind === "fx" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
810
|
+
...mcpServers ? { mcpServers } : {},
|
|
811
|
+
requireCredentialBrokering: true
|
|
812
|
+
})
|
|
813
|
+
},
|
|
814
|
+
"grok-build": {
|
|
815
|
+
...LAYOUTS["grok-build"],
|
|
816
|
+
pluginParts: CLAUDE_FORMAT_PARTS,
|
|
817
|
+
pluginServersByName: true,
|
|
818
|
+
name: "Grok Build",
|
|
819
|
+
factory: "grokBuild",
|
|
820
|
+
platforms: ["linux"],
|
|
821
|
+
configuredModelOnStart: true,
|
|
822
|
+
reasoning: "streamed",
|
|
823
|
+
reasoningTokens: true,
|
|
824
|
+
credential: "XAI_API_KEY",
|
|
825
|
+
endpoints: XAI_ENDPOINTS,
|
|
826
|
+
modelResponses: XAI_MODEL_RESPONSES,
|
|
827
|
+
servedModel: xaiServedModel,
|
|
828
|
+
mcpServers: acpMcpServers,
|
|
829
|
+
adapter: async ({ auth, mcpServers, descriptor, plugins, model, vertexChat }) => {
|
|
830
|
+
const grok = await import("./src-Dbk19BiP.js");
|
|
831
|
+
return grok.createGrokBuild({
|
|
832
|
+
...vertexChat ? {
|
|
833
|
+
auth: { [grok.VERTEX_TOKEN_ENV]: SANDBOX_ACCESS_TOKEN },
|
|
834
|
+
provider: grok.vertexProvider(vertexChat.project, vertexChat.region)
|
|
835
|
+
} : {
|
|
836
|
+
auth,
|
|
837
|
+
...auth["AI_GATEWAY_API_KEY"] ? { provider: grok.AI_GATEWAY_PROVIDER } : auth["OPENROUTER_API_KEY"] ? { provider: grok.OPENROUTER_PROVIDER } : {}
|
|
838
|
+
},
|
|
839
|
+
model,
|
|
840
|
+
...plugins.length ? {
|
|
841
|
+
pluginDirs: plugins.map((p) => p.dir),
|
|
842
|
+
pluginMcpServers: plugins.flatMap((p) => p.servers.map((s) => s.slice(p.name.length + 1)))
|
|
843
|
+
} : {},
|
|
844
|
+
...descriptor.kind === "grok-build" && descriptor.effort ? { effort: descriptor.effort } : {},
|
|
845
|
+
...mcpServers ? { mcpServers } : {},
|
|
846
|
+
requireCredentialBrokering: true
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
};
|
|
851
|
+
/** The harness of a config that names none: Cursor, on Cursor's own model. */
|
|
852
|
+
const DEFAULT_HARNESS = {
|
|
853
|
+
kind: "cursor",
|
|
854
|
+
model: "composer-2.5"
|
|
855
|
+
};
|
|
856
|
+
/** A harness to name in messages that ask for one. */
|
|
857
|
+
const HARNESS_EXAMPLE = "cursor({ model: 'composer-2.5' })";
|
|
858
|
+
const isAgentKind = (kind) => typeof kind === "string" && Object.hasOwn(AGENTS, kind);
|
|
859
|
+
/**
|
|
860
|
+
* A server as the plan knows it: its names, literal values and each `secret.template`'s text. A
|
|
861
|
+
* host secret's value is read when the attempt starts, so the plan has it as `''`.
|
|
862
|
+
*/
|
|
863
|
+
function plannedMcpServer(s) {
|
|
864
|
+
const literal = (values) => Object.fromEntries(Object.entries(values).map(([k, v]) => [k, typeof v === "string" ? v : v.kind === "secret-template" ? v.template : ""]));
|
|
865
|
+
return s.transport === "stdio" ? {
|
|
866
|
+
transport: "stdio",
|
|
867
|
+
command: s.command,
|
|
868
|
+
args: s.args,
|
|
869
|
+
env: literal(s.env)
|
|
870
|
+
} : {
|
|
871
|
+
transport: s.transport,
|
|
872
|
+
url: s.url,
|
|
873
|
+
headers: literal(s.headers)
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* Why a sandbox kind that runs only some real harnesses so far doesn't run `harness`, so the plan
|
|
878
|
+
* refuses it before any attempt starts; undefined when it does.
|
|
879
|
+
*/
|
|
880
|
+
function unverifiedHarness(harness, sandbox) {
|
|
881
|
+
const capabilities = capabilitiesOf(sandbox);
|
|
882
|
+
if (!isAgentKind(harness.kind) || takesHarness(capabilities, harness.kind)) return;
|
|
883
|
+
const kind = sandboxKind(sandbox);
|
|
884
|
+
const names = (capabilities.harnesses === "all" ? [] : capabilities.harnesses).flatMap((k) => isAgentKind(k) ? [AGENTS[k].name] : []);
|
|
885
|
+
const elsewhere = suggestedSandbox((c) => c.harnessSession && takesHarness(c, harness.kind));
|
|
886
|
+
return `The ${AGENTS[harness.kind].name} harness doesn't run in the ${kind.provider(sandbox)} sandbox yet: it runs ${names.join(", ") || "no real harness"} so far. ${kind.unverifiedHarnesses ?? `Run it in ${elsewhere}.`}`;
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Why a harness's agent can't take the environment's MCP servers (Goose, OpenCode, pi and Codex
|
|
890
|
+
* take no `mcp.sse`; OpenCode would substitute a `{env:…}` or `{file:…}` in a name or value), in the
|
|
891
|
+
* agent's own words, so the plan refuses them before any attempt starts; undefined when it can.
|
|
892
|
+
*/
|
|
893
|
+
function refusedMcp(harness, layers) {
|
|
894
|
+
if (!isAgentKind(harness.kind)) return void 0;
|
|
895
|
+
const servers = /* @__PURE__ */ new Map();
|
|
896
|
+
for (const { spec } of layers) for (const [name, server] of Object.entries(spec.mcp ?? {})) servers.set(name, plannedMcpServer(server));
|
|
897
|
+
if (servers.size === 0) return void 0;
|
|
898
|
+
try {
|
|
899
|
+
AGENTS[harness.kind].mcpServers(Object.fromEntries(servers));
|
|
900
|
+
return;
|
|
901
|
+
} catch (error) {
|
|
902
|
+
if (error instanceof InfraError) return error.message;
|
|
903
|
+
throw error;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
/** The first host variable a plugin MCP server reads (`${VAR}`), as `VAR`; undefined for none. */
|
|
907
|
+
function hostVariable(s) {
|
|
908
|
+
const values = Object.entries(s.transport === "stdio" ? s.env : s.headers);
|
|
909
|
+
for (const [key, v] of values) {
|
|
910
|
+
if (typeof v === "string") continue;
|
|
911
|
+
if (v.kind === "secret") return v.from ?? key;
|
|
912
|
+
return /\$\{([A-Za-z_][A-Za-z0-9_]*)\}/.exec(v.template)?.[1] ?? key;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
const quoted = (parts) => parts.map((p) => `'${p}'`).join(", ");
|
|
916
|
+
/**
|
|
917
|
+
* Why a harness's agent can't take the plugins, in the agent's own words: a part it doesn't
|
|
918
|
+
* load, apps it can't take (`pluginApps`), a hook event or type it doesn't run, a plugin MCP
|
|
919
|
+
* server it refuses (named `<plugin>:<server>`) or whose `<plugin>:<server>` key `mcp` already has,
|
|
920
|
+
* or, where it takes plugin items flat, a skill or MCP server whose name another already has, or a
|
|
921
|
+
* subagent, command or rule another unpacks to the same file. `own` names the
|
|
922
|
+
* environment's own skills and MCP servers, and `unread` the plugins not fetched yet (git and
|
|
923
|
+
* npm ones, at plan time) by their call. Undefined when it can take them.
|
|
924
|
+
*/
|
|
925
|
+
function refusedPlugins(harness, plugins, own, unread = []) {
|
|
926
|
+
if (plugins.length === 0 && unread.length === 0) return void 0;
|
|
927
|
+
const agent = isAgentKind(harness.kind) ? AGENTS[harness.kind] : void 0;
|
|
928
|
+
const mimics = harness.kind === "fake" && harness.layout ? AGENTS[harness.layout] : void 0;
|
|
929
|
+
const loads = (agent ?? mimics)?.pluginParts ?? PLUGIN_PARTS;
|
|
930
|
+
const name = agent?.name ?? (mimics ? `The fake agent with ${mimics.name}'s layout` : "The fake agent");
|
|
931
|
+
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`;
|
|
932
|
+
for (const p of plugins) {
|
|
933
|
+
const refused = p.kept.filter((part) => !loads.includes(part));
|
|
934
|
+
if (refused.length === 0) continue;
|
|
935
|
+
const can = p.kept.filter((part) => loads.includes(part));
|
|
936
|
+
const what = refused.map((part) => `${part} (${PART_PATHS[part]})`).join(" and ");
|
|
937
|
+
const fix = can.length ? `use only: [${quoted(can)}], or leave` : "leave";
|
|
938
|
+
return `${name} can't load the ${p.name} plugin's ${what}: ${fix} the plugin out of this cell`;
|
|
939
|
+
}
|
|
940
|
+
const reads = agent ?? mimics;
|
|
941
|
+
const first = reads?.pluginManifestsFirst ?? [];
|
|
942
|
+
for (const p of plugins) {
|
|
943
|
+
const other = p.manifests.find((m) => first.includes(m) && (m !== "plugin.json" || !reads?.pluginRootManifestNeedsSchema || p.rootSchema));
|
|
944
|
+
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`;
|
|
945
|
+
}
|
|
946
|
+
const apps = (agent ?? mimics)?.pluginApps;
|
|
947
|
+
const withApps = apps ? plugins.find((p) => p.apps) : void 0;
|
|
948
|
+
if (withApps) return `${name} can't load the ${withApps.name} plugin's apps: ${apps}`;
|
|
949
|
+
const layout = layoutOf(harness);
|
|
950
|
+
const runs = layout.pluginHookEvents;
|
|
951
|
+
for (const p of runs ? plugins : []) {
|
|
952
|
+
const event = p.hooks.events.find((e) => !runs?.includes(e));
|
|
953
|
+
const type = p.hooks.otherTypes[0];
|
|
954
|
+
if (!event && !type) continue;
|
|
955
|
+
const rest = p.kept.filter((part) => part !== "hooks");
|
|
956
|
+
const fix = rest.length ? `use only: [${quoted(rest)}], or leave` : "leave";
|
|
957
|
+
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`;
|
|
958
|
+
}
|
|
959
|
+
const servers = Object.fromEntries(plugins.flatMap((p) => Object.entries(p.mcp).map(([server, s]) => [pluginServerName(p.name, server), plannedMcpServer(s)])));
|
|
960
|
+
if (agent && Object.keys(servers).length) {
|
|
961
|
+
const alongside = agent.pluginPlacement === "flat" ? Object.fromEntries(own.mcp.map((n) => [n, {
|
|
962
|
+
transport: "stdio",
|
|
963
|
+
command: "true",
|
|
964
|
+
args: [],
|
|
965
|
+
env: {}
|
|
966
|
+
}])) : {};
|
|
967
|
+
try {
|
|
968
|
+
agent.mcpServers({
|
|
969
|
+
...alongside,
|
|
970
|
+
...servers
|
|
971
|
+
});
|
|
972
|
+
} catch (error) {
|
|
973
|
+
if (error instanceof InfraError) return error.message;
|
|
974
|
+
throw error;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
for (const p of plugins) for (const server of Object.keys(p.mcp)) {
|
|
978
|
+
const key = pluginServerName(p.name, server);
|
|
979
|
+
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}"]`;
|
|
980
|
+
}
|
|
981
|
+
if (layout.pluginPlacement === "namespaced") {
|
|
982
|
+
for (const p of plugins) {
|
|
983
|
+
if (!p.kept.includes("mcp")) continue;
|
|
984
|
+
for (const [server, s] of Object.entries(p.mcp)) {
|
|
985
|
+
const secret = hostVariable(s);
|
|
986
|
+
if (!secret) continue;
|
|
987
|
+
const rest = p.kept.filter((part) => part !== "mcp");
|
|
988
|
+
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`;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
if (!(agent ?? mimics)?.pluginServersByName) return void 0;
|
|
992
|
+
const byName = new Map(own.mcp.map((n) => [n, `mcp.${n}`]));
|
|
993
|
+
for (const p of plugins) for (const server of Object.keys(p.mcp)) {
|
|
994
|
+
const other = byName.get(server);
|
|
995
|
+
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`;
|
|
996
|
+
byName.set(server, `the ${p.name} plugin's MCP server "${server}"`);
|
|
997
|
+
}
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
const serverOwner = new Map(own.mcp.map((n) => [n, `mcp.${n}`]));
|
|
1001
|
+
for (const p of plugins) for (const server of Object.keys(p.mcp)) {
|
|
1002
|
+
const other = serverOwner.get(server);
|
|
1003
|
+
if (other) return `the ${p.name} plugin's MCP server "${server}" clashes with ${other}`;
|
|
1004
|
+
serverOwner.set(server, `the ${p.name} plugin's MCP server "${server}"`);
|
|
1005
|
+
}
|
|
1006
|
+
const skillOwner = new Map(own.skills.map((s) => [s.name, `${s.call}'s "${s.name}"`]));
|
|
1007
|
+
for (const p of plugins) for (const { name: skill } of p.skills) {
|
|
1008
|
+
const other = skillOwner.get(skill);
|
|
1009
|
+
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`;
|
|
1010
|
+
skillOwner.set(skill, `the ${p.name} plugin's skill "${skill}"`);
|
|
1011
|
+
}
|
|
1012
|
+
for (const part of ["agents", "commands"]) {
|
|
1013
|
+
const dir = layout.pluginUnpack?.[part];
|
|
1014
|
+
if (!dir) continue;
|
|
1015
|
+
const owner = /* @__PURE__ */ new Map();
|
|
1016
|
+
for (const p of plugins) for (const item of p[part]) {
|
|
1017
|
+
const other = owner.get(item);
|
|
1018
|
+
const what = part === "agents" ? "subagent" : "command";
|
|
1019
|
+
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`;
|
|
1020
|
+
owner.set(item, p.name);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
const rules = layout.pluginUnpack?.rules;
|
|
1024
|
+
const ruleOwner = /* @__PURE__ */ new Map();
|
|
1025
|
+
for (const p of rules ? plugins : []) for (const rule of p.rules) {
|
|
1026
|
+
const file = `${p.name}-${rule.replace(/\.mdc?$/, "")}.mdc`;
|
|
1027
|
+
const what = `the ${p.name} plugin's rule "${rule}"`;
|
|
1028
|
+
const other = ruleOwner.get(file);
|
|
1029
|
+
if (other) return `${what} and ${other} would both be placed at ${rules}/${file}: rename one, or narrow one with only`;
|
|
1030
|
+
ruleOwner.set(file, what);
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* A real agent's catalog entry, with what its model's provider decides, or its gateway's route:
|
|
1035
|
+
* on Vertex, the attempt's `vertex()` settings decide the project and region.
|
|
1036
|
+
*/
|
|
1037
|
+
function agentFor(h, vertex) {
|
|
1038
|
+
const agent = AGENTS[h.kind];
|
|
1039
|
+
if (h.gateway === "vertex") {
|
|
1040
|
+
const route = VERTEX_ROUTES[h.kind];
|
|
1041
|
+
if (!route) throw new InfraError(`reeval doesn't run ${agent.name} on Vertex AI`);
|
|
1042
|
+
if (!vertex) throw new InfraError(`${agent.name} on Vertex AI has no vertex() settings`);
|
|
1043
|
+
return {
|
|
1044
|
+
...agent,
|
|
1045
|
+
...route(vertex)
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
if (isRoutingGateway(h.gateway)) {
|
|
1049
|
+
const gateway = ROUTING_GATEWAYS[h.gateway];
|
|
1050
|
+
const route = gateway.routes[h.kind];
|
|
1051
|
+
if (!route) throw new InfraError(`reeval doesn't run ${agent.name} on ${gateway.name}`);
|
|
1052
|
+
return {
|
|
1053
|
+
...agent,
|
|
1054
|
+
...route(process.env)
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
return agent.forModel ? {
|
|
1058
|
+
...agent,
|
|
1059
|
+
...agent.forModel(h.model)
|
|
1060
|
+
} : agent;
|
|
1061
|
+
}
|
|
1062
|
+
/** The catalog entry for a harness's agent; undefined for the fake harness. */
|
|
1063
|
+
const agentOf = (h, vertex) => h.kind === "fake" ? void 0 : agentFor(h, vertex);
|
|
1064
|
+
/**
|
|
1065
|
+
* The host variable a harness authenticates with; undefined for the fake harness, and on Vertex,
|
|
1066
|
+
* whose token comes from Application Default Credentials.
|
|
1067
|
+
*/
|
|
1068
|
+
const credentialOf = (h) => h.kind === "fake" || h.gateway === "vertex" ? void 0 : agentFor(h).credential;
|
|
1069
|
+
/** The fake agent's own layout. */
|
|
1070
|
+
const FAKE_LAYOUT = {
|
|
1071
|
+
rulesFile: "AGENTS.md",
|
|
1072
|
+
workspaceSkillDir: ".agents/skills",
|
|
1073
|
+
harnessSkillDir: ".agents/skills",
|
|
1074
|
+
pluginPlacement: "flat"
|
|
1075
|
+
};
|
|
1076
|
+
/** Where a harness's agent reads rules and skills; a fake one with `layout` mimics that agent. */
|
|
1077
|
+
function layoutOf(descriptor) {
|
|
1078
|
+
if (descriptor.kind !== "fake") return LAYOUTS[descriptor.kind];
|
|
1079
|
+
return descriptor.layout ? LAYOUTS[descriptor.layout] : FAKE_LAYOUT;
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* The hosts a harness's agent is known to try in a session with or without plugins; a fake agent
|
|
1083
|
+
* with `layout` expects that agent's. On Vertex, the attempt's `vertex()` settings pick the route.
|
|
1084
|
+
*/
|
|
1085
|
+
function expectedBlockedFor(descriptor, plugins, vertex) {
|
|
1086
|
+
const expected = descriptor.kind !== "fake" ? agentFor(descriptor, vertex).expectedBlocked : descriptor.layout ? AGENTS[descriptor.layout].expectedBlocked : void 0;
|
|
1087
|
+
return expected?.withPlugins && !plugins ? void 0 : expected;
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* How the APIs behind the harnesses say they refused a key: an HTTP 401, Anthropic's and OpenAI's
|
|
1091
|
+
* 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
|
|
1092
|
+
* those for reasons that have nothing to do with the harness's key. Grok Build checks its key as
|
|
1093
|
+
* it starts and, when xAI refuses it (a 400 or 401, not an outage), offers no `xai.api_key`
|
|
1094
|
+
* sign-in, which is all `@ai-sdk/harness-acp` reports.
|
|
1095
|
+
*/
|
|
1096
|
+
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;
|
|
1097
|
+
/**
|
|
1098
|
+
* What to do when the harness's API refused its key, naming the variable; else undefined. The
|
|
1099
|
+
* error's wording says so for some CLIs; `refused` is the egress record's word for every one: a
|
|
1100
|
+
* brokered request the API answered with 401, whatever the CLI made of it.
|
|
1101
|
+
*/
|
|
1102
|
+
function authHint(agent, message, refused = false) {
|
|
1103
|
+
if (!refused && !REFUSED_KEY.test(message)) return void 0;
|
|
1104
|
+
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`;
|
|
1105
|
+
return keyRejected(agent.credential);
|
|
1106
|
+
}
|
|
1107
|
+
/** What to do when the API refused the key in `credential`, naming it. */
|
|
1108
|
+
const keyRejected = (credential) => `The API rejected ${credential}: set a valid key in the environment or .env.local`;
|
|
1109
|
+
/**
|
|
1110
|
+
* The agent's credential from the host, as the adapter's explicit `auth`. Fails closed. Empty for
|
|
1111
|
+
* a brokered token, which the adapter never sees.
|
|
1112
|
+
*/
|
|
1113
|
+
function agentAuth(agent, env = process.env) {
|
|
1114
|
+
if (agent.token) return {};
|
|
1115
|
+
const value = env[agent.credential];
|
|
1116
|
+
if (!value) throw new InfraError(`${agent.credential} isn't set, so the ${agent.name} harness can't authenticate. Set it in the environment or .env.local.`);
|
|
1117
|
+
return {
|
|
1118
|
+
...agent.authEnv,
|
|
1119
|
+
[agent.authAs ?? agent.credential]: value
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
function brokeringFor(h, vertex) {
|
|
1123
|
+
if (h.kind === "fake") {
|
|
1124
|
+
if (!h.brokers) return void 0;
|
|
1125
|
+
const { credential, endpoints } = AGENTS[h.layout ?? "cursor"];
|
|
1126
|
+
return {
|
|
1127
|
+
credential,
|
|
1128
|
+
endpoints
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
const agent = agentOf(h, vertex);
|
|
1132
|
+
if (!agent) return void 0;
|
|
1133
|
+
const { credential, endpoints, tokens, servedModel, askedModel, modelResponses, upstream } = agent;
|
|
1134
|
+
const { localResponses } = agent;
|
|
1135
|
+
return {
|
|
1136
|
+
credential,
|
|
1137
|
+
endpoints,
|
|
1138
|
+
...tokens ? { tokens: {
|
|
1139
|
+
name: credential,
|
|
1140
|
+
...tokens
|
|
1141
|
+
} } : {},
|
|
1142
|
+
...servedModel ? { servedModel } : {},
|
|
1143
|
+
...askedModel ? { askedModel } : {},
|
|
1144
|
+
...modelResponses ? { modelResponses } : {},
|
|
1145
|
+
...upstream ? { upstream } : {},
|
|
1146
|
+
...localResponses?.length ? { localResponses } : {}
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
export { unverifiedHarness as _, agentFor as a, isRoutingGateway as b, brokeringFor as c, expectedBlockedFor as d, isAgentKind as f, refusedPlugins as g, refusedMcp as h, agentAuth as i, claudeMcpServers as l, layoutOf as m, DEFAULT_HARNESS as n, agentMcp as o, keyRejected as p, HARNESS_EXAMPLE as r, authHint as s, AGENTS as t, credentialOf as u, writePluginFiles as v, ROUTING_GATEWAYS as y };
|
|
1150
|
+
|
|
1151
|
+
//# sourceMappingURL=agents-C6zhkxp3.js.map
|