open-agents-ai 0.187.107 → 0.187.109

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 +201 -49
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -271407,7 +271407,7 @@ function layout() {
271407
271407
  const footerBoxBottom = footerMetrics - 1;
271408
271408
  const footerBoxTop = rows - fh + 1;
271409
271409
  const footerInput = footerBoxTop + 1;
271410
- const contentBottom = footerBoxTop - 1;
271410
+ const contentBottom = footerBoxTop - 1 - CONTENT_SPACER_ROWS;
271411
271411
  const contentHeight = Math.max(1, contentBottom - contentTop + 1);
271412
271412
  return {
271413
271413
  rows,
@@ -271447,12 +271447,13 @@ function termRows() {
271447
271447
  function termCols() {
271448
271448
  return _termCols;
271449
271449
  }
271450
- var HEADER_ROWS, FOOTER_MIN_ROWS, _termRows, _termCols, _footerHeight, _headerHeight;
271450
+ var HEADER_ROWS, FOOTER_MIN_ROWS, CONTENT_SPACER_ROWS, _termRows, _termCols, _footerHeight, _headerHeight;
271451
271451
  var init_layout2 = __esm({
271452
271452
  "packages/cli/dist/tui/layout.js"() {
271453
271453
  "use strict";
271454
271454
  HEADER_ROWS = 3;
271455
271455
  FOOTER_MIN_ROWS = 4;
271456
+ CONTENT_SPACER_ROWS = 1;
271456
271457
  _termRows = 24;
271457
271458
  _termCols = 80;
271458
271459
  _footerHeight = FOOTER_MIN_ROWS;
@@ -279167,13 +279168,23 @@ var init_status_bar = __esm({
279167
279168
  });
279168
279169
  }
279169
279170
  const sysItems = [];
279171
+ const trunc3 = (s2) => {
279172
+ const parts = s2.trim().split(/\s+/).slice(0, 3);
279173
+ return parts.join(" ");
279174
+ };
279175
+ if (this._activeViewId !== "main") {
279176
+ const mainLabel = ` \u21A9 main `;
279177
+ const mainColored = `\x1B[38;5;110m${mainLabel}\x1B[0m`;
279178
+ sysItems.push({ render: () => mainColored + " ", w: mainLabel.length + 1 });
279179
+ }
279170
279180
  if (this._agentViews.size > 1) {
279171
279181
  for (const view of this._agentViews.values()) {
279172
279182
  if (view.id === "main" && this._activeViewId === "main")
279173
279183
  continue;
279174
279184
  const icon = view.status === "running" ? "\u25CF" : view.status === "completed" ? "\u2713" : view.status === "failed" ? "\u2717" : "\u25CB";
279175
- const label = ` ${view.label} ${icon} `;
279176
- sysItems.push({ render: () => renderBtn(`view:${view.id}`, label) + " ", w: label.length + 1 });
279185
+ const base3 = ` ${trunc3(view.label)} ${icon} `;
279186
+ const colored = view.id === this._activeViewId ? `\x1B[1;38;5;219m${base3}\x1B[0m` : `\x1B[38;5;213m${base3}\x1B[0m`;
279187
+ sysItems.push({ render: () => renderBtn(`view:${view.id}`, colored) + " ", w: base3.length + 1 });
279177
279188
  }
279178
279189
  } else {
279179
279190
  sysItems.push({ render: () => `\x1B[38;5;${TEXT_DIM}m no sub-agents `, w: 14 });
@@ -279236,7 +279247,55 @@ var init_status_bar = __esm({
279236
279247
  const panel = this._headerPanels[this._headerPanelIndex];
279237
279248
  if (!panel)
279238
279249
  return;
279239
- const content = panel.render(innerW);
279250
+ let content = panel.render(innerW);
279251
+ this._sysClickZones = [];
279252
+ if (String(this.currentHeaderPanel).startsWith("sys-")) {
279253
+ const zones = [];
279254
+ const trunc3 = (s2) => s2.trim().split(/\s+/).slice(0, 3).join(" ");
279255
+ if (this._activeViewId !== "main") {
279256
+ const mainLabel = ` \u21A9 main `;
279257
+ zones.push({ w: mainLabel.length + 1, id: "main", render: () => "" });
279258
+ }
279259
+ if (this._agentViews.size > 1) {
279260
+ for (const view of this._agentViews.values()) {
279261
+ if (view.id === "main" && this._activeViewId === "main")
279262
+ continue;
279263
+ const icon = view.status === "running" ? "\u25CF" : view.status === "completed" ? "\u2713" : view.status === "failed" ? "\u2717" : "\u25CB";
279264
+ const base3 = ` ${trunc3(view.label)} ${icon} `;
279265
+ zones.push({ w: base3.length + 1, id: view.id, render: () => "" });
279266
+ }
279267
+ } else {
279268
+ zones.push({ w: 14, render: () => "" });
279269
+ }
279270
+ zones.push({ w: 2, render: () => "" });
279271
+ const voiceLabel = this._voiceActive ? ` ${this._voiceModelId || "voice"} ` : " voice ";
279272
+ zones.push({ w: voiceLabel.length + 2, render: () => "" });
279273
+ zones.push({ w: 9, render: () => "" });
279274
+ let pages = [];
279275
+ let cur = [];
279276
+ let used = 0;
279277
+ for (const z16 of zones) {
279278
+ if (used + z16.w > innerW && cur.length > 0) {
279279
+ pages.push(cur);
279280
+ cur = [];
279281
+ used = 0;
279282
+ }
279283
+ cur.push(z16);
279284
+ used += z16.w;
279285
+ }
279286
+ if (cur.length > 0)
279287
+ pages.push(cur);
279288
+ const idx = parseInt(String(this.currentHeaderPanel).split("-")[1] || "0", 10) || 0;
279289
+ const page2 = pages[Math.max(0, Math.min(idx, pages.length - 1))] ?? [];
279290
+ let col = 4;
279291
+ const clickZones = [];
279292
+ for (const z16 of page2) {
279293
+ if (z16.id)
279294
+ clickZones.push({ start: col, end: col + z16.w - 2, id: z16.id });
279295
+ col += z16.w;
279296
+ }
279297
+ this._sysClickZones = clickZones;
279298
+ }
279240
279299
  const hasMultiple = this._headerPanels.length > 1;
279241
279300
  const leftArrow = hasMultiple ? `\x1B]8;;oa-cmd:header-prev\x07\x1B[38;5;${TEXT_DIM}m${this._headerPanelIndex > 0 ? "\u25C0" : " "}\x1B]8;;\x07` : " ";
279242
279301
  const rightArrow = hasMultiple ? `\x1B]8;;oa-cmd:header-next\x07\x1B[38;5;${TEXT_DIM}m${this._headerPanelIndex < this._headerPanels.length - 1 ? "\u25B6" : " "}\x1B]8;;\x07` : " ";
@@ -280094,6 +280153,22 @@ var init_status_bar = __esm({
280094
280153
  return;
280095
280154
  }
280096
280155
  if (row < this.scrollRegionTop) {
280156
+ const hdrRow = layout().headerContent;
280157
+ if (type === "press" && row === hdrRow && String(this.currentHeaderPanel).startsWith("sys-")) {
280158
+ const zones = this._sysClickZones ?? [];
280159
+ const hit = zones.find((z16) => col >= z16.start && col <= z16.end);
280160
+ if (hit) {
280161
+ this.switchToView(hit.id);
280162
+ if (hit.id !== "main") {
280163
+ this.beginContentWrite();
280164
+ process.stdout.write(`
280165
+ \x1B[38;5;245mpress Esc to return to primary interface\x1B[0m
280166
+ `);
280167
+ this.endContentWrite();
280168
+ }
280169
+ return;
280170
+ }
280171
+ }
280097
280172
  const cmd = hitTestHeaderButton(row, col, w);
280098
280173
  if (type === "press" && cmd) {
280099
280174
  if (cmd === "header-prev") {
@@ -280181,7 +280256,9 @@ var init_status_bar = __esm({
280181
280256
  });
280182
280257
  if (this.active) {
280183
280258
  this.applyScrollRegion();
280259
+ this._rebuildHeaderPanels?.();
280184
280260
  this.renderFooterAndPositionInput();
280261
+ this.refreshHeaderContent();
280185
280262
  }
280186
280263
  }
280187
280264
  /** Remove a sub-agent view */
@@ -280191,7 +280268,9 @@ var init_status_bar = __esm({
280191
280268
  this.switchToView("main");
280192
280269
  if (this.active) {
280193
280270
  this.applyScrollRegion();
280271
+ this._rebuildHeaderPanels?.();
280194
280272
  this.renderFooterAndPositionInput();
280273
+ this.refreshHeaderContent();
280195
280274
  }
280196
280275
  }
280197
280276
  /** Update a sub-agent's status */
@@ -280591,6 +280670,11 @@ ${CONTENT_BG_SEQ}`);
280591
280670
  line = line.replace(/\x1B\[0m/g, `\x1B[0m${CONTENT_BG_SEQ}`);
280592
280671
  buf += `\x1B[${screenRow};1H${CONTENT_BG_SEQ}\x1B[2K${line}`;
280593
280672
  }
280673
+ const L = layout();
280674
+ const spacerRow = L.footerBoxTop - 1;
280675
+ if (spacerRow >= this.scrollRegionTop && spacerRow < this.scrollRegionTop + h + 2) {
280676
+ buf += `\x1B[${spacerRow};1H${CONTENT_BG_SEQ}\x1B[2K`;
280677
+ }
280594
280678
  if (this._contentScrollOffset > 0) {
280595
280679
  const linesAbove = startIdx;
280596
280680
  const pct = totalLines > 0 ? Math.round((startIdx + h) / totalLines * 100) : 100;
@@ -280612,7 +280696,7 @@ ${CONTENT_BG_SEQ}`);
280612
280696
  if (!this.active)
280613
280697
  return;
280614
280698
  const L = layout();
280615
- this.termWrite(`\x1B[${L.footerInput};${this.promptWidth + 1}H\x1B[?25h`);
280699
+ this.termWrite(`\x1B[${L.footerInput};${this.promptWidth + 2}H\x1B[?25h`);
280616
280700
  }
280617
280701
  /** Strip ANSI escape codes to measure visible character width */
280618
280702
  static visWidth(s2) {
@@ -281063,7 +281147,8 @@ ${CONTENT_BG_SEQ}`);
281063
281147
  return {
281064
281148
  lines,
281065
281149
  cursorRow: cursorLineIdx,
281066
- cursorCol: this.promptWidth + cursorColInLine + 1
281150
+ // +2 accounts for the left box border (│ at col 1) and the column after it
281151
+ cursorCol: this.promptWidth + cursorColInLine + 2
281067
281152
  };
281068
281153
  }
281069
281154
  /** Set the DECSTBM scroll region to exclude the dynamic footer rows */
@@ -281117,6 +281202,10 @@ ${CONTENT_BG_SEQ}`);
281117
281202
  let buf = "\x1B[?7l";
281118
281203
  const boxInner = w - 2;
281119
281204
  buf += `\x1B[${pos.inputStartRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_TL}${BOX_H.repeat(Math.max(0, boxInner))}${BOX_TR}${RESET}`;
281205
+ const spacerRow = pos.inputStartRow - 1;
281206
+ if (spacerRow >= this.scrollRegionTop) {
281207
+ buf += `\x1B[${spacerRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}`;
281208
+ }
281120
281209
  for (let i2 = 0; i2 < inputWrap.lines.length; i2++) {
281121
281210
  const row = pos.inputStartRow + 1 + i2;
281122
281211
  const prefix = i2 === 0 ? this.promptText : " ".repeat(this.promptWidth);
@@ -281147,7 +281236,10 @@ ${CONTENT_BG_SEQ}`);
281147
281236
  buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL}${BOX_H.repeat(Math.max(0, boxInner))}${BOX_BR}${RESET}`;
281148
281237
  }
281149
281238
  buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET}`;
281150
- buf += `\x1B[?7h\x1B[${cursorTermRow};${inputWrap.cursorCol}H\x1B[?25h`;
281239
+ buf += "\x1B[?7h";
281240
+ if (this.writeDepth === 0) {
281241
+ buf += `\x1B[${cursorTermRow};${inputWrap.cursorCol}H\x1B[?25h`;
281242
+ }
281151
281243
  this.termWrite(buf);
281152
281244
  }
281153
281245
  /**
@@ -298126,6 +298218,8 @@ var init_stream_renderer = __esm({
298126
298218
  startTime = 0;
298127
298219
  /** Track if we're mid-tool-arg display */
298128
298220
  inToolArgs = false;
298221
+ /** Whether to show full thinking content instead of a compact indicator */
298222
+ showThinking = false;
298129
298223
  /** Optional callback to capture rendered lines for scrollback buffer */
298130
298224
  onRenderedLine = null;
298131
298225
  /**
@@ -298156,27 +298250,39 @@ var init_stream_renderer = __esm({
298156
298250
  /** Track whether we've shown the thinking indicator */
298157
298251
  thinkingIndicatorShown = false;
298158
298252
  thinkingTokenCount = 0;
298253
+ thinkingCache = "";
298159
298254
  write(token, kind) {
298160
298255
  if (!this.enabled)
298161
298256
  return;
298162
298257
  this.tokenCount++;
298163
298258
  if (kind === "thinking") {
298164
298259
  this.thinkingTokenCount++;
298165
- if (!this.thinkingIndicatorShown) {
298166
- this.thinkingIndicatorShown = true;
298167
- this.writeRaw(dimText(" \u23BF ") + dimItalic("thinking...") + "\n");
298168
- this.lineStarted = false;
298169
- }
298170
- if (this.thinkingTokenCount % 50 === 0) {
298171
- this.writeRaw(`\x1B[1A\x1B[49m\x1B[2K${dimText(" \u23BF ")}${dimItalic(`thinking... (${this.thinkingTokenCount} tokens)`)}
298172
- `);
298260
+ if (token)
298261
+ this.thinkingCache += token;
298262
+ if (this.showThinking) {
298263
+ for (const char of token) {
298264
+ this.lineBuffer += char;
298265
+ if (char === "\n")
298266
+ this.flushLine("thinking");
298267
+ }
298268
+ this.scheduleFlush("thinking");
298269
+ return;
298270
+ } else {
298271
+ if (!this.thinkingIndicatorShown) {
298272
+ this.thinkingIndicatorShown = true;
298273
+ this.writeRaw(dimText(" \u23BF ") + dimItalic("thinking...") + "\n");
298274
+ this.lineStarted = false;
298275
+ }
298276
+ if (this.thinkingTokenCount % 50 === 0) {
298277
+ this.writeRaw(dimText(" \u23BF ") + dimItalic(`thinking... (${this.thinkingTokenCount} tokens)`) + "\n");
298278
+ this.lineStarted = false;
298279
+ }
298280
+ return;
298173
298281
  }
298174
- return;
298175
298282
  }
298176
298283
  if (this.thinkingIndicatorShown && kind === "content") {
298177
298284
  this.thinkingIndicatorShown = false;
298178
- this.writeRaw(`\x1B[1A\x1B[49m\x1B[2K${dimText(" \u23BF ")}${dimItalic(`thought for ${this.thinkingTokenCount} tokens`)}
298179
- `);
298285
+ this.writeRaw(dimText(" \u23BF ") + dimItalic(`thought for ${this.thinkingTokenCount} tokens`) + "\n");
298180
298286
  this.thinkingTokenCount = 0;
298181
298287
  this.lineStarted = false;
298182
298288
  }
@@ -298237,17 +298343,15 @@ var init_stream_renderer = __esm({
298237
298343
  if (line.includes("<think>")) {
298238
298344
  this.inThinkBlock = true;
298239
298345
  const after = line.replace(/<think>/g, "");
298240
- if (after.trim()) {
298241
- this.writeHighlighted(after, "thinking");
298242
- }
298346
+ if (after.trim())
298347
+ this.writeHighlighted(after, this.showThinking ? "thinking" : "content");
298243
298348
  return;
298244
298349
  }
298245
298350
  if (line.includes("</think>")) {
298246
298351
  this.inThinkBlock = false;
298247
298352
  const after = line.replace(/<\/think>/g, "");
298248
- if (after.trim()) {
298353
+ if (after.trim())
298249
298354
  this.writeHighlighted(after, "content");
298250
- }
298251
298355
  return;
298252
298356
  }
298253
298357
  const trimmedLine = line.replace(/\n$/, "");
@@ -298268,6 +298372,10 @@ var init_stream_renderer = __esm({
298268
298372
  const effectiveKind = this.inThinkBlock ? "thinking" : kind;
298269
298373
  this.writeHighlighted(line, effectiveKind);
298270
298374
  }
298375
+ /** Return accumulated thinking content so far */
298376
+ dumpThinkingCache() {
298377
+ return this.thinkingCache;
298378
+ }
298271
298379
  /**
298272
298380
  * Write a highlighted line/fragment to stdout.
298273
298381
  */
@@ -298303,40 +298411,52 @@ var init_stream_renderer = __esm({
298303
298411
  case "tool_args":
298304
298412
  rendered = this.highlightJson(raw, true);
298305
298413
  break;
298306
- case "content": {
298307
- const maxW = termCols() - 6;
298308
- if (this.inCodeBlock) {
298309
- const cropped = raw.length > maxW ? raw.slice(0, maxW - 3) + "..." : raw;
298310
- if (this.codeLang === "diff" || this.codeLang === "patch") {
298311
- rendered = this.highlightDiff(cropped);
298312
- } else if (this.codeLang === "bash" || this.codeLang === "sh" || this.codeLang === "shell" || this.codeLang === "zsh") {
298313
- rendered = this.highlightShell(cropped);
298414
+ case "content":
298415
+ {
298416
+ const maxW = termCols() - 6;
298417
+ if (this.inCodeBlock) {
298418
+ const cropped = raw.length > maxW ? raw.slice(0, maxW - 3) + "..." : raw;
298419
+ if (this.codeLang === "diff" || this.codeLang === "patch") {
298420
+ rendered = this.highlightDiff(cropped);
298421
+ } else if (this.codeLang === "bash" || this.codeLang === "sh" || this.codeLang === "shell" || this.codeLang === "zsh") {
298422
+ rendered = this.highlightShell(cropped);
298423
+ } else {
298424
+ rendered = this.highlightCode(cropped);
298425
+ }
298426
+ } else if (this.looksLikeJson(raw)) {
298427
+ const cropped = raw.length > maxW ? raw.slice(0, maxW - 3) + "..." : raw;
298428
+ rendered = this.highlightJson(cropped, false);
298314
298429
  } else {
298315
- rendered = this.highlightCode(cropped);
298316
- }
298317
- } else if (this.looksLikeJson(raw)) {
298318
- const cropped = raw.length > maxW ? raw.slice(0, maxW - 3) + "..." : raw;
298319
- rendered = this.highlightJson(cropped, false);
298320
- } else {
298321
- if (hasNewline && raw.length > maxW) {
298322
- const wrapped = this.wordWrap(raw, maxW);
298323
- for (let i2 = 0; i2 < wrapped.length; i2++) {
298324
- const lp = i2 === 0 ? prefix : " ";
298325
- const isLast = i2 === wrapped.length - 1;
298326
- this.writeRaw(dimText(lp) + this.highlightMarkdown(wrapped[i2]) + (isLast ? "\n" : "\n"));
298430
+ if (hasNewline && raw.length > maxW) {
298431
+ const wrapped = this.wordWrap(raw, maxW);
298432
+ for (let i2 = 0; i2 < wrapped.length; i2++) {
298433
+ const lp = i2 === 0 ? prefix : " ";
298434
+ const isLast = i2 === wrapped.length - 1;
298435
+ this.writeRaw(dimText(lp) + this.highlightMarkdown(wrapped[i2]) + (isLast ? "\n" : "\n"));
298436
+ }
298437
+ this.lineStarted = false;
298438
+ return;
298327
298439
  }
298328
- this.lineStarted = false;
298329
- return;
298440
+ const cropped = raw.length > maxW ? raw.slice(0, maxW) : raw;
298441
+ rendered = this.highlightMarkdown(cropped);
298330
298442
  }
298331
- const cropped = raw.length > maxW ? raw.slice(0, maxW) : raw;
298332
- rendered = this.highlightMarkdown(cropped);
298443
+ break;
298333
298444
  }
298334
298445
  break;
298335
- }
298446
+ case "thinking":
298447
+ rendered = dimItalic(raw);
298448
+ break;
298336
298449
  }
298337
298450
  this.writeRaw(dimText(prefix) + rendered + (hasNewline ? "\n" : ""));
298338
298451
  this.lineStarted = !hasNewline;
298339
298452
  }
298453
+ /** Toggle visibility of full thinking content */
298454
+ setThinkingVisible(visible) {
298455
+ this.showThinking = visible;
298456
+ }
298457
+ getThinkingVisible() {
298458
+ return this.showThinking;
298459
+ }
298340
298460
  /** Write raw ANSI text to stdout and capture for scrollback.
298341
298461
  * Wraps each write in autowrap-disable (DECAWM off) to prevent the terminal
298342
298462
  * from injecting line breaks when a token fragment reaches the right edge. */
@@ -310398,6 +310518,30 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
310398
310518
  passwordShowPlain = !passwordShowPlain;
310399
310519
  if (statusBar.isActive)
310400
310520
  statusBar.handleResize();
310521
+ } else {
310522
+ const current = streamRenderer.getThinkingVisible?.() ?? false;
310523
+ streamRenderer.setThinkingVisible?.(!current);
310524
+ if (statusBar.isActive) {
310525
+ statusBar.beginContentWrite();
310526
+ if (!current) {
310527
+ const dump = streamRenderer.dumpThinkingCache?.() || "";
310528
+ if (dump.trim()) {
310529
+ process.stdout.write(`
310530
+ ${c3.dim(c3.italic("[expanded thinking]"))}
310531
+ `);
310532
+ for (const line of dump.split("\n")) {
310533
+ if (line.trim().length === 0)
310534
+ continue;
310535
+ process.stdout.write(" " + c3.dim(c3.italic(line)) + "\n");
310536
+ }
310537
+ } else {
310538
+ renderInfo("Thinking visibility: shown");
310539
+ }
310540
+ } else {
310541
+ renderInfo("Thinking visibility: hidden");
310542
+ }
310543
+ statusBar.endContentWrite();
310544
+ }
310401
310545
  }
310402
310546
  });
310403
310547
  let commandCtxRef = null;
@@ -313070,6 +313214,14 @@ ${c3.dim("(Use /quit to exit)")}
313070
313214
  showPrompt();
313071
313215
  });
313072
313216
  _escapeHandler = () => {
313217
+ if (!activeTask && statusBar.activeViewId !== "main") {
313218
+ statusBar.switchToView("main");
313219
+ statusBar.beginContentWrite();
313220
+ renderInfo("Returned to primary interface");
313221
+ statusBar.endContentWrite();
313222
+ showPrompt();
313223
+ return;
313224
+ }
313073
313225
  if (_recallText !== null) {
313074
313226
  const recalled = _recallText;
313075
313227
  _recallText = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.107",
3
+ "version": "0.187.109",
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",