open-agents-ai 0.185.18 → 0.185.20

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 +64 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -48548,7 +48548,7 @@ async function handleSlashCommand(input, ctx) {
48548
48548
  renderWarning(`Gateway stop: ${err instanceof Error ? err.message : String(err)}`);
48549
48549
  }
48550
48550
  }
48551
- const orphanPids = findPidsByPattern("cloudflared tunnel --url http");
48551
+ const orphanPids = findPidsByPattern(process.platform === "win32" ? "cloudflared" : "cloudflared tunnel");
48552
48552
  let orphansKilled = 0;
48553
48553
  for (const pid of orphanPids) {
48554
48554
  if (killPid(pid))
@@ -48612,9 +48612,9 @@ async function handleSlashCommand(input, ctx) {
48612
48612
  const existingGateway = ctx.getExposeGateway?.();
48613
48613
  const managedPid = existingGateway?._cloudflaredPid || null;
48614
48614
  if (!existingGateway?.isActive) {
48615
- const staleOrphans = findPidsByPattern("cloudflared tunnel --url http").filter((p) => p !== managedPid);
48615
+ const staleOrphans2 = findPidsByPattern(process.platform === "win32" ? "cloudflared" : "cloudflared tunnel").filter((p) => p !== managedPid);
48616
48616
  let cleanedUp = 0;
48617
- for (const pid of staleOrphans) {
48617
+ for (const pid of staleOrphans2) {
48618
48618
  if (killPid(pid))
48619
48619
  cleanedUp++;
48620
48620
  }
@@ -48625,6 +48625,9 @@ async function handleSlashCommand(input, ctx) {
48625
48625
  }
48626
48626
  const tunnelAlreadyActive = existingGateway?.isActive && existingGateway?.tunnelUrl;
48627
48627
  const p2pAlreadyActive = ctx.isExposeActive?.() && !existingGateway?.tunnelUrl;
48628
+ const staleOrphans = findPidsByPattern(process.platform === "win32" ? "cloudflared" : "cloudflared tunnel");
48629
+ for (const pid of staleOrphans)
48630
+ killPid(pid);
48628
48631
  if (config.transport.cloudflared && ctx.exposeStart) {
48629
48632
  if (tunnelAlreadyActive) {
48630
48633
  renderInfo(`Tunnel already active: ${existingGateway.tunnelUrl}`);
@@ -48652,6 +48655,11 @@ async function handleSlashCommand(input, ctx) {
48652
48655
  let daemonReady = false;
48653
48656
  try {
48654
48657
  const nexus = new NexusTool(projectDir);
48658
+ try {
48659
+ await nexus.execute({ action: "disconnect" });
48660
+ await new Promise((r) => setTimeout(r, 500));
48661
+ } catch {
48662
+ }
48655
48663
  renderInfo("Starting nexus daemon...");
48656
48664
  await nexus.execute({ action: "connect" });
48657
48665
  for (let wait = 0; wait < 15; wait++) {
@@ -48693,6 +48701,8 @@ async function handleSlashCommand(input, ctx) {
48693
48701
  const sponsorUrl = tunnelGw?.tunnelUrl || "";
48694
48702
  if (!sponsorUrl) {
48695
48703
  renderWarning("No tunnel URL available \u2014 sponsor not registered in directory. Start with cloudflared or libp2p first.");
48704
+ renderInfo("Sponsor wizard completed (offline mode \u2014 no public endpoint).");
48705
+ return;
48696
48706
  }
48697
48707
  let sponsorName = (config.header.message || "").replace(/^\/+/, "").trim();
48698
48708
  if (!sponsorName || sponsorName.length < 2) {
@@ -51548,6 +51558,37 @@ async function handleUpdate(subcommand, ctx) {
51548
51558
  installOverlay.dismiss();
51549
51559
  await new Promise((r) => setTimeout(r, 200));
51550
51560
  ctx.contextSave?.();
51561
+ try {
51562
+ const { join: pjoin } = await import("node:path");
51563
+ const { existsSync: ex, readFileSync: rf } = await import("node:fs");
51564
+ const { homedir: hd } = await import("node:os");
51565
+ const nexusPid = pjoin(ctx.repoRoot ?? process.cwd(), ".oa", "nexus", "daemon.pid");
51566
+ if (ex(nexusPid)) {
51567
+ const pid = parseInt(rf(nexusPid, "utf8").trim(), 10);
51568
+ if (pid > 0) {
51569
+ try {
51570
+ if (process.platform === "win32")
51571
+ nodeExecSync(`taskkill /F /PID ${pid}`, { timeout: 3e3, stdio: "ignore" });
51572
+ else
51573
+ process.kill(pid, "SIGTERM");
51574
+ } catch {
51575
+ }
51576
+ }
51577
+ }
51578
+ const cfPids = findPidsByPattern(process.platform === "win32" ? "cloudflared" : "cloudflared tunnel");
51579
+ for (const pid of cfPids)
51580
+ killPid(pid);
51581
+ const voiceDir2 = pjoin(hd(), ".open-agents", "voice");
51582
+ for (const pf of ["luxtts-daemon.pid", "piper-daemon.pid"]) {
51583
+ const fp = pjoin(voiceDir2, pf);
51584
+ if (ex(fp)) {
51585
+ const pid = parseInt(rf(fp, "utf8").trim(), 10);
51586
+ if (pid > 0)
51587
+ killPid(pid);
51588
+ }
51589
+ }
51590
+ } catch {
51591
+ }
51551
51592
  process.exit(120);
51552
51593
  }
51553
51594
  async function switchModel(query, ctx, local = false) {
@@ -66161,6 +66202,26 @@ async function startInteractive(config, repoPath) {
66161
66202
  await new Promise((r) => setTimeout(r, 50));
66162
66203
  process.stdin.pause();
66163
66204
  }
66205
+ if (isResumed) {
66206
+ try {
66207
+ const nexusDir = join70(repoRoot, ".oa", "nexus");
66208
+ const pidFile = join70(nexusDir, "daemon.pid");
66209
+ if (existsSync53(pidFile)) {
66210
+ const pid = parseInt(readFileSync42(pidFile, "utf8").trim(), 10);
66211
+ if (pid > 0) {
66212
+ try {
66213
+ if (process.platform === "win32") {
66214
+ execSync33(`taskkill /F /PID ${pid}`, { timeout: 5e3, stdio: "ignore" });
66215
+ } else {
66216
+ process.kill(pid, "SIGTERM");
66217
+ }
66218
+ } catch {
66219
+ }
66220
+ }
66221
+ }
66222
+ } catch {
66223
+ }
66224
+ }
66164
66225
  initOaDirectory(repoRoot);
66165
66226
  const savedSettings = resolveSettings(repoRoot);
66166
66227
  let restoredSessionContext = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.185.18",
3
+ "version": "0.185.20",
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",