open-agents-ai 0.187.88 → 0.187.90

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 +151 -72
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -278632,6 +278632,132 @@ var init_status_bar = __esm({
278632
278632
  this._headerPanels.push({ id, render });
278633
278633
  return this._headerPanels.length - 1;
278634
278634
  }
278635
+ /** Rebuild all header panels from the current item set.
278636
+ * Items are paginated across N pages — each page fills left-to-right
278637
+ * until no more items fit. Called on activate and resize. */
278638
+ _rebuildHeaderPanels() {
278639
+ this._headerPanels = [];
278640
+ const savedIdx = this._headerPanelIndex;
278641
+ const buildItems = () => {
278642
+ const items = [];
278643
+ const verText = ` OA v${this._version}`;
278644
+ items.push({ type: "text", text: verText, ansi: `\x1B[1;38;5;${TEXT_PRIMARY}m${verText}\x1B[0m`, w: verText.length });
278645
+ for (const btn of [
278646
+ { cmd: "help", label: " help " },
278647
+ { cmd: "voice", label: " voice " },
278648
+ { cmd: "model", label: " model " },
278649
+ { cmd: "cohere", label: " cohere " }
278650
+ ]) {
278651
+ items.push({ type: "btn", cmd: btn.cmd, label: btn.label, w: btn.label.length + 1 });
278652
+ }
278653
+ items.push({ type: "sep", w: 3 });
278654
+ if (this._agentViews.size > 1) {
278655
+ for (const view of this._agentViews.values()) {
278656
+ if (view.id === "main" && this._activeViewId === "main")
278657
+ continue;
278658
+ const icon = view.status === "running" ? "\u25CF" : view.status === "completed" ? "\u2713" : view.status === "failed" ? "\u2717" : "\u25CB";
278659
+ const label = ` ${view.label} ${icon} `;
278660
+ items.push({ type: "btn", cmd: `view:${view.id}`, label, w: label.length + 1 });
278661
+ }
278662
+ } else {
278663
+ items.push({ type: "text", text: " no sub-agents", ansi: `\x1B[38;5;${TEXT_DIM}m no sub-agents`, w: 14 });
278664
+ }
278665
+ const voiceIcon = this._voiceActive ? "\u25CF" : "\u25CB";
278666
+ const voiceColor = this._voiceActive ? 82 : TEXT_DIM;
278667
+ const voiceLabel = this._voiceActive ? ` ${this._voiceModelId || "voice"} ` : " voice ";
278668
+ items.push({
278669
+ type: "btn",
278670
+ cmd: "voice",
278671
+ label: `${voiceIcon}${voiceLabel}`,
278672
+ w: voiceLabel.length + 1 + 1
278673
+ // icon + label + space
278674
+ });
278675
+ const nexusColor = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
278676
+ const nexusDot = this._nexusStatus === "connected" || this._nexusStatus === "connecting" ? "\u25CF" : "\u25CB";
278677
+ items.push({
278678
+ type: "btn",
278679
+ cmd: "nexus",
278680
+ label: `${nexusDot} nexus `,
278681
+ w: 8
278682
+ // dot + " nexus " + space
278683
+ });
278684
+ return items;
278685
+ };
278686
+ const allItems = buildItems();
278687
+ const availW = Math.max(10, termCols() - 4);
278688
+ let page = [];
278689
+ let pageW = 0;
278690
+ const pages = [];
278691
+ for (const item of allItems) {
278692
+ if (pageW + item.w > availW && page.length > 0) {
278693
+ pages.push(page);
278694
+ page = [];
278695
+ pageW = 0;
278696
+ }
278697
+ page.push(item);
278698
+ pageW += item.w;
278699
+ }
278700
+ if (page.length > 0)
278701
+ pages.push(page);
278702
+ for (let pi = 0; pi < pages.length; pi++) {
278703
+ const pageItems = pages[pi];
278704
+ this.registerHeaderPanel(`page-${pi}`, (innerW) => {
278705
+ let out = "";
278706
+ let usedW = 0;
278707
+ for (const item of pageItems) {
278708
+ if (item.type === "text") {
278709
+ out += item.ansi;
278710
+ usedW += item.w;
278711
+ } else if (item.type === "btn") {
278712
+ const cmdPrefix = item.cmd.startsWith("view:") ? "oa-view:" + item.cmd.slice(5) : "oa-cmd:" + item.cmd;
278713
+ let fg2 = TEXT_DIM;
278714
+ if (item.cmd === "voice" && this._voiceActive)
278715
+ fg2 = 82;
278716
+ if (item.cmd === "nexus") {
278717
+ fg2 = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
278718
+ }
278719
+ out += `\x1B]8;;${cmdPrefix}\x07\x1B[38;5;${fg2}m${item.label}\x1B]8;;\x07 `;
278720
+ usedW += item.w;
278721
+ } else if (item.type === "sep") {
278722
+ out += `\x1B[38;5;${TEXT_DIM}m \u2502 `;
278723
+ usedW += 3;
278724
+ }
278725
+ }
278726
+ if (pi === 0 && usedW < innerW) {
278727
+ const gapNeeded = innerW - usedW;
278728
+ const verEnd = pageItems.findIndex((it) => it.type !== "text");
278729
+ if (verEnd > 0) {
278730
+ let out2 = "";
278731
+ for (let i2 = 0; i2 < pageItems.length; i2++) {
278732
+ const item = pageItems[i2];
278733
+ if (item.type === "text") {
278734
+ out2 += item.ansi;
278735
+ } else {
278736
+ if (i2 === verEnd) {
278737
+ out2 += `\x1B[38;5;${TEXT_DIM}m${" ".repeat(gapNeeded)}`;
278738
+ }
278739
+ if (item.type === "btn") {
278740
+ const cmdPrefix = item.cmd.startsWith("view:") ? "oa-view:" + item.cmd.slice(5) : "oa-cmd:" + item.cmd;
278741
+ let fg2 = TEXT_DIM;
278742
+ if (item.cmd === "voice" && this._voiceActive)
278743
+ fg2 = 82;
278744
+ if (item.cmd === "nexus") {
278745
+ fg2 = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
278746
+ }
278747
+ out2 += `\x1B]8;;${cmdPrefix}\x07\x1B[38;5;${fg2}m${item.label}\x1B]8;;\x07 `;
278748
+ } else if (item.type === "sep") {
278749
+ out2 += `\x1B[38;5;${TEXT_DIM}m \u2502 `;
278750
+ }
278751
+ }
278752
+ }
278753
+ return out2;
278754
+ }
278755
+ }
278756
+ return out;
278757
+ });
278758
+ }
278759
+ this._headerPanelIndex = Math.min(savedIdx, this._headerPanels.length - 1);
278760
+ }
278635
278761
  /** Switch to the next header panel (wraps around) */
278636
278762
  nextHeaderPanel() {
278637
278763
  if (this._headerPanels.length <= 1)
@@ -278671,9 +278797,9 @@ var init_status_bar = __esm({
278671
278797
  buf += ` `;
278672
278798
  buf += `\x1B[38;5;${TEXT_PRIMARY}m${PANEL_BG_SEQ}`;
278673
278799
  buf += content;
278674
- buf += `\x1B[${hdrRow};${w - 2}H`;
278800
+ buf += `\x1B[${hdrRow};${w - 1}H`;
278675
278801
  buf += rightArrow;
278676
- buf += ` ${BOX_FG}\u2502${RESET}`;
278802
+ buf += `\x1B[${hdrRow};${w}H${BOX_FG}\u2502${RESET}`;
278677
278803
  buf += "\x1B8";
278678
278804
  this.termWrite(buf);
278679
278805
  }
@@ -279199,65 +279325,7 @@ var init_status_bar = __esm({
279199
279325
  this.scrollRegionTop = scrollRegionTop ?? 1;
279200
279326
  this.active = true;
279201
279327
  if (this._headerPanels.length === 0) {
279202
- const allBtns = [
279203
- { cmd: "help", label: " help " },
279204
- { cmd: "voice", label: " voice " },
279205
- { cmd: "model", label: " model " },
279206
- { cmd: "cohere", label: " cohere " }
279207
- ];
279208
- this.registerHeaderPanel("main", (innerW) => {
279209
- const verText = ` OA v${this._version}`;
279210
- let usedW = verText.length + 5;
279211
- const fittingBtns = [];
279212
- const overflowBtns = [];
279213
- for (const btn of allBtns) {
279214
- const btnW = btn.label.length + 1;
279215
- if (usedW + btnW <= innerW) {
279216
- fittingBtns.push(btn);
279217
- usedW += btnW;
279218
- } else {
279219
- overflowBtns.push(btn);
279220
- }
279221
- }
279222
- this._overflowBtns = overflowBtns;
279223
- const gap = Math.max(1, innerW - usedW + 1);
279224
- let out = `\x1B[1;38;5;${TEXT_PRIMARY}m${verText}`;
279225
- out += `\x1B[38;5;${TEXT_DIM}m${" ".repeat(gap)}`;
279226
- for (const btn of fittingBtns) {
279227
- out += `\x1B]8;;oa-cmd:${btn.cmd}\x07\x1B[38;5;${TEXT_DIM}m${btn.label}\x1B]8;;\x07 `;
279228
- }
279229
- return out;
279230
- });
279231
- this.registerHeaderPanel("systems", (innerW) => {
279232
- let out = "";
279233
- if (this._agentViews.size > 1) {
279234
- for (const view of this._agentViews.values()) {
279235
- if (view.id === "main" && this._activeViewId === "main")
279236
- continue;
279237
- const icon = view.status === "running" ? "\u25CF" : view.status === "completed" ? "\u2713" : view.status === "failed" ? "\u2717" : "\u25CB";
279238
- const isActive = view.id === this._activeViewId;
279239
- const fg2 = isActive ? 252 : 245;
279240
- out += `\x1B]8;;oa-view:${view.id}\x07\x1B[38;5;${fg2}m ${view.label} ${icon} \x1B]8;;\x07 `;
279241
- }
279242
- } else {
279243
- out += `\x1B[38;5;${TEXT_DIM}m no sub-agents `;
279244
- }
279245
- out += `\x1B[38;5;${TEXT_DIM}m\u2502 `;
279246
- const voiceIcon = this._voiceActive ? `\x1B[38;5;82m\u25CF` : `\x1B[38;5;${TEXT_DIM}m\u25CB`;
279247
- const voiceLabel = this._voiceActive ? ` ${this._voiceModelId || "voice"} ` : " voice ";
279248
- out += `\x1B]8;;oa-cmd:voice\x07${voiceIcon}\x1B[38;5;${this._voiceActive ? 82 : TEXT_DIM}m${voiceLabel}\x1B]8;;\x07 `;
279249
- const nexusColor = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
279250
- const nexusDot = this._nexusStatus === "connected" ? "\u25CF" : this._nexusStatus === "connecting" ? "\u25CF" : "\u25CB";
279251
- out += `\x1B]8;;oa-cmd:nexus\x07\x1B[38;5;${nexusColor}m${nexusDot}\x1B[38;5;${TEXT_DIM}m nexus \x1B]8;;\x07`;
279252
- const overflow = this._overflowBtns;
279253
- if (overflow && overflow.length > 0) {
279254
- out += `\x1B[38;5;${TEXT_DIM}m\u2502 `;
279255
- for (const btn of overflow) {
279256
- out += `\x1B]8;;oa-cmd:${btn.cmd}\x07\x1B[38;5;${TEXT_DIM}m${btn.label}\x1B]8;;\x07 `;
279257
- }
279258
- }
279259
- return out;
279260
- });
279328
+ this._rebuildHeaderPanels();
279261
279329
  }
279262
279330
  if (!this._agentViews.has("main")) {
279263
279331
  this._agentViews.set("main", {
@@ -279500,22 +279568,27 @@ var init_status_bar = __esm({
279500
279568
  return this._cohereActive;
279501
279569
  }
279502
279570
  // ── Mouse tracking management ──────────────────────────────────────
279503
- // Uses ?1000h (normal tracking) instead of ?1002h (button-event tracking)
279504
- // so the terminal handles text selection natively. ?1000h reports:
279505
- // - Button press + release (header buttons, click-to-select)
279506
- // - Scroll wheel events (content scrolling)
279507
- // But does NOT capture drag/motion — the terminal handles that as
279508
- // native text selection. Users can Ctrl+Shift+C to copy normally.
279509
- /** Enable mouse tracking (clicks + scroll only — native selection works) */
279571
+ // TUI uses ?1000h (normal tracking) for native text selection.
279572
+ // Neovim mode uses ?1002h (cell-motion) for mouse=a drag support.
279573
+ // All mode transitions check neovim focus to avoid conflicts.
279574
+ /** Callback to check if neovim has focus (set by interactive.ts to avoid circular import) */
279575
+ _isNeovimFocused = null;
279576
+ /** Register neovim focus checker called from interactive.ts after neovim-mode imports */
279577
+ setNeovimFocusChecker(checker) {
279578
+ this._isNeovimFocused = checker;
279579
+ }
279580
+ /** Enable mouse tracking — respects neovim focus state */
279510
279581
  enableMouseTracking() {
279511
279582
  if (this._mouseTrackingEnabled || isOverlayActive())
279512
279583
  return;
279584
+ if (this._isNeovimFocused?.())
279585
+ return;
279513
279586
  this._mouseTrackingEnabled = true;
279514
279587
  if (process.stdout.isTTY) {
279515
279588
  this._trueStdoutWrite.call(process.stdout, "\x1B[?1000h\x1B[?1006h");
279516
279589
  }
279517
279590
  }
279518
- /** Disable mouse tracking entirely (only for overlay transitions + exit). */
279591
+ /** Disable mouse tracking entirely (overlay transitions + exit). */
279519
279592
  disableMouseTracking() {
279520
279593
  if (!this._mouseTrackingEnabled || isOverlayActive())
279521
279594
  return;
@@ -279818,6 +279891,7 @@ var init_status_bar = __esm({
279818
279891
  if (!this.active)
279819
279892
  return;
279820
279893
  setTermSize(process.stdout.rows ?? 24, process.stdout.columns ?? 80);
279894
+ this._rebuildHeaderPanels();
279821
279895
  const prevRows = this._prevTermRows;
279822
279896
  const prevCols = this._prevTermCols;
279823
279897
  this.updateFooterHeight();
@@ -288845,6 +288919,9 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`);
288845
288919
  if (process.stdout.isTTY) {
288846
288920
  process.stdout.write("\x1B[?1000h\x1B[?1006h");
288847
288921
  }
288922
+ if (process.stdout.isTTY) {
288923
+ process.stdout.write("\x1B[?1002l\x1B[?1003l");
288924
+ }
288848
288925
  } catch (err) {
288849
288926
  renderWarning(` Could not install system build deps: ${err instanceof Error ? err.message : String(err)}`);
288850
288927
  }
@@ -295353,7 +295430,7 @@ async function showExposeDashboard(gateway, rl, ctx3) {
295353
295430
  }
295354
295431
  };
295355
295432
  if (process.stdout.isTTY) {
295356
- process.stdout.write("\x1B[?1002l\x1B[?1006l");
295433
+ process.stdout.write("\x1B[?1000l\x1B[?1002l\x1B[?1006l");
295357
295434
  }
295358
295435
  process.stdin.on("data", onData);
295359
295436
  const cleanup = () => {
@@ -309736,6 +309813,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
309736
309813
  }
309737
309814
  });
309738
309815
  origTtyWriteRef = null;
309816
+ statusBar.setNeovimFocusChecker(() => isNeovimFocused());
309739
309817
  let _escapeHandler = null;
309740
309818
  statusBar.hookDirectInput(rl, () => {
309741
309819
  _escapeHandler?.();
@@ -310255,7 +310333,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
310255
310333
  }
310256
310334
  sudoPromptPending = true;
310257
310335
  if (process.stdout.isTTY) {
310258
- process.stdout.write("\x1B[?1002l\x1B[?1006l");
310336
+ process.stdout.write("\x1B[?1000l\x1B[?1002l\x1B[?1006l");
310259
310337
  }
310260
310338
  writeContent(() => {
310261
310339
  process.stdout.write(`
@@ -311867,7 +311945,8 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
311867
311945
  sessionSudoPassword = input;
311868
311946
  activeTask.runner.setSudoPassword(input);
311869
311947
  if (process.stdout.isTTY) {
311870
- process.stdout.write("\x1B[?1000h\x1B[?1006h");
311948
+ const mouseMode = isNeovimFocused() ? "\x1B[?1002h\x1B[?1006h" : "\x1B[?1000h\x1B[?1006h";
311949
+ process.stdout.write(mouseMode);
311871
311950
  }
311872
311951
  statusBar.setInputStateProvider(() => ({
311873
311952
  line: rl.line ?? "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.88",
3
+ "version": "0.187.90",
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",