agentgui 1.0.511 → 1.0.512
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/server.js +18 -5
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1817,15 +1817,28 @@ const server = http.createServer(async (req, res) => {
|
|
|
1817
1817
|
|
|
1818
1818
|
if (pathOnly.match(/^\/api\/tools\/([^/]+)\/status$/)) {
|
|
1819
1819
|
const toolId = pathOnly.match(/^\/api\/tools\/([^/]+)\/status$/)[1];
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1820
|
+
const dbStatus = queries.getToolStatus(toolId);
|
|
1821
|
+
const tmStatus = toolManager.checkToolStatus(toolId);
|
|
1822
|
+
if (!tmStatus && !dbStatus) {
|
|
1822
1823
|
sendJSON(req, res, 404, { error: 'Tool not found' });
|
|
1823
1824
|
return;
|
|
1824
1825
|
}
|
|
1826
|
+
|
|
1827
|
+
// Merge database status with tool manager status
|
|
1828
|
+
const status = {
|
|
1829
|
+
toolId,
|
|
1830
|
+
installed: tmStatus?.installed || (dbStatus?.status === 'installed'),
|
|
1831
|
+
isUpToDate: tmStatus?.isUpToDate || false,
|
|
1832
|
+
upgradeNeeded: tmStatus?.upgradeNeeded || false,
|
|
1833
|
+
status: dbStatus?.status || (tmStatus?.installed ? 'installed' : 'not_installed'),
|
|
1834
|
+
installedVersion: dbStatus?.version || tmStatus?.installedVersion || null,
|
|
1835
|
+
timestamp: Date.now(),
|
|
1836
|
+
error_message: dbStatus?.error_message || null
|
|
1837
|
+
};
|
|
1838
|
+
|
|
1825
1839
|
if (status.installed) {
|
|
1826
|
-
const updates = await toolManager.checkForUpdates(toolId
|
|
1827
|
-
status.hasUpdate = updates.
|
|
1828
|
-
status.latestVersion = updates.latestVersion;
|
|
1840
|
+
const updates = await toolManager.checkForUpdates(toolId);
|
|
1841
|
+
status.hasUpdate = updates.needsUpdate || false;
|
|
1829
1842
|
}
|
|
1830
1843
|
sendJSON(req, res, 200, status);
|
|
1831
1844
|
return;
|