agentgui 1.0.499 → 1.0.501
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/lib/tool-manager.js +14 -6
- package/package.json +1 -1
package/lib/tool-manager.js
CHANGED
|
@@ -25,11 +25,14 @@ const getNodeModulesPath = () => {
|
|
|
25
25
|
|
|
26
26
|
const getInstalledVersion = (pkg) => {
|
|
27
27
|
try {
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
const homeDir = os.homedir();
|
|
29
|
+
const pluginPath = path.join(homeDir, '.claude', 'plugins', pkg);
|
|
30
|
+
const pluginJsonPath = path.join(pluginPath, 'plugin.json');
|
|
31
|
+
if (fs.existsSync(pluginJsonPath)) {
|
|
32
|
+
const pluginJson = JSON.parse(fs.readFileSync(pluginJsonPath, 'utf-8'));
|
|
33
|
+
if (pluginJson.version) {
|
|
34
|
+
return pluginJson.version;
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
} catch (_) {}
|
|
35
38
|
return null;
|
|
@@ -118,7 +121,12 @@ const checkToolInstalled = (pkg) => {
|
|
|
118
121
|
try {
|
|
119
122
|
const nodeModulesPath = getNodeModulesPath();
|
|
120
123
|
const nodeModulesPackagePath = path.join(nodeModulesPath, pkg);
|
|
121
|
-
|
|
124
|
+
if (fs.existsSync(nodeModulesPackagePath)) {
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
const homeDir = os.homedir();
|
|
128
|
+
const pluginPath = path.join(homeDir, '.claude', 'plugins', pkg);
|
|
129
|
+
return fs.existsSync(pluginPath);
|
|
122
130
|
} catch (_) {
|
|
123
131
|
return false;
|
|
124
132
|
}
|