open-agents-ai 0.187.89 → 0.187.90

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.
Files changed (2) hide show
  1. package/dist/index.js +130 -61
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -278632,6 +278632,132 @@ var init_status_bar = __esm({
278632
278632
  this._headerPanels.push({ id, render });
278633
278633
  return this._headerPanels.length - 1;
278634
278634
  }
278635
+ /** Rebuild all header panels from the current item set.
278636
+ * Items are paginated across N pages — each page fills left-to-right
278637
+ * until no more items fit. Called on activate and resize. */
278638
+ _rebuildHeaderPanels() {
278639
+ this._headerPanels = [];
278640
+ const savedIdx = this._headerPanelIndex;
278641
+ const buildItems = () => {
278642
+ const items = [];
278643
+ const verText = ` OA v${this._version}`;
278644
+ items.push({ type: "text", text: verText, ansi: `\x1B[1;38;5;${TEXT_PRIMARY}m${verText}\x1B[0m`, w: verText.length });
278645
+ for (const btn of [
278646
+ { cmd: "help", label: " help " },
278647
+ { cmd: "voice", label: " voice " },
278648
+ { cmd: "model", label: " model " },
278649
+ { cmd: "cohere", label: " cohere " }
278650
+ ]) {
278651
+ items.push({ type: "btn", cmd: btn.cmd, label: btn.label, w: btn.label.length + 1 });
278652
+ }
278653
+ items.push({ type: "sep", w: 3 });
278654
+ if (this._agentViews.size > 1) {
278655
+ for (const view of this._agentViews.values()) {
278656
+ if (view.id === "main" && this._activeViewId === "main")
278657
+ continue;
278658
+ const icon = view.status === "running" ? "\u25CF" : view.status === "completed" ? "\u2713" : view.status === "failed" ? "\u2717" : "\u25CB";
278659
+ const label = ` ${view.label} ${icon} `;
278660
+ items.push({ type: "btn", cmd: `view:${view.id}`, label, w: label.length + 1 });
278661
+ }
278662
+ } else {
278663
+ items.push({ type: "text", text: " no sub-agents", ansi: `\x1B[38;5;${TEXT_DIM}m no sub-agents`, w: 14 });
278664
+ }
278665
+ const voiceIcon = this._voiceActive ? "\u25CF" : "\u25CB";
278666
+ const voiceColor = this._voiceActive ? 82 : TEXT_DIM;
278667
+ const voiceLabel = this._voiceActive ? ` ${this._voiceModelId || "voice"} ` : " voice ";
278668
+ items.push({
278669
+ type: "btn",
278670
+ cmd: "voice",
278671
+ label: `${voiceIcon}${voiceLabel}`,
278672
+ w: voiceLabel.length + 1 + 1
278673
+ // icon + label + space
278674
+ });
278675
+ const nexusColor = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
278676
+ const nexusDot = this._nexusStatus === "connected" || this._nexusStatus === "connecting" ? "\u25CF" : "\u25CB";
278677
+ items.push({
278678
+ type: "btn",
278679
+ cmd: "nexus",
278680
+ label: `${nexusDot} nexus `,
278681
+ w: 8
278682
+ // dot + " nexus " + space
278683
+ });
278684
+ return items;
278685
+ };
278686
+ const allItems = buildItems();
278687
+ const availW = Math.max(10, termCols() - 4);
278688
+ let page = [];
278689
+ let pageW = 0;
278690
+ const pages = [];
278691
+ for (const item of allItems) {
278692
+ if (pageW + item.w > availW && page.length > 0) {
278693
+ pages.push(page);
278694
+ page = [];
278695
+ pageW = 0;
278696
+ }
278697
+ page.push(item);
278698
+ pageW += item.w;
278699
+ }
278700
+ if (page.length > 0)
278701
+ pages.push(page);
278702
+ for (let pi = 0; pi < pages.length; pi++) {
278703
+ const pageItems = pages[pi];
278704
+ this.registerHeaderPanel(`page-${pi}`, (innerW) => {
278705
+ let out = "";
278706
+ let usedW = 0;
278707
+ for (const item of pageItems) {
278708
+ if (item.type === "text") {
278709
+ out += item.ansi;
278710
+ usedW += item.w;
278711
+ } else if (item.type === "btn") {
278712
+ const cmdPrefix = item.cmd.startsWith("view:") ? "oa-view:" + item.cmd.slice(5) : "oa-cmd:" + item.cmd;
278713
+ let fg2 = TEXT_DIM;
278714
+ if (item.cmd === "voice" && this._voiceActive)
278715
+ fg2 = 82;
278716
+ if (item.cmd === "nexus") {
278717
+ fg2 = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
278718
+ }
278719
+ out += `\x1B]8;;${cmdPrefix}\x07\x1B[38;5;${fg2}m${item.label}\x1B]8;;\x07 `;
278720
+ usedW += item.w;
278721
+ } else if (item.type === "sep") {
278722
+ out += `\x1B[38;5;${TEXT_DIM}m \u2502 `;
278723
+ usedW += 3;
278724
+ }
278725
+ }
278726
+ if (pi === 0 && usedW < innerW) {
278727
+ const gapNeeded = innerW - usedW;
278728
+ const verEnd = pageItems.findIndex((it) => it.type !== "text");
278729
+ if (verEnd > 0) {
278730
+ let out2 = "";
278731
+ for (let i2 = 0; i2 < pageItems.length; i2++) {
278732
+ const item = pageItems[i2];
278733
+ if (item.type === "text") {
278734
+ out2 += item.ansi;
278735
+ } else {
278736
+ if (i2 === verEnd) {
278737
+ out2 += `\x1B[38;5;${TEXT_DIM}m${" ".repeat(gapNeeded)}`;
278738
+ }
278739
+ if (item.type === "btn") {
278740
+ const cmdPrefix = item.cmd.startsWith("view:") ? "oa-view:" + item.cmd.slice(5) : "oa-cmd:" + item.cmd;
278741
+ let fg2 = TEXT_DIM;
278742
+ if (item.cmd === "voice" && this._voiceActive)
278743
+ fg2 = 82;
278744
+ if (item.cmd === "nexus") {
278745
+ fg2 = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
278746
+ }
278747
+ out2 += `\x1B]8;;${cmdPrefix}\x07\x1B[38;5;${fg2}m${item.label}\x1B]8;;\x07 `;
278748
+ } else if (item.type === "sep") {
278749
+ out2 += `\x1B[38;5;${TEXT_DIM}m \u2502 `;
278750
+ }
278751
+ }
278752
+ }
278753
+ return out2;
278754
+ }
278755
+ }
278756
+ return out;
278757
+ });
278758
+ }
278759
+ this._headerPanelIndex = Math.min(savedIdx, this._headerPanels.length - 1);
278760
+ }
278635
278761
  /** Switch to the next header panel (wraps around) */
278636
278762
  nextHeaderPanel() {
278637
278763
  if (this._headerPanels.length <= 1)
@@ -278671,9 +278797,9 @@ var init_status_bar = __esm({
278671
278797
  buf += ` `;
278672
278798
  buf += `\x1B[38;5;${TEXT_PRIMARY}m${PANEL_BG_SEQ}`;
278673
278799
  buf += content;
278674
- buf += `\x1B[${hdrRow};${w - 2}H`;
278800
+ buf += `\x1B[${hdrRow};${w - 1}H`;
278675
278801
  buf += rightArrow;
278676
- buf += ` ${BOX_FG}\u2502${RESET}`;
278802
+ buf += `\x1B[${hdrRow};${w}H${BOX_FG}\u2502${RESET}`;
278677
278803
  buf += "\x1B8";
278678
278804
  this.termWrite(buf);
278679
278805
  }
@@ -279199,65 +279325,7 @@ var init_status_bar = __esm({
279199
279325
  this.scrollRegionTop = scrollRegionTop ?? 1;
279200
279326
  this.active = true;
279201
279327
  if (this._headerPanels.length === 0) {
279202
- const allBtns = [
279203
- { cmd: "help", label: " help " },
279204
- { cmd: "voice", label: " voice " },
279205
- { cmd: "model", label: " model " },
279206
- { cmd: "cohere", label: " cohere " }
279207
- ];
279208
- this.registerHeaderPanel("main", (innerW) => {
279209
- const verText = ` OA v${this._version}`;
279210
- let usedW = verText.length + 5;
279211
- const fittingBtns = [];
279212
- const overflowBtns = [];
279213
- for (const btn of allBtns) {
279214
- const btnW = btn.label.length + 1;
279215
- if (usedW + btnW <= innerW) {
279216
- fittingBtns.push(btn);
279217
- usedW += btnW;
279218
- } else {
279219
- overflowBtns.push(btn);
279220
- }
279221
- }
279222
- this._overflowBtns = overflowBtns;
279223
- const gap = Math.max(1, innerW - usedW + 1);
279224
- let out = `\x1B[1;38;5;${TEXT_PRIMARY}m${verText}`;
279225
- out += `\x1B[38;5;${TEXT_DIM}m${" ".repeat(gap)}`;
279226
- for (const btn of fittingBtns) {
279227
- out += `\x1B]8;;oa-cmd:${btn.cmd}\x07\x1B[38;5;${TEXT_DIM}m${btn.label}\x1B]8;;\x07 `;
279228
- }
279229
- return out;
279230
- });
279231
- this.registerHeaderPanel("systems", (innerW) => {
279232
- let out = "";
279233
- if (this._agentViews.size > 1) {
279234
- for (const view of this._agentViews.values()) {
279235
- if (view.id === "main" && this._activeViewId === "main")
279236
- continue;
279237
- const icon = view.status === "running" ? "\u25CF" : view.status === "completed" ? "\u2713" : view.status === "failed" ? "\u2717" : "\u25CB";
279238
- const isActive = view.id === this._activeViewId;
279239
- const fg2 = isActive ? 252 : 245;
279240
- out += `\x1B]8;;oa-view:${view.id}\x07\x1B[38;5;${fg2}m ${view.label} ${icon} \x1B]8;;\x07 `;
279241
- }
279242
- } else {
279243
- out += `\x1B[38;5;${TEXT_DIM}m no sub-agents `;
279244
- }
279245
- out += `\x1B[38;5;${TEXT_DIM}m\u2502 `;
279246
- const voiceIcon = this._voiceActive ? `\x1B[38;5;82m\u25CF` : `\x1B[38;5;${TEXT_DIM}m\u25CB`;
279247
- const voiceLabel = this._voiceActive ? ` ${this._voiceModelId || "voice"} ` : " voice ";
279248
- out += `\x1B]8;;oa-cmd:voice\x07${voiceIcon}\x1B[38;5;${this._voiceActive ? 82 : TEXT_DIM}m${voiceLabel}\x1B]8;;\x07 `;
279249
- const nexusColor = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
279250
- const nexusDot = this._nexusStatus === "connected" ? "\u25CF" : this._nexusStatus === "connecting" ? "\u25CF" : "\u25CB";
279251
- out += `\x1B]8;;oa-cmd:nexus\x07\x1B[38;5;${nexusColor}m${nexusDot}\x1B[38;5;${TEXT_DIM}m nexus \x1B]8;;\x07`;
279252
- const overflow = this._overflowBtns;
279253
- if (overflow && overflow.length > 0) {
279254
- out += `\x1B[38;5;${TEXT_DIM}m\u2502 `;
279255
- for (const btn of overflow) {
279256
- out += `\x1B]8;;oa-cmd:${btn.cmd}\x07\x1B[38;5;${TEXT_DIM}m${btn.label}\x1B]8;;\x07 `;
279257
- }
279258
- }
279259
- return out;
279260
- });
279328
+ this._rebuildHeaderPanels();
279261
279329
  }
279262
279330
  if (!this._agentViews.has("main")) {
279263
279331
  this._agentViews.set("main", {
@@ -279823,6 +279891,7 @@ var init_status_bar = __esm({
279823
279891
  if (!this.active)
279824
279892
  return;
279825
279893
  setTermSize(process.stdout.rows ?? 24, process.stdout.columns ?? 80);
279894
+ this._rebuildHeaderPanels();
279826
279895
  const prevRows = this._prevTermRows;
279827
279896
  const prevCols = this._prevTermCols;
279828
279897
  this.updateFooterHeight();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.89",
3
+ "version": "0.187.90",
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",