open-agents-ai 0.138.46 → 0.138.48

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 +48 -43
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -52215,7 +52215,7 @@ ${CONTENT_BG_SEQ}`);
52215
52215
  * before readline splits them into garbage text. Scroll wheel support
52216
52216
  * is keyboard-only (Page Up/Down, Shift+Up/Down).
52217
52217
  */
52218
- hookReadlineScroll(rl, onEscape) {
52218
+ hookReadlineScroll(rl, onEscape, onCtrlO) {
52219
52219
  if (!rl || !rl._ttyWrite)
52220
52220
  return;
52221
52221
  const self = this;
@@ -52233,6 +52233,10 @@ ${CONTENT_BG_SEQ}`);
52233
52233
  if (cursor <= 0)
52234
52234
  return;
52235
52235
  }
52236
+ if (key?.ctrl && key?.name === "o" && onCtrlO) {
52237
+ onCtrlO();
52238
+ return;
52239
+ }
52236
52240
  if (s && (/\x1B\[</.test(s) || /^\d+;\d+;\d*[Mm]/.test(s) || /^;\d+[Mm]/.test(s) || /\[<\d/.test(s))) {
52237
52241
  return;
52238
52242
  }
@@ -52271,26 +52275,14 @@ ${CONTENT_BG_SEQ}`);
52271
52275
  self.scrollContentDown(1);
52272
52276
  return;
52273
52277
  }
52274
- const dir = key.name;
52275
- if (dir === arrowBurstDir) {
52276
- arrowBurst++;
52277
- } else {
52278
- arrowBurst = 1;
52279
- arrowBurstDir = dir;
52280
- }
52281
- if (arrowBurstTimer)
52282
- clearTimeout(arrowBurstTimer);
52283
- arrowBurstTimer = setTimeout(() => {
52284
- arrowBurst = 0;
52285
- arrowBurstDir = "";
52286
- }, 80);
52287
- if (arrowBurst >= 3) {
52288
- if (dir === "up")
52278
+ if (self._contentScrollOffset > 0) {
52279
+ if (key.name === "up")
52289
52280
  self.scrollContentUp(1);
52290
52281
  else
52291
52282
  self.scrollContentDown(1);
52292
52283
  return;
52293
52284
  }
52285
+ return origTtyWrite(s, key);
52294
52286
  }
52295
52287
  if (key?.name === "pageup" || s === "\x1B[5~") {
52296
52288
  self.pageUpContent();
@@ -52386,9 +52378,9 @@ var init_mouse_filter = __esm({
52386
52378
  if (mouseMatch) {
52387
52379
  const btn = parseInt(mouseMatch[1]);
52388
52380
  const row = parseInt(mouseMatch[3]);
52389
- if (btn === 64 && this.onScroll)
52381
+ if ((btn === 64 || btn === 96) && this.onScroll)
52390
52382
  this.onScroll("up", 3, row);
52391
- else if (btn === 65 && this.onScroll)
52383
+ else if ((btn === 65 || btn === 97) && this.onScroll)
52392
52384
  this.onScroll("down", 3, row);
52393
52385
  i += mouseMatch[0].length;
52394
52386
  continue;
@@ -53693,7 +53685,7 @@ async function startInteractive(config, repoPath) {
53693
53685
  const statusBar = new StatusBar();
53694
53686
  statusBar.setVersion(version);
53695
53687
  if (process.stdout.isTTY) {
53696
- const scrollTop = carouselLines > 0 ? carouselLines + 1 : 1;
53688
+ const scrollTop = carouselLines > 0 ? carouselLines : 1;
53697
53689
  statusBar.activate(scrollTop);
53698
53690
  statusBar.setBannerRefresh(() => banner.renderCurrentFrame());
53699
53691
  const { onOverlayLeave: onOverlayLeave2 } = await Promise.resolve().then(() => (init_overlay_lock(), overlay_lock_exports));
@@ -54065,16 +54057,15 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
54065
54057
  } catch {
54066
54058
  }
54067
54059
  const { MouseFilterStream: MouseFilterStream2 } = await Promise.resolve().then(() => (init_mouse_filter(), mouse_filter_exports));
54060
+ let origTtyWriteRef = null;
54068
54061
  const mouseFilter = new MouseFilterStream2((direction, lines, row) => {
54069
54062
  const rows = process.stdout.rows ?? 24;
54070
54063
  const fh = statusBar._currentFooterHeight ?? 3;
54071
54064
  const footerStart = rows - fh + 1;
54072
54065
  if (row >= footerStart) {
54073
- if (direction === "up") {
54074
- rl._ttyWrite?.("\x1B[A", { name: "up" });
54075
- } else {
54076
- rl._ttyWrite?.("\x1B[B", { name: "down" });
54077
- }
54066
+ const arrowKey = direction === "up" ? { name: "up" } : { name: "down" };
54067
+ const arrowSeq = direction === "up" ? "\x1B[A" : "\x1B[B";
54068
+ origTtyWriteRef?.(arrowSeq, arrowKey);
54078
54069
  } else {
54079
54070
  if (direction === "up")
54080
54071
  statusBar.scrollContentUp(lines);
@@ -54092,9 +54083,16 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
54092
54083
  history: savedHistory,
54093
54084
  completer
54094
54085
  });
54086
+ origTtyWriteRef = rl._ttyWrite?.bind(rl) ?? null;
54095
54087
  let _escapeHandler = null;
54096
54088
  statusBar.hookReadlineScroll(rl, () => {
54097
54089
  _escapeHandler?.();
54090
+ }, () => {
54091
+ if (sudoPromptPending) {
54092
+ passwordShowPlain = !passwordShowPlain;
54093
+ if (statusBar.isActive)
54094
+ statusBar.handleResize();
54095
+ }
54098
54096
  });
54099
54097
  rl.output = null;
54100
54098
  if (process.stdin.isTTY && typeof process.stdin.setRawMode === "function") {
@@ -54349,6 +54347,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
54349
54347
  }
54350
54348
  })().catch(() => {
54351
54349
  });
54350
+ let passwordShowPlain = false;
54352
54351
  function handleSudoRequest(_command) {
54353
54352
  if (sudoPromptPending)
54354
54353
  return;
@@ -54357,12 +54356,20 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
54357
54356
  return;
54358
54357
  }
54359
54358
  sudoPromptPending = true;
54360
- const sudoPromptStr = ` ${c2.bold(c2.yellow("\u{1F511} Password:"))} `;
54361
- if (isNeovimActive()) {
54362
- writeToNeovimOutput(sudoPromptStr);
54363
- } else {
54364
- process.stdout.write(sudoPromptStr);
54359
+ writeContent(() => renderInfo("Password required for sudo. Type below, Enter to submit. Ctrl+O to show/hide."));
54360
+ const pwPrompt = `\x1B[38;5;178m\u{1F511}\x1B[0m `;
54361
+ rl.setPrompt(pwPrompt);
54362
+ if (statusBar.isActive) {
54363
+ const origProvider = statusBar.inputStateProvider;
54364
+ statusBar.inputStateProvider = () => {
54365
+ const state = origProvider?.() ?? { line: "", cursor: 0 };
54366
+ if (passwordShowPlain)
54367
+ return state;
54368
+ return { line: "\u25CF".repeat(state.line.length), cursor: state.cursor };
54369
+ };
54370
+ statusBar.setPromptText(pwPrompt, 3);
54365
54371
  }
54372
+ showPrompt();
54366
54373
  }
54367
54374
  async function handleAskUser(question, options, allowMultiple) {
54368
54375
  if (statusBar?.isActive)
@@ -55698,28 +55705,26 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
55698
55705
  async function processLine(input) {
55699
55706
  if (depSudoPromptPending && depSudoResolver) {
55700
55707
  const pw = input.trim();
55701
- const pwRecvMsg = `\r\x1B[K ${c2.dim("\u{1F511} Password received")}
55702
- `;
55703
- if (isNeovimActive()) {
55704
- writeToNeovimOutput(pwRecvMsg);
55705
- } else {
55706
- process.stdout.write(pwRecvMsg);
55707
- }
55708
+ passwordShowPlain = false;
55709
+ statusBar.setInputStateProvider(() => ({
55710
+ line: rl.line ?? "",
55711
+ cursor: rl.cursor ?? 0
55712
+ }));
55713
+ writeContent(() => renderInfo("\u{1F511} Password received"));
55708
55714
  depSudoResolver(pw || null);
55709
55715
  showPrompt();
55710
55716
  return;
55711
55717
  }
55712
55718
  if (sudoPromptPending && activeTask) {
55713
55719
  sudoPromptPending = false;
55720
+ passwordShowPlain = false;
55714
55721
  sessionSudoPassword = input;
55715
55722
  activeTask.runner.setSudoPassword(input);
55716
- const pwRecvMsg2 = `\r\x1B[K ${c2.dim("\u{1F511} Password received")}
55717
- `;
55718
- if (isNeovimActive()) {
55719
- writeToNeovimOutput(pwRecvMsg2);
55720
- } else {
55721
- process.stdout.write(pwRecvMsg2);
55722
- }
55723
+ statusBar.setInputStateProvider(() => ({
55724
+ line: rl.line ?? "",
55725
+ cursor: rl.cursor ?? 0
55726
+ }));
55727
+ writeContent(() => renderInfo("\u{1F511} Password received"));
55723
55728
  showPrompt();
55724
55729
  return;
55725
55730
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.138.46",
3
+ "version": "0.138.48",
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",