omnius 1.0.351 → 1.0.353
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 +59 -4
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -573918,6 +573918,40 @@ ${blob}
|
|
|
573918
573918
|
}
|
|
573919
573919
|
if (toolResultIndices.length <= keepResults)
|
|
573920
573920
|
return;
|
|
573921
|
+
const callMetaById = /* @__PURE__ */ new Map();
|
|
573922
|
+
for (const m2 of messages2) {
|
|
573923
|
+
const calls = m2.tool_calls;
|
|
573924
|
+
if (m2.role === "assistant" && Array.isArray(calls)) {
|
|
573925
|
+
for (const c8 of calls) {
|
|
573926
|
+
const name10 = c8?.function?.name;
|
|
573927
|
+
if (!name10 || !c8.id)
|
|
573928
|
+
continue;
|
|
573929
|
+
const rawArgs = c8.function?.arguments || "{}";
|
|
573930
|
+
let path12;
|
|
573931
|
+
if (name10 === "file_read") {
|
|
573932
|
+
try {
|
|
573933
|
+
const a2 = JSON.parse(rawArgs);
|
|
573934
|
+
const p2 = a2.path ?? a2.file ?? a2.file_path;
|
|
573935
|
+
if (p2)
|
|
573936
|
+
path12 = String(p2);
|
|
573937
|
+
} catch {
|
|
573938
|
+
}
|
|
573939
|
+
}
|
|
573940
|
+
callMetaById.set(c8.id, { name: name10, path: path12, argsPreview: rawArgs.slice(0, 120) });
|
|
573941
|
+
}
|
|
573942
|
+
}
|
|
573943
|
+
}
|
|
573944
|
+
const metaForResult = (idx) => {
|
|
573945
|
+
const tcid = messages2[idx].tool_call_id;
|
|
573946
|
+
return tcid ? callMetaById.get(tcid) : void 0;
|
|
573947
|
+
};
|
|
573948
|
+
const pathForResult = (idx) => metaForResult(idx)?.path;
|
|
573949
|
+
const latestIdxForPath = /* @__PURE__ */ new Map();
|
|
573950
|
+
for (const idx of toolResultIndices) {
|
|
573951
|
+
const p2 = pathForResult(idx);
|
|
573952
|
+
if (p2)
|
|
573953
|
+
latestIdxForPath.set(p2, idx);
|
|
573954
|
+
}
|
|
573921
573955
|
const clearCount = toolResultIndices.length - keepResults;
|
|
573922
573956
|
const toClear = toolResultIndices.slice(0, clearCount);
|
|
573923
573957
|
let cleared = 0;
|
|
@@ -573926,10 +573960,31 @@ ${blob}
|
|
|
573926
573960
|
const content = typeof msg.content === "string" ? msg.content : "";
|
|
573927
573961
|
if (content.startsWith("[Tool result cleared") || content.length < 100)
|
|
573928
573962
|
continue;
|
|
573929
|
-
|
|
573930
|
-
|
|
573931
|
-
|
|
573932
|
-
|
|
573963
|
+
const p2 = pathForResult(idx);
|
|
573964
|
+
if (p2 && latestIdxForPath.get(p2) === idx)
|
|
573965
|
+
continue;
|
|
573966
|
+
if (p2 && content.length >= 100) {
|
|
573967
|
+
try {
|
|
573968
|
+
this._evidenceLedger.recordRead({
|
|
573969
|
+
path: p2,
|
|
573970
|
+
content,
|
|
573971
|
+
range: { start: 0, end: Number.POSITIVE_INFINITY },
|
|
573972
|
+
fileVersion: this._worldFacts.files.get(p2)?.writeCount ?? 0,
|
|
573973
|
+
turn: this._taskState?.toolCallCount ?? 0
|
|
573974
|
+
});
|
|
573975
|
+
} catch {
|
|
573976
|
+
}
|
|
573977
|
+
}
|
|
573978
|
+
const meta = metaForResult(idx);
|
|
573979
|
+
let stub;
|
|
573980
|
+
if (p2) {
|
|
573981
|
+
stub = `[Earlier read of ${p2} cleared — its content is preserved in your ACTIVE CONTEXT FRAME (Evidence already gathered). Do NOT re-read it; use the frame.]`;
|
|
573982
|
+
} else {
|
|
573983
|
+
const firstLine = content.split("\n").find((l2) => l2.trim())?.trim().slice(0, 140) ?? "";
|
|
573984
|
+
const failed = /\berror\b|\bfail|✗|exit code [1-9]|traceback/i.test(content);
|
|
573985
|
+
stub = `[${meta?.name ?? "tool"}(${meta?.argsPreview ?? ""}) result compacted to save context — ${failed ? "FAILED" : "ok"}${firstLine ? `: ${firstLine}` : ""}. Re-run ONLY if the underlying state has since changed.]`;
|
|
573986
|
+
}
|
|
573987
|
+
messages2[idx] = { ...msg, content: stub };
|
|
573933
573988
|
cleared++;
|
|
573934
573989
|
}
|
|
573935
573990
|
if (idleGapMs > IDLE_THRESHOLD_MS && !this._thinkingClearLatched) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.353",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.353",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED