open-agents-ai 0.187.393 → 0.187.394

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
@@ -532452,14 +532452,15 @@ var init_status_bar = __esm({
532452
532452
  _headerPanels = [];
532453
532453
  /** Index of the currently visible panel (0 = main) */
532454
532454
  _headerPanelIndex = 0;
532455
+ _headerCommandZones = [];
532455
532456
  /** Register a header panel. Returns its index. */
532456
- registerHeaderPanel(id, render2) {
532457
+ registerHeaderPanel(id, render2, meta) {
532457
532458
  const existing = this._headerPanels.findIndex((p2) => p2.id === id);
532458
532459
  if (existing >= 0) {
532459
- this._headerPanels[existing] = { id, render: render2 };
532460
+ this._headerPanels[existing] = { id, render: render2, meta };
532460
532461
  return existing;
532461
532462
  }
532462
- this._headerPanels.push({ id, render: render2 });
532463
+ this._headerPanels.push({ id, render: render2, meta });
532463
532464
  return this._headerPanels.length - 1;
532464
532465
  }
532465
532466
  /** Rebuild all header panels. Two categories are kept separate:
@@ -532509,10 +532510,6 @@ var init_status_bar = __esm({
532509
532510
  let out = "";
532510
532511
  let usedW = 0;
532511
532512
  if (isFirstPage) {
532512
- try {
532513
- this._verClickZone = this._updateLatest ? { start: 4, end: 4 + verW - 1 } : null;
532514
- } catch {
532515
- }
532516
532513
  out += `\x1B[1;38;5;${TEXT_PRIMARY}m${verText}\x1B[0m`;
532517
532514
  usedW += verW;
532518
532515
  }
@@ -532524,6 +532521,11 @@ var init_status_bar = __esm({
532524
532521
  out += renderBtn(btn.cmd, btn.label) + " ";
532525
532522
  }
532526
532523
  return out;
532524
+ }, {
532525
+ kind: "main",
532526
+ buttons: btns,
532527
+ isFirstPage,
532528
+ versionWidth: verW
532527
532529
  });
532528
532530
  }
532529
532531
  const sysItems = [];
@@ -532572,7 +532574,7 @@ var init_status_bar = __esm({
532572
532574
  let out = "";
532573
532575
  for (const item of items) out += item.render();
532574
532576
  return out;
532575
- });
532577
+ }, { kind: "system" });
532576
532578
  }
532577
532579
  this._headerPanelIndex = Math.min(savedIdx, Math.max(0, this._headerPanels.length - 1));
532578
532580
  }
@@ -532592,15 +532594,65 @@ var init_status_bar = __esm({
532592
532594
  get currentHeaderPanel() {
532593
532595
  return this._headerPanels[this._headerPanelIndex]?.id ?? "main";
532594
532596
  }
532597
+ getHeaderChromeLayout(termWidth) {
532598
+ const hasMultiple = this._headerPanels.length > 1;
532599
+ const showPrev = hasMultiple && this._headerPanelIndex > 0;
532600
+ const showNext = hasMultiple && this._headerPanelIndex < this._headerPanels.length - 1;
532601
+ const leftPadWidth = showPrev ? 2 : 0;
532602
+ const rightPadWidth = showNext ? 1 : 0;
532603
+ return {
532604
+ showPrev,
532605
+ showNext,
532606
+ contentStartCol: 2 + leftPadWidth,
532607
+ innerWidth: Math.max(1, termWidth - 2 - leftPadWidth - rightPadWidth)
532608
+ };
532609
+ }
532610
+ hitTestCurrentHeaderAction(row, col, termWidth) {
532611
+ const hdrRow = layout().headerContent;
532612
+ if (row !== hdrRow) return null;
532613
+ const chrome = this.getHeaderChromeLayout(termWidth);
532614
+ if (chrome.showPrev && col === 2) return "header-prev";
532615
+ if (chrome.showNext && col === termWidth - 1) return "header-next";
532616
+ const hit = this._headerCommandZones.find((zone) => col >= zone.start && col <= zone.end);
532617
+ return hit?.cmd ?? null;
532618
+ }
532595
532619
  /** Render the current header panel content onto terminal row 2 (inside box) */
532596
532620
  refreshHeaderContent() {
532597
532621
  if (!this.active) return;
532598
532622
  const w = termCols();
532599
- const innerW = Math.max(1, w - 5);
532623
+ const chrome = this.getHeaderChromeLayout(w);
532624
+ const innerW = chrome.innerWidth;
532600
532625
  const panel = this._headerPanels[this._headerPanelIndex];
532601
532626
  if (!panel) return;
532627
+ this._headerCommandZones = [];
532628
+ try {
532629
+ this._verClickZone = null;
532630
+ } catch {
532631
+ }
532602
532632
  let content = panel.render(innerW);
532603
532633
  this._sysClickZones = [];
532634
+ if (panel.meta?.kind === "main") {
532635
+ const buttons = panel.meta.buttons ?? [];
532636
+ const versionWidth = panel.meta.versionWidth ?? 0;
532637
+ const usedW = panel.meta.isFirstPage ? versionWidth : 0;
532638
+ const btnTotalW = buttons.reduce((sum, btn) => sum + btn.w + 1, 0);
532639
+ const gap = Math.max(1, innerW - usedW - btnTotalW);
532640
+ let col = chrome.contentStartCol + usedW + gap;
532641
+ if (panel.meta.isFirstPage && this._updateLatest) {
532642
+ try {
532643
+ this._verClickZone = {
532644
+ start: chrome.contentStartCol,
532645
+ end: chrome.contentStartCol + versionWidth - 1
532646
+ };
532647
+ } catch {
532648
+ }
532649
+ }
532650
+ this._headerCommandZones = buttons.map((btn) => {
532651
+ const zone = { start: col, end: col + btn.w - 1, cmd: `/${btn.cmd}` };
532652
+ col += btn.w + 1;
532653
+ return zone;
532654
+ });
532655
+ }
532604
532656
  if (String(this.currentHeaderPanel).startsWith("sys-")) {
532605
532657
  const zones = [];
532606
532658
  const trunc3 = (s2) => s2.trim().split(/\s+/).slice(0, 3).join(" ");
@@ -532637,7 +532689,7 @@ var init_status_bar = __esm({
532637
532689
  if (cur.length > 0) pages.push(cur);
532638
532690
  const idx = parseInt(String(this.currentHeaderPanel).split("-")[1] || "0", 10) || 0;
532639
532691
  const page2 = pages[Math.max(0, Math.min(idx, pages.length - 1))] ?? [];
532640
- let col = 4;
532692
+ let col = chrome.contentStartCol;
532641
532693
  const clickZones = [];
532642
532694
  for (const z16 of page2) {
532643
532695
  if (z16.id) clickZones.push({ start: col, end: col + z16.w - 2, id: z16.id });
@@ -532645,19 +532697,22 @@ var init_status_bar = __esm({
532645
532697
  }
532646
532698
  this._sysClickZones = clickZones;
532647
532699
  }
532648
- const hasMultiple = this._headerPanels.length > 1;
532649
- const leftArrow = hasMultiple ? `\x1B]8;;oa-cmd:header-prev\x07\x1B[38;5;${TEXT_DIM}m${this._headerPanelIndex > 0 ? "◀" : " "}\x1B]8;;\x07` : " ";
532650
- const rightArrow = hasMultiple ? `\x1B]8;;oa-cmd:header-next\x07\x1B[38;5;${TEXT_DIM}m${this._headerPanelIndex < this._headerPanels.length - 1 ? "▶" : " "}\x1B]8;;\x07` : " ";
532700
+ const leftArrow = chrome.showPrev ? `\x1B]8;;oa-cmd:header-prev\x07\x1B[38;5;${TEXT_DIM}m◀\x1B]8;;\x07` : "";
532701
+ const rightArrow = chrome.showNext ? `\x1B]8;;oa-cmd:header-next\x07\x1B[38;5;${TEXT_DIM}m▶\x1B]8;;\x07` : "";
532651
532702
  const hdrRow = layout().headerContent;
532652
532703
  let buf = "\x1B7";
532653
532704
  buf += `\x1B[${hdrRow};1H${PANEL_BG_SEQ}\x1B[2K`;
532654
532705
  buf += `${BOX_FG}│${RESET2}${PANEL_BG_SEQ}`;
532655
- buf += leftArrow;
532656
- buf += ` `;
532706
+ if (chrome.showPrev) {
532707
+ buf += leftArrow;
532708
+ buf += ` `;
532709
+ }
532657
532710
  buf += `\x1B[38;5;${TEXT_PRIMARY}m${PANEL_BG_SEQ}`;
532658
532711
  buf += content;
532659
- buf += `\x1B[${hdrRow};${w - 1}H`;
532660
- buf += rightArrow;
532712
+ if (chrome.showNext) {
532713
+ buf += `\x1B[${hdrRow};${w - 1}H`;
532714
+ buf += rightArrow;
532715
+ }
532661
532716
  buf += `\x1B[${hdrRow};${w}H${BOX_FG}│${RESET2}`;
532662
532717
  buf += "\x1B8";
532663
532718
  this.termWrite(buf);
@@ -533503,7 +533558,7 @@ var init_status_bar = __esm({
533503
533558
  return;
533504
533559
  }
533505
533560
  }
533506
- const cmd = hitTestHeaderButton(row, col, w);
533561
+ const cmd = this.hitTestCurrentHeaderAction(row, col, w);
533507
533562
  if (type === "press" && cmd) {
533508
533563
  if (cmd === "header-prev") {
533509
533564
  this.prevHeaderPanel();
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.393",
3
+ "version": "0.187.394",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "open-agents-ai",
9
- "version": "0.187.393",
9
+ "version": "0.187.394",
10
10
  "hasInstallScript": true,
11
11
  "license": "CC-BY-NC-4.0",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.393",
3
+ "version": "0.187.394",
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",