omnius 1.0.888 → 1.0.890

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
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/index.js
3
- size: 38545361 bytes
4
- sha256: eba5e49632d5ab67fbacfa057dddcb9ca05e8dc40ece7a60a65566d776e1c8e6
3
+ size: 38551717 bytes
4
+ sha256: 837c92ce93a45f47ba2fe7e341778f1c26f7fa61239c7e98b5828b3b994c21d3
@@ -1476,17 +1476,38 @@ function nativeCodeContent(source, language) {
1476
1476
  }
1477
1477
  return { content: source, language: selected };
1478
1478
  }
1479
- function nativeCodeHighlights(source) {
1479
+ function nativeCodeHighlights(source, language) {
1480
1480
  const highlights = [];
1481
+ const selected = nativeCodeLanguage(language);
1482
+ if (selected === "text" || selected === "plaintext") return highlights;
1483
+ if (selected === "diff" || selected === "patch") {
1484
+ for (const match of source.matchAll(/^(?:\+[^\n]*|-[^\n]*|@@[^\n]*|diff [^\n]*)/gm))
1485
+ highlights.push([
1486
+ match.index,
1487
+ match.index + match[0].length,
1488
+ match[0][0] === "+" ? "diff.add" : match[0][0] === "-" ? "diff.delete" : "diff.header"
1489
+ ]);
1490
+ return highlights;
1491
+ }
1481
1492
  const tokens = /("(?:\\.|[^"\\])*"?|'(?:\\.|[^'\\])*'?|`(?:\\.|[^`\\])*`?)|(\/\/[^\n]*|\/\*[\s\S]*?(?:\*\/|$)|\#[^\n]*)|\b(true|false|null|None|True|False|nil)\b|\b(const|let|var|function|class|def|return|if|else|elif|for|while|in|import|from|export|async|await|try|catch|except|throw|raise|new|public|private|static|void|int|bool|struct|enum|fn|pub|use|match|impl|package|func|select|switch|case|break|continue|end|do|then|fi|done)\b|(?<![\w])(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)|([{}\[\](),:;])/g;
1482
1493
  for (const match of source.matchAll(tokens)) {
1483
1494
  const start = match.index, end = start + match[0].length;
1484
1495
  const group = match[1] ? /^\s*:/.test(source.slice(end)) ? "property" : "string" : match[2] ? "comment" : match[3] ? "constant" : match[4] ? "keyword" : match[5] ? "number" : "punctuation";
1485
1496
  highlights.push([start, end, group]);
1486
1497
  }
1487
- return highlights;
1498
+ if (selected === "bash" || selected === "zsh" || selected === "fish") {
1499
+ const add = (start, token, group) => {
1500
+ if (!highlights.some(([from, to]) => from < start + token.length && to > start))
1501
+ highlights.push([start, start + token.length, group]);
1502
+ };
1503
+ for (const match of source.matchAll(/(?:^|[\n;|&])\s*(?:\$\s+)?(?:[A-Za-z_]\w*=\S+\s+)*([A-Za-z_./][\w./:+-]*)/g))
1504
+ add(match.index + match[0].lastIndexOf(match[1]), match[1], "function");
1505
+ for (const match of source.matchAll(/(?:^|\s)(--?[A-Za-z][\w-]*)/g))
1506
+ add(match.index + match[0].indexOf(match[1]), match[1], "attribute");
1507
+ }
1508
+ return highlights.sort((a, b) => a[0] - b[0]);
1488
1509
  }
1489
- function installNativeSyntax(syntax, colors) {
1510
+ function installNativeSyntax(syntax, colors, nativeColor2) {
1490
1511
  const base = { fg: colors.foreground, bg: colors.background };
1491
1512
  for (const [name, attributes] of Object.entries({
1492
1513
  default: {},
@@ -1500,21 +1521,24 @@ function installNativeSyntax(syntax, colors) {
1500
1521
  "markup.list": { dim: true },
1501
1522
  "markup.quote": { dim: true },
1502
1523
  comment: { dim: true, italic: true },
1503
- keyword: { bold: true },
1504
- property: { bold: true },
1505
- "string.special.key": { bold: true },
1506
- string: { italic: true },
1507
- "string.escape": { bold: true },
1508
- number: { bold: true },
1509
- boolean: { bold: true },
1510
- constant: { bold: true },
1511
- function: { bold: true },
1512
- type: { underline: true },
1524
+ keyword: { fg: nativeColor2(5), bold: true },
1525
+ property: { fg: nativeColor2(6), bold: true },
1526
+ "string.special.key": { fg: nativeColor2(6), bold: true },
1527
+ string: { fg: nativeColor2(2) },
1528
+ "string.escape": { fg: nativeColor2(3), bold: true },
1529
+ number: { fg: nativeColor2(3), bold: true },
1530
+ boolean: { fg: nativeColor2(3), bold: true },
1531
+ constant: { fg: nativeColor2(3), bold: true },
1532
+ function: { fg: nativeColor2(4), bold: true },
1533
+ type: { fg: nativeColor2(6) },
1513
1534
  punctuation: { dim: true },
1514
1535
  operator: {},
1515
1536
  variable: {},
1516
- tag: { bold: true },
1517
- attribute: { italic: true }
1537
+ tag: { fg: nativeColor2(4), bold: true },
1538
+ attribute: { fg: nativeColor2(6) },
1539
+ "diff.add": { fg: nativeColor2(2) },
1540
+ "diff.delete": { fg: nativeColor2(1) },
1541
+ "diff.header": { fg: nativeColor2(6), bold: true }
1518
1542
  }))
1519
1543
  syntax.registerStyle(name, { ...base, ...attributes });
1520
1544
  }
@@ -1676,14 +1700,14 @@ var NativeBlockView = class {
1676
1700
  return this.spec;
1677
1701
  }
1678
1702
  get trailingSpace() {
1679
- return this.spec.kind === "markdown" && this.spec.presentation === "final-answer" ? 1 : 0;
1703
+ return this.spec.presentation === "final-answer" || this.spec.presentation === "action" && !this.spec.streaming ? 1 : 0;
1680
1704
  }
1681
1705
  get hasVisibleContent() {
1682
1706
  return this.spec.kind !== "column" && this.spec.kind !== "row" || Boolean(this.spec.title || this.spec.text !== void 0 || this.spec.actions?.length || [...this.children?.views.values() ?? []].some((view) => view.hasVisibleContent));
1683
1707
  }
1684
1708
  setTurnSeparation(separate, previousBottom = 0) {
1685
1709
  const answer = this.spec.kind === "markdown" && this.spec.presentation === "final-answer";
1686
- this.root.marginTop = separate ? Math.max(0, 1 - previousBottom) : answer ? 1 : 0;
1710
+ this.root.marginTop = separate || answer ? Math.max(0, 1 - previousBottom) : 0;
1687
1711
  }
1688
1712
  build() {
1689
1713
  const { renderer: renderer2, colors, syntax } = this.context;
@@ -1798,7 +1822,7 @@ var NativeBlockView = class {
1798
1822
  wrapMode: "word",
1799
1823
  selectable: true,
1800
1824
  streaming: this.spec.streaming ?? false,
1801
- onHighlight: (highlights, context) => highlights.length ? void 0 : nativeCodeHighlights(context.content)
1825
+ onHighlight: (highlights, context) => highlights.length ? void 0 : nativeCodeHighlights(context.content, value.language)
1802
1826
  });
1803
1827
  }
1804
1828
  });
@@ -1823,7 +1847,7 @@ var NativeBlockView = class {
1823
1847
  selectable: true,
1824
1848
  wrapMode: "word",
1825
1849
  drawUnstyledText: true,
1826
- onHighlight: (highlights, context) => highlights.length ? void 0 : nativeCodeHighlights(context.content)
1850
+ onHighlight: (highlights, context) => highlights.length ? void 0 : nativeCodeHighlights(context.content, this.spec.language)
1827
1851
  });
1828
1852
  this.body.add(this.text);
