@openagents-org/agent-launcher 0.2.53 → 0.2.54
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 +2 -10
package/package.json
CHANGED
package/src/installer.js
CHANGED
|
@@ -52,17 +52,9 @@ class Installer {
|
|
|
52
52
|
const binaryPath = this._whichBinary(agentType);
|
|
53
53
|
if (!binaryPath) return false;
|
|
54
54
|
|
|
55
|
-
// Verify it's not a stale shim —
|
|
56
|
-
//
|
|
57
|
-
const entry = this.registry.getEntry(agentType);
|
|
58
|
-
const npmPkg = entry && entry.install ? entry.install.npm_package : null;
|
|
59
|
-
const binary = entry && entry.install ? entry.install.binary : agentType;
|
|
60
|
-
const portableDir = path.join(os.homedir(), '.openagents', 'nodejs');
|
|
61
|
-
const globalModules = path.join(portableDir, 'node_modules');
|
|
62
|
-
|
|
63
|
-
// If the binary is in our portable dir, verify the package exists
|
|
55
|
+
// Verify it's not a stale shim — if binary is in our portable dir,
|
|
56
|
+
// check the actual package exists (reuse variables from above)
|
|
64
57
|
if (binaryPath.startsWith(portableDir)) {
|
|
65
|
-
const pkgDir = path.join(globalModules, npmPkg || binary);
|
|
66
58
|
if (!fs.existsSync(path.join(pkgDir, 'package.json'))) {
|
|
67
59
|
// Stale shim — clean it up from all possible locations
|
|
68
60
|
for (const dir of [portableDir, path.join(globalModules, '.bin')]) {
|