omnius 1.0.970 → 1.0.972

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.
@@ -3406,7 +3406,10 @@ function formatSignalDivider(width, geometry = { direction: "top" }) {
3406
3406
  const cells = Math.max(0, Math.floor(width));
3407
3407
  const column3 = Math.floor(geometry.sidebarColumn ?? -1);
3408
3408
  if (!Number.isFinite(column3) || column3 < 0 || column3 >= cells) return "─".repeat(cells);
3409
- return "─".repeat(column3) + (geometry.direction === "top" ? "┬" : "┴") + "─".repeat(cells - column3 - 1);
3409
+ const left = "─".repeat(column3);
3410
+ const rightWidth = cells - column3 - 1;
3411
+ if (rightWidth === 0) return left + (geometry.direction === "top" ? "┐" : "┘");
3412
+ return left + (geometry.direction === "top" ? "┬" : "┴") + "─".repeat(rightWidth);
3410
3413
  }
3411
3414
  function fitInstrumentText(value, cells, marker = "~") {
3412
3415
  const text = stripTerminalSequences(normalizeTerminalLine(value));
@@ -7431,6 +7434,11 @@ function normalizeCommandName(name) {
7431
7434
  return name.replace(/^\//, "").trim().toLowerCase();
7432
7435
  }
7433
7436
 
7437
+ // packages/cli/src/tui/shell-mode-input.ts
7438
+ function parseShellModeInput(text) {
7439
+ return text.startsWith("!") ? text.slice(1).trimStart() : null;
7440
+ }
7441
+
7434
7442
  // packages/cli/src/tui/native/components/vim-composer.ts
7435
7443
  var VimComposer = class {
7436
7444
  constructor(editor, changed) {
@@ -8612,7 +8620,7 @@ var NativeFrontend = class {
8612
8620
  keyBindings: [{ name: "return", action: "submit" }, { name: "return", shift: true, action: "newline" }],
8613
8621
  onContentChange: () => this.editorChanged(),
8614
8622
  onCursorChange: () => this.editorChanged(),
8615
- onSubmit: () => this.submit()
8623
+ onSubmit: () => this.submit(true)
8616
8624
  });
8617
8625
  this.vimMode = new TextRenderable11(renderer2, {
8618
8626
  id: "omnius-vim-mode",
@@ -8827,14 +8835,13 @@ var NativeFrontend = class {
8827
8835
  const index = state.suggestions.findIndex((item) => item.value === selected);
8828
8836
  if (index >= 0) this.suggestions.setSelectedIndex(index);
8829
8837
  }
8830
- this.suggestions.visible = this.historyIndex < 0 && state.suggestions.length > 0;
8831
8838
  this.suggestions.height = Math.min(4, state.suggestions.length || 1);
8832
- this.prompt.content = styledText(state.prompt.trimEnd() || "❯");
8833
8839
  if (!this.editorInitialized) {
8834
8840
  this.editor.setText(state.input.text);
8835
8841
  this.placeInputCursor(state.input.text, state.input.cursor);
8836
8842
  this.editorInitialized = true;
8837
8843
  }
8844
+ this.suggestions.visible = !this.shellMode && this.historyIndex < 0 && state.suggestions.length > 0;
8838
8845
  this.editor.focusable = state.input.enabled && !this.paused;
8839
8846
  if (state.input.enabled && !this.paused && !this.modals.active && (inputWasEnabled === false || !this.renderer.currentFocusedRenderable)) this.editor.focus();
8840
8847
  this.metrics.content = styledText(state.metrics);
@@ -8849,7 +8856,7 @@ var NativeFrontend = class {
8849
8856
  this.replaceActions(this.metricsStartActions, (state.metricsActions ?? []).filter((action) => action.id === "agents"), "metrics");
8850
8857
  this.replaceActions(this.metricsEndActions, (state.metricsActions ?? []).filter((action) => action.id !== "agents"), "metrics");
8851
8858
  }
8852
- this.renderEnhance();
8859
+ this.renderComposer();
8853
8860
  this.renderActivity();
8854
8861
  this.renderMedia();
8855
8862
  } finally {
@@ -8904,9 +8911,16 @@ var NativeFrontend = class {
8904
8911
  parent.add(button);
8905
8912
  }
8906
8913
  }
8907
- renderEnhance() {
8914
+ get shellMode() {
8915
+ return parseShellModeInput(this.editor.plainText) !== null;
8916
+ }
8917
+ renderComposer() {
8918
+ const shellMode = this.shellMode;
8919
+ this.prompt.content = styledText(shellMode ? "shell ❯" : this.state?.prompt.trimEnd() || "❯");
8920
+ this.prompt.fg = shellMode ? this.context.colors.warning : this.context.colors.accent;
8921
+ if (shellMode) this.suggestions.visible = false;
8908
8922
  const state = this.state?.enhance;
8909
- this.enhance.visible = Boolean(state && (state.state !== "idle" || this.editor.plainText.trim()));
8923
+ this.enhance.visible = !shellMode && Boolean(state && (state.state !== "idle" || this.editor.plainText.trim()));
8910
8924
  if (!state) return;
8911
8925
  const actions = state.state === "confirm" ? [{ id: "enhance-accept", label: "✓" }, { id: "enhance-reject", label: "×" }] : [{ id: "enhance", label: state.state === "busy" ? "WORK · ENHANCE" : state.label ?? "ENHANCE", disabled: state.state === "busy" }];
8912
8926
  this.replaceActions(this.enhance, actions, "enhance");
@@ -8952,7 +8966,7 @@ var NativeFrontend = class {
8952
8966
  this.identityMarker.fg = colors.foreground;
8953
8967
  this.headerPanel.fg = colors.foreground;
8954
8968
  this.routeWarning.fg = colors.warning;
8955
- this.prompt.fg = this.activity.fg = this.liveButton.fg = colors.accent;
8969
+ this.activity.fg = this.liveButton.fg = colors.accent;
8956
8970
  this.vimMode.fg = colors.foreground;
8957
8971
  this.micTrack.fg = colors.foreground;
8958
8972
  this.queue.fg = this.metrics.fg = colors.dim;
@@ -9148,12 +9162,14 @@ var NativeFrontend = class {
9148
9162
  if (this.historyIndex >= 0 && text !== this.history[this.historyIndex]) this.resetHistoryNavigation();
9149
9163
  this.lastInput = text;
9150
9164
  this.lastCursor = cursor;
9151
- this.renderEnhance();
9165
+ this.renderComposer();
9152
9166
  this.emit({ type: "input", text, cursor });
9153
9167
  }
9154
- submit() {
9168
+ submit(fromEditor) {
9155
9169
  if (this.paused || this.state?.input.enabled === false) return;
9156
9170
  const text = this.editor.plainText;
9171
+ const shellCommand = fromEditor ? parseShellModeInput(text) : null;
9172
+ if (shellCommand === "") return;
9157
9173
  const command2 = /^\/([^\s]+)/.exec(text.trimStart())?.[1];
9158
9174
  const suggestion = String(this.suggestions.getSelectedOption()?.value ?? "");
9159
9175
  if (this.suggestions.visible && command2 && !findCommand(command2) && suggestion.startsWith(text.trimEnd()) && this.acceptSuggestion()) return;
@@ -9164,7 +9180,7 @@ var NativeFrontend = class {
9164
9180
  }
9165
9181
  this.resetHistoryNavigation();
9166
9182
  this.editor.clear();
9167
- this.emit({ type: "submit", text });
9183
+ this.emit(shellCommand === null ? { type: "submit", text } : { type: "submit", text, localShell: true });
9168
9184
  this.editorChanged();
9169
9185
  }
9170
9186
  resetHistoryNavigation() {
@@ -9189,6 +9205,7 @@ var NativeFrontend = class {
9189
9205
  else this.setInput(this.history[this.historyIndex], void 0, true);
9190
9206
  }
9191
9207
  acceptSuggestion() {
9208
+ if (this.shellMode) return false;
9192
9209
  const selected = this.suggestions.getSelectedOption();
9193
9210
  if (!selected || selected.value === this.editor.plainText.trimEnd()) return false;
9194
9211
  const text = String(selected.value);
@@ -9302,6 +9319,12 @@ var NativeFrontend = class {
9302
9319
  this.shortcut("ctrl-u", key);
9303
9320
  return;
9304
9321
  }
9322
+ if (key.name === "escape" && this.renderer.currentFocusedRenderable === this.editor && !this.paused && this.state?.input.enabled !== false && this.shellMode) {
9323
+ this.setInput("");
9324
+ key.preventDefault();
9325
+ key.stopPropagation();
9326
+ return;
9327
+ }
9305
9328
  if (this.renderer.currentFocusedRenderable === this.editor && !this.paused && this.state?.input.enabled !== false && this.vimComposer.handle(key)) return;
9306
9329
  if (key.name === "escape") {
9307
9330
  if (this.renderer.currentFocusedRenderable !== this.editor) {
@@ -9315,14 +9338,16 @@ var NativeFrontend = class {
9315
9338
  return;
9316
9339
  }
9317
9340
  if (key.name === "tab") {
9318
- if (key.ctrl) this.shortcut("ctrl-tab", key);
9319
- else if (!key.shift && this.renderer.currentFocusedRenderable === this.editor && this.suggestions.visible) {
9320
- this.acceptSuggestion();
9321
- key.preventDefault();
9322
- } else if (!key.shift && this.renderer.currentFocusedRenderable === this.editor && this.editor.plainText) this.shortcut("tab", key);
9323
- else this.focusNext(key.shift ? -1 : 1);
9324
9341
  key.preventDefault();
9325
9342
  key.stopPropagation();
9343
+ if (key.ctrl) this.shortcut("ctrl-tab", key);
9344
+ else {
9345
+ const completing = !key.shift && this.renderer.currentFocusedRenderable === this.editor;
9346
+ if (completing && this.shellMode) return;
9347
+ if (completing && this.suggestions.visible) this.acceptSuggestion();
9348
+ else if (completing && this.editor.plainText) this.shortcut("tab", key);
9349
+ else this.focusNext(key.shift ? -1 : 1);
9350
+ }
9326
9351
  return;
9327
9352
  }
9328
9353
  if (this.renderer.currentFocusedRenderable !== this.editor && this.renderer.currentFocusedRenderable !== this.scroll && !key.ctrl) return;
@@ -9533,7 +9558,7 @@ var NativeFrontend = class {
9533
9558
  }
9534
9559
  } else if (action === "insert") this.editor.insertText(value ?? "");
9535
9560
  else if (action === "clear") this.editor.clear();
9536
- else if (action === "submit") this.submit();
9561
+ else if (action === "submit") this.submit(false);
9537
9562
  else if (action === "complete") this.acceptSuggestion();
9538
9563
  else if (action === "focus") this.restoreFocus();
9539
9564
  else if (action === "select-block") {