open-agents-ai 0.138.95 → 0.138.97

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 +28 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -38606,6 +38606,15 @@ 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() {
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();
38609
38618
  nvimPty.onData((data) => {
38610
38619
  if (state.cleanedUp)
38611
38620
  return;
@@ -38620,6 +38629,7 @@ async function startNeovimMode(opts) {
38620
38629
  } else {
38621
38630
  process.stdout.write(filtered);
38622
38631
  }
38632
+ renderBackButton();
38623
38633
  });
38624
38634
  nvimPty.onExit(() => {
38625
38635
  if (!state.cleanedUp) {
@@ -38652,6 +38662,14 @@ async function startNeovimMode(opts) {
38652
38662
  toggleFocus(state);
38653
38663
  return;
38654
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
+ }
38655
38673
  if (state.focused) {
38656
38674
  let normalized = seq.replace(/\x1BO([ABCD])/g, "\x1B[$1");
38657
38675
  if (topOffset > 0) {
@@ -44173,8 +44191,14 @@ async function handleUpdate(subcommand, ctx) {
44173
44191
  const rows = process.stdout.rows ?? 24;
44174
44192
  const bgDark = 234;
44175
44193
  const yellow = 178;
44176
- let buf = `\x1B[48;5;${bgDark}m\x1B[H\x1B[2J`;
44177
- const centerRow = Math.floor(rows / 2);
44194
+ const contentTop = 4;
44195
+ const contentBottom = rows - 3;
44196
+ const contentHeight = Math.max(5, contentBottom - contentTop + 1);
44197
+ let buf = "\x1B[?2026h\x1B7\x1B[?25l";
44198
+ for (let r = contentTop; r <= contentBottom; r++) {
44199
+ buf += `\x1B[${r};1H\x1B[48;5;${bgDark}m\x1B[2K`;
44200
+ }
44201
+ const centerRow = contentTop + Math.floor(contentHeight / 2);
44178
44202
  const centerCol = Math.floor(cols / 2);
44179
44203
  const boxW = Math.min(44, cols - 4);
44180
44204
  const boxH = 7;
@@ -44211,15 +44235,14 @@ async function handleUpdate(subcommand, ctx) {
44211
44235
  const vLabel = `v${version}`;
44212
44236
  const vCol = centerCol - Math.floor(vLabel.length / 2);
44213
44237
  buf += `\x1B[${centerRow};${vCol}H\x1B[0;38;5;245m\x1B[48;5;${bgDark}m${vLabel}`;
44214
- if (statusLine) {
44238
+ if (statusLine && centerRow + 2 <= contentBottom) {
44215
44239
  const sCol = centerCol - Math.floor(statusLine.length / 2);
44216
44240
  buf += `\x1B[${centerRow + 2};${Math.max(1, sCol)}H\x1B[38;5;240m\x1B[48;5;${bgDark}m${statusLine.slice(0, cols - 2)}`;
44217
44241
  }
44218
- buf += `\x1B[0m`;
44242
+ buf += `\x1B[0m\x1B8\x1B[?25h\x1B[?2026l`;
44219
44243
  process.stdout.write(buf);
44220
44244
  }
44221
44245
  function startInstallOverlay(version) {
44222
- process.stdout.write("\x1B[?1049h\x1B[?25l");
44223
44246
  let frame = 0;
44224
44247
  let status = "";
44225
44248
  renderInstallFrame(version, frame, status);
@@ -44360,7 +44383,6 @@ async function handleUpdate(subcommand, ctx) {
44360
44383
  });
44361
44384
  if (needsSudo) {
44362
44385
  installOverlay.stop("Requesting permissions...");
44363
- process.stdout.write("\x1B[?1049l\x1B[?25h");
44364
44386
  renderInfo("Global npm directory requires elevated permissions.");
44365
44387
  renderInfo("Enter your password if prompted...");
44366
44388
  safeWrite("\n");
@@ -44400,7 +44422,6 @@ async function handleUpdate(subcommand, ctx) {
44400
44422
  if (!installOk) {
44401
44423
  installOverlay.stop("Install failed");
44402
44424
  await new Promise((r) => setTimeout(r, 1500));
44403
- process.stdout.write("\x1B[?1049l\x1B[?25h");
44404
44425
  renderWarning(`Try manually: ${sudoPrefix}npm i -g open-agents-ai`);
44405
44426
  return;
44406
44427
  }
@@ -44432,7 +44453,6 @@ async function handleUpdate(subcommand, ctx) {
44432
44453
  if (!primaryUpdated && !depsUpdated && !doRebuild && !doPython && !doCloudflared) {
44433
44454
  installOverlay.stop("No changes needed");
44434
44455
  await new Promise((r) => setTimeout(r, 1500));
44435
- process.stdout.write("\x1B[?1049l\x1B[?25h");
44436
44456
  return;
44437
44457
  }
44438
44458
  if (doRebuild) {
@@ -44505,7 +44525,6 @@ async function handleUpdate(subcommand, ctx) {
44505
44525
  if (!primaryUpdated) {
44506
44526
  installOverlay.stop("Done");
44507
44527
  await new Promise((r) => setTimeout(r, 1500));
44508
- process.stdout.write("\x1B[?1049l\x1B[?25h");
44509
44528
  return;
44510
44529
  }
44511
44530
  installOverlay.setStatus("Reloading...");
@@ -44515,7 +44534,6 @@ async function handleUpdate(subcommand, ctx) {
44515
44534
  const resumeFlag = hadActiveTask ? "1" : "update-only";
44516
44535
  installOverlay.stop("Reloading\u2026");
44517
44536
  await new Promise((r) => setTimeout(r, 300));
44518
- process.stdout.write("\x1B[?1049l\x1B[?25h");
44519
44537
  const { execPath, argv } = process;
44520
44538
  try {
44521
44539
  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.95",
3
+ "version": "0.138.97",
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",