agentgui 1.0.815 → 1.0.817
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/CHANGELOG.md +7 -0
- package/lib/tool-manager.js +1 -1
- package/lib/tool-provisioner.js +1 -1
- package/lib/tool-spawner.js +2 -1
- package/lib/{tool-version.js → tool-version-check.js} +2 -65
- package/lib/tool-version-fetch.js +61 -0
- package/package.json +1 -1
- package/static/js/client.js +0 -272
- package/static/js/conv-machine.js +0 -3
- package/static/js/conversations.js +0 -5
- package/static/js/event-filter.js +0 -59
- package/static/js/image-loader.js +0 -35
- package/static/js/script-runner.js +0 -3
- package/static/js/state-barrier.js +0 -4
- package/static/js/streaming-renderer.js +0 -273
- package/static/js/syntax-highlighter.js +0 -55
- package/static/js/ui-components.js +0 -51
- package/static/js/websocket-manager.js +0 -7
- package/static/js/ws-client.js +0 -4
- package/static/js/ws-machine.js +0 -2
- package/static/theme.js +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## 2026-04-11
|
|
2
|
+
- refactor: split tool-version.js into tool-version-check.js (sync) and tool-version-fetch.js (async/network)
|
|
3
|
+
|
|
4
|
+
## [Unreleased]
|
|
5
|
+
### Refactor
|
|
6
|
+
- Strip all standalone comment lines (// and /* */ block lines) from 14 static JS files: event-filter.js, image-loader.js, syntax-highlighter.js, client.js, streaming-renderer.js, ui-components.js, conversations.js, websocket-manager.js, conv-machine.js, ws-machine.js, ws-client.js, state-barrier.js, script-runner.js, theme.js. Total 781 comment lines removed. All files syntax-verified.
|
|
7
|
+
|
|
1
8
|
## [Unreleased]
|
|
2
9
|
|
|
3
10
|
### Changed
|
package/lib/tool-manager.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { checkToolViaBunx, clearVersionCache } from './tool-version.js';
|
|
1
|
+
import { checkToolViaBunx, clearVersionCache } from './tool-version-fetch.js';
|
|
2
2
|
import { createInstaller } from './tool-spawner.js';
|
|
3
3
|
import { autoProvision as _autoProvision, startPeriodicUpdateCheck as _startPeriodicUpdateCheck, stopPeriodicUpdateCheck } from './tool-provisioner.js';
|
|
4
4
|
|
package/lib/tool-provisioner.js
CHANGED
package/lib/tool-spawner.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
2
|
import os from 'os';
|
|
3
|
-
import { getCliVersion, getInstalledVersion
|
|
3
|
+
import { getCliVersion, getInstalledVersion } from './tool-version-check.js';
|
|
4
|
+
import { clearVersionCache, checkToolViaBunx } from './tool-version-fetch.js';
|
|
4
5
|
import * as toolInstallMachine from './tool-install-machine.js';
|
|
5
6
|
|
|
6
7
|
const isWindows = os.platform() === 'win32';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import https from 'https';
|
|
5
4
|
import { execSync } from 'child_process';
|
|
6
5
|
|
|
7
6
|
const isWindows = os.platform() === 'win32';
|
|
8
7
|
const homeDir = os.homedir();
|
|
9
8
|
|
|
10
|
-
const BIN_MAP = {
|
|
9
|
+
export const BIN_MAP = {
|
|
11
10
|
'@anthropic-ai/claude-code': 'claude',
|
|
12
11
|
'opencode-ai': 'opencode',
|
|
13
12
|
'@google/gemini-cli': 'gemini',
|
|
@@ -31,7 +30,7 @@ function getClaudeInstalledPluginPath(pluginId) {
|
|
|
31
30
|
return null;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
const FRAMEWORK_PATHS = {
|
|
33
|
+
export const FRAMEWORK_PATHS = {
|
|
35
34
|
claude: {
|
|
36
35
|
pluginDir: (pluginId) => getClaudeInstalledPluginPath(pluginId) || path.join(homeDir, '.claude', 'plugins', pluginId),
|
|
37
36
|
versionFile: (pluginId) => {
|
|
@@ -96,15 +95,12 @@ export function getInstalledVersion(pkg, pluginId = null, frameWork = null, tool
|
|
|
96
95
|
const tool = tools.find(t => t.pkg === pkg);
|
|
97
96
|
const actualPluginId = pluginId || tool?.pluginId || pkg;
|
|
98
97
|
const actualFrameWork = frameWork || tool?.frameWork;
|
|
99
|
-
|
|
100
98
|
const frameworks = actualFrameWork ? [actualFrameWork] : Object.keys(FRAMEWORK_PATHS);
|
|
101
99
|
for (const fw of frameworks) {
|
|
102
100
|
const fwConfig = FRAMEWORK_PATHS[fw];
|
|
103
101
|
if (!fwConfig) continue;
|
|
104
|
-
|
|
105
102
|
const version = tryReadVersion(fwConfig, actualPluginId);
|
|
106
103
|
if (version) return version;
|
|
107
|
-
|
|
108
104
|
if (fwConfig.fallbackInstalled) {
|
|
109
105
|
const hasMarker = fwConfig.markerFile && fs.existsSync(fwConfig.markerFile(actualPluginId));
|
|
110
106
|
const hasDir = fs.existsSync(fwConfig.pluginDir(actualPluginId));
|
|
@@ -177,62 +173,3 @@ export function compareVersions(v1, v2) {
|
|
|
177
173
|
}
|
|
178
174
|
return false;
|
|
179
175
|
}
|
|
180
|
-
|
|
181
|
-
const versionCache = new Map();
|
|
182
|
-
|
|
183
|
-
export function getPublishedVersion(pkg) {
|
|
184
|
-
const cacheKey = `published-${pkg}`;
|
|
185
|
-
const cached = versionCache.get(cacheKey);
|
|
186
|
-
if (cached && Date.now() - cached.timestamp < 3600000) {
|
|
187
|
-
return cached.version;
|
|
188
|
-
}
|
|
189
|
-
return null;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export async function fetchPublishedVersion(pkg) {
|
|
193
|
-
const cacheKey = `published-${pkg}`;
|
|
194
|
-
const cached = versionCache.get(cacheKey);
|
|
195
|
-
if (cached && Date.now() - cached.timestamp < 3600000) {
|
|
196
|
-
return cached.version;
|
|
197
|
-
}
|
|
198
|
-
try {
|
|
199
|
-
const version = await new Promise((resolve, reject) => {
|
|
200
|
-
const url = `https://registry.npmjs.org/${pkg}/latest`;
|
|
201
|
-
https.get(url, { headers: { 'User-Agent': 'agentgui-version-check/1.0' } }, (res) => {
|
|
202
|
-
let data = '';
|
|
203
|
-
res.on('data', chunk => { data += chunk; });
|
|
204
|
-
res.on('end', () => {
|
|
205
|
-
try { resolve(JSON.parse(data).version || null); } catch (e) { reject(e); }
|
|
206
|
-
});
|
|
207
|
-
}).on('error', reject);
|
|
208
|
-
});
|
|
209
|
-
if (version) versionCache.set(cacheKey, { version, timestamp: Date.now() });
|
|
210
|
-
return version;
|
|
211
|
-
} catch (_) {}
|
|
212
|
-
return null;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export function clearVersionCache() {
|
|
216
|
-
versionCache.clear();
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
export async function checkToolViaBunx(pkg, pluginId = null, category = 'plugin', frameWork = null, skipPublishedVersion = false, tools = []) {
|
|
220
|
-
try {
|
|
221
|
-
const isCli = category === 'cli';
|
|
222
|
-
const installed = isCli ? checkCliInstalled(pkg) : checkToolInstalled(pluginId || pkg, frameWork);
|
|
223
|
-
const installedVersion = isCli ? getCliVersion(pkg) : getInstalledVersion(pkg, pluginId, frameWork, tools);
|
|
224
|
-
let publishedVersion = null;
|
|
225
|
-
if (!skipPublishedVersion) {
|
|
226
|
-
publishedVersion = await fetchPublishedVersion(pkg);
|
|
227
|
-
}
|
|
228
|
-
const needsUpdate = installed && publishedVersion && compareVersions(installedVersion, publishedVersion);
|
|
229
|
-
const isUpToDate = installed && !needsUpdate;
|
|
230
|
-
return { installed, isUpToDate, upgradeNeeded: needsUpdate, output: 'version-check', installedVersion, publishedVersion };
|
|
231
|
-
} catch (err) {
|
|
232
|
-
console.log(`[tool-manager] Error checking ${pkg}:`, err.message);
|
|
233
|
-
const isCli = category === 'cli';
|
|
234
|
-
const installed = isCli ? checkCliInstalled(pkg) : checkToolInstalled(pluginId || pkg, frameWork);
|
|
235
|
-
const installedVersion = isCli ? getCliVersion(pkg) : getInstalledVersion(pkg, pluginId, frameWork, tools);
|
|
236
|
-
return { installed, isUpToDate: false, upgradeNeeded: false, output: '', installedVersion, publishedVersion: null };
|
|
237
|
-
}
|
|
238
|
-
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import https from 'https';
|
|
2
|
+
import { checkCliInstalled, getCliVersion, checkToolInstalled, compareVersions, getInstalledVersion } from './tool-version-check.js';
|
|
3
|
+
|
|
4
|
+
const versionCache = new Map();
|
|
5
|
+
|
|
6
|
+
export function getPublishedVersion(pkg) {
|
|
7
|
+
const cacheKey = `published-${pkg}`;
|
|
8
|
+
const cached = versionCache.get(cacheKey);
|
|
9
|
+
if (cached && Date.now() - cached.timestamp < 3600000) {
|
|
10
|
+
return cached.version;
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function fetchPublishedVersion(pkg) {
|
|
16
|
+
const cacheKey = `published-${pkg}`;
|
|
17
|
+
const cached = versionCache.get(cacheKey);
|
|
18
|
+
if (cached && Date.now() - cached.timestamp < 3600000) {
|
|
19
|
+
return cached.version;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
const version = await new Promise((resolve, reject) => {
|
|
23
|
+
const url = `https://registry.npmjs.org/${pkg}/latest`;
|
|
24
|
+
https.get(url, { headers: { 'User-Agent': 'agentgui-version-check/1.0' } }, (res) => {
|
|
25
|
+
let data = '';
|
|
26
|
+
res.on('data', chunk => { data += chunk; });
|
|
27
|
+
res.on('end', () => {
|
|
28
|
+
try { resolve(JSON.parse(data).version || null); } catch (e) { reject(e); }
|
|
29
|
+
});
|
|
30
|
+
}).on('error', reject);
|
|
31
|
+
});
|
|
32
|
+
if (version) versionCache.set(cacheKey, { version, timestamp: Date.now() });
|
|
33
|
+
return version;
|
|
34
|
+
} catch (_) {}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function clearVersionCache() {
|
|
39
|
+
versionCache.clear();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function checkToolViaBunx(pkg, pluginId = null, category = 'plugin', frameWork = null, skipPublishedVersion = false, tools = []) {
|
|
43
|
+
try {
|
|
44
|
+
const isCli = category === 'cli';
|
|
45
|
+
const installed = isCli ? checkCliInstalled(pkg) : checkToolInstalled(pluginId || pkg, frameWork);
|
|
46
|
+
const installedVersion = isCli ? getCliVersion(pkg) : getInstalledVersion(pkg, pluginId, frameWork, tools);
|
|
47
|
+
let publishedVersion = null;
|
|
48
|
+
if (!skipPublishedVersion) {
|
|
49
|
+
publishedVersion = await fetchPublishedVersion(pkg);
|
|
50
|
+
}
|
|
51
|
+
const needsUpdate = installed && publishedVersion && compareVersions(installedVersion, publishedVersion);
|
|
52
|
+
const isUpToDate = installed && !needsUpdate;
|
|
53
|
+
return { installed, isUpToDate, upgradeNeeded: needsUpdate, output: 'version-check', installedVersion, publishedVersion };
|
|
54
|
+
} catch (err) {
|
|
55
|
+
console.log(`[tool-manager] Error checking ${pkg}:`, err.message);
|
|
56
|
+
const isCli = category === 'cli';
|
|
57
|
+
const installed = isCli ? checkCliInstalled(pkg) : checkToolInstalled(pluginId || pkg, frameWork);
|
|
58
|
+
const installedVersion = isCli ? getCliVersion(pkg) : getInstalledVersion(pkg, pluginId, frameWork, tools);
|
|
59
|
+
return { installed, isUpToDate: false, upgradeNeeded: false, output: '', installedVersion, publishedVersion: null };
|
|
60
|
+
}
|
|
61
|
+
}
|