omnius 1.0.351 → 1.0.352

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 CHANGED
@@ -573918,6 +573918,33 @@ ${blob}
573918
573918
  }
573919
573919
  if (toolResultIndices.length <= keepResults)
573920
573920
  return;
573921
+ const callPathById = /* @__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
+ if (c8?.function?.name === "file_read" && c8.id) {
573927
+ try {
573928
+ const a2 = JSON.parse(c8.function.arguments || "{}");
573929
+ const p2 = a2.path ?? a2.file ?? a2.file_path;
573930
+ if (p2)
573931
+ callPathById.set(c8.id, String(p2));
573932
+ } catch {
573933
+ }
573934
+ }
573935
+ }
573936
+ }
573937
+ }
573938
+ const pathForResult = (idx) => {
573939
+ const tcid = messages2[idx].tool_call_id;
573940
+ return tcid ? callPathById.get(tcid) : void 0;
573941
+ };
573942
+ const latestIdxForPath = /* @__PURE__ */ new Map();
573943
+ for (const idx of toolResultIndices) {
573944
+ const p2 = pathForResult(idx);
573945
+ if (p2)
573946
+ latestIdxForPath.set(p2, idx);
573947
+ }
573921
573948
  const clearCount = toolResultIndices.length - keepResults;
573922
573949
  const toClear = toolResultIndices.slice(0, clearCount);
573923
573950
  let cleared = 0;
@@ -573926,9 +573953,24 @@ ${blob}
573926
573953
  const content = typeof msg.content === "string" ? msg.content : "";
573927
573954
  if (content.startsWith("[Tool result cleared") || content.length < 100)
573928
573955
  continue;
573956
+ const p2 = pathForResult(idx);
573957
+ if (p2 && latestIdxForPath.get(p2) === idx)
573958
+ continue;
573959
+ if (p2 && content.length >= 100) {
573960
+ try {
573961
+ this._evidenceLedger.recordRead({
573962
+ path: p2,
573963
+ content,
573964
+ range: { start: 0, end: Number.POSITIVE_INFINITY },
573965
+ fileVersion: this._worldFacts.files.get(p2)?.writeCount ?? 0,
573966
+ turn: this._taskState?.toolCallCount ?? 0
573967
+ });
573968
+ } catch {
573969
+ }
573970
+ }
573929
573971
  messages2[idx] = {
573930
573972
  ...msg,
573931
- content: `[Tool result cleared — write down important findings from earlier results as they may be cleared]`
573973
+ content: p2 ? `[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.]` : `[Tool result cleared — write down important findings from earlier results as they may be cleared]`
573932
573974
  };
573933
573975
  cleared++;
573934
573976
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.351",
3
+ "version": "1.0.352",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.351",
9
+ "version": "1.0.352",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.351",
3
+ "version": "1.0.352",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",