agentgui 1.0.498 → 1.0.500
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 +10 -5
- package/package.json +1 -1
- package/server.js +2 -2
- package/static/js/tools-manager.js +6 -2
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;
|
|
@@ -273,6 +276,7 @@ export async function install(toolId, onProgress) {
|
|
|
273
276
|
try {
|
|
274
277
|
const result = await spawnBunxProc(tool.pkg, onProgress);
|
|
275
278
|
statusCache.delete(toolId);
|
|
279
|
+
versionCache.delete(`published-${tool.pkg}`);
|
|
276
280
|
return result;
|
|
277
281
|
} finally {
|
|
278
282
|
installLocks.delete(toolId);
|
|
@@ -290,6 +294,7 @@ export async function update(toolId, onProgress) {
|
|
|
290
294
|
try {
|
|
291
295
|
const result = await spawnBunxProc(tool.pkg, onProgress);
|
|
292
296
|
statusCache.delete(toolId);
|
|
297
|
+
versionCache.delete(`published-${tool.pkg}`);
|
|
293
298
|
return result;
|
|
294
299
|
} finally {
|
|
295
300
|
installLocks.delete(toolId);
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1917,9 +1917,9 @@ const server = http.createServer(async (req, res) => {
|
|
|
1917
1917
|
if (result.success) {
|
|
1918
1918
|
queries.updateToolStatus(toolId, { status: 'installed', installed_at: Date.now() });
|
|
1919
1919
|
queries.addToolInstallHistory(toolId, 'update', 'success', null);
|
|
1920
|
-
await toolManager.checkToolStatusAsync(toolId);
|
|
1920
|
+
const freshStatus = await toolManager.checkToolStatusAsync(toolId);
|
|
1921
1921
|
if (wsOptimizer && wsOptimizer.broadcast) {
|
|
1922
|
-
wsOptimizer.broadcast({ type: 'tool_update_complete', toolId, data: result });
|
|
1922
|
+
wsOptimizer.broadcast({ type: 'tool_update_complete', toolId, data: { ...result, ...freshStatus } });
|
|
1923
1923
|
}
|
|
1924
1924
|
} else {
|
|
1925
1925
|
queries.updateToolStatus(toolId, { status: 'failed', error_message: result.error });
|
|
@@ -138,9 +138,13 @@
|
|
|
138
138
|
} else if (data.type === 'tool_install_complete' || data.type === 'tool_update_complete') {
|
|
139
139
|
var tool = tools.find(t => t.id === data.toolId);
|
|
140
140
|
if (tool) {
|
|
141
|
-
tool.status = 'installed';
|
|
141
|
+
tool.status = data.data?.isUpToDate ? 'installed' : 'needs_update';
|
|
142
142
|
tool.version = data.data?.version || tool.version;
|
|
143
|
-
tool.
|
|
143
|
+
tool.installedVersion = data.data?.installedVersion || tool.installedVersion;
|
|
144
|
+
tool.publishedVersion = data.data?.publishedVersion || tool.publishedVersion;
|
|
145
|
+
tool.isUpToDate = data.data?.isUpToDate ?? false;
|
|
146
|
+
tool.upgradeNeeded = data.data?.upgradeNeeded ?? false;
|
|
147
|
+
tool.hasUpdate = (data.data?.upgradeNeeded && data.data?.installed) ?? false;
|
|
144
148
|
tool.progress = 100;
|
|
145
149
|
operationInProgress.delete(data.toolId);
|
|
146
150
|
setTimeout(fetchTools, 1000);
|