omnius 1.0.239 → 1.0.241

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
@@ -591476,18 +591476,35 @@ function buildToolResultBody(toolName, success, output, verbose) {
591476
591476
  return diffBodyLines(output, verbose);
591477
591477
  }
591478
591478
  if (toolName === "file_write") {
591479
- const summary = extractFirstLine(output, Number.MAX_SAFE_INTEGER);
591480
- return [{
591481
- text: summary,
591479
+ if (!success) {
591480
+ return [{ text: extractFirstLine(output, Number.MAX_SAFE_INTEGER), mode: "wrap", kind: "error" }];
591481
+ }
591482
+ const writeLines = output.split("\n").filter((l2) => l2.trim());
591483
+ if (writeLines.length === 0) {
591484
+ return [{ text: "Done", mode: "wrap", kind: "success" }];
591485
+ }
591486
+ const maxLines2 = resolveToolOutputMaxLines(verbose);
591487
+ return writeLines.slice(0, maxLines2).map((line) => ({
591488
+ text: line,
591482
591489
  mode: "wrap",
591483
- kind: success ? "dim" : "error"
591484
- }];
591490
+ kind: "dim"
591491
+ }));
591485
591492
  }
591486
591493
  if (toolName === "file_read") {
591487
591494
  if (!success) {
591488
591495
  return [{ text: extractFirstLine(output, Number.MAX_SAFE_INTEGER), mode: "wrap", kind: "error" }];
591489
591496
  }
591490
- return codePreviewLines(output, resolveToolOutputMaxLines(verbose));
591497
+ const body = codePreviewLines(output, resolveToolOutputMaxLines(verbose));
591498
+ const headerMatch = output.match(/^\[FILE CONTEXT \| (.+?) \| (.+?) \| sha256=(.+?)\]/);
591499
+ if (headerMatch) {
591500
+ const [, filePath, scope, hash] = headerMatch;
591501
+ body.unshift({
591502
+ text: c3.dim(`Read ${scope} from ${filePath} · sha256 ${hash.slice(0, 12)}…`),
591503
+ mode: "wrap",
591504
+ kind: "plain"
591505
+ });
591506
+ }
591507
+ return body;
591491
591508
  }
