omnius 1.0.345 → 1.0.346

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 CHANGED
@@ -568855,7 +568855,7 @@ RECOVERY: cd to the directory containing '${file}', run a plain install with no
568855
568855
  });
568856
568856
 
568857
568857
  // packages/orchestrator/dist/agenticRunner.js
568858
- import { existsSync as _fsExistsSync, readFileSync as _fsReadFileSync, writeFileSync as _fsWriteFileSync, appendFileSync as _fsAppendFileSync, unlinkSync as _fsUnlinkSync, mkdirSync as _fsMkdirSync } from "node:fs";
568858
+ import { existsSync as _fsExistsSync, readFileSync as _fsReadFileSync, writeFileSync as _fsWriteFileSync, appendFileSync as _fsAppendFileSync, unlinkSync as _fsUnlinkSync, mkdirSync as _fsMkdirSync, statSync as _fsStatSync } from "node:fs";
568859
568859
  import { execFile as _execFile, spawn as _spawn } from "node:child_process";
568860
568860
  import { createHash as _createHash } from "node:crypto";
568861
568861
  import { join as _pathJoin, resolve as _pathResolve } from "node:path";
@@ -578830,41 +578830,63 @@ Respond with EXACTLY this structure before your next tool call:
578830
578830
  result = await this.offloadEmbeddedImageResult(result, tc.name, turn);
578831
578831
  }
578832
578832
  let output = this.normalizeToolOutput(result, tc.name, tc.arguments, turn);
578833
- if (process.env["OMNIUS_DISABLE_BRANCH_EXTRACT"] !== "1" && this.lookupRegisteredTool(tc.name)?.name === "file_read" && result.success && typeof result.output === "string" && this.backend && typeof this.backend.chatCompletion === "function") {
578833
+ if (process.env["OMNIUS_DISABLE_BRANCH_EXTRACT"] !== "1" && this.lookupRegisteredTool(tc.name)?.name === "file_read" && result.success && this.backend && typeof this.backend.chatCompletion === "function") {
578834
578834
  const a2 = tc.arguments ?? {};
578835
- const hasSmallRange = typeof a2["limit"] === "number" && a2["limit"] <= 80;
578836
- const lineCount = result.output.split("\n").length;
578837
- if (shouldBranchRead(result.output.length, lineCount, hasSmallRange)) {
578838
- const p2 = String(a2["path"] ?? a2["file"] ?? a2["file_path"] ?? "");
578839
- const lastAssistant = [...messages2].reverse().find((m2) => m2.role === "assistant" && typeof m2.content === "string");
578840
- const query = [
578841
- this._taskState.goal ?? "",
578842
- typeof lastAssistant?.content === "string" ? lastAssistant.content : ""
578843
- ].join(" ").trim().slice(0, 400) || "key facts, configuration, and structure";
578844
- try {
578845
- const ev = await extractEvidence({
578846
- path: p2,
578847
- query,
578848
- content: result.output,
578849
- fileVersion: this._worldFacts.files.get(p2)?.writeCount ?? 0,
578850
- backend: this.backend,
578851
- timeoutMs: 3e4
578852
- });
578853
- output = [
578854
- `[BRANCH-EXTRACT] ${p2} is large (${lineCount} lines, ${result.output.length} chars) — read in an isolated branch so it does not flood your context.`,
578855
- `Distilled for: "${query.slice(0, 160)}"`,
578856
- `Relevant evidence (lines ${ev.sourceStart ?? "?"}-${ev.sourceEnd ?? "?"}, confidence ${ev.confidence.toFixed(2)}):`,
578857
- ev.claim,
578858
- `If you need a different region, call file_read with a specific offset+limit, or extract_evidence(path, query) with a sharper question.`
578859
- ].join("\n");
578860
- this.emit({
578861
- type: "status",
578862
- toolName: tc.name,
578863
- content: `Branch-extract: ${p2} (${lineCount} lines) → ${ev.injectedChars} chars to context (${(result.output.length / Math.max(1, ev.injectedChars)).toFixed(0)}× smaller)`,
578864
- turn,
578865
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
578866
- });
578867
- } catch {
578835
+ const hasExplicitRange = typeof a2["offset"] === "number" || typeof a2["limit"] === "number";
578836
+ const pRaw = String(a2["path"] ?? a2["file"] ?? a2["file_path"] ?? "");
578837
+ if (!hasExplicitRange && pRaw) {
578838
+ let fullContent = null;
578839
+ let trueLines = 0;
578840
+ let trueBytes = 0;
578841
+ for (const cand of [
578842
+ pRaw,
578843
+ _pathResolve(this._workingDirectory || process.cwd(), pRaw)
578844
+ ]) {
578845
+ try {
578846
+ const st = _fsStatSync(cand);
578847
+ if (st.isFile()) {
578848
+ trueBytes = st.size;
578849
+ if (trueBytes > 8e3) {
578850
+ fullContent = _fsReadFileSync(cand, "utf-8");
578851
+ trueLines = fullContent.split("\n").length;
578852
+ }
578853
+ break;
578854
+ }
578855
+ } catch {
578856
+ }
578857
+ }
578858
+ if (fullContent && shouldBranchRead(trueBytes, trueLines, false)) {
578859
+ const lastAssistant = [...messages2].reverse().find((m2) => m2.role === "assistant" && typeof m2.content === "string");
578860
+ const query = [
578861
+ this._taskState.goal ?? "",
578862
+ typeof lastAssistant?.content === "string" ? lastAssistant.content : ""
578863
+ ].join(" ").trim().slice(0, 400) || "key facts, configuration, and structure";
578864
+ try {
578865
+ const ev = await extractEvidence({
578866
+ path: pRaw,
578867
+ query,
578868
+ content: fullContent,
578869
+ // the REAL body, not the preview
578870
+ fileVersion: this._worldFacts.files.get(pRaw)?.writeCount ?? 0,
578871
+ backend: this.backend,
578872
+ timeoutMs: 3e4
578873
+ });
578874
+ output = [
578875
+ `[BRANCH-EXTRACT] ${pRaw} is large (${trueLines} lines, ${trueBytes} bytes); a whole-file read only returns a preview, so it was read in an isolated branch and distilled.`,
578876
+ `Distilled for: "${query.slice(0, 160)}"`,
578877
+ `Relevant evidence (lines ${ev.sourceStart ?? "?"}-${ev.sourceEnd ?? "?"}, confidence ${ev.confidence.toFixed(2)}):`,
578878
+ ev.claim,
578879
+ `If you need a different region, call file_read with a specific offset+limit. Do NOT re-read the whole file — you already have the relevant content above.`
578880
+ ].join("\n");
578881
+ this.emit({
578882
+ type: "status",
578883
+ toolName: tc.name,
578884
+ content: `Branch-extract: ${pRaw} (${trueLines} lines / ${trueBytes}B) → ${ev.injectedChars} chars to context (${(trueBytes / Math.max(1, ev.injectedChars)).toFixed(0)}× smaller)`,
578885
+ turn,
578886
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
578887
+ });
578888
+ } catch {
578889
+ }
578868
578890
  }
578869
578891
  }
578870
578892
  }
@@ -584359,6 +584381,8 @@ ${result}`
584359
584381
  return true;
584360
584382
  if (/fetch failed|ECONNREFUSED|ECONNRESET|ETIMEDOUT|EPIPE|socket hang up|UND_ERR|other side closed/i.test(msg))
584361
584383
  return true;
584384
+ if (/stream timeout|no response or chunk within|no response within \d+\s*s|stream stalled/i.test(msg))
584385
+ return true;
584362
584386
  if (/received HTML error page/i.test(msg))
584363
584387
  return true;
584364
584388
  if (/model is loading|server busy|overloaded/i.test(msg))
@@ -584602,7 +584626,7 @@ ${description}`
584602
584626
  if (!this.isTransientError(initialErr))
584603
584627
  return null;
584604
584628
  const errMsg = flattenErrorText(initialErr);
584605
- const isNetworkError2 = /fetch failed|ECONNREFUSED|ECONNRESET|ETIMEDOUT|socket hang up|UND_ERR|other side closed/i.test(errMsg);
584629
+ const isNetworkError2 = /fetch failed|ECONNREFUSED|ECONNRESET|ETIMEDOUT|socket hang up|UND_ERR|other side closed|stream timeout|no response or chunk within|no response within \d+\s*s|stream stalled/i.test(errMsg);
584606
584630
  const isAuthError = this.isRecoverableAuthError(initialErr);
584607
584631
  const isGpuSlotUnavailable = this.isGpuSlotUnavailableError(initialErr);
584608
584632
  const maxRetries = isNetworkError2 || isGpuSlotUnavailable || isAuthError ? Infinity : 3;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.345",
3
+ "version": "1.0.346",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.345",
9
+ "version": "1.0.346",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.345",
3
+ "version": "1.0.346",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",