omnius 1.0.453 → 1.0.455
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 +74 -14
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -574333,6 +574333,10 @@ function updateGlobalIndex(paths, runIndex) {
|
|
|
574333
574333
|
schemaVersion: 1,
|
|
574334
574334
|
updatedAt: now2,
|
|
574335
574335
|
root: paths.root,
|
|
574336
|
+
runCount: 0,
|
|
574337
|
+
latestRun: null,
|
|
574338
|
+
diagnoses: {},
|
|
574339
|
+
anchors: [],
|
|
574336
574340
|
runs: []
|
|
574337
574341
|
};
|
|
574338
574342
|
next.updatedAt = now2;
|
|
@@ -574352,8 +574356,35 @@ function updateGlobalIndex(paths, runIndex) {
|
|
|
574352
574356
|
entry,
|
|
574353
574357
|
...next.runs.filter((item) => item.runId !== runIndex.runId)
|
|
574354
574358
|
].slice(0, 100);
|
|
574359
|
+
next.runCount = next.runs.length;
|
|
574360
|
+
next.latestRun = {
|
|
574361
|
+
runId: runIndex.runId,
|
|
574362
|
+
sessionId: runIndex.sessionId,
|
|
574363
|
+
cwd: runIndex.cwd,
|
|
574364
|
+
updatedAt: runIndex.updatedAt,
|
|
574365
|
+
eventCount: runIndex.summary.eventCount,
|
|
574366
|
+
failureCount: runIndex.summary.failureCount,
|
|
574367
|
+
focusBlockCount: runIndex.summary.focusBlockCount,
|
|
574368
|
+
suspiciousShellCount: runIndex.summary.suspiciousShellCount,
|
|
574369
|
+
readmePath: runIndex.readmePath,
|
|
574370
|
+
indexPath: runIndex.indexPath
|
|
574371
|
+
};
|
|
574372
|
+
next.diagnoses = aggregateGlobalDiagnoses(next.runs);
|
|
574373
|
+
next.anchors = buildAnchors(runIndex.cwd, runIndex.runId, paths);
|
|
574355
574374
|
writeFileSync49(paths.globalIndexPath, JSON.stringify(next, null, 2), "utf-8");
|
|
574356
574375
|
}
|
|
574376
|
+
function aggregateGlobalDiagnoses(runs) {
|
|
574377
|
+
const totals = {};
|
|
574378
|
+
for (const run2 of runs) {
|
|
574379
|
+
const index = readJson2(run2.indexPath);
|
|
574380
|
+
if (!index?.diagnoses)
|
|
574381
|
+
continue;
|
|
574382
|
+
for (const [name10, count] of Object.entries(index.diagnoses)) {
|
|
574383
|
+
totals[name10] = (totals[name10] ?? 0) + count;
|
|
574384
|
+
}
|
|
574385
|
+
}
|
|
574386
|
+
return Object.fromEntries(Object.entries(totals).sort((a2, b) => b[1] - a2[1] || a2[0].localeCompare(b[0])));
|
|
574387
|
+
}
|
|
574357
574388
|
function buildAnchors(cwd4, runId, paths, extra = []) {
|
|
574358
574389
|
const omniusDir = join112(cwd4, ".omnius");
|
|
574359
574390
|
const raw = [
|
|
@@ -574752,8 +574783,13 @@ function violatesDirective(directive, input) {
|
|
|
574752
574783
|
if (directive.requiredNextAction !== "update_todos") {
|
|
574753
574784
|
if (directive.forbiddenActionFamilies.includes(family))
|
|
574754
574785
|
return true;
|
|
574755
|
-
if (directive.forbiddenActionFamilies.includes(input.toolName))
|
|
574786
|
+
if (directive.forbiddenActionFamilies.includes(input.toolName)) {
|
|
574787
|
+
if (input.toolName === "shell" && input.isReadLike)
|
|
574788
|
+
return false;
|
|
574789
|
+
if (input.toolName === "shell" && input.shellLikelyMutatesFilesystem)
|
|
574790
|
+
return false;
|
|
574756
574791
|
return true;
|
|
574792
|
+
}
|
|
574757
574793
|
}
|
|
574758
574794
|
switch (directive.requiredNextAction) {
|
|
574759
574795
|
case "update_todos":
|
|
@@ -574781,6 +574817,12 @@ function violatesDirective(directive, input) {
|
|
|
574781
574817
|
return false;
|
|
574782
574818
|
}
|
|
574783
574819
|
}
|
|
574820
|
+
function forbiddenCachedEvidenceFamilies(input, family) {
|
|
574821
|
+
if (input.cachedResultFailed && input.toolName === "shell") {
|
|
574822
|
+
return uniqueLimited([family, "shell"]);
|
|
574823
|
+
}
|
|
574824
|
+
return [family];
|
|
574825
|
+
}
|
|
574784
574826
|
function normalizeCompletionStatus(value2) {
|
|
574785
574827
|
if (typeof value2 !== "string")
|
|
574786
574828
|
return null;
|
|
@@ -575110,7 +575152,7 @@ var init_focusSupervisor = __esm({
|
|
|
575110
575152
|
state,
|
|
575111
575153
|
reason: input.cachedResultFailed ? `cached failed ${input.toolName} evidence already exists` : `duplicate ${input.toolName} call has cached evidence`,
|
|
575112
575154
|
requiredNextAction: "use_cached_evidence",
|
|
575113
|
-
forbiddenActionFamilies:
|
|
575155
|
+
forbiddenActionFamilies: forbiddenCachedEvidenceFamilies(input, family)
|
|
575114
575156
|
});
|
|
575115
575157
|
if (strict && !advisoryOnly && (input.cachedResultFailed || duplicateHitCount >= hitLimit)) {
|
|
575116
575158
|
return this.block(directive, [
|
|
@@ -575199,22 +575241,23 @@ var init_focusSupervisor = __esm({
|
|
|
575199
575241
|
const forbidden = staleEditFailure ? uniqueLimited([
|
|
575200
575242
|
actionFamily(input.toolName, input.args),
|
|
575201
575243
|
input.toolName
|
|
575202
|
-
]) : [actionFamily(input.toolName, input.args)];
|
|
575244
|
+
]) : input.toolName === "shell" ? uniqueLimited([actionFamily(input.toolName, input.args), "shell"]) : [actionFamily(input.toolName, input.args)];
|
|
575203
575245
|
this.setDirective({
|
|
575204
575246
|
turn: input.turn,
|
|
575205
575247
|
state: "forced_replan",
|
|
575206
575248
|
reason: `same ${input.toolName} failure family repeated ${next.count} times: ${next.sample}`,
|
|
575207
|
-
requiredNextAction: staleEditFailure ? "read_authoritative_target" : input.toolName === "shell" ? "
|
|
575249
|
+
requiredNextAction: staleEditFailure ? "read_authoritative_target" : input.toolName === "shell" ? "use_cached_evidence" : "update_todos",
|
|
575208
575250
|
forbiddenActionFamilies: forbidden
|
|
575209
575251
|
});
|
|
575210
575252
|
} else if (next.count === 1 && !this.directive) {
|
|
575211
575253
|
const staleEditFailure = isEditTool(input.toolName) && next.errorClass.startsWith("stale_");
|
|
575254
|
+
const shellFailure = input.toolName === "shell";
|
|
575212
575255
|
this.setDirective({
|
|
575213
575256
|
turn: input.turn,
|
|
575214
|
-
state: "warn",
|
|
575257
|
+
state: shellFailure ? "cached_evidence" : "warn",
|
|
575215
575258
|
reason: `first ${input.toolName} failure (${next.errorClass}): ${next.sample}`,
|
|
575216
|
-
requiredNextAction: staleEditFailure ? "read_authoritative_target" : "update_todos",
|
|
575217
|
-
forbiddenActionFamilies: [actionFamily(input.toolName, input.args)]
|
|
575259
|
+
requiredNextAction: staleEditFailure ? "read_authoritative_target" : shellFailure ? "use_cached_evidence" : "update_todos",
|
|
575260
|
+
forbiddenActionFamilies: shellFailure ? uniqueLimited([actionFamily(input.toolName, input.args), "shell"]) : [actionFamily(input.toolName, input.args)]
|
|
575218
575261
|
});
|
|
575219
575262
|
}
|
|
575220
575263
|
}
|
|
@@ -577736,6 +577779,15 @@ function formatTodoReminderItems(todos, maxRows) {
|
|
|
577736
577779
|
rows.push(`... +${todos.length - rows.length} more`);
|
|
577737
577780
|
return rows.join("\n");
|
|
577738
577781
|
}
|
|
577782
|
+
function selectHeadTailLines(lines, headCount, tailCount) {
|
|
577783
|
+
if (lines.length <= headCount + tailCount)
|
|
577784
|
+
return lines;
|
|
577785
|
+
return [
|
|
577786
|
+
...lines.slice(0, headCount),
|
|
577787
|
+
`... [${lines.length - headCount - tailCount} middle line(s) omitted]`,
|
|
577788
|
+
...lines.slice(-tailCount)
|
|
577789
|
+
];
|
|
577790
|
+
}
|
|
577739
577791
|
function stripThinkBlocks(s2) {
|
|
577740
577792
|
if (!s2)
|
|
577741
577793
|
return s2;
|
|
@@ -582805,13 +582857,11 @@ ${contentPreview}
|
|
|
582805
582857
|
for (const f2 of shown) {
|
|
582806
582858
|
const argsRepr = JSON.stringify(f2.args).slice(0, 120);
|
|
582807
582859
|
const failureText = [f2.error, f2.output].filter((v) => typeof v === "string" && v.trim().length > 0).join("\n");
|
|
582808
|
-
const
|
|
582809
|
-
const errFull = failureText.slice(0, f2.tool === "file_edit" || f2.tool === "batch_edit" || f2.tool === "file_patch" ? 1200 : 600);
|
|
582860
|
+
const excerpt = this._formatRecentFailureExcerpt(f2.tool, failureText);
|
|
582810
582861
|
lines.push(`• turn ${f2.turn} — ${f2.tool}(${argsRepr})`);
|
|
582811
|
-
lines.push(` first line: ${
|
|
582812
|
-
if (
|
|
582813
|
-
|
|
582814
|
-
lines.push(indented);
|
|
582862
|
+
lines.push(` first line: ${excerpt.firstLine}`);
|
|
582863
|
+
if (excerpt.body) {
|
|
582864
|
+
lines.push(excerpt.body);
|
|
582815
582865
|
}
|
|
582816
582866
|
}
|
|
582817
582867
|
if (repeating.length > 0) {
|
|
@@ -582821,6 +582871,14 @@ ${contentPreview}
|
|
|
582821
582871
|
lines.push(`(turn ${turn} — failures auto-expire after 10 turns; cleared on success or successful retry)`);
|
|
582822
582872
|
return lines.join("\n");
|
|
582823
582873
|
}
|
|
582874
|
+
_formatRecentFailureExcerpt(tool, text2) {
|
|
582875
|
+
const lines = String(text2 || "").replace(/\r/g, "").split("\n").map((line) => line.trimEnd());
|
|
582876
|
+
const firstLine = lines.find((line) => line.trim().length > 0)?.slice(0, 220) || "(no error message)";
|
|
582877
|
+
const maxChars = tool === "file_edit" || tool === "batch_edit" || tool === "file_patch" ? 1400 : tool === "shell" ? 2200 : 900;
|
|
582878
|
+
const selected = tool === "shell" ? selectHeadTailLines(lines, 8, 14) : lines.slice(0, 8);
|
|
582879
|
+
const body = selected.filter((line) => line.trim().length > 0).map((line) => ` ${line}`).join("\n").slice(0, maxChars);
|
|
582880
|
+
return { firstLine, body };
|
|
582881
|
+
}
|
|
582824
582882
|
/**
|
|
582825
582883
|
* Render a short, local-code-first nudge from the freshest failure signal.
|
|
582826
582884
|
* This is intentionally not a web-search suggestion: most coding-agent loops
|
|
@@ -588347,6 +588405,7 @@ Read the current file if needed, make a different concrete edit, or move to veri
|
|
|
588347
588405
|
].includes(tc.name);
|
|
588348
588406
|
const isStatefulBrowserTool = this._isStatefulBrowserTool(tc.name);
|
|
588349
588407
|
const isReadLike = !isStatefulBrowserTool && (baseIsReadLike || tc.name === "shell" && this._isShellCommandReadOnly(tc.arguments?.["command"] ?? tc.arguments?.["cmd"] ?? ""));
|
|
588408
|
+
const shellLikelyMutatesFilesystem = tc.name === "shell" && this._shellCommandLikelyMutatesFilesystem(String(tc.arguments?.["command"] ?? tc.arguments?.["cmd"] ?? ""));
|
|
588350
588409
|
const adversaryRedundantSignal = this._adversaryRedundantSignals.has(toolFingerprint);
|
|
588351
588410
|
if (adversaryRedundantSignal) {
|
|
588352
588411
|
this._adversaryRedundantSignals.delete(toolFingerprint);
|
|
@@ -588533,6 +588592,7 @@ ${cachedResult}`,
|
|
|
588533
588592
|
completionStatus: completionStatusFromTaskCompleteArgs(tc.arguments),
|
|
588534
588593
|
fingerprint: toolFingerprint,
|
|
588535
588594
|
isReadLike,
|
|
588595
|
+
shellLikelyMutatesFilesystem,
|
|
588536
588596
|
cachedResult: focusCachedEntry?.result,
|
|
588537
588597
|
cachedResultFailed: tc.name === "shell" && typeof focusCachedEntry?.result === "string" && focusCachedEntry.result.includes("status: failure"),
|
|
588538
588598
|
duplicateHitCount: focusDuplicateHits,
|
|
@@ -589681,7 +589741,7 @@ Respond with EXACTLY this structure before your next tool call:
|
|
|
589681
589741
|
fingerprint: toolFingerprint,
|
|
589682
589742
|
args: tc.arguments,
|
|
589683
589743
|
error: (result.error ?? "").slice(0, 600),
|
|
589684
|
-
output: (result.output ?? "").slice(0, 1500),
|
|
589744
|
+
output: (result.output ?? "").slice(0, tc.name === "shell" ? 4e3 : 1500),
|
|
589685
589745
|
turn
|
|
589686
589746
|
});
|
|
589687
589747
|
if (this._recentFailures.length > 8) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.455",
|
|
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.455",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED