omnius 1.0.505 → 1.0.506

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
@@ -634927,6 +634927,143 @@ var init_dist9 = __esm({
634927
634927
  }
634928
634928
  });
634929
634929
 
634930
+ // packages/cli/src/tui/stageIndicator.ts
634931
+ function supportsTruecolor() {
634932
+ const colorterm = process.env.COLORTERM;
634933
+ if (colorterm === "truecolor" || colorterm === "24bit") return true;
634934
+ const term = process.env.TERM ?? "";
634935
+ return /-256color$|-truecolor$|kitty|wezterm|alacritty|ghostty|rio|contour/.test(term);
634936
+ }
634937
+ function isSweepingStage(stage2) {
634938
+ return SWEEPING_STAGES.has(stage2);
634939
+ }
634940
+ function stageBlockText(stage2, detail, width) {
634941
+ const meta = STAGE_META[stage2];
634942
+ const lead = "▌ ";
634943
+ let body = meta.label;
634944
+ if (detail && detail.length > 0) body += ` ${detail}`;
634945
+ const budget = Math.max(3, width - lead.length - 1);
634946
+ let text2 = body;
634947
+ if (text2.length > budget) {
634948
+ const ell = "…";
634949
+ text2 = text2.slice(0, Math.max(1, budget - ell.length)) + ell;
634950
+ }
634951
+ const padded = text2.padEnd(budget, " ");
634952
+ return lead + padded;
634953
+ }
634954
+ function renderStageBlock(stage2, detail, width, phase, truecolor) {
634955
+ const text2 = stageBlockText(stage2, detail, width);
634956
+ const meta = STAGE_META[stage2];
634957
+ const sweeping = isSweepingStage(stage2);
634958
+ const normPhase = (phase % 360 + 360) % 360;
634959
+ if (!truecolor) {
634960
+ const prefix = meta.weight === "alert" ? "\x1B[1;7m" : "\x1B[1m";
634961
+ return `${prefix}${text2}\x1B[0m`;
634962
+ }
634963
+ let out = "";
634964
+ for (let i2 = 0; i2 < text2.length; i2++) {
634965
+ const ch = text2[i2];
634966
+ if (ch === " ") {
634967
+ out += " ";
634968
+ continue;
634969
+ }
634970
+ const hue = sweeping ? (meta.baseHue + i2 * 4 + normPhase) % 360 : meta.baseHue;
634971
+ const [r2, g, b] = HUE_LUT[hue] ?? HUE_LUT[0];
634972
+ out += `\x1B[38;2;${r2};${g};${b}m${ch}`;
634973
+ }
634974
+ out += "\x1B[0m";
634975
+ return out;
634976
+ }
634977
+ function clampGradientWidth(width) {
634978
+ return Math.min(MAX_GRADIENT_COLS, Math.max(0, width));
634979
+ }
634980
+ function hsvToRgb(h, s2, v) {
634981
+ const c9 = v * s2;
634982
+ const x = c9 * (1 - Math.abs(h / 60 % 2 - 1));
634983
+ const m2 = v - c9;
634984
+ let r2 = 0;
634985
+ let g = 0;
634986
+ let b = 0;
634987
+ if (h < 60) {
634988
+ r2 = c9;
634989
+ g = x;
634990
+ } else if (h < 120) {
634991
+ r2 = x;
634992
+ g = c9;
634993
+ } else if (h < 180) {
634994
+ g = c9;
634995
+ b = x;
634996
+ } else if (h < 240) {
634997
+ g = x;
634998
+ b = c9;
634999
+ } else if (h < 300) {
635000
+ r2 = x;
635001
+ b = c9;
635002
+ } else {
635003
+ r2 = c9;
635004
+ b = x;
635005
+ }
635006
+ return [
635007
+ Math.round((r2 + m2) * 255),
635008
+ Math.round((g + m2) * 255),
635009
+ Math.round((b + m2) * 255)
635010
+ ];
635011
+ }
635012
+ function setStage(stage2, detail) {
635013
+ _currentStage = stage2;
635014
+ _currentDetail = detail;
635015
+ const event = { stage: stage2, detail, at: Date.now() };
635016
+ for (const cb of _subscribers) {
635017
+ try {
635018
+ cb(event);
635019
+ } catch {
635020
+ }
635021
+ }
635022
+ }
635023
+ function getStage() {
635024
+ return { stage: _currentStage, detail: _currentDetail };
635025
+ }
635026
+ var STAGE_META, SWEEPING_STAGES, MAX_GRADIENT_COLS, HUE_LUT, _currentStage, _currentDetail, _subscribers;
635027
+ var init_stageIndicator = __esm({
635028
+ "packages/cli/src/tui/stageIndicator.ts"() {
635029
+ "use strict";
635030
+ STAGE_META = {
635031
+ idle: { label: "idle", weight: "neutral", baseHue: 210 },
635032
+ planning: { label: "planning", weight: "active", baseHue: 265 },
635033
+ tool_call: { label: "tool call", weight: "active", baseHue: 200 },
635034
+ editing: { label: "editing", weight: "active", baseHue: 150 },
635035
+ verifying: { label: "verifying", weight: "active", baseHue: 45 },
635036
+ reflecting: { label: "reflecting", weight: "active", baseHue: 300 },
635037
+ compacting: { label: "compacting", weight: "active", baseHue: 180 },
635038
+ adversary_audit: { label: "adversary audit", weight: "active", baseHue: 330 },
635039
+ blocked: { label: "blocked", weight: "alert", baseHue: 0 },
635040
+ completed: { label: "completed", weight: "success", baseHue: 120 },
635041
+ failed: { label: "failed", weight: "alert", baseHue: 12 }
635042
+ };
635043
+ SWEEPING_STAGES = /* @__PURE__ */ new Set([
635044
+ "planning",
635045
+ "tool_call",
635046
+ "editing",
635047
+ "verifying",
635048
+ "reflecting",
635049
+ "compacting",
635050
+ "adversary_audit",
635051
+ "blocked",
635052
+ "failed"
635053
+ ]);
635054
+ MAX_GRADIENT_COLS = 120;
635055
+ HUE_LUT = (() => {
635056
+ const lut = [];
635057
+ for (let h = 0; h < 360; h++) {
635058
+ lut.push(hsvToRgb(h, 0.72, 0.95));
635059
+ }
635060
+ return lut;
635061
+ })();
635062
+ _currentStage = "idle";
635063
+ _subscribers = [];
635064
+ }
635065
+ });
635066
+
634930
635067
  // packages/cli/src/tui/braille-spinner.ts
634931
635068
  function buildColorRamp(ramp) {
634932
635069
  return [...ramp, ...ramp.slice(1, -1).reverse()];
@@ -637636,6 +637773,7 @@ var init_status_bar = __esm({
637636
637773
  "packages/cli/src/tui/status-bar.ts"() {
637637
637774
  "use strict";
637638
637775
  init_render();
637776
+ init_stageIndicator();
637639
637777
  init_braille_spinner();
637640
637778
  init_project_context();
637641
637779
  init_dist8();
@@ -638016,6 +638154,8 @@ var init_status_bar = __esm({
638016
638154
  _enhanceHandler = null;
638017
638155
  /** Current enhance-button lifecycle state. */
638018
638156
  _enhanceState = "idle";
638157
+ /** Gradient phase for the live stage indicator sweep (spec §3). */
638158
+ _stagePhase = 0;
638019
638159
  /** The pre-expansion seed text, restored when the user rejects the expansion. */
638020
638160
  _enhanceOriginal = null;
638021
638161
  /** Transient press-flash target for visual click feedback. */
@@ -641348,6 +641488,21 @@ ${CONTENT_BG_SEQ}`);
641348
641488
  return Math.round(n2).toLocaleString();
641349
641489
  }
641350
641490
  /** Build the metrics line string with adaptive compaction */
641491
+ /**
641492
+ * Live stage indicator block (spec: tui-stage-indicator-spec.md).
641493
+ * Renders the current runner stage as a left→right truecolor gradient block
641494
+ * on the metrics row, beside the scroll-down / copy-tui controls. The block
641495
+ * is a fixed-width cell so it never bleeds into the metrics sections.
641496
+ */
641497
+ buildStageBlock() {
641498
+ const { stage: stage2, detail } = getStage();
641499
+ const termWidth = getTermWidth();
641500
+ const reserved = clampGradientWidth(Math.min(28, Math.max(12, Math.floor(termWidth * 0.22))));
641501
+ const truecolor = supportsTruecolor();
641502
+ this._stagePhase = (this._stagePhase + 6) % 360;
641503
+ const block = renderStageBlock(stage2, detail, reserved, this._stagePhase, truecolor);
641504
+ return block + " ".repeat(Math.max(0, reserved - block.replace(/\x1B\[[0-9;]*m/g, "").length)) + " ";
641505
+ }
641351
641506
  buildMetricsLine() {
641352
641507
  const m2 = this.metrics;
641353
641508
  const termWidth = getTermWidth();
@@ -641739,7 +641894,8 @@ ${CONTENT_BG_SEQ}`);
641739
641894
  const color = sec.btnColor ?? 183;
641740
641895
  result += `${PANEL_BG_SEQ}\x1B[38;5;${color}m${content}\x1B[0m`;
641741
641896
  }
641742
- return result.replace(/\x1B\[0m/g, `\x1B[0m${PANEL_BG_SEQ}`);
641897
+ const stageBlock = this.buildStageBlock();
641898
+ return (stageBlock + result).replace(/\x1B\[0m/g, `\x1B[0m${PANEL_BG_SEQ}`);
641743
641899
  }
641744
641900
  // -------------------------------------------------------------------------
641745
641901
  // Private
@@ -744639,6 +744795,31 @@ ${entry.fullContent}`
744639
744795
  };
744640
744796
  runner.onEvent((event) => {
744641
744797
  emotionEngine?.appraise(event);
744798
+ switch (event.type) {
744799
+ case "tool_call":
744800
+ setStage("tool_call", event.toolName);
744801
+ break;
744802
+ case "stream_start":
744803
+ setStage("planning");
744804
+ break;
744805
+ case "compaction":
744806
+ setStage("compacting");
744807
+ break;
744808
+ case "debug_adversary":
744809
+ setStage("adversary_audit");
744810
+ break;
744811
+ case "complete":
744812
+ setStage("completed");
744813
+ break;
744814
+ case "error":
744815
+ setStage("failed", event.content?.slice(0, 40));
744816
+ break;
744817
+ case "user_interrupt":
744818
+ setStage("blocked");
744819
+ break;
744820
+ default:
744821
+ break;
744822
+ }
744642
744823
  switch (event.type) {
744643
744824
  case "tool_call":
744644
744825
  if (_apiCallbacks?.onToolCall)
@@ -752455,6 +752636,7 @@ var init_interactive = __esm({
752455
752636
  init_telegram_bridge();
752456
752637
  init_platforms();
752457
752638
  init_status_bar();
752639
+ init_stageIndicator();
752458
752640
  init_shell_live_block();
752459
752641
  init_tool_collapse_store();
752460
752642
  init_daemon_registry();
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.505",
3
+ "version": "1.0.506",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.505",
9
+ "version": "1.0.506",
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.505",
3
+ "version": "1.0.506",
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",