open-agents-ai 0.138.94 → 0.138.96

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 +50 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -38556,8 +38556,14 @@ async function startNeovimMode(opts) {
38556
38556
  } catch {
38557
38557
  }
38558
38558
  const ptyCols = opts.cols;
38559
+ const topOffset = opts.topOffset ?? 0;
38559
38560
  const ptyRows = Math.max(5, opts.contentRows);
38560
- const initVimCmd = "let g:loaded_netrwPlugin=1 | let g:loaded_netrw=1 | set mouse= autoread updatetime=300 signcolumn=no noswapfile";
38561
+ if (topOffset > 0 && isTTY5) {
38562
+ const termRows = process.stdout.rows ?? 24;
38563
+ const bottomBound = Math.min(termRows, topOffset + ptyRows);
38564
+ process.stdout.write(`\x1B[${topOffset + 1};${bottomBound}r\x1B[${topOffset + 1};1H`);
38565
+ }
38566
+ const initVimCmd = "let g:loaded_netrwPlugin=1 | let g:loaded_netrw=1 | set mouse=a autoread updatetime=300 signcolumn=no noswapfile | hi WinSeparator guifg=#1c1c1c guibg=#1c1c1c ctermfg=234 ctermbg=234 | hi VertSplit guifg=#1c1c1c guibg=#1c1c1c ctermfg=234 ctermbg=234 | hi StatusLine guifg=#bcbcbc guibg=#1c1c1c ctermfg=250 ctermbg=234 | hi StatusLineNC guifg=#585858 guibg=#1c1c1c ctermfg=240 ctermbg=234 | hi NeoTreeWinSeparator guifg=#1c1c1c guibg=#1c1c1c ctermfg=234 ctermbg=234";
38561
38567
  const luaBootstrap = "lua " + [
38562
38568
  'local lp = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"',
38563
38569
  'if not vim.loop.fs_stat(lp) then pcall(vim.fn.system, {"git", "clone", "--filter=blob:none", "--depth=1", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lp}) end',
@@ -38600,17 +38606,30 @@ async function startNeovimMode(opts) {
38600
38606
  cleanedUp: false
38601
38607
  };
38602
38608
  _state = state;
38609
+ const backLabel = " \u2190 back ";
38610
+ const backStartCol = 2;
38611
+ const backEndCol = backStartCol + backLabel.length - 1;
38612
+ function renderBackButton() {
38613
+ if (!isTTY5)
38614
+ return;
38615
+ process.stdout.write(`\x1B7\x1B[1;${backStartCol}H\x1B]8;;oa-cmd:back\x07\x1B[38;5;245m\x1B[48;5;236m${backLabel}\x1B]8;;\x07\x1B[0m\x1B8`);
38616
+ }
38617
+ renderBackButton();
38603
38618
  nvimPty.onData((data) => {
38604
38619
  if (state.cleanedUp)
38605
38620
  return;
38606
- const filtered = data.replace(PTY_MODE_ENABLE_RE, "");
38621
+ let filtered = data.replace(PTY_MODE_ENABLE_RE, "");
38607
38622
  if (!filtered)
38608
38623
  return;
38624
+ if (topOffset > 0) {
38625
+ filtered = filtered.replace(/\x1B\[(\d+)(;\d+)?H/g, (_m, row, col) => `\x1B[${parseInt(row) + topOffset}${col ?? ""}H`);
38626
+ }
38609
38627
  if (!state.focused) {
38610
38628
  process.stdout.write("\x1B7" + filtered + "\x1B8");
38611
38629
  } else {
38612
38630
  process.stdout.write(filtered);
38613
38631
  }
38632
+ renderBackButton();
38614
38633
  });
38615
38634
  nvimPty.onExit(() => {
38616
38635
  if (!state.cleanedUp) {
@@ -38643,9 +38662,31 @@ async function startNeovimMode(opts) {
38643
38662
  toggleFocus(state);
38644
38663
  return;
38645
38664
  }
38665
+ const backClick = seq.match(/\x1B\[<0;(\d+);1M/);
38666
+ if (backClick) {
38667
+ const clickCol = parseInt(backClick[1]);
38668
+ if (clickCol >= backStartCol && clickCol <= backEndCol) {
38669
+ doCleanup(state);
38670
+ return;
38671
+ }
38672
+ }
38646
38673
  if (state.focused) {
38647
- const normalized = seq.replace(/\x1BO([ABCD])/g, "\x1B[$1");
38648
- nvimPty.write(normalized);
38674
+ let normalized = seq.replace(/\x1BO([ABCD])/g, "\x1B[$1");
38675
+ if (topOffset > 0) {
38676
+ normalized = normalized.replace(/\x1B\[<(\d+);(\d+);(\d+)([Mm])/g, (_m, btn, col, row, suffix) => {
38677
+ const hostRow = parseInt(row);
38678
+ if (parseInt(btn) === 0 && suffix === "M" && hostRow > topOffset + ptyRows) {
38679
+ toggleFocus(state);
38680
+ return "";
38681
+ }
38682
+ if (hostRow <= topOffset)
38683
+ return "";
38684
+ const nvimRow = hostRow - topOffset;
38685
+ return `\x1B[<${btn};${col};${nvimRow}${suffix}`;
38686
+ });
38687
+ }
38688
+ if (normalized)
38689
+ nvimPty.write(normalized);
38649
38690
  }
38650
38691
  };
38651
38692
  stdin.on("data", state.stdinHandler);
@@ -38873,7 +38914,8 @@ function doCleanup(state) {
38873
38914
  }
38874
38915
  }
38875
38916
  _state = null;
38876
- process.stdout.write("\x1B[?1000l\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?1015l\x1B[?1004l\x1B[?2004l\x1B[H\x1B[J");
38917
+ const termRows = process.stdout.rows ?? 24;
38918
+ 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`);
38877
38919
  state.opts.onExit?.();
38878
38920
  }
38879
38921
  var isTTY5, PTY_MODE_ENABLE_RE, STDIN_MOUSE_FOCUS_RE, _state;
@@ -38882,7 +38924,7 @@ var init_neovim_mode = __esm({
38882
38924
  "use strict";
38883
38925
  init_setup();
38884
38926
  isTTY5 = process.stdout.isTTY ?? false;
38885
- PTY_MODE_ENABLE_RE = /\x1B\[\?(?:1000|1002|1003|1004|1005|1006|1015|2004)h/g;
38927
+ PTY_MODE_ENABLE_RE = /\x1B\[\?(?:1004|2004)h/g;
38886
38928
  STDIN_MOUSE_FOCUS_RE = /\x1B\[<[\d;]+[Mm]|\x1B\[M[\s\S]{3}|\x1B\[[IO]|\x1BO[ABCD]/g;
38887
38929
  _state = null;
38888
38930
  }
@@ -42203,6 +42245,8 @@ async function handleSlashCommand(input, ctx) {
42203
42245
  cwd: ctx.repoRoot,
42204
42246
  contentRows,
42205
42247
  cols,
42248
+ topOffset: 3,
42249
+ // start below 3-row banner
42206
42250
  rl: ctx.rl,
42207
42251
  initialFile: arg || void 0,
42208
42252
  onExit: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.138.94",
3
+ "version": "0.138.96",
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",