omnius 1.0.239 → 1.0.240

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) => ({
@@ -688549,8 +688567,19 @@ function createDMNEventHandler(verbose, writeContent) {
688549
688567
  break;
688550
688568
  case "model_response":
688551
688569
  if (verbose && event.content) {
688552
- const preview = event.content.length > 200 ? event.content.slice(0, 200) + "..." : event.content;
688553
- writeContent(() => renderVerbose(`DMN thinking: ${preview}`));
688570
+ const lines = event.content.split("\n");
688571
+ const maxPreviewLines = 15;
688572
+ if (lines.length > maxPreviewLines) {
688573
+ const preview = lines.slice(0, maxPreviewLines).join("\n");
688574
+ writeContent(
688575
+ () => renderVerbose(`DMN thinking (${lines.length} lines, showing first ${maxPreviewLines}):
688576
+ ${preview}
688577
+ ... ${lines.length - maxPreviewLines} more lines`)
688578
+ );
688579
+ } else {
688580
+ writeContent(() => renderVerbose(`DMN thinking (${lines.length} lines):
688581
+ ${event.content}`));
688582
+ }
688554
688583
  }
688555
688584
  break;
688556
688585
  case "token_usage":
@@ -688586,6 +688615,22 @@ function formatDMNToolArgs(toolName, args) {
688586
688615
  return "";
688587
688616
  }
688588
688617
  }
688618
+ function truncateByLines(text2, maxLines, maxChars = 600) {
688619
+ const lines = text2.split("\n");
688620
+ if (lines.length <= maxLines && text2.length <= maxChars) return text2;
688621
+ if (lines.length > maxLines) {
688622
+ const shown = lines.slice(0, maxLines);
688623
+ const rest = lines.length - maxLines;
688624
+ const joined = shown.join("\n");
688625
+ if (joined.length > maxChars) {
688626
+ return joined.slice(0, maxChars - 20) + `
688627
+ … (${rest} more lines, ${text2.length - joined.length} chars omitted)`;
688628
+ }
688629
+ return joined + `
688630
+ … ${rest} more lines`;
688631
+ }
688632
+ return text2.length > maxChars ? text2.slice(0, maxChars - 3) + "…" : text2;
688633
+ }
688589
688634
  async function renderAsciiPreviewForImage(imagePath, displayPath, title, writer) {
688590
688635
  try {
688591
688636
  const {
@@ -689923,7 +689968,7 @@ ${entry.fullContent}`
689923
689968
  ts: Date.now(),
689924
689969
  source: "main",
689925
689970
  sourceId: "main",
689926
- summary: String(event.content ?? "").slice(0, 120),
689971
+ summary: truncateByLines(String(event.content ?? ""), 3, 240),
689927
689972
  toolName: event.toolName ?? "unknown",
689928
689973
  success: event.success ?? false
689929
689974
  });
@@ -689950,7 +689995,7 @@ ${entry.fullContent}`
689950
689995
  } else if (isNeovimActive()) {
689951
689996
  const ok3 = event.success ?? false;
689952
689997
  const prefix = ok3 ? "\x1B[32m✓\x1B[0m" : "\x1B[31m✗\x1B[0m";
689953
- const preview = displayContent.slice(0, 120).replace(/\n/g, " ");
689998
+ const preview = truncateByLines(displayContent, 3, 240).replace(/\n/g, " ");
689954
689999
  writeToNeovimOutput(` ${prefix} ${preview}\r
689955
690000
  `);
689956
690001
  } else {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.239",
3
+ "version": "1.0.240",
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.240",
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.240",
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",