open-agents-ai 0.185.66 → 0.185.68

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.
Files changed (2) hide show
  1. package/dist/index.js +33 -23
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -43754,18 +43754,16 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
43754
43754
  log(`No supported package manager (choco/winget/apt/brew) \u2014 ${d.label} unavailable. Install manually or install Chocolatey: https://chocolatey.org/install`);
43755
43755
  } else {
43756
43756
  const labels = missing.map((d) => d.label).join(", ");
43757
+ let winNeedsElevation = false;
43757
43758
  if (process.platform === "win32") {
43758
- let isAdmin = false;
43759
43759
  try {
43760
43760
  execSync29("net session", { stdio: "pipe", timeout: 3e3 });
43761
- isAdmin = true;
43762
43761
  } catch {
43762
+ winNeedsElevation = true;
43763
+ log(`Installing ${labels} via ${pm2} (requires admin \u2014 UAC prompt will appear)...`);
43763
43764
  }
43764
- if (!isAdmin) {
43765
- log(`Installing ${labels} via ${pm2} (non-admin \u2014 some installs may need "Run as Administrator")...`);
43766
- } else {
43765
+ if (!winNeedsElevation)
43767
43766
  log(`Installing ${labels} via ${pm2}...`);
43768
- }
43769
43767
  } else {
43770
43768
  log(`Installing ${labels} via ${pm2}...`);
43771
43769
  }
@@ -43806,6 +43804,8 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
43806
43804
  try {
43807
43805
  if (needsSudo) {
43808
43806
  await sudoInstall(installCmd, getPassword, log, cachedPasswordRef, 18e4);
43807
+ } else if (winNeedsElevation) {
43808
+ execSync29(`powershell -NoProfile -Command "Start-Process -FilePath 'cmd.exe' -ArgumentList '/c ${installCmd.replace(/'/g, "''")}' -Verb RunAs -Wait"`, { stdio: "pipe", timeout: 18e4 });
43809
43809
  } else {
43810
43810
  execSync29(installCmd, { stdio: "pipe", timeout: 18e4 });
43811
43811
  }
@@ -43816,16 +43816,6 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
43816
43816
  lastError = stderr || stdout || msg;
43817
43817
  if (lastError.length > 300)
43818
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
- }
43829
43819
  }
43830
43820
  }
43831
43821
  if (!hasCmd(d.binary) && pipPkg) {
@@ -43841,10 +43831,18 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
43841
43831
  lastError += lastError ? ` | pip: ${pipError.slice(0, 150)}` : pipError.slice(0, 200);
43842
43832
  }
43843
43833
  }
43834
+ if (process.platform === "win32" && !hasCmd(d.binary)) {
43835
+ try {
43836
+ const freshPath = execSync29(`powershell -NoProfile -Command "[System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')"`, { encoding: "utf8", timeout: 5e3, stdio: "pipe" }).trim();
43837
+ if (freshPath)
43838
+ process.env.PATH = freshPath;
43839
+ } catch {
43840
+ }
43841
+ }
43844
43842
  if (hasCmd(d.binary)) {
43845
43843
  log(`${d.label} installed.`);
43846
43844
  } else {
43847
- const reason = lastError ? ` Reason: ${lastError}` : " (no error output captured \u2014 may need admin/UAC elevation)";
43845
+ const reason = lastError ? ` Reason: ${lastError}` : " (binary not found in PATH after install \u2014 may need terminal restart or admin elevation)";
43848
43846
  log(`${d.label} could not be installed \u2014 features will be limited.${reason}`);
43849
43847
  }
43850
43848
  }
@@ -53419,25 +53417,37 @@ async function handleUpdate(subcommand, ctx) {
53419
53417
  installOverlay.setStatus("Installing package...");
53420
53418
  const installCmd = `${sudoPrefix}npm install -g open-agents-ai@latest --prefer-online`;
53421
53419
  let installOk = await runInstall2(installCmd);
53420
+ if (!installOk && process.platform === "win32" && /EPERM|EACCES|access|denied|permission/i.test(installError)) {
53421
+ installOverlay.setStatus("Needs admin \u2014 retrying with elevation...");
53422
+ installError = "";
53423
+ installOk = await runInstall2(`powershell -NoProfile -Command "Start-Process -FilePath 'npm' -ArgumentList 'install -g open-agents-ai@latest --prefer-online' -Verb RunAs -Wait"`);
53424
+ }
53422
53425
  if (!installOk && /ENOTEMPTY|errno -39/i.test(installError)) {
53423
53426
  installOverlay.setStatus("Cleaning stale artifacts...");
53424
53427
  try {
53425
53428
  const prefix = await execA("npm prefix -g", { timeout: 5e3 });
53426
- const globalModules = prefix.endsWith("/lib") ? prefix + "/node_modules" : prefix + "/lib/node_modules";
53427
- await execA(`${sudoPrefix}find "${globalModules}" -maxdepth 1 -name ".open-agents*" -type d -exec rm -rf {} + 2>/dev/null || true`, { timeout: 15e3 });
53428
- await execA(`${sudoPrefix}rm -rf "${globalModules}/open-agents-ai" 2>/dev/null || true`, { timeout: 15e3 });
53429
- await execA(`${sudoPrefix}npm cache clean --force 2>/dev/null || true`, { timeout: 3e4 });
53429
+ if (process.platform === "win32") {
53430
+ await execA(`powershell -NoProfile -Command "Remove-Item -Recurse -Force '${prefix}\\node_modules\\open-agents-ai' -ErrorAction SilentlyContinue"`, { timeout: 15e3 });
53431
+ await execA(`npm cache clean --force`, { timeout: 3e4 });
53432
+ } else {
53433
+ const globalModules = prefix.endsWith("/lib") ? prefix + "/node_modules" : prefix + "/lib/node_modules";
53434
+ await execA(`${sudoPrefix}find "${globalModules}" -maxdepth 1 -name ".open-agents*" -type d -exec rm -rf {} + 2>/dev/null || true`, { timeout: 15e3 });
53435
+ await execA(`${sudoPrefix}rm -rf "${globalModules}/open-agents-ai" 2>/dev/null || true`, { timeout: 15e3 });
53436
+ await execA(`${sudoPrefix}npm cache clean --force 2>/dev/null || true`, { timeout: 3e4 });
53437
+ }
53430
53438
  } catch {
53431
53439
  }
53432
53440
  installOverlay.setStatus("Retrying install...");
53433
53441
  installError = "";
53434
- installOk = await runInstall2(`${sudoPrefix}npm install -g open-agents-ai@latest --force --prefer-online`);
53442
+ installOk = await runInstall2(`${process.platform === "win32" ? "" : sudoPrefix}npm install -g open-agents-ai@latest --force --prefer-online`);
53435
53443
  }
53436
53444
  if (!installOk) {
53437
53445
  installOverlay.stop("Install failed");
53438
53446
  await new Promise((r) => setTimeout(r, 2e3));
53439
53447
  installOverlay.dismiss();
53440
- renderWarning(`Try manually: ${sudoPrefix}npm i -g open-agents-ai`);
53448
+ const hint = process.platform === "win32" ? `npm i -g open-agents-ai (run terminal as Administrator)` : `${sudoPrefix}npm i -g open-agents-ai`;
53449
+ renderWarning(`Update failed: ${installError.slice(0, 150) || "unknown error"}`);
53450
+ renderWarning(`Try manually: ${hint}`);
53441
53451
  return;
53442
53452
  }
53443
53453
  installOverlay.setStatus(`Package installed (v${info.latestVersion})`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.185.66",
3
+ "version": "0.185.68",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",