omnius 1.0.875 → 1.0.877

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: 38051883 bytes
4
- sha256: 0337aabceca4d3d07e61d8e780a551c392da94181e271718d24fca263d970728
3
+ size: 38125251 bytes
4
+ sha256: f68cf4307aa6852b874b8dbbfcccb42c4fece40da12520fc07b29fbaf8ab7978
@@ -35,6 +35,7 @@ function sanitizeNativeInterfaceState(value) {
35
35
  Object.defineProperty(views, key, { value: { top: offset(entry.top), live: entry.live === true, disclosures }, enumerable: true, configurable: true, writable: true });
36
36
  }
37
37
  const layout = record(value.layout) ? value.layout : {}, instruments = record(value.instruments) ? value.instruments : {}, tabs = record(value.tabs) ? value.tabs : {};
38
+ const deviceSections = record(instruments.deviceSections) ? instruments.deviceSections : void 0;
38
39
  const taskNotes = record(instruments.taskNotes) ? instruments.taskNotes : void 0;
39
40
  const workQueue = record(instruments.workQueue) ? instruments.workQueue : void 0;
40
41
  const workDisclosures = {};
@@ -64,6 +65,7 @@ function sanitizeNativeInterfaceState(value) {
64
65
  session: instruments.session === true,
65
66
  context: instruments.context === true,
66
67
  devices: instruments.devices === true,
68
+ ...deviceSections ? { deviceSections: { cpu: deviceSections.cpu === true, memory: deviceSections.memory === true, disk: deviceSections.disk === true, network: deviceSections.network === true, gpu: deviceSections.gpu !== false } } : {},
67
69
  scrollTop: offset(instruments.scrollTop),
68
70
  deviceScrollTop: offset(instruments.deviceScrollTop),
69
71
  ...typeof instruments.routeAttempts === "boolean" ? { routeAttempts: instruments.routeAttempts } : {},
@@ -3691,6 +3693,8 @@ var DeviceMonitor = class extends BoxRenderable7 {
3691
3693
  contentOptions: { flexDirection: "column" }
3692
3694
  });
3693
3695
  this.add(this.scroll);
3696
+ for (const [key, title] of [["cpu", "CPU"], ["memory", "MEMORY"], ["disk", "DISK"], ["network", "NETWORK"], ["gpu", "GPU"]])
3697
+ this.createSection(renderer2, key, title);
3694
3698
  this.notes = new TextRenderable6(renderer2, {
3695
3699
  id: "omnius-devices:notes",
3696
3700
  content: "",
@@ -3702,7 +3706,7 @@ var DeviceMonitor = class extends BoxRenderable7 {
3702
3706
  wrapMode: "none",
3703
3707
  truncate: true
3704
3708
  });
3705
- this.scroll.add(this.notes);
3709
+ this.sections.get("gpu").body.add(this.notes);
3706
3710
  const controls = new BoxRenderable7(renderer2, { id: "omnius-devices:controls", width: "100%", height: 1, flexShrink: 0, flexDirection: "row", gap: 2 });
3707
3711
  this.add(controls);
3708
3712
  this.policy = this.button(renderer2, "omnius-devices:policy", "GPU POLICY", () => {
@@ -3722,10 +3726,119 @@ var DeviceMonitor = class extends BoxRenderable7 {
3722
3726
  status;
3723
3727
  notes;
3724
3728
  expanded = false;
3729
+ sectionState = { cpu: false, memory: false, disk: false, network: false, gpu: true };
3730
+ sections = /* @__PURE__ */ new Map();
3725
3731
  availableRows = 100;
3726
3732
  snapshot;
3727
3733
  historySource = "";
3728
3734
  rows = /* @__PURE__ */ new Map();
3735
+ createSection(renderer2, key, title) {
3736
+ const root = new BoxRenderable7(renderer2, {
3737
+ id: `omnius-devices:${key}`,
3738
+ width: "100%",
3739
+ minWidth: 0,
3740
+ flexShrink: 0,
3741
+ flexDirection: "column",
3742
+ onSizeChange: () => {
3743
+ const section = this.sections.get(key);
3744
+ if (!section) return;
3745
+ section.header.width = root.width;
3746
+ for (const row of section.readings.values()) row.width = root.width;
3747
+ if (section.detail) section.detail.width = root.width;
3748
+ }
3749
+ });
3750
+ const header = new SectionBanner(renderer2, title, `${root.id}:heading`, () => this.toggleDeviceSection(key));
3751
+ header.on(RenderableEvents5.FOCUSED, () => this.scroll.scrollChildIntoView(header.id));
3752
+ const body = new BoxRenderable7(renderer2, { id: `${root.id}:body`, width: "100%", minWidth: 0, flexShrink: 0, flexDirection: "column", visible: this.sectionState[key] });
3753
+ root.add(header);
3754
+ root.add(body);
3755
+ this.scroll.add(root);
3756
+ const readings = /* @__PURE__ */ new Map();
3757
+ const labels = key === "cpu" ? ["LOAD", "CORES", "SAMPLE"] : key === "memory" ? ["USED", "FREE", "LOAD"] : key === "disk" ? ["SPACE USED", "USED", "FREE"] : key === "network" ? ["RECEIVE", "TRANSMIT", "SAMPLE"] : [];
3758
+ for (const label2 of labels) {
3759
+ const row = new TelemetryRow(renderer2, label2, `${root.id}:${label2.toLowerCase().replace(/ /g, "-")}`, 16);
3760
+ readings.set(label2, row);
3761
+ body.add(row);
3762
+ }
3763
+ const detail = key !== "gpu" ? new TextRenderable6(renderer2, {
3764
+ id: `${root.id}:detail`,
3765
+ content: "",
3766
+ width: "100%",
3767
+ height: 1,
3768
+ flexShrink: 0,
3769
+ fg: foreground,
3770
+ bg: background,
3771
+ attributes: TextAttributes7.DIM,
3772
+ wrapMode: "none",
3773
+ truncate: true
3774
+ }) : void 0;
3775
+ if (detail) body.add(detail);
3776
+ this.sections.set(key, { root, header, body, readings, detail });
3777
+ }
3778
+ toggleDeviceSection(key) {
3779
+ this.setDeviceSections({ ...this.sectionState, [key]: !this.sectionState[key] });
3780
+ }
3781
+ captureDeviceSections() {
3782
+ return { ...this.sectionState };
3783
+ }
3784
+ setDeviceSections(state) {
3785
+ if (!state) return;
3786
+ for (const key of Object.keys(this.sectionState)) {
3787
+ if (typeof state[key] !== "boolean") continue;
3788
+ const section = this.sections.get(key);
3789
+ if (!state[key]) for (let focused = this._ctx.currentFocusedRenderable; focused; focused = focused.parent) {
3790
+ if (focused === section.body) {
3791
+ section.header.focus();
3792
+ break;
3793
+ }
3794
+ }
3795
+ this.sectionState[key] = state[key];
3796
+ section.body.visible = state[key];
3797
+ }
3798
+ this.refresh();
3799
+ }
3800
+ refreshSystem() {
3801
+ const system = this.snapshot?.system;
3802
+ const number = (value, suffix = "") => instrumentNumber(value, suffix === " GiB" ? 1 : 0, suffix);
3803
+ const ratio = (used, total) => `${instrumentNumber(used, 1)}/${instrumentNumber(total, 1)} GiB`;
3804
+ const sample = (status) => status === "measured" ? "Measured" : status === "warming-up" ? "Warming up" : status === "reset" ? "Counter reset" : "Unavailable";
3805
+ const rate = (value) => {
3806
+ if (value === void 0 || !Number.isFinite(value) || value < 0) return "--";
3807
+ const units = ["B/s", "KiB/s", "MiB/s", "GiB/s", "TiB/s"];
3808
+ let unit = 0;
3809
+ while (value >= 1024 && unit < units.length - 1) {
3810
+ value /= 1024;
3811
+ unit++;
3812
+ }
3813
+ return `${instrumentNumber(value, unit ? 1 : 0)} ${units[unit]}`;
3814
+ };
3815
+ const set = (key, label2, value) => this.sections.get(key).readings.get(label2).update(value);
3816
+ set("cpu", "LOAD", formatSignalMeter(system?.cpu.utilization, 100, 6));
3817
+ set("cpu", "CORES", number(system?.cpu.cores));
3818
+ set("cpu", "SAMPLE", sample(system?.cpu.status));
3819
+ set("memory", "USED", ratio(system?.memory.usedGB, system?.memory.totalGB));
3820
+ const free = system?.memory.totalGB !== void 0 && system.memory.usedGB !== void 0 ? Math.max(0, system.memory.totalGB - system.memory.usedGB) : void 0;
3821
+ set("memory", "FREE", number(free, " GiB"));
3822
+ set("memory", "LOAD", formatSignalMeter(system?.memory.utilization, 100, 6));
3823
+ set("disk", "SPACE USED", number(system?.disk.utilization, "%"));
3824
+ set("disk", "USED", ratio(system?.disk.usedGB, system?.disk.totalGB));
3825
+ set("disk", "FREE", number(system?.disk.freeGB, " GiB"));
3826
+ set("network", "RECEIVE", rate(system?.network.rxBytesPerSec));
3827
+ set("network", "TRANSMIT", rate(system?.network.txBytesPerSec));
3828
+ set("network", "SAMPLE", sample(system?.network.status));
3829
+ const captions = {
3830
+ cpu: `CPU · ${number(system?.cpu.utilization, "%")}`,
3831
+ memory: `MEMORY · ${number(system?.memory.utilization, "%")}`,
3832
+ disk: `DISK · ${number(system?.disk.utilization, "%")} SPACE`,
3833
+ network: "NETWORK",
3834
+ gpu: this.snapshot?.source === "jtop" ? "GPU / UMA" : `GPU · ${this.snapshot?.devices.length ?? 0}`
3835
+ };
3836
+ for (const key of Object.keys(captions)) this.sections.get(key).header.update(captions[key], this.sectionState[key]);
3837
+ this.sections.get("cpu").detail.content = system?.cpu.model || "Processor unavailable";
3838
+ this.sections.get("memory").detail.content = "Host RAM · OS used / total";
3839
+ this.sections.get("disk").detail.content = system?.disk.path || "Filesystem unavailable";
3840
+ this.sections.get("network").detail.content = system?.network.source === "proc-net-dev" ? "All non-loopback interfaces" : system?.network.source === "netstat" ? "Interface en0" : "Interface counters unavailable";
3841
+ }
3729
3842
  button(renderer2, id, label2, activate) {
3730
3843
  const button = new TextRenderable6(renderer2, {
3731
3844
  id,
@@ -3829,7 +3942,7 @@ var DeviceMonitor = class extends BoxRenderable7 {
3829
3942
  root.add(memory);
3830
3943
  root.add(memoryGraph);
3831
3944
  root.add(reason);
3832
- this.scroll.add(root);
3945
+ this.sections.get("gpu").body.add(root);
3833
3946
  row = { root, title, load, memory, reason, history, loadGraph, memoryGraph };
3834
3947
  this.rows.set(device.uuid, row);
3835
3948
  }
@@ -3852,6 +3965,12 @@ var DeviceMonitor = class extends BoxRenderable7 {
3852
3965
  this.refresh();
3853
3966
  }
3854
3967
  toggle() {
3968
+ if (this.expanded) for (let focused = this._ctx.currentFocusedRenderable; focused; focused = focused.parent) {
3969
+ if (focused === this.scroll) {
3970
+ this.heading.focus();
3971
+ break;
3972
+ }
3973
+ }
3855
3974
  this.expanded = !this.expanded;
3856
3975
  this.scroll.visible = this.expanded;
3857
3976
  this.scroll.minHeight = this.expanded ? 1 : 0;
@@ -3882,10 +4001,11 @@ var DeviceMonitor = class extends BoxRenderable7 {
3882
4001
  if (!this.heading) return;
3883
4002
  const data = this.snapshot, devices = data?.devices ?? [];
3884
4003
  this.heading.update(data?.source === "jtop" ? "DEVICES / JETSON" : "DEVICES", this.expanded);
4004
+ this.refreshSystem();
3885
4005
  const measured = devices.map((device) => device.utilization).filter((value) => value !== void 0 && Number.isFinite(value) && value >= 0);
3886
4006
  const on = devices.filter((device) => device.enabled === true).length;
3887
4007
  const policyKnown = devices.every((device) => device.enabled !== void 0);
3888
- this.summary.content = !devices.length ? data?.source === "unavailable" ? "Telemetry unavailable" : "No local GPUs reported" : `${devices.length} GPU · ${policyKnown ? on : "--"} ON · ${measured.length === devices.length ? Math.round(Math.max(...measured)) : "--"}% PEAK`;
4008
+ this.summary.content = data?.system ? `CPU ${instrumentNumber(data.system.cpu.utilization, 0, "%")} · RAM ${instrumentNumber(data.system.memory.utilization, 0, "%")}` : !devices.length ? data?.source === "unavailable" ? "Telemetry unavailable" : "No local GPUs reported" : `${devices.length} GPU · ${policyKnown ? on : "--"} ON · ${measured.length === devices.length ? Math.round(Math.max(...measured)) : "--"}% PEAK`;
3889
4009
  this.notes.content = [
3890
4010
  data?.local === false ? "REMOTE" : void 0,
3891
4011
  data ? `${data.source.toUpperCase()} · ${data.policy.toUpperCase()} · ${data.broker.toUpperCase()}` : void 0,
@@ -3902,6 +4022,10 @@ var DeviceMonitor = class extends BoxRenderable7 {
3902
4022
  const next = `${caption} ${deviceHistorySparkline(compactHistory, field, plotWidth)} ${value}`;
3903
4023
  if (element.plainText !== next) element.content = next;
3904
4024
  }
4025
+ if (!primary && data?.system) {
4026
+ this.compactLoad.content = `CPU ${formatSignalMeter(data.system.cpu.utilization, 100, 6)}`;
4027
+ this.compactMemory.content = `MEM ${formatSignalMeter(data.system.memory.utilization, 100, 6)}`;
4028
+ }
3905
4029
  for (const device of devices) {
3906
4030
  const row = this.rows.get(device.uuid);
3907
4031
  if (!row) continue;
@@ -3916,9 +4040,10 @@ var DeviceMonitor = class extends BoxRenderable7 {
3916
4040
  focusTargets() {
3917
4041
  return !this.visible ? [] : [
3918
4042
  this.heading,
4043
+ ...this.expanded ? [...this.sections.values()].map((section) => section.header) : [],
4044
+ ...this.expanded && this.sectionState.gpu ? [...this.rows.values()].map((row) => row.title).filter((title) => title.focusable) : [],
3919
4045
  ...this.policy.focusable ? [this.policy] : [],
3920
- ...this.status.focusable ? [this.status] : [],
3921
- ...this.expanded ? [...this.rows.values()].map((row) => row.title).filter((title) => title.focusable) : []
4046
+ ...this.status.focusable ? [this.status] : []
3922
4047
  ];
3923
4048
  }
3924
4049
  };
@@ -4323,6 +4448,7 @@ var InstrumentRail = class extends BoxRenderable7 {
4323
4448
  session: this.session.visible,
4324
4449
  context: this.contextHeader.expanded,
4325
4450
  devices: this.devices.isExpanded,
4451
+ deviceSections: this.devices.captureDeviceSections(),
4326
4452
  routeAttempts: this.routeAttemptsHeader.expanded,
4327
4453
  scrollTop: this.scroll.scrollTop,
4328
4454
  deviceScrollTop: this.devices.scroll.scrollTop,
@@ -4340,6 +4466,7 @@ var InstrumentRail = class extends BoxRenderable7 {
4340
4466
  this.routeAttemptsHeader.update(this.routeAttemptsHeading, state.routeAttempts === true);
4341
4467
  this.routeAttempts.visible = this.routeAttemptsHeader.visible && state.routeAttempts === true;
4342
4468
  this.devices.setExpanded(state.devices);
4469
+ this.devices.setDeviceSections(state.deviceSections);
4343
4470
  this.scroll.scrollTo(state.scrollTop);
4344
4471
  this.devices.scroll.scrollTo(state.deviceScrollTop);
4345
4472
  }
@@ -4379,6 +4506,8 @@ var COMMAND_SIGNATURES = [
4379
4506
  ["/models", "List all available models"],
4380
4507
  ["/endpoint", "Select an endpoint or provider"],
4381
4508
  ["/endpoint <provider|alias|url>", "Set a provider name, alias, or backend URL"],
4509
+ ["/provider", "Configure rate-limited inference sponsorship to the mesh"],
4510
+ ["/provider status", "Inspect saved and active mesh provider state"],
4382
4511
  ["/endpoint <url> --auth <t>", "Set endpoint with Bearer auth"],
4383
4512
  ["/fallback", "Show remote inference fallback mode"],
4384
4513
  ["/fallback status", "Show remote inference fallback mode"],
@@ -5029,7 +5158,6 @@ var COMMAND_SIGNATURES = [
5029
5158
  ["/quit", "Exit omnius"]
5030
5159
  ].map(([signature, description]) => ({ signature, description }));
5031
5160
  var PLANNED_SIGNATURES = [
5032
- ["/provider", "Show or select provider profile"],
5033
5161
  ["/prompt", "Show or edit the active prompt template"],
5034
5162
  ["/reasoning", "Alias family for thinking/reasoning controls"],
5035
5163
  ["/statusbar", "Configure the status bar"],
@@ -5205,6 +5333,7 @@ var ALIASES = {
5205
5333
  platforms: ["gateway"]
5206
5334
  };
5207
5335
  var USER_ONLY = /* @__PURE__ */ new Set([
5336
+ "provider",
5208
5337
  "fallback",
5209
5338
  "quit",
5210
5339
  "exit",
@@ -5298,6 +5427,7 @@ var DESTRUCTIVE = /* @__PURE__ */ new Set([
5298
5427
  "ollama"
5299
5428
  ]);
5300
5429
  var NETWORKED = /* @__PURE__ */ new Set([
5430
+ "provider",
5301
5431
  "endpoint",
5302
5432
  "update",
5303
5433
  "upgrade",
@@ -5332,6 +5462,7 @@ var NETWORKED = /* @__PURE__ */ new Set([
5332
5462
  "gateway"
5333
5463
  ]);
5334
5464
  var SECRET_BEARING = /* @__PURE__ */ new Set([
5465
+ "provider",
5335
5466
  "endpoint",
5336
5467
  "apikey",
5337
5468
  "key",
@@ -5342,6 +5473,7 @@ var SECRET_BEARING = /* @__PURE__ */ new Set([
5342
5473
  "hf"
5343
5474
  ]);
5344
5475
  var PROFILE_GATED = /* @__PURE__ */ new Set([
5476
+ "provider",
5345
5477
  "destroy",
5346
5478
  "update",
5347
5479
  "upgrade",
@@ -5376,7 +5508,7 @@ var REST_BLOCKED = /* @__PURE__ */ new Set([
5376
5508
  "paste",
5377
5509
  "indicator"
5378
5510
  ]);
5379
- var LOCAL_TUI_ONLY = /* @__PURE__ */ new Set(["indicator", "compacted", "gpu", "memory"]);
5511
+ var LOCAL_TUI_ONLY = /* @__PURE__ */ new Set(["indicator", "compacted", "gpu", "memory", "provider"]);
5380
5512
  var CANONICAL_BY_ALIAS = /* @__PURE__ */ new Map();
5381
5513
  for (const [canonical, aliases2] of Object.entries(ALIASES)) {
5382
5514
  for (const alias of aliases2) CANONICAL_BY_ALIAS.set(alias, canonical);