agentgui 1.0.636 → 1.0.637
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/plugins/tools-plugin.js +17 -11
- package/lib/tool-manager.js +9 -4
- package/package.json +1 -1
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// Tools plugin - tool detection, versioning, install/update handlers
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { spawnSync } from 'child_process';
|
|
4
|
+
import os from 'os';
|
|
5
|
+
|
|
6
|
+
const isWindows = os.platform() === 'win32';
|
|
7
|
+
const bunCmd = isWindows ? 'bun.cmd' : 'bun';
|
|
4
8
|
|
|
5
9
|
export default {
|
|
6
10
|
name: 'tools',
|
|
@@ -15,19 +19,21 @@ export default {
|
|
|
15
19
|
|
|
16
20
|
const detectTools = async () => {
|
|
17
21
|
const tools = [
|
|
18
|
-
{ id: 'gm-cc', pkg: '
|
|
19
|
-
{ id: 'gm-oc', pkg: '
|
|
20
|
-
{ id: 'gm-gc', pkg: '
|
|
21
|
-
{ id: 'gm-kilo', pkg: '
|
|
22
|
+
{ id: 'gm-cc', pkg: 'gm-cc', name: 'GM Claude' },
|
|
23
|
+
{ id: 'gm-oc', pkg: 'gm-oc', name: 'GM OpenCode' },
|
|
24
|
+
{ id: 'gm-gc', pkg: 'gm-gc', name: 'GM Gemini' },
|
|
25
|
+
{ id: 'gm-kilo', pkg: 'gm-kilo', name: 'GM Kilo' },
|
|
26
|
+
{ id: 'gm-codex', pkg: 'gm-codex', name: 'GM Codex' },
|
|
27
|
+
{ id: 'cli-claude', pkg: '@anthropic-ai/claude-code', name: 'Claude Code' },
|
|
28
|
+
{ id: 'cli-opencode', pkg: 'opencode-ai', name: 'OpenCode' },
|
|
29
|
+
{ id: 'cli-gemini', pkg: '@google/gemini-cli', name: 'Gemini CLI' },
|
|
30
|
+
{ id: 'cli-kilo', pkg: '@kilocode/cli', name: 'Kilo Code' },
|
|
31
|
+
{ id: 'cli-codex', pkg: '@openai/codex', name: 'Codex CLI' },
|
|
22
32
|
];
|
|
23
33
|
|
|
24
34
|
for (const tool of tools) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
tool.installed = true;
|
|
28
|
-
} catch {
|
|
29
|
-
tool.installed = false;
|
|
30
|
-
}
|
|
35
|
+
const result = spawnSync(bunCmd, ['x', tool.pkg, '--version'], { stdio: 'ignore', timeout: 10000 });
|
|
36
|
+
tool.installed = result.status === 0;
|
|
31
37
|
toolCache.set(tool.id, tool);
|
|
32
38
|
}
|
|
33
39
|
return tools;
|
package/lib/tool-manager.js
CHANGED
|
@@ -14,6 +14,7 @@ const TOOLS = [
|
|
|
14
14
|
{ id: 'gm-oc', name: 'GM OpenCode', pkg: 'gm-oc', pluginId: 'gm', category: 'plugin', frameWork: 'opencode' },
|
|
15
15
|
{ id: 'gm-gc', name: 'GM Gemini', pkg: 'gm-gc', pluginId: 'gm', category: 'plugin', frameWork: 'gemini' },
|
|
16
16
|
{ id: 'gm-kilo', name: 'GM Kilo', pkg: 'gm-kilo', pluginId: 'gm', category: 'plugin', frameWork: 'kilo' },
|
|
17
|
+
{ id: 'gm-codex', name: 'GM Codex', pkg: 'gm-codex', pluginId: 'gm', category: 'plugin', frameWork: 'codex' },
|
|
17
18
|
];
|
|
18
19
|
|
|
19
20
|
const statusCache = new Map();
|
|
@@ -123,14 +124,15 @@ const getInstalledVersion = (pkg, pluginId = null, frameWork = null) => {
|
|
|
123
124
|
|
|
124
125
|
// Check Codex CLI (stored at ~/.codex)
|
|
125
126
|
if (!frameWork || frameWork === 'codex') {
|
|
126
|
-
const
|
|
127
|
-
if (fs.existsSync(
|
|
127
|
+
const codexPluginPath = path.join(homeDir, '.codex', 'plugins', actualPluginId, 'plugin.json');
|
|
128
|
+
if (fs.existsSync(codexPluginPath)) {
|
|
128
129
|
try {
|
|
129
|
-
const pluginJson = JSON.parse(fs.readFileSync(
|
|
130
|
+
const pluginJson = JSON.parse(fs.readFileSync(codexPluginPath, 'utf-8'));
|
|
130
131
|
if (pluginJson.version) return pluginJson.version;
|
|
131
132
|
} catch (e) {
|
|
132
|
-
console.warn(`[tool-manager] Failed to parse ${
|
|
133
|
+
console.warn(`[tool-manager] Failed to parse ${codexPluginPath}:`, e.message);
|
|
133
134
|
}
|
|
135
|
+
return 'installed';
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
138
|
} catch (_) {}
|
|
@@ -204,6 +206,9 @@ const checkToolInstalled = (pluginId, frameWork = null) => {
|
|
|
204
206
|
if (fs.existsSync(path.join(homeDir, '.config', 'kilo', 'agents', pluginId + '.md'))) return true;
|
|
205
207
|
if (fs.existsSync(path.join(homeDir, '.config', 'kilo', 'agents', pluginId))) return true;
|
|
206
208
|
}
|
|
209
|
+
if (!frameWork || frameWork === 'codex') {
|
|
210
|
+
if (fs.existsSync(path.join(homeDir, '.codex', 'plugins', pluginId))) return true;
|
|
211
|
+
}
|
|
207
212
|
} catch (_) {}
|
|
208
213
|
return false;
|
|
209
214
|
};
|