@openagents-org/agent-launcher 0.2.52 → 0.2.53
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.
- package/package.json +1 -1
- package/src/installer.js +10 -1
package/package.json
CHANGED
package/src/installer.js
CHANGED
|
@@ -39,7 +39,16 @@ class Installer {
|
|
|
39
39
|
// Fast check: marker file
|
|
40
40
|
if (this._hasMarker(agentType)) return true;
|
|
41
41
|
|
|
42
|
-
//
|
|
42
|
+
// Definitive check: does the package exist in our node_modules?
|
|
43
|
+
const portableDir = path.join(os.homedir(), '.openagents', 'nodejs');
|
|
44
|
+
const globalModules = path.join(portableDir, 'node_modules');
|
|
45
|
+
const entry = this.registry.getEntry(agentType);
|
|
46
|
+
const npmPkg = entry && entry.install ? entry.install.npm_package : null;
|
|
47
|
+
const binary = entry && entry.install ? entry.install.binary : agentType;
|
|
48
|
+
const pkgDir = path.join(globalModules, npmPkg || binary);
|
|
49
|
+
if (fs.existsSync(path.join(pkgDir, 'package.json'))) return true;
|
|
50
|
+
|
|
51
|
+
// Fallback: check if binary exists on PATH (system install)
|
|
43
52
|
const binaryPath = this._whichBinary(agentType);
|
|
44
53
|
if (!binaryPath) return false;
|
|
45
54
|
|