591492
591509
  if (toolName === "task_complete") {
591493
591510
  const summary = output && output.trim() ? output : "Done";
@@ -591550,6 +591567,7 @@ function codePreviewLines(output, maxLines) {
591550
591567
  const lines = output.split("\n");
591551
591568
  let start2 = 0;
591552
591569
  while (start2 < lines.length && !lines[start2].trim()) start2++;
591570
+ if (start2 < lines.length && /^\[FILE CONTEXT \|/.test(lines[start2])) start2++;
591553
591571
  const shown = lines.slice(start2, start2 + maxLines);
591554
591572
  if (shown.length === 0) return [{ text: "(empty file)", mode: "wrap", kind: "dim" }];
591555
591573
  const body = shown.map((line) => ({
@@ -597446,7 +597464,7 @@ var init_call_agent = __esm({
597446
597464
  ts: Date.now(),
597447
597465
  source: "call",
597448
597466
  sourceId: clientId,
597449
- summary: `Responded: ${summary.slice(0, 100)}`
597467
+ summary: `Responded: ${summary}`
597450
597468
  });
597451
597469
  return { success: true, output: summary };
597452
597470
  }
@@ -597467,7 +597485,7 @@ var init_call_agent = __esm({
597467
597485
  if (event.type === "tool_result") {
597468
597486
  const toolName = event.toolName ?? "unknown";
597469
597487
  const success = event.success ?? false;
597470
- const content = String(event.content ?? "").slice(0, 100);
597488
+ const content = String(event.content ?? "");
597471
597489
  this.emit("toolResult", toolName, success, content);
597472
597490
  feed.push({
597473
597491
  ts: Date.now(),
@@ -616673,7 +616691,7 @@ function describeToolCall(toolName, args, personality = 2, emotion, stark = fals
616673
616691
  }
616674
616692
  function extractResultDigest(toolName, content) {
616675
616693
  if (!content || content.length < 5) return "";
616676
- const text2 = content.slice(0, 2e3);
616694
+ const text2 = content.slice(0, 8e3);
616677
616695
  const nuggets = [];
616678
616696
  const ethMatch = text2.match(/([\d.]+)\s*ETH/i);
616679
616697
  if (ethMatch) nuggets.push(`${ethMatch[1]} ETH`);
@@ -616717,8 +616735,8 @@ function extractResultDigest(toolName, content) {
616717
616735
  const contentDigest = extractContentSummary(text2, toolName);
616718
616736
  if (contentDigest) nuggets.push(contentDigest);
616719
616737
  }
616720
- const digest3 = nuggets.slice(0, 3).join(", ");
616721
- return digest3.length > 100 ? digest3.slice(0, 97) + "..." : digest3;
616738
+ const digest3 = nuggets.slice(0, 5).join(", ");
616739
+ return digest3.length > 400 ? digest3.slice(0, 397) + "..." : digest3;
616722
616740
  }
616723
616741
  function extractContentSummary(text2, toolName) {
616724
616742
  let cleaned = text2.replace(/^\s*\d+[│|:→]\s*/gm, "").replace(/\d{4}-\d{2}-\d{2}T[\d:.]+Z?\s*/g, "").replace(/^[\s*#=-]+$/gm, "").replace(/```[\s\S]*?```/g, "").replace(
@@ -616732,9 +616750,9 @@ function extractContentSummary(text2, toolName) {
616732
616750
  if (/^(\/|\.\/)/.test(line)) continue;
616733
616751
  if (/^\s*[{<]/.test(line)) continue;
616734
616752
  let summary = line;
616735
- if (summary.length > 80) {
616736
- const cut = summary.lastIndexOf(" ", 80);
616737
- summary = summary.slice(0, cut > 20 ? cut : 80);
616753
+ if (summary.length > 400) {
616754
+ const cut = summary.lastIndexOf(" ", 400);
616755
+ summary = summary.slice(0, cut > 20 ? cut : 400);
616738
616756
  }
616739
616757
  if (summary.length > 0 && !(summary.length > 1 && summary[0] === summary[0].toUpperCase() && summary[1] === summary[1].toUpperCase())) {
616740
616758
  summary = summary.charAt(0).toLowerCase() + summary.slice(1);
@@ -616820,15 +616838,14 @@ function describeToolResult(toolName, success, personality = 2, resultContent, e
616820
616838
  }
616821
616839
  function describeTaskComplete(summary, completed, personality = 2, _stark = false) {
616822
616840
  const tier = getTier(personality);
616823
- const truncated = summary.length > 200 ? summary.slice(0, 200) + "..." : summary;
616824
616841
  if (!completed) {
616825
- if (truncated) {
616826
- return tier === "terse" ? `Incomplete: ${truncated}` : `Could not finish. ${truncated}`;
616842
+ if (summary) {
616843
+ return tier === "terse" ? `Incomplete: ${summary}` : `Could not finish. ${summary}`;
616827
616844
  }
616828
616845
  return `Task ended without completion, no summary was provided`;
616829
616846
  }
616830
- if (truncated) {
616831
- return truncated;
616847
+ if (summary) {
616848
+ return summary;
616832
616849
  }
616833
616850
  return `Task completed, but no summary was generated to describe the outcome`;
616834
616851
  }
@@ -617617,16 +617634,19 @@ except Exception as exc:
617617
617634
  /**
617618
617635
  * Split long text into sentence-sized chunks suitable for ONNX TTS.
617619
617636
  * Splits on: newlines (list items, paragraphs), then sentence-ending
617620
- * punctuation (.!?). Short text (<= 200 chars) passes through unchanged.
617637
+ * punctuation (.!?). If no split point is found the full text is kept
617638
+ * as a single chunk — no data is ever silently dropped.
617621
617639
  */
617622
617640
  chunkText(text2) {
617623
- if (text2.length <= 200) return [text2];
617641
+ if (!text2) return [];
617642
+ const MAX_CHUNK = 800;
617643
+ if (text2.length <= MAX_CHUNK) return [text2];
617624
617644
  const chunks = [];
617625
617645
  const lines = text2.split(/\n+/);
617626
617646
  for (const line of lines) {
617627
617647
  const trimmed = line.replace(/^[\s\-*•]+/, "").trim();
617628
617648
  if (!trimmed) continue;
617629
- if (trimmed.length <= 200) {
617649
+ if (trimmed.length <= MAX_CHUNK) {
617630
617650
  chunks.push(trimmed);
617631
617651
  } else {
617632
617652
  const sentences = trimmed.split(/(?<=[.!?])\s+/);
@@ -617636,7 +617656,7 @@ except Exception as exc:
617636
617656
  }
617637
617657
  }
617638
617658
  }
617639
- return chunks.length > 0 ? chunks : [text2.slice(0, 200)];
617659
+ return chunks.length > 0 ? chunks : [text2];
617640
617660
  }
617641
617661
  // -------------------------------------------------------------------------
617642
617662
  // Queue drain
@@ -688549,8 +688569,19 @@ function createDMNEventHandler(verbose, writeContent) {
688549
688569
  break;
688550
688570
  case "model_response":
688551
688571
  if (verbose && event.content) {
688552
- const preview = event.content.length > 200 ? event.content.slice(0, 200) + "..." : event.content;
688553
- writeContent(() => renderVerbose(`DMN thinking: ${preview}`));
688572
+ const lines = event.content.split("\n");
688573
+ const maxPreviewLines = 15;
688574
+ if (lines.length > maxPreviewLines) {
688575
+ const preview = lines.slice(0, maxPreviewLines).join("\n");
688576
+ writeContent(
688577
+ () => renderVerbose(`DMN thinking (${lines.length} lines, showing first ${maxPreviewLines}):
688578
+ ${preview}
688579
+ ... ${lines.length - maxPreviewLines} more lines`)
688580
+ );
688581
+ } else {
688582
+ writeContent(() => renderVerbose(`DMN thinking (${lines.length} lines):
688583
+ ${event.content}`));
688584
+ }
688554
688585
  }
688555
688586
  break;
688556
688587
  case "token_usage":
@@ -688586,6 +688617,22 @@ function formatDMNToolArgs(toolName, args) {
688586
688617
  return "";
688587
688618
  }
688588
688619
  }
688620
+ function truncateByLines(text2, maxLines, maxChars = 600) {
688621
+ const lines = text2.split("\n");
688622
+ if (lines.length <= maxLines && text2.length <= maxChars) return text2;
688623
+ if (lines.length > maxLines) {
688624
+ const shown = lines.slice(0, maxLines);
688625
+ const rest = lines.length - maxLines;
688626
+ const joined = shown.join("\n");
688627
+ if (joined.length > maxChars) {
688628
+ return joined.slice(0, maxChars - 20) + `
688629
+ … (${rest} more lines, ${text2.length - joined.length} chars omitted)`;
688630
+ }
688631
+ return joined + `
688632
+ … ${rest} more lines`;
688633
+ }
688634
+ return text2.length > maxChars ? text2.slice(0, maxChars - 3) + "…" : text2;
688635
+ }
688589
688636
  async function renderAsciiPreviewForImage(imagePath, displayPath, title, writer) {
688590
688637
  try {
688591
688638
  const {
@@ -689923,7 +689970,7 @@ ${entry.fullContent}`
689923
689970
  ts: Date.now(),
689924
689971
  source: "main",
689925
689972
  sourceId: "main",
689926
- summary: String(event.content ?? "").slice(0, 120),
689973
+ summary: truncateByLines(String(event.content ?? ""), 3, 240),
689927
689974
  toolName: event.toolName ?? "unknown",
689928
689975
  success: event.success ?? false
689929
689976
  });
@@ -689950,7 +689997,7 @@ ${entry.fullContent}`
689950
689997
  } else if (isNeovimActive()) {
689951
689998
  const ok3 = event.success ?? false;
689952
689999
  const prefix = ok3 ? "\x1B[32m✓\x1B[0m" : "\x1B[31m✗\x1B[0m";
689953
- const preview = displayContent.slice(0, 120).replace(/\n/g, " ");
690000
+ const preview = truncateByLines(displayContent, 3, 240).replace(/\n/g, " ");
689954
690001
  writeToNeovimOutput(` ${prefix} ${preview}\r
689955
690002
  `);
689956
690003
  } else {
@@ -694382,7 +694429,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
694382
694429
  },
694383
694430
  onAgentSpeech(text2) {
694384
694431
  writeContent(
694385
- () => renderInfo(`\x1B[38;5;37m[agent]\x1B[0m ${text2.slice(0, 120)}`)
694432
+ () => renderInfo(`\x1B[38;5;37m[agent]\x1B[0m ${truncateByLines(text2, 5, 600)}`)
694386
694433
  );
694387
694434
  },
694388
694435
  // Keep state changes silent
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.239",
3
+ "version": "1.0.241",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.239",
9
+ "version": "1.0.241",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
@@ -7041,9 +7041,9 @@
7041
7041
  }
7042
7042
  },
7043
7043
  "node_modules/undici": {
7044
- "version": "7.27.1",
7045
- "resolved": "https://registry.npmjs.org/undici/-/undici-7.27.1.tgz",
7046
- "integrity": "sha512-UDdpiex+mzigiyrXrGbiUaF4HzTNhKbh2vRNFaTMzcqmLIPrZxaCtwo/1TMSuWoM1Xz3WiTo9KdgI3kRqYzJGg==",
7044
+ "version": "7.27.2",
7045
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.27.2.tgz",
7046
+ "integrity": "sha512-uZsKNuzQxDMUY6M3pIMvy5tvlGmtq8XJ2oLAkfRKGNu+1VQAIvLy2xIVG5ATZl5wDXl/tddByAWCizRbOme+TA==",
7047
7047
  "license": "MIT",
7048
7048
  "engines": {
7049
7049
  "node": ">=20.18.1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.239",
3
+ "version": "1.0.241",
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",