reeval 0.14.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/THIRD_PARTY_NOTICES.md +69 -69
- package/assets/gateway-models.mjs +74 -0
- package/dist/{adapter-BloGVZ_a.js → adapter-CRKYPkRt.js} +37 -8
- package/dist/adapter-CRKYPkRt.js.map +1 -0
- package/dist/{agent-m-_t-IuW.js → agent-BgH4-kFc.js} +58 -16
- package/dist/agent-BgH4-kFc.js.map +1 -0
- package/dist/{app-files-C-jwhRDt.js → app-files-BMVBr079.js} +4 -4
- package/dist/app-files-BMVBr079.js.map +1 -0
- package/dist/{assemble-BDEpelpi.js → assemble-BVbI6NW-.js} +214 -128
- package/dist/assemble-BVbI6NW-.js.map +1 -0
- package/dist/assemble-SiHa4__F.js +1 -0
- package/dist/{attempt-jI0OWxlz.js → attempt-CpbZ9arV.js} +10 -10
- package/dist/{attempt-jI0OWxlz.js.map → attempt-CpbZ9arV.js.map} +1 -1
- package/dist/{match-Bz0nSdzN.js → attempt-host-CIxjs2Be.js} +104 -6
- package/dist/attempt-host-CIxjs2Be.js.map +1 -0
- package/dist/{capture-CVRwRTnb.js → capture-iQ6kYJV0.js} +2360 -1523
- package/dist/capture-iQ6kYJV0.js.map +1 -0
- package/dist/capture-px7Ey95_.js +1 -0
- package/dist/{cli-C_4gaJ50.js → cli-1YQU-66F.js} +153 -180
- package/dist/cli-1YQU-66F.js.map +1 -0
- package/dist/{cli-spec-CpnbATtI.js → cli-spec-CPWT1mAG.js} +10 -21
- package/dist/cli-spec-CPWT1mAG.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{client-D5hNjpEx.js → client-DMmOkbRA.js} +14 -7
- package/dist/client-DMmOkbRA.js.map +1 -0
- package/dist/{command-BXLUfw4h.js → command-8_Cg5v6b.js} +35 -22
- package/dist/command-8_Cg5v6b.js.map +1 -0
- package/dist/{command-I1euLLio.js → command-BlYCAqu-.js} +7 -7
- package/dist/{command-I1euLLio.js.map → command-BlYCAqu-.js.map} +1 -1
- package/dist/{validate-BhwqrVsm.js → command-C-HeGlap.js} +388 -60
- package/dist/command-C-HeGlap.js.map +1 -0
- package/dist/{command-Bxdy62dW.js → command-Cr1zjRvl.js} +32 -31
- package/dist/command-Cr1zjRvl.js.map +1 -0
- package/dist/{commands-p1S4nw_H.js → commands-Bj9NbmsO.js} +1 -1
- package/dist/{commands-jzigbNFb.js → commands-BvTNZ2-b.js} +181 -73
- package/dist/commands-BvTNZ2-b.js.map +1 -0
- package/dist/{config-BrdHA9bJ.js → config-CneBZB84.js} +883 -433
- package/dist/config-CneBZB84.js.map +1 -0
- package/dist/{contrasts-DRxMQQTC.js → contrasts-lhFsekco.js} +3 -3
- package/dist/{contrasts-DRxMQQTC.js.map → contrasts-lhFsekco.js.map} +1 -1
- package/dist/cost-C5RBTTJr.js +1 -0
- package/dist/{cost-D4elx933.js → cost-ChPa8-Fp.js} +3 -3
- package/dist/cost-ChPa8-Fp.js.map +1 -0
- package/dist/db-BnXyamuj.js +2 -0
- package/dist/db-Cnh3jIv_.js +1530 -0
- package/dist/db-Cnh3jIv_.js.map +1 -0
- package/dist/debug-CAx3qcaP.js +1 -0
- package/dist/{debug-D24NOQH1.js → debug-CgG3T071.js} +5 -2
- package/dist/debug-CgG3T071.js.map +1 -0
- package/dist/{docker-BnRlTpZA.js → docker-BihzJwbV.js} +11 -6
- package/dist/docker-BihzJwbV.js.map +1 -0
- package/dist/{docker-D01slDF3.js → docker-Cqq03H72.js} +26 -8
- package/dist/docker-Cqq03H72.js.map +1 -0
- package/dist/{docker-DivfZl2u.js → docker-DCAtFMo9.js} +1 -1
- package/dist/{doctor-DQ2p0euG.js → doctor-Dl4vMeqt.js} +275 -37
- package/dist/doctor-Dl4vMeqt.js.map +1 -0
- package/dist/{env-BQqj93gu.js → env-CARj5Axq.js} +6 -3
- package/dist/env-CARj5Axq.js.map +1 -0
- package/dist/{environment-CO0P0soF.js → environment-Cf5HMjib.js} +116 -297
- package/dist/environment-Cf5HMjib.js.map +1 -0
- package/dist/{errors-r025B0Zb.js → errors-CHebohjc.js} +10 -4
- package/dist/{errors-r025B0Zb.js.map → errors-CHebohjc.js.map} +1 -1
- package/dist/eval-source-CAE4y2Sr.js +146 -0
- package/dist/eval-source-CAE4y2Sr.js.map +1 -0
- package/dist/{evaluate-BUmsN7yG.js → evaluate-CUtgyr43.js} +682 -150
- package/dist/evaluate-CUtgyr43.js.map +1 -0
- package/dist/evaluate-D35T51AC.d.ts +45 -0
- package/dist/files-BEnUJW1e.js +1 -0
- package/dist/{files-B-CJeeEh.js → files-BRViE7m-.js} +200 -87
- package/dist/files-BRViE7m-.js.map +1 -0
- package/dist/{files-kUCrswI6.js → files-BSqA2sZE.js} +20 -9
- package/dist/files-BSqA2sZE.js.map +1 -0
- package/dist/files-C3tQtD26.js +1 -0
- package/dist/files-CNiJ_fZf.js +37 -0
- package/dist/files-CNiJ_fZf.js.map +1 -0
- package/dist/{files-Ca0d6Uq3.js → files-D1y8Pg4Z.js} +35 -7
- package/dist/files-D1y8Pg4Z.js.map +1 -0
- package/dist/files-Dts7EY3H.js +1 -0
- package/dist/{pairs-CHfZNRT6.js → gate-BC6SdQZs.js} +58 -4
- package/dist/gate-BC6SdQZs.js.map +1 -0
- package/dist/gateway.d.ts +22 -9
- package/dist/gateway.js +30 -8
- package/dist/gateway.js.map +1 -1
- package/dist/{git-Bk8DSwHy.js → git-UNxT_3z0.js} +3 -3
- package/dist/{git-Bk8DSwHy.js.map → git-UNxT_3z0.js.map} +1 -1
- package/dist/harness-3NVyTSGK.js +392 -0
- package/dist/harness-3NVyTSGK.js.map +1 -0
- package/dist/harness.d.ts +12 -8
- package/dist/harness.js +1 -1
- package/dist/{images-DzLeFjLx.js → images-8A_LzVfw.js} +8 -8
- package/dist/{images-DzLeFjLx.js.map → images-8A_LzVfw.js.map} +1 -1
- package/dist/index.d.ts +99 -11
- package/dist/index.js +5 -5
- package/dist/init-okoALIah.js +1 -0
- package/dist/{init-SRalM5xF.js → init-sFBgODhu.js} +10 -11
- package/dist/init-sFBgODhu.js.map +1 -0
- package/dist/{invocations-DzyKSJBa.js → invocations-C9ejlOYl.js} +10 -6
- package/dist/invocations-C9ejlOYl.js.map +1 -0
- package/dist/{judge-yLvjC5A3.js → judge-Bg4v4e_K.js} +236 -46
- package/dist/judge-Bg4v4e_K.js.map +1 -0
- package/dist/judge.d.ts +5 -7
- package/dist/judge.js +4 -8
- package/dist/judge.js.map +1 -1
- package/dist/{live-DYd2QEyR.js → live-DeMvnDD5.js} +3 -3
- package/dist/{live-DYd2QEyR.js.map → live-DeMvnDD5.js.map} +1 -1
- package/dist/{matchers-D4eUqx4j.js → matchers-BKPuaXlj.js} +14 -13
- package/dist/matchers-BKPuaXlj.js.map +1 -0
- package/dist/{model-1ZLr9Dcv.js → model-2rBZrdZA.js} +29 -36
- package/dist/model-2rBZrdZA.js.map +1 -0
- package/dist/{model-B45lDUV1.js → model-3MJtpho8.js} +22 -13
- package/dist/model-3MJtpho8.js.map +1 -0
- package/dist/{model-CgnOpss4.js → model-Bz7-j71_.js} +245 -68
- package/dist/model-Bz7-j71_.js.map +1 -0
- package/dist/model-DkPwypN4.js +1 -0
- package/dist/model-bREXVXwT.js +1 -0
- package/dist/{node-BSq5qHnQ.js → node-fP-H2uxn.js} +72 -50
- package/dist/node-fP-H2uxn.js.map +1 -0
- package/dist/{object-CLf2-tNq.js → object-BkXGPKWY.js} +3 -2
- package/dist/object-BkXGPKWY.js.map +1 -0
- package/dist/opencode-providers-Bz0l7OZI.js +3276 -0
- package/dist/opencode-providers-Bz0l7OZI.js.map +1 -0
- package/dist/openrouter-models-Bo8PZ4Ew.js +34 -0
- package/dist/openrouter-models-Bo8PZ4Ew.js.map +1 -0
- package/dist/{patch-DWf-I_Q_.js → patch-6T9XAipm.js} +7 -9
- package/dist/patch-6T9XAipm.js.map +1 -0
- package/dist/patch-CquGAGX5.js +76 -0
- package/dist/patch-CquGAGX5.js.map +1 -0
- package/dist/{plan-BIwUzlB8.js → plan-Dw2BjafJ.js} +79 -35
- package/dist/plan-Dw2BjafJ.js.map +1 -0
- package/dist/{plugins-Dkp_H3pB.js → plugins-ngQEJBjJ.js} +274 -17
- package/dist/plugins-ngQEJBjJ.js.map +1 -0
- package/dist/{preflight-D9y-HvZQ.js → preflight-BYXkweNN.js} +1 -1
- package/dist/{preflight-DJCD_BDn.js → preflight-CDRpog9o.js} +3 -3
- package/dist/{preflight-DJCD_BDn.js.map → preflight-CDRpog9o.js.map} +1 -1
- package/dist/{prepare-BJG_pD54.js → prepare-B3btUlT6.js} +2 -2
- package/dist/{prepare-CIxCGG0M.js → prepare-PkARUGoF.js} +8 -8
- package/dist/{prepare-CIxCGG0M.js.map → prepare-PkARUGoF.js.map} +1 -1
- package/dist/{prices-BcLEXvdY.js → prices-QaS-kjSQ.js} +7 -4
- package/dist/prices-QaS-kjSQ.js.map +1 -0
- package/dist/{provenance-CfZpFpAh.js → provenance-7Hzg88f4.js} +4 -4
- package/dist/{provenance-CfZpFpAh.js.map → provenance-7Hzg88f4.js.map} +1 -1
- package/dist/{providers-D1Zxp2he.js → providers-DDNMbv1T.js} +1 -1
- package/dist/{providers-DFk_6W4K.js → providers-PKoJtGK0.js} +5 -5
- package/dist/{providers-DFk_6W4K.js.map → providers-PKoJtGK0.js.map} +1 -1
- package/dist/query-Bt6vLJ3m.js +1 -0
- package/dist/{query-CemclveB.js → query-nBXrgEwl.js} +3 -3
- package/dist/{query-CemclveB.js.map → query-nBXrgEwl.js.map} +1 -1
- package/dist/{questions-bAudIc04.js → questions-CkAwePPR.js} +110 -36
- package/dist/questions-CkAwePPR.js.map +1 -0
- package/dist/{record-kk9M1hj-.js → record-DZBCjuwm.js} +6 -6
- package/dist/{record-kk9M1hj-.js.map → record-DZBCjuwm.js.map} +1 -1
- package/dist/redact-DVIaahLv.js +658 -0
- package/dist/redact-DVIaahLv.js.map +1 -0
- package/dist/remarks-Bp6AwPgb.js +1 -0
- package/dist/{rules-VhftPOOT.js → remarks-Bt0zwiQB.js} +330 -66
- package/dist/remarks-Bt0zwiQB.js.map +1 -0
- package/dist/{header-BLPP6aCU.js → remarks-IFFe_oty.js} +35 -9
- package/dist/remarks-IFFe_oty.js.map +1 -0
- package/dist/{remarks-mujJv1Ey.js → remarks-eBcrIZRu.js} +10 -5
- package/dist/remarks-eBcrIZRu.js.map +1 -0
- package/dist/{remote-CKcEKja4.js → remote-DfJYiP-R.js} +39 -99
- package/dist/remote-DfJYiP-R.js.map +1 -0
- package/dist/resolve-CT4XZIfV.js +1 -0
- package/dist/{resolve-CBoKzQMP.js → resolve-D_cLa4tW.js} +46 -30
- package/dist/resolve-D_cLa4tW.js.map +1 -0
- package/dist/results-DrKJuIQF.js +63 -0
- package/dist/results-DrKJuIQF.js.map +1 -0
- package/dist/{resume-B9SOSnK9.js → resume-BmIM52MJ.js} +47 -17
- package/dist/resume-BmIM52MJ.js.map +1 -0
- package/dist/{runtime-BgQRyCLl.js → runtime-CZVpkr04.js} +139 -48
- package/dist/runtime-CZVpkr04.js.map +1 -0
- package/dist/{sandbox-BOYZ0hlo.js → sandbox-Cmi6IQML.js} +2 -2
- package/dist/{sandbox-BOYZ0hlo.js.map → sandbox-Cmi6IQML.js.map} +1 -1
- package/dist/sandbox.d.ts +1 -1
- package/dist/sandbox.js +1 -1
- package/dist/server-CKJOnIB0.js +1 -0
- package/dist/{server-TGW4WyAz.js → server-DS8BGhGU.js} +75 -33
- package/dist/server-DS8BGhGU.js.map +1 -0
- package/dist/{shared-BDUzStad.js → shared-B_lvGqWz.js} +19 -11
- package/dist/shared-B_lvGqWz.js.map +1 -0
- package/dist/source-CgUqpumI.js +1 -0
- package/dist/source-DcXv4de-.js +59 -0
- package/dist/source-DcXv4de-.js.map +1 -0
- package/dist/{src-CHIwOy0o.js → src-1lpTocbd.js} +75 -30
- package/dist/{src-CHIwOy0o.js.map → src-1lpTocbd.js.map} +1 -1
- package/dist/{src-DjF_M8_f.js → src-8yTF251P.js} +30 -8
- package/dist/{src-DjF_M8_f.js.map → src-8yTF251P.js.map} +1 -1
- package/dist/{src-DjRI-IeE.js → src-A8HLtO0a.js} +135 -35
- package/dist/{src-DjRI-IeE.js.map → src-A8HLtO0a.js.map} +1 -1
- package/dist/{src-NSdQ9zI6.js → src-BO8AYqJ5.js} +17 -5
- package/dist/src-BO8AYqJ5.js.map +1 -0
- package/dist/src-BTqJbvj6.js +2 -0
- package/dist/{src-DmUgeTlE.js → src-BYDOXw_Y.js} +23 -7
- package/dist/{src-DmUgeTlE.js.map → src-BYDOXw_Y.js.map} +1 -1
- package/dist/src-BkiComGh.js +2 -0
- package/dist/src-BvgeZ4tS.js +2 -0
- package/dist/{src-8zoX_qrb.js → src-C0ySiej5.js} +572 -1067
- package/dist/src-C0ySiej5.js.map +1 -0
- package/dist/src-CgJrz5p0.js +3 -0
- package/dist/src-Cp-2Hdib.js +2 -0
- package/dist/{src-CyaDNG9r.js → src-DMo2eCOJ.js} +1 -1
- package/dist/{src-ChhtI6BP.js → src-DSZyg0Uq.js} +177 -28
- package/dist/src-DSZyg0Uq.js.map +1 -0
- package/dist/src-Dk2Na0b-.js +2 -0
- package/dist/src-OESRtvOi.js +2 -0
- package/dist/{src-DKPVX2Us.js → src-gn7YlnRg.js} +34 -5
- package/dist/{src-DKPVX2Us.js.map → src-gn7YlnRg.js.map} +1 -1
- package/dist/src-h5uDlk3m.js +1 -0
- package/dist/state-C97udoh3.js +1 -0
- package/dist/{state-B1t143wG.js → state-C_kdhp5v.js} +15 -15
- package/dist/{state-B1t143wG.js.map → state-C_kdhp5v.js.map} +1 -1
- package/dist/{stats-DSy5HfOv.js → stats-hfpuYsAM.js} +2 -2
- package/dist/{stats-DSy5HfOv.js.map → stats-hfpuYsAM.js.map} +1 -1
- package/dist/suite-ByT1lsdD.js +2 -0
- package/dist/{suite-WgT7m6Vs.js → suite-DieLXvCT.js} +61 -65
- package/dist/suite-DieLXvCT.js.map +1 -0
- package/dist/{summary-DIGEVr08.js → summary-CSzyBVsF.js} +113 -277
- package/dist/summary-CSzyBVsF.js.map +1 -0
- package/dist/tarball-CHcahyNK.js +258 -0
- package/dist/tarball-CHcahyNK.js.map +1 -0
- package/dist/testing.d.ts +426 -143
- package/dist/testing.js +12 -10
- package/dist/testing.js.map +1 -1
- package/dist/{text-CrVy5ioL.js → text-DTigcA64.js} +9 -5
- package/dist/text-DTigcA64.js.map +1 -0
- package/dist/{tool-target-D2mcYlSQ.js → tool-target-CKWkd6QI.js} +2 -2
- package/dist/{tool-target-D2mcYlSQ.js.map → tool-target-CKWkd6QI.js.map} +1 -1
- package/dist/{transcript-BTxJpW4R.js → transcript-BJrKfgRW.js} +13 -5
- package/dist/transcript-BJrKfgRW.js.map +1 -0
- package/dist/types-C5vI3g1C.js.map +1 -1
- package/dist/{types-DXBbP9Mk.d.ts → types-DVvW66ci.d.ts} +569 -895
- package/dist/vertex-Bv7vhMgs.js +1 -0
- package/dist/vertex-C7PI-WPc.d.ts +3 -0
- package/dist/vertex-DypYjx71.js +456 -0
- package/dist/vertex-DypYjx71.js.map +1 -0
- package/dist/view/index.d.ts +548 -121
- package/dist/view/index.js +9 -9
- package/dist/{views-sXpGE6a2.js → views-B9STsLB4.js} +9 -10
- package/dist/{views-sXpGE6a2.js.map → views-B9STsLB4.js.map} +1 -1
- package/dist/views-Ca-rTixp.js +2 -0
- package/dist/{worker-entry-Duo9oAeT.js → worker-entry-C5bLCv6s.js} +48 -20
- package/dist/worker-entry-C5bLCv6s.js.map +1 -0
- package/dist/workspace-8uHtBSve.js +1 -0
- package/dist/{workspace-CDI68wtX.js → workspace-CBuI9Uds.js} +5 -5
- package/dist/{workspace-CDI68wtX.js.map → workspace-CBuI9Uds.js.map} +1 -1
- package/docker/seccomp-default.json +1 -0
- package/package.json +5 -1
- package/skills/eval-rubric/SKILL.md +46 -104
- package/dist/adapter-BloGVZ_a.js.map +0 -1
- package/dist/agent-m-_t-IuW.js.map +0 -1
- package/dist/app-files-C-jwhRDt.js.map +0 -1
- package/dist/assemble-BDEpelpi.js.map +0 -1
- package/dist/assemble-C5bfncHU.js +0 -1
- package/dist/capture-CVRwRTnb.js.map +0 -1
- package/dist/capture-CherbjzB.js +0 -1
- package/dist/cli-C_4gaJ50.js.map +0 -1
- package/dist/cli-spec-CpnbATtI.js.map +0 -1
- package/dist/client-D5hNjpEx.js.map +0 -1
- package/dist/command-BWAuwQNk.js +0 -91
- package/dist/command-BWAuwQNk.js.map +0 -1
- package/dist/command-BXLUfw4h.js.map +0 -1
- package/dist/command-Be6BSE2L.js +0 -335
- package/dist/command-Be6BSE2L.js.map +0 -1
- package/dist/command-Bxdy62dW.js.map +0 -1
- package/dist/commands-jzigbNFb.js.map +0 -1
- package/dist/config-BrdHA9bJ.js.map +0 -1
- package/dist/cost-D4elx933.js.map +0 -1
- package/dist/cost-DmnAod9x.js +0 -1
- package/dist/db-CAfksinX.js +0 -2
- package/dist/db-DO0p7xgP.js +0 -619
- package/dist/db-DO0p7xgP.js.map +0 -1
- package/dist/debug-D24NOQH1.js.map +0 -1
- package/dist/debug-D7bEv_UV.js +0 -1
- package/dist/docker-BnRlTpZA.js.map +0 -1
- package/dist/docker-D01slDF3.js.map +0 -1
- package/dist/doctor-DQ2p0euG.js.map +0 -1
- package/dist/env-BQqj93gu.js.map +0 -1
- package/dist/environment-CO0P0soF.js.map +0 -1
- package/dist/evaluate-BUmsN7yG.js.map +0 -1
- package/dist/evaluate-C_sgRA-V.d.ts +0 -134
- package/dist/facts-DzOUTreB.js +0 -906
- package/dist/facts-DzOUTreB.js.map +0 -1
- package/dist/files-B-CJeeEh.js.map +0 -1
- package/dist/files-BAt0i00X.js +0 -1
- package/dist/files-Bp5j5BqI.js +0 -1
- package/dist/files-C2sjmXhk.js +0 -1
- package/dist/files-C_gQNVB-.js +0 -65
- package/dist/files-C_gQNVB-.js.map +0 -1
- package/dist/files-Ca0d6Uq3.js.map +0 -1
- package/dist/files-kUCrswI6.js.map +0 -1
- package/dist/generate-DZ7vp69F.js +0 -1647
- package/dist/generate-DZ7vp69F.js.map +0 -1
- package/dist/harness-COVXSwJ6.js +0 -354
- package/dist/harness-COVXSwJ6.js.map +0 -1
- package/dist/header-BLPP6aCU.js.map +0 -1
- package/dist/init-RgCQXZhb.js +0 -1
- package/dist/init-SRalM5xF.js.map +0 -1
- package/dist/insights-TyAvz9aV.js +0 -68
- package/dist/insights-TyAvz9aV.js.map +0 -1
- package/dist/invocations-DzyKSJBa.js.map +0 -1
- package/dist/judge-yLvjC5A3.js.map +0 -1
- package/dist/match-Bz0nSdzN.js.map +0 -1
- package/dist/matchers-D4eUqx4j.js.map +0 -1
- package/dist/model-1ZLr9Dcv.js.map +0 -1
- package/dist/model-B45lDUV1.js.map +0 -1
- package/dist/model-BTZq8HIZ.js +0 -1
- package/dist/model-CgnOpss4.js.map +0 -1
- package/dist/model-Ch8kX87u.js +0 -1
- package/dist/node-BSq5qHnQ.js.map +0 -1
- package/dist/object-CLf2-tNq.js.map +0 -1
- package/dist/opencode-providers-klkqgzvb.js +0 -3276
- package/dist/opencode-providers-klkqgzvb.js.map +0 -1
- package/dist/pairs-CHfZNRT6.js.map +0 -1
- package/dist/patch-DWf-I_Q_.js.map +0 -1
- package/dist/plan-BIwUzlB8.js.map +0 -1
- package/dist/plugins-Dkp_H3pB.js.map +0 -1
- package/dist/prices-BcLEXvdY.js.map +0 -1
- package/dist/query-Cvbwl804.js +0 -1
- package/dist/questions-bAudIc04.js.map +0 -1
- package/dist/redact-CRGdfV2s.js +0 -240
- package/dist/redact-CRGdfV2s.js.map +0 -1
- package/dist/remarks-CXwSnSjR.js +0 -278
- package/dist/remarks-CXwSnSjR.js.map +0 -1
- package/dist/remarks-CyAu2DiB.js +0 -1
- package/dist/remarks-mujJv1Ey.js.map +0 -1
- package/dist/remote-CKcEKja4.js.map +0 -1
- package/dist/resolve-B5-uqmJ6.js +0 -1
- package/dist/resolve-CBoKzQMP.js.map +0 -1
- package/dist/results-CMgZEANy.js +0 -78
- package/dist/results-CMgZEANy.js.map +0 -1
- package/dist/resume-B9SOSnK9.js.map +0 -1
- package/dist/rules-VhftPOOT.js.map +0 -1
- package/dist/run-CwIEK16q.js +0 -88
- package/dist/run-CwIEK16q.js.map +0 -1
- package/dist/runtime-BgQRyCLl.js.map +0 -1
- package/dist/server-CHRSgKRp.js +0 -1
- package/dist/server-TGW4WyAz.js.map +0 -1
- package/dist/shared-BDUzStad.js.map +0 -1
- package/dist/source-B1WvBIQt.js +0 -40
- package/dist/source-B1WvBIQt.js.map +0 -1
- package/dist/source-DAzztZwU.js +0 -1
- package/dist/src-1jHbFaGW.js +0 -1
- package/dist/src-8zoX_qrb.js.map +0 -1
- package/dist/src-C_9wgowC.js +0 -2
- package/dist/src-ChhtI6BP.js.map +0 -1
- package/dist/src-D005Cbqz.js +0 -2
- package/dist/src-DIfRbp5a.js +0 -3
- package/dist/src-Dg8121Xy.js +0 -2
- package/dist/src-ElBqEN-S.js +0 -2
- package/dist/src-NSdQ9zI6.js.map +0 -1
- package/dist/src-YHGaUrGE.js +0 -2
- package/dist/src-mJVxw1Jm.js +0 -2
- package/dist/state-vznMh2wl.js +0 -1
- package/dist/suite-BsWGHzlG.js +0 -2
- package/dist/suite-WgT7m6Vs.js.map +0 -1
- package/dist/summary-DIGEVr08.js.map +0 -1
- package/dist/text-CrVy5ioL.js.map +0 -1
- package/dist/transcript-BTxJpW4R.js.map +0 -1
- package/dist/usage-DF3_p5pE.js +0 -1
- package/dist/validate-BhwqrVsm.js.map +0 -1
- package/dist/views-BW_C5eVH.js +0 -2
- package/dist/worker-entry-Duo9oAeT.js.map +0 -1
- package/dist/workspace-QZCacP8A.js +0 -1
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
import { t as isObjectLike } from "./object-
|
|
1
|
+
import { t as isObjectLike } from "./object-BkXGPKWY.js";
|
|
2
2
|
import { n as UsageError } from "./errors-B6BSMs03.js";
|
|
3
|
-
import { d as refusal,
|
|
4
|
-
import {
|
|
3
|
+
import { d as refusal, h as parseDuration, i as durationSchema, l as nonEmpty, o as genericProblem, r as durationProblem, s as got, t as closest } from "./shared-B_lvGqWz.js";
|
|
4
|
+
import { F as credentialsIn, G as pluginSourceSchema, H as gitWorkspaceSchema, I as descriptorProblem, K as secretSchema, L as egressPolicySchema, N as VAR, P as badHost, R as egressProblem, U as hostFileSchema, W as mcpServerSchema, a as PLUGIN_PARTS, i as PLUGIN_NAME, q as skillSourceSchema, y as localPluginServers, z as envVarsSchema } from "./plugins-ngQEJBjJ.js";
|
|
5
|
+
import { c as hasTokenShape, n as SECRET_NAME } from "./redact-DVIaahLv.js";
|
|
5
6
|
import { i as PACKAGE_DIR, n as COMPILED } from "./root-Dlff-zp8.js";
|
|
6
|
-
import { a as PLUGIN_PARTS, i as PLUGIN_NAME, y as localPluginServers } from "./plugins-Dkp_H3pB.js";
|
|
7
7
|
import picomatch from "picomatch";
|
|
8
8
|
import { readdirSync, realpathSync, statSync } from "node:fs";
|
|
9
9
|
import { dirname, isAbsolute, join, normalize, resolve, sep } from "node:path";
|
|
10
10
|
import { z } from "zod";
|
|
11
|
-
import { isIP } from "node:net";
|
|
12
11
|
import { fileURLToPath } from "node:url";
|
|
13
12
|
//#region src/contract/docker.ts
|
|
14
13
|
/** Docker's memory size: bytes, or a number with `b`, `k`, `m` or `g`. */
|
|
15
14
|
const MEMORY = /^\d+(\.\d+)?[bkmg]?$/i;
|
|
16
15
|
const installStepSchema = z.union([nonEmpty(), z.strictObject({
|
|
17
|
-
run: nonEmpty()
|
|
16
|
+
run: nonEmpty(),
|
|
18
17
|
timeout: durationSchema.optional()
|
|
19
|
-
})])
|
|
18
|
+
})]);
|
|
20
19
|
/** Every field but `kind` and `dockerfile`, shared by the descriptor and `docker()`'s options. */
|
|
21
20
|
const fields = {
|
|
22
|
-
id: nonEmpty().optional()
|
|
23
|
-
image: nonEmpty().optional()
|
|
24
|
-
from: z.string().regex(/^\S+$/, "one word").optional()
|
|
25
|
-
install: z.array(installStepSchema).min(1).optional()
|
|
26
|
-
maxConcurrent: z.number().optional()
|
|
27
|
-
root: z.boolean().optional()
|
|
28
|
-
capabilities: z.array(z.string().regex(/^(CAP_)?[A-Z_]+$/)).optional()
|
|
29
|
-
memory: z.union([z.string().regex(MEMORY), z.int().positive()]).optional()
|
|
30
|
-
swap: z.union([z.string().regex(MEMORY), z.int().nonnegative()]).optional()
|
|
31
|
-
cpus: z.number().positive().optional()
|
|
32
|
-
pids: z.int().positive().optional()
|
|
21
|
+
id: nonEmpty().optional(),
|
|
22
|
+
image: nonEmpty().optional(),
|
|
23
|
+
from: z.string().regex(/^\S+$/, "one word").optional(),
|
|
24
|
+
install: z.array(installStepSchema).min(1).optional(),
|
|
25
|
+
maxConcurrent: z.number().optional(),
|
|
26
|
+
root: z.boolean().optional(),
|
|
27
|
+
capabilities: z.array(z.string().regex(/^(CAP_)?[A-Z_]+$/)).optional(),
|
|
28
|
+
memory: z.union([z.string().regex(MEMORY), z.int().positive()]).optional(),
|
|
29
|
+
swap: z.union([z.string().regex(MEMORY), z.int().nonnegative()]).optional(),
|
|
30
|
+
cpus: z.number().positive().optional(),
|
|
31
|
+
pids: z.int().positive().optional()
|
|
33
32
|
};
|
|
34
33
|
const BASES = [
|
|
35
34
|
"image",
|
|
@@ -50,20 +49,20 @@ function oneRecipe(value, ctx) {
|
|
|
50
49
|
}
|
|
51
50
|
const dockerSandboxSchema = z.strictObject({
|
|
52
51
|
kind: z.literal("docker"),
|
|
53
|
-
engine: z.enum(["docker", "podman"]).optional()
|
|
52
|
+
engine: z.enum(["docker", "podman"]).optional(),
|
|
54
53
|
...fields,
|
|
55
|
-
dockerfile: nonEmpty().optional()
|
|
56
|
-
}).superRefine(oneRecipe)
|
|
54
|
+
dockerfile: nonEmpty().optional()
|
|
55
|
+
}).superRefine(oneRecipe);
|
|
57
56
|
const fakeSandboxSchema = z.strictObject({
|
|
58
57
|
kind: z.literal("fake"),
|
|
59
|
-
id: nonEmpty().optional()
|
|
60
|
-
dir: nonEmpty().optional()
|
|
61
|
-
maxConcurrent: z.number().optional()
|
|
62
|
-
})
|
|
58
|
+
id: nonEmpty().optional(),
|
|
59
|
+
dir: nonEmpty().optional(),
|
|
60
|
+
maxConcurrent: z.number().optional()
|
|
61
|
+
});
|
|
63
62
|
/** `docker()`'s argument: the descriptor's fields, with `dockerfile` relative or a `file:` URL. */
|
|
64
63
|
const dockerOptionsSchema = z.strictObject({
|
|
65
64
|
...fields,
|
|
66
|
-
dockerfile: z.union([nonEmpty(), z.instanceof(URL)]).optional()
|
|
65
|
+
dockerfile: z.union([nonEmpty(), z.instanceof(URL)]).optional()
|
|
67
66
|
}).superRefine(oneRecipe);
|
|
68
67
|
const DOCKER_HINTS = {
|
|
69
68
|
steps: "install",
|
|
@@ -134,12 +133,12 @@ function explainDocker(issue, value) {
|
|
|
134
133
|
if (key === "environment" || key === "env") return `Unknown docker() option "${key}". The sandbox is what's baked into the image; variables and secrets belong in defineEnvironment({ env }).`;
|
|
135
134
|
return `Unknown docker() option "${key}".${DOCKER_HINTS[key] ? ` Did you mean "${DOCKER_HINTS[key]}"?` : ""}`;
|
|
136
135
|
}
|
|
136
|
+
if (issue.path[0] === "install" && issue.path.length > 1) return installMessage(options.install[issue.path[1]]);
|
|
137
137
|
if (issue.code === "custom") {
|
|
138
138
|
const { bases } = issue.params ?? {};
|
|
139
139
|
return bases ? `docker() takes one base image, but got ${bases.join(" and ")}. Use image (has the harness), from (a toolchain image reeval bakes the harness onto) or dockerfile.` : "docker() takes dockerfile or install, not both: put the install commands in the Dockerfile as RUN lines, so there's one recipe for the image.";
|
|
140
140
|
}
|
|
141
141
|
const key = String(issue.path[0]);
|
|
142
|
-
if (key === "install" && issue.path.length > 1) return installMessage(options.install[issue.path[1]]);
|
|
143
142
|
return (FIELD[key] ?? ((v) => `docker({ ${key} }) is invalid (got ${got(v)})`))(options[key]);
|
|
144
143
|
}
|
|
145
144
|
function explainFake(issue, value) {
|
|
@@ -170,255 +169,36 @@ function sandboxProblem(value) {
|
|
|
170
169
|
}), value.engine) : refusal(fakeSandboxSchema, value, explainFake, { skip: ["maxConcurrent"] });
|
|
171
170
|
}
|
|
172
171
|
//#endregion
|
|
173
|
-
//#region src/contract/plain.ts
|
|
174
|
-
/** A host environment variable's name. */
|
|
175
|
-
const VAR = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
176
|
-
/** A host name, or `*.` and a domain for its subdomains. */
|
|
177
|
-
const HOST = /^(?:\*\.)?[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*$/i;
|
|
178
|
-
/** Why `host` isn't a host name or `*.` pattern, or undefined when it is one. */
|
|
179
|
-
function badHost(host) {
|
|
180
|
-
if (typeof host === "string" && HOST.test(host)) {
|
|
181
|
-
const name = host.replace(/^\*\./, "");
|
|
182
|
-
if (/(?:^|\.)\d+$/.test(name) && (name !== host || isIP(name) !== 4)) return `'${host}' isn't a host name or an IPv4 address, and a *. pattern never matches an address.`;
|
|
183
|
-
if (name !== host && !name.includes(".")) return `'${host}' would allow every host under .${name}; name the domain, e.g. '*.example.${name}'.`;
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
if (typeof host === "string" && /^[a-z]+:\/\//i.test(host)) return `hosts are host names, not URLs: use '${new URL(host).hostname}' (got '${host}')`;
|
|
187
|
-
if (typeof host === "string" && /^[^:/]+:\d+$/.test(host)) return `hosts are host names without a port: use '${host.split(":")[0]}' (got '${host}')`;
|
|
188
|
-
return `${JSON.stringify(host)} isn't a host. Use a name like 'api.example.com', or '*.example.com' for its subdomains.`;
|
|
189
|
-
}
|
|
190
|
-
const host = z.string().superRefine((value, ctx) => {
|
|
191
|
-
const bad = badHost(value);
|
|
192
|
-
if (bad) ctx.addIssue({
|
|
193
|
-
code: "custom",
|
|
194
|
-
message: bad
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
const gatePolicySchema = z.union([z.literal("all"), z.strictObject({ passRate: z.number().gt(0).max(1) })]).describe("How a cell's attempts decide its outcome: `'all'` (the default) passes only when every attempt passes (pass^k); `{ passRate }` passes when its pass@1 (passes over passes and fails) is at least that share.");
|
|
198
|
-
const egressPolicySchema = z.union([
|
|
199
|
-
z.literal("proxy"),
|
|
200
|
-
z.literal("allow-all"),
|
|
201
|
-
z.literal("deny-all"),
|
|
202
|
-
z.strictObject({ allow: z.array(host).readonly() })
|
|
203
|
-
]).describe("Where the sandbox may connect: any host over HTTP(S) through the egress gateway (`'proxy'`, the default), anywhere including raw TCP and UDP around the gateway (`'allow-all'`), nowhere (`'deny-all'`), or only the listed hosts (`'*.example.com'` matches subdomains). Under a restricted policy the harness's own hosts, brokered secrets' `hosts` and MCP servers' hosts are allowed too; any other request gets a refusal, and the attempt goes on.");
|
|
204
|
-
const substituteInSchema = z.enum([
|
|
205
|
-
"header",
|
|
206
|
-
"query",
|
|
207
|
-
"body"
|
|
208
|
-
]).describe("`header` values, the `query` string, or the request `body`.");
|
|
209
|
-
const secretSchema = z.strictObject({
|
|
210
|
-
kind: z.literal("secret"),
|
|
211
|
-
from: z.string().regex(VAR, "needs a host variable name").optional().describe("The host variable; defaults to the key it's set under."),
|
|
212
|
-
optional: z.boolean().optional().describe("When the host variable is unset, skip it (the record says so) instead of failing."),
|
|
213
|
-
to: z.enum(["agent", "checks"]).optional().describe("`agent` (default): the container's environment. `checks`: only `c.exec` and `setup` steps."),
|
|
214
|
-
hosts: z.array(host).min(1).optional().describe("Brokers the secret: the sandbox gets a per-attempt placeholder, and the Docker egress gateway swaps in the real value only on HTTPS requests to these hosts (`*.example.com` for subdomains)."),
|
|
215
|
-
in: z.array(substituteInSchema).min(1).optional().describe("Where in a request to those hosts the gateway substitutes; defaults to `['header']`.")
|
|
216
|
-
}).superRefine((secret, ctx) => {
|
|
217
|
-
if (secret.in && !secret.hosts) ctx.addIssue({
|
|
218
|
-
code: "custom",
|
|
219
|
-
path: ["in"],
|
|
220
|
-
message: "in only applies to a brokered secret; add hosts"
|
|
221
|
-
});
|
|
222
|
-
}).describe("A host environment variable, redacted everywhere reeval writes and recorded by name only. Made by the `secret` helper of `defineEnvironment` and `defineConfig` callbacks.");
|
|
223
|
-
const secretTemplateSchema = z.strictObject({
|
|
224
|
-
kind: z.literal("secret-template"),
|
|
225
|
-
template: z.string().describe("The string, with `${NAME}` for each host variable to substitute.")
|
|
226
|
-
}).describe("`secret.template('Bearer ${TOKEN}')`: host variables substituted into a string, for MCP headers.");
|
|
227
|
-
const envValueSchema = z.union([z.string(), secretSchema]).describe("A variable's value: a literal string, or a host secret.");
|
|
228
|
-
const envVarsSchema = z.record(z.string(), envValueSchema).describe("Environment variables by name.");
|
|
229
|
-
const hostFileSchema = z.strictObject({
|
|
230
|
-
kind: z.literal("file"),
|
|
231
|
-
path: nonEmpty().describe("Its path on the host, absolute or relative to the directory of the file it's written in.")
|
|
232
|
-
}).describe("A file on the host, read when an attempt starts. Made by the `file` helper.");
|
|
233
|
-
const skillPlacementSchema = z.enum(["harness", "workspace"]).describe("`harness` (default): the agent's own skills, via its adapter. `workspace`: its repo skill dir.");
|
|
234
|
-
const ONLY = "The skill names to keep; default every one found.";
|
|
235
|
-
const EXCLUDE = "Paths in each skill directory to leave out, gitignore-style.";
|
|
236
|
-
const skill = (source, fields) => z.strictObject({
|
|
237
|
-
kind: z.literal("skill"),
|
|
238
|
-
placement: skillPlacementSchema,
|
|
239
|
-
source: z.literal(source),
|
|
240
|
-
...fields
|
|
241
|
-
});
|
|
242
|
-
const skillSourceSchema = z.discriminatedUnion("source", [
|
|
243
|
-
skill("local", {
|
|
244
|
-
path: nonEmpty().describe("A host directory with a `SKILL.md`, or a directory of them."),
|
|
245
|
-
only: z.array(z.string()).optional().describe(ONLY),
|
|
246
|
-
exclude: z.array(z.string()).optional().describe(EXCLUDE)
|
|
247
|
-
}),
|
|
248
|
-
skill("git", {
|
|
249
|
-
repo: nonEmpty().describe("As written: a URL, `github:owner/repo`, or a GitHub `/tree/<ref>/<path>` URL."),
|
|
250
|
-
ref: z.string().optional().describe("A branch, tag or commit SHA; unset is the remote's `HEAD`."),
|
|
251
|
-
path: z.string().optional().describe("The directory in the repository to read skills from."),
|
|
252
|
-
only: z.array(z.string()).optional().describe(ONLY),
|
|
253
|
-
exclude: z.array(z.string()).optional().describe(EXCLUDE)
|
|
254
|
-
}),
|
|
255
|
-
skill("registry", {
|
|
256
|
-
id: z.string().regex(/^[\w.-]+\/[\w.-]+@[a-z0-9-]+$/).describe("A skills.sh id, `owner/repo@skill`."),
|
|
257
|
-
version: z.string().optional().describe("A git ref of the skill's repository.")
|
|
258
|
-
}),
|
|
259
|
-
skill("npm", {
|
|
260
|
-
spec: nonEmpty().describe("A pinned npm package spec."),
|
|
261
|
-
path: z.string().describe("The directory in the package to read skills from; default `skills`."),
|
|
262
|
-
only: z.array(z.string()).optional().describe(ONLY),
|
|
263
|
-
exclude: z.array(z.string()).optional().describe(EXCLUDE)
|
|
264
|
-
}),
|
|
265
|
-
skill("inline", {
|
|
266
|
-
name: z.string().describe("The skill's name, as in `SKILL.md`'s frontmatter."),
|
|
267
|
-
description: z.string().describe("The skill's description, as in `SKILL.md`'s frontmatter."),
|
|
268
|
-
content: z.string().describe("The body of `SKILL.md`."),
|
|
269
|
-
files: z.record(z.string(), z.string()).describe("Other files in the skill directory, by relative path.")
|
|
270
|
-
})
|
|
271
|
-
]).describe("Skills to place for the agent, made by the `skill` helper.");
|
|
272
|
-
const pluginPartSchema = z.enum([
|
|
273
|
-
"skills",
|
|
274
|
-
"agents",
|
|
275
|
-
"commands",
|
|
276
|
-
"hooks",
|
|
277
|
-
"mcp",
|
|
278
|
-
"rules"
|
|
279
|
-
]).describe("A part of a plugin, as Claude Code's layout bundles it: `skills/<name>/SKILL.md`, `agents/<name>.md`, `commands/<name>.md`, `hooks/hooks.json`, `.mcp.json` (or the manifest's `mcpServers`) or `rules/`.");
|
|
280
|
-
const pluginMarketplaceSchema = z.discriminatedUnion("source", [z.strictObject({
|
|
281
|
-
source: z.literal("git"),
|
|
282
|
-
repo: nonEmpty().describe("As written: a URL or `github:owner/repo`."),
|
|
283
|
-
ref: z.string().optional().describe("A branch, tag or commit SHA; unset is the remote's `HEAD`.")
|
|
284
|
-
}), z.strictObject({
|
|
285
|
-
source: z.literal("npm"),
|
|
286
|
-
spec: nonEmpty().describe("An npm package spec.")
|
|
287
|
-
})]).describe("A Claude Code marketplace: the source that holds its `.claude-plugin/marketplace.json`.");
|
|
288
|
-
const buildCommands = z.union([nonEmpty(), z.array(nonEmpty()).min(1, "at least one command")]);
|
|
289
|
-
const pluginBuildSchema = z.union([buildCommands, z.strictObject({
|
|
290
|
-
run: buildCommands.describe("The command, or the commands in order."),
|
|
291
|
-
cwd: z.string().regex(/^(?:\.|(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))[^\\]+)$/, "a directory relative to the source's root, with forward slashes and no ..").optional().describe("Where they run, relative to the source's root; default the plugin's directory.")
|
|
292
|
-
})]).describe("Shell commands that build a plugin in a Docker image layer, on the cell's harness image, as root and with no secrets: one, a list, or `{ run, cwd }`. They run from the plugin's directory, or from `cwd`, relative to the source's root (`'.'` for the repository's or package's root).");
|
|
293
|
-
const plugin = (source, fields) => z.strictObject({
|
|
294
|
-
kind: z.literal("plugin"),
|
|
295
|
-
source: z.literal(source),
|
|
296
|
-
...fields,
|
|
297
|
-
only: z.array(pluginPartSchema).min(1, "at least one part").optional().describe("The parts to place; default every part the plugin has."),
|
|
298
|
-
build: pluginBuildSchema.optional().describe("Commands that build the plugin in a Docker image layer, from its directory unless `cwd` says otherwise.")
|
|
299
|
-
});
|
|
300
|
-
const pluginSourceSchema = z.discriminatedUnion("source", [
|
|
301
|
-
plugin("local", { path: nonEmpty().describe("A host directory with a `.claude-plugin/plugin.json`.") }),
|
|
302
|
-
plugin("git", {
|
|
303
|
-
repo: nonEmpty().describe("As written: a URL, `github:owner/repo`, or a GitHub `/tree/<ref>/<path>` URL."),
|
|
304
|
-
ref: z.string().optional().describe("A branch, tag or commit SHA; unset is the remote's `HEAD`."),
|
|
305
|
-
path: z.string().optional().describe("The plugin's directory in the repository; default its root.")
|
|
306
|
-
}),
|
|
307
|
-
plugin("npm", {
|
|
308
|
-
spec: nonEmpty().describe("A pinned npm package spec."),
|
|
309
|
-
path: z.string().optional().describe("The plugin's directory in the package; default its root.")
|
|
310
|
-
}),
|
|
311
|
-
plugin("marketplace", {
|
|
312
|
-
name: nonEmpty().describe("The plugin's entry in the marketplace's `.claude-plugin/marketplace.json`."),
|
|
313
|
-
marketplace: pluginMarketplaceSchema.describe("Where the marketplace is: a git repository (at `ref`) or an npm package.")
|
|
314
|
-
})
|
|
315
|
-
]).describe("A plugin to place for the agent, in Claude Code's layout, made by the `plugin` helper.");
|
|
316
|
-
const mcpServerSchema = z.discriminatedUnion("transport", [z.strictObject({
|
|
317
|
-
kind: z.literal("mcp"),
|
|
318
|
-
transport: z.literal("stdio"),
|
|
319
|
-
command: nonEmpty().describe("The command that starts the server in the sandbox."),
|
|
320
|
-
args: z.array(z.string()),
|
|
321
|
-
env: envVarsSchema.describe("Variables the server process gets.")
|
|
322
|
-
}), z.strictObject({
|
|
323
|
-
kind: z.literal("mcp"),
|
|
324
|
-
transport: z.enum(["http", "sse"]).describe("Streamable HTTP, or the older SSE transport."),
|
|
325
|
-
url: z.url("must be a URL"),
|
|
326
|
-
headers: z.record(z.string(), z.union([
|
|
327
|
-
z.string(),
|
|
328
|
-
secretSchema,
|
|
329
|
-
secretTemplateSchema
|
|
330
|
-
])).describe("Request headers, with secrets brokered by the egress gateway.")
|
|
331
|
-
})]).describe("An MCP server the agent gets, made by the `mcp` helper: a command in the sandbox, or a URL.");
|
|
332
|
-
const gitWorkspaceSchema = z.strictObject({
|
|
333
|
-
kind: z.literal("git"),
|
|
334
|
-
repo: nonEmpty().describe("As written: a URL, `github:owner/repo`, or a local path."),
|
|
335
|
-
url: nonEmpty().describe("What reeval fetches: the clone URL, or an absolute path for a local repository."),
|
|
336
|
-
ref: z.string().optional().describe("A branch, tag or commit SHA; unset is the remote's `HEAD`."),
|
|
337
|
-
path: z.string().optional().describe("A directory in the repository whose contents become the workspace."),
|
|
338
|
-
init: z.boolean().optional().describe("Give the workspace a `.git`: one commit of the fetched tree, with no remote."),
|
|
339
|
-
token: z.string().superRefine((token, ctx) => {
|
|
340
|
-
if (!VAR.test(token) || /^(?:gh[opsur]_|github_pat_)/.test(token)) ctx.addIssue({
|
|
341
|
-
code: "custom",
|
|
342
|
-
message: "token names the host variable that holds the token, e.g. token: 'GITHUB_TOKEN'. Don't put the token itself in the eval."
|
|
343
|
-
});
|
|
344
|
-
}).optional().describe("The host variable holding a token for the fetch; read on the host only.")
|
|
345
|
-
}).describe("A git repository (or one directory of it) the workspace starts as, from the `git` helper. `url` is what reeval fetches: the clone URL, or an absolute path for a local repository.");
|
|
346
|
-
/** Every key any object in `schema` takes, for "Did you mean". */
|
|
347
|
-
function keysOf(schema) {
|
|
348
|
-
const def = schema.def;
|
|
349
|
-
if (def.shape) return Object.keys(def.shape);
|
|
350
|
-
if (def.options) return [...new Set(def.options.flatMap(keysOf))];
|
|
351
|
-
return def.innerType ? keysOf(def.innerType) : [];
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* What's wrong with a descriptor that arrived as data, in terms of the helper that makes it
|
|
355
|
-
* (`call`, e.g. `secret` or `skill.git`), or undefined when it's sound.
|
|
356
|
-
*/
|
|
357
|
-
function descriptorProblem(schema, value, call) {
|
|
358
|
-
return refusal(schema, value, (issue, v) => {
|
|
359
|
-
if (issue.code === "unrecognized_keys") {
|
|
360
|
-
const key = issue.keys[0];
|
|
361
|
-
const near = closest(key, keysOf(schema));
|
|
362
|
-
return `${call}() has no "${key}" field${issue.path.length ? ` in ${String(issue.path.join("."))}` : ""}.${near ? ` Did you mean "${near}"?` : ""}`;
|
|
363
|
-
}
|
|
364
|
-
if (issue.code === "custom") return `${call}(): ${issue.message}`;
|
|
365
|
-
if (issue.code === "invalid_union" && issue.path.length === 1) {
|
|
366
|
-
const key = String(issue.path[0]);
|
|
367
|
-
const values = schema.def.options?.flatMap((o) => [...o.shape[key]?._zod.values ?? []]);
|
|
368
|
-
return `${call.split(".")[0]}() ${key} is ${oneOf(values ?? [])} (got ${got(valueAt(v, issue.path))})`;
|
|
369
|
-
}
|
|
370
|
-
return genericProblem(call, issue, v);
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
const GATE_SHAPE = "is 'all' (every attempt passes) or { passRate } with a share above 0 and at most 1, e.g. gate: { passRate: 0.8 }";
|
|
374
|
-
/** reeval's sentence for a gate that isn't one, or undefined. */
|
|
375
|
-
const gateProblem = (value, where) => refusal(gatePolicySchema, value, () => `gate in ${where} ${GATE_SHAPE} (got ${got(value)})`);
|
|
376
|
-
const EGRESS_SHAPE = `is 'proxy' (the default), 'allow-all', 'deny-all', or { allow: ['api.example.com', '*.example.org'] }`;
|
|
377
|
-
/** reeval's sentence for an egress policy that isn't one, or undefined. */
|
|
378
|
-
function egressProblem(value, where) {
|
|
379
|
-
return refusal(egressPolicySchema, value, () => {
|
|
380
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
381
|
-
const list = Array.isArray(value) ? ` For a list of hosts, use { allow: ${got(value)} }.` : "";
|
|
382
|
-
return `egress in ${where} ${EGRESS_SHAPE} (got ${got(value)}).${list}`;
|
|
383
|
-
}
|
|
384
|
-
const key = Object.keys(value).find((k) => k !== "allow");
|
|
385
|
-
if (key !== void 0) return `Unknown egress key "${key}" in ${where}.${key === "deny" ? " A policy lists what's allowed; everything else is refused." : key === "hosts" || key === "allowedHosts" ? " Did you mean \"allow\"?" : " A policy is { allow: ['api.example.com'] }."}`;
|
|
386
|
-
const allow = value.allow;
|
|
387
|
-
if (!Array.isArray(allow)) return `egress in ${where} ${EGRESS_SHAPE} (got ${got(value)})`;
|
|
388
|
-
return `egress.allow in ${where}: ${allow.map(badHost).find(Boolean)}`;
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
//#endregion
|
|
392
172
|
//#region src/contract/environment.ts
|
|
393
173
|
/** An environment's or layer's name, which names its cells. */
|
|
394
174
|
const NAME = /^[A-Za-z0-9][A-Za-z0-9._@+-]*$/;
|
|
395
175
|
const sandboxDescriptorSchema = z.union([fakeSandboxSchema, dockerSandboxSchema]);
|
|
396
176
|
const setupStepSchema = z.union([nonEmpty(), z.strictObject({
|
|
397
|
-
run: nonEmpty()
|
|
398
|
-
timeout: durationSchema.optional()
|
|
399
|
-
cwd: nonEmpty().optional()
|
|
400
|
-
})])
|
|
177
|
+
run: nonEmpty(),
|
|
178
|
+
timeout: durationSchema.optional(),
|
|
179
|
+
cwd: nonEmpty().optional()
|
|
180
|
+
})]);
|
|
401
181
|
const environmentSpecSchema = z.strictObject({
|
|
402
|
-
sandbox: sandboxDescriptorSchema.optional()
|
|
403
|
-
workspace: gitWorkspaceSchema.optional()
|
|
404
|
-
env: envVarsSchema.optional()
|
|
405
|
-
egress: egressPolicySchema.optional()
|
|
406
|
-
files: z.record(z.string(), z.union([z.string(), hostFileSchema])).optional()
|
|
407
|
-
rules: z.union([z.string(), hostFileSchema]).optional()
|
|
408
|
-
setup: z.array(setupStepSchema).optional()
|
|
409
|
-
skills: z.array(skillSourceSchema).optional()
|
|
410
|
-
mcp: z.record(z.string(), mcpServerSchema).optional()
|
|
411
|
-
plugins: z.array(pluginSourceSchema).optional()
|
|
412
|
-
})
|
|
182
|
+
sandbox: sandboxDescriptorSchema.optional(),
|
|
183
|
+
workspace: gitWorkspaceSchema.optional(),
|
|
184
|
+
env: envVarsSchema.optional(),
|
|
185
|
+
egress: egressPolicySchema.optional(),
|
|
186
|
+
files: z.record(z.string(), z.union([z.string(), hostFileSchema])).optional(),
|
|
187
|
+
rules: z.union([z.string(), hostFileSchema]).optional(),
|
|
188
|
+
setup: z.array(setupStepSchema).optional(),
|
|
189
|
+
skills: z.array(skillSourceSchema).optional(),
|
|
190
|
+
mcp: z.record(z.string(), mcpServerSchema).optional(),
|
|
191
|
+
plugins: z.array(pluginSourceSchema).optional()
|
|
192
|
+
});
|
|
413
193
|
const environmentLayerSchema = z.strictObject({
|
|
414
|
-
name: z.string().regex(NAME)
|
|
415
|
-
spec: environmentSpecSchema
|
|
416
|
-
})
|
|
194
|
+
name: z.string().regex(NAME),
|
|
195
|
+
spec: environmentSpecSchema
|
|
196
|
+
});
|
|
417
197
|
const environmentDataSchema = z.strictObject({
|
|
418
198
|
kind: z.literal("environment"),
|
|
419
|
-
name: z.string().regex(NAME)
|
|
420
|
-
layers: z.array(environmentLayerSchema).readonly()
|
|
421
|
-
})
|
|
199
|
+
name: z.string().regex(NAME),
|
|
200
|
+
layers: z.array(environmentLayerSchema).readonly()
|
|
201
|
+
});
|
|
422
202
|
//#endregion
|
|
423
203
|
//#region src/environment.ts
|
|
424
204
|
var DefinitionError = class extends Error {
|
|
@@ -540,18 +320,23 @@ function mcpHosts(url) {
|
|
|
540
320
|
}
|
|
541
321
|
}
|
|
542
322
|
/**
|
|
323
|
+
* Where an MCP server's header secret is brokered to: its own `hosts`, else the server's host.
|
|
324
|
+
* Never on an `http://` server: the gateway swaps secrets in over HTTPS only, and the header
|
|
325
|
+
* goes only to the server.
|
|
326
|
+
*/
|
|
327
|
+
const mcpHeaderHosts = (value, url) => {
|
|
328
|
+
const own = mcpHosts(url);
|
|
329
|
+
return own && isSecret(value) ? value.hosts ?? own : own;
|
|
330
|
+
};
|
|
331
|
+
/**
|
|
543
332
|
* Every secret among `env` and the layers' env and MCP servers (their local plugins' included),
|
|
544
333
|
* layered as the attempt resolves them: a later layer's variable or MCP server replaces an
|
|
545
334
|
* earlier one of the same name.
|
|
546
335
|
*/
|
|
547
336
|
function plannedSecrets(env, layers) {
|
|
548
337
|
const vars = { ...env };
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
Object.assign(vars, spec.env);
|
|
552
|
-
for (const [name, server] of Object.entries(spec.mcp ?? {})) servers.set(name, server);
|
|
553
|
-
}
|
|
554
|
-
for (const [name, server] of localPluginServers(layers)) servers.set(name, server);
|
|
338
|
+
for (const { spec } of layers) Object.assign(vars, spec.env);
|
|
339
|
+
const servers = layeredServers(layers);
|
|
555
340
|
const out = /* @__PURE__ */ new Map();
|
|
556
341
|
const add = (label, from, hosts, checksOnly = false, optional = false) => out.set(`${label}\0${from}`, {
|
|
557
342
|
label,
|
|
@@ -569,15 +354,43 @@ function plannedSecrets(env, layers) {
|
|
|
569
354
|
fromVars(s.env, `mcp.${server}.env.`);
|
|
570
355
|
continue;
|
|
571
356
|
}
|
|
572
|
-
const own = mcpHosts(s.url);
|
|
573
357
|
for (const [header, value] of Object.entries(s.headers)) {
|
|
574
358
|
const label = `mcp.${server}.headers.${header}`;
|
|
575
|
-
if (isSecret(value)) add(label, value.from ?? header, value.
|
|
576
|
-
if (isSecretTemplate(value)) for (const [, name] of value.template.matchAll(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g)) add(label, name,
|
|
359
|
+
if (isSecret(value)) add(label, value.from ?? header, mcpHeaderHosts(value, s.url));
|
|
360
|
+
if (isSecretTemplate(value)) for (const [, name] of value.template.matchAll(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g)) add(label, name, mcpHeaderHosts(value, s.url));
|
|
577
361
|
}
|
|
578
362
|
}
|
|
579
363
|
return [...out.values()];
|
|
580
364
|
}
|
|
365
|
+
/** The layers' MCP servers and their local plugins', a later one replacing an earlier one of its name. */
|
|
366
|
+
function layeredServers(layers) {
|
|
367
|
+
const servers = /* @__PURE__ */ new Map();
|
|
368
|
+
for (const { spec } of layers) for (const [name, server] of Object.entries(spec.mcp ?? {})) servers.set(name, server);
|
|
369
|
+
for (const [name, server] of localPluginServers(layers)) servers.set(name, server);
|
|
370
|
+
return servers;
|
|
371
|
+
}
|
|
372
|
+
const CREDENTIAL_HEADER = /^(?:proxy-)?authorization$|^cookie$|(?:^|[-_])auth(?:$|[-_])/i;
|
|
373
|
+
/** An `Authorization`-style value, whatever the header is called. */
|
|
374
|
+
const AUTH_SCHEME = /^(?:Bearer|Basic|Token)\s+\S/i;
|
|
375
|
+
/** Whether an MCP header written as a plain string looks like a credential, by its name or its value's shape. */
|
|
376
|
+
const credentialHeader = (name, value) => CREDENTIAL_HEADER.test(name.trim()) || SECRET_NAME.test(name) || AUTH_SCHEME.test(value.trim()) || hasTokenShape(value);
|
|
377
|
+
/**
|
|
378
|
+
* The plain-header values masked like a secret-named host variable's: 8 or more characters, so a
|
|
379
|
+
* guessed-at header such as `X-Token-Count: '1000'` can't mask every `1000` the attempt writes.
|
|
380
|
+
*/
|
|
381
|
+
const maskedHeaderValue = (name, value) => value.length >= 8 && credentialHeader(name, value);
|
|
382
|
+
/** The layers' MCP headers that look like credentials but aren't a `secret()` or `secret.template`. */
|
|
383
|
+
function plainCredentialHeaders(layers) {
|
|
384
|
+
const out = [];
|
|
385
|
+
for (const [server, s] of layeredServers(layers)) {
|
|
386
|
+
if (s.transport === "stdio") continue;
|
|
387
|
+
for (const [header, value] of Object.entries(s.headers)) if (typeof value === "string" && credentialHeader(header, value)) out.push({
|
|
388
|
+
label: `mcp.${server}.headers.${header}`,
|
|
389
|
+
https: mcpHosts(s.url) !== void 0
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
return out;
|
|
393
|
+
}
|
|
581
394
|
/** The secrets the sandbox gets as real values: no `hosts`, and none implied by an MCP URL. */
|
|
582
395
|
const unbrokeredSecrets = (env, layers) => plannedSecrets(env, layers).flatMap(({ hosts, ...s }) => hosts ? [] : [s]);
|
|
583
396
|
function secretHelper() {
|
|
@@ -635,14 +448,12 @@ function sameWorkspaceOnly(a, b) {
|
|
|
635
448
|
}
|
|
636
449
|
/** The paths the layers' `files` write, sorted. */
|
|
637
450
|
const filesOf = (layers) => [...new Set(layers.flatMap((l) => Object.keys(l.spec.files ?? {})))].sort();
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
u.password = u.password && "***";
|
|
645
|
-
return u.href;
|
|
451
|
+
const NO_GIT_CREDENTIALS = "the URL has a password or token in it. reeval fetches the repository on the host with your own git credentials; remove it from the URL.";
|
|
452
|
+
const NO_NPM_CREDENTIALS = "the URL has a password or token in it. reeval runs npm pack on the host, with your own npm and git credentials; remove it from the URL.";
|
|
453
|
+
/** Throws when an npm spec is a URL (a tarball, git+https:, git+ssh:) with a password or token. */
|
|
454
|
+
function npmCredentials(call, spec) {
|
|
455
|
+
const masked = credentialsIn(spec);
|
|
456
|
+
if (masked) throw new DefinitionError(`${call}(${JSON.stringify(masked)}): ${NO_NPM_CREDENTIALS}`);
|
|
646
457
|
}
|
|
647
458
|
const GIT_OPTIONS = [
|
|
648
459
|
"ref",
|
|
@@ -721,6 +532,8 @@ function skillHelper(base) {
|
|
|
721
532
|
}),
|
|
722
533
|
git: (repo, o = {}) => {
|
|
723
534
|
if (typeof repo !== "string" || !repo) throw new DefinitionError(`skill.git() needs a repository URL, e.g. skill.git('https://github.com/acme/skills') (got ${JSON.stringify(repo)})`);
|
|
535
|
+
const masked = credentialsIn(repo);
|
|
536
|
+
if (masked) throw new DefinitionError(`skill.git(${JSON.stringify(masked)}): ${NO_GIT_CREDENTIALS}`);
|
|
724
537
|
const parsed = parseGitRepo(repo);
|
|
725
538
|
const ref = o.ref ?? parsed.ref;
|
|
726
539
|
const path = o.path ?? parsed.path;
|
|
@@ -745,15 +558,18 @@ function skillHelper(base) {
|
|
|
745
558
|
placement: placement(o.placement)
|
|
746
559
|
};
|
|
747
560
|
},
|
|
748
|
-
npm: (spec, o = {}) =>
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
561
|
+
npm: (spec, o = {}) => {
|
|
562
|
+
if (typeof spec === "string") npmCredentials("skill.npm", spec);
|
|
563
|
+
return {
|
|
564
|
+
kind: "skill",
|
|
565
|
+
source: "npm",
|
|
566
|
+
spec: localNpmSpec(spec, base),
|
|
567
|
+
path: o.path ?? "skills",
|
|
568
|
+
...o.only ? { only: [...o.only] } : {},
|
|
569
|
+
...exclude(o.exclude),
|
|
570
|
+
placement: placement(o.placement)
|
|
571
|
+
};
|
|
572
|
+
},
|
|
757
573
|
inline: (skill, o = {}) => ({
|
|
758
574
|
kind: "skill",
|
|
759
575
|
source: "inline",
|
|
@@ -833,7 +649,7 @@ function pluginHelper(base) {
|
|
|
833
649
|
if (typeof repo !== "string" || !repo.trim()) throw new DefinitionError(`plugin.git() needs a repository: a URL or github:owner/repo, e.g. plugin.git('github:acme/agent-plugins', { ref: 'v1.2.0' }) (got ${JSON.stringify(repo)})`);
|
|
834
650
|
const what = `plugin.git(${JSON.stringify(repo)})`;
|
|
835
651
|
const masked = credentialsIn(repo);
|
|
836
|
-
if (masked) throw new DefinitionError(`plugin.git(${JSON.stringify(masked)}):
|
|
652
|
+
if (masked) throw new DefinitionError(`plugin.git(${JSON.stringify(masked)}): ${NO_GIT_CREDENTIALS}`);
|
|
837
653
|
const options = common(what, o, ["ref", "path"]);
|
|
838
654
|
const parsed = parseGitRepo(repo);
|
|
839
655
|
const ref = o.ref ?? parsed.ref;
|
|
@@ -850,6 +666,7 @@ function pluginHelper(base) {
|
|
|
850
666
|
},
|
|
851
667
|
npm: (spec, o = {}) => {
|
|
852
668
|
if (typeof spec !== "string" || !spec.trim()) throw new DefinitionError(`plugin.npm() needs a pinned package spec, e.g. plugin.npm('@acme/review-plugin@1.2.0') (got ${JSON.stringify(spec)})`);
|
|
669
|
+
npmCredentials("plugin.npm", spec);
|
|
853
670
|
const what = `plugin.npm(${JSON.stringify(spec)})`;
|
|
854
671
|
const options = common(what, o, ["path"]);
|
|
855
672
|
const path = dirPath(what, o.path, "package");
|
|
@@ -874,6 +691,8 @@ function pluginHelper(base) {
|
|
|
874
691
|
if (ref !== void 0) throw new DefinitionError(`${what}: ref picks a commit of a git marketplace; pin an npm marketplace in its spec, e.g. npm:@acme/plugins@2.0.0`);
|
|
875
692
|
const spec = from.slice(4);
|
|
876
693
|
if (!spec) throw new DefinitionError(`${what}: npm: needs a package spec`);
|
|
694
|
+
const masked = credentialsIn(spec);
|
|
695
|
+
if (masked) throw new DefinitionError(`plugin.marketplace(${JSON.stringify(`${name}@npm:${masked}`)}): ${NO_NPM_CREDENTIALS}`);
|
|
877
696
|
return {
|
|
878
697
|
kind: "plugin",
|
|
879
698
|
source: "marketplace",
|
|
@@ -886,7 +705,7 @@ function pluginHelper(base) {
|
|
|
886
705
|
};
|
|
887
706
|
}
|
|
888
707
|
const masked = credentialsIn(from);
|
|
889
|
-
if (masked) throw new DefinitionError(`plugin.marketplace(${JSON.stringify(`${name}@${masked}`)}):
|
|
708
|
+
if (masked) throw new DefinitionError(`plugin.marketplace(${JSON.stringify(`${name}@${masked}`)}): ${NO_GIT_CREDENTIALS}`);
|
|
890
709
|
const parsed = parseGitRepo(from);
|
|
891
710
|
if (parsed.ref !== void 0 || parsed.path !== void 0) throw new DefinitionError(`${what}: name the marketplace's repository, whose root holds .claude-plugin/marketplace.json, and pick its commit with ref, e.g. plugin.marketplace('${name}@github:owner/repo', { ref: 'v1' })`);
|
|
892
711
|
if (ref !== void 0 && (typeof ref !== "string" || !ref.trim() || ref.startsWith("-"))) throw new DefinitionError(`${what}: ref is a branch, tag or commit SHA (got ${JSON.stringify(ref)})`);
|
|
@@ -1361,6 +1180,6 @@ function applied(env) {
|
|
|
1361
1180
|
};
|
|
1362
1181
|
}
|
|
1363
1182
|
//#endregion
|
|
1364
|
-
export {
|
|
1183
|
+
export { sandboxPaths as A, mcpHeaderHosts as C, profileSandbox as D, plannedSecrets as E, workspaceOf as F, environmentDataSchema as I, sandboxDescriptorSchema as L, toPath as M, unbrokeredSecrets as N, sameWorkspaceOnly as O, workspaceLabel as P, checkDockerOptions as R, maskedHeaderValue as S, plainCredentialHeaders as T, isEnvironment as _, callerDir as a, isSecret as b, defineEnvironment as c, environmentFrom as d, environmentPaths as f, helpersFor as g, globFilter as h, applied as i, stepCommand as j, sandboxOf as k, emptyEnvironment as l, filesOf as m, DEFAULT_SKILL_EXCLUDE as n, checkEgress as o, environmentSandbox as p, EMPTY_BASELINE as r, checkEnv as s, DEFAULT_DIRECTORY_IGNORES as t, environmentDataProblem as u, isHostFile as v, parseGitRepo as w, isSecretTemplate as x, isMovingRef as y, sandboxProblem as z };
|
|
1365
1184
|
|
|
1366
|
-
//# sourceMappingURL=environment-
|
|
1185
|
+
//# sourceMappingURL=environment-Cf5HMjib.js.map
|