open-agents-ai 0.138.97 → 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 +45 -13
  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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.138.97",
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",