reeval 0.18.0 → 0.20.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.
Files changed (380) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +5 -5
  3. package/dist/{adapter-CptK032x.js → adapter-C60z3wLq.js} +5 -4
  4. package/dist/adapter-C60z3wLq.js.map +1 -0
  5. package/dist/{agent-B63OzUX9.js → agent-BmsMXZXx.js} +30 -10
  6. package/dist/{agent-B63OzUX9.js.map → agent-BmsMXZXx.js.map} +1 -1
  7. package/dist/agents-DXuFxtGC.js +1151 -0
  8. package/dist/agents-DXuFxtGC.js.map +1 -0
  9. package/dist/{app-files-sgqwfjtn.js → app-files-DT5mJyV4.js} +3 -3
  10. package/dist/app-files-DT5mJyV4.js.map +1 -0
  11. package/dist/assemble-CE4pHKIa.js +1 -0
  12. package/dist/{assemble-Me7Whp-y.js → assemble-DM2PNU4R.js} +152 -129
  13. package/dist/assemble-DM2PNU4R.js.map +1 -0
  14. package/dist/{attempt-Dp7Wtm8M.js → attempt-CAdlwlNu.js} +2 -2
  15. package/dist/{attempt-Dp7Wtm8M.js.map → attempt-CAdlwlNu.js.map} +1 -1
  16. package/dist/{attempt-host-Cik0SoIn.js → attempt-host-7VviAJrl.js} +6 -6
  17. package/dist/{attempt-host-Cik0SoIn.js.map → attempt-host-7VviAJrl.js.map} +1 -1
  18. package/dist/boat-BjLqFJIZ.js +108 -0
  19. package/dist/boat-BjLqFJIZ.js.map +1 -0
  20. package/dist/boat-DSNgZt-t.js +322 -0
  21. package/dist/boat-DSNgZt-t.js.map +1 -0
  22. package/dist/bridge/index.mjs +401 -79
  23. package/dist/capture-BzotD2hs.js +1 -0
  24. package/dist/{capture-C3RmjPph.js → capture-Ccf0Hmyx.js} +27 -25
  25. package/dist/capture-Ccf0Hmyx.js.map +1 -0
  26. package/dist/cases-Dy0mifal.js +1 -0
  27. package/dist/cases-z9E6DCd5.js +639 -0
  28. package/dist/cases-z9E6DCd5.js.map +1 -0
  29. package/dist/{cli-BBOlXKPG.js → cli-DTuLSlmW.js} +442 -707
  30. package/dist/cli-DTuLSlmW.js.map +1 -0
  31. package/dist/{cli-spec-DZ0bnP0_.js → cli-spec-Dsr79Qy1.js} +38 -11
  32. package/dist/cli-spec-Dsr79Qy1.js.map +1 -0
  33. package/dist/cli.js +2 -2
  34. package/dist/{client-tZ2WBDxf.js → client-KM4C5r5_.js} +93 -3
  35. package/dist/client-KM4C5r5_.js.map +1 -0
  36. package/dist/{command-DhiwsZl1.js → command-C2C7P5qo.js} +9 -9
  37. package/dist/{command-DhiwsZl1.js.map → command-C2C7P5qo.js.map} +1 -1
  38. package/dist/{command-CFQ9c1hk.js → command-D8oMB2fa.js} +16 -16
  39. package/dist/command-D8oMB2fa.js.map +1 -0
  40. package/dist/{command-fO0BFsTq.js → command-DSL7I-SI.js} +37 -37
  41. package/dist/command-DSL7I-SI.js.map +1 -0
  42. package/dist/{command-qGS802uX.js → command-Ff0T-1Hi.js} +21 -80
  43. package/dist/command-Ff0T-1Hi.js.map +1 -0
  44. package/dist/{commands-xYTMNTPv.js → commands-Bk9NG1s_.js} +1 -1
  45. package/dist/{commands-CC60TOT5.js → commands-xAOi_VEk.js} +186 -85
  46. package/dist/commands-xAOi_VEk.js.map +1 -0
  47. package/dist/{config-C2UtS9vy.js → config-SvK8pjEK.js} +261 -1708
  48. package/dist/config-SvK8pjEK.js.map +1 -0
  49. package/dist/{context-BajfiH0S.js → context-BdgCao9Q.js} +3 -2
  50. package/dist/context-BdgCao9Q.js.map +1 -0
  51. package/dist/{cost-BuVDamui.js → cost-BdRgySQl.js} +2 -2
  52. package/dist/{cost-BuVDamui.js.map → cost-BdRgySQl.js.map} +1 -1
  53. package/dist/cost-Cr26Alhq.js +1 -0
  54. package/dist/{cursor-catalog-BTK_apL-.js → cursor-catalog-DEzan4IT.js} +3 -3
  55. package/dist/{cursor-catalog-BTK_apL-.js.map → cursor-catalog-DEzan4IT.js.map} +1 -1
  56. package/dist/{db-C5SZ0510.js → db-BzOJ4Js4.js} +130 -84
  57. package/dist/db-BzOJ4Js4.js.map +1 -0
  58. package/dist/db-CQRZ3URX.js +2 -0
  59. package/dist/debug-CF4p4Lp_.js +1 -0
  60. package/dist/{debug-B5jDImcW.js → debug-CIXzB4wK.js} +2 -2
  61. package/dist/{debug-B5jDImcW.js.map → debug-CIXzB4wK.js.map} +1 -1
  62. package/dist/{default-effort-FEidNAIi.js → default-effort-BBDPbJ4D.js} +1 -1
  63. package/dist/{default-effort-BVmx7r7L.js → default-effort-BDKIxJyC.js} +4 -4
  64. package/dist/{default-effort-BVmx7r7L.js.map → default-effort-BDKIxJyC.js.map} +1 -1
  65. package/dist/{dist-ByYk_wAs.js → dist-Db7ifchA.js} +37 -8
  66. package/dist/dist-Db7ifchA.js.map +1 -0
  67. package/dist/{docker-BlSopHpZ.js → docker--mukta3L.js} +1 -1
  68. package/dist/{docker-B2F8-PGC.js → docker-DFrjoNs-.js} +3 -3
  69. package/dist/{docker-B2F8-PGC.js.map → docker-DFrjoNs-.js.map} +1 -1
  70. package/dist/{docker-Dto8ROCq.js → docker-DG_uFgn2.js} +109 -77
  71. package/dist/docker-DG_uFgn2.js.map +1 -0
  72. package/dist/{doctor-BcvfKpBX.js → doctor-DWK4ttex.js} +84 -27
  73. package/dist/doctor-DWK4ttex.js.map +1 -0
  74. package/dist/{environment-CC1RV21n.js → environment-cPMCOk-h.js} +79 -39
  75. package/dist/environment-cPMCOk-h.js.map +1 -0
  76. package/dist/{errors-BQV__TzH.js → errors-BZgLSZtV.js} +2 -2
  77. package/dist/{errors-BQV__TzH.js.map → errors-BZgLSZtV.js.map} +1 -1
  78. package/dist/{eval-source-CzxdgFBW.js → eval-source-C9b1h8L6.js} +10 -10
  79. package/dist/{eval-source-CzxdgFBW.js.map → eval-source-C9b1h8L6.js.map} +1 -1
  80. package/dist/{evaluate-NTNJ8T9H.js → evaluate-B12Tosvq.js} +377 -142
  81. package/dist/evaluate-B12Tosvq.js.map +1 -0
  82. package/dist/{evaluate-DToSB2bt.d.ts → evaluate-COdzf7Hl.d.ts} +17 -26
  83. package/dist/{files-aAzoGNCB.js → files-BOBdC0uI.js} +5 -5
  84. package/dist/{files-aAzoGNCB.js.map → files-BOBdC0uI.js.map} +1 -1
  85. package/dist/files-C1Rk9FYA.js +1 -0
  86. package/dist/files-DMQ9-Vv5.js +1 -0
  87. package/dist/{files-BGlHnC46.js → files-DgXyaAg6.js} +2 -2
  88. package/dist/{files-BGlHnC46.js.map → files-DgXyaAg6.js.map} +1 -1
  89. package/dist/files-Di0xDbCc.js +1 -0
  90. package/dist/{files-p-uTdOjA.js → files-DlQshsks.js} +3 -2
  91. package/dist/files-DlQshsks.js.map +1 -0
  92. package/dist/{files-DsXULUi5.js → files-F5EG0WPT.js} +5 -5
  93. package/dist/{files-DsXULUi5.js.map → files-F5EG0WPT.js.map} +1 -1
  94. package/dist/files-G5jf8wBp.js +1 -0
  95. package/dist/{files-CZXrkPja.js → files-s28a6czq.js} +54 -13
  96. package/dist/{files-CZXrkPja.js.map → files-s28a6czq.js.map} +1 -1
  97. package/dist/files-tiNWe8Ih.js +64 -0
  98. package/dist/files-tiNWe8Ih.js.map +1 -0
  99. package/dist/gate-CgYdaprG.js +49 -0
  100. package/dist/gate-CgYdaprG.js.map +1 -0
  101. package/dist/gateway.d.ts +1 -1
  102. package/dist/{git-C1MB5bjr.js → git-BpoqEgDV.js} +2 -2
  103. package/dist/{git-C1MB5bjr.js.map → git-BpoqEgDV.js.map} +1 -1
  104. package/dist/{harness-DGsRZDSo.js → harness-C2berMiM.js} +3 -3
  105. package/dist/{harness-DGsRZDSo.js.map → harness-C2berMiM.js.map} +1 -1
  106. package/dist/{harness-DYSC4zMh.js → harness-DXv2gnaT.js} +4 -2
  107. package/dist/harness-DXv2gnaT.js.map +1 -0
  108. package/dist/harness.d.ts +1 -1
  109. package/dist/harness.js +1 -1
  110. package/dist/{ids-DuK6xl4w.js → ids-C_advdJA.js} +3 -8
  111. package/dist/ids-C_advdJA.js.map +1 -0
  112. package/dist/{images-CNayXCp2.js → images-D2jFze2v.js} +98 -10
  113. package/dist/images-D2jFze2v.js.map +1 -0
  114. package/dist/index.d.ts +23 -3
  115. package/dist/index.js +5 -5
  116. package/dist/{init-D5HtmyMI.js → init-Bi1Q3lRi.js} +7 -6
  117. package/dist/init-Bi1Q3lRi.js.map +1 -0
  118. package/dist/init-CUw65o36.js +1 -0
  119. package/dist/{ink-list-Ca-5dunO.js → ink-list-BpfidQ1h.js} +121 -31
  120. package/dist/ink-list-BpfidQ1h.js.map +1 -0
  121. package/dist/{invocations-DrGXF9dT.js → invocations-CxGNOlh0.js} +3 -3
  122. package/dist/{invocations-DrGXF9dT.js.map → invocations-CxGNOlh0.js.map} +1 -1
  123. package/dist/judge-COMXT1Hx.js +230 -0
  124. package/dist/judge-COMXT1Hx.js.map +1 -0
  125. package/dist/judge.d.ts +1 -1
  126. package/dist/judge.js +1 -1
  127. package/dist/{judgments-m-mb0zv8.js → judgments-CzgpsTqv.js} +2 -2
  128. package/dist/{judgments-m-mb0zv8.js.map → judgments-CzgpsTqv.js.map} +1 -1
  129. package/dist/kinds-Bh2I35id.js +698 -0
  130. package/dist/kinds-Bh2I35id.js.map +1 -0
  131. package/dist/{summary-Uzc9osfV.js → layout-Cm85tQYk.js} +39 -150
  132. package/dist/layout-Cm85tQYk.js.map +1 -0
  133. package/dist/list-DuThsE28.js +1348 -0
  134. package/dist/list-DuThsE28.js.map +1 -0
  135. package/dist/{live-B71o2TkX.js → live-CgYbO4Te.js} +6 -4
  136. package/dist/{live-B71o2TkX.js.map → live-CgYbO4Te.js.map} +1 -1
  137. package/dist/{live-uRURFDMZ.js → live-DL0se4Zd.js} +7 -7
  138. package/dist/{live-uRURFDMZ.js.map → live-DL0se4Zd.js.map} +1 -1
  139. package/dist/live-DZLmj0iG.js +1 -0
  140. package/dist/{matchers-Cs8aDqdU.js → matchers-CXLn-1jm.js} +3 -2
  141. package/dist/{matchers-Cs8aDqdU.js.map → matchers-CXLn-1jm.js.map} +1 -1
  142. package/dist/{model-CXVVB4RK.js → model-CkNVAxob.js} +1 -1
  143. package/dist/model-Cv4GuTsZ.js +1 -0
  144. package/dist/{model-1L19Zukh.js → model-CwwkrCb7.js} +5 -5
  145. package/dist/{model-1L19Zukh.js.map → model-CwwkrCb7.js.map} +1 -1
  146. package/dist/{model-Ce9l9_rF.js → model-V3mMXp6x.js} +203 -313
  147. package/dist/model-V3mMXp6x.js.map +1 -0
  148. package/dist/{model-BxBWFOZn.js → model-cgt5uvu8.js} +5 -5
  149. package/dist/{model-BxBWFOZn.js.map → model-cgt5uvu8.js.map} +1 -1
  150. package/dist/{node-DhIRSrrK.js → node-D7pAU--0.js} +14 -10
  151. package/dist/node-D7pAU--0.js.map +1 -0
  152. package/dist/{opencode-providers-Co7plCea.js → opencode-providers-BGiXt8_B.js} +104 -35
  153. package/dist/opencode-providers-BGiXt8_B.js.map +1 -0
  154. package/dist/{openrouter-models-DNvLRYM7.js → openrouter-models-Cw1z8-sq.js} +2 -2
  155. package/dist/{openrouter-models-DNvLRYM7.js.map → openrouter-models-Cw1z8-sq.js.map} +1 -1
  156. package/dist/options-DPUmk7v_.js +1 -0
  157. package/dist/{gate-Cp_pQoEe.js → pairs-BGb134Vu.js} +2 -48
  158. package/dist/pairs-BGb134Vu.js.map +1 -0
  159. package/dist/{patch-ug5HpMOj.js → patch-DAi1nCuH.js} +2 -2
  160. package/dist/{patch-ug5HpMOj.js.map → patch-DAi1nCuH.js.map} +1 -1
  161. package/dist/plain-BYUf_fUV.js +267 -0
  162. package/dist/plain-BYUf_fUV.js.map +1 -0
  163. package/dist/{plan-DqnzfDH1.js → plan-CsPilzpk.js} +110 -39
  164. package/dist/plan-CsPilzpk.js.map +1 -0
  165. package/dist/{plugins-B2KQ0y3P.js → plugins-BfnhazOv.js} +10 -267
  166. package/dist/plugins-BfnhazOv.js.map +1 -0
  167. package/dist/{preflight-DyzmvK7i.js → preflight-BixaE4BA.js} +16 -9
  168. package/dist/preflight-BixaE4BA.js.map +1 -0
  169. package/dist/preflight-Bn3ianye.js +1 -0
  170. package/dist/{preflight-DVXEvzFU.js → preflight-D1C-iH0U.js} +1 -1
  171. package/dist/preflight-GkpgrBxP.js +68 -0
  172. package/dist/preflight-GkpgrBxP.js.map +1 -0
  173. package/dist/{prepare-BcSRa7-3.js → prepare-C--rM_wO.js} +2 -2
  174. package/dist/{prepare-21WMQZyt.js → prepare-DQEDXoDp.js} +9 -9
  175. package/dist/{prepare-21WMQZyt.js.map → prepare-DQEDXoDp.js.map} +1 -1
  176. package/dist/{prices-DYJA0tJN.js → prices-5m3SzMZ3.js} +2 -2
  177. package/dist/{prices-DYJA0tJN.js.map → prices-5m3SzMZ3.js.map} +1 -1
  178. package/dist/{provenance-iRxjp4Pu.js → provenance-BXyYwUC8.js} +4 -3
  179. package/dist/provenance-BXyYwUC8.js.map +1 -0
  180. package/dist/provider-BnUoz4KB.js +1 -0
  181. package/dist/{provider-DZd8t_XW.js → provider-BxzZq3Th.js} +2 -2
  182. package/dist/{provider-DZd8t_XW.js.map → provider-BxzZq3Th.js.map} +1 -1
  183. package/dist/{providers-vXMXuwn-.js → providers-1p4HKYIp.js} +152 -9
  184. package/dist/providers-1p4HKYIp.js.map +1 -0
  185. package/dist/providers-B-ijCktf.js +1 -0
  186. package/dist/query-BYhyf0LR.js +1 -0
  187. package/dist/{query-BhaKQ07P.js → query-DhhU9ADI.js} +2 -2
  188. package/dist/{query-BhaKQ07P.js.map → query-DhhU9ADI.js.map} +1 -1
  189. package/dist/{questions-BzdLdV3C.js → questions-CMAq4pr8.js} +9 -9
  190. package/dist/{questions-BzdLdV3C.js.map → questions-CMAq4pr8.js.map} +1 -1
  191. package/dist/{record-DhzwkSXc.js → record-6IUzwP9K.js} +5 -3
  192. package/dist/record-6IUzwP9K.js.map +1 -0
  193. package/dist/{remarks-CauU408t.js → remarks-BNABzemt.js} +115 -35
  194. package/dist/remarks-BNABzemt.js.map +1 -0
  195. package/dist/{remarks-NMgPd30U.js → remarks-DPCONFxZ.js} +71 -50
  196. package/dist/remarks-DPCONFxZ.js.map +1 -0
  197. package/dist/{remote-Dwy3fyo3.js → remote-U7fNt0UP.js} +6 -6
  198. package/dist/{remote-Dwy3fyo3.js.map → remote-U7fNt0UP.js.map} +1 -1
  199. package/dist/resolve-C14Pmtej.js +1 -0
  200. package/dist/{resolve-B1zMnPwK.js → resolve-Cx3a9UQ2.js} +10 -9
  201. package/dist/resolve-Cx3a9UQ2.js.map +1 -0
  202. package/dist/{results-CfC0id_u.js → results-CQKXmHym.js} +6 -6
  203. package/dist/{results-CfC0id_u.js.map → results-CQKXmHym.js.map} +1 -1
  204. package/dist/{resume-Dkhrpjow.js → resume-POpZa1ge.js} +169 -27
  205. package/dist/resume-POpZa1ge.js.map +1 -0
  206. package/dist/retry-CmG809Mp.js +105 -0
  207. package/dist/retry-CmG809Mp.js.map +1 -0
  208. package/dist/{runtime-DcvQcr36.js → runtime-Xm9oeC7o.js} +26 -7
  209. package/dist/runtime-Xm9oeC7o.js.map +1 -0
  210. package/dist/sandbox/boat.d.ts +26 -0
  211. package/dist/sandbox/boat.js +37 -0
  212. package/dist/sandbox/boat.js.map +1 -0
  213. package/dist/{sandbox-8zCrtuCf.js → sandbox-DrlL4yqb.js} +31 -3
  214. package/dist/sandbox-DrlL4yqb.js.map +1 -0
  215. package/dist/sandbox.d.ts +20 -2
  216. package/dist/sandbox.js +1 -1
  217. package/dist/{server-Dplq8g0r.js → server-C00zd6zl.js} +9 -9
  218. package/dist/{server-Dplq8g0r.js.map → server-C00zd6zl.js.map} +1 -1
  219. package/dist/server-C1UJcpUh.js +1 -0
  220. package/dist/{shared-ogqPJ0uo.js → shared-Cfi45Bvy.js} +9 -2
  221. package/dist/shared-Cfi45Bvy.js.map +1 -0
  222. package/dist/slug-IHh3f770.js +136 -0
  223. package/dist/slug-IHh3f770.js.map +1 -0
  224. package/dist/{source-NWHqn5-o.js → source-DDgr48Gn.js} +2 -2
  225. package/dist/{source-NWHqn5-o.js.map → source-DDgr48Gn.js.map} +1 -1
  226. package/dist/source-DJHmQv_j.js +1 -0
  227. package/dist/src-1dBuXzs4.js +3 -0
  228. package/dist/{src-CUpoVVb8.js → src-BKpioayC.js} +2 -2
  229. package/dist/{src-B-L8O1Ld.js → src-BNQznj4z.js} +2 -2
  230. package/dist/{src-B-L8O1Ld.js.map → src-BNQznj4z.js.map} +1 -1
  231. package/dist/src-BY1cCaoJ.js +2 -0
  232. package/dist/src-BbZYaQ8b.js +2 -0
  233. package/dist/src-CDFH2vVN.js +2 -0
  234. package/dist/src-CMW5R9Q0.js +1 -0
  235. package/dist/{src-BQXdf-Gw.js → src-CV_7DkPa.js} +47 -45
  236. package/dist/{src-BQXdf-Gw.js.map → src-CV_7DkPa.js.map} +1 -1
  237. package/dist/{src-KlDOGD0B.js → src-Cb2MWozp.js} +3 -1
  238. package/dist/{src-KlDOGD0B.js.map → src-Cb2MWozp.js.map} +1 -1
  239. package/dist/{src-B9oE_mNS.js → src-CrV2WA2i.js} +2 -2
  240. package/dist/src-CsFaawcZ.js +2 -0
  241. package/dist/{src-HTG2SoNz.js → src-DAzaCTcN.js} +2 -2
  242. package/dist/{src-HTG2SoNz.js.map → src-DAzaCTcN.js.map} +1 -1
  243. package/dist/{src-uluei5nU.js → src-DvGns8cz.js} +2 -2
  244. package/dist/{src-uluei5nU.js.map → src-DvGns8cz.js.map} +1 -1
  245. package/dist/{src-B_igzM1O.js → src-Dw79VLa3.js} +3 -1
  246. package/dist/{src-B_igzM1O.js.map → src-Dw79VLa3.js.map} +1 -1
  247. package/dist/{src-D5t4OiRt.js → src-KxS91P7L.js} +3 -1
  248. package/dist/{src-D5t4OiRt.js.map → src-KxS91P7L.js.map} +1 -1
  249. package/dist/{src-BvM0jWuZ.js → src-YvblOrBU.js} +2 -2
  250. package/dist/{src-BvM0jWuZ.js.map → src-YvblOrBU.js.map} +1 -1
  251. package/dist/src-wKwznPgt.js +2 -0
  252. package/dist/{src-BQ6BiXoc.js → src-y0nOeRRE.js} +610 -72
  253. package/dist/src-y0nOeRRE.js.map +1 -0
  254. package/dist/{state-DDCGUhva.js → state-328JpnHA.js} +17 -17
  255. package/dist/{state-DDCGUhva.js.map → state-328JpnHA.js.map} +1 -1
  256. package/dist/state-Ca55Gk_O.js +1 -0
  257. package/dist/suite-CKBa6MKt.js +2 -0
  258. package/dist/{suite-M8_7xio7.js → suite-COglUhPd.js} +70 -92
  259. package/dist/suite-COglUhPd.js.map +1 -0
  260. package/dist/summary-DDy9DfyJ.js +148 -0
  261. package/dist/summary-DDy9DfyJ.js.map +1 -0
  262. package/dist/tart-cli-C-GsbVsQ.js +1 -0
  263. package/dist/tart-cli-CU0nFS-L.js +55 -0
  264. package/dist/tart-cli-CU0nFS-L.js.map +1 -0
  265. package/dist/tart-dWoJvWHc.js +586 -0
  266. package/dist/tart-dWoJvWHc.js.map +1 -0
  267. package/dist/tart-images-DZ_Mbh-g.js +233 -0
  268. package/dist/tart-images-DZ_Mbh-g.js.map +1 -0
  269. package/dist/tart-ref-7Qv3cm3B.js +1 -0
  270. package/dist/tart-ref-DYZijjrU.js +55 -0
  271. package/dist/tart-ref-DYZijjrU.js.map +1 -0
  272. package/dist/testing.d.ts +2 -2
  273. package/dist/testing.js +4 -4
  274. package/dist/trace-Dx2NBE1O.js +311 -0
  275. package/dist/trace-Dx2NBE1O.js.map +1 -0
  276. package/dist/traits-DKnYkqeK.js +66 -0
  277. package/dist/traits-DKnYkqeK.js.map +1 -0
  278. package/dist/{transcript-Cg4SeqRX.js → transcript-CCf07UmU.js} +2 -2
  279. package/dist/{transcript-Cg4SeqRX.js.map → transcript-CCf07UmU.js.map} +1 -1
  280. package/dist/{types-C4OkYhZg.js → types-C2mLpph3.js} +3 -2
  281. package/dist/types-C2mLpph3.js.map +1 -0
  282. package/dist/{types-DGvexkcp.d.ts → types-DBwFsGem.d.ts} +352 -76
  283. package/dist/{judge-DYOF69Oe.js → vercel-CGlSBv63.js} +3 -229
  284. package/dist/vercel-CGlSBv63.js.map +1 -0
  285. package/dist/{vertex-BLQMayc1.js → vertex-Eb2wqahk.js} +2 -2
  286. package/dist/{vertex-BLQMayc1.js.map → vertex-Eb2wqahk.js.map} +1 -1
  287. package/dist/vertex-O88TCwgY.js +1 -0
  288. package/dist/view/index.d.ts +101 -58
  289. package/dist/view/index.js +9 -8
  290. package/dist/views-B0Yt_Q1S.js +2 -0
  291. package/dist/{views-BISrsIjw.js → views-BROacjBv.js} +7 -6
  292. package/dist/views-BROacjBv.js.map +1 -0
  293. package/dist/{worker-entry-DJD_nHkS.js → worker-entry-Smb4bNDc.js} +11 -8
  294. package/dist/{worker-entry-DJD_nHkS.js.map → worker-entry-Smb4bNDc.js.map} +1 -1
  295. package/dist/workspace-C0dDP75l.js +1 -0
  296. package/dist/{workspace-BO1VhUR9.js → workspace-DNDTEk8v.js} +6 -6
  297. package/dist/{workspace-BO1VhUR9.js.map → workspace-DNDTEk8v.js.map} +1 -1
  298. package/package.json +24 -11
  299. package/skills/eval-rubric/SKILL.md +15 -7
  300. package/dist/adapter-CptK032x.js.map +0 -1
  301. package/dist/app-files-sgqwfjtn.js.map +0 -1
  302. package/dist/assemble-CxBHkavM.js +0 -1
  303. package/dist/assemble-Me7Whp-y.js.map +0 -1
  304. package/dist/capture-C3RmjPph.js.map +0 -1
  305. package/dist/capture-YPwxp_iK.js +0 -1
  306. package/dist/cli-BBOlXKPG.js.map +0 -1
  307. package/dist/cli-spec-DZ0bnP0_.js.map +0 -1
  308. package/dist/client-tZ2WBDxf.js.map +0 -1
  309. package/dist/command-CFQ9c1hk.js.map +0 -1
  310. package/dist/command-fO0BFsTq.js.map +0 -1
  311. package/dist/command-qGS802uX.js.map +0 -1
  312. package/dist/commands-CC60TOT5.js.map +0 -1
  313. package/dist/config-C2UtS9vy.js.map +0 -1
  314. package/dist/context-BajfiH0S.js.map +0 -1
  315. package/dist/contrasts-BjOg7wyr.js +0 -101
  316. package/dist/contrasts-BjOg7wyr.js.map +0 -1
  317. package/dist/cost-BJU0MAji.js +0 -1
  318. package/dist/db-C5SZ0510.js.map +0 -1
  319. package/dist/db-puzLzX4k.js +0 -2
  320. package/dist/debug-BnXV7JbX.js +0 -1
  321. package/dist/dist-ByYk_wAs.js.map +0 -1
  322. package/dist/docker-Dto8ROCq.js.map +0 -1
  323. package/dist/doctor-BcvfKpBX.js.map +0 -1
  324. package/dist/environment-CC1RV21n.js.map +0 -1
  325. package/dist/evaluate-NTNJ8T9H.js.map +0 -1
  326. package/dist/files-COW5JBJM.js +0 -1
  327. package/dist/files-DFtuRQJx.js +0 -1
  328. package/dist/files-oOYNR7ZH.js +0 -1
  329. package/dist/files-p-uTdOjA.js.map +0 -1
  330. package/dist/gate-Cp_pQoEe.js.map +0 -1
  331. package/dist/harness-DYSC4zMh.js.map +0 -1
  332. package/dist/ids-DuK6xl4w.js.map +0 -1
  333. package/dist/images-CNayXCp2.js.map +0 -1
  334. package/dist/init-8o6W3_fn.js +0 -1
  335. package/dist/init-D5HtmyMI.js.map +0 -1
  336. package/dist/ink-list-Ca-5dunO.js.map +0 -1
  337. package/dist/judge-DYOF69Oe.js.map +0 -1
  338. package/dist/list-CM_YSJXq.js +0 -374
  339. package/dist/list-CM_YSJXq.js.map +0 -1
  340. package/dist/live-DQc8jr6o.js +0 -1
  341. package/dist/model-Ce9l9_rF.js.map +0 -1
  342. package/dist/model-Cxzo4cjw.js +0 -1
  343. package/dist/node-DhIRSrrK.js.map +0 -1
  344. package/dist/opencode-providers-Co7plCea.js.map +0 -1
  345. package/dist/plan-DqnzfDH1.js.map +0 -1
  346. package/dist/plugins-B2KQ0y3P.js.map +0 -1
  347. package/dist/preflight-DyzmvK7i.js.map +0 -1
  348. package/dist/provenance-iRxjp4Pu.js.map +0 -1
  349. package/dist/provider-DCdTHQpk.js +0 -1
  350. package/dist/providers-D0ob_tra.js +0 -1
  351. package/dist/providers-vXMXuwn-.js.map +0 -1
  352. package/dist/query-CvgUsvep.js +0 -1
  353. package/dist/record-DhzwkSXc.js.map +0 -1
  354. package/dist/remarks-CauU408t.js.map +0 -1
  355. package/dist/remarks-NMgPd30U.js.map +0 -1
  356. package/dist/resolve-B1zMnPwK.js.map +0 -1
  357. package/dist/resolve-BIIeVT12.js +0 -1
  358. package/dist/resume-Dkhrpjow.js.map +0 -1
  359. package/dist/runtime-DcvQcr36.js.map +0 -1
  360. package/dist/sandbox-8zCrtuCf.js.map +0 -1
  361. package/dist/server-0tuj8VSa.js +0 -1
  362. package/dist/shared-ogqPJ0uo.js.map +0 -1
  363. package/dist/source-llwLewOU.js +0 -1
  364. package/dist/src-BQ6BiXoc.js.map +0 -1
  365. package/dist/src-BXnv0ViU.js +0 -2
  366. package/dist/src-BiS8YNN_.js +0 -3
  367. package/dist/src-BkH4GOxu.js +0 -1
  368. package/dist/src-C-tH5ebd.js +0 -2
  369. package/dist/src-Cg1bFs9g.js +0 -2
  370. package/dist/src-DV_UorZv.js +0 -2
  371. package/dist/src-XxUpr2sa.js +0 -2
  372. package/dist/state-DZbAO95a.js +0 -1
  373. package/dist/suite-M8_7xio7.js.map +0 -1
  374. package/dist/suite-u2KJnGpY.js +0 -2
  375. package/dist/summary-Uzc9osfV.js.map +0 -1
  376. package/dist/types-C4OkYhZg.js.map +0 -1
  377. package/dist/vertex-h_peaZTN.js +0 -1
  378. package/dist/views-BISrsIjw.js.map +0 -1
  379. package/dist/views-Bfab8fM9.js +0 -2
  380. package/dist/workspace-B8EOCuxl.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-Bh2I35id.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-BfnhazOv.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", "darwin"],
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-CsFaawcZ.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-Db7ifchA.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-BbZYaQ8b.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-1dBuXzs4.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-BY1cCaoJ.js")).createGoose({
705
+ ...vertex ? { vertex } : {},
706
+ ...auth["AI_GATEWAY_API_KEY"] ? {
707
+ auth,
708
+ provider: (await import("./src-BY1cCaoJ.js")).AI_GATEWAY_PROVIDER
709
+ } : auth["OPENROUTER_API_KEY"] ? {
710
+ auth,
711
+ provider: (await import("./src-BY1cCaoJ.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-CrV2WA2i.js")).createPi({
736
+ ...auth["AI_GATEWAY_API_KEY"] ? {
737
+ auth,
738
+ gateway: (await import("./src-CrV2WA2i.js")).PI_AI_GATEWAY
739
+ } : auth["OPENROUTER_API_KEY"] ? {
740
+ auth,
741
+ gateway: (await import("./src-CrV2WA2i.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-CDFH2vVN.js")).createCodex({
778
+ auth,
779
+ ...auth["AI_GATEWAY_API_KEY"] ? { provider: (await import("./src-CDFH2vVN.js")).AI_GATEWAY_PROVIDER } : auth["OPENROUTER_API_KEY"] ? { provider: (await import("./src-CDFH2vVN.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-wKwznPgt.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-BKpioayC.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-DXuFxtGC.js.map