open-agents-ai 0.138.56 → 0.138.57

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 +70 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -51597,6 +51597,11 @@ var init_status_bar = __esm({
51597
51597
  stdinHooked = false;
51598
51598
  /** COHERE distributed cognitive commons active flag */
51599
51599
  _cohereActive = false;
51600
+ /** Mouse tracking state — disabled when idle to allow native text selection */
51601
+ _mouseTrackingEnabled = true;
51602
+ _mouseIdleTimer = null;
51603
+ static MOUSE_IDLE_MS = 1500;
51604
+ // disable after 1.5s idle
51600
51605
  /** Banner refresh callback — called after resize to re-render top rows */
51601
51606
  _bannerRefresh = null;
51602
51607
  /** Track previous terminal dimensions to clear ghost separators on resize */
@@ -52199,6 +52204,47 @@ var init_status_bar = __esm({
52199
52204
  get cohereActive() {
52200
52205
  return this._cohereActive;
52201
52206
  }
52207
+ // ── Mouse tracking management ──────────────────────────────────────
52208
+ // Terminal mouse tracking (?1002h) captures all mouse events, preventing
52209
+ // native text selection. We disable it when idle (allowing selection) and
52210
+ // re-enable when scroll/streaming starts (allowing mouse scroll).
52211
+ // Users can always hold Shift for selection as a universal fallback.
52212
+ /** Enable mouse tracking (for scroll during streaming/scrollback) */
52213
+ enableMouseTracking() {
52214
+ if (this._mouseTrackingEnabled)
52215
+ return;
52216
+ this._mouseTrackingEnabled = true;
52217
+ if (process.stdout.isTTY) {
52218
+ this._trueStdoutWrite.call(process.stdout, "\x1B[?1002h\x1B[?1006h");
52219
+ }
52220
+ }
52221
+ /** Disable mouse tracking (allows native terminal text selection) */
52222
+ disableMouseTracking() {
52223
+ if (!this._mouseTrackingEnabled)
52224
+ return;
52225
+ this._mouseTrackingEnabled = false;
52226
+ if (process.stdout.isTTY) {
52227
+ this._trueStdoutWrite.call(process.stdout, "\x1B[?1002l\x1B[?1006l");
52228
+ }
52229
+ }
52230
+ /** Schedule mouse tracking disable after idle timeout.
52231
+ * Called after each content write or stream end. Cancelled by scroll/stream start. */
52232
+ scheduleMouseIdle() {
52233
+ if (this._mouseIdleTimer)
52234
+ clearTimeout(this._mouseIdleTimer);
52235
+ this._mouseIdleTimer = setTimeout(() => {
52236
+ if (!this.isStreaming && !this.isScrolledBack) {
52237
+ this.disableMouseTracking();
52238
+ }
52239
+ }, _StatusBar.MOUSE_IDLE_MS);
52240
+ }
52241
+ /** Cancel mouse idle timer (user is actively scrolling or streaming started) */
52242
+ cancelMouseIdle() {
52243
+ if (this._mouseIdleTimer) {
52244
+ clearTimeout(this._mouseIdleTimer);
52245
+ this._mouseIdleTimer = null;
52246
+ }
52247
+ }
52202
52248
  /** Set a callback to re-render the banner after resize/redraw */
52203
52249
  setBannerRefresh(refresh) {
52204
52250
  this._bannerRefresh = refresh;
@@ -52325,6 +52371,8 @@ var init_status_bar = __esm({
52325
52371
  return;
52326
52372
  this.writeDepth++;
52327
52373
  this._brailleSpinner.setMetrics({ isStreaming: true });
52374
+ this.cancelMouseIdle();
52375
+ this.enableMouseTracking();
52328
52376
  const rows = process.stdout.rows ?? 24;
52329
52377
  const scrollEnd = Math.max(rows - this._currentFooterHeight, this.scrollRegionTop + 1);
52330
52378
  if (this.writeDepth === 1 && !this._origWrite) {
@@ -52362,6 +52410,7 @@ ${CONTENT_BG_SEQ}`);
52362
52410
  process.stdout.write(RESET);
52363
52411
  this._brailleSpinner.setMetrics({ isStreaming: false });
52364
52412
  this.renderFooterAndPositionInput();
52413
+ this.scheduleMouseIdle();
52365
52414
  }
52366
52415
  }
52367
52416
  // -----------------------------------------------------------------------
@@ -52390,16 +52439,22 @@ ${CONTENT_BG_SEQ}`);
52390
52439
  scrollContentUp(lines = 1) {
52391
52440
  if (!this.active)
52392
52441
  return;
52442
+ this.cancelMouseIdle();
52443
+ this.enableMouseTracking();
52393
52444
  const maxOffset = Math.max(0, this._contentLines.length - this.contentHeight);
52394
52445
  this._contentScrollOffset = Math.min(maxOffset, this._contentScrollOffset + lines);
52395
52446
  this.repaintContent();
52447
+ this.scheduleMouseIdle();
52396
52448
  }
52397
52449
  /** Scroll down through content history */
52398
52450
  scrollContentDown(lines = 1) {
52399
52451
  if (!this.active)
52400
52452
  return;
52453
+ this.cancelMouseIdle();
52454
+ this.enableMouseTracking();
52401
52455
  this._contentScrollOffset = Math.max(0, this._contentScrollOffset - lines);
52402
52456
  this.repaintContent();
52457
+ this.scheduleMouseIdle();
52403
52458
  }
52404
52459
  /** Page up — scroll by visible height */
52405
52460
  pageUpContent() {
@@ -53208,10 +53263,12 @@ var init_mouse_filter = __esm({
53208
53263
  MouseFilterStream = class extends Transform {
53209
53264
  buffer = "";
53210
53265
  onScroll = null;
53266
+ onActivity = null;
53211
53267
  flushTimer = null;
53212
- constructor(scrollHandler) {
53268
+ constructor(scrollHandler, activityHandler) {
53213
53269
  super();
53214
53270
  this.onScroll = scrollHandler;
53271
+ this.onActivity = activityHandler ?? null;
53215
53272
  }
53216
53273
  _transform(chunk, _encoding, callback) {
53217
53274
  this.buffer += chunk.toString();
@@ -53231,6 +53288,8 @@ var init_mouse_filter = __esm({
53231
53288
  this.onScroll("up", 3, row);
53232
53289
  else if ((btn === 65 || btn === 97) && this.onScroll)
53233
53290
  this.onScroll("down", 3, row);
53291
+ if (this.onActivity)
53292
+ this.onActivity();
53234
53293
  i += mouseMatch[0].length;
53235
53294
  continue;
53236
53295
  }
@@ -54972,6 +55031,10 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
54972
55031
  else
54973
55032
  statusBar.scrollContentDown(lines);
54974
55033
  }
55034
+ }, () => {
55035
+ statusBar.cancelMouseIdle();
55036
+ statusBar.enableMouseTracking();
55037
+ statusBar.scheduleMouseIdle();
54975
55038
  });
54976
55039
  process.stdin.pipe(mouseFilter);
54977
55040
  const rl = readline2.createInterface({
@@ -55256,6 +55319,9 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
55256
55319
  return;
55257
55320
  }
55258
55321
  sudoPromptPending = true;
55322
+ if (process.stdout.isTTY) {
55323
+ process.stdout.write("\x1B[?1002l\x1B[?1006l");
55324
+ }
55259
55325
  writeContent(() => renderInfo("Password required for sudo. Type below, Enter to submit. Ctrl+O to show/hide."));
55260
55326
  const pwPrompt = `\x1B[38;5;178m\u{1F511}\x1B[0m `;
55261
55327
  rl.setPrompt(pwPrompt);
@@ -56627,6 +56693,9 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
56627
56693
  passwordShowPlain = false;
56628
56694
  sessionSudoPassword = input;
56629
56695
  activeTask.runner.setSudoPassword(input);
56696
+ if (process.stdout.isTTY) {
56697
+ process.stdout.write("\x1B[?1002h\x1B[?1006h");
56698
+ }
56630
56699
  statusBar.setInputStateProvider(() => ({
56631
56700
  line: rl.line ?? "",
56632
56701
  cursor: rl.cursor ?? 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.138.56",
3
+ "version": "0.138.57",
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",