open-agents-ai 0.187.85 → 0.187.86
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 +61 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -294277,18 +294277,21 @@ async function handleUpdate(subcommand, ctx3) {
|
|
|
294277
294277
|
}
|
|
294278
294278
|
};
|
|
294279
294279
|
const PROGRESS_BLOCKS = [" ", "\u2801", "\u2803", "\u2807", "\u280F", "\u281F", "\u283F", "\u28FF"];
|
|
294280
|
+
const BRAILLE_SPINNER = ["\u2801", "\u2803", "\u2807", "\u280F", "\u281F", "\u283F", "\u28FF", "\u28FE", "\u28FC", "\u28F8", "\u28F0", "\u28E0", "\u28C0", "\u2880"];
|
|
294280
294281
|
let _installProgress = 0;
|
|
294281
294282
|
let _installTotal = 10;
|
|
294282
|
-
|
|
294283
|
+
let _installPhase = "";
|
|
294284
|
+
function renderInstallFrame(version4, frame, statusLine) {
|
|
294283
294285
|
const L = layout();
|
|
294284
294286
|
const cols = L.cols;
|
|
294285
|
-
const { tuiAccent: getAccent, tuiBgSeq: getBgSeq, tuiBoxFg: getBoxFg } = (init_theme(), __toCommonJS(theme_exports));
|
|
294287
|
+
const { tuiAccent: getAccent, tuiBgSeq: getBgSeq, tuiBoxFg: getBoxFg, tuiTextDim: getDimColor } = (init_theme(), __toCommonJS(theme_exports));
|
|
294286
294288
|
const accentColor = getAccent() < 0 ? 252 : getAccent();
|
|
294287
294289
|
const boxFg = getBoxFg();
|
|
294288
294290
|
const bgSeq = getBgSeq();
|
|
294289
294291
|
const contentTop = L.contentTop;
|
|
294290
294292
|
const contentBottom = L.contentBottom;
|
|
294291
294293
|
const contentHeight = L.contentHeight;
|
|
294294
|
+
const isDone = statusLine === "__DONE__";
|
|
294292
294295
|
let buf = "\x1B[?2026h\x1B7\x1B[?25l";
|
|
294293
294296
|
for (let r2 = contentTop; r2 <= contentBottom; r2++) {
|
|
294294
294297
|
buf += `\x1B[${r2};1H${bgSeq}\x1B[2K`;
|
|
@@ -294305,32 +294308,42 @@ async function handleUpdate(subcommand, ctx3) {
|
|
|
294305
294308
|
buf += `\x1B[${boxTop + r2};${boxLeft}H${boxFg}\u2502${bgSeq}${" ".repeat(innerW)}${boxFg}\u2502`;
|
|
294306
294309
|
}
|
|
294307
294310
|
buf += `\x1B[${boxTop + boxH - 1};${boxLeft}H${boxFg}\u2570${"\u2500".repeat(innerW)}\u256F`;
|
|
294308
|
-
const isDone = statusLine === "__DONE__";
|
|
294309
294311
|
const label = isDone ? "INSTALLED" : "INSTALLING";
|
|
294310
294312
|
const labelColor = isDone ? 82 : accentColor;
|
|
294311
|
-
const
|
|
294312
|
-
|
|
294313
|
+
const spinner = isDone ? " \u2713" : ` ${BRAILLE_SPINNER[frame % BRAILLE_SPINNER.length]}`;
|
|
294314
|
+
const fullLabel = label + spinner;
|
|
294315
|
+
const labelCol = centerCol - Math.floor(fullLabel.length / 2);
|
|
294316
|
+
buf += `\x1B[${boxTop + 1};${labelCol}H\x1B[1;38;5;${labelColor}m${label}\x1B[0m\x1B[38;5;${labelColor}m${spinner}\x1B[0m`;
|
|
294313
294317
|
const progress = isDone ? 1 : Math.min(0.95, _installProgress / Math.max(1, _installTotal));
|
|
294314
294318
|
const barW = innerW - 4;
|
|
294315
|
-
const
|
|
294316
|
-
|
|
294317
|
-
|
|
294318
|
-
|
|
294319
|
-
|
|
294320
|
-
|
|
294321
|
-
|
|
294322
|
-
|
|
294323
|
-
|
|
294324
|
-
|
|
294325
|
-
|
|
294319
|
+
const barCol = boxLeft + 3;
|
|
294320
|
+
if (_installProgress === 0 && !isDone) {
|
|
294321
|
+
let bar = "";
|
|
294322
|
+
for (let c4 = 0; c4 < barW; c4++) {
|
|
294323
|
+
const wave = Math.sin((c4 - frame * 0.8) * 0.3);
|
|
294324
|
+
const idx = Math.max(0, Math.min(PROGRESS_BLOCKS.length - 1, Math.floor((wave + 1) * 0.5 * (PROGRESS_BLOCKS.length - 1))));
|
|
294325
|
+
bar += PROGRESS_BLOCKS[idx];
|
|
294326
|
+
}
|
|
294327
|
+
buf += `\x1B[${boxTop + 2};${barCol}H\x1B[38;5;${accentColor}m${bar}\x1B[0m`;
|
|
294328
|
+
} else {
|
|
294329
|
+
const filledCols = Math.floor(progress * barW);
|
|
294330
|
+
let bar = "";
|
|
294331
|
+
for (let c4 = 0; c4 < barW; c4++) {
|
|
294332
|
+
if (c4 < filledCols) {
|
|
294333
|
+
bar += PROGRESS_BLOCKS[PROGRESS_BLOCKS.length - 1];
|
|
294334
|
+
} else if (c4 === filledCols) {
|
|
294335
|
+
const edgeIdx = isDone ? PROGRESS_BLOCKS.length - 1 : frame % (PROGRESS_BLOCKS.length - 1) + 1;
|
|
294336
|
+
bar += PROGRESS_BLOCKS[edgeIdx];
|
|
294337
|
+
} else {
|
|
294338
|
+
bar += PROGRESS_BLOCKS[0];
|
|
294339
|
+
}
|
|
294326
294340
|
}
|
|
294341
|
+
buf += `\x1B[${boxTop + 2};${barCol}H\x1B[38;5;${accentColor}m${bar}\x1B[0m`;
|
|
294327
294342
|
}
|
|
294328
|
-
const
|
|
294329
|
-
|
|
294330
|
-
const statusText = isDone ? `v${version4}` : statusLine || `v${version4}`;
|
|
294343
|
+
const phaseText = _installPhase ? `${_installPhase}` : "";
|
|
294344
|
+
const statusText = isDone ? `v${version4}` : statusLine || phaseText || `v${version4}`;
|
|
294331
294345
|
const statusTrunc = statusText.slice(0, innerW - 2);
|
|
294332
294346
|
const sCol = centerCol - Math.floor(statusTrunc.length / 2);
|
|
294333
|
-
const { tuiTextDim: getDimColor } = (init_theme(), __toCommonJS(theme_exports));
|
|
294334
294347
|
buf += `\x1B[${boxTop + 3};${sCol}H\x1B[38;5;${getDimColor()}m${statusTrunc}\x1B[0m`;
|
|
294335
294348
|
buf += `\x1B[0m\x1B8\x1B[?25h\x1B[?2026l`;
|
|
294336
294349
|
process.stdout.write(buf);
|
|
@@ -294343,22 +294356,29 @@ async function handleUpdate(subcommand, ctx3) {
|
|
|
294343
294356
|
const timer = setInterval(() => {
|
|
294344
294357
|
frame++;
|
|
294345
294358
|
renderInstallFrame(version4, frame, status);
|
|
294346
|
-
},
|
|
294359
|
+
}, 80);
|
|
294347
294360
|
return {
|
|
294348
294361
|
setStatus(text) {
|
|
294349
294362
|
status = text;
|
|
294350
294363
|
},
|
|
294364
|
+
setPhase(phase) {
|
|
294365
|
+
_installPhase = phase;
|
|
294366
|
+
},
|
|
294367
|
+
setProgress(current, total) {
|
|
294368
|
+
_installProgress = current;
|
|
294369
|
+
_installTotal = total;
|
|
294370
|
+
},
|
|
294351
294371
|
stop(finalText) {
|
|
294352
294372
|
clearInterval(timer);
|
|
294353
294373
|
unlockFooterRedraws();
|
|
294354
294374
|
status = "__DONE__";
|
|
294375
|
+
_installProgress = _installTotal;
|
|
294355
294376
|
renderInstallFrame(version4, frame, status);
|
|
294356
294377
|
setTimeout(() => {
|
|
294357
294378
|
status = finalText;
|
|
294358
294379
|
renderInstallFrame(version4, frame + 1, finalText);
|
|
294359
294380
|
}, 300);
|
|
294360
294381
|
},
|
|
294361
|
-
/** Clear the overlay content area entirely — return to normal scroll area */
|
|
294362
294382
|
dismiss() {
|
|
294363
294383
|
unlockFooterRedraws();
|
|
294364
294384
|
clearInterval(timer);
|
|
@@ -294553,7 +294573,8 @@ async function handleUpdate(subcommand, ctx3) {
|
|
|
294553
294573
|
const installOverlay = startInstallOverlay(targetVersion);
|
|
294554
294574
|
let installError = "";
|
|
294555
294575
|
_installProgress = 0;
|
|
294556
|
-
_installTotal =
|
|
294576
|
+
_installTotal = 20;
|
|
294577
|
+
_installPhase = "Preparing...";
|
|
294557
294578
|
const runInstall2 = (cmd) => new Promise((resolve39) => {
|
|
294558
294579
|
const child = exec4(cmd, { timeout: 18e4 }, (err, _stdout, stderr) => {
|
|
294559
294580
|
if (err)
|
|
@@ -294603,7 +294624,11 @@ async function handleUpdate(subcommand, ctx3) {
|
|
|
294603
294624
|
const sudoPrefix = needsSudo ? "sudo " : "";
|
|
294604
294625
|
let primaryUpdated = false;
|
|
294605
294626
|
let depsUpdated = false;
|
|
294627
|
+
const totalPhases = (doPackage && info ? 5 : 0) + (doDeps ? 5 : 0) + (doRebuild ? 3 : 0) + (doPython ? 3 : 0) + (doCloudflared ? 2 : 0) + (doOllama ? 2 : 0);
|
|
294628
|
+
let completedPhases = 0;
|
|
294629
|
+
installOverlay.setProgress(0, totalPhases || 1);
|
|
294606
294630
|
if (doPackage && info) {
|
|
294631
|
+
installOverlay.setPhase("Package");
|
|
294607
294632
|
installOverlay.setStatus("Installing package...");
|
|
294608
294633
|
const installCmd = `${sudoPrefix}npm install -g open-agents-ai@latest --prefer-online`;
|
|
294609
294634
|
let installOk = await runInstall2(installCmd);
|
|
@@ -294640,10 +294665,13 @@ async function handleUpdate(subcommand, ctx3) {
|
|
|
294640
294665
|
renderWarning(`Try manually: ${hint}`);
|
|
294641
294666
|
return;
|
|
294642
294667
|
}
|
|
294668
|
+
completedPhases += 5;
|
|
294669
|
+
installOverlay.setProgress(completedPhases, totalPhases);
|
|
294643
294670
|
installOverlay.setStatus(`Package installed (v${info.latestVersion})`);
|
|
294644
294671
|
primaryUpdated = true;
|
|
294645
294672
|
}
|
|
294646
294673
|
if (doDeps) {
|
|
294674
|
+
installOverlay.setPhase("Dependencies");
|
|
294647
294675
|
installOverlay.setStatus("Checking sub-dependencies...");
|
|
294648
294676
|
try {
|
|
294649
294677
|
const prefix = await execA("npm prefix -g", { timeout: 5e3 });
|
|
@@ -294701,9 +294729,12 @@ async function handleUpdate(subcommand, ctx3) {
|
|
|
294701
294729
|
}
|
|
294702
294730
|
} catch {
|
|
294703
294731
|
}
|
|
294732
|
+
completedPhases += 5;
|
|
294733
|
+
installOverlay.setProgress(completedPhases, totalPhases);
|
|
294704
294734
|
installOverlay.setStatus(depsUpdated ? "Dependencies updated" : "Dependencies OK");
|
|
294705
294735
|
}
|
|
294706
294736
|
if (doOllama) {
|
|
294737
|
+
installOverlay.setPhase("Ollama");
|
|
294707
294738
|
installOverlay.setStatus("Updating Ollama...");
|
|
294708
294739
|
try {
|
|
294709
294740
|
const { updateOllama: doOllamaUpgrade } = await Promise.resolve().then(() => (init_setup(), setup_exports));
|
|
@@ -294774,18 +294805,22 @@ async function handleUpdate(subcommand, ctx3) {
|
|
|
294774
294805
|
}
|
|
294775
294806
|
}
|
|
294776
294807
|
if (doRebuild) {
|
|
294808
|
+
installOverlay.setPhase("Native Modules");
|
|
294777
294809
|
installOverlay.setStatus("Rebuilding native modules...");
|
|
294778
294810
|
await new Promise((resolve39) => {
|
|
294779
294811
|
const child = exec4(`${sudoPrefix}npm rebuild -g open-agents-ai 2>/dev/null || true`, { timeout: 12e4 }, () => resolve39(true));
|
|
294780
294812
|
child.stdout?.resume();
|
|
294781
294813
|
child.stderr?.resume();
|
|
294782
294814
|
});
|
|
294815
|
+
completedPhases += 3;
|
|
294816
|
+
installOverlay.setProgress(completedPhases, totalPhases);
|
|
294783
294817
|
installOverlay.setStatus("Native modules rebuilt");
|
|
294784
294818
|
}
|
|
294785
294819
|
const { existsSync: fsExists } = await import("node:fs");
|
|
294786
294820
|
const { join: pathJoin } = await import("node:path");
|
|
294787
294821
|
const { homedir: getHome } = await import("node:os");
|
|
294788
294822
|
if (doPython) {
|
|
294823
|
+
installOverlay.setPhase("Python");
|
|
294789
294824
|
let hasPython = hasCmd("python3") || hasCmd("python");
|
|
294790
294825
|
if (!hasPython) {
|
|
294791
294826
|
installOverlay.setStatus("Installing Python3...");
|
|
@@ -294821,9 +294856,12 @@ async function handleUpdate(subcommand, ctx3) {
|
|
|
294821
294856
|
});
|
|
294822
294857
|
installOverlay.setStatus("Python deps bootstrapped");
|
|
294823
294858
|
}
|
|
294859
|
+
completedPhases += 3;
|
|
294860
|
+
installOverlay.setProgress(completedPhases, totalPhases);
|
|
294824
294861
|
}
|
|
294825
294862
|
let hasCf = false;
|
|
294826
294863
|
if (doCloudflared) {
|
|
294864
|
+
installOverlay.setPhase("Cloudflared");
|
|
294827
294865
|
installOverlay.setStatus("Checking cloudflared...");
|
|
294828
294866
|
try {
|
|
294829
294867
|
const { execSync: es } = await import("node:child_process");
|
package/package.json
CHANGED