1829
1853
  } else if (spec.text !== void 0) {
@@ -1891,7 +1915,8 @@ var NativeBlockView = class {
1891
1915
  if (rebuild) this.reset();
1892
1916
  this.signature = signature;
1893
1917
  const finalAnswer = spec.kind === "markdown" && spec.presentation === "final-answer";
1894
- this.root.marginTop = this.root.marginBottom = finalAnswer ? 1 : 0;
1918
+ this.root.marginTop = finalAnswer ? 1 : 0;
1919
+ this.root.marginBottom = this.trailingSpace;
1895
1920
  if (spec.collapsed !== this.previousModelCollapsed) {
1896
1921
  this.collapsed = spec.collapsed ?? false;
1897
1922
  this.previousModelCollapsed = spec.collapsed;
@@ -3315,68 +3340,6 @@ import {
3315
3340
  TextRenderable as TextRenderable8
3316
3341
  } from "@opentui/core";
3317
3342
 
3318
- // packages/cli/src/tui/native/components/device-history.ts
3319
- var DeviceHistory = class {
3320
- samples = [];
3321
- append(sample) {
3322
- if (!Number.isFinite(sample.at) || sample.at <= (this.samples.at(-1)?.at ?? 0)) return;
3323
- this.samples.push(sample);
3324
- if (this.samples.length > 120) this.samples.splice(0, this.samples.length - 120);
3325
- }
3326
- };
3327
- function deviceHistorySparkline(samples, field, width) {
3328
- const columns = Math.max(0, Math.floor(width));
3329
- const latest = samples.at(-1)?.at;
3330
- const values = Array(columns).fill(void 0);
3331
- if (latest !== void 0) for (const sample of samples) {
3332
- const x = columns - 1 - Math.round((latest - sample.at) / 2e3);
3333
- if (x >= 0 && x < columns) values[x] = sample[field];
3334
- }
3335
- return values.map((value) => value === void 0 || !Number.isFinite(value) || value < 0 ? " " : "▁▂▃▄▅▆▇█"[Math.round(Math.min(100, value) * 7 / 100)]).join("");
3336
- }
3337
- function deviceHistoryGraph(samples, field, width) {
3338
- const columns = Math.max(0, Math.floor(width) - 5), pixels = columns * 2;
3339
- if (columns < 2) return "";
3340
- const cells = Array.from({ length: 3 }, () => Array(columns).fill(0));
3341
- const latest = samples.at(-1)?.at;
3342
- const dots = [[1, 8], [2, 16], [4, 32], [64, 128]];
3343
- const point = (x, y) => {
3344
- if (x < 0 || x >= pixels || y < 0 || y >= 12) return;
3345
- cells[Math.floor(y / 4)][Math.floor(x / 2)] |= dots[y % 4][x % 2];
3346
- };
3347
- let previous;
3348
- if (latest !== void 0) for (const sample of samples) {
3349
- const value = sample[field];
3350
- const x = pixels - 1 - Math.round((latest - sample.at) / 1e3);
3351
- if (x < 0) {
3352
- previous = void 0;
3353
- continue;
3354
- }
3355
- if (value === void 0 || !Number.isFinite(value) || value < 0) {
3356
- previous = void 0;
3357
- continue;
3358
- }
3359
- const y = Math.round(11 * (1 - Math.min(100, value) / 100));
3360
- if (previous && sample.at - previous.at <= 5e3) {
3361
- const distance = Math.max(1, Math.abs(x - previous.x), Math.abs(y - previous.y));
3362
- for (let step = 0; step <= distance; step++) point(Math.round(previous.x + (x - previous.x) * step / distance), Math.round(previous.y + (y - previous.y) * step / distance));
3363
- } else point(x, y);
3364
- previous = { x, y, at: sample.at };
3365
- }
3366
- const labels = ["100%│", " 50%│", " 0%└"];
3367
- return cells.map((row, y) => labels[y] + row.map((bits, x) => bits ? String.fromCodePoint(10240 + bits) : x % 4 === 0 ? "·" : " ").join("")).join("\n");
3368
- }
3369
-
3370
- // packages/cli/src/tui/native/components/task-notes.ts
3371
- import {
3372
- BoxRenderable as BoxRenderable6,
3373
- CliRenderEvents as CliRenderEvents4,
3374
- RenderableEvents as RenderableEvents3,
3375
- ScrollBoxRenderable as ScrollBoxRenderable3,
3376
- TextAttributes as TextAttributes5,
3377
- TextRenderable as TextRenderable5
3378
- } from "@opentui/core";
3379
-
3380
3343
  // packages/cli/src/tui/native/components/instrument-format.ts
3381
3344
  var graphemes2 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
3382
3345
  function formatSignalDivider(width, geometry = { direction: "top" }) {
@@ -3415,6 +3378,11 @@ function formatTelemetryRow(label3, value, width, reserved = 12) {
3415
3378
  function instrumentNumber(value, precision = 0, unit = "") {
3416
3379
  return value === void 0 || !Number.isFinite(value) || value < 0 ? "--" : `${value.toFixed(Math.max(0, Math.min(6, precision)))}${unit}`;
3417
3380
  }
3381
+ function utilizationColor(value, maximum = 100) {
3382
+ if (value === void 0 || !Number.isFinite(value) || value < 0 || !Number.isFinite(maximum) || maximum <= 0) return void 0;
3383
+ const percent = value / maximum * 100;
3384
+ return percent < 50 ? "index:2" : percent < 80 ? "index:3" : "index:1";
3385
+ }
3418
3386
  function formatSignalMeter(value, maximum, width = 8) {
3419
3387
  const cells = Math.max(1, Math.floor(width));
3420
3388
  if (value === void 0 || maximum === void 0 || !Number.isFinite(value) || !Number.isFinite(maximum) || value < 0 || maximum <= 0)
@@ -3442,7 +3410,72 @@ function instrumentStatus(value) {
3442
3410
  return status.toUpperCase();
3443
3411
  }
3444
3412
 
3413
+ // packages/cli/src/tui/native/components/device-history.ts
3414
+ var DeviceHistory = class {
3415
+ samples = [];
3416
+ append(sample) {
3417
+ if (!Number.isFinite(sample.at) || sample.at <= (this.samples.at(-1)?.at ?? 0)) return;
3418
+ this.samples.push(sample);
3419
+ if (this.samples.length > 120) this.samples.splice(0, this.samples.length - 120);
3420
+ }
3421
+ };
3422
+ function deviceHistorySparklineSpans(samples, field, width) {
3423
+ const columns = Math.max(0, Math.floor(width));
3424
+ const latest = samples.at(-1)?.at;
3425
+ const values = Array(columns).fill(void 0);
3426
+ if (latest !== void 0) for (const sample of samples) {
3427
+ const x = columns - 1 - Math.round((latest - sample.at) / 2e3);
3428
+ if (x >= 0 && x < columns) values[x] = sample[field];
3429
+ }
3430
+ return values.map((value) => ({ text: value === void 0 || !Number.isFinite(value) || value < 0 ? " " : "▁▂▃▄▅▆▇█"[Math.round(Math.min(100, value) * 7 / 100)], fg: utilizationColor(value) }));
3431
+ }
3432
+ function deviceHistoryGraphSpans(samples, field, width) {
3433
+ const columns = Math.max(0, Math.floor(width) - 5), pixels = columns * 2;
3434
+ if (columns < 2) return [];
3435
+ const cells = Array.from({ length: 3 }, () => Array(columns).fill(0));
3436
+ const levels = Array.from({ length: 3 }, () => Array(columns).fill(-1));
3437
+ const latest = samples.at(-1)?.at;
3438
+ const dots = [[1, 8], [2, 16], [4, 32], [64, 128]];
3439
+ const point = (x, y, value) => {
3440
+ if (x < 0 || x >= pixels || y < 0 || y >= 12) return;
3441
+ cells[Math.floor(y / 4)][Math.floor(x / 2)] |= dots[y % 4][x % 2];
3442
+ levels[Math.floor(y / 4)][Math.floor(x / 2)] = Math.max(levels[Math.floor(y / 4)][Math.floor(x / 2)], value);
3443
+ };
3444
+ let previous;
3445
+ if (latest !== void 0) for (const sample of samples) {
3446
+ const value = sample[field];
3447
+ const x = pixels - 1 - Math.round((latest - sample.at) / 1e3);
3448
+ if (x < 0) {
3449
+ previous = void 0;
3450
+ continue;
3451
+ }
3452
+ if (value === void 0 || !Number.isFinite(value) || value < 0) {
3453
+ previous = void 0;
3454
+ continue;
3455
+ }
3456
+ const y = Math.round(11 * (1 - Math.min(100, value) / 100));
3457
+ if (previous && sample.at - previous.at <= 5e3) {
3458
+ const distance = Math.max(1, Math.abs(x - previous.x), Math.abs(y - previous.y));
3459
+ for (let step = 0; step <= distance; step++) point(Math.round(previous.x + (x - previous.x) * step / distance), Math.round(previous.y + (y - previous.y) * step / distance), previous.value + (value - previous.value) * step / distance);
3460
+ } else point(x, y, value);
3461
+ previous = { x, y, at: sample.at, value };
3462
+ }
3463
+ const labels = ["100%│", " 50%│", " 0%└"];
3464
+ return cells.flatMap((row, y) => [{ text: (y ? "\n" : "") + labels[y] }, ...row.map((bits, x) => ({
3465
+ text: bits ? String.fromCodePoint(10240 + bits) : x % 4 === 0 ? "·" : " ",
3466
+ fg: bits ? utilizationColor(levels[y][x]) : void 0
3467
+ }))]);
3468
+ }
3469
+
3445
3470
  // packages/cli/src/tui/native/components/task-notes.ts
3471
+ import {
3472
+ BoxRenderable as BoxRenderable6,
3473
+ CliRenderEvents as CliRenderEvents4,
3474
+ RenderableEvents as RenderableEvents3,
3475
+ ScrollBoxRenderable as ScrollBoxRenderable3,
3476
+ TextAttributes as TextAttributes5,
3477
+ TextRenderable as TextRenderable5
3478
+ } from "@opentui/core";
3446
3479
  var marks = ["▨", "▧", "▥", "▦"];
3447
3480
  var reducedMotion = () => process.env["OMNIUS_TUI_REDUCE_MOTION"] === "1" || process.env["REDUCE_MOTION"] === "1";
3448
3481
  var safe = (value) => typeof value === "string" ? plainText(value) : "";
@@ -5020,13 +5053,15 @@ var TelemetryRow = class extends TextRenderable8 {
5020
5053
  reserved;
5021
5054
  label;
5022
5055
  value = "--";
5056
+ valueColor;
5023
5057
  onResize(width, height) {
5024
5058
  super.onResize(width, height);
5025
5059
  this.refresh();
5026
5060
  }
5027
- update(value, label3 = this.label) {
5061
+ update(value, label3 = this.label, utilization) {
5028
5062
  this.label = label3;
5029
5063
  this.value = value;
5064
+ this.valueColor = utilizationColor(utilization);
5030
5065
  this.refresh();
5031
5066
  }
5032
5067
  refresh() {
@@ -5036,7 +5071,8 @@ var TelemetryRow = class extends TextRenderable8 {
5036
5071
  this.width,
5037
5072
  this.reserved
5038
5073
  );
5039
- if (this.plainText !== next) this.content = next;
5074
+ const start = next.endsWith(this.value) ? next.length - this.value.length : 0;
5075
+ this.content = styledText([{ text: next.slice(0, start) }, { text: next.slice(start), fg: this.valueColor }]);
5040
5076
  }
5041
5077
  };
5042
5078
  var SignalMeter = class extends TelemetryRow {
@@ -5294,15 +5330,15 @@ var DeviceMonitor = class extends BoxRenderable9 {
5294
5330
  }
5295
5331
  return `${instrumentNumber(value, unit ? 1 : 0)} ${units[unit]}`;
5296
5332
  };
5297
- const set = (key, label3, value) => this.sections.get(key).readings.get(label3).update(value);
5298
- set("cpu", "LOAD", formatSignalMeter(system?.cpu.utilization, 100, 6));
5333
+ const set = (key, label3, value, utilization) => this.sections.get(key).readings.get(label3).update(value, label3, utilization);
5334
+ set("cpu", "LOAD", formatSignalMeter(system?.cpu.utilization, 100, 6), system?.cpu.utilization);
5299
5335
  set("cpu", "CORES", number(system?.cpu.cores));
5300
5336
  set("cpu", "SAMPLE", sample(system?.cpu.status));
5301
5337
  set("memory", "USED", ratio(system?.memory.usedGB, system?.memory.totalGB));
5302
5338
  const free = system?.memory.totalGB !== void 0 && system.memory.usedGB !== void 0 ? Math.max(0, system.memory.totalGB - system.memory.usedGB) : void 0;
5303
5339
  set("memory", "FREE", number(free, " GiB"));
5304
- set("memory", "LOAD", formatSignalMeter(system?.memory.utilization, 100, 6));
5305
- set("disk", "SPACE USED", number(system?.disk.utilization, "%"));
5340
+ set("memory", "LOAD", formatSignalMeter(system?.memory.utilization, 100, 6), system?.memory.utilization);
5341
+ set("disk", "SPACE USED", number(system?.disk.utilization, "%"), system?.disk.utilization);
5306
5342
  set("disk", "USED", ratio(system?.disk.usedGB, system?.disk.totalGB));
5307
5343
  set("disk", "FREE", number(system?.disk.freeGB, " GiB"));
5308
5344
  set("network", "RECEIVE", rate(system?.network.rxBytesPerSec));
@@ -5437,10 +5473,10 @@ var DeviceMonitor = class extends BoxRenderable9 {
5437
5473
  if (row.title.focused && !selectable) this.heading.focus();
5438
5474
  row.title.focusable = selectable;
5439
5475
  row.title.attributes = row.title.focused ? TextAttributes8.INVERSE : device.preferred ? TextAttributes8.BOLD : selectable ? 0 : TextAttributes8.DIM;
5440
- row.load.update(formatSignalMeter(device.utilization, 100, 6));
5476
+ row.load.update(formatSignalMeter(device.utilization, 100, 6), "LOAD", device.utilization);
5441
5477
  const used = device.memoryUsedMB === void 0 ? "--" : instrumentNumber(device.memoryUsedMB / 1024, 1);
5442
5478
  const total = device.memoryTotalMB === void 0 || device.memoryTotalMB <= 0 ? "--" : instrumentNumber(device.memoryTotalMB / 1024, 1);
5443
- row.memory.update(`${used}/${total} GiB`, device.unifiedMemory ? "UMA" : "VRAM");
5479
+ row.memory.update(`${used}/${total} GiB`, device.unifiedMemory ? "UMA" : "VRAM", device.memoryUsedMB !== void 0 && device.memoryTotalMB !== void 0 && device.memoryTotalMB > 0 ? device.memoryUsedMB / device.memoryTotalMB * 100 : void 0);
5444
5480
  row.reason.content = device.policyReason ?? "";
5445
5481
  row.reason.visible = Boolean(device.policyReason);
5446
5482
  }
@@ -5522,12 +5558,15 @@ var DeviceMonitor = class extends BoxRenderable9 {
5522
5558
  const value = instrumentNumber(current, 0, "%");
5523
5559
  const caption = `${label3}${primary?.index ?? "-"}`;
5524
5560
  const plotWidth = Math.max(0, this.width - caption.length - value.length - 2);
5525
- const next = `${caption} ${deviceHistorySparkline(compactHistory, field, plotWidth)} ${value}`;
5526
- if (element.plainText !== next) element.content = next;
5561
+ element.content = styledText([
5562
+ { text: `${caption} ` },
5563
+ ...deviceHistorySparklineSpans(compactHistory, field, plotWidth),
5564
+ { text: ` ${value}`, fg: utilizationColor(current) }
5565
+ ]);
5527
5566
  }
5528
5567
  if (!primary && data?.system) {
5529
- this.compactLoad.content = `CPU ${formatSignalMeter(data.system.cpu.utilization, 100, 6)}`;
5530
- this.compactMemory.content = `MEM ${formatSignalMeter(data.system.memory.utilization, 100, 6)}`;
5568
+ this.compactLoad.content = styledText([{ text: "CPU " }, { text: formatSignalMeter(data.system.cpu.utilization, 100, 6), fg: utilizationColor(data.system.cpu.utilization) }]);
5569
+ this.compactMemory.content = styledText([{ text: "MEM " }, { text: formatSignalMeter(data.system.memory.utilization, 100, 6), fg: utilizationColor(data.system.memory.utilization) }]);
5531
5570
  }
5532
5571
  for (const device of devices) {
5533
5572
  const row = this.rows.get(device.uuid);
@@ -5535,8 +5574,7 @@ var DeviceMonitor = class extends BoxRenderable9 {
5535
5574
  const state = device.enabled === void 0 ? "--" : device.enabled ? "ON" : "OFF";
5536
5575
  row.title.content = formatTelemetryRow(`GPU ${device.index} ${device.name}`, `${state}${device.preferred ? " *" : ""}`, row.root.width, 6);
5537
5576
  for (const [plot, field] of [[row.loadGraph, "load"], [row.memoryGraph, "memory"]]) {
5538
- const next = deviceHistoryGraph(row.history.samples, field, row.root.width);
5539
- if (plot.plainText !== next) plot.content = next;
5577
+ plot.content = styledText(deviceHistoryGraphSpans(row.history.samples, field, row.root.width));
5540
5578
  }
5541
5579
  }
5542
5580
  }
@@ -6046,6 +6084,7 @@ var InstrumentRail = class extends BoxRenderable9 {
6046
6084
 
6047
6085
  // packages/cli/src/tui/command-registry.ts
6048
6086
  var COMMAND_SIGNATURES = [
6087
+ ["/enhance <prompt>", "Enhance a prompt into the input editor"],
6049
6088
  ["/model", "Select from available models"],
6050
6089
  ["/model <name>", "Switch to a specific model"],
6051
6090
  ["/models", "List all available models"],
@@ -6722,6 +6761,7 @@ var PLANNED_SIGNATURES = [
6722
6761
  implementationStatus: "planned"
6723
6762
  }));
6724
6763
  var CATEGORY_OVERRIDES = {
6764
+ enhance: "ui",
6725
6765
  model: "model",
6726
6766
  models: "model",
6727
6767
  endpoint: "network",
@@ -6878,6 +6918,7 @@ var ALIASES = {
6878
6918
  platforms: ["gateway"]
6879
6919
  };
6880
6920
  var USER_ONLY = /* @__PURE__ */ new Set([
6921
+ "enhance",
6881
6922
  "provider",
6882
6923
  "fallback",
6883
6924
  "quit",
@@ -6972,6 +7013,7 @@ var DESTRUCTIVE = /* @__PURE__ */ new Set([
6972
7013
  "ollama"
6973
7014
  ]);
6974
7015
  var NETWORKED = /* @__PURE__ */ new Set([
7016
+ "enhance",
6975
7017
  "provider",
6976
7018
  "endpoint",
6977
7019
  "update",
@@ -7053,7 +7095,7 @@ var REST_BLOCKED = /* @__PURE__ */ new Set([
7053
7095
  "paste",
7054
7096
  "indicator"
7055
7097
  ]);
7056
- var LOCAL_TUI_ONLY = /* @__PURE__ */ new Set(["indicator", "compacted", "gpu", "memory", "provider"]);
7098
+ var LOCAL_TUI_ONLY = /* @__PURE__ */ new Set(["indicator", "compacted", "gpu", "memory", "provider", "enhance"]);
7057
7099
  var CANONICAL_BY_ALIAS = /* @__PURE__ */ new Map();
7058
7100
  for (const [canonical, aliases2] of Object.entries(ALIASES)) {
7059
7101
  for (const alias of aliases2) CANONICAL_BY_ALIAS.set(alias, canonical);
@@ -7684,6 +7726,8 @@ var NativeTabStrip = class extends BoxRenderable11 {
7684
7726
  syncing = false;
7685
7727
  reveal;
7686
7728
  colors;
7729
+ pulseTimer;
7730
+ pulseBright = true;
7687
7731
  naturalWidth = 0;
7688
7732
  update(items, activeId, busy = false) {
7689
7733
  const signature = JSON.stringify([items, activeId, busy]);
@@ -7780,7 +7824,8 @@ var NativeTabStrip = class extends BoxRenderable11 {
7780
7824
  this.renderer.requestRender();
7781
7825
  }
7782
7826
  style(entry) {
7783
- entry.button.attributes = (entry.active ? TextAttributes10.BOLD | TextAttributes10.UNDERLINE : entry.blocked ? TextAttributes10.DIM : 0) | (entry.button.focused ? TextAttributes10.INVERSE : 0);
7827
+ entry.button.attributes = (entry.active ? TextAttributes10.BOLD | TextAttributes10.UNDERLINE : entry.blocked ? TextAttributes10.DIM : 0) | (entry.action.running ? this.pulseBright ? TextAttributes10.BOLD : TextAttributes10.DIM : 0) | (entry.button.focused ? TextAttributes10.INVERSE : 0);
7828
+ entry.button.fg = entry.action.running ? nativeColor(6) : this.colors.foreground;
7784
7829
  if (entry.close) entry.close.attributes = (entry.closeBlocked || !entry.close.focused ? TextAttributes10.DIM : 0) | (entry.close.focused ? TextAttributes10.INVERSE : 0);
7785
7830
  }
7786
7831
  handleKey(entry, key, close2 = false) {
@@ -7802,6 +7847,7 @@ var NativeTabStrip = class extends BoxRenderable11 {
7802
7847
  key.stopPropagation();
7803
7848
  }
7804
7849
  syncScroll = () => {
7850
+ this.syncPulse();
7805
7851
  if (!this.visible || this.width < 1) return;
7806
7852
  const overflow = this.naturalWidth > this.width;
7807
7853
  if (this.rail.visible !== overflow) {
@@ -7818,6 +7864,27 @@ var NativeTabStrip = class extends BoxRenderable11 {
7818
7864
  this.rail.value = this.scroll.scrollLeft;
7819
7865
  this.syncing = false;
7820
7866
  };
7867
+ syncPulse() {
7868
+ let visible2 = this.visible && this.width > 0;
7869
+ for (let parent = this.parent; parent && visible2; parent = parent.parent) visible2 = parent.visible;
7870
+ const animate = visible2 && process.env["OMNIUS_TUI_REDUCE_MOTION"] !== "1" && process.env["REDUCE_MOTION"] !== "1" && [...this.buttons.values()].some((entry) => entry.action.running);
7871
+ if (animate && !this.pulseTimer) {
7872
+ this.pulseTimer = setInterval(() => {
7873
+ this.syncPulse();
7874
+ if (!this.pulseTimer) return;
7875
+ this.pulseBright = !this.pulseBright;
7876
+ for (const entry of this.buttons.values()) if (entry.action.running) this.style(entry);
7877
+ this.renderer.requestRender();
7878
+ }, 600);
7879
+ this.pulseTimer.unref?.();
7880
+ } else if (!animate && this.pulseTimer) {
7881
+ clearInterval(this.pulseTimer);
7882
+ this.pulseTimer = void 0;
7883
+ this.pulseBright = true;
7884
+ for (const entry of this.buttons.values()) this.style(entry);
7885
+ this.renderer.requestRender();
7886
+ }
7887
+ }
7821
7888
  applyTheme(colors) {
7822
7889
  this.colors = colors;
7823
7890
  for (const { button, close: close2 } of this.buttons.values()) {
@@ -7830,12 +7897,15 @@ var NativeTabStrip = class extends BoxRenderable11 {
7830
7897
  }
7831
7898
  styleNativeScrollbars(this.scroll, colors);
7832
7899
  styleNativeSlider(this.rail, colors);
7900
+ for (const entry of this.buttons.values()) this.style(entry);
7833
7901
  }
7834
7902
  restoreOffset(offset2) {
7835
7903
  this.reveal = void 0;
7836
7904
  this.scroll.scrollLeft = offset2;
7837
7905
  }
7838
7906
  destroySelf() {
7907
+ if (this.pulseTimer) clearInterval(this.pulseTimer);
7908
+ this.pulseTimer = void 0;
7839
7909
  this.renderer.off(CliRenderEvents7.FRAME, this.syncScroll);
7840
7910
  super.destroySelf();
7841
7911
  }
@@ -8650,7 +8720,7 @@ var NativeFrontend = class {
8650
8720
  this.headerSignature = "";
8651
8721
  this.metricsActionsSignature = "";
8652
8722
  const colors = this.context.colors = palette(theme);
8653
- installNativeSyntax(this.context.syntax, colors);
8723
+ installNativeSyntax(this.context.syntax, colors, nativeColor);
8654
8724
  this.root.backgroundColor = colors.background;
8655
8725
  this.header.backgroundColor = this.footer.backgroundColor = colors.background;
8656
8726
  this.header.borderColor = this.footer.borderColor = this.embeddedPane.borderColor = colors.border;
@@ -23343,6 +23343,66 @@
23343
23343
  "Allowing an autonomous agent to invoke it without an explicit user action"
23344
23344
  ]
23345
23345
  },
23346
+ {
23347
+ "id": "command.enhance",
23348
+ "kind": "command",
23349
+ "title": "/enhance",
23350
+ "summary": "Enhance a prompt into the input editor",
23351
+ "aliases": [
23352
+ "/enhance",
23353
+ "enhance"
23354
+ ],
23355
+ "keywords": [
23356
+ "command",
23357
+ "ui",
23358
+ "enhance"
23359
+ ],
23360
+ "maturity": "stable",
23361
+ "layer": "interface",
23362
+ "audiences": [
23363
+ "user",
23364
+ "coding-agent",
23365
+ "integrator"
23366
+ ],
23367
+ "interfaces": [
23368
+ {
23369
+ "type": "tui",
23370
+ "target": "/enhance"
23371
+ }
23372
+ ],
23373
+ "references": [
23374
+ {
23375
+ "type": "source",
23376
+ "target": "packages/cli/src/tui/command-registry.ts",
23377
+ "relation": "registry"
23378
+ }
23379
+ ],
23380
+ "signatures": [
23381
+ {
23382
+ "signature": "/enhance <prompt>",
23383
+ "description": "Enhance a prompt into the input editor"
23384
+ }
23385
+ ],
23386
+ "subcommands": [],
23387
+ "implementation_status": "implemented",
23388
+ "surfaces": {
23389
+ "tui": true,
23390
+ "rest": false,
23391
+ "gateway": false,
23392
+ "agentTool": false
23393
+ },
23394
+ "safety": {
23395
+ "userOnly": true,
23396
+ "destructive": false,
23397
+ "networked": true,
23398
+ "secretBearing": false,
23399
+ "profileGated": false
23400
+ },
23401
+ "avoid_when": [
23402
+ "Calling it through the REST command proxy; this command is not REST-exposed",
23403
+ "Allowing an autonomous agent to invoke it without an explicit user action"
23404
+ ]
23405
+ },
23346
23406
  {
23347
23407
  "id": "command.evaluate",
23348
23408
  "kind": "command",
package/docs/DISCOVERY.md CHANGED
@@ -322,6 +322,7 @@ Daemon equivalents are `GET /v1/discovery/bootstrap`, `GET /v1/discovery?q=<inte
322
322
  | `command.dream` | /dream | Start dream mode - creative idle exploration (writes to .omnius/dreams/) |
323
323
  | `command.emojis` | /emojis | Toggle emoji rendering in TUI messages |
324
324
  | `command.endpoint` | /endpoint | Select an endpoint or provider |
325
+ | `command.enhance` | /enhance | Enhance a prompt into the input editor |
325
326
  | `command.evaluate` | /evaluate | Evaluate last completed task (LLM quality scoring) |
326
327
  | `command.expose` | /expose | Expose local inference via libp2p (default) |
327
328
  | `command.fallback` | /fallback | Show remote inference fallback mode |
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.888",
3
+ "version": "1.0.890",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.888",
9
+ "version": "1.0.890",
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.888",
3
+ "version": "1.0.890",
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/library.js",