open-agents-ai 0.147.0 → 0.149.0

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 +36 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -55613,6 +55613,19 @@ function copyText(text) {
55613
55613
  continue;
55614
55614
  }
55615
55615
  }
55616
+ if (!_clipboardAutoInstallAttempted) {
55617
+ _clipboardAutoInstallAttempted = true;
55618
+ try {
55619
+ execSync29("which apt-get", { timeout: 2e3, stdio: "pipe" });
55620
+ try {
55621
+ execSync29("sudo -n apt-get install -y xclip 2>/dev/null", { timeout: 15e3, stdio: "pipe" });
55622
+ execSync29("xclip -selection clipboard", { input: text, timeout: 3e3 });
55623
+ return true;
55624
+ } catch {
55625
+ }
55626
+ } catch {
55627
+ }
55628
+ }
55616
55629
  } catch {
55617
55630
  }
55618
55631
  try {
@@ -55695,7 +55708,7 @@ function hitTestHeaderButton(row, col, termWidth) {
55695
55708
  }
55696
55709
  return null;
55697
55710
  }
55698
- var SEL_BG, SEL_FG, SEL_START, SEL_END, TextSelection, _hoveredButtonCmd, _pressedButtonCmd, BTN_REST_BG, BTN_REST_FG, BTN_HOVER_BG, BTN_HOVER_FG, BTN_PRESS_BG, BTN_PRESS_FG, _updateBadgeActive, _updateBadgeCol, _updateBadgeLen;
55711
+ var SEL_BG, SEL_FG, SEL_START, SEL_END, TextSelection, _clipboardAutoInstallAttempted, _hoveredButtonCmd, _pressedButtonCmd, BTN_REST_BG, BTN_REST_FG, BTN_HOVER_BG, BTN_HOVER_FG, BTN_PRESS_BG, BTN_PRESS_FG, _updateBadgeActive, _updateBadgeCol, _updateBadgeLen;
55699
55712
  var init_text_selection = __esm({
55700
55713
  "packages/cli/dist/tui/text-selection.js"() {
55701
55714
  "use strict";
@@ -55898,6 +55911,7 @@ var init_text_selection = __esm({
55898
55911
  return copyText(text);
55899
55912
  }
55900
55913
  };
55914
+ _clipboardAutoInstallAttempted = false;
55901
55915
  _hoveredButtonCmd = null;
55902
55916
  _pressedButtonCmd = null;
55903
55917
  BTN_REST_BG = 236;
@@ -56823,7 +56837,11 @@ var init_status_bar = __esm({
56823
56837
  this.repaintContent();
56824
56838
  } else if (type === "release") {
56825
56839
  this._textSelection.onMouseRelease(row, col);
56826
- this.repaintContent();
56840
+ if (this._textSelection.hasSelection) {
56841
+ this.copySelection();
56842
+ } else {
56843
+ this.repaintContent();
56844
+ }
56827
56845
  }
56828
56846
  }
56829
56847
  /** Copy current selection to clipboard. Returns true if copied. */
@@ -56831,16 +56849,20 @@ var init_status_bar = __esm({
56831
56849
  if (!this._textSelection.hasSelection)
56832
56850
  return false;
56833
56851
  const ok = this._textSelection.copyToClipboard();
56852
+ this._textSelection.clear();
56853
+ this.repaintContent();
56854
+ const rows = process.stdout.rows ?? 24;
56855
+ const pos = this.rowPositions(rows);
56856
+ const writer = this._origWrite ?? process.stdout.write.bind(process.stdout);
56834
56857
  if (ok) {
56835
- const rows = process.stdout.rows ?? 24;
56836
- const pos = this.rowPositions(rows);
56837
- const writer = this._origWrite ?? process.stdout.write.bind(process.stdout);
56838
56858
  writer(`\x1B[${pos.metricsRow};1H\x1B[2K\x1B[38;5;${TEXT_PRIMARY}m \u2713 Copied to clipboard\x1B[0m`);
56839
- setTimeout(() => {
56840
- if (this.active)
56841
- this.renderFooterAndPositionInput();
56842
- }, 1200);
56859
+ } else {
56860
+ writer(`\x1B[${pos.metricsRow};1H\x1B[2K\x1B[38;5;214m \u26A0 Copy failed \u2014 install xclip: sudo apt install xclip\x1B[0m`);
56843
56861
  }
56862
+ setTimeout(() => {
56863
+ if (this.active)
56864
+ this.renderFooterAndPositionInput();
56865
+ }, ok ? 1200 : 3e3);
56844
56866
  return ok;
56845
56867
  }
56846
56868
  /** Arm block (rectangular) selection mode — next click starts block select */
@@ -57820,6 +57842,11 @@ ${CONTENT_BG_SEQ}`);
57820
57842
  if (key?.name === "escape" || s === "\x1B") {
57821
57843
  sawEscape = true;
57822
57844
  sawEscapeTime = Date.now();
57845
+ if (self._textSelection.hasSelection && s.length === 1) {
57846
+ self._textSelection.clear();
57847
+ self.repaintContent();
57848
+ return;
57849
+ }
57823
57850
  if (onEscape && s.length === 1)
57824
57851
  onEscape();
57825
57852
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.147.0",
3
+ "version": "0.149.0",
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",