omnius 1.0.118 → 1.0.120
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 +121 -31
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -527033,15 +527033,17 @@ var init_personality = __esm({
|
|
|
527033
527033
|
// packages/orchestrator/dist/critic.js
|
|
527034
527034
|
function buildForceProgressBlockMessage(call, hits) {
|
|
527035
527035
|
const argPreview = JSON.stringify(call.args ?? {}).slice(0, 200);
|
|
527036
|
-
return `[FORCED PROGRESS BLOCK —
|
|
527036
|
+
return `[FORCED PROGRESS BLOCK — duplicate ${call.tool} call skipped; this is not a tool failure. You have called ${call.tool}(${argPreview}) ${hits} times with identical arguments. The runtime did not re-run the tool; it is returning the cached result below so you can proceed without retrying.
|
|
527037
527037
|
|
|
527038
|
-
To proceed,
|
|
527038
|
+
Progress is REQUIRED before this tool will run again with the same arguments. To proceed, do one of these:
|
|
527039
527039
|
• file_write or file_edit to make progress, OR
|
|
527040
527040
|
• todo_write that advances the plan, OR
|
|
527041
527041
|
• task_complete (if all phases are done), OR
|
|
527042
|
-
• Call a different tool or use different arguments.
|
|
527043
|
-
|
|
527044
|
-
|
|
527042
|
+
• Call a different tool or use different arguments.]`;
|
|
527043
|
+
}
|
|
527044
|
+
function buildCachedResultEnvelope(result) {
|
|
527045
|
+
return `[CACHED RESULT — you already have this information from a prior successful call. Do NOT call this tool again with the same arguments.]
|
|
527046
|
+
${result}`;
|
|
527045
527047
|
}
|
|
527046
527048
|
function evaluate(inputs) {
|
|
527047
527049
|
const { proposedCall, fingerprint, isReadLike, recentToolResults, dedupHitCount, observerRedundantBlock } = inputs;
|
|
@@ -527050,8 +527052,7 @@ function evaluate(inputs) {
|
|
|
527050
527052
|
return {
|
|
527051
527053
|
decision: "observer_block",
|
|
527052
527054
|
reason: "Littleman observer flagged this fingerprint as redundant",
|
|
527053
|
-
cachedResult: cached ?
|
|
527054
|
-
${cached.result}` : null
|
|
527055
|
+
cachedResult: cached ? buildCachedResultEnvelope(cached.result) : null
|
|
527055
527056
|
};
|
|
527056
527057
|
}
|
|
527057
527058
|
if (isReadLike) {
|
|
@@ -527064,11 +527065,12 @@ ${cached.result}` : null
|
|
|
527064
527065
|
decision: "force_progress_block",
|
|
527065
527066
|
reason: `${proposedCall.tool} fingerprint hit count ${hits} >= ${threshold}`,
|
|
527066
527067
|
hitNumber: hits,
|
|
527067
|
-
blockMessage: buildForceProgressBlockMessage(proposedCall, hits)
|
|
527068
|
+
blockMessage: buildForceProgressBlockMessage(proposedCall, hits),
|
|
527069
|
+
cachedResult: buildCachedResultEnvelope(cached.result),
|
|
527070
|
+
compacted: cached.compacted
|
|
527068
527071
|
};
|
|
527069
527072
|
}
|
|
527070
|
-
const cachedEnvelope =
|
|
527071
|
-
${cached.result}`;
|
|
527073
|
+
const cachedEnvelope = buildCachedResultEnvelope(cached.result);
|
|
527072
527074
|
return {
|
|
527073
527075
|
decision: "serve_cached",
|
|
527074
527076
|
reason: cached.compacted ? "post-compaction cache re-serve" : `duplicate call #${hits} (still under ${threshold}-hit gate)`,
|
|
@@ -543226,27 +543228,35 @@ ${latest.output || ""}`.trim();
|
|
|
543226
543228
|
const dirsListed = [];
|
|
543227
543229
|
const searches = [];
|
|
543228
543230
|
const shells = [];
|
|
543231
|
+
let compactedCount = 0;
|
|
543229
543232
|
for (const [fingerprint, entry] of recentToolResults) {
|
|
543233
|
+
const { toolName, args } = this._decodeToolFingerprint(fingerprint);
|
|
543230
543234
|
if (entry.compacted)
|
|
543231
|
-
|
|
543232
|
-
const colonIdx = fingerprint.indexOf(":");
|
|
543233
|
-
const toolName = colonIdx > 0 ? fingerprint.slice(0, colonIdx) : fingerprint;
|
|
543235
|
+
compactedCount++;
|
|
543234
543236
|
if (toolName === "file_read") {
|
|
543235
|
-
const
|
|
543236
|
-
if (
|
|
543237
|
-
filesRead.push(
|
|
543237
|
+
const path12 = args.get("path") ?? args.get("file");
|
|
543238
|
+
if (path12) {
|
|
543239
|
+
filesRead.push(this._formatKnowledgeTarget(this._formatFileReadKnowledgeTarget(path12, args), entry.compacted));
|
|
543240
|
+
}
|
|
543238
543241
|
} else if (toolName === "list_directory") {
|
|
543239
|
-
const
|
|
543240
|
-
|
|
543241
|
-
dirsListed.push(pathMatch[1]);
|
|
543242
|
+
const path12 = args.get("path") ?? ".";
|
|
543243
|
+
dirsListed.push(this._formatKnowledgeTarget(path12, entry.compacted));
|
|
543242
543244
|
} else if (toolName === "grep_search" || toolName === "find_files") {
|
|
543243
|
-
|
|
543245
|
+
const path12 = args.get("path") ?? ".";
|
|
543246
|
+
const pattern = args.get("pattern") ?? args.get("query") ?? "";
|
|
543247
|
+
const target = pattern ? `${toolName} ${path12} :: ${pattern}` : `${toolName} ${path12}`;
|
|
543248
|
+
searches.push(this._formatKnowledgeTarget(target, entry.compacted));
|
|
543244
543249
|
} else if (toolName === "shell" || toolName === "shell_async") {
|
|
543245
|
-
const
|
|
543246
|
-
shells.push(
|
|
543250
|
+
const command = args.get("command") ?? args.get("cmd") ?? toolName;
|
|
543251
|
+
shells.push(this._formatKnowledgeTarget(command, entry.compacted));
|
|
543247
543252
|
}
|
|
543248
543253
|
}
|
|
543249
|
-
const sections = [
|
|
543254
|
+
const sections = [
|
|
543255
|
+
"[KNOWLEDGE — cached tool results already known to the runtime. Do NOT re-call these tools with the same arguments:]"
|
|
543256
|
+
];
|
|
543257
|
+
if (compactedCount > 0) {
|
|
543258
|
+
sections.push(`Compacted cached entries still count as already-known results (${compactedCount}); an exact repeat will be served from cache or skipped, not produce new information.`);
|
|
543259
|
+
}
|
|
543250
543260
|
if (filesRead.length > 0) {
|
|
543251
543261
|
const unique = [...new Set(filesRead)].slice(0, 30);
|
|
543252
543262
|
sections.push(`Files already read (${unique.length}): ${unique.join(", ")}`);
|
|
@@ -543256,7 +543266,8 @@ ${latest.output || ""}`.trim();
|
|
|
543256
543266
|
sections.push(`Directories already listed (${unique.length}): ${unique.join(", ")}`);
|
|
543257
543267
|
}
|
|
543258
543268
|
if (searches.length > 0) {
|
|
543259
|
-
|
|
543269
|
+
const unique = [...new Set(searches)].slice(0, 15);
|
|
543270
|
+
sections.push(`Searches already run (${unique.length}): ${unique.join(", ")}`);
|
|
543260
543271
|
}
|
|
543261
543272
|
if (shells.length > 0) {
|
|
543262
543273
|
const unique = [...new Set(shells)].slice(0, 15);
|
|
@@ -543494,6 +543505,68 @@ ${blob}
|
|
|
543494
543505
|
_buildToolFingerprint(name10, args) {
|
|
543495
543506
|
return `${name10}:${this._buildExactArgsKey(args)}`;
|
|
543496
543507
|
}
|
|
543508
|
+
_decodeToolFingerprint(fingerprint) {
|
|
543509
|
+
const colonIdx = fingerprint.indexOf(":");
|
|
543510
|
+
const toolName = colonIdx > 0 ? fingerprint.slice(0, colonIdx) : fingerprint;
|
|
543511
|
+
const argsKey = colonIdx > 0 ? fingerprint.slice(colonIdx + 1) : "";
|
|
543512
|
+
return { toolName, args: this._parseExactArgsKey(argsKey) };
|
|
543513
|
+
}
|
|
543514
|
+
_parseExactArgsKey(argsKey) {
|
|
543515
|
+
const parsed = /* @__PURE__ */ new Map();
|
|
543516
|
+
if (!argsKey)
|
|
543517
|
+
return parsed;
|
|
543518
|
+
const entries = [];
|
|
543519
|
+
let current = "";
|
|
543520
|
+
let escaped = false;
|
|
543521
|
+
for (const ch of argsKey) {
|
|
543522
|
+
if (escaped) {
|
|
543523
|
+
current += ch;
|
|
543524
|
+
escaped = false;
|
|
543525
|
+
} else if (ch === "\\") {
|
|
543526
|
+
escaped = true;
|
|
543527
|
+
} else if (ch === ",") {
|
|
543528
|
+
entries.push(current);
|
|
543529
|
+
current = "";
|
|
543530
|
+
} else {
|
|
543531
|
+
current += ch;
|
|
543532
|
+
}
|
|
543533
|
+
}
|
|
543534
|
+
if (escaped)
|
|
543535
|
+
current += "\\";
|
|
543536
|
+
entries.push(current);
|
|
543537
|
+
for (const entry of entries) {
|
|
543538
|
+
const eqIdx = entry.indexOf("=");
|
|
543539
|
+
if (eqIdx <= 0)
|
|
543540
|
+
continue;
|
|
543541
|
+
parsed.set(entry.slice(0, eqIdx), entry.slice(eqIdx + 1));
|
|
543542
|
+
}
|
|
543543
|
+
return parsed;
|
|
543544
|
+
}
|
|
543545
|
+
_formatKnowledgeTarget(target, compacted) {
|
|
543546
|
+
const clipped = target.length > 180 ? `${target.slice(0, 130)}...${target.slice(-40)}` : target;
|
|
543547
|
+
return compacted ? `${clipped} (cached after compaction)` : clipped;
|
|
543548
|
+
}
|
|
543549
|
+
_formatFileReadKnowledgeTarget(path12, args) {
|
|
543550
|
+
const offset = this._formatArgsKeyScalar(args.get("offset"));
|
|
543551
|
+
const limit = this._formatArgsKeyScalar(args.get("limit"));
|
|
543552
|
+
if (offset !== void 0 || limit !== void 0) {
|
|
543553
|
+
return `${path12} (offset ${offset ?? "0"}, limit ${limit ?? "end"})`;
|
|
543554
|
+
}
|
|
543555
|
+
return path12;
|
|
543556
|
+
}
|
|
543557
|
+
_formatArgsKeyScalar(value2) {
|
|
543558
|
+
if (value2 === void 0)
|
|
543559
|
+
return void 0;
|
|
543560
|
+
if (value2.startsWith("#number:"))
|
|
543561
|
+
return value2.slice("#number:".length);
|
|
543562
|
+
if (value2.startsWith("#boolean:"))
|
|
543563
|
+
return value2.slice("#boolean:".length);
|
|
543564
|
+
if (value2 === "#null")
|
|
543565
|
+
return "null";
|
|
543566
|
+
if (value2 === "#undefined")
|
|
543567
|
+
return "undefined";
|
|
543568
|
+
return value2;
|
|
543569
|
+
}
|
|
543497
543570
|
_isStatefulBrowserTool(name10) {
|
|
543498
543571
|
return name10 === "playwright_browser" || name10 === "browser_action";
|
|
543499
543572
|
}
|
|
@@ -546572,8 +546645,8 @@ ${criticDecision.cachedResult.slice(0, 500)}` : `[BLOCKED — the observer confi
|
|
|
546572
546645
|
this.emit({
|
|
546573
546646
|
type: "tool_result",
|
|
546574
546647
|
toolName: tc.name,
|
|
546575
|
-
success:
|
|
546576
|
-
content:
|
|
546648
|
+
success: true,
|
|
546649
|
+
content: `[SKIPPED DUPLICATE — exact ${tc.name} call not re-run; cached result returned.]`.slice(0, 120),
|
|
546577
546650
|
turn,
|
|
546578
546651
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
546579
546652
|
});
|
|
@@ -546581,7 +546654,19 @@ ${criticDecision.cachedResult.slice(0, 500)}` : `[BLOCKED — the observer confi
|
|
|
546581
546654
|
mode: "step_repetition",
|
|
546582
546655
|
rationale: `force_progress_block on ${tc.name} after ${criticDecision.hitNumber} identical calls`
|
|
546583
546656
|
});
|
|
546584
|
-
|
|
546657
|
+
const header = criticDecision.compacted ? `[RE-SERVED FROM CACHE — the original result was compacted from context. Here is the data again. Do not retry this exact call.]
|
|
546658
|
+
|
|
546659
|
+
` : `[SKIPPED DUPLICATE — exact ${tc.name} call not re-run. The cached result below is from the prior successful call. Do not retry this exact call.]
|
|
546660
|
+
|
|
546661
|
+
`;
|
|
546662
|
+
const truncatedCache = criticDecision.cachedResult.length > 500 ? criticDecision.cachedResult.slice(0, 500) + `
|
|
546663
|
+
... [${criticDecision.cachedResult.length - 500} chars omitted — same as before]` : criticDecision.cachedResult;
|
|
546664
|
+
return {
|
|
546665
|
+
tc,
|
|
546666
|
+
output: `${criticDecision.blockMessage}
|
|
546667
|
+
|
|
546668
|
+
${header}${truncatedCache}`
|
|
546669
|
+
};
|
|
546585
546670
|
}
|
|
546586
546671
|
if (criticDecision.decision === "serve_cached") {
|
|
546587
546672
|
dedupHitCount.set(toolFingerprint, criticDecision.hitNumber);
|
|
@@ -573330,10 +573415,12 @@ var init_status_bar = __esm({
|
|
|
573330
573415
|
/**
|
|
573331
573416
|
* A dynamic block repaint positions box rows via absolute cursor moves but
|
|
573332
573417
|
* does not advance the terminal's live cursor below the expanded block.
|
|
573333
|
-
* The next content write must therefore repaint from scrollback
|
|
573334
|
-
* writing at the stale cursor, or
|
|
573418
|
+
* The next content write session must therefore repaint from scrollback
|
|
573419
|
+
* instead of writing at the stale cursor, or multi-line injections like
|
|
573420
|
+
* "Context added" can overwrite the box bottom border.
|
|
573335
573421
|
*/
|
|
573336
573422
|
_contentCursorNeedsReplay = false;
|
|
573423
|
+
_contentCursorReplayActive = false;
|
|
573337
573424
|
/** Auto-scroll to live when new content arrives (disabled when user scrolls back) */
|
|
573338
573425
|
_autoScroll = true;
|
|
573339
573426
|
/** Cached click region for the spacer button */
|
|
@@ -573476,6 +573563,7 @@ var init_status_bar = __esm({
|
|
|
573476
573563
|
if (this.active) {
|
|
573477
573564
|
this.repaintContent();
|
|
573478
573565
|
this._contentCursorNeedsReplay = true;
|
|
573566
|
+
if (this.writeDepth > 0) this._contentCursorReplayActive = true;
|
|
573479
573567
|
}
|
|
573480
573568
|
}
|
|
573481
573569
|
/** Force a complete footer redraw (public wrapper for renderFooterAndPositionInput).
|
|
@@ -575339,6 +575427,7 @@ var init_status_bar = __esm({
|
|
|
575339
575427
|
if (!this.active) return;
|
|
575340
575428
|
this.writeDepth++;
|
|
575341
575429
|
if (this.writeDepth > 1) return;
|
|
575430
|
+
this._contentCursorReplayActive = this._contentCursorNeedsReplay;
|
|
575342
575431
|
if (isOverlayActive()) {
|
|
575343
575432
|
return;
|
|
575344
575433
|
}
|
|
@@ -575384,8 +575473,7 @@ var init_status_bar = __esm({
|
|
|
575384
575473
|
}
|
|
575385
575474
|
if (bufferedContentChanged) self2.scheduleStreamingRepaint();
|
|
575386
575475
|
}
|
|
575387
|
-
if (self2.
|
|
575388
|
-
self2._contentCursorNeedsReplay = false;
|
|
575476
|
+
if (self2._contentCursorReplayActive && bufferedContentChanged && self2._bufferContent && !isOverlayActive()) {
|
|
575389
575477
|
self2.clearStreamingRepaintTimer();
|
|
575390
575478
|
self2.repaintContent();
|
|
575391
575479
|
return true;
|
|
@@ -575433,6 +575521,8 @@ ${CONTENT_BG_SEQ}`);
|
|
|
575433
575521
|
this._inProgressLine = "";
|
|
575434
575522
|
}
|
|
575435
575523
|
this._bufferContent = false;
|
|
575524
|
+
this._contentCursorNeedsReplay = false;
|
|
575525
|
+
this._contentCursorReplayActive = false;
|
|
575436
575526
|
if (this._origWrite) {
|
|
575437
575527
|
try {
|
|
575438
575528
|
delete process.stdout.write.__omniusWriteLayer;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.120",
|
|
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.120",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED