open-agents-ai 0.187.76 → 0.187.78

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 +164 -152
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -270921,6 +270921,73 @@ var init_theme = __esm({
270921
270921
  }
270922
270922
  });
270923
270923
 
270924
+ // packages/cli/dist/tui/layout.js
270925
+ function layout() {
270926
+ const rows = _termRows;
270927
+ const cols = _termCols;
270928
+ const fh = _footerHeight;
270929
+ const hh = _headerHeight;
270930
+ const headerTop = 1;
270931
+ const headerContent = 2;
270932
+ const headerBottom = hh;
270933
+ const contentTop = headerBottom + 1;
270934
+ const footerMetrics = rows;
270935
+ const footerBoxBottom = footerMetrics - 1;
270936
+ const footerBoxTop = rows - fh + 1;
270937
+ const footerInput = footerBoxTop + 1;
270938
+ const contentBottom = footerBoxTop - 1;
270939
+ const contentHeight = Math.max(1, contentBottom - contentTop + 1);
270940
+ return {
270941
+ rows,
270942
+ cols,
270943
+ headerTop,
270944
+ headerContent,
270945
+ headerBottom,
270946
+ contentTop,
270947
+ contentBottom,
270948
+ contentHeight,
270949
+ footerBoxTop,
270950
+ footerInput,
270951
+ footerBoxBottom,
270952
+ footerMetrics,
270953
+ scrollRegionTop: contentTop,
270954
+ scrollRegionBottom: contentBottom,
270955
+ footerHeight: fh,
270956
+ headerHeight: _headerHeight
270957
+ };
270958
+ }
270959
+ function setTermSize(rows, cols) {
270960
+ _termRows = rows;
270961
+ _termCols = cols;
270962
+ }
270963
+ function setFooterHeight(height) {
270964
+ _footerHeight = Math.max(FOOTER_MIN_ROWS, height);
270965
+ }
270966
+ function setHeaderHeight(height) {
270967
+ _headerHeight = Math.max(1, height);
270968
+ }
270969
+ function headerHeight() {
270970
+ return _headerHeight;
270971
+ }
270972
+ function termRows() {
270973
+ return _termRows;
270974
+ }
270975
+ function termCols() {
270976
+ return _termCols;
270977
+ }
270978
+ var HEADER_ROWS, FOOTER_MIN_ROWS, _termRows, _termCols, _footerHeight, _headerHeight;
270979
+ var init_layout2 = __esm({
270980
+ "packages/cli/dist/tui/layout.js"() {
270981
+ "use strict";
270982
+ HEADER_ROWS = 3;
270983
+ FOOTER_MIN_ROWS = 4;
270984
+ _termRows = 24;
270985
+ _termCols = 80;
270986
+ _footerHeight = FOOTER_MIN_ROWS;
270987
+ _headerHeight = HEADER_ROWS;
270988
+ }
270989
+ });
270990
+
270924
270991
  // packages/cli/dist/tui/render.js
270925
270992
  function accentFg() {
270926
270993
  const a2 = tuiAccent();
@@ -270972,7 +271039,7 @@ function getColorsEnabled() {
270972
271039
  return _colorsEnabled;
270973
271040
  }
270974
271041
  function getTermWidth() {
270975
- return process.stdout.columns ?? 80;
271042
+ return termCols();
270976
271043
  }
270977
271044
  function formatMarkdownLine(line) {
270978
271045
  const headingMatch = line.match(/^(#{1,6})\s+(.*)/);
@@ -271490,6 +271557,7 @@ var init_render = __esm({
271490
271557
  "packages/cli/dist/tui/render.js"() {
271491
271558
  "use strict";
271492
271559
  init_theme();
271560
+ init_layout2();
271493
271561
  isTTY2 = process.stdout.isTTY ?? false;
271494
271562
  c3 = {
271495
271563
  bold: (t2) => ansi2("1", t2),
@@ -278086,60 +278154,6 @@ var init_daemon_registry = __esm({
278086
278154
  }
278087
278155
  });
278088
278156
 
278089
- // packages/cli/dist/tui/layout.js
278090
- function layout() {
278091
- const rows = _termRows;
278092
- const cols = _termCols;
278093
- const fh = _footerHeight;
278094
- const headerTop = 1;
278095
- const headerContent = 2;
278096
- const headerBottom = 3;
278097
- const contentTop = headerBottom + 1;
278098
- const footerMetrics = rows;
278099
- const footerBoxBottom = footerMetrics - 1;
278100
- const footerBoxTop = rows - fh + 1;
278101
- const footerInput = footerBoxTop + 1;
278102
- const contentBottom = footerBoxTop - 1;
278103
- const contentHeight = Math.max(1, contentBottom - contentTop + 1);
278104
- return {
278105
- rows,
278106
- cols,
278107
- headerTop,
278108
- headerContent,
278109
- headerBottom,
278110
- contentTop,
278111
- contentBottom,
278112
- contentHeight,
278113
- footerBoxTop,
278114
- footerInput,
278115
- footerBoxBottom,
278116
- footerMetrics,
278117
- scrollRegionTop: contentTop,
278118
- scrollRegionBottom: contentBottom,
278119
- footerHeight: fh,
278120
- headerHeight: _headerHeight
278121
- };
278122
- }
278123
- function setTermSize(rows, cols) {
278124
- _termRows = rows;
278125
- _termCols = cols;
278126
- }
278127
- function setFooterHeight(height) {
278128
- _footerHeight = Math.max(FOOTER_MIN_ROWS, height);
278129
- }
278130
- var HEADER_ROWS, FOOTER_MIN_ROWS, _termRows, _termCols, _footerHeight, _headerHeight;
278131
- var init_layout2 = __esm({
278132
- "packages/cli/dist/tui/layout.js"() {
278133
- "use strict";
278134
- HEADER_ROWS = 3;
278135
- FOOTER_MIN_ROWS = 4;
278136
- _termRows = 24;
278137
- _termCols = 80;
278138
- _footerHeight = FOOTER_MIN_ROWS;
278139
- _headerHeight = HEADER_ROWS;
278140
- }
278141
- });
278142
-
278143
278157
  // packages/cli/dist/tui/status-bar.js
278144
278158
  var status_bar_exports = {};
278145
278159
  __export(status_bar_exports, {
@@ -278513,7 +278527,7 @@ var init_status_bar = __esm({
278513
278527
  refreshHeaderContent() {
278514
278528
  if (!this.active)
278515
278529
  return;
278516
- const w = process.stdout.columns ?? 80;
278530
+ const w = termCols();
278517
278531
  const innerW = w - 2;
278518
278532
  const panel = this._headerPanels[this._headerPanelIndex];
278519
278533
  if (!panel)
@@ -278522,14 +278536,15 @@ var init_status_bar = __esm({
278522
278536
  const hasMultiple = this._headerPanels.length > 1;
278523
278537
  const leftArrow = hasMultiple ? `\x1B]8;;oa-cmd:header-prev\x07\x1B[38;5;${TEXT_DIM}m${this._headerPanelIndex > 0 ? "\u25C0" : " "}\x1B]8;;\x07` : " ";
278524
278538
  const rightArrow = hasMultiple ? `\x1B]8;;oa-cmd:header-next\x07\x1B[38;5;${TEXT_DIM}m${this._headerPanelIndex < this._headerPanels.length - 1 ? "\u25B6" : " "}\x1B]8;;\x07` : " ";
278539
+ const hdrRow = layout().headerContent;
278525
278540
  let buf = "\x1B7";
278526
- buf += `\x1B[2;1H${PANEL_BG_SEQ}\x1B[2K`;
278541
+ buf += `\x1B[${hdrRow};1H${PANEL_BG_SEQ}\x1B[2K`;
278527
278542
  buf += `${BOX_FG}\u2502${RESET}${PANEL_BG_SEQ}`;
278528
278543
  buf += leftArrow;
278529
278544
  buf += ` `;
278530
278545
  buf += `\x1B[38;5;${TEXT_PRIMARY}m${PANEL_BG_SEQ}`;
278531
278546
  buf += content;
278532
- buf += `\x1B[2;${w - 2}H`;
278547
+ buf += `\x1B[${hdrRow};${w - 2}H`;
278533
278548
  buf += rightArrow;
278534
278549
  buf += ` ${BOX_FG}\u2502${RESET}`;
278535
278550
  buf += "\x1B8";
@@ -279101,8 +279116,8 @@ var init_status_bar = __esm({
279101
279116
  startedAt: Date.now()
279102
279117
  });
279103
279118
  }
279104
- this._prevTermRows = process.stdout.rows ?? 24;
279105
- this._prevTermCols = process.stdout.columns ?? 80;
279119
+ this._prevTermRows = termRows();
279120
+ this._prevTermCols = termCols();
279106
279121
  this.applyScrollRegion(true);
279107
279122
  this.fillContentArea();
279108
279123
  this.renderFooterAndPositionInput();
@@ -279125,8 +279140,7 @@ var init_status_bar = __esm({
279125
279140
  this._processing = false;
279126
279141
  }
279127
279142
  this.stopAllMetrics();
279128
- const rows = process.stdout.rows ?? 24;
279129
- this.termWrite(`\x1B[1;${rows}r`);
279143
+ this.termWrite(`\x1B[1;${termRows()}r`);
279130
279144
  }
279131
279145
  /** Whether the status bar is currently active */
279132
279146
  get isActive() {
@@ -279237,8 +279251,7 @@ var init_status_bar = __esm({
279237
279251
  }
279238
279252
  /** Handle mouse click on a suggestion row */
279239
279253
  suggestClickAt(row) {
279240
- const rows = process.stdout.rows ?? 24;
279241
- const pos = this.rowPositions(rows);
279254
+ const pos = this.rowPositions(termRows());
279242
279255
  if (pos.suggestStartRow <= 0 || this._suggestions.length === 0)
279243
279256
  return false;
279244
279257
  const idx = row - pos.suggestStartRow;
@@ -279394,7 +279407,7 @@ var init_status_bar = __esm({
279394
279407
  handlePointerEvent(type, col, row) {
279395
279408
  if (!this.active)
279396
279409
  return;
279397
- const w = process.stdout.columns ?? 80;
279410
+ const w = termCols();
279398
279411
  if (type === "press" && this._suggestions.length > 0) {
279399
279412
  if (this.suggestClickAt(row))
279400
279413
  return;
@@ -279429,8 +279442,7 @@ var init_status_bar = __esm({
279429
279442
  }
279430
279443
  return;
279431
279444
  }
279432
- const rows = process.stdout.rows ?? 24;
279433
- const pos = this.rowPositions(rows);
279445
+ const pos = this.rowPositions(termRows());
279434
279446
  if (type === "press" && pos.tabBarRow > 0 && row === pos.tabBarRow) {
279435
279447
  const viewId = this.hitTestTabBar(col);
279436
279448
  if (viewId)
@@ -279438,7 +279450,7 @@ var init_status_bar = __esm({
279438
279450
  return;
279439
279451
  }
279440
279452
  const fh = this._currentFooterHeight;
279441
- const footerStart = rows - fh + 1;
279453
+ const footerStart = termRows() - fh + 1;
279442
279454
  if (row >= footerStart)
279443
279455
  return;
279444
279456
  }
@@ -279449,8 +279461,7 @@ var init_status_bar = __esm({
279449
279461
  const ok = this._textSelection.copyToClipboard();
279450
279462
  this._textSelection.clear();
279451
279463
  this.repaintContent();
279452
- const rows = process.stdout.rows ?? 24;
279453
- const pos = this.rowPositions(rows);
279464
+ const pos = this.rowPositions(termRows());
279454
279465
  const writer = this._origWrite ?? process.stdout.write.bind(process.stdout);
279455
279466
  if (ok) {
279456
279467
  writer(`\x1B[${pos.metricsRow};1H\x1B[2K\x1B[38;5;${TEXT_PRIMARY}m \u2713 Copied to clipboard\x1B[0m`);
@@ -279466,8 +279477,7 @@ var init_status_bar = __esm({
279466
279477
  /** Arm block (rectangular) selection mode — next click starts block select */
279467
279478
  armBlockSelection() {
279468
279479
  this._textSelection.armBlockMode();
279469
- const rows = process.stdout.rows ?? 24;
279470
- const pos = this.rowPositions(rows);
279480
+ const pos = this.rowPositions(termRows());
279471
279481
  const writer = this._origWrite ?? process.stdout.write.bind(process.stdout);
279472
279482
  writer(`\x1B[${pos.metricsRow};1H\x1B[2K\x1B[38;5;${TEXT_PRIMARY}m \u25A0 Block selection mode \u2014 click and drag\x1B[0m`);
279473
279483
  setTimeout(() => {
@@ -279629,7 +279639,7 @@ var init_status_bar = __esm({
279629
279639
  * overlay UIs (tuiSelect, /expose dashboard, etc.) should use.
279630
279640
  */
279631
279641
  get availableContentRows() {
279632
- const rows = process.stdout.rows ?? 24;
279642
+ const rows = termRows();
279633
279643
  const usable = rows - (this.scrollRegionTop - 1) - this._currentFooterHeight;
279634
279644
  return Math.max(3, usable);
279635
279645
  }
@@ -279653,8 +279663,8 @@ var init_status_bar = __esm({
279653
279663
  const prevRows = this._prevTermRows;
279654
279664
  const prevCols = this._prevTermCols;
279655
279665
  this.updateFooterHeight();
279656
- const rows = process.stdout.rows ?? 24;
279657
- const cols = process.stdout.columns ?? 80;
279666
+ const rows = termRows();
279667
+ const cols = termCols();
279658
279668
  this._prevTermRows = rows;
279659
279669
  this._prevTermCols = cols;
279660
279670
  const pos = this.rowPositions(rows);
@@ -279782,12 +279792,11 @@ ${CONTENT_BG_SEQ}`);
279782
279792
  /** Record a content line for scrollback. Called by the stream renderer intercept. */
279783
279793
  /** Paint the entire content area with CONTENT_BG — called on activation and resize */
279784
279794
  fillContentArea() {
279785
- const rows = process.stdout.rows ?? 24;
279786
279795
  const h = this.contentHeight;
279787
279796
  let buf = "\x1B7\x1B[?25l";
279788
279797
  for (let r2 = 0; r2 < h; r2++) {
279789
279798
  const screenRow = this.scrollRegionTop + r2;
279790
- if (screenRow > rows)
279799
+ if (screenRow > termRows())
279791
279800
  break;
279792
279801
  buf += `\x1B[${screenRow};1H${CONTENT_BG_SEQ}\x1B[2K`;
279793
279802
  }
@@ -279825,8 +279834,7 @@ ${CONTENT_BG_SEQ}`);
279825
279834
  }
279826
279835
  /** Number of visible content rows */
279827
279836
  get contentHeight() {
279828
- const rows = process.stdout.rows ?? 24;
279829
- return Math.max(1, rows - (this.scrollRegionTop - 1) - this._currentFooterHeight);
279837
+ return Math.max(1, termRows() - (this.scrollRegionTop - 1) - this._currentFooterHeight);
279830
279838
  }
279831
279839
  /** Whether user has scrolled back from live */
279832
279840
  get isScrolledBack() {
@@ -279881,7 +279889,7 @@ ${CONTENT_BG_SEQ}`);
279881
279889
  const h = this.contentHeight;
279882
279890
  const totalLines = this._contentLines.length;
279883
279891
  const startIdx = Math.max(0, totalLines - h - this._contentScrollOffset);
279884
- const w = process.stdout.columns ?? 80;
279892
+ const w = termCols();
279885
279893
  let buf = "\x1B[?2026h";
279886
279894
  buf += "\x1B7";
279887
279895
  buf += "\x1B[?25l";
@@ -280277,25 +280285,21 @@ ${CONTENT_BG_SEQ}`);
280277
280285
  return 1 + 1 + inputLines + suggestionRows !== this._currentFooterHeight;
280278
280286
  }
280279
280287
  /** Compute absolute row positions for all footer elements.
280280
- * Layout (top to bottom): input suggestions/braille metrics.
280281
- * When suggestions are active, they replace the braille row and expand upward. */
280282
- rowPositions(rows) {
280283
- const fh = this._currentFooterHeight;
280288
+ * DELEGATES TO layout() the centralized layout manager.
280289
+ * This method exists for backward compatibility with the ~100 call sites
280290
+ * that use `pos.inputStartRow`, `pos.scrollEnd`, etc. */
280291
+ rowPositions(_rows) {
280292
+ setTermSize(process.stdout.rows ?? 24, process.stdout.columns ?? 80);
280293
+ setFooterHeight(this._currentFooterHeight);
280294
+ const L = layout();
280284
280295
  const hasSugg = this._suggestions.length > 0;
280285
- const suggestionAndBottomRows = hasSugg ? this._suggestions.length + 1 : 1;
280286
- const totalFooter = fh;
280287
- const metricsRow = rows;
280288
- const boxBottomRow = metricsRow - 1;
280289
- const suggestStartRow = hasSugg ? boxBottomRow - this._suggestions.length : -1;
280290
- const inputEndRow = hasSugg ? suggestStartRow - 1 : boxBottomRow - 1;
280291
- const inputStartRow = rows - totalFooter + 1;
280292
280296
  return {
280293
- scrollEnd: Math.max(inputStartRow - 1, this.scrollRegionTop + 1),
280294
- inputStartRow,
280297
+ scrollEnd: L.scrollRegionBottom,
280298
+ inputStartRow: L.footerBoxTop,
280295
280299
  tabBarRow: -1,
280296
- bufferRow: boxBottomRow,
280297
- suggestStartRow,
280298
- metricsRow,
280300
+ bufferRow: L.footerBoxBottom,
280301
+ suggestStartRow: hasSugg ? L.footerBoxBottom - this._suggestions.length : -1,
280302
+ metricsRow: L.footerMetrics,
280299
280303
  topSepRow: -1,
280300
280304
  bottomSepRow: -1
280301
280305
  };
@@ -280374,8 +280378,7 @@ ${CONTENT_BG_SEQ}`);
280374
280378
  /** Set the DECSTBM scroll region to exclude the dynamic footer rows */
280375
280379
  applyScrollRegion(clearScrollback = false) {
280376
280380
  this.updateFooterHeight();
280377
- const rows = process.stdout.rows ?? 24;
280378
- const pos = this.rowPositions(rows);
280381
+ const pos = this.rowPositions(termRows());
280379
280382
  this.termWrite(`\x1B[${this.scrollRegionTop};${pos.scrollEnd}r\x1B[${pos.scrollEnd};1H` + (clearScrollback ? "\x1B[3J" : ""));
280380
280383
  }
280381
280384
  /**
@@ -280390,7 +280393,7 @@ ${CONTENT_BG_SEQ}`);
280390
280393
  renderFooterAndPositionInput() {
280391
280394
  if (!this.active || this._resizing)
280392
280395
  return;
280393
- const rows = process.stdout.rows ?? 24;
280396
+ const rows = termRows();
280394
280397
  const w = getTermWidth();
280395
280398
  const oldFooterHeight = this._currentFooterHeight;
280396
280399
  const heightChanged = this.updateFooterHeight(w);
@@ -280479,9 +280482,8 @@ ${CONTENT_BG_SEQ}`);
280479
280482
  }
280480
280483
  return;
280481
280484
  }
280482
- const rows = process.stdout.rows ?? 24;
280483
280485
  const w = getTermWidth();
280484
- const pos = this.rowPositions(rows);
280486
+ const pos = this.rowPositions(termRows());
280485
280487
  let buf = "\x1B7\x1B[?7l";
280486
280488
  if (pos.tabBarRow > 0) {
280487
280489
  buf += `\x1B[${pos.tabBarRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}`;
@@ -280515,7 +280517,7 @@ ${CONTENT_BG_SEQ}`);
280515
280517
  renderInputRowDuringStream() {
280516
280518
  if (!this.active || this._resizing || !this.inputStateProvider)
280517
280519
  return;
280518
- const rows = process.stdout.rows ?? 24;
280520
+ const rows = termRows();
280519
280521
  const w = getTermWidth();
280520
280522
  const oldFooterHeight = this._currentFooterHeight;
280521
280523
  const heightChanged = this.updateFooterHeight(w);
@@ -280742,8 +280744,7 @@ ${CONTENT_BG_SEQ}`);
280742
280744
  const nextLines = Math.ceil((line.length + 1) / avail);
280743
280745
  if (nextLines > currentLines) {
280744
280746
  self2.updateFooterHeight();
280745
- const rows = process.stdout.rows ?? 24;
280746
- const pos = self2.rowPositions(rows);
280747
+ const pos = self2.rowPositions(termRows());
280747
280748
  const writer = self2._origWrite ?? process.stdout.write.bind(process.stdout);
280748
280749
  writer(`\x1B[${self2.scrollRegionTop};${pos.scrollEnd}r`);
280749
280750
  self2.renderFooterAndPositionInput();
@@ -284666,9 +284667,9 @@ async function startNeovimMode(opts) {
284666
284667
  const topOffset = opts.topOffset ?? 0;
284667
284668
  const ptyRows = Math.max(5, opts.contentRows);
284668
284669
  if (topOffset > 0 && isTTY5) {
284669
- const termRows = process.stdout.rows ?? 24;
284670
- const bottomBound = Math.min(termRows, topOffset + ptyRows);
284671
- process.stdout.write(`\x1B[${topOffset + 1};${bottomBound}r\x1B[${topOffset + 1};1H`);
284670
+ const L = layout();
284671
+ const bottomBound = Math.min(L.rows, topOffset + ptyRows);
284672
+ process.stdout.write(`\x1B[${L.contentTop};${bottomBound}r\x1B[${L.contentTop};1H`);
284672
284673
  }
284673
284674
  const initVimCmd = "let g:loaded_netrwPlugin=1 | let g:loaded_netrw=1 | set mouse=a autoread updatetime=300 signcolumn=no noswapfile | hi WinSeparator guifg=#000000 guibg=#000000 ctermfg=0 ctermbg=0 | hi VertSplit guifg=#000000 guibg=#000000 ctermfg=0 ctermbg=0 | hi StatusLine guifg=#bcbcbc guibg=#000000 ctermfg=250 ctermbg=0 | hi StatusLineNC guifg=#585858 guibg=#000000 ctermfg=240 ctermbg=0 | hi NeoTreeWinSeparator guifg=#000000 guibg=#000000 ctermfg=0 ctermbg=0";
284674
284675
  const luaBootstrap = "lua " + [
@@ -285057,8 +285058,7 @@ function doCleanup(state) {
285057
285058
  }
285058
285059
  }
285059
285060
  _state = null;
285060
- const termRows = process.stdout.rows ?? 24;
285061
- process.stdout.write(`\x1B[?1000l\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?1015l\x1B[?1004l\x1B[?2004l\x1B[1;${termRows}r\x1B[H\x1B[J`);
285061
+ process.stdout.write(`\x1B[?1000l\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?1015l\x1B[?1004l\x1B[?2004l\x1B[1;${termRows()}r\x1B[H\x1B[J`);
285062
285062
  state.opts.onExit?.();
285063
285063
  }
285064
285064
  var isTTY5, PTY_MODE_ENABLE_RE, STDIN_MOUSE_FOCUS_RE, _state;
@@ -285066,6 +285066,7 @@ var init_neovim_mode = __esm({
285066
285066
  "packages/cli/dist/tui/neovim-mode.js"() {
285067
285067
  "use strict";
285068
285068
  init_setup();
285069
+ init_layout2();
285069
285070
  isTTY5 = process.stdout.isTTY ?? false;
285070
285071
  PTY_MODE_ENABLE_RE = /\x1B\[\?(?:1004|2004)h/g;
285071
285072
  STDIN_MOUSE_FOCUS_RE = /\x1B\[<[\d;]+[Mm]|\x1B\[M[\s\S]{3}|\x1B\[[IO]|\x1BO[ABCD]/g;
@@ -291098,14 +291099,15 @@ Clone a new voice: /voice clone <wav-file> [name]`);
291098
291099
  renderInfo("Neovim mode stopped. Main waterfall restored.");
291099
291100
  } else {
291100
291101
  ctx3.retireCarousel?.();
291101
- const contentRows = ctx3.availableContentRows?.() ?? Math.max(5, (process.stdout.rows ?? 24) - 6);
291102
- const cols = process.stdout.columns ?? 80;
291102
+ const L = layout();
291103
+ const contentRows = ctx3.availableContentRows?.() ?? Math.max(5, L.contentHeight);
291104
+ const cols = termCols();
291103
291105
  const err = await startNeovimMode({
291104
291106
  cwd: ctx3.repoRoot,
291105
291107
  contentRows,
291106
291108
  cols,
291107
- topOffset: 3,
291108
- // start below 3-row banner
291109
+ topOffset: headerHeight(),
291110
+ // start below header (banner/carousel)
291109
291111
  rl: ctx3.rl,
291110
291112
  initialFile: arg || void 0,
291111
291113
  onExit: () => {
@@ -294898,8 +294900,8 @@ async function showExposeDashboard(gateway, rl, ctx3) {
294898
294900
  }
294899
294901
  return;
294900
294902
  }
294901
- const cols = () => process.stdout.columns ?? 80;
294902
- const rows = () => process.stdout.rows ?? 24;
294903
+ const cols = () => termCols();
294904
+ const rows = () => termRows();
294903
294905
  const peerLedColor = (peerIdx) => {
294904
294906
  const stops = [51, 81, 111, 141, 171, 201];
294905
294907
  const code8 = stops[Math.min(peerIdx, stops.length - 1)] ?? 51;
@@ -296206,6 +296208,7 @@ var isTTY6, PHRASES, Carousel;
296206
296208
  var init_carousel = __esm({
296207
296209
  "packages/cli/dist/tui/carousel.js"() {
296208
296210
  "use strict";
296211
+ init_layout2();
296209
296212
  isTTY6 = process.stdout.isTTY ?? false;
296210
296213
  PHRASES = [
296211
296214
  // English
@@ -296289,7 +296292,7 @@ var init_carousel = __esm({
296289
296292
  started = false;
296290
296293
  resizeHandler = null;
296291
296294
  constructor(customPhrases) {
296292
- this.width = process.stdout.columns ?? 80;
296295
+ this.width = termCols();
296293
296296
  const bank = customPhrases && customPhrases.length > 0 ? customPhrases : PHRASES;
296294
296297
  const indices0 = Array.from({ length: bank.length }, (_, i2) => i2).sort(() => Math.random() - 0.5);
296295
296298
  const indices1 = Array.from({ length: bank.length }, (_, i2) => i2).sort(() => Math.random() - 0.5);
@@ -296318,15 +296321,16 @@ var init_carousel = __esm({
296318
296321
  if (!isTTY6)
296319
296322
  return 0;
296320
296323
  this.started = true;
296321
- const termRows = process.stdout.rows ?? 24;
296322
- process.stdout.write("\x1B[1;1H");
296324
+ setHeaderHeight(this.reservedRows);
296325
+ const L = layout();
296326
+ process.stdout.write(`\x1B[${L.headerTop};1H`);
296323
296327
  for (let i2 = 0; i2 < this.reservedRows; i2++) {
296324
296328
  process.stdout.write("\x1B[2K\n");
296325
296329
  }
296326
- process.stdout.write(`\x1B[${this.reservedRows + 1};${termRows}r`);
296327
- process.stdout.write(`\x1B[${this.reservedRows + 1};1H`);
296330
+ process.stdout.write(`\x1B[${L.contentTop};${L.rows}r`);
296331
+ process.stdout.write(`\x1B[${L.contentTop};1H`);
296328
296332
  this.resizeHandler = () => {
296329
- this.width = process.stdout.columns ?? 80;
296333
+ this.width = termCols();
296330
296334
  this.rebuildRibbons();
296331
296335
  };
296332
296336
  process.stdout.on("resize", this.resizeHandler);
@@ -296349,13 +296353,14 @@ var init_carousel = __esm({
296349
296353
  renderFrame() {
296350
296354
  if (!isTTY6)
296351
296355
  return;
296356
+ const L = layout();
296352
296357
  let buf = "\x1B7";
296353
296358
  buf += "\x1B[?7l";
296354
296359
  for (let i2 = 0; i2 < this.rows.length; i2++) {
296355
296360
  const line = this.extractWindow(this.rows[i2]);
296356
- buf += `\x1B[${i2 + 1};1H\x1B[2K${line}`;
296361
+ buf += `\x1B[${L.headerTop + i2};1H\x1B[2K${line}`;
296357
296362
  }
296358
- buf += `\x1B[4;1H\x1B[2K`;
296363
+ buf += `\x1B[${L.headerBottom};1H\x1B[2K`;
296359
296364
  buf += "\x1B[?7h";
296360
296365
  buf += "\x1B8";
296361
296366
  process.stdout.write(buf);
@@ -296429,10 +296434,12 @@ var init_carousel = __esm({
296429
296434
  }
296430
296435
  if (!isTTY6 || !this.started)
296431
296436
  return;
296437
+ const L = layout();
296432
296438
  let buf = "\x1B7";
296433
296439
  for (let i2 = 0; i2 < this.reservedRows; i2++) {
296434
- buf += `\x1B[${i2 + 1};1H\x1B[2K`;
296440
+ buf += `\x1B[${L.headerTop + i2};1H\x1B[2K`;
296435
296441
  }
296442
+ setHeaderHeight(HEADER_ROWS);
296436
296443
  buf += "\x1B[r";
296437
296444
  buf += "\x1B8";
296438
296445
  process.stdout.write(buf);
@@ -296485,8 +296492,8 @@ function getNodeMnemonic() {
296485
296492
  }
296486
296493
  }
296487
296494
  function createDefaultBanner(version4 = "0.120.0") {
296488
- const width = process.stdout.columns ?? 80;
296489
- const rows = 3;
296495
+ const width = termCols();
296496
+ const rows = headerHeight();
296490
296497
  const yellow = tuiAccent() < 0 ? -1 : tuiAccent();
296491
296498
  const bgBlack = tuiBg() < 0 ? -1 : tuiBg();
296492
296499
  const grid = [];
@@ -296526,8 +296533,8 @@ function createDefaultBanner(version4 = "0.120.0") {
296526
296533
  };
296527
296534
  }
296528
296535
  function createCohereBanner() {
296529
- const width = process.stdout.columns ?? 80;
296530
- const rows = 3;
296536
+ const width = termCols();
296537
+ const rows = headerHeight();
296531
296538
  const grid = [];
296532
296539
  const bgColor = 0;
296533
296540
  const fgColor = 226;
@@ -296560,8 +296567,8 @@ function createCohereBanner() {
296560
296567
  };
296561
296568
  }
296562
296569
  function createSponsorBanner(sponsorName, tagline, primaryColor = 214, bgColor = 0) {
296563
- const width = process.stdout.columns ?? 80;
296564
- const rows = 3;
296570
+ const width = termCols();
296571
+ const rows = headerHeight();
296565
296572
  const grid = [];
296566
296573
  for (let r2 = 0; r2 < rows; r2++) {
296567
296574
  const row = [];
@@ -296646,7 +296653,7 @@ function fillGridRegion(grid, startRow, startCol, endRow, endCol, cell) {
296646
296653
  }
296647
296654
  }
296648
296655
  function createAnimatedBanner(id, name10, frameBuilders, frameDurationMs, author = "user") {
296649
- const width = process.stdout.columns ?? 80;
296656
+ const width = termCols();
296650
296657
  return {
296651
296658
  id,
296652
296659
  name: name10,
@@ -296666,6 +296673,7 @@ var init_banner = __esm({
296666
296673
  "packages/cli/dist/tui/banner.js"() {
296667
296674
  "use strict";
296668
296675
  init_theme();
296676
+ init_layout2();
296669
296677
  isTTY7 = process.stdout.isTTY ?? false;
296670
296678
  MNEMONIC_ADJECTIVES = [
296671
296679
  "swift",
@@ -296757,7 +296765,9 @@ var init_banner = __esm({
296757
296765
  timer = null;
296758
296766
  frameTick = 0;
296759
296767
  width;
296760
- rows = 3;
296768
+ get rows() {
296769
+ return headerHeight();
296770
+ }
296761
296771
  /** Callback fired after every frame render — used for header button overlay */
296762
296772
  onAfterRender = null;
296763
296773
  /** When set, the version text on row 1 becomes a pulsing UPDATE button */
@@ -296767,7 +296777,7 @@ var init_banner = __esm({
296767
296777
  /** Whether header zone is focused (Ctrl+Tab highlight) */
296768
296778
  _focused = false;
296769
296779
  constructor() {
296770
- this.width = process.stdout.columns ?? 80;
296780
+ this.width = termCols();
296771
296781
  }
296772
296782
  /** Signal that an update is available — enables pulsing UPDATE badge on row 1 */
296773
296783
  setUpdateAvailable(latestVersion) {
@@ -296791,7 +296801,7 @@ var init_banner = __esm({
296791
296801
  this.currentDesign = design;
296792
296802
  this.currentFrame = 0;
296793
296803
  this.frameTick = 0;
296794
- this.width = process.stdout.columns ?? 80;
296804
+ this.width = termCols();
296795
296805
  }
296796
296806
  /** Get current design */
296797
296807
  getDesign() {
@@ -296808,7 +296818,7 @@ var init_banner = __esm({
296808
296818
  } else if (this.currentDesign.type === "cohere") {
296809
296819
  this.currentDesign = createCohereBanner();
296810
296820
  }
296811
- this.width = process.stdout.columns ?? 80;
296821
+ this.width = termCols();
296812
296822
  this.renderCurrentFrame();
296813
296823
  }
296814
296824
  /**
@@ -296822,7 +296832,7 @@ var init_banner = __esm({
296822
296832
  return 0;
296823
296833
  this.renderCurrentFrame();
296824
296834
  this._resizeHandler = () => {
296825
- this.width = process.stdout.columns ?? 80;
296835
+ this.width = termCols();
296826
296836
  if (this.currentDesign) {
296827
296837
  if (this.currentDesign.type === "default") {
296828
296838
  const version4 = this.currentDesign.version ?? "0.0.0";
@@ -296830,8 +296840,8 @@ var init_banner = __esm({
296830
296840
  } else if (this.currentDesign.type === "cohere") {
296831
296841
  this.currentDesign = createCohereBanner();
296832
296842
  }
296833
- const newRows = process.stdout.rows ?? 24;
296834
- process.stdout.write(`\x1B[${this.rows + 2};${newRows}r`);
296843
+ const L = layout();
296844
+ process.stdout.write(`\x1B[${L.contentTop};${L.rows}r`);
296835
296845
  this.renderCurrentFrame();
296836
296846
  }
296837
296847
  };
@@ -296864,10 +296874,11 @@ var init_banner = __esm({
296864
296874
  const frame = this.currentDesign.frames[this.currentFrame];
296865
296875
  if (!frame)
296866
296876
  return;
296867
- this.width = process.stdout.columns ?? 80;
296877
+ this.width = termCols();
296868
296878
  let buf = "\x1B[?2026h";
296879
+ const L = layout();
296869
296880
  for (let r2 = 0; r2 < this.rows; r2++) {
296870
- buf += `\x1B[${r2 + 1};1H${tuiBg() >= 0 ? `\x1B[48;5;${tuiBg()}m` : "\x1B[49m"}\x1B[2K`;
296881
+ buf += `\x1B[${L.headerTop + r2};1H${tuiBg() >= 0 ? `\x1B[48;5;${tuiBg()}m` : "\x1B[49m"}\x1B[2K`;
296871
296882
  const row = frame.grid[r2];
296872
296883
  if (!row)
296873
296884
  continue;
@@ -296902,16 +296913,15 @@ var init_banner = __esm({
296902
296913
  }
296903
296914
  if (this.onAfterRender)
296904
296915
  this.onAfterRender();
296905
- const termRows = process.stdout.rows ?? 24;
296906
- const inputRow = termRows - 2;
296916
+ const Lp = layout();
296907
296917
  try {
296908
- process.stdout.write(`\x1B[${inputRow};1H\x1B[?2026l`);
296918
+ process.stdout.write(`\x1B[${Lp.footerInput};1H\x1B[?2026l`);
296909
296919
  } catch {
296910
296920
  }
296911
296921
  }
296912
296922
  /** Handle terminal resize */
296913
296923
  handleResize() {
296914
- this.width = process.stdout.columns ?? 80;
296924
+ this.width = termCols();
296915
296925
  if (this.currentDesign) {
296916
296926
  if (this.currentDesign.type === "cohere") {
296917
296927
  this.currentDesign = createCohereBanner();
@@ -308772,10 +308782,11 @@ async function startInteractive(config, repoPath) {
308772
308782
  }
308773
308783
  let restoredSessionContext = null;
308774
308784
  if (process.stdout.isTTY) {
308785
+ setTermSize(process.stdout.rows ?? 24, process.stdout.columns ?? 80);
308775
308786
  process.stdout.write("\x1B[2J\x1B[3J\x1B]50;ClearScrollback\x07\x1B[H");
308776
308787
  process.stdout.write("\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?1015l\x1B[?1049h" + // enter alternate screen buffer
308777
308788
  tuiBgSeq() + // theme bg for content area
308778
- `\x1B[2J\x1B[3J\x1B[H\x1B[1;${process.stdout.rows ?? 24}r\x1B[?25l`);
308789
+ `\x1B[2J\x1B[3J\x1B[H\x1B[1;${termRows()}r\x1B[?25l`);
308779
308790
  const restoreScreen = () => {
308780
308791
  process.stdout.write("\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?1015l\x1B[?25h\x1B[?1049l");
308781
308792
  };
@@ -309474,9 +309485,8 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
309474
309485
  const { MouseFilterStream: MouseFilterStream2 } = await Promise.resolve().then(() => (init_mouse_filter(), mouse_filter_exports));
309475
309486
  let origTtyWriteRef = null;
309476
309487
  const mouseFilter = new MouseFilterStream2((direction, lines, row) => {
309477
- const rows = process.stdout.rows ?? 24;
309478
309488
  const fh = statusBar._currentFooterHeight ?? 3;
309479
- const footerStart = rows - fh + 1;
309489
+ const footerStart = termRows() - fh + 1;
309480
309490
  if (row >= footerStart) {
309481
309491
  const arrowKey = direction === "up" ? { name: "up" } : { name: "down" };
309482
309492
  const arrowSeq = direction === "up" ? "\x1B[A" : "\x1B[B";
@@ -309594,14 +309604,15 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
309594
309604
  }
309595
309605
  process.stdout.on("resize", () => {
309596
309606
  statusBar.handleResize();
309607
+ setTermSize(process.stdout.rows ?? 24, process.stdout.columns ?? 80);
309597
309608
  if (isNeovimActive()) {
309598
- const contentRows = statusBar.isActive ? statusBar.availableContentRows : Math.max(5, (process.stdout.rows ?? 24) - 6);
309599
- resizeNeovim(process.stdout.columns ?? 80, contentRows);
309609
+ const contentRows = statusBar.isActive ? statusBar.availableContentRows : Math.max(5, termRows() - 6);
309610
+ resizeNeovim(termCols(), contentRows);
309600
309611
  }
309601
309612
  if (!carouselRetired && !isNeovimActive()) {
309602
- const termRows = process.stdout.rows ?? 24;
309613
+ const tr = termRows();
309603
309614
  const scrollStart = carousel.reservedRows + 1;
309604
- const scrollEnd = Math.max(termRows - statusBar.reservedRows, scrollStart + 1);
309615
+ const scrollEnd = Math.max(tr - statusBar.reservedRows, scrollStart + 1);
309605
309616
  let clearBuf = "";
309606
309617
  for (let r2 = scrollStart; r2 <= scrollEnd; r2++) {
309607
309618
  clearBuf += `\x1B[${r2};1H\x1B[2K`;
@@ -311210,7 +311221,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
311210
311221
  return true;
311211
311222
  },
311212
311223
  availableContentRows() {
311213
- return statusBar.isActive ? statusBar.availableContentRows : Math.max(3, (process.stdout.rows ?? 24) - 6);
311224
+ return statusBar.isActive ? statusBar.availableContentRows : Math.max(3, termRows() - 6);
311214
311225
  },
311215
311226
  showPrompt() {
311216
311227
  showPrompt();
@@ -312550,6 +312561,7 @@ var init_interactive = __esm({
312550
312561
  init_config();
312551
312562
  init_updater();
312552
312563
  init_commands();
312564
+ init_layout2();
312553
312565
  init_setup();
312554
312566
  init_model_picker();
312555
312567
  init_project_context();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.76",
3
+ "version": "0.187.78",
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",