omnius 1.0.350 → 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 +66 -7
- package/npm-shrinkwrap.json +9 -5
- package/package.json +1 -1
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
|
}
|
|
@@ -578051,11 +578093,20 @@ Use the saved fact to continue the promised synthesis or next concrete step, or
|
|
|
578051
578093
|
const repeatGateEligible = isReadLike || tc.name === "memory_write";
|
|
578052
578094
|
if (repeatGateEligible && _existingFp !== void 0 && _repeatGateMax > 0) {
|
|
578053
578095
|
if (criticDecision.hitNumber >= _repeatGateMax) {
|
|
578054
|
-
|
|
578055
|
-
|
|
578056
|
-
|
|
578057
|
-
|
|
578058
|
-
|
|
578096
|
+
if (isReadLike) {
|
|
578097
|
+
repeatShortCircuit = {
|
|
578098
|
+
success: true,
|
|
578099
|
+
output: `[STOP RE-READING — you have requested this exact read ${criticDecision.hitNumber}× and you ALREADY HAVE its full content, shown again below. Do NOT read it again. Act on it: edit the file, run a verification, or call task_complete. If a previous edit failed with "old_string not found", your old_string did not match the file — copy it EXACTLY (including indentation) from the content below.]
|
|
578100
|
+
|
|
578101
|
+
` + _existingFp.result
|
|
578102
|
+
};
|
|
578103
|
+
} else {
|
|
578104
|
+
repeatShortCircuit = {
|
|
578105
|
+
success: false,
|
|
578106
|
+
output: "",
|
|
578107
|
+
error: this._buildRepeatGateBlock(tc.name, tc.arguments ?? {}, criticDecision.hitNumber)
|
|
578108
|
+
};
|
|
578109
|
+
}
|
|
578059
578110
|
} else {
|
|
578060
578111
|
repeatShortCircuit = {
|
|
578061
578112
|
success: true,
|
|
@@ -578953,7 +579004,15 @@ Respond with EXACTLY this structure before your next tool call:
|
|
|
578953
579004
|
const cacheableMemoryNoop = tc.name === "memory_write" && result.success && result.noop;
|
|
578954
579005
|
if (isReadLike && result.success || tc.name === "shell" || cacheableMemoryNoop) {
|
|
578955
579006
|
recentToolResults.set(toolFingerprint, {
|
|
578956
|
-
result: tc.name === "shell" ? this._buildShellCacheResult(tc.arguments, result) : (
|
|
579007
|
+
result: tc.name === "shell" ? this._buildShellCacheResult(tc.arguments, result) : (
|
|
579008
|
+
// Read-like results are SERVED BACK to the model when the
|
|
579009
|
+
// repeat gate fires, so they must stay complete enough to
|
|
579010
|
+
// edit against — truncating to 2KB cut the tail off normal
|
|
579011
|
+
// source files (the "old_string not found" cascade). Large
|
|
579012
|
+
// files are handled by branch-extract upstream, so 16KB
|
|
579013
|
+
// here covers ordinary files without bloating the cache.
|
|
579014
|
+
isReadLike ? (result.output ?? "").slice(0, 16e3) : (result.output ?? "").slice(0, 2e3)
|
|
579015
|
+
),
|
|
578957
579016
|
compacted: false
|
|
578958
579017
|
});
|
|
578959
579018
|
if (isReadLike && result.success) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
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.
|
|
9
|
+
"version": "1.0.352",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
|
@@ -6153,12 +6153,16 @@
|
|
|
6153
6153
|
}
|
|
6154
6154
|
},
|
|
6155
6155
|
"node_modules/range-parser": {
|
|
6156
|
-
"version": "1.
|
|
6157
|
-
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.
|
|
6158
|
-
"integrity": "sha512-
|
|
6156
|
+
"version": "1.3.0",
|
|
6157
|
+
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz",
|
|
6158
|
+
"integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==",
|
|
6159
6159
|
"license": "MIT",
|
|
6160
6160
|
"engines": {
|
|
6161
6161
|
"node": ">= 0.6"
|
|
6162
|
+
},
|
|
6163
|
+
"funding": {
|
|
6164
|
+
"type": "opencollective",
|
|
6165
|
+
"url": "https://opencollective.com/express"
|
|
6162
6166
|
}
|
|
6163
6167
|
},
|
|
6164
6168
|
"node_modules/raw-body": {
|
package/package.json
CHANGED