omnius 1.0.377 → 1.0.379
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 +138 -14
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -573482,6 +573482,9 @@ ${modelVisible}` : modelVisible || result.error || displayOutput || "";
|
|
|
573482
573482
|
const realFileMutation = input.realFileMutation ?? this._isRealProjectMutation(input.toolName, input.result);
|
|
573483
573483
|
const attemptedTargetPaths = this._extractToolTargetPaths(input.toolName, input.args, input.result);
|
|
573484
573484
|
const realMutationPaths = input.realMutationPaths ?? (realFileMutation ? attemptedTargetPaths : []);
|
|
573485
|
+
if (this._shouldSuppressCompletionDiscoveryEvidence(input.toolName, input.result, attemptedTargetPaths)) {
|
|
573486
|
+
return;
|
|
573487
|
+
}
|
|
573485
573488
|
this._completionLedger = recordToolEvidence(this._completionLedger, {
|
|
573486
573489
|
name: input.toolName,
|
|
573487
573490
|
success: input.result.success,
|
|
@@ -573503,6 +573506,14 @@ ${modelVisible}` : modelVisible || result.error || displayOutput || "";
|
|
|
573503
573506
|
}
|
|
573504
573507
|
this._saveCompletionLedgerSafe();
|
|
573505
573508
|
}
|
|
573509
|
+
_shouldSuppressCompletionDiscoveryEvidence(toolName, result, targetPaths) {
|
|
573510
|
+
if (result.success !== true)
|
|
573511
|
+
return false;
|
|
573512
|
+
if (toolName === "file_read") {
|
|
573513
|
+
return targetPaths.length > 0 && targetPaths.some((path12) => this._evidenceLedger.hasFresh(path12));
|
|
573514
|
+
}
|
|
573515
|
+
return toolName === "list_directory" || toolName === "find_files" || toolName === "grep_search";
|
|
573516
|
+
}
|
|
573506
573517
|
_isAtomicBatchEditAbort(toolName, result) {
|
|
573507
573518
|
if (toolName !== "batch_edit" || !result || result.success !== false) {
|
|
573508
573519
|
return false;
|
|
@@ -582469,7 +582480,7 @@ Then use file_read on individual FILES inside it.`);
|
|
|
582469
582480
|
handledIds.add(matchTc.id);
|
|
582470
582481
|
const output = sr.result.success ? sr.result.output : `Error: ${sr.result.error || "unknown"}
|
|
582471
582482
|
${sr.result.output}`;
|
|
582472
|
-
messages2.push(this.
|
|
582483
|
+
messages2.push(this.buildModelFacingToolMessage(output, matchTc.id, matchTc.name, matchTc.arguments, sr.result.success));
|
|
582473
582484
|
if (matchTc.name === "task_complete") {
|
|
582474
582485
|
if (!sr.result.success) {
|
|
582475
582486
|
messages2.push({
|
|
@@ -582537,7 +582548,7 @@ ${sr.result.output}`;
|
|
|
582537
582548
|
break;
|
|
582538
582549
|
const r2 = await executeSingle(tc);
|
|
582539
582550
|
if (r2) {
|
|
582540
|
-
messages2.push(this.
|
|
582551
|
+
messages2.push(this.buildModelFacingToolMessage(r2.output, r2.tc.id, r2.tc.name, r2.tc.arguments, r2.success));
|
|
582541
582552
|
if (r2.systemGuidance) {
|
|
582542
582553
|
messages2.push({
|
|
582543
582554
|
role: "system",
|
|
@@ -582648,7 +582659,7 @@ ${sr.result.output}`;
|
|
|
582648
582659
|
}, 5);
|
|
582649
582660
|
for (const r2 of results) {
|
|
582650
582661
|
if (r2) {
|
|
582651
|
-
messages2.push(this.
|
|
582662
|
+
messages2.push(this.buildModelFacingToolMessage(r2.output, r2.tc.id, r2.tc.name, r2.tc.arguments, r2.success));
|
|
582652
582663
|
if (r2.systemGuidance) {
|
|
582653
582664
|
messages2.push({
|
|
582654
582665
|
role: "system",
|
|
@@ -583541,7 +583552,7 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
|
|
|
583541
583552
|
} else {
|
|
583542
583553
|
this._consecutiveEnoent = 0;
|
|
583543
583554
|
}
|
|
583544
|
-
const toolMsg = this.
|
|
583555
|
+
const toolMsg = this.buildModelFacingToolMessage(output, tc.id, tc.name, tc.arguments, result.success);
|
|
583545
583556
|
messages2.push(toolMsg);
|
|
583546
583557
|
if (tc.name === "task_complete") {
|
|
583547
583558
|
if (!result.success) {
|
|
@@ -583690,6 +583701,60 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
|
|
|
583690
583701
|
}
|
|
583691
583702
|
}
|
|
583692
583703
|
}
|
|
583704
|
+
if (!completed && !this._completionIncompleteVerification && process.env["OMNIUS_DISABLE_TRUTH_AUTOCOMPLETE"] !== "1") {
|
|
583705
|
+
try {
|
|
583706
|
+
const _finalTurn = Math.max(this._lastBuildSuccessTurn, this._lastFileWriteTurn, toolCallLog.at(-1)?.turn ?? -1, 0);
|
|
583707
|
+
const _todos = this.readSessionTodos() || [];
|
|
583708
|
+
const _truthCompletion = buildTruthBasedCompletion({
|
|
583709
|
+
todos: _todos,
|
|
583710
|
+
currentTurn: _finalTurn,
|
|
583711
|
+
lastValidationTurn: this._lastBuildSuccessTurn,
|
|
583712
|
+
lastValidationCommand: this._lastBuildSuccessCommand,
|
|
583713
|
+
lastMutationTurn: this._lastFileWriteTurn,
|
|
583714
|
+
verifyFailureCount: this._verifyFailures.size,
|
|
583715
|
+
filesEdited: [...this._taskState.modifiedFiles.entries()].map(([path12, action]) => ({ path: path12, action }))
|
|
583716
|
+
});
|
|
583717
|
+
if (_truthCompletion.ready && this._truthAutoCompleteBlockedValidationTurn !== this._lastBuildSuccessTurn) {
|
|
583718
|
+
const _summary = _truthCompletion.summary || "Completed.";
|
|
583719
|
+
const _args = { summary: _summary };
|
|
583720
|
+
if (!holdTaskCompleteGates(_args, _finalTurn)) {
|
|
583721
|
+
const _bpFinalTruth = await this._runBackwardPassReview(_finalTurn, toolCallLog, _summary);
|
|
583722
|
+
if (!_bpFinalTruth || _bpFinalTruth.proceed) {
|
|
583723
|
+
completed = true;
|
|
583724
|
+
summary = _summary;
|
|
583725
|
+
this.emit({
|
|
583726
|
+
type: "status",
|
|
583727
|
+
content: `REG-31: run-end truth-based completion synthesized (${_truthCompletion.reason})`,
|
|
583728
|
+
turn: _finalTurn,
|
|
583729
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
583730
|
+
});
|
|
583731
|
+
this._onTypedEvent?.({
|
|
583732
|
+
type: "completion_requested",
|
|
583733
|
+
runId: this._sessionId ?? "unknown",
|
|
583734
|
+
summary: summary.slice(0, 500),
|
|
583735
|
+
sourcePath: "direct",
|
|
583736
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
583737
|
+
});
|
|
583738
|
+
if (summary && !this._assistantTextEmitted) {
|
|
583739
|
+
this.emit({
|
|
583740
|
+
type: "assistant_text",
|
|
583741
|
+
content: summary,
|
|
583742
|
+
source: "task_complete_summary",
|
|
583743
|
+
turn: _finalTurn,
|
|
583744
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
583745
|
+
});
|
|
583746
|
+
this._assistantTextEmitted = true;
|
|
583747
|
+
}
|
|
583748
|
+
} else if (_bpFinalTruth.feedback) {
|
|
583749
|
+
emitBackwardPassAdvisory(_bpFinalTruth.feedback, _finalTurn);
|
|
583750
|
+
}
|
|
583751
|
+
} else {
|
|
583752
|
+
this._truthAutoCompleteBlockedValidationTurn = this._lastBuildSuccessTurn;
|
|
583753
|
+
}
|
|
583754
|
+
}
|
|
583755
|
+
} catch {
|
|
583756
|
+
}
|
|
583757
|
+
}
|
|
583693
583758
|
const durationMs = Date.now() - start2;
|
|
583694
583759
|
const incompleteVerification = this._completionIncompleteVerification;
|
|
583695
583760
|
if (incompleteVerification && !summary) {
|
|
@@ -584520,6 +584585,75 @@ ${marker}` : marker);
|
|
|
584520
584585
|
}
|
|
584521
584586
|
return { role: "tool", content: messageContent, tool_call_id: toolCallId };
|
|
584522
584587
|
}
|
|
584588
|
+
buildModelFacingToolMessage(output, toolCallId, toolName, args, success) {
|
|
584589
|
+
return this.buildToolMessage(this.compactDiscoveryOutputForModel(toolName, args, output, success), toolCallId, toolName);
|
|
584590
|
+
}
|
|
584591
|
+
compactDiscoveryOutputForModel(toolName, args, output, success) {
|
|
584592
|
+
if (success !== true)
|
|
584593
|
+
return output;
|
|
584594
|
+
if (this.shouldBypassDiscoveryCompaction(output))
|
|
584595
|
+
return output;
|
|
584596
|
+
const displayOutput = this.unwrapToolOutputForDisplay(output);
|
|
584597
|
+
if (toolName === "file_read") {
|
|
584598
|
+
const path13 = this.extractPrimaryToolPath(args);
|
|
584599
|
+
if (!path13 || !this._evidenceLedger.hasFresh(path13))
|
|
584600
|
+
return output;
|
|
584601
|
+
const entry = this._evidenceLedger.get(path13);
|
|
584602
|
+
return this.wrapToolOutputForModel(toolName, [
|
|
584603
|
+
"[DISCOVERY COMPACTED - file_read evidence captured]",
|
|
584604
|
+
`path=${path13}`,
|
|
584605
|
+
`captured=${this.countTextLines(displayOutput)} lines, ${displayOutput.length} chars${entry ? `, fidelity=${entry.fidelity}` : ""}`,
|
|
584606
|
+
'active_context="Evidence already gathered this run"',
|
|
584607
|
+
"Use the active evidence frame. Re-read only if that frame marks this file STALE or you need a distinct range."
|
|
584608
|
+
].join("\n"));
|
|
584609
|
+
}
|
|
584610
|
+
const previewSpec = toolName === "list_directory" ? { label: "directory listing", maxLines: 40, maxChars: 2400 } : toolName === "find_files" ? { label: "file discovery", maxLines: 60, maxChars: 3e3 } : toolName === "grep_search" ? { label: "search matches", maxLines: 40, maxChars: 3e3 } : null;
|
|
584611
|
+
if (!previewSpec)
|
|
584612
|
+
return output;
|
|
584613
|
+
const path12 = this.extractPrimaryToolPath(args);
|
|
584614
|
+
const preview = this.boundedDiscoveryPreview(displayOutput, previewSpec.maxLines, previewSpec.maxChars);
|
|
584615
|
+
return this.wrapToolOutputForModel(toolName, [
|
|
584616
|
+
`[DISCOVERY BOUNDED - ${previewSpec.label}]`,
|
|
584617
|
+
path12 ? `path=${path12}` : "",
|
|
584618
|
+
`captured=${this.countTextLines(displayOutput)} lines, ${displayOutput.length} chars`,
|
|
584619
|
+
`preview_lines=${preview.keptLines}/${preview.totalLines}`,
|
|
584620
|
+
"Keep these discovered candidates in mind; repeat this discovery only if the underlying filesystem/search scope has changed.",
|
|
584621
|
+
"",
|
|
584622
|
+
preview.text
|
|
584623
|
+
].filter(Boolean).join("\n"));
|
|
584624
|
+
}
|
|
584625
|
+
shouldBypassDiscoveryCompaction(output) {
|
|
584626
|
+
return output.includes("[IMAGE_BASE64:") || output.includes("[BRANCH-EXTRACT]") || output.includes("[STOP RE-READING") || output.includes("[Tool output truncated") || output.includes(TRIAGE_ENVELOPE_MARKER);
|
|
584627
|
+
}
|
|
584628
|
+
countTextLines(text2) {
|
|
584629
|
+
if (!text2)
|
|
584630
|
+
return 0;
|
|
584631
|
+
return text2.split("\n").length;
|
|
584632
|
+
}
|
|
584633
|
+
boundedDiscoveryPreview(text2, maxLines, maxChars) {
|
|
584634
|
+
const lines = text2.split("\n");
|
|
584635
|
+
const kept = [];
|
|
584636
|
+
let used = 0;
|
|
584637
|
+
for (const line of lines) {
|
|
584638
|
+
if (kept.length >= maxLines)
|
|
584639
|
+
break;
|
|
584640
|
+
const next = line.slice(0, Math.max(0, maxChars - used));
|
|
584641
|
+
if (next.length === 0 && line.length > 0)
|
|
584642
|
+
break;
|
|
584643
|
+
kept.push(next);
|
|
584644
|
+
used += next.length + 1;
|
|
584645
|
+
if (used >= maxChars)
|
|
584646
|
+
break;
|
|
584647
|
+
}
|
|
584648
|
+
if (kept.length < lines.length) {
|
|
584649
|
+
kept.push(`[... ${lines.length - kept.length} additional line(s) compacted ...]`);
|
|
584650
|
+
}
|
|
584651
|
+
return {
|
|
584652
|
+
text: kept.join("\n"),
|
|
584653
|
+
totalLines: lines.length,
|
|
584654
|
+
keptLines: Math.min(kept.length, lines.length)
|
|
584655
|
+
};
|
|
584656
|
+
}
|
|
584523
584657
|
// -------------------------------------------------------------------------
|
|
584524
584658
|
// Output folding — keep head + tail, omit middle (preserves errors at end)
|
|
584525
584659
|
// -------------------------------------------------------------------------
|
|
@@ -615685,16 +615819,6 @@ var init_status_bar = __esm({
|
|
|
615685
615819
|
last2.width += 2;
|
|
615686
615820
|
}
|
|
615687
615821
|
}
|
|
615688
|
-
const modelSummary2 = this.summarizeHeaderModelName();
|
|
615689
|
-
if (modelSummary2) {
|
|
615690
|
-
const text2 = ` ${modelSummary2} `;
|
|
615691
|
-
parts.push({ text: text2, width: stripAnsi(text2).length });
|
|
615692
|
-
}
|
|
615693
|
-
const transportSummary = this.summarizeHeaderTransport();
|
|
615694
|
-
if (transportSummary) {
|
|
615695
|
-
const text2 = ` ${transportSummary} `;
|
|
615696
|
-
parts.push({ text: text2, width: stripAnsi(text2).length });
|
|
615697
|
-
}
|
|
615698
615822
|
if (this._processing) {
|
|
615699
615823
|
const glyph = _StatusBar.HEADER_SPINNER_FRAMES[this._headerSpinnerFrame] ?? "";
|
|
615700
615824
|
const last2 = parts[parts.length - 1];
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.379",
|
|
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.379",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED