open-agents-ai 0.104.13 → 0.104.15

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 +111 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -27085,31 +27085,56 @@ function setContentWriteHook(hook) {
27085
27085
  _contentWriteHook = hook;
27086
27086
  }
27087
27087
  function renderError(message) {
27088
- _contentWriteHook?.begin();
27088
+ const redir = _contentWriteHook?.redirect?.();
27089
27089
  const icon = _emojisEnabled ? c2.red("\u2716") : c2.red("E");
27090
+ if (redir) {
27091
+ redir(`
27092
+ ${icon} ${message}
27093
+ `);
27094
+ return;
27095
+ }
27096
+ _contentWriteHook?.begin();
27090
27097
  process.stdout.write(`
27091
27098
  ${icon} ${message}
27092
27099
  `);
27093
27100
  _contentWriteHook?.end();
27094
27101
  }
27095
27102
  function renderInfo(message) {
27096
- _contentWriteHook?.begin();
27103
+ const redir = _contentWriteHook?.redirect?.();
27097
27104
  const icon = _emojisEnabled ? c2.cyan("\u2139") : c2.cyan("i");
27105
+ if (redir) {
27106
+ redir(`${icon} ${message}
27107
+ `);
27108
+ return;
27109
+ }
27110
+ _contentWriteHook?.begin();
27098
27111
  process.stdout.write(`${icon} ${message}
27099
27112
  `);
27100
27113
  _contentWriteHook?.end();
27101
27114
  }
27102
27115
  function renderWarning(message) {
27103
- _contentWriteHook?.begin();
27116
+ const redir = _contentWriteHook?.redirect?.();
27104
27117
  const icon = _emojisEnabled ? c2.yellow("\u26A0") : c2.yellow("!");
27118
+ if (redir) {
27119
+ redir(`${icon} ${message}
27120
+ `);
27121
+ return;
27122
+ }
27123
+ _contentWriteHook?.begin();
27105
27124
  process.stdout.write(`${icon} ${message}
27106
27125
  `);
27107
27126
  _contentWriteHook?.end();
27108
27127
  }
27109
27128
  function renderVerbose(message) {
27129
+ const redir = _contentWriteHook?.redirect?.();
27130
+ const text = `${c2.dim(` > ${message}`)}
27131
+ `;
27132
+ if (redir) {
27133
+ redir(text);
27134
+ return;
27135
+ }
27110
27136
  _contentWriteHook?.begin();
27111
- process.stdout.write(`${c2.dim(` > ${message}`)}
27112
- `);
27137
+ process.stdout.write(text);
27113
27138
  _contentWriteHook?.end();
27114
27139
  }
