spacecode 2.14.1 → 2.14.2
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/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/repl.mjs +11 -3
- package/package.json +1 -1
package/dist/repl.mjs
CHANGED
|
@@ -104901,7 +104901,7 @@ async function runWorkerJob(deps, job) {
|
|
|
104901
104901
|
const run = built ? { exitCode: 0, stdout: "", stderr: "" } : deps.runAgent ? await deps.runAgent(dir, prompt, agentSecs) : await deps.sandbox.exec(`timeout ${agentSecs} ${deps.agentCommand(dir, prompt)}`);
|
|
104902
104902
|
const result = parseWorkerResult(run.stdout);
|
|
104903
104903
|
if (await deps.cancelled()) return "cancelled";
|
|
104904
|
-
const rawPatch = await deps.sandbox.exec(`cd ${shq(dir)} && git add -N . && git diff ${base}`);
|
|
104904
|
+
const rawPatch = await deps.sandbox.exec(`cd ${shq(dir)} && git add -N . ${(deps.excludeFromDiff ?? []).map((g2) => shq(`:(exclude,glob)${g2}`)).join(" ")} && git diff ${base}`);
|
|
104905
104905
|
if (rawPatch.exitCode !== 0) throw new Error("git diff failed");
|
|
104906
104906
|
const patch = { ...rawPatch, stdout: rawPatch.stdout === "" || rawPatch.stdout.endsWith("\n") ? rawPatch.stdout : `${rawPatch.stdout}
|
|
104907
104907
|
` };
|
|
@@ -104925,7 +104925,12 @@ async function runWorkerJob(deps, job) {
|
|
|
104925
104925
|
const install = await deps.sandbox.exec(`cd ${shq(dir)} && [ -d node_modules ] || timeout ${slice()} npm install --no-audit --no-fund --silent`);
|
|
104926
104926
|
if (install.exitCode !== 0) deps.log("worker dependency install failed", { ...ids, exitCode: install.exitCode });
|
|
104927
104927
|
}
|
|
104928
|
-
for (const c of wanted)
|
|
104928
|
+
for (const c of wanted) {
|
|
104929
|
+
const r = await deps.sandbox.exec(`cd ${shq(dir)} && timeout ${slice()} ${c.cmd}`);
|
|
104930
|
+
checks[c.name] = r.exitCode;
|
|
104931
|
+
if (r.exitCode !== 0) deps.log("worker check failed", { ...ids, check: c.name, exitCode: r.exitCode, tail: redactSecrets(`${r.stdout}
|
|
104932
|
+
${r.stderr}`.trim().slice(-300).replace(/\s+/g, " ")) });
|
|
104933
|
+
}
|
|
104929
104934
|
}
|
|
104930
104935
|
}
|
|
104931
104936
|
if (await deps.cancelled()) return "cancelled";
|
|
@@ -104990,7 +104995,9 @@ async function createTaskWorktree(shell, cwd2, runId, taskId, attempt) {
|
|
|
104990
104995
|
const top = await must(shell, `cd ${q2(cwd2)} && git rev-parse --show-toplevel`, "finding the repository root");
|
|
104991
104996
|
const gitDir = await must(shell, `cd ${q2(cwd2)} && git rev-parse --absolute-git-dir`, "finding the git directory");
|
|
104992
104997
|
const base = await must(shell, `cd ${q2(top)} && git stash create`, "snapshotting the working tree") || "HEAD";
|
|
104993
|
-
const
|
|
104998
|
+
const root = `${gitDir}/spacecode-core`;
|
|
104999
|
+
await shell(`find ${q2(root)} -mindepth 2 -maxdepth 2 -type d -name 'wt-*' -mmin +1440 2>/dev/null | while read -r w; do git -C ${q2(top)} worktree remove --force "$w" >/dev/null 2>&1; done; git -C ${q2(top)} worktree prune`);
|
|
105000
|
+
const dir = `${root}/${safe(runId)}/wt-${safe(taskId)}-${attempt}`;
|
|
104994
105001
|
await must(shell, `git -C ${q2(top)} worktree add --detach ${q2(dir)} ${q2(base)}`, "creating the task worktree");
|
|
104995
105002
|
const found = await must(shell, `cd ${q2(top)} && find . -maxdepth 4 -name node_modules -type d -prune -not -path './.git/*'`, "listing dependency folders");
|
|
104996
105003
|
for (const line of found.split("\n")) {
|
|
@@ -105043,6 +105050,7 @@ function localPipelineDeps(d, job) {
|
|
|
105043
105050
|
},
|
|
105044
105051
|
chown: () => "true",
|
|
105045
105052
|
installDependencies: false,
|
|
105053
|
+
excludeFromDiff: ["**/node_modules"],
|
|
105046
105054
|
basePatches: async () => {
|
|
105047
105055
|
const res = await d.fetch(`${base}/base-patches`, { headers: auth, signal: d.signal });
|
|
105048
105056
|
if (!res.ok) throw new Error(`base patches request failed (${res.status})`);
|