open-agents-ai 0.184.46 → 0.184.47

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 +25 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -53597,14 +53597,14 @@ var init_stream_renderer = __esm({
53597
53597
  this.lineStarted = false;
53598
53598
  }
53599
53599
  if (this.thinkingTokenCount % 50 === 0) {
53600
- process.stdout.write(`\x1B[1A\x1B[2K${dimText(" \u23BF ")}${dimItalic(`thinking... (${this.thinkingTokenCount} tokens)`)}
53600
+ this.writeRaw(`\x1B[1A\x1B[2K${dimText(" \u23BF ")}${dimItalic(`thinking... (${this.thinkingTokenCount} tokens)`)}
53601
53601
  `);
53602
53602
  }
53603
53603
  return;
53604
53604
  }
53605
53605
  if (this.thinkingIndicatorShown && kind === "content") {
53606
53606
  this.thinkingIndicatorShown = false;
53607
- process.stdout.write(`\x1B[1A\x1B[2K${dimText(" \u23BF ")}${dimItalic(`thought for ${this.thinkingTokenCount} tokens`)}
53607
+ this.writeRaw(`\x1B[1A\x1B[2K${dimText(" \u23BF ")}${dimItalic(`thought for ${this.thinkingTokenCount} tokens`)}
53608
53608
  `);
53609
53609
  this.thinkingTokenCount = 0;
53610
53610
  this.lineStarted = false;
@@ -53747,17 +53747,18 @@ var init_stream_renderer = __esm({
53747
53747
  const cropped = raw.length > maxW ? raw.slice(0, maxW - 3) + "..." : raw;
53748
53748
  rendered = this.highlightJson(cropped, false);
53749
53749
  } else {
53750
- if (raw.length > maxW) {
53750
+ if (hasNewline && raw.length > maxW) {
53751
53751
  const wrapped = this.wordWrap(raw, maxW);
53752
53752
  for (let i = 0; i < wrapped.length; i++) {
53753
53753
  const lp = i === 0 ? prefix : " ";
53754
53754
  const isLast = i === wrapped.length - 1;
53755
- this.writeRaw(dimText(lp) + this.highlightMarkdown(wrapped[i]) + (isLast && !hasNewline ? "" : "\n"));
53755
+ this.writeRaw(dimText(lp) + this.highlightMarkdown(wrapped[i]) + (isLast ? "\n" : "\n"));
53756
53756
  }
53757
- this.lineStarted = !hasNewline;
53757
+ this.lineStarted = false;
53758
53758
  return;
53759
53759
  }
53760
- rendered = this.highlightMarkdown(raw);
53760
+ const cropped = raw.length > maxW ? raw.slice(0, maxW) : raw;
53761
+ rendered = this.highlightMarkdown(cropped);
53761
53762
  }
53762
53763
  break;
53763
53764
  }
@@ -53765,9 +53766,15 @@ var init_stream_renderer = __esm({
53765
53766
  this.writeRaw(dimText(prefix) + rendered + (hasNewline ? "\n" : ""));
53766
53767
  this.lineStarted = !hasNewline;
53767
53768
  }
53768
- /** Write raw ANSI text to stdout and capture for scrollback */
53769
+ /** Write raw ANSI text to stdout and capture for scrollback.
53770
+ * Wraps each write in autowrap-disable (DECAWM off) to prevent the terminal
53771
+ * from injecting line breaks when a token fragment reaches the right edge. */
53769
53772
  writeRaw(text) {
53770
- process.stdout.write(text);
53773
+ if (isTTY8) {
53774
+ process.stdout.write(`\x1B[?7l${text}\x1B[?7h`);
53775
+ } else {
53776
+ process.stdout.write(text);
53777
+ }
53771
53778
  if (this.onRenderedLine) {
53772
53779
  const parts = text.split("\n");
53773
53780
  for (let i = 0; i < parts.length - 1; i++) {
@@ -53780,6 +53787,16 @@ var init_stream_renderer = __esm({
53780
53787
  }
53781
53788
  /** Flush partial buffer (non-newline-terminated tokens) */
53782
53789
  flushPartial(kind) {
53790
+ if (this.lineBuffer.length === 0)
53791
+ return;
53792
+ if (this.lineBuffer.includes("<think>")) {
53793
+ this.inThinkBlock = true;
53794
+ this.lineBuffer = this.lineBuffer.replace(/<think>/g, "");
53795
+ }
53796
+ if (this.lineBuffer.includes("</think>")) {
53797
+ this.inThinkBlock = false;
53798
+ this.lineBuffer = this.lineBuffer.replace(/<\/think>/g, "");
53799
+ }
53783
53800
  if (this.lineBuffer.length === 0)
53784
53801
  return;
53785
53802
  const effectiveKind = this.inThinkBlock ? "thinking" : kind;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.184.46",
3
+ "version": "0.184.47",
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",