open-agents-ai 0.187.129 → 0.187.131
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.
- package/dist/index.js +35 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -264670,6 +264670,7 @@ ${description}`
|
|
|
264670
264670
|
async streamingRequest(request, turn) {
|
|
264671
264671
|
const backend = this.backend;
|
|
264672
264672
|
let content = "";
|
|
264673
|
+
let thinkingContent = "";
|
|
264673
264674
|
let inThinkTag = false;
|
|
264674
264675
|
const toolCallAccumulators = /* @__PURE__ */ new Map();
|
|
264675
264676
|
let streamUsage;
|
|
@@ -264703,18 +264704,21 @@ ${description}`
|
|
|
264703
264704
|
}
|
|
264704
264705
|
if (kind === "content") {
|
|
264705
264706
|
content += fragment;
|
|
264706
|
-
|
|
264707
|
-
|
|
264708
|
-
|
|
264709
|
-
|
|
264710
|
-
|
|
264711
|
-
|
|
264712
|
-
|
|
264713
|
-
|
|
264714
|
-
|
|
264715
|
-
|
|
264716
|
-
|
|
264717
|
-
|
|
264707
|
+
} else {
|
|
264708
|
+
thinkingContent += fragment;
|
|
264709
|
+
}
|
|
264710
|
+
const buf = kind === "content" ? content : thinkingContent;
|
|
264711
|
+
if (buf.length > 400 && buf.length % 200 < fragment.length) {
|
|
264712
|
+
const half = Math.floor(buf.length / 2);
|
|
264713
|
+
const firstHalf = buf.slice(half - 150, half);
|
|
264714
|
+
const secondHalf = buf.slice(-150);
|
|
264715
|
+
if (firstHalf.length >= 100 && firstHalf === secondHalf) {
|
|
264716
|
+
this.emit({
|
|
264717
|
+
type: "status",
|
|
264718
|
+
content: `Aborting generation \u2014 intra-response repetition detected in ${kind} (model stuck in loop)`,
|
|
264719
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
264720
|
+
});
|
|
264721
|
+
break;
|
|
264718
264722
|
}
|
|
264719
264723
|
}
|
|
264720
264724
|
this.emit({
|
|
@@ -280228,6 +280232,9 @@ var init_status_bar = __esm({
|
|
|
280228
280232
|
const fh = this._currentFooterHeight;
|
|
280229
280233
|
const footerStart = termRows() - fh + 1;
|
|
280230
280234
|
if (row >= footerStart) return;
|
|
280235
|
+
if (type === "press" || type === "drag") {
|
|
280236
|
+
this.disableMouseTracking();
|
|
280237
|
+
}
|
|
280231
280238
|
}
|
|
280232
280239
|
/** Copy current selection to clipboard. Returns true if copied. */
|
|
280233
280240
|
copySelection() {
|
|
@@ -280495,6 +280502,8 @@ var init_status_bar = __esm({
|
|
|
280495
280502
|
_origWrite = null;
|
|
280496
280503
|
/** True stdout.write captured at construction — immune to interceptor stacking */
|
|
280497
280504
|
_trueStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
280505
|
+
/** Only buffer actual content lines (not footer/scroll-region maintenance) */
|
|
280506
|
+
_bufferContent = false;
|
|
280498
280507
|
/** Write directly to the terminal, bypassing content bg/scrollback monkey-patch.
|
|
280499
280508
|
* ALL footer/input/braille rendering MUST use this, never process.stdout.write.
|
|
280500
280509
|
* Respects overlay isolation — when tuiSelect/dropPanel is on alt screen,
|
|
@@ -280535,9 +280544,11 @@ var init_status_bar = __esm({
|
|
|
280535
280544
|
else if (Buffer.isBuffer(chunk)) text = chunk.toString();
|
|
280536
280545
|
else text = String(chunk);
|
|
280537
280546
|
const lines = text.split("\n");
|
|
280538
|
-
|
|
280539
|
-
const
|
|
280540
|
-
|
|
280547
|
+
if (self2._bufferContent && !isOverlayActive()) {
|
|
280548
|
+
for (const line of lines) {
|
|
280549
|
+
const visible = line.replace(/\x1B\[[0-9;]*[A-Za-z]/g, "");
|
|
280550
|
+
if (visible.trim().length > 0) self2.bufferContentLine(line);
|
|
280551
|
+
}
|
|
280541
280552
|
}
|
|
280542
280553
|
if (typeof chunk === "string") {
|
|
280543
280554
|
chunk = chunk.replace(/\x1B\[0m/g, `\x1B[0m${CONTENT_BG_SEQ}`).replace(/\n/g, `\x1B[K
|
|
@@ -280550,14 +280561,13 @@ ${CONTENT_BG_SEQ}`);
|
|
|
280550
280561
|
process.stdout.write = bufferedWrite;
|
|
280551
280562
|
}
|
|
280552
280563
|
this.termWrite("\x1B[?2026h");
|
|
280553
|
-
process.stdout
|
|
280554
|
-
|
|
280555
|
-
|
|
280556
|
-
`\x1B[${this.scrollRegionTop};${scrollEnd}r\x1B[${scrollEnd};1H`
|
|
280557
|
-
);
|
|
280564
|
+
this._trueStdoutWrite.call(process.stdout, `\x1B[?25l${CONTENT_BG_SEQ}`);
|
|
280565
|
+
this._trueStdoutWrite.call(process.stdout, `\x1B[${this.scrollRegionTop};${scrollEnd}r`);
|
|
280566
|
+
this._trueStdoutWrite.call(process.stdout, `\x1B[${scrollEnd};1H`);
|
|
280558
280567
|
this.renderFooterAndPositionInput();
|
|
280559
|
-
process.stdout
|
|
280568
|
+
this._trueStdoutWrite.call(process.stdout, `\x1B[${scrollEnd};1H`);
|
|
280560
280569
|
this.termWrite("\x1B[?2026l");
|
|
280570
|
+
this._bufferContent = true;
|
|
280561
280571
|
}
|
|
280562
280572
|
/**
|
|
280563
280573
|
* Call AFTER writing content to the scrollable area.
|
|
@@ -280570,6 +280580,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
280570
280580
|
if (!this.active) return;
|
|
280571
280581
|
this.writeDepth = Math.max(0, this.writeDepth - 1);
|
|
280572
280582
|
if (this.writeDepth === 0) {
|
|
280583
|
+
this._bufferContent = false;
|
|
280573
280584
|
if (this._origWrite) {
|
|
280574
280585
|
try {
|
|
280575
280586
|
delete process.stdout.write.__oa_oaWriteLayer;
|
|
@@ -309952,9 +309963,9 @@ ${opts.systemPromptAddition}` : `Working directory: ${repoRoot}`;
|
|
|
309952
309963
|
setContentWriteHook({
|
|
309953
309964
|
begin: () => statusBar.beginContentWrite(),
|
|
309954
309965
|
end: () => statusBar.endContentWrite(),
|
|
309955
|
-
//
|
|
309956
|
-
//
|
|
309957
|
-
redirect: () => isNeovimActive() ? writeToNeovimOutput : null
|
|
309966
|
+
// During overlays, send render output to the alternate screen via overlayWrite;
|
|
309967
|
+
// in neovim mode, route to the Agent Output pane. Otherwise, null (normal).
|
|
309968
|
+
redirect: () => isOverlayActive() ? overlayWrite : isNeovimActive() ? writeToNeovimOutput : null
|
|
309958
309969
|
});
|
|
309959
309970
|
}
|
|
309960
309971
|
setContentWriteHook({
|
package/package.json
CHANGED