open-agents-ai 0.125.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 +59 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -42485,9 +42485,13 @@ async function handleUpdate(subcommand, ctx) {
|
|
|
42485
42485
|
if (needsSudo) {
|
|
42486
42486
|
process.stdout.write("\x1B[?1049l");
|
|
42487
42487
|
renderInfo("Global npm directory requires elevated permissions.");
|
|
42488
|
+
renderInfo("Enter your password if prompted...");
|
|
42488
42489
|
safeWrite("\n");
|
|
42489
42490
|
try {
|
|
42490
|
-
|
|
42491
|
+
const { spawnSync } = await import("node:child_process");
|
|
42492
|
+
const sudoResult = spawnSync("sudo", ["-v"], { stdio: "inherit", timeout: 6e4 });
|
|
42493
|
+
if (sudoResult.status !== 0)
|
|
42494
|
+
throw new Error("sudo failed");
|
|
42491
42495
|
} catch {
|
|
42492
42496
|
renderWarning("Could not acquire sudo credentials. Try: sudo npm i -g open-agents-ai");
|
|
42493
42497
|
return;
|
|
@@ -42507,17 +42511,22 @@ async function handleUpdate(subcommand, ctx) {
|
|
|
42507
42511
|
const installCmd = `${sudoPrefix}npm install -g open-agents-ai@latest --prefer-online`;
|
|
42508
42512
|
let installOk = await runInstall2(installCmd);
|
|
42509
42513
|
if (!installOk && /ENOTEMPTY|errno -39/i.test(installError)) {
|
|
42510
|
-
installSpinner.stop("
|
|
42514
|
+
installSpinner.stop("ENOTEMPTY \u2014 cleaning stale npm artifacts...");
|
|
42515
|
+
process.stdout.write(` ${c2.dim("\u2502")} Removing stale temp directories and npm cache...
|
|
42516
|
+
`);
|
|
42511
42517
|
try {
|
|
42512
42518
|
const prefix = await execA("npm prefix -g", { timeout: 5e3 });
|
|
42513
42519
|
const globalModules = prefix.endsWith("/lib") ? prefix + "/node_modules" : prefix + "/lib/node_modules";
|
|
42514
|
-
await execA(`${sudoPrefix}find "${globalModules}" -maxdepth 1 -name ".open-agents
|
|
42520
|
+
await execA(`${sudoPrefix}find "${globalModules}" -maxdepth 1 -name ".open-agents*" -type d -exec rm -rf {} + 2>/dev/null || true`, { timeout: 15e3 });
|
|
42515
42521
|
await execA(`${sudoPrefix}rm -rf "${globalModules}/open-agents-ai" 2>/dev/null || true`, { timeout: 15e3 });
|
|
42522
|
+
await execA(`${sudoPrefix}npm cache clean --force 2>/dev/null || true`, { timeout: 3e4 });
|
|
42516
42523
|
} catch {
|
|
42517
42524
|
}
|
|
42518
|
-
|
|
42525
|
+
process.stdout.write(` ${c2.dim("\u2502")} Retrying with --force...
|
|
42526
|
+
`);
|
|
42527
|
+
const retrySpinner = startInlineSpinner("Retrying install (force)");
|
|
42519
42528
|
installError = "";
|
|
42520
|
-
installOk = await runInstall2(
|
|
42529
|
+
installOk = await runInstall2(`${sudoPrefix}npm install -g open-agents-ai@latest --force --prefer-online`);
|
|
42521
42530
|
if (!installOk) {
|
|
42522
42531
|
retrySpinner.stop("Retry failed.");
|
|
42523
42532
|
} else {
|
|
@@ -44207,14 +44216,14 @@ function createDefaultBanner(version = "0.120.0") {
|
|
|
44207
44216
|
const width = process.stdout.columns ?? 80;
|
|
44208
44217
|
const rows = 3;
|
|
44209
44218
|
const grid = [];
|
|
44210
|
-
const gradient = "
|
|
44219
|
+
const gradient = " \u2591\u2592\u2593\u2588";
|
|
44211
44220
|
for (let r = 0; r < rows; r++) {
|
|
44212
44221
|
const row = [];
|
|
44213
44222
|
for (let c3 = 0; c3 < width; c3++) {
|
|
44214
44223
|
const progress = c3 / width;
|
|
44215
44224
|
const charIdx = Math.min(gradient.length - 1, Math.floor(progress * gradient.length));
|
|
44216
|
-
const
|
|
44217
|
-
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 });
|
|
44218
44227
|
}
|
|
44219
44228
|
grid.push(row);
|
|
44220
44229
|
}
|
|
@@ -44222,11 +44231,14 @@ function createDefaultBanner(version = "0.120.0") {
|
|
|
44222
44231
|
const hintText = " /cohere to engage distributed mind experiment";
|
|
44223
44232
|
const fullText = versionText + hintText;
|
|
44224
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
|
+
}
|
|
44225
44237
|
for (let i = 0; i < versionText.length && startCol + i < width; i++) {
|
|
44226
|
-
grid[1][startCol + i] = { char: versionText[i], fg:
|
|
44238
|
+
grid[1][startCol + i] = { char: versionText[i], fg: 226, bg: 0, bold: true };
|
|
44227
44239
|
}
|
|
44228
44240
|
for (let i = 0; i < hintText.length && startCol + versionText.length + i < width; i++) {
|
|
44229
|
-
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 };
|
|
44230
44242
|
}
|
|
44231
44243
|
return {
|
|
44232
44244
|
id: "default-header",
|
|
@@ -44293,11 +44305,38 @@ var init_banner = __esm({
|
|
|
44293
44305
|
getDesign() {
|
|
44294
44306
|
return this.currentDesign;
|
|
44295
44307
|
}
|
|
44296
|
-
/**
|
|
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
|
+
*/
|
|
44297
44314
|
start() {
|
|
44298
44315
|
if (!isTTY7 || !this.currentDesign)
|
|
44299
|
-
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`);
|
|
44300
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);
|
|
44301
44340
|
if (this.currentDesign.frames.length > 1) {
|
|
44302
44341
|
this.timer = setInterval(() => {
|
|
44303
44342
|
this.frameTick++;
|
|
@@ -44309,13 +44348,19 @@ var init_banner = __esm({
|
|
|
44309
44348
|
}
|
|
44310
44349
|
}, 66);
|
|
44311
44350
|
}
|
|
44351
|
+
return this.rows + 1;
|
|
44312
44352
|
}
|
|
44313
|
-
|
|
44353
|
+
_resizeHandler = null;
|
|
44354
|
+
/** Stop rendering and clean up */
|
|
44314
44355
|
stop() {
|
|
44315
44356
|
if (this.timer) {
|
|
44316
44357
|
clearInterval(this.timer);
|
|
44317
44358
|
this.timer = null;
|
|
44318
44359
|
}
|
|
44360
|
+
if (this._resizeHandler) {
|
|
44361
|
+
process.stdout.removeListener("resize", this._resizeHandler);
|
|
44362
|
+
this._resizeHandler = null;
|
|
44363
|
+
}
|
|
44319
44364
|
}
|
|
44320
44365
|
/** Render the current frame into the top 3 rows */
|
|
44321
44366
|
renderCurrentFrame() {
|
|
@@ -52982,8 +53027,7 @@ async function startInteractive(config, repoPath) {
|
|
|
52982
53027
|
} else {
|
|
52983
53028
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
52984
53029
|
banner.setDesign(createDefaultBanner(version));
|
|
52985
|
-
banner.start();
|
|
52986
|
-
carouselLines = 4;
|
|
53030
|
+
carouselLines = banner.start();
|
|
52987
53031
|
renderRichHeader({
|
|
52988
53032
|
model: config.model,
|
|
52989
53033
|
version,
|
package/package.json
CHANGED