reeval 0.27.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +15 -15
- package/dist/{adapter-CVTLAqRZ.js → adapter-mMrKaF9C.js} +4 -4
- package/dist/{adapter-CVTLAqRZ.js.map → adapter-mMrKaF9C.js.map} +1 -1
- package/dist/agent-BMHM86Qy.js +271 -0
- package/dist/agent-BMHM86Qy.js.map +1 -0
- package/dist/agents-BP6F1c6y.d.ts +3 -0
- package/dist/agents-DgfyOMRm.js +400 -0
- package/dist/agents-DgfyOMRm.js.map +1 -0
- package/dist/{api-C8ZbQG7s.js → api-DIzSkDXZ.js} +2 -2
- package/dist/{api-C8ZbQG7s.js.map → api-DIzSkDXZ.js.map} +1 -1
- package/dist/assemble-Dsl_C0gf.js +1 -0
- package/dist/{assemble-CMEwZN4_.js → assemble-DxVRcaLC.js} +17 -17
- package/dist/{assemble-CMEwZN4_.js.map → assemble-DxVRcaLC.js.map} +1 -1
- package/dist/{attach-BX-5hEGv.js → attach-CB-ESG7D.js} +5 -5
- package/dist/{attach-BX-5hEGv.js.map → attach-CB-ESG7D.js.map} +1 -1
- package/dist/{attempt-host-4dd7VaDe.js → attempt-host-B3zsORzT.js} +5 -5
- package/dist/{attempt-host-4dd7VaDe.js.map → attempt-host-B3zsORzT.js.map} +1 -1
- package/dist/{boat-IDUgSDug.js → boat-B2B3XO9B.js} +8 -8
- package/dist/{boat-IDUgSDug.js.map → boat-B2B3XO9B.js.map} +1 -1
- package/dist/{boat-Cal3Y_cf.js → boat-CANaudKC.js} +1 -1
- package/dist/{boat-images-BvfeOB9a.js → boat-images-sSz82GXk.js} +8 -8
- package/dist/{boat-images-BvfeOB9a.js.map → boat-images-sSz82GXk.js.map} +1 -1
- package/dist/{bundle-BOMF_M7M.js → bundle-CJsMYTJw.js} +68 -15
- package/dist/bundle-CJsMYTJw.js.map +1 -0
- package/dist/capture-5WMKZZRx.js +1 -0
- package/dist/{capture-Zg37l-rl.js → capture-DTHe_BcS.js} +13 -13
- package/dist/{capture-Zg37l-rl.js.map → capture-DTHe_BcS.js.map} +1 -1
- package/dist/{cases-C6vnV-gn.js → cases-B_a7flE8.js} +3 -3
- package/dist/{cases-C6vnV-gn.js.map → cases-B_a7flE8.js.map} +1 -1
- package/dist/cases-D0-dA8q1.js +1 -0
- package/dist/{classify-BIJQ2Xqo.js → classify-gLl11KS8.js} +3 -3
- package/dist/{classify-BIJQ2Xqo.js.map → classify-gLl11KS8.js.map} +1 -1
- package/dist/{cli-DccpONR9.js → cli-EopIiwBJ.js} +118 -116
- package/dist/cli-EopIiwBJ.js.map +1 -0
- package/dist/{cli-spec-DO-RQP-t.js → cli-spec-CYh8vLTE.js} +31 -9
- package/dist/cli-spec-CYh8vLTE.js.map +1 -0
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/{cloud-CcllrnMJ.js → cloud-CsofVdxN.js} +4 -4
- package/dist/{cloud-CcllrnMJ.js.map → cloud-CsofVdxN.js.map} +1 -1
- package/dist/{cloud-files-Dk9vMqTd.js → cloud-files-BpWbKpxg.js} +9 -9
- package/dist/{cloud-files-Dk9vMqTd.js.map → cloud-files-BpWbKpxg.js.map} +1 -1
- package/dist/{cloud-project-pwlrENpe.js → cloud-project-CN1f7p5a.js} +2 -2
- package/dist/{cloud-project-pwlrENpe.js.map → cloud-project-CN1f7p5a.js.map} +1 -1
- package/dist/{cloud-project-CwCIPUO0.js → cloud-project-DLn9l5X6.js} +1 -1
- package/dist/{cloud-push-XtACx9Rn.js → cloud-push-CLIcWVa6.js} +11 -11
- package/dist/{cloud-push-XtACx9Rn.js.map → cloud-push-CLIcWVa6.js.map} +1 -1
- package/dist/{cloud-push-baZYUB5L.js → cloud-push-CPLWxn8b.js} +1 -1
- package/dist/{cloud-run-B6axrPZv.js → cloud-run-ChdOr6zu.js} +18 -14
- package/dist/cloud-run-ChdOr6zu.js.map +1 -0
- package/dist/{cloud-run-C0Hj7EiS.js → cloud-run-DIAXbsWd.js} +1 -1
- package/dist/{cloud-secrets-CTuA8dDk.js → cloud-secrets-DAuRwjTP.js} +75 -57
- package/dist/cloud-secrets-DAuRwjTP.js.map +1 -0
- package/dist/cloud-secrets-a1B2IsjU.js +1 -0
- package/dist/{command-Blf581A9.js → command-6UkOgqge.js} +22 -22
- package/dist/{command-Blf581A9.js.map → command-6UkOgqge.js.map} +1 -1
- package/dist/{command-BC_zVYDg.js → command-CQS2gjNM.js} +17 -17
- package/dist/{command-BC_zVYDg.js.map → command-CQS2gjNM.js.map} +1 -1
- package/dist/{command-BN-UjwKc.js → command-CUBXsFfz.js} +7 -7
- package/dist/{command-BN-UjwKc.js.map → command-CUBXsFfz.js.map} +1 -1
- package/dist/{command-Q-RyEJPQ.js → command-Dq-mFirh.js} +2 -2
- package/dist/{command-Q-RyEJPQ.js.map → command-Dq-mFirh.js.map} +1 -1
- package/dist/{command-CiGl6R33.js → command-I8E1FgG5.js} +12 -12
- package/dist/{command-CiGl6R33.js.map → command-I8E1FgG5.js.map} +1 -1
- package/dist/{commands-DzRyz-v9.js → commands-BeLE4oN4.js} +18 -18
- package/dist/{commands-DzRyz-v9.js.map → commands-BeLE4oN4.js.map} +1 -1
- package/dist/{commands-CBbpjvzR.js → commands-wkSzuPgF.js} +1 -1
- package/dist/{config-DDNytzO-.js → config-CfZWILTy.js} +22 -25
- package/dist/config-CfZWILTy.js.map +1 -0
- package/dist/{provenance-Cylt_YxT.d.ts → core-C2d0URWs.d.ts} +2 -2
- package/dist/{core-B3Qg8zwG.js → core-tpzE5NhW.js} +8 -8
- package/dist/{core-B3Qg8zwG.js.map → core-tpzE5NhW.js.map} +1 -1
- package/dist/{cost-DQ0ayy6h.js → cost-CSfMv_sp.js} +5 -2
- package/dist/cost-CSfMv_sp.js.map +1 -0
- package/dist/{cost-a_rUSdsf.js → cost-_uinO5Yg.js} +1 -1
- package/dist/{cost-Dp-xFGJ1.js → cost-rRhvzqJo.js} +2 -2
- package/dist/{cost-Dp-xFGJ1.js.map → cost-rRhvzqJo.js.map} +1 -1
- package/dist/{cursor-catalog-CkdQyfqe.js → cursor-catalog-Cw3kv68u.js} +15 -5
- package/dist/cursor-catalog-Cw3kv68u.js.map +1 -0
- package/dist/{daytona-acuTdrq7.js → daytona-fLoFUu2I.js} +10 -10
- package/dist/{daytona-acuTdrq7.js.map → daytona-fLoFUu2I.js.map} +1 -1
- package/dist/{daytona-image-BtdtmTYn.js → daytona-image-BRBFQA9c.js} +4 -4
- package/dist/{daytona-image-BtdtmTYn.js.map → daytona-image-BRBFQA9c.js.map} +1 -1
- package/dist/daytona-image-DuZpq9Qw.js +1 -0
- package/dist/db-BPumcvp8.js +1 -0
- package/dist/{db-BQb7-_SX.js → db-t2g-ANto.js} +10 -10
- package/dist/{db-BQb7-_SX.js.map → db-t2g-ANto.js.map} +1 -1
- package/dist/{default-effort-C8bN-rLD.js → default-effort-ByvTDqX7.js} +10 -4
- package/dist/default-effort-ByvTDqX7.js.map +1 -0
- package/dist/default-effort-C9He6KVv.js +1 -0
- package/dist/{docker-CHEDAivU.js → docker-BKA4ELbB.js} +1 -1
- package/dist/{docker-DzSu1y_e.js → docker-h8mYtGWF.js} +2 -2
- package/dist/{docker-DzSu1y_e.js.map → docker-h8mYtGWF.js.map} +1 -1
- package/dist/{doctor-BPHM419M.js → doctor-CPXSQ4s-.js} +27 -26
- package/dist/doctor-CPXSQ4s-.js.map +1 -0
- package/dist/{env-8x1O8I1M.js → env-ARmqWMQ5.js} +3 -1
- package/dist/env-ARmqWMQ5.js.map +1 -0
- package/dist/{environment-CkzsewoX.js → environment-B_ht7Lbp.js} +4 -3
- package/dist/environment-B_ht7Lbp.js.map +1 -0
- package/dist/{errors-xUi3AkBi.js → errors-BQxdlRgT.js} +2 -2
- package/dist/{errors-xUi3AkBi.js.map → errors-BQxdlRgT.js.map} +1 -1
- package/dist/{eval-source-CK6QEXlf.js → eval-source-Byy9CDjg.js} +5 -5
- package/dist/{eval-source-CK6QEXlf.js.map → eval-source-Byy9CDjg.js.map} +1 -1
- package/dist/{evaluate-Nnh0iPuo.d.ts → evaluate-Bhdj1cv0.d.ts} +1 -1
- package/dist/{evaluate-DnMnoErB.js → evaluate-DoObbRZ2.js} +70 -55
- package/dist/evaluate-DoObbRZ2.js.map +1 -0
- package/dist/events-D7kBBdzl.js +1 -0
- package/dist/{events-CQJ9VK-x.js → events-Da6Pl5_b.js} +3 -3
- package/dist/{events-CQJ9VK-x.js.map → events-Da6Pl5_b.js.map} +1 -1
- package/dist/{files-DxMU7Qa3.js → files-CLNAE1rM.js} +6 -6
- package/dist/{files-DxMU7Qa3.js.map → files-CLNAE1rM.js.map} +1 -1
- package/dist/files-CjabTKaR.js +1 -0
- package/dist/{files-C0k5nNUu.js → files-CmLgOH3w.js} +3 -3
- package/dist/{files-C0k5nNUu.js.map → files-CmLgOH3w.js.map} +1 -1
- package/dist/{files-CGzUGcN2.js → files-CsJWxr6c.js} +2 -2
- package/dist/{files-CGzUGcN2.js.map → files-CsJWxr6c.js.map} +1 -1
- package/dist/{files-FLbqNavk.js → files-DV9Tfusu.js} +7 -7
- package/dist/{files-FLbqNavk.js.map → files-DV9Tfusu.js.map} +1 -1
- package/dist/{files--mW-Ym3B.js → files-Dc2xVqx1.js} +1 -1
- package/dist/{files-lwByH3UH.js → files-DgRaHy0k.js} +5 -5
- package/dist/{files-lwByH3UH.js.map → files-DgRaHy0k.js.map} +1 -1
- package/dist/files-DrXNXtQR.js +1 -0
- package/dist/files-Ds_hi5Bh.js +1 -0
- package/dist/{files-f7mRGOM3.js → files-uFFwVJZG.js} +4 -4
- package/dist/{files-f7mRGOM3.js.map → files-uFFwVJZG.js.map} +1 -1
- package/dist/gateway.d.ts +1 -1
- package/dist/harness-Dcd3ffkY.js.map +1 -1
- package/dist/{harness-install-CTAsIRk9.js → harness-install-CmD1eQsL.js} +7 -5
- package/dist/harness-install-CmD1eQsL.js.map +1 -0
- package/dist/harness.d.ts +1 -1
- package/dist/{ids-D9QbaaVk.js → ids-cqB_4aeP.js} +3 -3
- package/dist/{ids-D9QbaaVk.js.map → ids-cqB_4aeP.js.map} +1 -1
- package/dist/{images-32hY25pv.js → images-CWT6Ye03.js} +13 -13
- package/dist/{images-32hY25pv.js.map → images-CWT6Ye03.js.map} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/{init-DSDKSenO.js → init-BESRsV7F.js} +5 -5
- package/dist/{init-DSDKSenO.js.map → init-BESRsV7F.js.map} +1 -1
- package/dist/init-CSfZF3uV.js +1 -0
- package/dist/{ink-list-BsPpwXuw.js → ink-list-Cu48wlm7.js} +2 -2
- package/dist/{ink-list-BsPpwXuw.js.map → ink-list-Cu48wlm7.js.map} +1 -1
- package/dist/{inputs-DvE7qqTb.js → inputs-BoQrNOoN.js} +6 -6
- package/dist/{inputs-DvE7qqTb.js.map → inputs-BoQrNOoN.js.map} +1 -1
- package/dist/internal/vm.d.ts +2 -2
- package/dist/{invocations-2vDCZ_7f.js → invocations-FUUh2r22.js} +3 -3
- package/dist/{invocations-2vDCZ_7f.js.map → invocations-FUUh2r22.js.map} +1 -1
- package/dist/{judge-3ABSMDa4.js → judge-CUjB8kYF.js} +71 -24
- package/dist/judge-CUjB8kYF.js.map +1 -0
- package/dist/judge.d.ts +3 -3
- package/dist/judge.js +1 -1
- package/dist/{judgments-CVCUWT-g.js → judgments-8zHsGW8o.js} +2 -2
- package/dist/{judgments-CVCUWT-g.js.map → judgments-8zHsGW8o.js.map} +1 -1
- package/dist/{kinds-CICscFIA.js → kinds-C6PeknHN.js} +7 -7
- package/dist/{kinds-CICscFIA.js.map → kinds-C6PeknHN.js.map} +1 -1
- package/dist/{labels-Dtyf5-pd.js → labels-CbwHtEHq.js} +2 -3
- package/dist/labels-CbwHtEHq.js.map +1 -0
- package/dist/{layout-ChWMCz4x.js → layout-zk3wcJ-D.js} +4 -4
- package/dist/{layout-ChWMCz4x.js.map → layout-zk3wcJ-D.js.map} +1 -1
- package/dist/{link-Rj7DMpHv.js → link-C74mznSy.js} +3 -3
- package/dist/{link-Rj7DMpHv.js.map → link-C74mznSy.js.map} +1 -1
- package/dist/{list-DSm2TZds.js → list-B_bnCkKF.js} +7 -7
- package/dist/{list-DSm2TZds.js.map → list-B_bnCkKF.js.map} +1 -1
- package/dist/{live-D3zHauJd.js → live-BXjhPeBS.js} +5 -5
- package/dist/{live-D3zHauJd.js.map → live-BXjhPeBS.js.map} +1 -1
- package/dist/{live-YXsT5z0d.js → live-CVlGZ5uP.js} +2 -2
- package/dist/{live-YXsT5z0d.js.map → live-CVlGZ5uP.js.map} +1 -1
- package/dist/{machine-service-GQkt_mJ-.js → machine-service-CIPF3GOD.js} +1 -1
- package/dist/{machine-service-Bos-taCx.js → machine-service-WRvLuPyf.js} +3 -3
- package/dist/{machine-service-Bos-taCx.js.map → machine-service-WRvLuPyf.js.map} +1 -1
- package/dist/{machines-tHbtRGLZ.js → machines-BIhbRJ4m.js} +23 -23
- package/dist/{machines-tHbtRGLZ.js.map → machines-BIhbRJ4m.js.map} +1 -1
- package/dist/{markdown-COts-jxf.js → markdown-aVaKa5tB.js} +2 -2
- package/dist/{markdown-COts-jxf.js.map → markdown-aVaKa5tB.js.map} +1 -1
- package/dist/{model-CcbVQLLZ.js → model-CnuJlONr.js} +1 -1
- package/dist/{model-B89uRS9X.js → model-D3sK3a5R.js} +13 -13
- package/dist/model-D3sK3a5R.js.map +1 -0
- package/dist/{model-WiM6J5cw.js → model-DmPDqMOT.js} +6 -5
- package/dist/model-DmPDqMOT.js.map +1 -0
- package/dist/{model-BdYwVOAF.js → model-EhOuBsho.js} +24 -16
- package/dist/{model-BdYwVOAF.js.map → model-EhOuBsho.js.map} +1 -1
- package/dist/model-Yu4XAseh.js +1 -0
- package/dist/{node-eEX-KpkO.js → node-ChfH6UTx.js} +4 -4
- package/dist/{node-eEX-KpkO.js.map → node-ChfH6UTx.js.map} +1 -1
- package/dist/{openrouter-models-B1sIOTD2.js → openrouter-models-D19R699I.js} +7 -8
- package/dist/openrouter-models-D19R699I.js.map +1 -0
- package/dist/options-DFSyG3S8.js +1 -0
- package/dist/{patch-BYEfvtW6.js → patch-DBQCuZAJ.js} +2 -2
- package/dist/{patch-BYEfvtW6.js.map → patch-DBQCuZAJ.js.map} +1 -1
- package/dist/pi-providers-C7r3J259.js +1 -0
- package/dist/{plan-BryczQNX.js → plan-Dj19aa3f.js} +10 -10
- package/dist/{plan-BryczQNX.js.map → plan-Dj19aa3f.js.map} +1 -1
- package/dist/{plugins-DPV4muCf.js → plugins-rlmJz7B3.js} +6 -15
- package/dist/plugins-rlmJz7B3.js.map +1 -0
- package/dist/{preflight-D-t0S092.js → preflight-C919d0x1.js} +9 -9
- package/dist/{preflight-D-t0S092.js.map → preflight-C919d0x1.js.map} +1 -1
- package/dist/{preflight-BQdB1wyE.js → preflight-CVGDRu2C.js} +1 -1
- package/dist/{preflight-CiF8GvAC.js → preflight-CvIY-sKu.js} +4 -4
- package/dist/{preflight-CiF8GvAC.js.map → preflight-CvIY-sKu.js.map} +1 -1
- package/dist/preflight-DzeTciWY.js +1 -0
- package/dist/{prepare-yxqXzH9o.js → prepare-BAkGolQG.js} +11 -8
- package/dist/prepare-BAkGolQG.js.map +1 -0
- package/dist/{prepare-DeI3A_tV.js → prepare-D91IAX_H.js} +2 -2
- package/dist/{prices-7Av-R8LY.js → prices-DZa1s6oE.js} +2 -2
- package/dist/{prices-7Av-R8LY.js.map → prices-DZa1s6oE.js.map} +1 -1
- package/dist/prices-DhqfDLI0.js +1 -0
- package/dist/{provenance-DH-yi6D5.js → provenance-BKmmc54i.js} +4 -4
- package/dist/{provenance-DH-yi6D5.js.map → provenance-BKmmc54i.js.map} +1 -1
- package/dist/{provider-Cn7lmECy.js → provider-BNQjWvVI.js} +2 -2
- package/dist/{provider-Cn7lmECy.js.map → provider-BNQjWvVI.js.map} +1 -1
- package/dist/provider-CVvAjoNS.js +1 -0
- package/dist/{providers-C0CsemjO.js → providers-BJtQ3NwC.js} +1 -1
- package/dist/{providers-pNzZLfjc.js → providers-zFYsqSGY.js} +26 -26
- package/dist/{providers-pNzZLfjc.js.map → providers-zFYsqSGY.js.map} +1 -1
- package/dist/{query-B9eLoFkA.js → query-Bb9N_XYo.js} +2 -2
- package/dist/{query-B9eLoFkA.js.map → query-Bb9N_XYo.js.map} +1 -1
- package/dist/query-CIn4l3KN.js +1 -0
- package/dist/{questions-Bvs34IKu.js → questions-7ENfOXct.js} +6 -6
- package/dist/{questions-Bvs34IKu.js.map → questions-7ENfOXct.js.map} +1 -1
- package/dist/{recipe-DOiL6fCP.js → recipe-BYfLWBQt.js} +3 -3
- package/dist/{recipe-DOiL6fCP.js.map → recipe-BYfLWBQt.js.map} +1 -1
- package/dist/{record-BWy9s9CV.js → record-CB1A6v0V.js} +2 -2
- package/dist/{record-BWy9s9CV.js.map → record-CB1A6v0V.js.map} +1 -1
- package/dist/{remarks-UZpf9-8r.js → remarks-Cf6sylYA.js} +10 -10
- package/dist/{remarks-UZpf9-8r.js.map → remarks-Cf6sylYA.js.map} +1 -1
- package/dist/{remarks-BbMdB_8I.js → remarks-vofg7p1p.js} +3 -3
- package/dist/{remarks-BbMdB_8I.js.map → remarks-vofg7p1p.js.map} +1 -1
- package/dist/{remote-C003Q3Nu.js → remote-3htNQd1k.js} +8 -7
- package/dist/remote-3htNQd1k.js.map +1 -0
- package/dist/renderer/ascii.d.ts +1 -1
- package/dist/renderer/markdown.d.ts +1 -1
- package/dist/renderer/markdown.js +1 -1
- package/dist/{report-B-kavICs.js → report-BQTwKMyw.js} +3 -3
- package/dist/{report-B-kavICs.js.map → report-BQTwKMyw.js.map} +1 -1
- package/dist/{report-inputs-UUAME7ww.js → report-inputs-CfN15NUr.js} +6 -6
- package/dist/{report-inputs-UUAME7ww.js.map → report-inputs-CfN15NUr.js.map} +1 -1
- package/dist/{resolve-B34rYHUr.js → resolve-BithWafe.js} +27 -17
- package/dist/resolve-BithWafe.js.map +1 -0
- package/dist/{resolve-C_UGu3ls.js → resolve-Cb2dNF75.js} +2 -2
- package/dist/{resolve-C_UGu3ls.js.map → resolve-Cb2dNF75.js.map} +1 -1
- package/dist/resolve-D8NaRPmt.js +1 -0
- package/dist/{results-DCxO32Il.js → results-BSrEuS2x.js} +6 -6
- package/dist/{results-DCxO32Il.js.map → results-BSrEuS2x.js.map} +1 -1
- package/dist/{resume-Ds4K9mQc.js → resume-VlM095b2.js} +6 -6
- package/dist/{resume-Ds4K9mQc.js.map → resume-VlM095b2.js.map} +1 -1
- package/dist/{retry-ReEnqSqt.js → retry-DI6qS8FY.js} +5 -5
- package/dist/{retry-ReEnqSqt.js.map → retry-DI6qS8FY.js.map} +1 -1
- package/dist/routes-D1tgwWoe.js +629 -0
- package/dist/routes-D1tgwWoe.js.map +1 -0
- package/dist/{run-C_kA5Jzh.js → run-DwLQh41-.js} +3 -3
- package/dist/{run-C_kA5Jzh.js.map → run-DwLQh41-.js.map} +1 -1
- package/dist/{runtime-Cu8_OGj6.js → runtime-CXxeCKoX.js} +6 -6
- package/dist/{runtime-Cu8_OGj6.js.map → runtime-CXxeCKoX.js.map} +1 -1
- package/dist/sandbox/boat.d.ts +2 -2
- package/dist/sandbox/boat.js +1 -1
- package/dist/sandbox/daytona.d.ts +2 -2
- package/dist/sandbox/daytona.js +1 -1
- package/dist/{sandbox-BsC4pZQC.js → sandbox-D1vDKYqU.js} +2 -2
- package/dist/{sandbox-BsC4pZQC.js.map → sandbox-D1vDKYqU.js.map} +1 -1
- package/dist/sandbox.d.ts +3 -3
- package/dist/sandbox.js +1 -1
- package/dist/secrets-file-BFJSaPHI.js +169 -0
- package/dist/secrets-file-BFJSaPHI.js.map +1 -0
- package/dist/{server-2cICWjvT.js → server-BrBZ0_xA.js} +6 -6
- package/dist/{server-2cICWjvT.js.map → server-BrBZ0_xA.js.map} +1 -1
- package/dist/server-CzilMQ_m.js +1 -0
- package/dist/shared-7f8bQJP4.d.ts +2 -0
- package/dist/{skill-dirs-B7o83G5I.js → skill-dirs-DaHQ463p.js} +2 -2
- package/dist/skill-dirs-DaHQ463p.js.map +1 -0
- package/dist/{source-CFimUGjU.js → source-CfeQ4DL4.js} +2 -2
- package/dist/{source-CFimUGjU.js.map → source-CfeQ4DL4.js.map} +1 -1
- package/dist/source-DqFPDDZU.js +1 -0
- package/dist/{spans-BshoUrAD.js → spans-DUexyi3E.js} +2 -2
- package/dist/spans-DUexyi3E.js.map +1 -0
- package/dist/{src-CRZg669b.js → src-1TaLS8AT.js} +1 -1
- package/dist/{src-CEValY4l.js → src-B3sBDfG2.js} +157 -114
- package/dist/src-B3sBDfG2.js.map +1 -0
- package/dist/{src-ZaP7-0pi.js → src-BWb__auU.js} +1 -1
- package/dist/{src-kjTrRKQJ.js → src-CU4tXeik.js} +1 -1
- package/dist/src-CfDk0uu4.js +3068 -0
- package/dist/src-CfDk0uu4.js.map +1 -0
- package/dist/src-DR_j9K3o.js +2 -0
- package/dist/{src-B8t-GsRm.js → src-DV-o1jAX.js} +1 -1
- package/dist/{src-DP-gPQ5B.js → src-RygE9XhU.js} +1 -1
- package/dist/{src-7kshnPZC.js → src-V6cCl3Ak.js} +1 -1
- package/dist/src-hPuCF6xC.js +1 -0
- package/dist/{src-B5r1d23Y.js → src-o0VTS7Rt.js} +5 -2
- package/dist/{src-B5r1d23Y.js.map → src-o0VTS7Rt.js.map} +1 -1
- package/dist/src-og0zwqOf.js +4 -0
- package/dist/ssh-pool-BWXdYQl0.js +1 -0
- package/dist/{ssh-pool-6nJsmgfW.js → ssh-pool-DqFdHcz0.js} +7 -7
- package/dist/{ssh-pool-6nJsmgfW.js.map → ssh-pool-DqFdHcz0.js.map} +1 -1
- package/dist/{start-BAha4BDk.js → start-BSBWBxQb.js} +13 -6
- package/dist/start-BSBWBxQb.js.map +1 -0
- package/dist/startup-YENEnSa_.js +16 -0
- package/dist/startup-YENEnSa_.js.map +1 -0
- package/dist/state-7TAiol30.js +1 -0
- package/dist/{state-DcuHVqLB.js → state-BhSANU74.js} +5 -5
- package/dist/{state-DcuHVqLB.js.map → state-BhSANU74.js.map} +1 -1
- package/dist/store/local.d.ts +1 -1
- package/dist/store/s3.d.ts +1 -1
- package/dist/{studio-share-DPk-XBsO.js → studio-share-58-7lF42.js} +6 -6
- package/dist/{studio-share-DPk-XBsO.js.map → studio-share-58-7lF42.js.map} +1 -1
- package/dist/suite-BvIl9-41.js +2 -0
- package/dist/{suite-DBbQs15H.js → suite-Bz0uCwd3.js} +4 -4
- package/dist/{suite-DBbQs15H.js.map → suite-Bz0uCwd3.js.map} +1 -1
- package/dist/{summary-CtTtjh3v.js → summary-Bx1qyFwL.js} +8 -8
- package/dist/{summary-CtTtjh3v.js.map → summary-Bx1qyFwL.js.map} +1 -1
- package/dist/{sync-DcFcjYLX.js → sync-BeiDYfR6.js} +6 -6
- package/dist/{sync-DcFcjYLX.js.map → sync-BeiDYfR6.js.map} +1 -1
- package/dist/{tart-CgW8e9RN.d.ts → tart-Brv7Huzv.d.ts} +2 -2
- package/dist/{tart-C50mEMFB.js → tart-CcdnLmyl.js} +7 -7
- package/dist/{tart-C50mEMFB.js.map → tart-CcdnLmyl.js.map} +1 -1
- package/dist/{tart-bake-C26irBUZ.js → tart-bake-BRfCI3R9.js} +1 -1
- package/dist/{tart-bake-By16X4Pb.js → tart-bake-CRrij4Ct.js} +7 -7
- package/dist/{tart-bake-By16X4Pb.js.map → tart-bake-CRrij4Ct.js.map} +1 -1
- package/dist/{tart-cli-C05FdPQV.js → tart-cli-B1qZ4EPU.js} +2 -2
- package/dist/{tart-cli-C05FdPQV.js.map → tart-cli-B1qZ4EPU.js.map} +1 -1
- package/dist/{tart-cli-DVI2SWz4.js → tart-cli-B7YKODI8.js} +1 -1
- package/dist/{tart-hosts-DESXVcNv.js → tart-hosts-CNUiaq7k.js} +1 -1
- package/dist/{tart-hosts-GDk-lRnT.js → tart-hosts-CifzR5Lp.js} +4 -4
- package/dist/{tart-hosts-GDk-lRnT.js.map → tart-hosts-CifzR5Lp.js.map} +1 -1
- package/dist/{tart-images-CLpWt7Mm.js → tart-images-DOboVDfH.js} +2 -2
- package/dist/{tart-images-CLpWt7Mm.js.map → tart-images-DOboVDfH.js.map} +1 -1
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +4 -4
- package/dist/{tool-class-CB-m4PiF.js → tool-class-DzpZJJWK.js} +2 -2
- package/dist/{tool-class-CB-m4PiF.js.map → tool-class-DzpZJJWK.js.map} +1 -1
- package/dist/{trace-CJQLlAbB.js → trace-BY_rkR5K.js} +2 -2
- package/dist/{trace-CJQLlAbB.js.map → trace-BY_rkR5K.js.map} +1 -1
- package/dist/{types-Buut5yGe.js → types-BRXqpxJ1.js} +3 -8
- package/dist/types-BRXqpxJ1.js.map +1 -0
- package/dist/{types-CYz4dqAd.d.ts → types-CseRWbr7.d.ts} +1 -1
- package/dist/{types-BZaItiui.d.ts → types-DtRJb-jv.d.ts} +203 -199
- package/dist/{ui-Ci9IZA-f.js → ui-CNYSCEFR.js} +5 -5
- package/dist/{ui-Ci9IZA-f.js.map → ui-CNYSCEFR.js.map} +1 -1
- package/dist/{usage-CwIRPPZ9.js → usage-Dg_IyU0o.js} +3 -5
- package/dist/usage-Dg_IyU0o.js.map +1 -0
- package/dist/vercel-models-DZxE5QJe.js +14 -0
- package/dist/vercel-models-DZxE5QJe.js.map +1 -0
- package/dist/{vertex-DQQGhUn7.js → vertex-BS-i5_z3.js} +20 -91
- package/dist/vertex-BS-i5_z3.js.map +1 -0
- package/dist/vertex-DWCgbhK1.js +2 -0
- package/dist/view/index.d.ts +3 -3
- package/dist/view/index.js +12 -12
- package/dist/view/report/index.d.ts +3 -3
- package/dist/view/report/index.js +3 -3
- package/dist/{views-BP8ck_JR.js → views-CLF_vJ6q.js} +6 -6
- package/dist/{views-BP8ck_JR.js.map → views-CLF_vJ6q.js.map} +1 -1
- package/dist/views-ZX-NomRg.js +2 -0
- package/dist/{vm-container-B_u4pfS7.js → vm-container-BHRWzfKZ.js} +6 -6
- package/dist/{vm-container-B_u4pfS7.js.map → vm-container-BHRWzfKZ.js.map} +1 -1
- package/dist/{vm-images-DLSFXRVh.js → vm-images-CZitoP8K.js} +13 -13
- package/dist/{vm-images-DLSFXRVh.js.map → vm-images-CZitoP8K.js.map} +1 -1
- package/dist/{worker-entry-CWQSBQAG.js → worker-entry-DTrgQNo6.js} +3 -3
- package/dist/{worker-entry-CWQSBQAG.js.map → worker-entry-DTrgQNo6.js.map} +1 -1
- package/dist/{workspace-Bi4hvK9n.js → workspace-CgkcWyX1.js} +6 -6
- package/dist/{workspace-Bi4hvK9n.js.map → workspace-CgkcWyX1.js.map} +1 -1
- package/dist/workspace-DbRCjXfa.js +1 -0
- package/package.json +1 -1
- package/dist/agent-DMYCRwih.js +0 -987
- package/dist/agent-DMYCRwih.js.map +0 -1
- package/dist/agents-BnLy2oJs.js +0 -1408
- package/dist/agents-BnLy2oJs.js.map +0 -1
- package/dist/agents-D4H9bKHD.d.ts +0 -2
- package/dist/assemble-EbRQIpCM.js +0 -1
- package/dist/bundle-BOMF_M7M.js.map +0 -1
- package/dist/capture-giEWLD66.js +0 -1
- package/dist/cases-Bsp-G-ZL.js +0 -1
- package/dist/cli-DccpONR9.js.map +0 -1
- package/dist/cli-spec-DO-RQP-t.js.map +0 -1
- package/dist/cloud-run-B6axrPZv.js.map +0 -1
- package/dist/cloud-secrets-CTuA8dDk.js.map +0 -1
- package/dist/cloud-secrets-D4_doDp3.js +0 -1
- package/dist/config-DDNytzO-.js.map +0 -1
- package/dist/cost-DQ0ayy6h.js.map +0 -1
- package/dist/cursor-catalog-CkdQyfqe.js.map +0 -1
- package/dist/daytona-image-Bhc1-HBs.js +0 -1
- package/dist/db-Djz9zixD.js +0 -1
- package/dist/default-effort-Ba_1HAs4.js +0 -1
- package/dist/default-effort-C8bN-rLD.js.map +0 -1
- package/dist/doctor-BPHM419M.js.map +0 -1
- package/dist/env-8x1O8I1M.js.map +0 -1
- package/dist/environment-CkzsewoX.js.map +0 -1
- package/dist/evaluate-DnMnoErB.js.map +0 -1
- package/dist/events-CwWpBkkc.js +0 -1
- package/dist/files-1PVfWWXB.js +0 -1
- package/dist/files-CsPOd60N.js +0 -1
- package/dist/files-DOz7Qr5r.js +0 -1
- package/dist/harness-install-CTAsIRk9.js.map +0 -1
- package/dist/init-B7u-ygNZ.js +0 -1
- package/dist/judge-3ABSMDa4.js.map +0 -1
- package/dist/labels-Dtyf5-pd.js.map +0 -1
- package/dist/model-B89uRS9X.js.map +0 -1
- package/dist/model-Doy9vFnq.js +0 -1
- package/dist/model-WiM6J5cw.js.map +0 -1
- package/dist/openrouter-models-B1sIOTD2.js.map +0 -1
- package/dist/options-DN2Zh2HW.js +0 -1
- package/dist/plugins-DPV4muCf.js.map +0 -1
- package/dist/preflight-D9eRBIzJ.js +0 -1
- package/dist/prepare-yxqXzH9o.js.map +0 -1
- package/dist/prices-CZWSNosm.js +0 -1
- package/dist/provider-B24hZX95.js +0 -1
- package/dist/provider-stop-DjBMfZW5.js +0 -69
- package/dist/provider-stop-DjBMfZW5.js.map +0 -1
- package/dist/query-3PjR8hU2.js +0 -1
- package/dist/remote-C003Q3Nu.js.map +0 -1
- package/dist/resolve-B34rYHUr.js.map +0 -1
- package/dist/resolve-BzHvjODA.js +0 -1
- package/dist/routes-Cp4gAjBZ.js +0 -427
- package/dist/routes-Cp4gAjBZ.js.map +0 -1
- package/dist/secrets-file-B1Yj1WjD.js +0 -100
- package/dist/secrets-file-B1Yj1WjD.js.map +0 -1
- package/dist/server-CzTVzKWG.js +0 -1
- package/dist/shared-B3iLKAiu.d.ts +0 -1
- package/dist/skill-dirs-B7o83G5I.js.map +0 -1
- package/dist/source-CydZOoBv.js +0 -1
- package/dist/spans-BshoUrAD.js.map +0 -1
- package/dist/src-2MDgX3cP.js +0 -3
- package/dist/src-CEValY4l.js.map +0 -1
- package/dist/src-CH8ZNcTe.js +0 -1
- package/dist/src-Con14kZF.js +0 -2
- package/dist/ssh-pool-pPq8x-rp.js +0 -1
- package/dist/start-BAha4BDk.js.map +0 -1
- package/dist/state-C007zNcM.js +0 -1
- package/dist/suite-BQNoCyRE.js +0 -2
- package/dist/types-Buut5yGe.js.map +0 -1
- package/dist/usage-CwIRPPZ9.js.map +0 -1
- package/dist/vercel-models-Ci33llXz.js +0 -21
- package/dist/vercel-models-Ci33llXz.js.map +0 -1
- package/dist/vertex-DQQGhUn7.js.map +0 -1
- package/dist/vertex-DtWe0Xf6.js +0 -1
- package/dist/views-_yc6K-9E.js +0 -2
- package/dist/workspace-Nhdu3NBO.js +0 -1
package/dist/agent-DMYCRwih.js
DELETED
|
@@ -1,987 +0,0 @@
|
|
|
1
|
-
import { Ot as SANDBOX_ROOT, jt as WORKSPACE_DIR } from "./src-CEValY4l.js";
|
|
2
|
-
import { i as debugTrace, r as debugLog } from "./attempt-D5WH0yFa.js";
|
|
3
|
-
import { S as brokerToken } from "./vertex-DQQGhUn7.js";
|
|
4
|
-
import { c as runsAgent, d as sandboxKind, f as suggestedSandbox, n as capabilitiesOf } from "./kinds-CICscFIA.js";
|
|
5
|
-
import { i as hasNetworkSession, t as InfraError } from "./types-Buut5yGe.js";
|
|
6
|
-
import { a as plural } from "./text-B8-W3Cvn.js";
|
|
7
|
-
import { a as tokenUsage, t as addUsage } from "./usage-CwIRPPZ9.js";
|
|
8
|
-
import { a as agentFor, c as authHint, i as agentAuth, o as agentMcp, x as writePluginFiles } from "./agents-BnLy2oJs.js";
|
|
9
|
-
import { n as providerStop } from "./provider-stop-DjBMfZW5.js";
|
|
10
|
-
import { t as isObjectLike } from "./object-CeQ8dgUC.js";
|
|
11
|
-
import { HarnessAgent } from "@ai-sdk/harness/agent";
|
|
12
|
-
const SHELL_TOOLS = /* @__PURE__ */ new Set([
|
|
13
|
-
"bash",
|
|
14
|
-
"shell",
|
|
15
|
-
"Shell",
|
|
16
|
-
"run_terminal_cmd",
|
|
17
|
-
"execute_command",
|
|
18
|
-
"terminal"
|
|
19
|
-
]);
|
|
20
|
-
const str = (value) => typeof value === "string" ? value : "";
|
|
21
|
-
/** Wall time until the result part arrived; Cursor can report `completed_at_ms` before the shell returns. */
|
|
22
|
-
function toolDurationMs(start, call, endMs, t) {
|
|
23
|
-
const wall = endMs - start;
|
|
24
|
-
if (t?.end === void 0) return endMs - call.ms;
|
|
25
|
-
if (t.recovered) return t.end - start;
|
|
26
|
-
return Math.max(t.end - start, wall);
|
|
27
|
-
}
|
|
28
|
-
function stallFlags(tool, durationMs) {
|
|
29
|
-
if (durationMs === null || durationMs < 12e4) return {};
|
|
30
|
-
if (SHELL_TOOLS.has(tool) || tool === "edit") return { stalled: true };
|
|
31
|
-
return {};
|
|
32
|
-
}
|
|
33
|
-
const record = (value) => isObjectLike(value) ? value : {};
|
|
34
|
-
/**
|
|
35
|
-
* A reasoning block recovered after the turn (Antigravity's, from its stored conversation) says
|
|
36
|
-
* in its provider metadata how long before its own part it started, and how long the agent says
|
|
37
|
-
* it took: it's placed there, not where it arrived.
|
|
38
|
-
*/
|
|
39
|
-
function recoveredTiming(part) {
|
|
40
|
-
for (const meta of Object.values(record(part.providerMetadata))) {
|
|
41
|
-
const { startedBeforeMs, durationMs } = record(meta);
|
|
42
|
-
if (typeof startedBeforeMs !== "number") continue;
|
|
43
|
-
return {
|
|
44
|
-
startedBeforeMs,
|
|
45
|
-
durationMs: typeof durationMs === "number" ? durationMs : null
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/** The harness's synthetic "fileChange" twin of every edit, which always says "modify". */
|
|
50
|
-
const isFileChangeEcho = (part) => part.toolName === "fileChange" || str(part.toolCallId).startsWith("harness-file-change-");
|
|
51
|
-
function lines(text) {
|
|
52
|
-
if (!text) return [];
|
|
53
|
-
const all = text.split("\n");
|
|
54
|
-
if (all.at(-1) === "") all.pop();
|
|
55
|
-
return all;
|
|
56
|
-
}
|
|
57
|
-
/** Lines only in `before` (removed) and only in `after` (added), as multisets. */
|
|
58
|
-
function lineDelta(before, after) {
|
|
59
|
-
const counts = /* @__PURE__ */ new Map();
|
|
60
|
-
for (const line of lines(before)) counts.set(line, (counts.get(line) ?? 0) + 1);
|
|
61
|
-
let added = 0;
|
|
62
|
-
for (const line of lines(after)) {
|
|
63
|
-
const n = counts.get(line) ?? 0;
|
|
64
|
-
if (n > 0) counts.set(line, n - 1);
|
|
65
|
-
else added++;
|
|
66
|
-
}
|
|
67
|
-
const removed = [...counts.values()].reduce((a, b) => a + b, 0);
|
|
68
|
-
return {
|
|
69
|
-
added,
|
|
70
|
-
removed
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
/** The workspace's root, slot 0's (`/reeval/workspace/`) or a shared machine's slot's (`/reeval-s2/…`). */
|
|
74
|
-
const WORKSPACE = new RegExp(`^${SANDBOX_ROOT}(?:-s\\d+)?/${WORKSPACE_DIR}/`);
|
|
75
|
-
/** A path under the workspace, relative to it, as Cursor reports them. */
|
|
76
|
-
const inWorkspace = (path) => path.replace(WORKSPACE, "");
|
|
77
|
-
/** Cursor's and OpenCode's edit tools take `path`, Claude Code's `file_path`. */
|
|
78
|
-
const editPath = (input) => str(input.path) || str(input.file_path);
|
|
79
|
-
/**
|
|
80
|
-
* Cursor reports `referenceCount`; Claude Code lists `results`, where each search is
|
|
81
|
-
* `{ content: [{ title, url }] }` and plain strings are commentary.
|
|
82
|
-
*/
|
|
83
|
-
function searchReferences(output) {
|
|
84
|
-
const { referenceCount, references, results } = record(output);
|
|
85
|
-
if (typeof referenceCount === "number") return referenceCount;
|
|
86
|
-
if (Array.isArray(references)) return references.length;
|
|
87
|
-
if (!Array.isArray(results)) return null;
|
|
88
|
-
return results.reduce((n, r) => {
|
|
89
|
-
const links = record(r).content;
|
|
90
|
-
return n + (Array.isArray(links) ? links.length : 0);
|
|
91
|
-
}, 0);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Claude Code's bridge sends errors as `{ message }` objects; Cursor's as strings or Errors; ACP
|
|
95
|
-
* harnesses (OpenCode) the tool's `rawOutput`, `{ metadata, error }`. Any other object is kept as JSON.
|
|
96
|
-
*/
|
|
97
|
-
const errorText = (error) => str(error) || str(record(error).message) || str(record(error).error) || jsonText(error);
|
|
98
|
-
function jsonText(value) {
|
|
99
|
-
if (typeof value !== "object" || value === null) return String(value);
|
|
100
|
-
try {
|
|
101
|
-
return JSON.stringify(value);
|
|
102
|
-
} catch {
|
|
103
|
-
return String(value);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
/** Lines added and removed across unified-diff hunks, each `{ lines: ['+x', '-y', ' z'] }`. */
|
|
107
|
-
function hunkDelta(hunks) {
|
|
108
|
-
let added = 0;
|
|
109
|
-
let removed = 0;
|
|
110
|
-
for (const hunk of hunks) {
|
|
111
|
-
const lines = record(hunk).lines;
|
|
112
|
-
for (const line of Array.isArray(lines) ? lines : []) if (str(line).startsWith("+")) added++;
|
|
113
|
-
else if (str(line).startsWith("-")) removed++;
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
added,
|
|
117
|
-
removed
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
/** Claude Code's Write (`type`, `content`) or Edit (`oldString`, `newString`) result. */
|
|
121
|
-
function claudeEdit(toolCallId, output) {
|
|
122
|
-
const { originalFile, structuredPatch, content, oldString, newString } = output;
|
|
123
|
-
const created = output.type === "create" || output.type === void 0 && originalFile === null;
|
|
124
|
-
const counts = Array.isArray(structuredPatch) && structuredPatch.length > 0 ? hunkDelta(structuredPatch) : created ? {
|
|
125
|
-
added: lines(str(content ?? newString)).length,
|
|
126
|
-
removed: 0
|
|
127
|
-
} : typeof originalFile === "string" && typeof content === "string" ? lineDelta(originalFile, content) : typeof oldString === "string" && typeof newString === "string" ? lineDelta(oldString, newString) : {
|
|
128
|
-
added: null,
|
|
129
|
-
removed: null
|
|
130
|
-
};
|
|
131
|
-
return {
|
|
132
|
-
type: "file-edit",
|
|
133
|
-
toolCallId,
|
|
134
|
-
path: str(output.filePath),
|
|
135
|
-
kind: created ? "create" : "modify",
|
|
136
|
-
...counts
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
function fileEdits(toolCallId, output, tool, input) {
|
|
140
|
-
if (tool === "delete") return [{
|
|
141
|
-
type: "file-edit",
|
|
142
|
-
toolCallId,
|
|
143
|
-
path: editPath(input),
|
|
144
|
-
kind: "delete",
|
|
145
|
-
added: 0,
|
|
146
|
-
removed: null
|
|
147
|
-
}];
|
|
148
|
-
const result = record(output);
|
|
149
|
-
if (typeof result.filePath === "string") return [claudeEdit(toolCallId, result)];
|
|
150
|
-
const patch = str(record(result.details).patch);
|
|
151
|
-
if (patch) {
|
|
152
|
-
const all = lines(patch);
|
|
153
|
-
const hunks = all.findIndex((l) => l.startsWith("@@"));
|
|
154
|
-
const body = hunks < 0 ? [] : all.slice(hunks + 1);
|
|
155
|
-
return [{
|
|
156
|
-
type: "file-edit",
|
|
157
|
-
toolCallId,
|
|
158
|
-
path: editPath(input),
|
|
159
|
-
kind: "modify",
|
|
160
|
-
added: body.filter((l) => l.startsWith("+")).length,
|
|
161
|
-
removed: body.filter((l) => l.startsWith("-")).length
|
|
162
|
-
}];
|
|
163
|
-
}
|
|
164
|
-
const files = record(result.metadata).files;
|
|
165
|
-
if (Array.isArray(files) && files.length > 0) return files.map((f) => {
|
|
166
|
-
const file = record(f);
|
|
167
|
-
return {
|
|
168
|
-
type: "file-edit",
|
|
169
|
-
toolCallId,
|
|
170
|
-
path: inWorkspace(str(file.file) || editPath(input)),
|
|
171
|
-
kind: file.status === "added" ? "create" : file.status === "deleted" ? "delete" : "modify",
|
|
172
|
-
added: typeof file.additions === "number" ? file.additions : null,
|
|
173
|
-
removed: typeof file.deletions === "number" ? file.deletions : null
|
|
174
|
-
};
|
|
175
|
-
});
|
|
176
|
-
const said = str(result.output);
|
|
177
|
-
if (/^(Created|Wrote) file successfully/.test(said)) {
|
|
178
|
-
const created = said.startsWith("Created");
|
|
179
|
-
return [{
|
|
180
|
-
type: "file-edit",
|
|
181
|
-
toolCallId,
|
|
182
|
-
path: inWorkspace(editPath(input)),
|
|
183
|
-
kind: created ? "create" : "modify",
|
|
184
|
-
added: created ? lines(str(input.content)).length : null,
|
|
185
|
-
removed: created ? 0 : null
|
|
186
|
-
}];
|
|
187
|
-
}
|
|
188
|
-
if (result.kind === "add" || result.kind === "update") return [{
|
|
189
|
-
type: "file-edit",
|
|
190
|
-
toolCallId,
|
|
191
|
-
path: editPath(input),
|
|
192
|
-
kind: result.kind === "add" ? "create" : "modify",
|
|
193
|
-
added: null,
|
|
194
|
-
removed: null
|
|
195
|
-
}];
|
|
196
|
-
if (typeof result.linesAdded === "number") return [{
|
|
197
|
-
type: "file-edit",
|
|
198
|
-
toolCallId,
|
|
199
|
-
path: editPath(input),
|
|
200
|
-
kind: str(result.diffString).startsWith("--- /dev/null") ? "create" : "modify",
|
|
201
|
-
added: result.linesAdded,
|
|
202
|
-
removed: typeof result.linesRemoved === "number" ? result.linesRemoved : null
|
|
203
|
-
}];
|
|
204
|
-
if (tool === "write") return [{
|
|
205
|
-
type: "file-edit",
|
|
206
|
-
toolCallId,
|
|
207
|
-
path: editPath(input),
|
|
208
|
-
kind: "write",
|
|
209
|
-
added: typeof input.content === "string" ? lines(input.content).length : null,
|
|
210
|
-
removed: null
|
|
211
|
-
}];
|
|
212
|
-
return [{
|
|
213
|
-
type: "file-edit",
|
|
214
|
-
toolCallId,
|
|
215
|
-
path: editPath(input),
|
|
216
|
-
kind: "modify",
|
|
217
|
-
added: null,
|
|
218
|
-
removed: null
|
|
219
|
-
}];
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* The tool's name. Cursor reports an MCP call as `mcp`, with the server and tool in its input;
|
|
223
|
-
* those are named `mcp__<server>__<tool>`, as Claude Code names its own.
|
|
224
|
-
*/
|
|
225
|
-
function toolName(part) {
|
|
226
|
-
const input = record(part.input);
|
|
227
|
-
if (typeof input.providerIdentifier === "string" && typeof input.toolName === "string") return `mcp__${input.providerIdentifier}__${input.toolName}`;
|
|
228
|
-
return str(part.toolName);
|
|
229
|
-
}
|
|
230
|
-
/** The tool's input: a Cursor MCP call's own `args`, without the wrapper naming its server and tool. */
|
|
231
|
-
function toolInput(part) {
|
|
232
|
-
const input = record(part.input);
|
|
233
|
-
if (typeof input.providerIdentifier === "string" && typeof input.toolName === "string") return input.args ?? {};
|
|
234
|
-
return part.input;
|
|
235
|
-
}
|
|
236
|
-
/** Claude Code's native tool names as its adapter's common ones, for a subagent's calls. */
|
|
237
|
-
const CLAUDE_COMMON_NAMES = {
|
|
238
|
-
Read: "read",
|
|
239
|
-
Write: "write",
|
|
240
|
-
Edit: "edit",
|
|
241
|
-
MultiEdit: "edit",
|
|
242
|
-
Bash: "bash",
|
|
243
|
-
Glob: "glob",
|
|
244
|
-
Grep: "grep",
|
|
245
|
-
WebSearch: "webSearch"
|
|
246
|
-
};
|
|
247
|
-
/** A tool result's content as text: Claude's is a string or a list of `{ type: 'text', text }`. */
|
|
248
|
-
const contentText = (content) => Array.isArray(content) ? content.map((c) => str(record(c).text)).join("") : typeof content === "string" ? content : jsonText(content);
|
|
249
|
-
/**
|
|
250
|
-
* A Claude Code subagent's edit as Claude's own Edit or Write result, which `claudeEdit` reads:
|
|
251
|
-
* the bridge passes a subagent's messages on as raw SDK messages, whose result is only text.
|
|
252
|
-
*/
|
|
253
|
-
function subagentEditOutput(tool, input, said) {
|
|
254
|
-
const filePath = inWorkspace(editPath(input));
|
|
255
|
-
if (tool === "edit") return {
|
|
256
|
-
filePath,
|
|
257
|
-
oldString: input.old_string,
|
|
258
|
-
newString: input.new_string
|
|
259
|
-
};
|
|
260
|
-
return {
|
|
261
|
-
type: /created successfully/i.test(said) ? "create" : "update",
|
|
262
|
-
filePath,
|
|
263
|
-
content: input.content
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* The tool calls and results in a Claude Code subagent's SDK message (`parent_tool_use_id` set),
|
|
268
|
-
* which the bridge passes on only as a `raw` part, as the stream parts its own calls arrive as.
|
|
269
|
-
*/
|
|
270
|
-
function subagentParts(raw) {
|
|
271
|
-
const parent = raw.parent_tool_use_id;
|
|
272
|
-
if (typeof parent !== "string" || raw.type !== "assistant" && raw.type !== "user") return [];
|
|
273
|
-
const content = record(raw.message).content;
|
|
274
|
-
if (!Array.isArray(content)) return [];
|
|
275
|
-
const structured = record(raw.tool_use_result);
|
|
276
|
-
return content.flatMap((b) => {
|
|
277
|
-
const block = record(b);
|
|
278
|
-
if (raw.type === "assistant" && block.type === "tool_use" && typeof block.id === "string") {
|
|
279
|
-
const name = str(block.name);
|
|
280
|
-
return [{
|
|
281
|
-
type: "tool-call",
|
|
282
|
-
toolCallId: block.id,
|
|
283
|
-
toolName: CLAUDE_COMMON_NAMES[name] ?? name,
|
|
284
|
-
input: block.input ?? {},
|
|
285
|
-
subagent: parent
|
|
286
|
-
}];
|
|
287
|
-
}
|
|
288
|
-
if (raw.type === "user" && block.type === "tool_result") {
|
|
289
|
-
const said = contentText(block.content);
|
|
290
|
-
const id = str(block.tool_use_id);
|
|
291
|
-
return block.is_error === true ? [{
|
|
292
|
-
type: "tool-error",
|
|
293
|
-
toolCallId: id,
|
|
294
|
-
error: said
|
|
295
|
-
}] : [{
|
|
296
|
-
type: "tool-result",
|
|
297
|
-
toolCallId: id,
|
|
298
|
-
output: said,
|
|
299
|
-
structured
|
|
300
|
-
}];
|
|
301
|
-
}
|
|
302
|
-
return [];
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
const toolOutputOf = (value) => {
|
|
306
|
-
const said = record(value);
|
|
307
|
-
if (said.view !== "full") return {};
|
|
308
|
-
return {
|
|
309
|
-
view: "full",
|
|
310
|
-
...typeof said.bytes === "number" ? { bytes: said.bytes } : {}
|
|
311
|
-
};
|
|
312
|
-
};
|
|
313
|
-
/**
|
|
314
|
-
* What an adapter says about a tool result's output, as `toolOutput` in the result's
|
|
315
|
-
* `providerMetadata` under its own key: `view: 'full'` for output it read from where the CLI
|
|
316
|
-
* saved it (the model got a pointer or nothing), and `bytes`, the saved output's size in UTF-8,
|
|
317
|
-
* when it kept only part of it. An adapter that finds the saved output only after the result
|
|
318
|
-
* went out sends a `raw` part whose `toolOutput` also has the `toolCallId` and the `output` that
|
|
319
|
-
* replaces the result's.
|
|
320
|
-
*/
|
|
321
|
-
function adapterToolOutput(metadata) {
|
|
322
|
-
for (const entry of Object.values(record(metadata))) {
|
|
323
|
-
const said = toolOutputOf(record(entry).toolOutput);
|
|
324
|
-
if (said.view) return said;
|
|
325
|
-
}
|
|
326
|
-
return {};
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Turns an AI SDK harness stream into reeval transcript events: text and reasoning blocks joined,
|
|
330
|
-
* each tool call merged with its result, edits normalized to `file-edit`, web tools given their
|
|
331
|
-
* query or URL, and the harness's duplicate `fileChange` events dropped. Cursor's tool durations
|
|
332
|
-
* come from its runner's own `tool_call` events, because tool results are only flushed at the
|
|
333
|
-
* end of a step. Each tool event's `outputView` is `full` for the tools in `fullToolOutput` and
|
|
334
|
-
* for output an adapter read from where its CLI saved it, else `model`.
|
|
335
|
-
*/
|
|
336
|
-
function normalizeStream(parts, startedAt, options = {}) {
|
|
337
|
-
const fullByHarness = (tool) => options.fullToolOutput === "all" || options.fullToolOutput?.includes(tool) === true;
|
|
338
|
-
const timing = /* @__PURE__ */ new Map();
|
|
339
|
-
const replaced = /* @__PURE__ */ new Map();
|
|
340
|
-
for (const { ms, part } of parts) {
|
|
341
|
-
if (part.type !== "raw") continue;
|
|
342
|
-
const raw = record(part.rawValue);
|
|
343
|
-
const later = record(raw.toolOutput);
|
|
344
|
-
if (typeof later.toolCallId === "string" && "output" in later && toolOutputOf(later).view) replaced.set(later.toolCallId, {
|
|
345
|
-
...toolOutputOf(later),
|
|
346
|
-
output: later.output
|
|
347
|
-
});
|
|
348
|
-
const event = raw.type === "event" ? record(raw.event) : {};
|
|
349
|
-
const id = event.type === "tool_call" ? str(event.call_id) : "";
|
|
350
|
-
if (!id) continue;
|
|
351
|
-
const t = timing.get(id) ?? {};
|
|
352
|
-
const started = typeof event.started_at_ms === "number" ? event.started_at_ms - startedAt : void 0;
|
|
353
|
-
const ended = typeof event.completed_at_ms === "number" ? event.completed_at_ms - startedAt : void 0;
|
|
354
|
-
if (started !== void 0) t.at = t.start = started;
|
|
355
|
-
else if (event.status === "running" && t.start === void 0) t.start = ms;
|
|
356
|
-
if (ended !== void 0) {
|
|
357
|
-
t.end = ended;
|
|
358
|
-
if (raw.recovered !== void 0 && t.start !== void 0) t.recovered = true;
|
|
359
|
-
} else if (event.status === "completed" || event.status === "error") t.end = ms;
|
|
360
|
-
timing.set(id, t);
|
|
361
|
-
}
|
|
362
|
-
const out = [];
|
|
363
|
-
const stamp = (at) => ({
|
|
364
|
-
ts: new Date(startedAt + at).toISOString(),
|
|
365
|
-
atMs: at
|
|
366
|
-
});
|
|
367
|
-
const blocks = /* @__PURE__ */ new Map();
|
|
368
|
-
const pending = /* @__PURE__ */ new Map();
|
|
369
|
-
const toolDone = (id, reported, end, failed) => {
|
|
370
|
-
let call = reported;
|
|
371
|
-
const t = timing.get(id);
|
|
372
|
-
const durationMs = toolDurationMs(t?.start ?? call.ms, call, end.ms, t);
|
|
373
|
-
call = t?.at === void 0 ? call : {
|
|
374
|
-
...call,
|
|
375
|
-
ms: t.at
|
|
376
|
-
};
|
|
377
|
-
const input = record(call.part.input);
|
|
378
|
-
const name = toolName(call.part);
|
|
379
|
-
const replacement = failed ? void 0 : replaced.get(id);
|
|
380
|
-
const raw = failed ? errorText(end.part.error) : replacement ? replacement.output : end.part.output;
|
|
381
|
-
const subagent = str(call.part.subagent);
|
|
382
|
-
const structured = record(end.part.structured);
|
|
383
|
-
const output = subagent && (name === "edit" || name === "write") && !failed ? typeof structured.filePath === "string" ? {
|
|
384
|
-
...structured,
|
|
385
|
-
filePath: inWorkspace(structured.filePath)
|
|
386
|
-
} : subagentEditOutput(name, input, str(raw)) : name === "bash" && typeof raw === "string" ? raw.replace(/\r\n/g, "\n") : raw;
|
|
387
|
-
const base = {
|
|
388
|
-
...stamp(call.ms),
|
|
389
|
-
durationMs,
|
|
390
|
-
...stallFlags(name, durationMs),
|
|
391
|
-
...subagent ? { subagent } : {}
|
|
392
|
-
};
|
|
393
|
-
if ((name === "edit" || name === "write" || name === "delete") && !failed) {
|
|
394
|
-
for (const edit of fileEdits(id, output, name, input)) out.push({
|
|
395
|
-
at: call.ms,
|
|
396
|
-
event: {
|
|
397
|
-
...base,
|
|
398
|
-
...edit,
|
|
399
|
-
...stallFlags(name, durationMs)
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
if (name === "webSearch") {
|
|
405
|
-
out.push({
|
|
406
|
-
at: call.ms,
|
|
407
|
-
event: {
|
|
408
|
-
...base,
|
|
409
|
-
type: "web-search",
|
|
410
|
-
toolCallId: id,
|
|
411
|
-
query: str(input.searchTerm) || str(input.query),
|
|
412
|
-
references: failed ? null : searchReferences(output),
|
|
413
|
-
ok: !failed
|
|
414
|
-
}
|
|
415
|
-
});
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
if (name === "webFetch" || name === "WebFetch") {
|
|
419
|
-
const result = record(output);
|
|
420
|
-
const status = typeof result.code === "number" ? result.code : void 0;
|
|
421
|
-
out.push({
|
|
422
|
-
at: call.ms,
|
|
423
|
-
event: {
|
|
424
|
-
...base,
|
|
425
|
-
type: "web-fetch",
|
|
426
|
-
toolCallId: id,
|
|
427
|
-
url: str(input.url),
|
|
428
|
-
ok: !failed && result.success !== false && (status === void 0 || status >= 200 && status < 400)
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
const said = replacement ?? adapterToolOutput(end.part.providerMetadata);
|
|
434
|
-
out.push({
|
|
435
|
-
at: call.ms,
|
|
436
|
-
event: {
|
|
437
|
-
...base,
|
|
438
|
-
type: "tool",
|
|
439
|
-
toolCallId: id,
|
|
440
|
-
tool: name,
|
|
441
|
-
input: toolInput(call.part),
|
|
442
|
-
output,
|
|
443
|
-
outputView: said.view ?? (fullByHarness(name) ? "full" : "model"),
|
|
444
|
-
...said.bytes !== void 0 ? { outputTruncated: { bytes: said.bytes } } : {},
|
|
445
|
-
ok: !failed
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
};
|
|
449
|
-
for (const stamped of parts) {
|
|
450
|
-
const { ms, part } = stamped;
|
|
451
|
-
switch (part.type) {
|
|
452
|
-
case "raw":
|
|
453
|
-
for (const sub of subagentParts(record(part.rawValue))) {
|
|
454
|
-
const id = str(sub.toolCallId);
|
|
455
|
-
if (sub.type === "tool-call") {
|
|
456
|
-
pending.set(id, {
|
|
457
|
-
ms,
|
|
458
|
-
part: sub
|
|
459
|
-
});
|
|
460
|
-
continue;
|
|
461
|
-
}
|
|
462
|
-
const call = pending.get(id);
|
|
463
|
-
if (!call) continue;
|
|
464
|
-
pending.delete(id);
|
|
465
|
-
toolDone(id, call, {
|
|
466
|
-
ms,
|
|
467
|
-
part: sub
|
|
468
|
-
}, sub.type === "tool-error");
|
|
469
|
-
}
|
|
470
|
-
break;
|
|
471
|
-
case "text-start":
|
|
472
|
-
case "reasoning-start": {
|
|
473
|
-
const recovered = part.type === "reasoning-start" ? recoveredTiming(part) : void 0;
|
|
474
|
-
blocks.set(str(part.id), {
|
|
475
|
-
type: part.type === "text-start" ? "text" : "reasoning",
|
|
476
|
-
ms: recovered ? Math.max(0, ms - recovered.startedBeforeMs) : ms,
|
|
477
|
-
text: "",
|
|
478
|
-
...recovered ? { durationMs: recovered.durationMs } : {}
|
|
479
|
-
});
|
|
480
|
-
break;
|
|
481
|
-
}
|
|
482
|
-
case "text-delta":
|
|
483
|
-
case "reasoning-delta": {
|
|
484
|
-
const block = blocks.get(str(part.id));
|
|
485
|
-
if (block) block.text += str(part.text ?? part.delta);
|
|
486
|
-
break;
|
|
487
|
-
}
|
|
488
|
-
case "text-end":
|
|
489
|
-
case "reasoning-end": {
|
|
490
|
-
const block = blocks.get(str(part.id));
|
|
491
|
-
blocks.delete(str(part.id));
|
|
492
|
-
if (block?.text.trim()) out.push({
|
|
493
|
-
at: block.ms,
|
|
494
|
-
event: {
|
|
495
|
-
...stamp(block.ms),
|
|
496
|
-
type: block.type,
|
|
497
|
-
text: block.text,
|
|
498
|
-
durationMs: block.durationMs !== void 0 ? block.durationMs : ms - block.ms
|
|
499
|
-
}
|
|
500
|
-
});
|
|
501
|
-
break;
|
|
502
|
-
}
|
|
503
|
-
case "tool-call":
|
|
504
|
-
if (!isFileChangeEcho(part)) pending.set(str(part.toolCallId), {
|
|
505
|
-
ms,
|
|
506
|
-
part
|
|
507
|
-
});
|
|
508
|
-
break;
|
|
509
|
-
case "tool-result":
|
|
510
|
-
case "tool-error": {
|
|
511
|
-
if (isFileChangeEcho(part)) break;
|
|
512
|
-
const id = str(part.toolCallId);
|
|
513
|
-
const call = pending.get(id);
|
|
514
|
-
if (!call) break;
|
|
515
|
-
pending.delete(id);
|
|
516
|
-
toolDone(id, call, stamped, part.type === "tool-error");
|
|
517
|
-
break;
|
|
518
|
-
}
|
|
519
|
-
case "error":
|
|
520
|
-
out.push({
|
|
521
|
-
at: ms,
|
|
522
|
-
event: {
|
|
523
|
-
...stamp(ms),
|
|
524
|
-
type: "error",
|
|
525
|
-
message: errorText(part.error)
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
break;
|
|
529
|
-
case "finish-step": if (part.finishReason === "error") {
|
|
530
|
-
const message = `A model call failed (${str(part.rawFinishReason) || "error"}), and the agent retried it`;
|
|
531
|
-
out.push({
|
|
532
|
-
at: ms,
|
|
533
|
-
event: {
|
|
534
|
-
...stamp(ms),
|
|
535
|
-
type: "retry",
|
|
536
|
-
message
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
const streamEndMs = parts.at(-1)?.ms;
|
|
543
|
-
for (const [id, call] of pending) {
|
|
544
|
-
const name = toolName(call.part);
|
|
545
|
-
const input = record(call.part.input);
|
|
546
|
-
const t = timing.get(id);
|
|
547
|
-
const start = t?.start ?? call.ms;
|
|
548
|
-
const durationMs = streamEndMs === void 0 ? null : toolDurationMs(start, call, streamEndMs, t);
|
|
549
|
-
const subagent = str(call.part.subagent);
|
|
550
|
-
const base = {
|
|
551
|
-
...stamp(call.ms),
|
|
552
|
-
durationMs,
|
|
553
|
-
...stallFlags(name, durationMs),
|
|
554
|
-
...subagent ? { subagent } : {}
|
|
555
|
-
};
|
|
556
|
-
if (name === "webSearch") {
|
|
557
|
-
out.push({
|
|
558
|
-
at: call.ms,
|
|
559
|
-
event: {
|
|
560
|
-
...base,
|
|
561
|
-
type: "web-search",
|
|
562
|
-
toolCallId: id,
|
|
563
|
-
query: str(input.searchTerm) || str(input.query),
|
|
564
|
-
references: null,
|
|
565
|
-
ok: null
|
|
566
|
-
}
|
|
567
|
-
});
|
|
568
|
-
continue;
|
|
569
|
-
}
|
|
570
|
-
if (name === "webFetch" || name === "WebFetch") {
|
|
571
|
-
out.push({
|
|
572
|
-
at: call.ms,
|
|
573
|
-
event: {
|
|
574
|
-
...base,
|
|
575
|
-
type: "web-fetch",
|
|
576
|
-
toolCallId: id,
|
|
577
|
-
url: str(input.url),
|
|
578
|
-
ok: null
|
|
579
|
-
}
|
|
580
|
-
});
|
|
581
|
-
continue;
|
|
582
|
-
}
|
|
583
|
-
out.push({
|
|
584
|
-
at: call.ms,
|
|
585
|
-
event: {
|
|
586
|
-
...base,
|
|
587
|
-
type: "tool",
|
|
588
|
-
toolCallId: id,
|
|
589
|
-
tool: name,
|
|
590
|
-
input: toolInput(call.part),
|
|
591
|
-
output: null,
|
|
592
|
-
ok: null
|
|
593
|
-
}
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
for (const [, block] of blocks) if (block.text.trim()) out.push({
|
|
597
|
-
at: block.ms,
|
|
598
|
-
event: {
|
|
599
|
-
...stamp(block.ms),
|
|
600
|
-
type: block.type,
|
|
601
|
-
text: block.text,
|
|
602
|
-
durationMs: null
|
|
603
|
-
}
|
|
604
|
-
});
|
|
605
|
-
return out.sort((a, b) => a.at - b.at).map((e) => e.event);
|
|
606
|
-
}
|
|
607
|
-
/** Whether a harness's reasoning blocks carry their time: streamed, or recovered with it. */
|
|
608
|
-
const timesReasoning = (delivery) => delivery === "streamed" || delivery === "recovered";
|
|
609
|
-
/**
|
|
610
|
-
* A turn's reasoning time, from the reasoning blocks the harness streamed; null when it can't be
|
|
611
|
-
* known. A harness whose reasoning arrives whole (`whole`) or not at all (`none`) can't time it.
|
|
612
|
-
* A streamed or recovered turn with no reasoning block has spent none only when its usage says it
|
|
613
|
-
* used no reasoning tokens; otherwise the model may have reasoned without the harness showing it.
|
|
614
|
-
*/
|
|
615
|
-
function reasoningTime(delivery, events, usage) {
|
|
616
|
-
if (!timesReasoning(delivery)) return null;
|
|
617
|
-
const blocks = events.flatMap((e) => e.type === "reasoning" ? [e.durationMs] : []);
|
|
618
|
-
if (blocks.length === 0) return usage?.reasoning === 0 ? 0 : null;
|
|
619
|
-
if (blocks.some((ms) => ms === null)) return null;
|
|
620
|
-
return blocks.reduce((n, ms) => n + (ms ?? 0), 0);
|
|
621
|
-
}
|
|
622
|
-
// src/harness/agent.ts
|
|
623
|
-
/** A stream part into the attempt's trace, and each tool call as a `-v` line as it happens. */
|
|
624
|
-
function traceStreamPart(part, ms, tools) {
|
|
625
|
-
const p = part;
|
|
626
|
-
debugTrace("harness", "stream", {
|
|
627
|
-
ms,
|
|
628
|
-
part
|
|
629
|
-
}, p.type.endsWith("-delta") ? false : `stream ${p.type}`);
|
|
630
|
-
if (p.type === "tool-call" && p.toolCallId) {
|
|
631
|
-
const name = p.toolName ?? "tool";
|
|
632
|
-
tools.set(p.toolCallId, {
|
|
633
|
-
name,
|
|
634
|
-
at: ms
|
|
635
|
-
});
|
|
636
|
-
debugLog("harness", `tool ${name} called (${p.toolCallId})`);
|
|
637
|
-
} else if ((p.type === "tool-result" || p.type === "tool-error") && p.toolCallId) {
|
|
638
|
-
const call = tools.get(p.toolCallId);
|
|
639
|
-
const took = call ? ` in ${ms - call.at}ms` : "";
|
|
640
|
-
const how = p.type === "tool-error" ? `failed: ${errorText(p.error)}` : "returned";
|
|
641
|
-
debugLog("harness", `tool ${call?.name ?? p.toolName ?? "tool"} ${how}${took} (${p.toolCallId})`);
|
|
642
|
-
} else if (p.type === "error") debugLog("harness", `stream error: ${errorText(p.error)}`);
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* Each turn's cost from what the harness reports on its finish: a session's running total, as
|
|
646
|
-
* Claude Code's is, less what its earlier turns reported. A total that fell, or a session other
|
|
647
|
-
* than the attempt's first, can't be split into turns, so that turn has no reported cost; nor
|
|
648
|
-
* has one the harness put at $0, which it says for a model its own prices don't list.
|
|
649
|
-
*/
|
|
650
|
-
function turnCosts(reported, source) {
|
|
651
|
-
let session;
|
|
652
|
-
let before = 0;
|
|
653
|
-
return (harnessMetadata) => {
|
|
654
|
-
const said = reported?.(harnessMetadata);
|
|
655
|
-
if (!said) return void 0;
|
|
656
|
-
let usd = said.usd;
|
|
657
|
-
if (said.session !== void 0) {
|
|
658
|
-
const same = session === void 0 || session === said.session;
|
|
659
|
-
const fell = said.usd < before;
|
|
660
|
-
session ??= said.session;
|
|
661
|
-
if (!same) return void 0;
|
|
662
|
-
usd = Math.round((said.usd - before) * 1e9) / 1e9;
|
|
663
|
-
before = said.usd;
|
|
664
|
-
if (fell) return void 0;
|
|
665
|
-
}
|
|
666
|
-
return usd > 0 ? {
|
|
667
|
-
usd,
|
|
668
|
-
basis: "reported",
|
|
669
|
-
source
|
|
670
|
-
} : void 0;
|
|
671
|
-
};
|
|
672
|
-
}
|
|
673
|
-
/** How long reading a CLI's stored usage gets, past which the turn keeps none. */
|
|
674
|
-
const STORED_USAGE_MS = 5e3;
|
|
675
|
-
/** An adapter's usage, in the AI SDK's provider shape, as reeval's; null when it counts nothing. */
|
|
676
|
-
function harnessUsage(usage) {
|
|
677
|
-
const { inputTokens: input, outputTokens: output } = usage;
|
|
678
|
-
if (input.total === void 0 && output.total === void 0) return null;
|
|
679
|
-
const cacheRead = input.cacheRead ?? 0;
|
|
680
|
-
const cacheWrite = input.cacheWrite ?? 0;
|
|
681
|
-
return {
|
|
682
|
-
input: input.noCache ?? Math.max((input.total ?? 0) - cacheRead - cacheWrite, 0),
|
|
683
|
-
output: output.total ?? 0,
|
|
684
|
-
cacheRead,
|
|
685
|
-
cacheWrite,
|
|
686
|
-
reasoning: output.reasoning ?? null
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
|
-
/**
|
|
690
|
-
* The adapter, with every part its sessions emit also passed to `onPart`. `HarnessAgent` keeps
|
|
691
|
-
* the `stream-start` part's `modelId` (the model the runtime resolved) to itself.
|
|
692
|
-
*/
|
|
693
|
-
function observed(adapter, onPart) {
|
|
694
|
-
const session = (s) => new Proxy(s, { get(target, key, receiver) {
|
|
695
|
-
const value = Reflect.get(target, key, receiver);
|
|
696
|
-
if (key !== "doPromptTurn" && key !== "doContinueTurn") return value;
|
|
697
|
-
return (turn) => value.call(target, {
|
|
698
|
-
...turn,
|
|
699
|
-
emit: (part) => {
|
|
700
|
-
onPart(part);
|
|
701
|
-
turn.emit(part);
|
|
702
|
-
}
|
|
703
|
-
});
|
|
704
|
-
} });
|
|
705
|
-
return new Proxy(adapter, { get(target, key, receiver) {
|
|
706
|
-
const value = Reflect.get(target, key, receiver);
|
|
707
|
-
if (key !== "doStart") return value;
|
|
708
|
-
return async (...args) => session(await value.apply(target, args));
|
|
709
|
-
} });
|
|
710
|
-
}
|
|
711
|
-
/**
|
|
712
|
-
* The built-in tools that wait on a person, which an eval has none of. Claude Code's
|
|
713
|
-
* `AskUserQuestion` ends the turn on a tool call only the host answers, and the session takes no
|
|
714
|
-
* new prompt until it gets one, so the agent is never offered it and asks in its reply instead.
|
|
715
|
-
*/
|
|
716
|
-
const INTERACTIVE_TOOLS = ["askUserQuestions"];
|
|
717
|
-
/** The adapter's built-in tools reeval turns off: those of {@link INTERACTIVE_TOOLS} it offers. */
|
|
718
|
-
function interactiveTools(adapter) {
|
|
719
|
-
return INTERACTIVE_TOOLS.filter((name) => Object.hasOwn(adapter.builtinTools, name));
|
|
720
|
-
}
|
|
721
|
-
/**
|
|
722
|
-
* The turn's error when every model call the egress gateway brokered in it got an HTTP error,
|
|
723
|
-
* naming the statuses; undefined when one succeeded or none was brokered.
|
|
724
|
-
*/
|
|
725
|
-
function everyCallFailed(name, statuses) {
|
|
726
|
-
if (statuses.length === 0 || statuses.some((s) => s < 400)) return void 0;
|
|
727
|
-
return `every ${name} model call in the turn failed (HTTP ${[...new Set(statuses)].join(", ")})`;
|
|
728
|
-
}
|
|
729
|
-
/**
|
|
730
|
-
* The turn's refused-key error (`hinted`, the first error `authHint` named the key in) when the API
|
|
731
|
-
* rejected the harness's key for the whole turn: the turn errored, or every brokered call failed,
|
|
732
|
-
* and no call the gateway brokered with the key in it succeeded. A key that served one call isn't
|
|
733
|
-
* rejected, whatever the turn's error says: a 401 the CLI retried past, or refused-key wording
|
|
734
|
-
* that came from elsewhere (a tool's or MCP server's output in the CLI's stderr).
|
|
735
|
-
*/
|
|
736
|
-
function rejectedKey(turn) {
|
|
737
|
-
const { hinted, status, statuses } = turn;
|
|
738
|
-
if (!hinted || status === "aborted" || statuses.some((s) => s < 400)) return void 0;
|
|
739
|
-
return status === "error" || statuses.length > 0 ? hinted : void 0;
|
|
740
|
-
}
|
|
741
|
-
/** The route's service account, written beside the workspace, as the adapter takes it. */
|
|
742
|
-
async function writeAdc(sandbox, adc) {
|
|
743
|
-
await sandbox.writeFile(`../${adc.file}`, adc.content);
|
|
744
|
-
const credentialsFile = `${sandbox.workdir.replace(/[\\/][^\\/]*$/, "")}/${adc.file}`;
|
|
745
|
-
debugLog("env", `Vertex AI service account → ${credentialsFile}`);
|
|
746
|
-
return {
|
|
747
|
-
project: adc.project,
|
|
748
|
-
location: adc.location,
|
|
749
|
-
credentialsFile
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
/**
|
|
753
|
-
* Why `agent` can't run in `sandbox`: its kind has no harness session, can't keep the agent's
|
|
754
|
-
* credential out of it, or runs a platform the agent's bootstrap has no build for.
|
|
755
|
-
*/
|
|
756
|
-
function agentSandboxProblem(agent, sandbox) {
|
|
757
|
-
const fits = runsAgent(agent.platforms);
|
|
758
|
-
const can = capabilitiesOf(sandbox);
|
|
759
|
-
if (fits(can)) return void 0;
|
|
760
|
-
const lacks = [
|
|
761
|
-
...can.harnessSession ? [] : ["has no harness session"],
|
|
762
|
-
...can.brokers ? [] : [`can't keep ${agent.credential} out of it`],
|
|
763
|
-
...!can.harnessSession || agent.platforms.includes(can.platform) ? [] : [`runs ${can.platform}, not ${agent.platforms.join(" or ")}`]
|
|
764
|
-
];
|
|
765
|
-
const fix = suggestedSandbox(fits);
|
|
766
|
-
return `The ${agent.name} harness can't run in the ${sandboxKind(sandbox).provider(sandbox)} sandbox, which ${lacks.join(" and ")}: ${fix ? `set sandbox: ${fix} for this eval, or ` : ""}use fakeHarness() with fakeSandbox()`;
|
|
767
|
-
}
|
|
768
|
-
/** A real agent through its AI SDK harness adapter, in a sandbox that gives it a harness session. */
|
|
769
|
-
function createAgentHarness(descriptor, sandbox, vertex) {
|
|
770
|
-
const catalog = agentFor(descriptor, vertex);
|
|
771
|
-
const problem = agentSandboxProblem(catalog, sandbox);
|
|
772
|
-
if (problem) throw new InfraError(problem);
|
|
773
|
-
return { async start(sandbox, signal, { skills, mcp, plugins }) {
|
|
774
|
-
const auth = agentAuth(catalog);
|
|
775
|
-
let servedModel = null;
|
|
776
|
-
let finishMetadata;
|
|
777
|
-
const turnCost = turnCosts(catalog.reportedCost, descriptor.kind);
|
|
778
|
-
const servers = agentMcp(catalog, mcp, plugins);
|
|
779
|
-
const model = catalog.modelId?.(descriptor.model) ?? descriptor.model;
|
|
780
|
-
const vertex = catalog.adc ? await writeAdc(sandbox, catalog.adc) : void 0;
|
|
781
|
-
const adapter = await catalog.adapter({
|
|
782
|
-
auth,
|
|
783
|
-
...catalog.routeEnv ? { env: catalog.routeEnv } : {},
|
|
784
|
-
...vertex ? { vertex } : {},
|
|
785
|
-
...catalog.vertexChat ? { vertexChat: catalog.vertexChat } : {},
|
|
786
|
-
descriptor,
|
|
787
|
-
model,
|
|
788
|
-
plugins,
|
|
789
|
-
...Object.keys(servers).length ? { mcpServers: catalog.mcpServers(servers) } : {}
|
|
790
|
-
});
|
|
791
|
-
for (const path of await writePluginFiles(sandbox, catalog, plugins)) debugLog("env", `plugin settings → ${path}`);
|
|
792
|
-
const off = interactiveTools(adapter);
|
|
793
|
-
const agent = new HarnessAgent({
|
|
794
|
-
harness: observed(adapter, (part) => {
|
|
795
|
-
if (part.type === "stream-start" && part.modelId && !catalog.configuredModelOnStart) servedModel = part.modelId;
|
|
796
|
-
if (part.type === "finish") finishMetadata = part.harnessMetadata;
|
|
797
|
-
}),
|
|
798
|
-
model,
|
|
799
|
-
permissionMode: "allow-all",
|
|
800
|
-
...off.length ? { inactiveTools: off } : {},
|
|
801
|
-
sandboxConfig: { workDir: WORKSPACE_DIR },
|
|
802
|
-
...skills.length ? { skills } : {}
|
|
803
|
-
});
|
|
804
|
-
if (!hasNetworkSession(sandbox)) throw new InfraError(`The ${catalog.name} harness got a sandbox with no harness session`);
|
|
805
|
-
const refusedSince = (from) => (sandbox.brokeredStatuses?.() ?? []).slice(from).includes(401);
|
|
806
|
-
let stopToken = () => {};
|
|
807
|
-
if (catalog.token) {
|
|
808
|
-
try {
|
|
809
|
-
stopToken = await brokerToken(catalog.token, sandbox.network, {
|
|
810
|
-
onRefresh: (t) => debugLog("broker", `access token refreshed, valid until ${new Date(t.expiresAt).toISOString()}`),
|
|
811
|
-
onError: (error) => debugLog("broker", `access token refresh failed, retrying: ${errorText(error)}`)
|
|
812
|
-
});
|
|
813
|
-
} catch (error) {
|
|
814
|
-
throw new InfraError(`Couldn't mint an access token from ${catalog.credential} for ${catalog.name}: ${errorText(error)}. Run gcloud auth application-default login, or set GOOGLE_APPLICATION_CREDENTIALS.`);
|
|
815
|
-
}
|
|
816
|
-
debugLog("broker", `gateway adds an access token from ${catalog.credential}`);
|
|
817
|
-
}
|
|
818
|
-
let session;
|
|
819
|
-
try {
|
|
820
|
-
session = await agent.createSession({
|
|
821
|
-
sandboxSession: sandbox.network,
|
|
822
|
-
abortSignal: signal
|
|
823
|
-
});
|
|
824
|
-
} catch (error) {
|
|
825
|
-
stopToken();
|
|
826
|
-
if (signal.aborted) throw error;
|
|
827
|
-
const message = error.message;
|
|
828
|
-
const hint = authHint(catalog, message, refusedSince(0));
|
|
829
|
-
throw new InfraError(`${hint ? `${hint}. ` : ""}${catalog.name} harness failed to start: ${message}`, { transient: !hint && error.transient === true });
|
|
830
|
-
}
|
|
831
|
-
const network = sandbox.network;
|
|
832
|
-
let usageMark;
|
|
833
|
-
const storedUsage = async (since) => {
|
|
834
|
-
const store = await catalog.storedUsage?.();
|
|
835
|
-
if (!store) return null;
|
|
836
|
-
const command = store.command({
|
|
837
|
-
since,
|
|
838
|
-
...usageMark ? { mark: usageMark } : {}
|
|
839
|
-
});
|
|
840
|
-
const read = await Promise.resolve(network.run({
|
|
841
|
-
command,
|
|
842
|
-
abortSignal: AbortSignal.timeout(STORED_USAGE_MS)
|
|
843
|
-
})).then(({ exitCode, stdout, stderr }) => {
|
|
844
|
-
if (exitCode !== 0) throw new Error(`exit ${exitCode}: ${stderr.trim().slice(-300)}`);
|
|
845
|
-
return store.parse(stdout);
|
|
846
|
-
}).catch((error) => {
|
|
847
|
-
debugLog("harness", `reading ${catalog.name}'s stored usage failed: ${errorText(error)}`);
|
|
848
|
-
});
|
|
849
|
-
if (!read) {
|
|
850
|
-
debugLog("harness", `no usage in ${catalog.name}'s store since the turn began`);
|
|
851
|
-
return null;
|
|
852
|
-
}
|
|
853
|
-
if (read.mark) usageMark = read.mark;
|
|
854
|
-
const usage = harnessUsage(read.usage);
|
|
855
|
-
debugLog("harness", `usage read back from ${catalog.name}'s store: ${plural(read.calls, "model call")}${usage ? ` · ${usage.input} in · ${usage.output} out` : ""}`);
|
|
856
|
-
return usage;
|
|
857
|
-
};
|
|
858
|
-
let running;
|
|
859
|
-
let turn;
|
|
860
|
-
return {
|
|
861
|
-
async send(prompt, turnSignal) {
|
|
862
|
-
const startedAt = Date.now();
|
|
863
|
-
const current = { startedAt };
|
|
864
|
-
turn = current;
|
|
865
|
-
const parts = [];
|
|
866
|
-
const servedBefore = sandbox.servedRequests?.().length ?? 0;
|
|
867
|
-
const brokeredBefore = sandbox.brokeredStatuses?.().length ?? 0;
|
|
868
|
-
servedModel = null;
|
|
869
|
-
finishMetadata = void 0;
|
|
870
|
-
let stepUsage = null;
|
|
871
|
-
const steps = [];
|
|
872
|
-
const finish = async (text, status, extra = [], reported = stepUsage) => {
|
|
873
|
-
const usage = reported ?? await (current.salvaged ?? storedUsage(startedAt));
|
|
874
|
-
const statuses = sandbox.brokeredStatuses?.().slice(brokeredBefore) ?? [];
|
|
875
|
-
const refused = statuses.includes(401);
|
|
876
|
-
const events = [...normalizeStream(parts, startedAt, { ...catalog.fullToolOutput ? { fullToolOutput: catalog.fullToolOutput } : {} }), ...extra].map((e) => e.type === "reasoning" && !timesReasoning(catalog.reasoning) ? {
|
|
877
|
-
...e,
|
|
878
|
-
durationMs: null
|
|
879
|
-
} : e);
|
|
880
|
-
const failed = everyCallFailed(catalog.name, statuses);
|
|
881
|
-
if (status === "completed" && failed && !events.some((e) => e.type === "error")) {
|
|
882
|
-
const at = Date.now() - startedAt;
|
|
883
|
-
status = "error";
|
|
884
|
-
events.push({
|
|
885
|
-
type: "error",
|
|
886
|
-
message: failed,
|
|
887
|
-
ts: new Date(startedAt + at).toISOString(),
|
|
888
|
-
atMs: at
|
|
889
|
-
});
|
|
890
|
-
}
|
|
891
|
-
let hinted;
|
|
892
|
-
const transcript = events.map((e) => {
|
|
893
|
-
if (e.type !== "error") return e;
|
|
894
|
-
const hint = authHint(catalog, e.message, refused);
|
|
895
|
-
if (!hint) return e;
|
|
896
|
-
const message = `${hint}. ${e.message}`;
|
|
897
|
-
hinted ??= message;
|
|
898
|
-
return {
|
|
899
|
-
...e,
|
|
900
|
-
message
|
|
901
|
-
};
|
|
902
|
-
});
|
|
903
|
-
const rejected = rejectedKey({
|
|
904
|
-
hinted,
|
|
905
|
-
status,
|
|
906
|
-
statuses
|
|
907
|
-
});
|
|
908
|
-
const stopped = rejected ? void 0 : providerStop({
|
|
909
|
-
errors: transcript.flatMap((e) => e.type === "error" ? [e.message] : []),
|
|
910
|
-
status,
|
|
911
|
-
statuses
|
|
912
|
-
});
|
|
913
|
-
const cost = turnCost(finishMetadata);
|
|
914
|
-
return {
|
|
915
|
-
text,
|
|
916
|
-
status,
|
|
917
|
-
usage,
|
|
918
|
-
...cost ? { cost } : {},
|
|
919
|
-
model: servedModel ?? sandbox.servedRequests?.().slice(servedBefore).at(-1) ?? null,
|
|
920
|
-
unreported: catalog.unreported?.(finishMetadata) ?? [],
|
|
921
|
-
steps,
|
|
922
|
-
reasoningMs: reasoningTime(catalog.reasoning, transcript, usage),
|
|
923
|
-
startedAt: new Date(startedAt).toISOString(),
|
|
924
|
-
durationMs: Date.now() - startedAt,
|
|
925
|
-
transcript,
|
|
926
|
-
...rejected ? { rejectedKey: rejected } : {},
|
|
927
|
-
...stopped ? { providerStop: stopped } : {},
|
|
928
|
-
...process.env.REEVAL_RAW_TRANSCRIPT ? { raw: parts } : {}
|
|
929
|
-
};
|
|
930
|
-
};
|
|
931
|
-
running = (note) => finish("", "aborted", [note]);
|
|
932
|
-
try {
|
|
933
|
-
const result = await agent.stream({
|
|
934
|
-
session,
|
|
935
|
-
prompt,
|
|
936
|
-
abortSignal: turnSignal
|
|
937
|
-
});
|
|
938
|
-
const tools = /* @__PURE__ */ new Map();
|
|
939
|
-
for await (const part of result.fullStream) {
|
|
940
|
-
const ms = Date.now() - startedAt;
|
|
941
|
-
parts.push({
|
|
942
|
-
ms,
|
|
943
|
-
part
|
|
944
|
-
});
|
|
945
|
-
traceStreamPart(part, ms, tools);
|
|
946
|
-
if (part.type === "finish-step") {
|
|
947
|
-
const step = tokenUsage(part.usage);
|
|
948
|
-
if (step) steps.push(step);
|
|
949
|
-
stepUsage = addUsage(stepUsage, step);
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
const reported = await result.totalUsage;
|
|
953
|
-
const total = tokenUsage(reported);
|
|
954
|
-
const mark = (await catalog.storedUsage?.())?.mark?.(reported.raw);
|
|
955
|
-
if (mark) usageMark = mark;
|
|
956
|
-
const status = turnSignal.aborted ? "aborted" : "completed";
|
|
957
|
-
return finish(await result.text, status, [], total ?? stepUsage);
|
|
958
|
-
} catch (error) {
|
|
959
|
-
const message = errorText(error);
|
|
960
|
-
const at = Date.now() - startedAt;
|
|
961
|
-
const reported = parts.some(({ part }) => part.type === "error" && errorText(part.error) === message);
|
|
962
|
-
return finish("", turnSignal.aborted ? "aborted" : "error", reported ? [] : [{
|
|
963
|
-
type: "error",
|
|
964
|
-
message,
|
|
965
|
-
ts: new Date(startedAt + at).toISOString(),
|
|
966
|
-
atMs: at
|
|
967
|
-
}]);
|
|
968
|
-
} finally {
|
|
969
|
-
if (turn === current) turn = void 0;
|
|
970
|
-
}
|
|
971
|
-
},
|
|
972
|
-
stopped: (note) => running ? running(note) : Promise.reject(/* @__PURE__ */ new Error("No turn is running")),
|
|
973
|
-
salvage: async () => {
|
|
974
|
-
if (!turn) return;
|
|
975
|
-
turn.salvaged ??= storedUsage(turn.startedAt);
|
|
976
|
-
await turn.salvaged;
|
|
977
|
-
},
|
|
978
|
-
close: () => {
|
|
979
|
-
stopToken();
|
|
980
|
-
return session.destroy().catch(() => {});
|
|
981
|
-
}
|
|
982
|
-
};
|
|
983
|
-
} };
|
|
984
|
-
}
|
|
985
|
-
export { createAgentHarness };
|
|
986
|
-
|
|
987
|
-
//# sourceMappingURL=agent-DMYCRwih.js.map
|