open-agents-ai 0.138.9 → 0.138.11
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 +75 -31
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -44407,32 +44407,24 @@ function createDefaultBanner(version = "0.120.0") {
|
|
|
44407
44407
|
const width = process.stdout.columns ?? 80;
|
|
44408
44408
|
const rows = 3;
|
|
44409
44409
|
const grid = [];
|
|
44410
|
-
const
|
|
44411
|
-
const
|
|
44412
|
-
const fgText = 235;
|
|
44413
|
-
const halftone = ["\u2588", "\u2593", "\u2592", "\u2591", " "];
|
|
44410
|
+
const textColor = 178;
|
|
44411
|
+
const shades = [" ", "\u2591", "\u2592", "\u2593", "\u2588"];
|
|
44414
44412
|
for (let r = 0; r < rows; r++) {
|
|
44415
44413
|
const row = [];
|
|
44416
44414
|
for (let c3 = 0; c3 < width; c3++) {
|
|
44417
|
-
const
|
|
44418
|
-
|
|
44419
|
-
|
|
44420
|
-
} else {
|
|
44421
|
-
const htIdx = Math.min(halftone.length - 1, Math.floor(dist * halftone.length));
|
|
44422
|
-
row.push({ char: halftone[htIdx], fg: bgColor, bg: 0, bold: false });
|
|
44423
|
-
}
|
|
44415
|
+
const progress = c3 / (width - 1);
|
|
44416
|
+
const shadeIdx = Math.min(shades.length - 1, Math.floor(progress * shades.length));
|
|
44417
|
+
row.push({ char: shades[shadeIdx], fg: textColor, bg: 0, bold: false });
|
|
44424
44418
|
}
|
|
44425
44419
|
grid.push(row);
|
|
44426
44420
|
}
|
|
44427
|
-
const
|
|
44428
|
-
const
|
|
44429
|
-
|
|
44430
|
-
|
|
44431
|
-
for (let i = 0; i < versionText.length && startCol + i < width; i++) {
|
|
44432
|
-
grid[1][startCol + i] = { char: versionText[i], fg: fgDark, bg: bgColor, bold: true };
|
|
44421
|
+
const text = `OA v${version}`;
|
|
44422
|
+
const startCol = 2;
|
|
44423
|
+
for (let c3 = 0; c3 < Math.min(width, startCol + text.length + 2); c3++) {
|
|
44424
|
+
grid[1][c3] = { char: "\u2588", fg: textColor, bg: 0, bold: false };
|
|
44433
44425
|
}
|
|
44434
|
-
for (let i = 0; i <
|
|
44435
|
-
grid[1][startCol +
|
|
44426
|
+
for (let i = 0; i < text.length && startCol + i < width; i++) {
|
|
44427
|
+
grid[1][startCol + i] = { char: text[i], fg: 0, bg: textColor, bold: true };
|
|
44436
44428
|
}
|
|
44437
44429
|
return {
|
|
44438
44430
|
id: "default-header",
|
|
@@ -52095,28 +52087,76 @@ var init_status_bar = __esm({
|
|
|
52095
52087
|
*
|
|
52096
52088
|
* Must be called after readline is created.
|
|
52097
52089
|
*/
|
|
52090
|
+
/**
|
|
52091
|
+
* Hook into readline to intercept scroll keys AND consume mouse escape
|
|
52092
|
+
* sequences so they don't leak as garbage text into the input area.
|
|
52093
|
+
*
|
|
52094
|
+
* Uses _ttyWrite monkey-patch — this is the ONLY reliable interception
|
|
52095
|
+
* point in Node.js because readline's internal input handler can't be
|
|
52096
|
+
* pre-empted by stream listeners (they're all observers).
|
|
52097
|
+
*
|
|
52098
|
+
* Mouse SGR sequences: \x1B[<N;X;YM / \x1B[<N;X;Ym
|
|
52099
|
+
* Readline splits these across multiple _ttyWrite calls, so we also
|
|
52100
|
+
* match partial fragments like ";25M" or "[<65;".
|
|
52101
|
+
*/
|
|
52098
52102
|
hookReadlineScroll(rl) {
|
|
52099
52103
|
if (!rl || !rl._ttyWrite)
|
|
52100
52104
|
return;
|
|
52105
|
+
const self = this;
|
|
52101
52106
|
const origTtyWrite = rl._ttyWrite.bind(rl);
|
|
52102
|
-
|
|
52103
|
-
|
|
52107
|
+
let swallowingMouse = false;
|
|
52108
|
+
rl._ttyWrite = function(s, key) {
|
|
52109
|
+
if (!self.active)
|
|
52104
52110
|
return origTtyWrite(s, key);
|
|
52105
52111
|
const seq = s || "";
|
|
52112
|
+
const keySeq = key?.sequence || "";
|
|
52113
|
+
const fullMouse = /\x1B\[<(\d+);\d+;\d+[Mm]/.exec(seq) || /\x1B\[<(\d+);\d+;\d+[Mm]/.exec(keySeq);
|
|
52114
|
+
if (fullMouse) {
|
|
52115
|
+
const btn = parseInt(fullMouse[1]);
|
|
52116
|
+
if (btn === 64)
|
|
52117
|
+
self.scrollContentUp(3);
|
|
52118
|
+
else if (btn === 65)
|
|
52119
|
+
self.scrollContentDown(3);
|
|
52120
|
+
return;
|
|
52121
|
+
}
|
|
52122
|
+
if (seq.includes("\x1B[<") || seq.includes("[<")) {
|
|
52123
|
+
swallowingMouse = true;
|
|
52124
|
+
if (/[Mm]/.test(seq.slice(seq.indexOf("<")))) {
|
|
52125
|
+
const match = /(\d+)/.exec(seq.slice(seq.indexOf("<") + 1));
|
|
52126
|
+
if (match) {
|
|
52127
|
+
const btn = parseInt(match[1]);
|
|
52128
|
+
if (btn === 64)
|
|
52129
|
+
self.scrollContentUp(3);
|
|
52130
|
+
else if (btn === 65)
|
|
52131
|
+
self.scrollContentDown(3);
|
|
52132
|
+
}
|
|
52133
|
+
swallowingMouse = false;
|
|
52134
|
+
}
|
|
52135
|
+
return;
|
|
52136
|
+
}
|
|
52137
|
+
if (swallowingMouse) {
|
|
52138
|
+
if (/[Mm]/.test(seq)) {
|
|
52139
|
+
swallowingMouse = false;
|
|
52140
|
+
}
|
|
52141
|
+
return;
|
|
52142
|
+
}
|
|
52143
|
+
if (/^\d+;\d+;\d*[Mm]?$/.test(seq) || /^;\d+[Mm]$/.test(seq)) {
|
|
52144
|
+
return;
|
|
52145
|
+
}
|
|
52106
52146
|
if (key?.name === "pageup" || seq === "\x1B[5~") {
|
|
52107
|
-
|
|
52147
|
+
self.pageUpContent();
|
|
52108
52148
|
return;
|
|
52109
52149
|
}
|
|
52110
52150
|
if (key?.name === "pagedown" || seq === "\x1B[6~") {
|
|
52111
|
-
|
|
52151
|
+
self.pageDownContent();
|
|
52112
52152
|
return;
|
|
52113
52153
|
}
|
|
52114
52154
|
if (key?.shift && key?.name === "up" || seq === "\x1B[1;2A") {
|
|
52115
|
-
|
|
52155
|
+
self.scrollContentUp(3);
|
|
52116
52156
|
return;
|
|
52117
52157
|
}
|
|
52118
52158
|
if (key?.shift && key?.name === "down" || seq === "\x1B[1;2B") {
|
|
52119
|
-
|
|
52159
|
+
self.scrollContentDown(3);
|
|
52120
52160
|
return;
|
|
52121
52161
|
}
|
|
52122
52162
|
return origTtyWrite(s, key);
|
|
@@ -53312,9 +53352,9 @@ async function startInteractive(config, repoPath) {
|
|
|
53312
53352
|
initOaDirectory(repoRoot);
|
|
53313
53353
|
const savedSettings = resolveSettings(repoRoot);
|
|
53314
53354
|
if (process.stdout.isTTY && !isResumed) {
|
|
53315
|
-
process.stdout.write("\x1B[?1049h\x1B[2J\x1B[3J\x1B[H\x1B[?25l");
|
|
53355
|
+
process.stdout.write("\x1B[?1049h\x1B[2J\x1B[3J\x1B[H\x1B[?25l\x1B[?1002h\x1B[?1006h");
|
|
53316
53356
|
const restoreScreen = () => {
|
|
53317
|
-
process.stdout.write("\x1B[?25h\x1B[?1049l");
|
|
53357
|
+
process.stdout.write("\x1B[?1006l\x1B[?1002l\x1B[?25h\x1B[?1049l");
|
|
53318
53358
|
};
|
|
53319
53359
|
process.on("exit", restoreScreen);
|
|
53320
53360
|
process.on("SIGINT", () => {
|
|
@@ -53389,9 +53429,9 @@ async function startInteractive(config, repoPath) {
|
|
|
53389
53429
|
const version = getVersion3();
|
|
53390
53430
|
if (isResumed) {
|
|
53391
53431
|
if (process.stdout.isTTY) {
|
|
53392
|
-
process.stdout.write("\x1B[?1049h\x1B[2J\x1B[3J\x1B[H\x1B[?25l");
|
|
53432
|
+
process.stdout.write("\x1B[?1049h\x1B[2J\x1B[3J\x1B[H\x1B[?25l\x1B[?1002h\x1B[?1006h");
|
|
53393
53433
|
const restoreScreen = () => {
|
|
53394
|
-
process.stdout.write("\x1B[?25h\x1B[?1049l");
|
|
53434
|
+
process.stdout.write("\x1B[?1006l\x1B[?1002l\x1B[?25h\x1B[?1049l");
|
|
53395
53435
|
};
|
|
53396
53436
|
process.on("exit", restoreScreen);
|
|
53397
53437
|
process.on("SIGINT", () => {
|
|
@@ -53405,8 +53445,6 @@ async function startInteractive(config, repoPath) {
|
|
|
53405
53445
|
}
|
|
53406
53446
|
banner.setDesign(createDefaultBanner(version));
|
|
53407
53447
|
carouselLines = banner.start();
|
|
53408
|
-
const resumeMsg = hasTaskToResume ? `Updated to v${version} \u2014 picking up where you left off.` : `Updated to v${version}.`;
|
|
53409
|
-
renderInfo(resumeMsg);
|
|
53410
53448
|
} else {
|
|
53411
53449
|
process.stdout.write("\x1B[H");
|
|
53412
53450
|
banner.setDesign(createDefaultBanner(version));
|
|
@@ -53418,6 +53456,12 @@ async function startInteractive(config, repoPath) {
|
|
|
53418
53456
|
const scrollTop = carouselLines > 0 ? carouselLines + 1 : 1;
|
|
53419
53457
|
statusBar.activate(scrollTop);
|
|
53420
53458
|
statusBar.setBannerRefresh(() => banner.renderCurrentFrame());
|
|
53459
|
+
if (isResumed) {
|
|
53460
|
+
statusBar.beginContentWrite();
|
|
53461
|
+
const resumeMsg = hasTaskToResume ? `Updated to v${version} \u2014 picking up where you left off.` : `Updated to v${version}.`;
|
|
53462
|
+
renderInfo(resumeMsg);
|
|
53463
|
+
statusBar.endContentWrite();
|
|
53464
|
+
}
|
|
53421
53465
|
setContentWriteHook({
|
|
53422
53466
|
begin: () => statusBar.beginContentWrite(),
|
|
53423
53467
|
end: () => statusBar.endContentWrite(),
|
package/package.json
CHANGED