@openagents-org/agent-connector 0.1.4 → 0.1.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/package.json +1 -1
  2. package/src/daemon.js +4 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openagents-org/agent-connector",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Agent management CLI and library for OpenAgents — install, configure, and run AI coding agents",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/daemon.js CHANGED
@@ -763,11 +763,7 @@ class Daemon {
763
763
  try {
764
764
  if (!fs.existsSync(pidFile)) return null;
765
765
  const pid = parseInt(fs.readFileSync(pidFile, 'utf-8').trim(), 10);
766
- if (isNaN(pid)) return null;
767
- if (Daemon._isAlive(pid)) return pid;
768
- // Stale
769
- try { fs.unlinkSync(pidFile); } catch {}
770
- return null;
766
+ return isNaN(pid) ? null : pid;
771
767
  } catch {
772
768
  return null;
773
769
  }
@@ -777,7 +773,9 @@ class Daemon {
777
773
  try {
778
774
  process.kill(pid, 0);
779
775
  return true;
780
- } catch {
776
+ } catch (e) {
777
+ // EPERM = process exists but cross-session on Windows
778
+ if (e.code === 'EPERM') return true;
781
779
  return false;
782
780
  }
783
781
  }