@openagents-org/agent-launcher 0.2.55 → 0.2.57

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/installer.js +8 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openagents-org/agent-launcher",
3
- "version": "0.2.55",
3
+ "version": "0.2.57",
4
4
  "description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/installer.js CHANGED
@@ -36,9 +36,6 @@ class Installer {
36
36
  * Checks binary on PATH first, then marker files.
37
37
  */
38
38
  isInstalled(agentType) {
39
- // Fast check: marker file
40
- if (this._hasMarker(agentType)) return true;
41
-
42
39
  // Definitive check: does the package exist in our node_modules?
43
40
  const portableDir = path.join(os.homedir(), '.openagents', 'nodejs');
44
41
  const globalModules = path.join(portableDir, 'node_modules');
@@ -48,9 +45,16 @@ class Installer {
48
45
  const pkgDir = path.join(globalModules, npmPkg || binary);
49
46
  if (fs.existsSync(path.join(pkgDir, 'package.json'))) return true;
50
47
 
48
+ // Marker file alone is not enough — package may have been pruned
49
+ // (npm --prefix removes packages not in its dependency tree)
50
+
51
51
  // Fallback: check if binary exists on PATH (system install)
52
52
  const binaryPath = this._whichBinary(agentType);
53
- if (!binaryPath) return false;
53
+ if (!binaryPath) {
54
+ // Clean stale marker if package is gone
55
+ try { fs.unlinkSync(path.join(this.markersDir, agentType)); } catch {}
56
+ return false;
57
+ }
54
58
 
55
59
  // Verify it's not a stale shim — if binary is in our portable dir,
56
60
  // check the actual package exists (reuse variables from above)