open-agents-ai 0.138.96 → 0.138.98

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 +55 -23
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -38606,15 +38606,35 @@ async function startNeovimMode(opts) {
38606
38606
  cleanedUp: false
38607
38607
  };
38608
38608
  _state = state;
38609
- const backLabel = " \u2190 back ";
38610
- const backStartCol = 2;
38611
- const backEndCol = backStartCol + backLabel.length - 1;
38612
- function renderBackButton() {
38609
+ const toolbarBtns = [];
38610
+ {
38611
+ const btns = [
38612
+ { label: " \u2190 back ", action: "back" },
38613
+ { label: " undo ", action: "undo" },
38614
+ { label: " redo ", action: "redo" },
38615
+ { label: " save ", action: "save" }
38616
+ ];
38617
+ let col = 2;
38618
+ for (const b of btns) {
38619
+ toolbarBtns.push({ label: b.label, startCol: col, endCol: col + b.label.length - 1, action: b.action });
38620
+ col += b.label.length + 1;
38621
+ }
38622
+ }
38623
+ function renderToolbar() {
38613
38624
  if (!isTTY5)
38614
38625
  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`);
38626
+ let buf = "\x1B7";
38627
+ buf += `\x1B[2;1H\x1B[48;5;234m\x1B[2K`;
38628
+ for (const btn of toolbarBtns) {
38629
+ buf += `\x1B[2;${btn.startCol}H`;
38630
+ buf += `\x1B]8;;oa-cmd:${btn.action}\x07`;
38631
+ buf += `\x1B[38;5;245m\x1B[48;5;236m${btn.label}`;
38632
+ buf += `\x1B]8;;\x07`;
38633
+ }
38634
+ buf += "\x1B[0m\x1B8";
38635
+ process.stdout.write(buf);
38616
38636
  }
38617
- renderBackButton();
38637
+ renderToolbar();
38618
38638
  nvimPty.onData((data) => {
38619
38639
  if (state.cleanedUp)
38620
38640
  return;
@@ -38629,7 +38649,7 @@ async function startNeovimMode(opts) {
38629
38649
  } else {
38630
38650
  process.stdout.write(filtered);
38631
38651
  }
38632
- renderBackButton();
38652
+ renderToolbar();
38633
38653
  });
38634
38654
  nvimPty.onExit(() => {
38635
38655
  if (!state.cleanedUp) {
@@ -38662,14 +38682,26 @@ async function startNeovimMode(opts) {
38662
38682
  toggleFocus(state);
38663
38683
  return;
38664
38684
  }
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;
38685
+ const toolbarClick = seq.match(/\x1B\[<0;(\d+);2M/);
38686
+ if (toolbarClick) {
38687
+ const clickCol = parseInt(toolbarClick[1]);
38688
+ for (const btn of toolbarBtns) {
38689
+ if (clickCol >= btn.startCol && clickCol <= btn.endCol) {
38690
+ if (btn.action === "back") {
38691
+ doCleanup(state);
38692
+ } else if (btn.action === "undo") {
38693
+ nvimPty.write("\x1B:undo\r");
38694
+ } else if (btn.action === "redo") {
38695
+ nvimPty.write("\x1B:redo\r");
38696
+ } else if (btn.action === "save") {
38697
+ nvimPty.write("\x1B:wa\r");
38698
+ }
38699
+ return;
38700
+ }
38671
38701
  }
38672
38702
  }
38703
+ if (seq.match(/\x1B\[<0;(\d+);1M/))
38704
+ return;
38673
38705
  if (state.focused) {
38674
38706
  let normalized = seq.replace(/\x1BO([ABCD])/g, "\x1B[$1");
38675
38707
  if (topOffset > 0) {
@@ -44191,8 +44223,14 @@ async function handleUpdate(subcommand, ctx) {
44191
44223
  const rows = process.stdout.rows ?? 24;
44192
44224
  const bgDark = 234;
44193
44225
  const yellow = 178;
44194
- let buf = `\x1B[48;5;${bgDark}m\x1B[H\x1B[2J`;
44195
- const centerRow = Math.floor(rows / 2);
44226
+ const contentTop = 4;
44227
+ const contentBottom = rows - 3;
44228
+ const contentHeight = Math.max(5, contentBottom - contentTop + 1);
44229
+ let buf = "\x1B[?2026h\x1B7\x1B[?25l";
44230
+ for (let r = contentTop; r <= contentBottom; r++) {
44231
+ buf += `\x1B[${r};1H\x1B[48;5;${bgDark}m\x1B[2K`;
44232
+ }
44233
+ const centerRow = contentTop + Math.floor(contentHeight / 2);
44196
44234
  const centerCol = Math.floor(cols / 2);
44197
44235
  const boxW = Math.min(44, cols - 4);
44198
44236
  const boxH = 7;
@@ -44229,15 +44267,14 @@ async function handleUpdate(subcommand, ctx) {
44229
44267
  const vLabel = `v${version}`;
44230
44268
  const vCol = centerCol - Math.floor(vLabel.length / 2);
44231
44269
  buf += `\x1B[${centerRow};${vCol}H\x1B[0;38;5;245m\x1B[48;5;${bgDark}m${vLabel}`;
44232
- if (statusLine) {
44270
+ if (statusLine && centerRow + 2 <= contentBottom) {
44233
44271
  const sCol = centerCol - Math.floor(statusLine.length / 2);
44234
44272
  buf += `\x1B[${centerRow + 2};${Math.max(1, sCol)}H\x1B[38;5;240m\x1B[48;5;${bgDark}m${statusLine.slice(0, cols - 2)}`;
44235
44273
  }
44236
- buf += `\x1B[0m`;
44274
+ buf += `\x1B[0m\x1B8\x1B[?25h\x1B[?2026l`;
44237
44275
  process.stdout.write(buf);
44238
44276
  }
44239
44277
  function startInstallOverlay(version) {
44240
- process.stdout.write("\x1B[?1049h\x1B[?25l");
44241
44278
  let frame = 0;
44242
44279
  let status = "";
44243
44280
  renderInstallFrame(version, frame, status);
@@ -44378,7 +44415,6 @@ async function handleUpdate(subcommand, ctx) {
44378
44415
  });
44379
44416
  if (needsSudo) {
44380
44417
  installOverlay.stop("Requesting permissions...");
44381
- process.stdout.write("\x1B[?1049l\x1B[?25h");
44382
44418
  renderInfo("Global npm directory requires elevated permissions.");
44383
44419
  renderInfo("Enter your password if prompted...");
44384
44420
  safeWrite("\n");
@@ -44418,7 +44454,6 @@ async function handleUpdate(subcommand, ctx) {
44418
44454
  if (!installOk) {
44419
44455
  installOverlay.stop("Install failed");
44420
44456
  await new Promise((r) => setTimeout(r, 1500));
44421
- process.stdout.write("\x1B[?1049l\x1B[?25h");
44422
44457
  renderWarning(`Try manually: ${sudoPrefix}npm i -g open-agents-ai`);
44423
44458
  return;
44424
44459
  }
@@ -44450,7 +44485,6 @@ async function handleUpdate(subcommand, ctx) {
44450
44485
  if (!primaryUpdated && !depsUpdated && !doRebuild && !doPython && !doCloudflared) {
44451
44486
  installOverlay.stop("No changes needed");
44452
44487
  await new Promise((r) => setTimeout(r, 1500));
44453
- process.stdout.write("\x1B[?1049l\x1B[?25h");
44454
44488
  return;
44455
44489
  }
44456
44490
  if (doRebuild) {
@@ -44523,7 +44557,6 @@ async function handleUpdate(subcommand, ctx) {
44523
44557
  if (!primaryUpdated) {
44524
44558
  installOverlay.stop("Done");
44525
44559
  await new Promise((r) => setTimeout(r, 1500));
44526
- process.stdout.write("\x1B[?1049l\x1B[?25h");
44527
44560
  return;
44528
44561
  }
44529
44562
  installOverlay.setStatus("Reloading...");
@@ -44533,7 +44566,6 @@ async function handleUpdate(subcommand, ctx) {
44533
44566
  const resumeFlag = hadActiveTask ? "1" : "update-only";
44534
44567
  installOverlay.stop("Reloading\u2026");
44535
44568
  await new Promise((r) => setTimeout(r, 300));
44536
- process.stdout.write("\x1B[?1049l\x1B[?25h");
44537
44569
  const { execPath, argv } = process;
44538
44570
  try {
44539
44571
  const { execFileSync } = await import("node:child_process");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.138.96",
3
+ "version": "0.138.98",
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",