open-agents-ai 0.105.5 → 0.105.6

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 +31 -23
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14438,6 +14438,15 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
14438
14438
  const nodeModulesDir = resolve26(this.repoRoot, "node_modules");
14439
14439
  let nexusResolved = false;
14440
14440
  let installedVersion = "";
14441
+ const execAsync2 = (cmd, opts = {}) => new Promise((res, rej) => {
14442
+ const { exec: ex } = __require("node:child_process");
14443
+ ex(cmd, { encoding: "utf8", timeout: opts.timeout ?? 3e4, cwd: opts.cwd, maxBuffer: 10 * 1024 * 1024 }, (err, stdout) => {
14444
+ if (err)
14445
+ rej(err);
14446
+ else
14447
+ res((stdout || "").trim());
14448
+ });
14449
+ });
14441
14450
  try {
14442
14451
  const nexusPkg = join30(nodeModulesDir, "open-agents-nexus", "package.json");
14443
14452
  if (existsSync23(nexusPkg)) {
@@ -14448,30 +14457,29 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
14448
14457
  } catch {
14449
14458
  }
14450
14459
  } else {
14451
- const globalDir = execSync22("npm root -g", { encoding: "utf8", timeout: 5e3 }).trim();
14452
- const globalPkg = join30(globalDir, "open-agents-nexus", "package.json");
14453
- if (existsSync23(globalPkg)) {
14454
- nexusResolved = true;
14455
- try {
14456
- const pkg = JSON.parse(readFileSync16(globalPkg, "utf8"));
14457
- installedVersion = pkg.version || "";
14458
- } catch {
14460
+ try {
14461
+ const globalDir = await execAsync2("npm root -g", { timeout: 5e3 });
14462
+ const globalPkg = join30(globalDir, "open-agents-nexus", "package.json");
14463
+ if (existsSync23(globalPkg)) {
14464
+ nexusResolved = true;
14465
+ try {
14466
+ const pkg = JSON.parse(readFileSync16(globalPkg, "utf8"));
14467
+ installedVersion = pkg.version || "";
14468
+ } catch {
14469
+ }
14459
14470
  }
14471
+ } catch {
14460
14472
  }
14461
14473
  }
14462
14474
  } catch {
14463
14475
  }
14464
14476
  if (nexusResolved && installedVersion) {
14465
14477
  try {
14466
- const latestRaw = execSync22("npm view open-agents-nexus version 2>/dev/null", {
14467
- encoding: "utf8",
14468
- timeout: 8e3
14469
- }).trim();
14478
+ const latestRaw = await execAsync2("npm view open-agents-nexus version 2>/dev/null", { timeout: 8e3 });
14470
14479
  if (latestRaw && latestRaw !== installedVersion) {
14471
14480
  try {
14472
- execSync22(`npm install open-agents-nexus@${latestRaw} --save 2>&1`, {
14481
+ await execAsync2(`npm install open-agents-nexus@${latestRaw} --save 2>&1`, {
14473
14482
  cwd: this.repoRoot,
14474
- stdio: "pipe",
14475
14483
  timeout: 6e4
14476
14484
  });
14477
14485
  installedVersion = latestRaw;
@@ -14483,14 +14491,13 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
14483
14491
  }
14484
14492
  if (!nexusResolved) {
14485
14493
  try {
14486
- execSync22("npm install open-agents-nexus@latest 2>&1", {
14494
+ await execAsync2("npm install open-agents-nexus@latest 2>&1", {
14487
14495
  cwd: this.repoRoot,
14488
- stdio: "pipe",
14489
14496
  timeout: 12e4
14490
14497
  });
14491
14498
  } catch {
14492
14499
  try {
14493
- execSync22("npm install -g open-agents-nexus@latest 2>&1", { stdio: "pipe", timeout: 12e4 });
14500
+ await execAsync2("npm install -g open-agents-nexus@latest 2>&1", { timeout: 12e4 });
14494
14501
  } catch {
14495
14502
  throw new Error("Failed to install open-agents-nexus. Run: npm install open-agents-nexus");
14496
14503
  }
@@ -14503,7 +14510,7 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
14503
14510
  const agentType = args.agent_type || "general";
14504
14511
  const nodePaths = [nodeModulesDir];
14505
14512
  try {
14506
- const globalDir = execSync22("npm root -g", { encoding: "utf8", timeout: 5e3 }).trim();
14513
+ const globalDir = await execAsync2("npm root -g", { timeout: 5e3 });
14507
14514
  nodePaths.push(globalDir);
14508
14515
  } catch {
14509
14516
  }
@@ -40257,9 +40264,10 @@ async function handleUpdate(subcommand, ctx) {
40257
40264
  }
40258
40265
  const info = await checkForUpdate(currentVersion, true);
40259
40266
  const { exec: exec4, execSync: es2 } = await import("node:child_process");
40267
+ const execA = (cmd, opts) => new Promise((res, rej) => exec4(cmd, { encoding: "utf8", timeout: opts?.timeout ?? 3e4, cwd: opts?.cwd }, (err, stdout) => err ? rej(err) : res((stdout || "").trim())));
40260
40268
  let needsSudo = false;
40261
40269
  try {
40262
- const prefix = es2("npm prefix -g", { encoding: "utf8", timeout: 5e3 }).trim();
40270
+ const prefix = await execA("npm prefix -g", { timeout: 5e3 });
40263
40271
  const { accessSync, constants } = await import("node:fs");
40264
40272
  try {
40265
40273
  accessSync(prefix, constants.W_OK);
@@ -40363,10 +40371,10 @@ async function handleUpdate(subcommand, ctx) {
40363
40371
  if (!installOk && /ENOTEMPTY|errno -39/i.test(installError)) {
40364
40372
  installSpinner.stop("Cleaning stale npm temp files...");
40365
40373
  try {
40366
- const prefix = es2("npm prefix -g", { encoding: "utf8", timeout: 5e3 }).trim();
40374
+ const prefix = await execA("npm prefix -g", { timeout: 5e3 });
40367
40375
  const globalModules = prefix.endsWith("/lib") ? prefix + "/node_modules" : prefix + "/lib/node_modules";
40368
- es2(`${sudoPrefix}find "${globalModules}" -maxdepth 1 -name ".open-agents-ai-*" -type d -exec rm -rf {} + 2>/dev/null || true`, { timeout: 15e3 });
40369
- es2(`${sudoPrefix}rm -rf "${globalModules}/open-agents-ai" 2>/dev/null || true`, { timeout: 15e3 });
40376
+ await execA(`${sudoPrefix}find "${globalModules}" -maxdepth 1 -name ".open-agents-ai-*" -type d -exec rm -rf {} + 2>/dev/null || true`, { timeout: 15e3 });
40377
+ await execA(`${sudoPrefix}rm -rf "${globalModules}/open-agents-ai" 2>/dev/null || true`, { timeout: 15e3 });
40370
40378
  } catch {
40371
40379
  }
40372
40380
  const retrySpinner = startInlineSpinner("Retrying install");
@@ -40390,7 +40398,7 @@ async function handleUpdate(subcommand, ctx) {
40390
40398
  if (doDeps) {
40391
40399
  const depsSpinner = startInlineSpinner("Updating subordinate dependencies");
40392
40400
  try {
40393
- const prefix = es2("npm prefix -g", { encoding: "utf8", timeout: 5e3 }).trim();
40401
+ const prefix = await execA("npm prefix -g", { timeout: 5e3 });
40394
40402
  const globalModules = prefix.endsWith("/lib") ? prefix + "/node_modules" : prefix + "/lib/node_modules";
40395
40403
  const { existsSync: fe, readFileSync: rf } = await import("node:fs");
40396
40404
  const { join: pj } = await import("node:path");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.105.5",
3
+ "version": "0.105.6",
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",