omnius 1.0.891 → 1.0.893

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.
@@ -1639,13 +1639,27 @@ function nativeMarkdownSections(owner, source, streaming = false) {
1639
1639
  return segmented ? output : void 0;
1640
1640
  }
1641
1641
 
1642
- // packages/cli/src/tui/native/components/blocks.ts
1643
- function nativeProgressText(value, working = false) {
1644
- if (value === void 0 || !Number.isFinite(value)) return `[············] ${working ? "working" : "pending"}`;
1642
+ // packages/cli/src/tui/native/activity-presentation.ts
1643
+ function nativeProgressText(value, _working = false) {
1644
+ if (value === void 0 || !Number.isFinite(value)) return "";
1645
1645
  const ratio = Math.max(0, Math.min(1, value));
1646
1646
  const filled = Math.round(ratio * 12);
1647
1647
  return `[${"▮".repeat(filled)}${"░".repeat(12 - filled)}] ${Math.round(ratio * 100)}%`;
1648
1648
  }
1649
+ function nativeActivityText(activity, runtimeStatus) {
1650
+ const stage = activity?.stage?.trim().replace(/_/g, " ") ?? "";
1651
+ const label3 = activity?.label?.trim() ?? "";
1652
+ if (/^(?:blocked|failed|error|awaiting input|waiting|paused|interrupted|stopped)(?:\b|$)/i.test(stage)) {
1653
+ return [stage.toUpperCase(), label3.toLowerCase() === stage.toLowerCase() ? "" : label3].filter(Boolean).join(" · ");
1654
+ }
1655
+ if (!activity?.operationId && activity?.progress !== void 0 && Number.isFinite(activity.progress)) {
1656
+ const percent = Math.round(Math.max(0, Math.min(1, activity.progress)) * 100);
1657
+ return [label3, `${percent}%`].filter(Boolean).join(" · ");
1658
+ }
1659
+ return runtimeStatus?.trim() ?? "";
1660
+ }
1661
+
1662
+ // packages/cli/src/tui/native/components/blocks.ts
1649
1663
  function nativeControlFocus(control, baseAttributes = 0) {
1650
1664
  const update = () => {
1651
1665
  if (!control.isDestroyed) control.attributes = baseAttributes | (control.focused ? 32 : 0);
@@ -1921,11 +1935,7 @@ var NativeBlockView = class {
1921
1935
  this.collapsed = spec.collapsed ?? false;
1922
1936
  this.previousModelCollapsed = spec.collapsed;
1923
1937
  }
1924
- if (this.title) {
1925
- this.title.content = `${spec.collapsible ? this.collapsed ? "▸ " : "· " : ""}${plainText(spec.title)}`;
1926
- this.title.focusable = Boolean(spec.collapsible);
1927
- }
1928
- if (this.body) this.body.visible = !this.collapsed;
1938
+ this.syncDisclosure();
1929
1939
  const sections = spec.kind === "markdown" ? nativeMarkdownSections(spec.id, plainText(spec.text), spec.streaming) : void 0;
1930
1940
  if (this.text && spec.kind === "markdown") this.text.visible = !sections;
1931
1941
  if (sections && this.body) {
@@ -1948,7 +1958,11 @@ var NativeBlockView = class {
1948
1958
  if (this.image && spec.imagePath && this.image.source !== spec.imagePath) this.image.source = spec.imagePath;
1949
1959
  if (this.terminal) this.terminal.height = spec.height ?? 14;
1950
1960
  if (this.image) this.image.height = spec.height ?? 12;
1951
- if (this.progress) this.progress.content = nativeProgressText(spec.progress, spec.streaming);
1961
+ if (this.progress) {
1962
+ const meter = nativeProgressText(spec.progress, spec.streaming);
1963
+ this.progress.content = meter;
1964
+ this.progress.visible = Boolean(meter);
1965
+ }
1952
1966
  this.children?.replace(spec.children ?? []);
1953
1967
  const actionsSignature = JSON.stringify(spec.actions ?? []);
1954
1968
  if (this.actions && actionsSignature !== this.actionsSignature) {
@@ -1988,10 +2002,26 @@ var NativeBlockView = class {
1988
2002
  }
1989
2003
  toggle() {
1990
2004
  this.collapsed = !this.collapsed;
1991
- if (this.body) this.body.visible = !this.collapsed;
1992
- if (this.title) this.title.content = `${this.collapsed ? "▸ " : "· "}${plainText(this.spec.title)}`;
2005
+ this.syncDisclosure();
1993
2006
  this.context.emit({ type: "action", action: "toggle-block", id: this.spec.id });
1994
2007
  }
2008
+ syncDisclosure() {
2009
+ if (this.body) this.body.visible = !this.collapsed;
2010
+ if (!this.title) return;
2011
+ const title = plainText(this.spec.title);
2012
+ const lineDisclosure = /^\+ \d+ lines?$/.test(title);
2013
+ const label3 = this.spec.collapsible && !this.collapsed && lineDisclosure ? title.replace(/^\+/, "−") : title;
2014
+ this.title.content = `${this.spec.collapsible ? this.collapsed ? "▸ " : "▾ " : ""}${label3}`;
2015
+ this.title.focusable = Boolean(this.spec.collapsible);
2016
+ const children = this.root.getChildren();
2017
+ const position = this.spec.collapsible && !this.collapsed && (this.spec.disclosurePlacement === "footer" || lineDisclosure) ? children.length - 1 : 0;
2018
+ if (children.indexOf(this.title) !== position) {
2019
+ const focused = this.title.focused;
2020
+ this.root.remove(this.title);
2021
+ this.root.add(this.title, position);
2022
+ if (focused) this.title.focus();
2023
+ }
2024
+ }
1995
2025
  captureDisclosures(result) {
1996
2026
  if (this.spec.collapsible) Object.defineProperty(result, this.spec.id, { value: this.collapsed, enumerable: true, configurable: true, writable: true });
1997
2027
  this.children?.captureDisclosures(result);
@@ -2000,8 +2030,7 @@ var NativeBlockView = class {
2000
2030
  restoreDisclosures(state) {
2001
2031
  if (this.spec.collapsible && Object.hasOwn(state, this.spec.id)) {
2002
2032
  this.collapsed = state[this.spec.id];
2003
- if (this.body) this.body.visible = !this.collapsed;
2004
- if (this.title) this.title.content = `${this.collapsed ? "▸ " : "· "}${plainText(this.spec.title)}`;
2033
+ this.syncDisclosure();
2005
2034
  }
2006
2035
  this.children?.restoreDisclosures(state);
2007
2036
  this.markdownSections?.restoreDisclosures(state);
@@ -6110,7 +6139,7 @@ var COMMAND_SIGNATURES = [
6110
6139
  ["/wizard", "Alias for /setup"],
6111
6140
  ["/parallel", "Show current Ollama parallel inference slots"],
6112
6141
  ["/parallel <1-15>", "Set parallel slots (restarts Ollama, max 15)"],
6113
- ["/gpu", "Select enabled GPUs with arrow keys and Space"],
6142
+ ["/gpu", "Select enabled GPUs and CPU offload with arrow keys and Space"],
6114
6143
  ["/gpu status|reset", "Inspect or reset the host-local GPU policy"],
6115
6144
  ["/gpu select <UUID>", "Open the GPU policy selector focused on a device"],
6116
6145
  [
@@ -8683,14 +8712,9 @@ var NativeFrontend = class {
8683
8712
  this.replaceActions(this.enhance, actions, "enhance");
8684
8713
  }
8685
8714
  renderActivity() {
8686
- const activity = this.state?.activity;
8687
- const stage = activity?.stage === "idle" ? void 0 : activity?.stage?.replace(/_/g, " ").toUpperCase();
8688
- const label3 = activity?.label && activity.label.toUpperCase() !== stage ? activity.label : void 0;
8689
- const elapsed = activity?.elapsedMs === void 0 ? void 0 : `${Math.max(0, Math.floor(activity.elapsedMs / 1e3))}s`;
8690
- const progress = activity?.progress === void 0 ? void 0 : `${Math.round(activity.progress * 100)}% source accounted`;
8691
- const reading = [stage, label3, elapsed, progress].filter(Boolean).join(" · ") || this.state?.instruments?.runtimeStatus || "";
8692
- this.activity.visible = Boolean(activity?.processing || reading);
8693
- this.activity.content = `${activity?.processing ? "RUN · " : ""}${reading}`;
8715
+ const reading = nativeActivityText(this.state?.activity, this.state?.instruments?.runtimeStatus);
8716
+ this.activity.visible = Boolean(reading);
8717
+ this.activity.content = reading;
8694
8718
  this.status.visible = this.activity.visible || this.media.visible || this.copyFeedback.visible;
8695
8719
  }
8696
8720
  renderMedia() {