open-agents-ai 0.184.46 → 0.184.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.
- package/dist/index.js +43 -10
- 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
|
-
|
|
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
|
-
|
|
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
|
|
53755
|
+
this.writeRaw(dimText(lp) + this.highlightMarkdown(wrapped[i]) + (isLast ? "\n" : "\n"));
|
|
53756
53756
|
}
|
|
53757
|
-
this.lineStarted =
|
|
53757
|
+
this.lineStarted = false;
|
|
53758
53758
|
return;
|
|
53759
53759
|
}
|
|
53760
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -64629,6 +64646,8 @@ Review its full output in the [${id}] tab or via full_sub_agent(action='output',
|
|
|
64629
64646
|
const costTracker = new CostTracker(provider.id);
|
|
64630
64647
|
const sessionMetrics = new SessionMetrics();
|
|
64631
64648
|
const workEvaluator = new WorkEvaluator();
|
|
64649
|
+
let setupReady = false;
|
|
64650
|
+
const setupTasks = [];
|
|
64632
64651
|
ensureTranscribeCliBackground();
|
|
64633
64652
|
ensureCloudflaredBackground((msg) => {
|
|
64634
64653
|
if (statusBar?.isActive) {
|
|
@@ -64639,7 +64658,7 @@ Review its full output in the [${id}] tab or via full_sub_agent(action='output',
|
|
|
64639
64658
|
});
|
|
64640
64659
|
let depSudoResolver = null;
|
|
64641
64660
|
let depSudoPromptPending = false;
|
|
64642
|
-
ensureVisionDeps((msg) => {
|
|
64661
|
+
const visionDepsPromise = ensureVisionDeps((msg) => {
|
|
64643
64662
|
if (statusBar?.isActive) {
|
|
64644
64663
|
statusBar.beginContentWrite();
|
|
64645
64664
|
renderInfo(msg);
|
|
@@ -64669,6 +64688,8 @@ Review its full output in the [${id}] tab or via full_sub_agent(action='output',
|
|
|
64669
64688
|
}
|
|
64670
64689
|
})).catch(() => {
|
|
64671
64690
|
});
|
|
64691
|
+
setupTasks.push(visionDepsPromise.catch(() => {
|
|
64692
|
+
}));
|
|
64672
64693
|
let updateNotified = false;
|
|
64673
64694
|
if (!isResumed) {
|
|
64674
64695
|
checkForUpdate(version).then((updateInfo) => {
|
|
@@ -65158,7 +65179,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
65158
65179
|
}
|
|
65159
65180
|
return fn();
|
|
65160
65181
|
}
|
|
65161
|
-
(async () => {
|
|
65182
|
+
const startupChecksPromise = (async () => {
|
|
65162
65183
|
if (!isResumed && !isFirstRun()) {
|
|
65163
65184
|
try {
|
|
65164
65185
|
const available = await isModelAvailable(currentConfig);
|
|
@@ -65351,6 +65372,8 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
65351
65372
|
}
|
|
65352
65373
|
})().catch(() => {
|
|
65353
65374
|
});
|
|
65375
|
+
setupTasks.push(startupChecksPromise.catch(() => {
|
|
65376
|
+
}));
|
|
65354
65377
|
Promise.resolve().then(() => (init_serve(), serve_exports)).then(({ startApiServer: startApiServer2 }) => {
|
|
65355
65378
|
const apiPort = parseInt(process.env["OA_PORT"] || "11435", 10);
|
|
65356
65379
|
const apiServer = startApiServer2({
|
|
@@ -66655,6 +66678,14 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
66655
66678
|
headerBtnQueue = null;
|
|
66656
66679
|
setTimeout(() => statusBar.fireHeaderButton?.(queued), 100);
|
|
66657
66680
|
}
|
|
66681
|
+
if (setupTasks.length > 0 && !isResumed) {
|
|
66682
|
+
statusBar.setPromptText(" setting up...", 0);
|
|
66683
|
+
const setupTimeout = new Promise((r) => setTimeout(r, 15e3));
|
|
66684
|
+
await Promise.race([Promise.all(setupTasks), setupTimeout]);
|
|
66685
|
+
setupReady = true;
|
|
66686
|
+
} else {
|
|
66687
|
+
setupReady = true;
|
|
66688
|
+
}
|
|
66658
66689
|
showPrompt();
|
|
66659
66690
|
if (!isResumed) {
|
|
66660
66691
|
const savedCtx = loadSessionContext(repoRoot);
|
|
@@ -66822,6 +66853,8 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
|
|
|
66822
66853
|
};
|
|
66823
66854
|
};
|
|
66824
66855
|
rl.on("line", (line) => {
|
|
66856
|
+
if (!setupReady)
|
|
66857
|
+
return;
|
|
66825
66858
|
persistHistoryLine(line);
|
|
66826
66859
|
const input = line.trim();
|
|
66827
66860
|
if (!input) {
|
package/package.json
CHANGED