open-agents-ai 0.126.0 → 0.127.0
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 +45 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -44216,14 +44216,14 @@ function createDefaultBanner(version = "0.120.0") {
|
|
|
44216
44216
|
const width = process.stdout.columns ?? 80;
|
|
44217
44217
|
const rows = 3;
|
|
44218
44218
|
const grid = [];
|
|
44219
|
-
const gradient = "
|
|
44219
|
+
const gradient = " \u2591\u2592\u2593\u2588";
|
|
44220
44220
|
for (let r = 0; r < rows; r++) {
|
|
44221
44221
|
const row = [];
|
|
44222
44222
|
for (let c3 = 0; c3 < width; c3++) {
|
|
44223
44223
|
const progress = c3 / width;
|
|
44224
44224
|
const charIdx = Math.min(gradient.length - 1, Math.floor(progress * gradient.length));
|
|
44225
|
-
const
|
|
44226
|
-
row.push({ char: gradient[charIdx], fg:
|
|
44225
|
+
const yellowShade = 232 + Math.floor(progress * 12);
|
|
44226
|
+
row.push({ char: gradient[charIdx], fg: yellowShade, bg: 0, bold: false });
|
|
44227
44227
|
}
|
|
44228
44228
|
grid.push(row);
|
|
44229
44229
|
}
|
|
@@ -44231,11 +44231,14 @@ function createDefaultBanner(version = "0.120.0") {
|
|
|
44231
44231
|
const hintText = " /cohere to engage distributed mind experiment";
|
|
44232
44232
|
const fullText = versionText + hintText;
|
|
44233
44233
|
const startCol = Math.max(2, Math.floor((width - fullText.length) / 2));
|
|
44234
|
+
for (let c3 = Math.max(0, startCol - 1); c3 < Math.min(width, startCol + fullText.length + 1); c3++) {
|
|
44235
|
+
grid[1][c3] = { char: " ", fg: -1, bg: 0, bold: false };
|
|
44236
|
+
}
|
|
44234
44237
|
for (let i = 0; i < versionText.length && startCol + i < width; i++) {
|
|
44235
|
-
grid[1][startCol + i] = { char: versionText[i], fg:
|
|
44238
|
+
grid[1][startCol + i] = { char: versionText[i], fg: 226, bg: 0, bold: true };
|
|
44236
44239
|
}
|
|
44237
44240
|
for (let i = 0; i < hintText.length && startCol + versionText.length + i < width; i++) {
|
|
44238
|
-
grid[1][startCol + versionText.length + i] = { char: hintText[i], fg:
|
|
44241
|
+
grid[1][startCol + versionText.length + i] = { char: hintText[i], fg: 178, bg: 0, bold: false };
|
|
44239
44242
|
}
|
|
44240
44243
|
return {
|
|
44241
44244
|
id: "default-header",
|
|
@@ -44302,11 +44305,38 @@ var init_banner = __esm({
|
|
|
44302
44305
|
getDesign() {
|
|
44303
44306
|
return this.currentDesign;
|
|
44304
44307
|
}
|
|
44305
|
-
/**
|
|
44308
|
+
/**
|
|
44309
|
+
* Start rendering the banner.
|
|
44310
|
+
* Sets up DECSTBM scroll region so rows 1-3 are locked at top and
|
|
44311
|
+
* content below row 4 scrolls normally without overlapping the banner.
|
|
44312
|
+
* Returns the number of rows reserved (3 banner + 1 separator = 4).
|
|
44313
|
+
*/
|
|
44306
44314
|
start() {
|
|
44307
44315
|
if (!isTTY7 || !this.currentDesign)
|
|
44308
|
-
return;
|
|
44316
|
+
return 0;
|
|
44317
|
+
const termRows = process.stdout.rows ?? 24;
|
|
44318
|
+
process.stdout.write("\x1B[1;1H");
|
|
44319
|
+
for (let i = 0; i < this.rows + 1; i++) {
|
|
44320
|
+
process.stdout.write("\x1B[2K\n");
|
|
44321
|
+
}
|
|
44322
|
+
process.stdout.write(`\x1B[${this.rows + 2};${termRows}r`);
|
|
44323
|
+
process.stdout.write(`\x1B[${this.rows + 2};1H`);
|
|
44309
44324
|
this.renderCurrentFrame();
|
|
44325
|
+
this._resizeHandler = () => {
|
|
44326
|
+
this.width = process.stdout.columns ?? 80;
|
|
44327
|
+
if (this.currentDesign) {
|
|
44328
|
+
if (this.currentDesign.type === "default") {
|
|
44329
|
+
const version = this.currentDesign.frames[0]?.grid[1]?.filter((c3) => c3.bold && c3.fg === 226).map((c3) => c3.char).join("").replace("OA-", "") || "0.0.0";
|
|
44330
|
+
this.currentDesign = createDefaultBanner(version);
|
|
44331
|
+
} else if (this.currentDesign.type === "cohere") {
|
|
44332
|
+
this.currentDesign = createCohereBanner();
|
|
44333
|
+
}
|
|
44334
|
+
const newRows = process.stdout.rows ?? 24;
|
|
44335
|
+
process.stdout.write(`\x1B[${this.rows + 2};${newRows}r`);
|
|
44336
|
+
this.renderCurrentFrame();
|
|
44337
|
+
}
|
|
44338
|
+
};
|
|
44339
|
+
process.stdout.on("resize", this._resizeHandler);
|
|
44310
44340
|
if (this.currentDesign.frames.length > 1) {
|
|
44311
44341
|
this.timer = setInterval(() => {
|
|
44312
44342
|
this.frameTick++;
|
|
@@ -44318,13 +44348,19 @@ var init_banner = __esm({
|
|
|
44318
44348
|
}
|
|
44319
44349
|
}, 66);
|
|
44320
44350
|
}
|
|
44351
|
+
return this.rows + 1;
|
|
44321
44352
|
}
|
|
44322
|
-
|
|
44353
|
+
_resizeHandler = null;
|
|
44354
|
+
/** Stop rendering and clean up */
|
|
44323
44355
|
stop() {
|
|
44324
44356
|
if (this.timer) {
|
|
44325
44357
|
clearInterval(this.timer);
|
|
44326
44358
|
this.timer = null;
|
|
44327
44359
|
}
|
|
44360
|
+
if (this._resizeHandler) {
|
|
44361
|
+
process.stdout.removeListener("resize", this._resizeHandler);
|
|
44362
|
+
this._resizeHandler = null;
|
|
44363
|
+
}
|
|
44328
44364
|
}
|
|
44329
44365
|
/** Render the current frame into the top 3 rows */
|
|
44330
44366
|
renderCurrentFrame() {
|
|
@@ -52991,8 +53027,7 @@ async function startInteractive(config, repoPath) {
|
|
|
52991
53027
|
} else {
|
|
52992
53028
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
52993
53029
|
banner.setDesign(createDefaultBanner(version));
|
|
52994
|
-
banner.start();
|
|
52995
|
-
carouselLines = 4;
|
|
53030
|
+
carouselLines = banner.start();
|
|
52996
53031
|
renderRichHeader({
|
|
52997
53032
|
model: config.model,
|
|
52998
53033
|
version,
|
package/package.json
CHANGED