spacecode 2.14.7 → 2.14.8
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 +16 -1
- package/package.json +1 -1
package/dist/repl.mjs
CHANGED
|
@@ -104826,6 +104826,17 @@ function codemindDigest(o) {
|
|
|
104826
104826
|
const checked = names.length === 0 ? "no repo checks configured for this task" : names.map((n) => `${n} exit ${o.checks[n]}`).join(", ");
|
|
104827
104827
|
return [`changed: created ${o.files.join(", ")} through Codemind build ${o.buildId}`, `checked: ${checked}`, "uncertain: none", `files: ${o.files.join(", ")}`].join("\n");
|
|
104828
104828
|
}
|
|
104829
|
+
function observedDigest(o) {
|
|
104830
|
+
const names = Object.keys(o.checks);
|
|
104831
|
+
const checked = names.length === 0 ? "no repo checks configured for this task" : names.map((n) => `${n} exit ${o.checks[n]}`).join(", ");
|
|
104832
|
+
const tail = redactSecrets((o.lastWords ?? "").trim().slice(-200).replace(/\s+/g, " "));
|
|
104833
|
+
return [
|
|
104834
|
+
`changed: ${o.changedFiles.length} file(s) changed in the task worktree`,
|
|
104835
|
+
`checked: ${checked}`,
|
|
104836
|
+
`uncertain: the agent ended without its own digest, so this summary is composed from the diff and the check results${tail ? `; its last words: ${tail}` : ""}`,
|
|
104837
|
+
`files: ${o.changedFiles.join(", ")}`
|
|
104838
|
+
].join("\n");
|
|
104839
|
+
}
|
|
104829
104840
|
function redactSecrets(text) {
|
|
104830
104841
|
return text.replace(/https?:\/\/\S+/g, "[url]").replace(/\b(?:gh[pousr]_[A-Za-z0-9]{20,255}|github_pat_[A-Za-z0-9_]{20,255})\b/g, "[token]");
|
|
104831
104842
|
}
|
|
@@ -104986,8 +104997,12 @@ ${r.stderr}`.trim().slice(-300).replace(/\s+/g, " ")) });
|
|
|
104986
104997
|
}
|
|
104987
104998
|
}
|
|
104988
104999
|
if (await deps.cancelled()) return "cancelled";
|
|
104989
|
-
|
|
105000
|
+
let digest = built ? codemindDigest({ buildId: built.buildId, files: built.files, checks }) : extractDigest(result?.text ?? "") ?? "";
|
|
104990
105001
|
const tooBig = new TextEncoder().encode(patch.stdout).length > MAX_PATCH_BYTES;
|
|
105002
|
+
if (digest === "" && run.exitCode === 0 && changedFiles.length > 0 && patch.stdout !== "" && !tooBig) {
|
|
105003
|
+
digest = observedDigest({ changedFiles, checks, ...result ? { lastWords: result.text } : {} });
|
|
105004
|
+
deps.log("worker ended without a digest; composed one from the diff and checks", { ...ids, files: changedFiles.length });
|
|
105005
|
+
}
|
|
104991
105006
|
if (result) {
|
|
104992
105007
|
await deps.report({ type: "usage", n: 0, tokens: result.inputTokens + result.outputTokens }).catch(
|
|
104993
105008
|
(e) => deps.log("worker usage report failed", { ...ids, error: e instanceof Error ? e.message.slice(0, 100) : "unknown" })
|