omnius 1.0.446 → 1.0.447
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 +89 -11
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -573841,6 +573841,7 @@ function recordDebugToolEvent(input) {
|
|
|
573841
573841
|
...input.focusSupervisor ? { focusSupervisor: input.focusSupervisor } : {},
|
|
573842
573842
|
...input.focusDecision ? { focusDecision: input.focusDecision } : {},
|
|
573843
573843
|
...input.repeatShortCircuit !== void 0 ? { repeatShortCircuit: input.repeatShortCircuit } : {},
|
|
573844
|
+
...input.runtimeAuthored !== void 0 ? { runtimeAuthored: input.runtimeAuthored } : {},
|
|
573844
573845
|
...input.runtimeGuidance ? { runtimeGuidancePreview: trim(input.runtimeGuidance, 1200) } : {},
|
|
573845
573846
|
diagnoses,
|
|
573846
573847
|
summary: summarizeToolEvent(input.toolName, input.success, diagnoses, command),
|
|
@@ -574413,6 +574414,11 @@ function resolveFocusSupervisorMode(configured, envValue = process.env["OMNIUS_F
|
|
|
574413
574414
|
}
|
|
574414
574415
|
function violatesDirective(directive, input) {
|
|
574415
574416
|
if (input.toolName === "task_complete") {
|
|
574417
|
+
const summary = String(input.args?.["summary"] ?? input.args?.["message"] ?? input.args?.["reason"] ?? "");
|
|
574418
|
+
const reportsConcreteBlocker = /\b(blocked|blocker|incomplete|unable|cannot|can't|failed|failure|stopped|cached failure|no safe progress|unrecoverable)\b/i.test(summary);
|
|
574419
|
+
if (reportsConcreteBlocker && (directive.requiredNextAction === "read_authoritative_target" || directive.requiredNextAction === "report_blocked" || directive.requiredNextAction === "report_incomplete")) {
|
|
574420
|
+
return false;
|
|
574421
|
+
}
|
|
574416
574422
|
return directive.requiredNextAction !== "report_blocked" && directive.requiredNextAction !== "report_incomplete" && directive.requiredNextAction !== "use_cached_evidence";
|
|
574417
574423
|
}
|
|
574418
574424
|
if (input.toolName === "ask_user")
|
|
@@ -574463,6 +574469,21 @@ function isEditTool(toolName) {
|
|
|
574463
574469
|
function isReportTool(toolName) {
|
|
574464
574470
|
return toolName === "task_complete" || toolName === "ask_user";
|
|
574465
574471
|
}
|
|
574472
|
+
function compactCachedEvidence(text2) {
|
|
574473
|
+
const value2 = text2 || "";
|
|
574474
|
+
const lineCount = value2 ? value2.split("\n").length : 0;
|
|
574475
|
+
const sha = value2.match(/sha256=([a-f0-9]{8,64})/i)?.[1];
|
|
574476
|
+
const header = value2.match(/\[FILE CONTEXT \|[^\]]+\]/)?.[0];
|
|
574477
|
+
const preview = value2.split("\n").map((line) => line.trim()).find((line) => line.length > 0 && !line.startsWith("[trust_tier:") && line !== "---") ?? "";
|
|
574478
|
+
return [
|
|
574479
|
+
"Cached evidence is already available in the active context/tool cache; full payload omitted from this block to avoid context bloat.",
|
|
574480
|
+
`cached_size=${lineCount} lines, ${value2.length} chars`,
|
|
574481
|
+
sha ? `cached_sha256=${sha.slice(0, 16)}` : "",
|
|
574482
|
+
header ? `cached_header=${header.slice(0, 220)}` : "",
|
|
574483
|
+
preview && preview !== header ? `cached_preview=${preview.slice(0, 220)}` : "",
|
|
574484
|
+
"Use the cached evidence now, or request a distinct offset/limit/query if genuinely needed."
|
|
574485
|
+
].filter(Boolean).join("\n");
|
|
574486
|
+
}
|
|
574466
574487
|
function actionFamily(toolName, args) {
|
|
574467
574488
|
if (isEditTool(toolName)) {
|
|
574468
574489
|
const path12 = primaryPath(args);
|
|
@@ -574606,6 +574627,7 @@ var init_focusSupervisor = __esm({
|
|
|
574606
574627
|
lastContext = null;
|
|
574607
574628
|
failureFamilies = /* @__PURE__ */ new Map();
|
|
574608
574629
|
ignoredDirectiveStreak = 0;
|
|
574630
|
+
lastIgnoredDirectiveTurn = null;
|
|
574609
574631
|
constructor(options2 = {}) {
|
|
574610
574632
|
this.mode = options2.mode ?? "auto";
|
|
574611
574633
|
this.modelTier = options2.modelTier ?? "large";
|
|
@@ -574653,9 +574675,25 @@ var init_focusSupervisor = __esm({
|
|
|
574653
574675
|
const family = actionFamily(input.toolName, input.args);
|
|
574654
574676
|
const prior = this.directive;
|
|
574655
574677
|
if (prior && violatesDirective(prior, input)) {
|
|
574678
|
+
const strict = this.shouldStrictlyIntervene(input.context);
|
|
574679
|
+
const sameTurnAsDirective = input.turn <= prior.createdTurn;
|
|
574680
|
+
const alreadyCountedThisTurn = this.lastIgnoredDirectiveTurn === input.turn;
|
|
574681
|
+
if (sameTurnAsDirective || alreadyCountedThisTurn) {
|
|
574682
|
+
if (strict) {
|
|
574683
|
+
const reason = sameTurnAsDirective ? `queued tool call was emitted in the same turn that created directive ${prior.id}; it could not have observed the directive` : `another tool call in turn ${input.turn} already counted against directive ${prior.id}`;
|
|
574684
|
+
return this.block(prior, [
|
|
574685
|
+
"[FOCUS SUPERVISOR BLOCK]",
|
|
574686
|
+
`${reason}.`,
|
|
574687
|
+
`Required next action: ${prior.requiredNextAction}.`,
|
|
574688
|
+
`Blocked action family: ${family}.`,
|
|
574689
|
+
"This block is not counted as a new ignored directive."
|
|
574690
|
+
].join("\n"), false);
|
|
574691
|
+
}
|
|
574692
|
+
return this.pass();
|
|
574693
|
+
}
|
|
574656
574694
|
prior.ignoredCount++;
|
|
574657
574695
|
this.ignoredDirectiveStreak++;
|
|
574658
|
-
|
|
574696
|
+
this.lastIgnoredDirectiveTurn = input.turn;
|
|
574659
574697
|
if (strict && prior.ignoredCount >= 1) {
|
|
574660
574698
|
const terminal = this.ignoredDirectiveStreak >= TERMINAL_INCOMPLETE_IGNORE_THRESHOLD;
|
|
574661
574699
|
const ignoredManyTimes = this.ignoredDirectiveStreak >= 3;
|
|
@@ -574669,6 +574707,7 @@ var init_focusSupervisor = __esm({
|
|
|
574669
574707
|
family
|
|
574670
574708
|
])
|
|
574671
574709
|
});
|
|
574710
|
+
this.lastIgnoredDirectiveTurn = input.turn;
|
|
574672
574711
|
return this.block(directive, [
|
|
574673
574712
|
`[FOCUS SUPERVISOR BLOCK] The previous directive was ignored: ${prior.reason}`,
|
|
574674
574713
|
`Required next action: ${directive.requiredNextAction}.`,
|
|
@@ -574708,7 +574747,7 @@ var init_focusSupervisor = __esm({
|
|
|
574708
574747
|
`This ${input.toolName} action family has already produced evidence and should not be re-executed unchanged.`,
|
|
574709
574748
|
`Required next action: ${directive.requiredNextAction}.`,
|
|
574710
574749
|
"",
|
|
574711
|
-
input.cachedResult
|
|
574750
|
+
compactCachedEvidence(input.cachedResult)
|
|
574712
574751
|
].join("\n"), !input.cachedResultFailed);
|
|
574713
574752
|
}
|
|
574714
574753
|
return this.inject(directive, `[FOCUS SUPERVISOR] ${directive.reason}. Required next action: ${directive.requiredNextAction}.`);
|
|
@@ -574736,6 +574775,11 @@ var init_focusSupervisor = __esm({
|
|
|
574736
574775
|
this.clearSatisfiedDirective("mutation landed", input.turn);
|
|
574737
574776
|
return;
|
|
574738
574777
|
}
|
|
574778
|
+
if (input.runtimeAuthored) {
|
|
574779
|
+
this.lastDecision = "runtime_authored_not_satisfied";
|
|
574780
|
+
this.lastReason = "runtime-authored control result did not execute the requested tool";
|
|
574781
|
+
return;
|
|
574782
|
+
}
|
|
574739
574783
|
if (input.toolName === "todo_write" && input.success) {
|
|
574740
574784
|
if (input.noop) {
|
|
574741
574785
|
this.lastDecision = "todo_noop_not_satisfied";
|
|
@@ -574745,6 +574789,11 @@ var init_focusSupervisor = __esm({
|
|
|
574745
574789
|
this.clearSatisfiedDirective("todo plan updated", input.turn);
|
|
574746
574790
|
return;
|
|
574747
574791
|
}
|
|
574792
|
+
if (input.success && input.noop) {
|
|
574793
|
+
this.lastDecision = "noop_not_satisfied";
|
|
574794
|
+
this.lastReason = "cached/no-op tool result did not perform the required recovery action";
|
|
574795
|
+
return;
|
|
574796
|
+
}
|
|
574748
574797
|
if (input.toolName === "file_read" && input.success) {
|
|
574749
574798
|
if (this.directive?.requiredNextAction === "read_authoritative_target" || this.directive?.requiredNextAction === "use_cached_evidence") {
|
|
574750
574799
|
this.clearSatisfiedDirective("authoritative evidence refreshed", input.turn);
|
|
@@ -574848,6 +574897,8 @@ var init_focusSupervisor = __esm({
|
|
|
574848
574897
|
this.directive = directive;
|
|
574849
574898
|
this.state = directive.state;
|
|
574850
574899
|
this.lastReason = directive.reason;
|
|
574900
|
+
if (!stable)
|
|
574901
|
+
this.lastIgnoredDirectiveTurn = null;
|
|
574851
574902
|
return directive;
|
|
574852
574903
|
}
|
|
574853
574904
|
clearSatisfiedDirective(reason, _turn) {
|
|
@@ -574858,6 +574909,7 @@ var init_focusSupervisor = __esm({
|
|
|
574858
574909
|
this.directive = null;
|
|
574859
574910
|
this.state = "observe";
|
|
574860
574911
|
this.ignoredDirectiveStreak = 0;
|
|
574912
|
+
this.lastIgnoredDirectiveTurn = null;
|
|
574861
574913
|
}
|
|
574862
574914
|
pass() {
|
|
574863
574915
|
return { kind: "pass", state: this.state, ...this.directive ? { directive: this.directive } : {} };
|
|
@@ -582416,6 +582468,32 @@ ${sections.join("\n")}` : sections.join("\n");
|
|
|
582416
582468
|
`Do NOT repeat this exact call. If you believe state changed, perform the concrete change first, then retry with distinct evidence.`
|
|
582417
582469
|
].join("\n");
|
|
582418
582470
|
}
|
|
582471
|
+
_buildRepeatCachedEvidenceNotice(toolName, args, hits, cachedResult) {
|
|
582472
|
+
const argPreview = JSON.stringify(args ?? {}).slice(0, 200);
|
|
582473
|
+
const target = this.extractPrimaryToolPath(args) || argPreview;
|
|
582474
|
+
const summary = this._summarizeCachedToolResult(cachedResult);
|
|
582475
|
+
return [
|
|
582476
|
+
"[REPEAT GATE - cached evidence not re-sent]",
|
|
582477
|
+
`Exact repeat #${hits} of ${toolName}(${argPreview}).`,
|
|
582478
|
+
`target=${target}`,
|
|
582479
|
+
"This call was not executed again, and the cached payload was not re-emitted because repeating it bloats the model context.",
|
|
582480
|
+
summary,
|
|
582481
|
+
"",
|
|
582482
|
+
"Required next action: use the active evidence frame/tool cache and take a concrete next step: edit/write, run verification, update todos with changed state, or task_complete with evidence.",
|
|
582483
|
+
"If you need different information, use a distinct offset/limit/query. For broad multi-file discovery, use file_explore, grep_search, fanout_explore, or full_sub_agent instead of repeating this call."
|
|
582484
|
+
].join("\n");
|
|
582485
|
+
}
|
|
582486
|
+
_summarizeCachedToolResult(output) {
|
|
582487
|
+
const text2 = output || "";
|
|
582488
|
+
const lineCount = text2 ? text2.split("\n").length : 0;
|
|
582489
|
+
const sha = text2.match(/sha256=([a-f0-9]{8,64})/i)?.[1];
|
|
582490
|
+
const header = text2.match(/\[FILE CONTEXT \|[^\]]+\]/)?.[0];
|
|
582491
|
+
return [
|
|
582492
|
+
`cached_size=${lineCount} lines, ${text2.length} chars`,
|
|
582493
|
+
sha ? `cached_sha256=${sha.slice(0, 16)}` : "",
|
|
582494
|
+
header ? `cached_header=${header.slice(0, 220)}` : ""
|
|
582495
|
+
].filter(Boolean).join("\n");
|
|
582496
|
+
}
|
|
582419
582497
|
_renderKnowledgeBlock(recentToolResults) {
|
|
582420
582498
|
if (recentToolResults.size === 0)
|
|
582421
582499
|
return null;
|
|
@@ -587755,12 +587833,9 @@ Read the current file if needed, make a different concrete edit, or move to veri
|
|
|
587755
587833
|
if (repeatGateEligible && _existingFp !== void 0 && _repeatGateMax > 0) {
|
|
587756
587834
|
if (criticDecision.hitNumber >= _repeatGateMax) {
|
|
587757
587835
|
if (isReadLike) {
|
|
587758
|
-
const cachedResult = this.sanitizeCachedToolResult(tc.name, _existingFp.result);
|
|
587759
587836
|
repeatShortCircuit = {
|
|
587760
587837
|
success: true,
|
|
587761
|
-
output:
|
|
587762
|
-
|
|
587763
|
-
` + cachedResult,
|
|
587838
|
+
output: this._buildRepeatCachedEvidenceNotice(tc.name, tc.arguments ?? {}, criticDecision.hitNumber, this.sanitizeCachedToolResult(tc.name, _existingFp.result)),
|
|
587764
587839
|
runtimeAuthored: true,
|
|
587765
587840
|
noop: true
|
|
587766
587841
|
};
|
|
@@ -587789,7 +587864,7 @@ ${cachedResult}`,
|
|
|
587789
587864
|
runtimeAuthored: true
|
|
587790
587865
|
} : {
|
|
587791
587866
|
success: true,
|
|
587792
|
-
output: cachedResult,
|
|
587867
|
+
output: this._buildRepeatCachedEvidenceNotice(tc.name, tc.arguments ?? {}, criticDecision.hitNumber, cachedResult),
|
|
587793
587868
|
runtimeAuthored: true,
|
|
587794
587869
|
noop: true
|
|
587795
587870
|
};
|
|
@@ -587838,7 +587913,8 @@ ${cachedResult}`,
|
|
|
587838
587913
|
success: focusDecision.success,
|
|
587839
587914
|
output: focusDecision.message,
|
|
587840
587915
|
error: focusDecision.success ? void 0 : focusDecision.message,
|
|
587841
|
-
runtimeAuthored: true
|
|
587916
|
+
runtimeAuthored: true,
|
|
587917
|
+
noop: true
|
|
587842
587918
|
};
|
|
587843
587919
|
}
|
|
587844
587920
|
}
|
|
@@ -589140,7 +589216,7 @@ Respond with EXACTLY this structure before your next tool call:
|
|
|
589140
589216
|
}
|
|
589141
589217
|
}
|
|
589142
589218
|
}
|
|
589143
|
-
if (criticGuidance) {
|
|
589219
|
+
if (criticGuidance && !repeatShortCircuit) {
|
|
589144
589220
|
output += `
|
|
589145
589221
|
|
|
589146
589222
|
${criticGuidance}`;
|
|
@@ -589325,7 +589401,8 @@ Evidence: ${evidencePreview}`.slice(0, 500);
|
|
|
589325
589401
|
error: result.error ?? "",
|
|
589326
589402
|
mutated: realFileMutation || shellFilesystemMutation,
|
|
589327
589403
|
isReadLike,
|
|
589328
|
-
noop: tc.name === "todo_write" ? this._isTodoWriteNoopResult(result) : result.noop
|
|
589404
|
+
noop: tc.name === "todo_write" ? this._isTodoWriteNoopResult(result) : result.noop,
|
|
589405
|
+
runtimeAuthored: result.runtimeAuthored === true
|
|
589329
589406
|
});
|
|
589330
589407
|
const focusSnapshotAfter = this._focusSupervisor?.snapshot();
|
|
589331
589408
|
focusAfterToolResult = focusSnapshotAfter ?? void 0;
|
|
@@ -589368,6 +589445,7 @@ Evidence: ${evidencePreview}`.slice(0, 500);
|
|
|
589368
589445
|
requiredNextAction: focusDecision.directive.requiredNextAction
|
|
589369
589446
|
},
|
|
589370
589447
|
repeatShortCircuit: Boolean(repeatShortCircuit),
|
|
589448
|
+
runtimeAuthored: result.runtimeAuthored === true,
|
|
589371
589449
|
runtimeGuidance: runtimeSystemGuidance
|
|
589372
589450
|
});
|
|
589373
589451
|
} catch {
|
|
@@ -591843,7 +591921,7 @@ ${marker}` : marker);
|
|
|
591843
591921
|
].filter(Boolean).join("\n"));
|
|
591844
591922
|
}
|
|
591845
591923
|
shouldBypassDiscoveryCompaction(output) {
|
|
591846
|
-
return output.includes("[IMAGE_BASE64:") || output.includes("[BRANCH-EXTRACT]") || output.includes("[
|
|
591924
|
+
return output.includes("[IMAGE_BASE64:") || output.includes("[BRANCH-EXTRACT]") || output.includes("[REPEAT GATE - cached evidence not re-sent]") || output.includes("[Tool output truncated") || output.includes(TRIAGE_ENVELOPE_MARKER);
|
|
591847
591925
|
}
|
|
591848
591926
|
countTextLines(text2) {
|
|
591849
591927
|
if (!text2)
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.447",
|
|
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.447",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED