open-agents-ai 0.138.19 → 0.138.21
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 +40 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -50531,7 +50531,7 @@ var init_system_metrics = __esm({
|
|
|
50531
50531
|
|
|
50532
50532
|
// packages/cli/dist/tui/status-bar.js
|
|
50533
50533
|
import { readFileSync as readFileSync31 } from "node:fs";
|
|
50534
|
-
var EXPERT_TOOL_BASELINES, CONTEXT_SWITCH_OVERHEAD, TURN_PLANNING_OVERHEAD, DEFAULT_TOOL_BASELINE, CODE_READ_CHARS_PER_SEC, PROSE_READ_CHARS_PER_SEC, MIN_CONTENT_FOR_READING, CODE_CONTENT_TOOLS, PROSE_CONTENT_TOOLS, HumanSpeedTracker, StatusBar;
|
|
50534
|
+
var EXPERT_TOOL_BASELINES, CONTEXT_SWITCH_OVERHEAD, TURN_PLANNING_OVERHEAD, DEFAULT_TOOL_BASELINE, CODE_READ_CHARS_PER_SEC, PROSE_READ_CHARS_PER_SEC, MIN_CONTENT_FOR_READING, CODE_CONTENT_TOOLS, PROSE_CONTENT_TOOLS, HumanSpeedTracker, PANEL_BG, CONTENT_BG, PANEL_BG_SEQ, CONTENT_BG_SEQ, RESET, StatusBar;
|
|
50535
50535
|
var init_status_bar = __esm({
|
|
50536
50536
|
"packages/cli/dist/tui/status-bar.js"() {
|
|
50537
50537
|
"use strict";
|
|
@@ -50695,6 +50695,11 @@ var init_status_bar = __esm({
|
|
|
50695
50695
|
return this.toolCalls > 0;
|
|
50696
50696
|
}
|
|
50697
50697
|
};
|
|
50698
|
+
PANEL_BG = 234;
|
|
50699
|
+
CONTENT_BG = 233;
|
|
50700
|
+
PANEL_BG_SEQ = `\x1B[48;5;${PANEL_BG}m`;
|
|
50701
|
+
CONTENT_BG_SEQ = `\x1B[48;5;${CONTENT_BG}m`;
|
|
50702
|
+
RESET = "\x1B[0m";
|
|
50698
50703
|
StatusBar = class _StatusBar {
|
|
50699
50704
|
metrics = {
|
|
50700
50705
|
promptTokens: 0,
|
|
@@ -51378,7 +51383,6 @@ var init_status_bar = __esm({
|
|
|
51378
51383
|
this._prevTermCols = cols;
|
|
51379
51384
|
const pos = this.rowPositions(rows);
|
|
51380
51385
|
const w = getTermWidth();
|
|
51381
|
-
const sep = `\x1B[38;5;236m${"\u2500".repeat(w)}\x1B[0m`;
|
|
51382
51386
|
const clearStart = Math.max(this.scrollRegionTop + 1, pos.scrollEnd + 1);
|
|
51383
51387
|
if (this.writeDepth > 0) {
|
|
51384
51388
|
const inputWrap = this.wrapInput(w);
|
|
@@ -51386,13 +51390,13 @@ var init_status_bar = __esm({
|
|
|
51386
51390
|
for (let row = clearStart; row <= rows; row++) {
|
|
51387
51391
|
buf += `\x1B[${row};1H\x1B[2K`;
|
|
51388
51392
|
}
|
|
51389
|
-
buf += `\x1B[${pos.bufferRow};1H${this.buildBufferContent(w)}\x1B[${pos.topSepRow};1H${
|
|
51393
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildBufferContent(w)}${RESET}\x1B[${pos.topSepRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}`;
|
|
51390
51394
|
for (let i = 0; i < inputWrap.lines.length; i++) {
|
|
51391
51395
|
const row = pos.inputStartRow + i;
|
|
51392
51396
|
const prefix = i === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
51393
51397
|
buf += `\x1B[${row};1H${prefix}${inputWrap.lines[i]}`;
|
|
51394
51398
|
}
|
|
51395
|
-
buf += `\x1B[${pos.bottomSepRow};1H${
|
|
51399
|
+
buf += `\x1B[${pos.bottomSepRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET}\x1B[?7h\x1B[${pos.scrollEnd};1H`;
|
|
51396
51400
|
process.stdout.write(buf);
|
|
51397
51401
|
} else {
|
|
51398
51402
|
this.applyScrollRegion();
|
|
@@ -51425,6 +51429,7 @@ var init_status_bar = __esm({
|
|
|
51425
51429
|
* tool event executed mid-stream will push depth to 2; its paired
|
|
51426
51430
|
* endContentWrite() drops it back to 1 without touching the footer.
|
|
51427
51431
|
*/
|
|
51432
|
+
_origWrite = null;
|
|
51428
51433
|
beginContentWrite() {
|
|
51429
51434
|
if (!this.active)
|
|
51430
51435
|
return;
|
|
@@ -51432,7 +51437,21 @@ var init_status_bar = __esm({
|
|
|
51432
51437
|
this._brailleSpinner.setMetrics({ isStreaming: true });
|
|
51433
51438
|
const rows = process.stdout.rows ?? 24;
|
|
51434
51439
|
const scrollEnd = Math.max(rows - this._currentFooterHeight, this.scrollRegionTop + 1);
|
|
51435
|
-
|
|
51440
|
+
if (this.writeDepth === 1 && !this._origWrite) {
|
|
51441
|
+
this._origWrite = process.stdout.write;
|
|
51442
|
+
const origBound = this._origWrite.bind(process.stdout);
|
|
51443
|
+
process.stdout.write = ((chunk, ...args) => {
|
|
51444
|
+
if (typeof chunk === "string") {
|
|
51445
|
+
chunk = chunk.replace(/\x1B\[0m/g, `\x1B[0m${CONTENT_BG_SEQ}`);
|
|
51446
|
+
chunk = chunk.replace(/\n/g, `\x1B[K
|
|
51447
|
+
${CONTENT_BG_SEQ}`);
|
|
51448
|
+
}
|
|
51449
|
+
return origBound(chunk, ...args);
|
|
51450
|
+
});
|
|
51451
|
+
}
|
|
51452
|
+
process.stdout.write(`\x1B[?25l` + // hide cursor
|
|
51453
|
+
CONTENT_BG_SEQ + // set content area bg (#111)
|
|
51454
|
+
`\x1B[${this.scrollRegionTop};${scrollEnd}r\x1B[${scrollEnd};1H`);
|
|
51436
51455
|
}
|
|
51437
51456
|
/**
|
|
51438
51457
|
* Call AFTER writing content to the scrollable area.
|
|
@@ -51446,6 +51465,11 @@ var init_status_bar = __esm({
|
|
|
51446
51465
|
return;
|
|
51447
51466
|
this.writeDepth = Math.max(0, this.writeDepth - 1);
|
|
51448
51467
|
if (this.writeDepth === 0) {
|
|
51468
|
+
if (this._origWrite) {
|
|
51469
|
+
process.stdout.write = this._origWrite;
|
|
51470
|
+
this._origWrite = null;
|
|
51471
|
+
}
|
|
51472
|
+
process.stdout.write(RESET);
|
|
51449
51473
|
this._brailleSpinner.setMetrics({ isStreaming: false });
|
|
51450
51474
|
this.renderFooterAndPositionInput();
|
|
51451
51475
|
}
|
|
@@ -51994,16 +52018,15 @@ var init_status_bar = __esm({
|
|
|
51994
52018
|
process.stdout.write(scrollDown);
|
|
51995
52019
|
}
|
|
51996
52020
|
}
|
|
51997
|
-
const sep = `\x1B[38;5;236m${"\u2500".repeat(w)}\x1B[0m`;
|
|
51998
52021
|
const inputWrap = this.wrapInput(w);
|
|
51999
|
-
let buf = `\x1B[?7l\x1B[${pos.bufferRow};1H\x1B[2K${this.buildBufferContent(w)}\x1B[${pos.topSepRow};1H\x1B[2K${
|
|
52022
|
+
let buf = `\x1B[?7l\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildBufferContent(w)}${RESET}\x1B[${pos.topSepRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}`;
|
|
52000
52023
|
for (let i = 0; i < inputWrap.lines.length; i++) {
|
|
52001
52024
|
const row = pos.inputStartRow + i;
|
|
52002
52025
|
const prefix = i === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
52003
|
-
buf += `\x1B[${row};1H\x1B[2K${prefix}${inputWrap.lines[i]}`;
|
|
52026
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${prefix}${inputWrap.lines[i]}${RESET}`;
|
|
52004
52027
|
}
|
|
52005
52028
|
const cursorTermRow = pos.inputStartRow + inputWrap.cursorRow;
|
|
52006
|
-
buf += `\x1B[${pos.bottomSepRow};1H\x1B[2K${
|
|
52029
|
+
buf += `\x1B[${pos.bottomSepRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET}\x1B[?7h\x1B[${cursorTermRow};${inputWrap.cursorCol}H\x1B[?25h`;
|
|
52007
52030
|
process.stdout.write(buf);
|
|
52008
52031
|
}
|
|
52009
52032
|
/**
|
|
@@ -52030,8 +52053,7 @@ var init_status_bar = __esm({
|
|
|
52030
52053
|
const rows = process.stdout.rows ?? 24;
|
|
52031
52054
|
const w = getTermWidth();
|
|
52032
52055
|
const pos = this.rowPositions(rows);
|
|
52033
|
-
const
|
|
52034
|
-
const buf = `\x1B7\x1B[?7l\x1B[${pos.bufferRow};1H\x1B[2K${this.buildBufferContent(w)}\x1B[${pos.topSepRow};1H\x1B[2K${sep}\x1B[${pos.bottomSepRow};1H\x1B[2K${sep}\x1B[${pos.metricsRow};1H\x1B[2K${this.buildMetricsLine()}\x1B[?7h\x1B8` + // DEC restore cursor
|
|
52056
|
+
const buf = `\x1B7\x1B[?7l\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildBufferContent(w)}${RESET}\x1B[${pos.topSepRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}\x1B[${pos.bottomSepRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET}\x1B[?7h\x1B8` + // DEC restore cursor
|
|
52035
52057
|
(this.writeDepth === 0 ? "\x1B[?25h" : "");
|
|
52036
52058
|
process.stdout.write(buf);
|
|
52037
52059
|
}
|
|
@@ -52066,16 +52088,15 @@ var init_status_bar = __esm({
|
|
|
52066
52088
|
buf += "\x1BM";
|
|
52067
52089
|
}
|
|
52068
52090
|
buf += "\x1B[?7l";
|
|
52069
|
-
|
|
52070
|
-
buf += `\x1B[${pos.
|
|
52071
|
-
buf += `\x1B[${pos.topSepRow};1H\x1B[2K${sep}`;
|
|
52091
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildBufferContent(w)}${RESET}`;
|
|
52092
|
+
buf += `\x1B[${pos.topSepRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}`;
|
|
52072
52093
|
for (let i = 0; i < inputWrap.lines.length; i++) {
|
|
52073
52094
|
const row = pos.inputStartRow + i;
|
|
52074
52095
|
const prefix = i === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
52075
|
-
buf += `\x1B[${row};1H\x1B[2K${prefix}${inputWrap.lines[i]}`;
|
|
52096
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${prefix}${inputWrap.lines[i]}${RESET}`;
|
|
52076
52097
|
}
|
|
52077
|
-
buf += `\x1B[${pos.bottomSepRow};1H\x1B[2K${
|
|
52078
|
-
buf += `\x1B[${pos.metricsRow};1H\x1B[2K${this.buildMetricsLine()}`;
|
|
52098
|
+
buf += `\x1B[${pos.bottomSepRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}`;
|
|
52099
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET}`;
|
|
52079
52100
|
buf += "\x1B[?7h";
|
|
52080
52101
|
buf += "\x1B8";
|
|
52081
52102
|
if (heightDelta > 0) {
|
|
@@ -52116,7 +52137,7 @@ var init_status_bar = __esm({
|
|
|
52116
52137
|
const w = getTermWidth();
|
|
52117
52138
|
const pos = this.rowPositions(rows);
|
|
52118
52139
|
const content = this.buildBufferContent(w);
|
|
52119
|
-
process.stdout.write(`\x1B7\x1B[?7l\x1B[${pos.bufferRow};1H\x1B[2K${content}\x1B[?7h\x1B8`);
|
|
52140
|
+
process.stdout.write(`\x1B7\x1B[?7l\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${content}${RESET}\x1B[?7h\x1B8`);
|
|
52120
52141
|
}
|
|
52121
52142
|
/**
|
|
52122
52143
|
* Hook into process.stdin to redraw footer after every keystroke.
|
|
@@ -53442,7 +53463,7 @@ async function startInteractive(config, repoPath) {
|
|
|
53442
53463
|
initOaDirectory(repoRoot);
|
|
53443
53464
|
const savedSettings = resolveSettings(repoRoot);
|
|
53444
53465
|
if (process.stdout.isTTY) {
|
|
53445
|
-
process.stdout.write("\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?1015l\x1B[?1049h\x1B[2J\x1B[3J\x1B[H\x1B[?25l");
|
|
53466
|
+
process.stdout.write("\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?1015l\x1B[?1049h\x1B[48;5;233m\x1B[2J\x1B[3J\x1B[H\x1B[?25l");
|
|
53446
53467
|
const restoreScreen = () => {
|
|
53447
53468
|
process.stdout.write("\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?1015l\x1B[?25h\x1B[?1049l");
|
|
53448
53469
|
};
|
package/package.json
CHANGED