reeval 0.0.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/LICENSE +202 -0
- package/THIRD_PARTY_NOTICES.md +2160 -0
- package/assets/package.json +9 -0
- package/assets/pnpm-lock.yaml +1336 -0
- package/dist/agent-DVHkx8aT.js +532 -0
- package/dist/agent-DVHkx8aT.js.map +1 -0
- package/dist/analysis-CxSCt1YY.js +16 -0
- package/dist/analysis-CxSCt1YY.js.map +1 -0
- package/dist/assemble-B-nmz8oH.js +695 -0
- package/dist/assemble-B-nmz8oH.js.map +1 -0
- package/dist/assemble-CmRVDZ2Q.js +2 -0
- package/dist/attempt-BdRQ9jKX.js +176 -0
- package/dist/attempt-BdRQ9jKX.js.map +1 -0
- package/dist/bridge/index.mjs +1911 -0
- package/dist/bridge/package.json +13 -0
- package/dist/bridge/pnpm-lock.yaml +1041 -0
- package/dist/bridge/pnpm-workspace.yaml +2 -0
- package/dist/budget-DBUrH4jX.js +8 -0
- package/dist/budget-DBUrH4jX.js.map +1 -0
- package/dist/cli--CQ3Iy9q.js +1865 -0
- package/dist/cli--CQ3Iy9q.js.map +1 -0
- package/dist/cli-spec-DKAu09Gi.js +478 -0
- package/dist/cli-spec-DKAu09Gi.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -0
- package/dist/colors-QV9dFVhN.js +34 -0
- package/dist/colors-QV9dFVhN.js.map +1 -0
- package/dist/command-BSJzHMtP.js +280 -0
- package/dist/command-BSJzHMtP.js.map +1 -0
- package/dist/command-CEm8PZ1N.js +1043 -0
- package/dist/command-CEm8PZ1N.js.map +1 -0
- package/dist/command-D-jnQWVG.js +673 -0
- package/dist/command-D-jnQWVG.js.map +1 -0
- package/dist/command-DQAvbG7d.js +432 -0
- package/dist/command-DQAvbG7d.js.map +1 -0
- package/dist/commands-A4udfyKZ.js +2 -0
- package/dist/commands-CF8mOfiu.js +207 -0
- package/dist/commands-CF8mOfiu.js.map +1 -0
- package/dist/config-Cuj0kVYj.js +415 -0
- package/dist/config-Cuj0kVYj.js.map +1 -0
- package/dist/context-loi9OCZv.js +106 -0
- package/dist/context-loi9OCZv.js.map +1 -0
- package/dist/core-tLN-z1Be.js +96 -0
- package/dist/core-tLN-z1Be.js.map +1 -0
- package/dist/db-Cjj2ZsfQ.js +2 -0
- package/dist/db-DxDzMhtB.js +827 -0
- package/dist/db-DxDzMhtB.js.map +1 -0
- package/dist/debug-D24NOQH1.js +89 -0
- package/dist/debug-D24NOQH1.js.map +1 -0
- package/dist/debug-SEmW4w8f.js +2 -0
- package/dist/dist-BZXYHN2X.js +1673 -0
- package/dist/dist-BZXYHN2X.js.map +1 -0
- package/dist/docker-DQDZWXF9.js +20 -0
- package/dist/docker-DQDZWXF9.js.map +1 -0
- package/dist/docker-DnWAVdEm.js +2 -0
- package/dist/docker-oSbCExHL.js +153 -0
- package/dist/docker-oSbCExHL.js.map +1 -0
- package/dist/doctor-CxlH1pDM.js +525 -0
- package/dist/doctor-CxlH1pDM.js.map +1 -0
- package/dist/egress-73SQfKdx.js +619 -0
- package/dist/egress-73SQfKdx.js.map +1 -0
- package/dist/env-BQqj93gu.js +21 -0
- package/dist/env-BQqj93gu.js.map +1 -0
- package/dist/environment-Mz7wvrtD.js +552 -0
- package/dist/environment-Mz7wvrtD.js.map +1 -0
- package/dist/errors-C9w_ud7g.js +160 -0
- package/dist/errors-C9w_ud7g.js.map +1 -0
- package/dist/errors-CSxfJ4qu.js +11 -0
- package/dist/errors-CSxfJ4qu.js.map +1 -0
- package/dist/files--6CEUXm7.js +2 -0
- package/dist/files-BLlrhU4-.js +62 -0
- package/dist/files-BLlrhU4-.js.map +1 -0
- package/dist/files-Bd25OAQH.js +2 -0
- package/dist/files-BvHCFWgD.js +2 -0
- package/dist/files-D2-qn_Dl.js +275 -0
- package/dist/files-D2-qn_Dl.js.map +1 -0
- package/dist/files-bF2fPuT9.js +99 -0
- package/dist/files-bF2fPuT9.js.map +1 -0
- package/dist/git-D6hMeieS.js +44 -0
- package/dist/git-D6hMeieS.js.map +1 -0
- package/dist/harness-ls5aX1UO.js +131 -0
- package/dist/harness-ls5aX1UO.js.map +1 -0
- package/dist/harness.d.ts +74 -0
- package/dist/harness.js +2 -0
- package/dist/header-DzFDoMCI.js +78 -0
- package/dist/header-DzFDoMCI.js.map +1 -0
- package/dist/ids-Bp6ut7ZD.js +49 -0
- package/dist/ids-Bp6ut7ZD.js.map +1 -0
- package/dist/images-Cc1-coFc.js +286 -0
- package/dist/images-Cc1-coFc.js.map +1 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +1959 -0
- package/dist/index.js.map +1 -0
- package/dist/init-CFljS8BJ.js +344 -0
- package/dist/init-CFljS8BJ.js.map +1 -0
- package/dist/init-z2ZPn9Tj.js +2 -0
- package/dist/invocations-rXktgSAn.js +157 -0
- package/dist/invocations-rXktgSAn.js.map +1 -0
- package/dist/jiti-BOLXpKyG.js +46 -0
- package/dist/jiti-BOLXpKyG.js.map +1 -0
- package/dist/judge-D8Uf4dA9.js +146 -0
- package/dist/judge-D8Uf4dA9.js.map +1 -0
- package/dist/judge.d.ts +21 -0
- package/dist/judge.js +19 -0
- package/dist/judge.js.map +1 -0
- package/dist/live-Bs3LReMV.js +98 -0
- package/dist/live-Bs3LReMV.js.map +1 -0
- package/dist/matchers-DyLvm7EG.js +374 -0
- package/dist/matchers-DyLvm7EG.js.map +1 -0
- package/dist/model-BdO79gWz.js +44 -0
- package/dist/model-BdO79gWz.js.map +1 -0
- package/dist/model-CDL98xue.js +725 -0
- package/dist/model-CDL98xue.js.map +1 -0
- package/dist/model-v-0_Ik7S.js +2 -0
- package/dist/node-kG64XxdE.js +506 -0
- package/dist/node-kG64XxdE.js.map +1 -0
- package/dist/opencode-providers-DZuD_oYt.js +3149 -0
- package/dist/opencode-providers-DZuD_oYt.js.map +1 -0
- package/dist/options-CAQhu--C.js +452 -0
- package/dist/options-CAQhu--C.js.map +1 -0
- package/dist/patch-BkKje4cp.js +69 -0
- package/dist/patch-BkKje4cp.js.map +1 -0
- package/dist/paths-CBvm6pap.js +72 -0
- package/dist/paths-CBvm6pap.js.map +1 -0
- package/dist/plan-gwk6dJ8c.js +237 -0
- package/dist/plan-gwk6dJ8c.js.map +1 -0
- package/dist/preflight-BtubXKQ8.js +2 -0
- package/dist/preflight-BypZMNBG.js +185 -0
- package/dist/preflight-BypZMNBG.js.map +1 -0
- package/dist/prepare-Cwv0bHs_.js +3 -0
- package/dist/prepare-D6Uzcubb.js +213 -0
- package/dist/prepare-D6Uzcubb.js.map +1 -0
- package/dist/provenance-Dfb8YY5Y.js +129 -0
- package/dist/provenance-Dfb8YY5Y.js.map +1 -0
- package/dist/provider-BDbNOQhQ.js +2 -0
- package/dist/provider-CmAYTQQs.js +14 -0
- package/dist/provider-CmAYTQQs.js.map +1 -0
- package/dist/providers-2p3ylMHI.js +107 -0
- package/dist/providers-2p3ylMHI.js.map +1 -0
- package/dist/providers-BUOxitcT.js +2 -0
- package/dist/query-CFATHZmV.js +91 -0
- package/dist/query-CFATHZmV.js.map +1 -0
- package/dist/query-DR4m6CXf.js +2 -0
- package/dist/record-DQ8wzyco.js +99 -0
- package/dist/record-DQ8wzyco.js.map +1 -0
- package/dist/redact-C4fL_bZP.js +167 -0
- package/dist/redact-C4fL_bZP.js.map +1 -0
- package/dist/results-CeXb8Wde.js +37 -0
- package/dist/results-CeXb8Wde.js.map +1 -0
- package/dist/root-CFDjpWuc.js +110 -0
- package/dist/root-CFDjpWuc.js.map +1 -0
- package/dist/sandbox-By2gkdkC.js +133 -0
- package/dist/sandbox-By2gkdkC.js.map +1 -0
- package/dist/sandbox.d.ts +41 -0
- package/dist/sandbox.js +2 -0
- package/dist/server-Bi61uiY0.js +350 -0
- package/dist/server-Bi61uiY0.js.map +1 -0
- package/dist/server-CsSBL8NC.js +2 -0
- package/dist/source-BXzrmof5.js +2 -0
- package/dist/source-Bsfa3LZH.js +40 -0
- package/dist/source-Bsfa3LZH.js.map +1 -0
- package/dist/src-55j1zNHH.js +3 -0
- package/dist/src-AEwxd1UP.js +602 -0
- package/dist/src-AEwxd1UP.js.map +1 -0
- package/dist/src-BDwSuyIo.js +3 -0
- package/dist/src-BQyMiWri.js +490 -0
- package/dist/src-BQyMiWri.js.map +1 -0
- package/dist/src-C-LHyTSV.js +3 -0
- package/dist/src-Cmp-7YrD.js +1136 -0
- package/dist/src-Cmp-7YrD.js.map +1 -0
- package/dist/src-D0RdqpNb.js +252 -0
- package/dist/src-D0RdqpNb.js.map +1 -0
- package/dist/src-D8KYzxBX.js +793 -0
- package/dist/src-D8KYzxBX.js.map +1 -0
- package/dist/src-DEgff9Z7.js +4 -0
- package/dist/src-DXx_29pq.js +567 -0
- package/dist/src-DXx_29pq.js.map +1 -0
- package/dist/src-DwwiVLqv.js +2937 -0
- package/dist/src-DwwiVLqv.js.map +1 -0
- package/dist/src-N7E_mfcZ.js +2 -0
- package/dist/src-W9g-y5X5.js +3 -0
- package/dist/src-daS0wKH2.js +3 -0
- package/dist/state-Cyw3QTsN.js +2 -0
- package/dist/state-DZ7eqb1F.js +167 -0
- package/dist/state-DZ7eqb1F.js.map +1 -0
- package/dist/stats-BNAHlNMD.js +114 -0
- package/dist/stats-BNAHlNMD.js.map +1 -0
- package/dist/studio-app/assets/index-D6XyfFSH.js +58 -0
- package/dist/studio-app/assets/index-xwzWdcE_.css +2 -0
- package/dist/studio-app/favicon.svg +1 -0
- package/dist/studio-app/index.html +15 -0
- package/dist/summary-D7Ttky0z.js +166 -0
- package/dist/summary-D7Ttky0z.js.map +1 -0
- package/dist/text-gEcKjAyp.js +29 -0
- package/dist/text-gEcKjAyp.js.map +1 -0
- package/dist/types-C5vI3g1C.js +9 -0
- package/dist/types-C5vI3g1C.js.map +1 -0
- package/dist/types-DLec-6Cx.d.ts +1535 -0
- package/dist/usage-DsYUqIUM.js +24 -0
- package/dist/usage-DsYUqIUM.js.map +1 -0
- package/dist/view/index.d.ts +645 -0
- package/dist/view/index.js +8 -0
- package/dist/views-BrHOv6wg.js +220 -0
- package/dist/views-BrHOv6wg.js.map +1 -0
- package/dist/views-CwCWLWqo.js +3 -0
- package/dist/worker-entry-DnYkANPG.js +506 -0
- package/dist/worker-entry-DnYkANPG.js.map +1 -0
- package/dist/workspace-C2S0Z6gl.js +327 -0
- package/dist/workspace-C2S0Z6gl.js.map +1 -0
- package/dist/workspace-CyoXG6CY.js +2 -0
- package/docker/Dockerfile +19 -0
- package/package.json +79 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { y as workspaceLabel } from "./environment-Mz7wvrtD.js";
|
|
2
|
+
import { a as registerSecret } from "./redact-C4fL_bZP.js";
|
|
3
|
+
import { l as sha256 } from "./ids-Bp6ut7ZD.js";
|
|
4
|
+
import { rt as RETRY_DELAYS } from "./src-DwwiVLqv.js";
|
|
5
|
+
import { t as git } from "./git-D6hMeieS.js";
|
|
6
|
+
import { t as PrepareError } from "./provider-CmAYTQQs.js";
|
|
7
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { join, posix } from "node:path";
|
|
9
|
+
import { randomBytes } from "node:crypto";
|
|
10
|
+
//#region src/workspace.ts
|
|
11
|
+
/** A workspace that couldn't be prepared; `usage` when fixing it means changing the eval. */
|
|
12
|
+
var WorkspaceError = class extends Error {
|
|
13
|
+
name = "WorkspaceError";
|
|
14
|
+
usage;
|
|
15
|
+
constructor(message, usage) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.usage = usage;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const workspaceKey = (w) => JSON.stringify([
|
|
21
|
+
w.url,
|
|
22
|
+
w.ref ?? null,
|
|
23
|
+
w.path ?? null
|
|
24
|
+
]);
|
|
25
|
+
const cacheDir = (root) => join(root, ".reeval", "cache", "git");
|
|
26
|
+
const preparedFile = (root, runId) => join(root, ".reeval", "cache", "prepared", `${runId}.git.json`);
|
|
27
|
+
const FULL_SHA = /^[0-9a-f]{40}$/;
|
|
28
|
+
/** What git's stderr says went wrong. */
|
|
29
|
+
function classifyGitError(stderr) {
|
|
30
|
+
if (/couldn't find remote ref|not our ref|unadvertised object|invalid refspec/i.test(stderr)) return "ref";
|
|
31
|
+
if (/Authentication failed|could not read (?:Username|Password)|terminal prompts disabled|Permission denied \(publickey|Host key verification failed|Access denied|returned error: 40[13]/i.test(stderr)) return "auth";
|
|
32
|
+
if (/Could not resolve host|Connection (?:timed out|refused|reset)|Operation timed out|early EOF|RPC failed|unexpected disconnect|remote end hung up|returned error: 5\d\d|\.lock'?: File exists|Unable to create .*\.lock|could not lock/i.test(stderr)) return "transient";
|
|
33
|
+
if (/Repository not found|does not appear to be a git repository|not a git repository|No such file or directory|Unable to find remote helper|protocol .* is not supported|returned error: 404|not found/i.test(stderr)) return "url";
|
|
34
|
+
return "other";
|
|
35
|
+
}
|
|
36
|
+
const firstLine = (stderr) => stderr.split("\n").map((l) => l.replace(/^(?:fatal|error): /, "").trim()).find(Boolean) ?? "git failed";
|
|
37
|
+
const GIT_ENV = process.env.GIT_SSH_COMMAND ? {} : { GIT_SSH_COMMAND: "ssh -o BatchMode=yes" };
|
|
38
|
+
async function gitIn(dir, args, input, env = {}) {
|
|
39
|
+
const r = await git(dir, args, {
|
|
40
|
+
env: {
|
|
41
|
+
...GIT_ENV,
|
|
42
|
+
...env
|
|
43
|
+
},
|
|
44
|
+
...input !== void 0 ? { input } : {}
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
...r,
|
|
48
|
+
text: r.stdout.toString("utf8").trim()
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
52
|
+
/**
|
|
53
|
+
* Fetches, resolves and exports one workspace. `what` names it in messages; `delays` are the
|
|
54
|
+
* waits before each retry of a transient failure.
|
|
55
|
+
*/
|
|
56
|
+
async function prepareOne(root, w, what, delays, env) {
|
|
57
|
+
const dir = join(cacheDir(root), "repos", sha256(w.url).slice(0, 16));
|
|
58
|
+
mkdirSync(dir, { recursive: true });
|
|
59
|
+
const setup = async (args) => {
|
|
60
|
+
const r = await gitIn(dir, args);
|
|
61
|
+
if (r.code !== 0) throw new WorkspaceError(`${what}: couldn't set up its cache in ${dir}: ${firstLine(r.stderr)}`, false);
|
|
62
|
+
};
|
|
63
|
+
await setup([
|
|
64
|
+
"init",
|
|
65
|
+
"-q",
|
|
66
|
+
"--bare"
|
|
67
|
+
]);
|
|
68
|
+
await setup([
|
|
69
|
+
"config",
|
|
70
|
+
"remote.origin.url",
|
|
71
|
+
w.url
|
|
72
|
+
]);
|
|
73
|
+
await setup([
|
|
74
|
+
"config",
|
|
75
|
+
"remote.origin.promisor",
|
|
76
|
+
"true"
|
|
77
|
+
]);
|
|
78
|
+
const fetch = async (args, input, config = []) => {
|
|
79
|
+
for (let i = 0;; i++) {
|
|
80
|
+
const r = await gitIn(dir, [
|
|
81
|
+
...config,
|
|
82
|
+
"fetch",
|
|
83
|
+
"-q",
|
|
84
|
+
"--no-tags",
|
|
85
|
+
"--no-write-fetch-head",
|
|
86
|
+
...args
|
|
87
|
+
], input, env);
|
|
88
|
+
if (r.code === 0) return;
|
|
89
|
+
const failure = classifyGitError(r.stderr);
|
|
90
|
+
if (failure === "transient" && i < delays.length) {
|
|
91
|
+
await sleep(delays[i] ?? 0);
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
throw fetchError(failure, r.stderr, w, what);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
let commit;
|
|
98
|
+
if (w.ref && FULL_SHA.test(w.ref)) {
|
|
99
|
+
const known = await gitIn(dir, [
|
|
100
|
+
"rev-parse",
|
|
101
|
+
"--verify",
|
|
102
|
+
"-q",
|
|
103
|
+
`${w.ref}^{commit}`
|
|
104
|
+
]);
|
|
105
|
+
if (known.code === 0) commit = known.text;
|
|
106
|
+
}
|
|
107
|
+
if (!commit) {
|
|
108
|
+
const temp = `refs/es/fetch/${process.pid}-${randomBytes(4).toString("hex")}`;
|
|
109
|
+
await fetch([
|
|
110
|
+
"--depth",
|
|
111
|
+
"1",
|
|
112
|
+
...w.path ? ["--filter=blob:none"] : [],
|
|
113
|
+
"origin",
|
|
114
|
+
`+${w.ref ?? "HEAD"}:${temp}`
|
|
115
|
+
]);
|
|
116
|
+
const resolved = await gitIn(dir, [
|
|
117
|
+
"rev-parse",
|
|
118
|
+
"--verify",
|
|
119
|
+
"-q",
|
|
120
|
+
`${temp}^{commit}`
|
|
121
|
+
]);
|
|
122
|
+
await gitIn(dir, [
|
|
123
|
+
"update-ref",
|
|
124
|
+
"-d",
|
|
125
|
+
temp
|
|
126
|
+
]);
|
|
127
|
+
if (resolved.code !== 0) throw new WorkspaceError(`${what}: ref "${w.ref}" isn't a commit (a branch, tag or commit SHA)`, true);
|
|
128
|
+
commit = resolved.text;
|
|
129
|
+
}
|
|
130
|
+
await gitIn(dir, [
|
|
131
|
+
"update-ref",
|
|
132
|
+
`refs/es/commits/${commit}`,
|
|
133
|
+
commit
|
|
134
|
+
]);
|
|
135
|
+
const tree = await treeAt(dir, commit, w, what);
|
|
136
|
+
const tar = join(cacheDir(root), "trees", `${tree}.tar`);
|
|
137
|
+
if (!existsSync(tar)) {
|
|
138
|
+
const oids = (await gitIn(dir, [
|
|
139
|
+
"rev-list",
|
|
140
|
+
"--objects",
|
|
141
|
+
"--missing=print",
|
|
142
|
+
tree
|
|
143
|
+
])).text.split("\n").filter((l) => l.startsWith("?")).map((l) => l.slice(1));
|
|
144
|
+
if (oids.length) await fetch([
|
|
145
|
+
"--filter=blob:none",
|
|
146
|
+
"--stdin",
|
|
147
|
+
"origin"
|
|
148
|
+
], `${oids.join("\n")}\n`, ["-c", "fetch.negotiationAlgorithm=noop"]);
|
|
149
|
+
const archived = await git(dir, [...[
|
|
150
|
+
"-c",
|
|
151
|
+
"filter.lfs.process=",
|
|
152
|
+
"-c",
|
|
153
|
+
"filter.lfs.smudge=cat"
|
|
154
|
+
], ...[
|
|
155
|
+
"-c",
|
|
156
|
+
"filter.lfs.required=false",
|
|
157
|
+
"archive",
|
|
158
|
+
"--format=tar",
|
|
159
|
+
tree
|
|
160
|
+
]], { env: GIT_ENV });
|
|
161
|
+
if (archived.code !== 0) throw new WorkspaceError(`${what}: couldn't export ${tree.slice(0, 12)}: ${firstLine(archived.stderr)}`, false);
|
|
162
|
+
mkdirSync(join(cacheDir(root), "trees"), { recursive: true });
|
|
163
|
+
const partial = `${tar}.${process.pid}-${randomBytes(4).toString("hex")}`;
|
|
164
|
+
writeFileSync(partial, archived.stdout);
|
|
165
|
+
renameSync(partial, tar);
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
commit,
|
|
169
|
+
tree,
|
|
170
|
+
tar
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/** The tree the workspace is: the commit's, or the directory `path` in it. */
|
|
174
|
+
async function treeAt(dir, commit, w, what) {
|
|
175
|
+
const at = `${w.ref ? `at ${w.ref} ` : ""}(commit ${commit.slice(0, 7)})`;
|
|
176
|
+
if (!w.path) return (await gitIn(dir, ["rev-parse", `${commit}^{tree}`])).text;
|
|
177
|
+
const entry = await gitIn(dir, [
|
|
178
|
+
"ls-tree",
|
|
179
|
+
commit,
|
|
180
|
+
"--",
|
|
181
|
+
w.path
|
|
182
|
+
]);
|
|
183
|
+
const [meta = "", name] = entry.text.split(" ");
|
|
184
|
+
const [, type, oid] = meta.split(" ");
|
|
185
|
+
if (entry.code === 0 && name === w.path && type === "tree" && oid) return oid;
|
|
186
|
+
if (entry.code === 0 && name === w.path) throw new WorkspaceError(`${what} ${at}: "${w.path}" is a file, not a directory`, true);
|
|
187
|
+
let parent = posix.dirname(w.path);
|
|
188
|
+
let list = await gitIn(dir, ["ls-tree", parent === "." ? commit : `${commit}:${parent}`]);
|
|
189
|
+
if (list.code !== 0) {
|
|
190
|
+
parent = ".";
|
|
191
|
+
list = await gitIn(dir, ["ls-tree", commit]);
|
|
192
|
+
}
|
|
193
|
+
const names = list.code === 0 ? list.text.split("\n").filter(Boolean).map((l) => {
|
|
194
|
+
const [m = "", n = ""] = l.split(" ");
|
|
195
|
+
return m.split(" ")[1] === "tree" ? `${n}/` : n;
|
|
196
|
+
}) : [];
|
|
197
|
+
const shown = names.slice(0, 12).join(", ") + (names.length > 12 ? ", …" : "");
|
|
198
|
+
const where = parent === "." ? "its top level has" : `${parent}/ has`;
|
|
199
|
+
throw new WorkspaceError(`${what} ${at} has no directory "${w.path}"${names.length ? `; ${where}: ${shown}` : ""}`, true);
|
|
200
|
+
}
|
|
201
|
+
function fetchError(failure, stderr, w, what) {
|
|
202
|
+
const line = firstLine(stderr);
|
|
203
|
+
switch (failure) {
|
|
204
|
+
case "ref": {
|
|
205
|
+
const short = w.ref && /^[0-9a-f]{7,39}$/.test(w.ref) ? " Give a commit as its full 40-character SHA." : "";
|
|
206
|
+
return new WorkspaceError(`${what}: the repository has no ref "${w.ref ?? "HEAD"}" (a branch, tag or commit SHA).${short}`, true);
|
|
207
|
+
}
|
|
208
|
+
case "auth": return new WorkspaceError(`${what}: isn't readable with this machine's git credentials, or doesn't exist (${line}). reeval fetches the repository on the host, so set up access there (gh auth setup-git, a credential helper or an SSH key); the sandbox never gets the credentials.`, true);
|
|
209
|
+
case "url": return new WorkspaceError(`${what}: couldn't fetch it (${line}). Check the URL; a private repository also needs this machine's git credentials.`, true);
|
|
210
|
+
case "transient": return new WorkspaceError(`${what}: couldn't be fetched (${line})`, false);
|
|
211
|
+
default: return new WorkspaceError(`${what}: fetching it failed (${line})`, false);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* The token's header for git, in git's environment rather than its arguments, and only for the
|
|
216
|
+
* repository's own origin. Appended to any `GIT_CONFIG_COUNT` entries already set.
|
|
217
|
+
*/
|
|
218
|
+
function tokenEnv(url, token) {
|
|
219
|
+
const n = Number(process.env.GIT_CONFIG_COUNT ?? 0) || 0;
|
|
220
|
+
const header = Buffer.from(`x-access-token:${token}`).toString("base64");
|
|
221
|
+
registerSecret(header);
|
|
222
|
+
return {
|
|
223
|
+
GIT_CONFIG_COUNT: String(n + 1),
|
|
224
|
+
[`GIT_CONFIG_KEY_${n}`]: `http.${new URL(url).origin}/.extraHeader`,
|
|
225
|
+
[`GIT_CONFIG_VALUE_${n}`]: `Authorization: Basic ${header}`
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Prepares every distinct workspace `uses` need, before any attempt, and writes the outcomes for
|
|
230
|
+
* the run's workers. A workspace that fails fails only the attempts that use it.
|
|
231
|
+
*/
|
|
232
|
+
async function prepareWorkspaces(uses, options) {
|
|
233
|
+
const distinct = /* @__PURE__ */ new Map();
|
|
234
|
+
for (const u of uses) {
|
|
235
|
+
const key = workspaceKey(u.workspace);
|
|
236
|
+
const entry = distinct.get(key) ?? {
|
|
237
|
+
workspace: u.workspace,
|
|
238
|
+
setBy: []
|
|
239
|
+
};
|
|
240
|
+
const by = `environment ${u.environment}`;
|
|
241
|
+
if (!entry.setBy.includes(by)) entry.setBy.push(by);
|
|
242
|
+
distinct.set(key, entry);
|
|
243
|
+
}
|
|
244
|
+
const out = /* @__PURE__ */ new Map();
|
|
245
|
+
const byUrl = /* @__PURE__ */ new Map();
|
|
246
|
+
for (const u of distinct.values()) byUrl.set(u.workspace.url, [...byUrl.get(u.workspace.url) ?? [], u]);
|
|
247
|
+
await Promise.all([...byUrl.values()].map(async (list) => {
|
|
248
|
+
for (const { workspace, setBy } of list) {
|
|
249
|
+
const label = workspaceLabel(workspace);
|
|
250
|
+
const what = `Workspace git(${JSON.stringify(label)})`;
|
|
251
|
+
const key = workspaceKey(workspace);
|
|
252
|
+
try {
|
|
253
|
+
let env = {};
|
|
254
|
+
if (workspace.token) {
|
|
255
|
+
const value = process.env[workspace.token];
|
|
256
|
+
if (!value) throw new WorkspaceError(`${what}: its token variable ${workspace.token} isn't set. Set it in the environment or .env.local.`, true);
|
|
257
|
+
registerSecret(value);
|
|
258
|
+
env = tokenEnv(workspace.url, value);
|
|
259
|
+
}
|
|
260
|
+
const delays = options.delays ?? RETRY_DELAYS;
|
|
261
|
+
const prepared = await prepareOne(options.root, workspace, what, delays, env);
|
|
262
|
+
out.set(key, {
|
|
263
|
+
ok: true,
|
|
264
|
+
workspace,
|
|
265
|
+
prepared
|
|
266
|
+
});
|
|
267
|
+
} catch (error) {
|
|
268
|
+
if (!(error instanceof WorkspaceError)) throw error;
|
|
269
|
+
const failure = {
|
|
270
|
+
class: error.usage ? "config" : "transient",
|
|
271
|
+
stage: "workspace",
|
|
272
|
+
ref: label,
|
|
273
|
+
cause: null,
|
|
274
|
+
log: null,
|
|
275
|
+
message: error.message,
|
|
276
|
+
usage: error.usage,
|
|
277
|
+
setBy
|
|
278
|
+
};
|
|
279
|
+
out.set(key, {
|
|
280
|
+
ok: false,
|
|
281
|
+
workspace,
|
|
282
|
+
failure,
|
|
283
|
+
label,
|
|
284
|
+
setBy
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}));
|
|
289
|
+
const outcomes = [...distinct.keys()].map((k) => out.get(k));
|
|
290
|
+
if (!outcomes.length) return outcomes;
|
|
291
|
+
const file = preparedFile(options.root, options.runId);
|
|
292
|
+
mkdirSync(join(file, ".."), { recursive: true });
|
|
293
|
+
const doc = Object.fromEntries(outcomes.map((o) => [workspaceKey(o.workspace), o.ok ? { prepared: o.prepared } : {
|
|
294
|
+
failure: o.failure,
|
|
295
|
+
label: o.label,
|
|
296
|
+
setBy: o.setBy
|
|
297
|
+
}]));
|
|
298
|
+
writeFileSync(file, JSON.stringify(doc));
|
|
299
|
+
return outcomes;
|
|
300
|
+
}
|
|
301
|
+
const removePreparedWorkspaces = (root, runId) => rmSync(preparedFile(root, runId), { force: true });
|
|
302
|
+
const read = /* @__PURE__ */ new Map();
|
|
303
|
+
/**
|
|
304
|
+
* The workspace an attempt copies in, as the CLI prepared it for the run; undefined if it didn't.
|
|
305
|
+
* A workspace that failed throws its failure as a {@link PrepareError}, as a sandbox's does.
|
|
306
|
+
*/
|
|
307
|
+
function preparedWorkspace(root, runId, w) {
|
|
308
|
+
const file = preparedFile(root, runId);
|
|
309
|
+
if (!read.has(file)) {
|
|
310
|
+
let doc = null;
|
|
311
|
+
try {
|
|
312
|
+
doc = JSON.parse(readFileSync(file, "utf8"));
|
|
313
|
+
} catch {}
|
|
314
|
+
read.set(file, doc);
|
|
315
|
+
}
|
|
316
|
+
const entry = read.get(file)?.[workspaceKey(w)];
|
|
317
|
+
if (!entry) return void 0;
|
|
318
|
+
if ("failure" in entry) throw new PrepareError({
|
|
319
|
+
...entry.failure,
|
|
320
|
+
message: `${entry.failure.message}\n(the workspace git(${JSON.stringify(entry.label)}), set by ${entry.setBy.join(", ")}, failed to prepare before the run started; every attempt that needs it fails with this)`
|
|
321
|
+
});
|
|
322
|
+
return entry.prepared;
|
|
323
|
+
}
|
|
324
|
+
//#endregion
|
|
325
|
+
export { removePreparedWorkspaces as a, preparedWorkspace as i, classifyGitError as n, workspaceKey as o, prepareWorkspaces as r, WorkspaceError as t };
|
|
326
|
+
|
|
327
|
+
//# sourceMappingURL=workspace-C2S0Z6gl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-C2S0Z6gl.js","names":[],"sources":["../src/workspace.ts"],"mappings":";;;;;;;;;;;AAsBA,IAAa,iBAAb,cAAoC,MAAM;CACxC,OAAgB;CAChB;CACA,YAAY,SAAiB,OAAgB;EAC3C,MAAM,OAAO;EACb,KAAK,QAAQ;CACf;AACF;AAEA,MAAa,gBAAgB,MAC3B,KAAK,UAAU;CAAC,EAAE;CAAK,EAAE,OAAO;CAAM,EAAE,QAAQ;AAAI,CAAC;AAEvD,MAAM,YAAY,SAAiB,KAAK,MAAM,WAAW,SAAS,KAAK;AACvE,MAAM,gBAAgB,MAAc,UAClC,KAAK,MAAM,WAAW,SAAS,YAAY,GAAG,MAAM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 -0,0 +1,19 @@
|
|
|
1
|
+
# Base image for reeval sandboxes. `reeval image build` builds this, bakes the Cursor harness
|
|
2
|
+
# bootstrap into it and commits the result as the image evals run in.
|
|
3
|
+
FROM node:22-bookworm-slim
|
|
4
|
+
|
|
5
|
+
RUN apt-get update \
|
|
6
|
+
&& apt-get install -y --no-install-recommends bash ca-certificates curl git procps \
|
|
7
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
8
|
+
|
|
9
|
+
# npm before 11.6 (node:22 ships 10.9) can crash resolving circular peer sets ("reading
|
|
10
|
+
# 'edgesOut'", npm/cli#8261), so evals' installs get a fixed npm. Keep in step with NPM_VERSION
|
|
11
|
+
# in src/build-image.ts. The harness bridge installs its dependencies with pnpm.
|
|
12
|
+
RUN npm install --global npm@11.20.0 && npm install --global pnpm@10.33.3
|
|
13
|
+
|
|
14
|
+
# The agent, setup steps and checks run as `reeval` (SANDBOX_USER in src/image.ts); image builds stay
|
|
15
|
+
# root. Keep in step with toolchainDockerfile in src/build-image.ts.
|
|
16
|
+
RUN useradd --create-home --shell /bin/bash --uid 10001 --user-group reeval \
|
|
17
|
+
&& mkdir -p /reeval/workspace && chown -R reeval:reeval /reeval
|
|
18
|
+
ENV PATH=/home/reeval/.local/bin:$PATH
|
|
19
|
+
WORKDIR /reeval/workspace
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "reeval",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "reeval: an eval runner for coding agents",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "Invertase <oss@invertase.io>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/invertase/reeval.git",
|
|
10
|
+
"directory": "packages/reeval"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/invertase/reeval/tree/main/packages/reeval#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/invertase/reeval/issues"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=22.13"
|
|
19
|
+
},
|
|
20
|
+
"bin": {
|
|
21
|
+
"reeval": "./dist/cli.js",
|
|
22
|
+
"re": "./dist/cli.js"
|
|
23
|
+
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"default": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./harness": {
|
|
30
|
+
"types": "./dist/harness.d.ts",
|
|
31
|
+
"default": "./dist/harness.js"
|
|
32
|
+
},
|
|
33
|
+
"./sandbox": {
|
|
34
|
+
"types": "./dist/sandbox.d.ts",
|
|
35
|
+
"default": "./dist/sandbox.js"
|
|
36
|
+
},
|
|
37
|
+
"./judge": {
|
|
38
|
+
"types": "./dist/judge.d.ts",
|
|
39
|
+
"default": "./dist/judge.js"
|
|
40
|
+
},
|
|
41
|
+
"./view": {
|
|
42
|
+
"types": "./dist/view/index.d.ts",
|
|
43
|
+
"default": "./dist/view/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./package.json": "./package.json"
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"dist",
|
|
49
|
+
"docker",
|
|
50
|
+
"assets",
|
|
51
|
+
"THIRD_PARTY_NOTICES.md"
|
|
52
|
+
],
|
|
53
|
+
"preferUnplugged": true,
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public",
|
|
56
|
+
"registry": "https://registry.npmjs.org/"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@ai-sdk/google": "4.0.79",
|
|
60
|
+
"@ai-sdk/harness": "1.0.124",
|
|
61
|
+
"@ai-sdk/harness-acp": "1.0.62",
|
|
62
|
+
"@ai-sdk/provider-utils": "5.0.47",
|
|
63
|
+
"@ai-sdk/typesafe-ai": "3.0.6",
|
|
64
|
+
"@hono/node-server": "2.1.1",
|
|
65
|
+
"@modelcontextprotocol/server": "2.1.0",
|
|
66
|
+
"@vitest/expect": "5.0.2",
|
|
67
|
+
"@vitest/utils": "5.0.2",
|
|
68
|
+
"ai": "7.0.114",
|
|
69
|
+
"commander": "15.0.0",
|
|
70
|
+
"get-tsconfig": "4.14.3",
|
|
71
|
+
"hono": "4.13.9",
|
|
72
|
+
"jiti": "2.7.0",
|
|
73
|
+
"std-env": "4.2.0",
|
|
74
|
+
"tinyglobby": "0.2.17",
|
|
75
|
+
"ws": "8.21.0",
|
|
76
|
+
"yaml": "2.9.1",
|
|
77
|
+
"zod": "4.6.5"
|
|
78
|
+
}
|
|
79
|
+
}
|