27115
27140
  function renderRichHeader(opts) {
@@ -34583,7 +34608,10 @@ async function startNeovimMode(opts) {
34583
34608
  'local lp = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"',
34584
34609
  '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',
34585
34610
  "vim.opt.rtp:prepend(lp)",
34586
- 'pcall(function() require("lazy").setup({{"nvim-neo-tree/neo-tree.nvim", branch="v3.x", dependencies={"nvim-lua/plenary.nvim","MunifTanjim/nui.nvim"},config=function() require("neo-tree").setup({close_if_last_window=true,filesystem={follow_current_file={enabled=true},use_libuv_file_watcher=true,hijack_netrw_behavior="disabled"},window={position="left",width=30}}) end}},{install={colorscheme={}},checker={enabled=false}}) end)'
34611
+ 'pcall(function() require("lazy").setup({{"nvim-neo-tree/neo-tree.nvim", branch="v3.x", lazy=false, dependencies={"nvim-lua/plenary.nvim","MunifTanjim/nui.nvim","nvim-tree/nvim-web-devicons"},config=function() require("neo-tree").setup({close_if_last_window=true,enable_git_status=true,filesystem={follow_current_file={enabled=true},use_libuv_file_watcher=true,hijack_netrw_behavior="open_default",filtered_items={hide_dotfiles=false,hide_gitignored=false}},window={position="left",width=30}}) end}},{install={colorscheme={}},checker={enabled=false}}) end)',
34612
+ // Open neo-tree sidebar after lazy.nvim finishes loading (needs short defer).
34613
+ // Uses pcall so a missing/broken neo-tree doesn't block the editor.
34614
+ 'vim.defer_fn(function() pcall(vim.cmd, "Neotree show") end, 300)'
34587
34615
  ].join("; ");
34588
34616
  const nvimArgs = [
34589
34617
  "--listen",
@@ -34807,10 +34835,10 @@ function toggleFocus(state) {
34807
34835
  if (state.opts.rl) {
34808
34836
  try {
34809
34837
  state.opts.rl.resume();
34810
- state.opts.rl.prompt(false);
34811
34838
  } catch {
34812
34839
  }
34813
34840
  }
34841
+ state.opts.onFocusToTUI?.();
34814
34842
  } else {
34815
34843
  state.focused = true;
34816
34844
  if (state.opts.rl) {
@@ -37990,7 +38018,8 @@ async function handleSlashCommand(input, ctx) {
37990
38018
  initialFile: arg || void 0,
37991
38019
  onExit: () => {
37992
38020
  renderInfo("Neovim mode exited.");
37993
- }
38021
+ },
38022
+ onFocusToTUI: ctx.showPrompt
37994
38023
  });
37995
38024
  if (err) {
37996
38025
  renderError(err);
@@ -49364,6 +49393,22 @@ ${entry.fullContent}`
49364
49393
  let streamStartMs = 0;
49365
49394
  let streamTextBuffer = "";
49366
49395
  const contentWrite = (fn) => {
49396
+ if (isNeovimActive()) {
49397
+ const origWrite = process.stdout.write;
49398
+ let captured = "";
49399
+ process.stdout.write = ((chunk) => {
49400
+ captured += typeof chunk === "string" ? chunk : Buffer.isBuffer(chunk) ? chunk.toString() : "";
49401
+ return true;
49402
+ });
49403
+ try {
49404
+ fn();
49405
+ } finally {
49406
+ process.stdout.write = origWrite;
49407
+ }
49408
+ if (captured)
49409
+ writeToNeovimOutput(captured);
49410
+ return;
49411
+ }
49367
49412
  if (isOverlayActive()) {
49368
49413
  const origWrite = process.stdout.write;
49369
49414
  const chunks = [];
@@ -49788,7 +49833,10 @@ async function startInteractive(config, repoPath) {
49788
49833
  statusBar.activate(scrollTop);
49789
49834
  setContentWriteHook({
49790
49835
  begin: () => statusBar.beginContentWrite(),
49791
- end: () => statusBar.endContentWrite()
49836
+ end: () => statusBar.endContentWrite(),
49837
+ // When neovim is active, redirect all render output to the Agent Output
49838
+ // pane instead of writing to stdout (which would push the PTY upward).
49839
+ redirect: () => isNeovimActive() ? writeToNeovimOutput : null
49792
49840
  });
49793
49841
  }
49794
49842
  let resolvedContextWindowSize = 0;
@@ -50180,6 +50228,22 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
50180
50228
  }
50181
50229
  }
50182
50230
  function writeContent(fn) {
50231
+ if (isNeovimActive()) {
50232
+ const origWrite = process.stdout.write;
50233
+ let captured = "";
50234
+ process.stdout.write = ((chunk) => {
50235
+ captured += typeof chunk === "string" ? chunk : Buffer.isBuffer(chunk) ? chunk.toString() : "";
50236
+ return true;
50237
+ });
50238
+ try {
50239
+ fn();
50240
+ } finally {
50241
+ process.stdout.write = origWrite;
50242
+ }
50243
+ if (captured)
50244
+ writeToNeovimOutput(captured);
50245
+ return;
50246
+ }
50183
50247
  if (isOverlayActive()) {
50184
50248
  const origWrite = process.stdout.write;
50185
50249
  const chunks = [];
@@ -50335,7 +50399,11 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
50335
50399
  }
50336
50400
  sudoPromptPending = true;
50337
50401
  const sudoPromptStr = ` ${c2.bold(c2.yellow("\u{1F511} Password:"))} `;
50338
- process.stdout.write(sudoPromptStr);
50402
+ if (isNeovimActive()) {
50403
+ writeToNeovimOutput(sudoPromptStr);
50404
+ } else {
50405
+ process.stdout.write(sudoPromptStr);
50406
+ }
50339
50407
  }
50340
50408
  async function handleAskUser(question, options, allowMultiple) {
50341
50409
  if (statusBar?.isActive)
@@ -51084,7 +51152,12 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
51084
51152
  const exposeFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
51085
51153
  let exposeFrame = 0;
51086
51154
  const exposeSpinner = setInterval(() => {
51087
- process.stdout.write(`\r ${c2.cyan(exposeFrames[exposeFrame % exposeFrames.length])} ${c2.dim(exposeSpinnerMsg)}`);
51155
+ if (isNeovimActive()) {
51156
+ writeToNeovimOutput(`${c2.cyan(exposeFrames[exposeFrame % exposeFrames.length])} ${c2.dim(exposeSpinnerMsg)}\r
51157
+ `);
51158
+ } else {
51159
+ process.stdout.write(`\r ${c2.cyan(exposeFrames[exposeFrame % exposeFrames.length])} ${c2.dim(exposeSpinnerMsg)}`);
51160
+ }
51088
51161
  exposeFrame++;
51089
51162
  }, 80);
51090
51163
  const newP2P = new ExposeP2PGateway({
@@ -51113,7 +51186,8 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
51113
51186
  try {
51114
51187
  const peerId = await newP2P.start();
51115
51188
  clearInterval(exposeSpinner);
51116
- process.stdout.write(`\r\x1B[2K`);
51189
+ if (!isNeovimActive())
51190
+ process.stdout.write(`\r\x1B[2K`);
51117
51191
  p2pGateway = newP2P;
51118
51192
  writeContent(() => {
51119
51193
  process.stdout.write("\n" + newP2P.formatConnectionInfo() + "\n\n");
@@ -51121,7 +51195,8 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
51121
51195
  return peerId;
51122
51196
  } catch (err) {
51123
51197
  clearInterval(exposeSpinner);
51124
- process.stdout.write(`\r\x1B[2K`);
51198
+ if (!isNeovimActive())
51199
+ process.stdout.write(`\r\x1B[2K`);
51125
51200
  if (!transport) {
51126
51201
  writeContent(() => {
51127
51202
  renderWarning(`libp2p expose failed: ${err instanceof Error ? err.message : String(err)}`);
@@ -51385,6 +51460,9 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
51385
51460
  availableContentRows() {
51386
51461
  return statusBar.isActive ? statusBar.availableContentRows : Math.max(3, (process.stdout.rows ?? 24) - 6);
51387
51462
  },
51463
+ showPrompt() {
51464
+ showPrompt();
51465
+ },
51388
51466
  destroyProject() {
51389
51467
  const oaPath = join51(repoRoot, OA_DIR);
51390
51468
  if (existsSync42(oaPath)) {
@@ -51559,7 +51637,12 @@ ${sessionCtx}` : "",
51559
51637
  function showPasteIndicator() {
51560
51638
  const count = pasteBuffer.length;
51561
51639
  const label = ` ${c2.dim("[")}${c2.bold(c2.cyan(String(count)))}${c2.dim(" pasted line" + (count !== 1 ? "s" : "") + " \u2014 press Enter to submit]")}`;
51562
- process.stdout.write(`\r\x1B[K${label}`);
51640
+ if (isNeovimActive()) {
51641
+ writeToNeovimOutput(`${label}\r
51642
+ `);
51643
+ } else {
51644
+ process.stdout.write(`\r\x1B[K${label}`);
51645
+ }
51563
51646
  pasteIndicatorShown = true;
51564
51647
  }
51565
51648
  const buildSlashCommandHandler = () => {
@@ -51624,8 +51707,13 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
51624
51707
  async function processLine(input) {
51625
51708
  if (depSudoPromptPending && depSudoResolver) {
51626
51709
  const pw = input.trim();
51627
- process.stdout.write(`\r\x1B[K ${c2.dim("\u{1F511} Password received")}
51628
- `);
51710
+ const pwRecvMsg = `\r\x1B[K ${c2.dim("\u{1F511} Password received")}
51711
+ `;
51712
+ if (isNeovimActive()) {
51713
+ writeToNeovimOutput(pwRecvMsg);
51714
+ } else {
51715
+ process.stdout.write(pwRecvMsg);
51716
+ }
51629
51717
  depSudoResolver(pw || null);
51630
51718
  showPrompt();
51631
51719
  return;
@@ -51634,8 +51722,13 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
51634
51722
  sudoPromptPending = false;
51635
51723
  sessionSudoPassword = input;
51636
51724
  activeTask.runner.setSudoPassword(input);
51637
- process.stdout.write(`\r\x1B[K ${c2.dim("\u{1F511} Password received")}
51638
- `);
51725
+ const pwRecvMsg2 = `\r\x1B[K ${c2.dim("\u{1F511} Password received")}
51726
+ `;
51727
+ if (isNeovimActive()) {
51728
+ writeToNeovimOutput(pwRecvMsg2);
51729
+ } else {
51730
+ process.stdout.write(pwRecvMsg2);
51731
+ }
51639
51732
  showPrompt();
51640
51733
  return;
51641
51734
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.104.13",
3
+ "version": "0.104.15",
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",