open-agents-ai 0.185.65 → 0.185.67
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 +30 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -43814,8 +43814,18 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
43814
43814
|
const stdout = e.stdout?.toString?.()?.trim?.() ?? "";
|
|
43815
43815
|
const msg = e.message ?? "";
|
|
43816
43816
|
lastError = stderr || stdout || msg;
|
|
43817
|
-
if (lastError.length >
|
|
43818
|
-
lastError = lastError.slice(0,
|
|
43817
|
+
if (lastError.length > 300)
|
|
43818
|
+
lastError = lastError.slice(0, 300) + "...";
|
|
43819
|
+
if (process.platform === "win32" && /access|denied|elevation|administrator|privilege|0x80070005/i.test(lastError)) {
|
|
43820
|
+
log(`${d.label}: needs admin \u2014 retrying with elevation...`);
|
|
43821
|
+
try {
|
|
43822
|
+
execSync29(`powershell -NoProfile -Command "Start-Process -FilePath 'cmd.exe' -ArgumentList '/c ${installCmd.replace(/"/g, '\\"')}' -Verb RunAs -Wait"`, { stdio: "pipe", timeout: 18e4 });
|
|
43823
|
+
lastError = "";
|
|
43824
|
+
} catch (e2) {
|
|
43825
|
+
const stderr2 = e2.stderr?.toString?.()?.trim?.() ?? "";
|
|
43826
|
+
lastError = `Elevated install failed: ${(stderr2 || e2.message || "").slice(0, 200)}`;
|
|
43827
|
+
}
|
|
43828
|
+
}
|
|
43819
43829
|
}
|
|
43820
43830
|
}
|
|
43821
43831
|
if (!hasCmd(d.binary) && pipPkg) {
|
|
@@ -53409,25 +53419,37 @@ async function handleUpdate(subcommand, ctx) {
|
|
|
53409
53419
|
installOverlay.setStatus("Installing package...");
|
|
53410
53420
|
const installCmd = `${sudoPrefix}npm install -g open-agents-ai@latest --prefer-online`;
|
|
53411
53421
|
let installOk = await runInstall2(installCmd);
|
|
53422
|
+
if (!installOk && process.platform === "win32" && /EPERM|EACCES|access|denied|permission/i.test(installError)) {
|
|
53423
|
+
installOverlay.setStatus("Needs admin \u2014 retrying with elevation...");
|
|
53424
|
+
installError = "";
|
|
53425
|
+
installOk = await runInstall2(`powershell -NoProfile -Command "Start-Process -FilePath 'npm' -ArgumentList 'install -g open-agents-ai@latest --prefer-online' -Verb RunAs -Wait"`);
|
|
53426
|
+
}
|
|
53412
53427
|
if (!installOk && /ENOTEMPTY|errno -39/i.test(installError)) {
|
|
53413
53428
|
installOverlay.setStatus("Cleaning stale artifacts...");
|
|
53414
53429
|
try {
|
|
53415
53430
|
const prefix = await execA("npm prefix -g", { timeout: 5e3 });
|
|
53416
|
-
|
|
53417
|
-
|
|
53418
|
-
|
|
53419
|
-
|
|
53431
|
+
if (process.platform === "win32") {
|
|
53432
|
+
await execA(`powershell -NoProfile -Command "Remove-Item -Recurse -Force '${prefix}\\node_modules\\open-agents-ai' -ErrorAction SilentlyContinue"`, { timeout: 15e3 });
|
|
53433
|
+
await execA(`npm cache clean --force`, { timeout: 3e4 });
|
|
53434
|
+
} else {
|
|
53435
|
+
const globalModules = prefix.endsWith("/lib") ? prefix + "/node_modules" : prefix + "/lib/node_modules";
|
|
53436
|
+
await execA(`${sudoPrefix}find "${globalModules}" -maxdepth 1 -name ".open-agents*" -type d -exec rm -rf {} + 2>/dev/null || true`, { timeout: 15e3 });
|
|
53437
|
+
await execA(`${sudoPrefix}rm -rf "${globalModules}/open-agents-ai" 2>/dev/null || true`, { timeout: 15e3 });
|
|
53438
|
+
await execA(`${sudoPrefix}npm cache clean --force 2>/dev/null || true`, { timeout: 3e4 });
|
|
53439
|
+
}
|
|
53420
53440
|
} catch {
|
|
53421
53441
|
}
|
|
53422
53442
|
installOverlay.setStatus("Retrying install...");
|
|
53423
53443
|
installError = "";
|
|
53424
|
-
installOk = await runInstall2(`${sudoPrefix}npm install -g open-agents-ai@latest --force --prefer-online`);
|
|
53444
|
+
installOk = await runInstall2(`${process.platform === "win32" ? "" : sudoPrefix}npm install -g open-agents-ai@latest --force --prefer-online`);
|
|
53425
53445
|
}
|
|
53426
53446
|
if (!installOk) {
|
|
53427
53447
|
installOverlay.stop("Install failed");
|
|
53428
53448
|
await new Promise((r) => setTimeout(r, 2e3));
|
|
53429
53449
|
installOverlay.dismiss();
|
|
53430
|
-
|
|
53450
|
+
const hint = process.platform === "win32" ? `npm i -g open-agents-ai (run terminal as Administrator)` : `${sudoPrefix}npm i -g open-agents-ai`;
|
|
53451
|
+
renderWarning(`Update failed: ${installError.slice(0, 150) || "unknown error"}`);
|
|
53452
|
+
renderWarning(`Try manually: ${hint}`);
|
|
53431
53453
|
return;
|
|
53432
53454
|
}
|
|
53433
53455
|
installOverlay.setStatus(`Package installed (v${info.latestVersion})`);
|
package/package.json
CHANGED