agentgui 1.0.998 → 1.0.1000

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/electron/main.js CHANGED
@@ -14,9 +14,12 @@ let serverProcess = null;
14
14
  let mainWindow = null;
15
15
 
16
16
  function startServer() {
17
+ // process.execPath is the Electron binary; ELECTRON_RUN_AS_NODE makes it run
18
+ // server.js as a plain Node process instead of spinning up a second
19
+ // Electron/Chromium app runtime just to host the background HTTP server.
17
20
  serverProcess = spawn(process.execPath, ['server.js'], {
18
21
  cwd: ROOT,
19
- env: { ...process.env, PORT: String(PORT) },
22
+ env: { ...process.env, ELECTRON_RUN_AS_NODE: '1', PORT: String(PORT) },
20
23
  stdio: ['ignore', 'pipe', 'pipe'],
21
24
  });
22
25
  serverProcess.stdout.on('data', d => process.stdout.write(`[server] ${d}`));
@@ -32,6 +35,7 @@ function pollReady(retries = 40) {
32
35
  return new Promise((resolve, reject) => {
33
36
  function attempt(n) {
34
37
  http.get(APP_URL, res => {
38
+ res.resume(); // drain the response so the socket is freed between polls
35
39
  if (res.statusCode === 200 || res.statusCode === 401) return resolve();
36
40
  if (n <= 0) return reject(new Error(`Server not ready after polling (last status: ${res.statusCode})`));
37
41
  setTimeout(() => attempt(n - 1), 500);
package/lib/ws-setup.js CHANGED
@@ -60,6 +60,10 @@ export function createWsSetup(server, { BASE_URL, watch, staticDir, _assetCache,
60
60
  }
61
61
  debugLog(`[WebSocket] Client ${ws.clientId} disconnected`);
62
62
  });
63
+ } else {
64
+ // No handler owns this route - close it rather than leaving an
65
+ // authenticated socket open and idle (it would never be serviced).
66
+ ws.close(4404, 'unknown-route');
63
67
  }
64
68
  });
65
69
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.998",
3
+ "version": "1.0.1000",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",