agentgui 1.0.491 → 1.0.493

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.
@@ -35,6 +35,45 @@ const getInstalledVersion = (pkg) => {
35
35
  return null;
36
36
  };
37
37
 
38
+ const getCliToolVersion = async (pkg) => {
39
+ try {
40
+ const cliName = pkg.split('/').pop();
41
+ const nodeModulesPath = getNodeModulesPath();
42
+ const cliBinPath = path.join(nodeModulesPath, '.bin', cliName);
43
+
44
+ if (fs.existsSync(cliBinPath)) {
45
+ const result = await new Promise((resolve) => {
46
+ const proc = spawn(cliBinPath, ['--version'], {
47
+ stdio: ['pipe', 'pipe', 'pipe'],
48
+ timeout: 5000,
49
+ shell: isWindows
50
+ });
51
+ let stdout = '';
52
+ proc.stdout.on('data', (d) => { stdout += d.toString(); });
53
+ const timer = setTimeout(() => {
54
+ try { proc.kill('SIGKILL'); } catch (_) {}
55
+ resolve(null);
56
+ }, 5000);
57
+ proc.on('close', (code) => {
58
+ clearTimeout(timer);
59
+ if (code === 0) {
60
+ const version = stdout.trim().split(/[\s\(]/)[0];
61
+ resolve(version && version.match(/^\d+\.\d+/) ? version : null);
62
+ } else {
63
+ resolve(null);
64
+ }
65
+ });
66
+ proc.on('error', () => {
67
+ clearTimeout(timer);
68
+ resolve(null);
69
+ });
70
+ });
71
+ return result;
72
+ }
73
+ } catch (_) {}
74
+ return null;
75
+ };
76
+
38
77
  const getPublishedVersion = async (pkg) => {
39
78
  try {
40
79
  const cacheKey = `published-${pkg}`;
@@ -120,6 +159,11 @@ const checkToolViaBunx = async (pkg) => {
120
159
  });
121
160
  });
122
161
 
162
+ let finalInstalledVersion = checkResult.installedVersion;
163
+ if (!finalInstalledVersion && checkResult.installed) {
164
+ finalInstalledVersion = await getCliToolVersion(pkg);
165
+ }
166
+
123
167
  const publishedVersion = await getPublishedVersion(pkg);
124
168
  const compareVersions = (v1, v2) => {
125
169
  if (!v1 || !v2) return false;
@@ -134,8 +178,8 @@ const checkToolViaBunx = async (pkg) => {
134
178
  return false;
135
179
  };
136
180
 
137
- const needsUpdate = checkResult.installed && publishedVersion && compareVersions(checkResult.installedVersion, publishedVersion);
138
- return { ...checkResult, publishedVersion, upgradeNeeded: needsUpdate };
181
+ const needsUpdate = checkResult.installed && publishedVersion && compareVersions(finalInstalledVersion, publishedVersion);
182
+ return { ...checkResult, installedVersion: finalInstalledVersion, publishedVersion, upgradeNeeded: needsUpdate };
139
183
  } catch (_) {
140
184
  const installedVersion = getInstalledVersion(pkg);
141
185
  return { installed: checkToolInstalled(pkg), isUpToDate: false, upgradeNeeded: false, output: '', installedVersion, publishedVersion: null };
@@ -264,7 +264,9 @@ export function register(router, deps) {
264
264
  status: t.installed ? (t.isUpToDate ? 'installed' : 'needs_update') : 'not_installed',
265
265
  isUpToDate: t.isUpToDate,
266
266
  upgradeNeeded: t.upgradeNeeded,
267
- hasUpdate: t.upgradeNeeded && t.installed
267
+ hasUpdate: t.upgradeNeeded && t.installed,
268
+ installedVersion: t.installedVersion,
269
+ publishedVersion: t.publishedVersion
268
270
  }));
269
271
  return { tools: result };
270
272
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.491",
3
+ "version": "1.0.493",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -147,6 +147,7 @@ class AgentGUIClient {
147
147
  this.wsManager.on('connected', () => {
148
148
  console.log('WebSocket connected');
149
149
  this.updateConnectionStatus('connected');
150
+ this._subscribeToConversationUpdates();
150
151
  this._recoverMissedChunks();
151
152
  this.emit('ws:connected');
152
153
  });
@@ -1378,6 +1379,13 @@ class AgentGUIClient {
1378
1379
  }
1379
1380
  }
1380
1381
 
1382
+ _subscribeToConversationUpdates() {
1383
+ if (!this.state.conversations || this.state.conversations.length === 0) return;
1384
+ for (const conv of this.state.conversations) {
1385
+ this.wsManager.subscribeToConversation(conv.id);
1386
+ }
1387
+ }
1388
+
1381
1389
  async _recoverMissedChunks() {
1382
1390
  if (!this.state.currentSession?.id) return;
1383
1391
  if (!this.state.streamingConversations.has(this.state.currentConversation?.id)) return;
@@ -473,6 +473,10 @@ class WebSocketManager {
473
473
  return this.sendMessage({ type: 'subscribe', sessionId, timestamp: Date.now() });
474
474
  }
475
475
 
476
+ subscribeToConversation(conversationId) {
477
+ return this.sendMessage({ type: 'subscribe', conversationId, timestamp: Date.now() });
478
+ }
479
+
476
480
  resubscribeAll() {
477
481
  for (const key of this.activeSubscriptions) {
478
482
  const [type, id] = key.split(':');