agentgui 1.0.778 → 1.0.780

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.
@@ -74,7 +74,8 @@ export function register(deps) {
74
74
  const url = new URL(req.url, `http://${req.headers.host}`);
75
75
  const limit = parseInt(url.searchParams.get('limit') || '50', 10);
76
76
  const before = url.searchParams.get('before') || null;
77
- let offset = before ? parseInt(before, 10) : 0;
77
+ let offset = 0;
78
+ if (before) { const parsed = parseInt(before, 10); if (!isNaN(parsed)) offset = parsed; }
78
79
  const result = queries.getThreadHistory(threadId, limit, offset);
79
80
  sendJSON(req, res, 200, { states: result.states, next_cursor: result.hasMore ? String(offset + limit) : null });
80
81
  } catch (err) {
@@ -53,6 +53,7 @@ export function register(router, deps) {
53
53
  const entry = activeScripts.get(p.id);
54
54
  if (!entry) err(404, 'No running script');
55
55
  try { process.kill(-entry.process.pid, 'SIGTERM'); } catch { try { entry.process.kill('SIGTERM'); } catch {} }
56
+ setTimeout(() => { try { process.kill(-entry.process.pid, 'SIGKILL'); } catch { try { entry.process.kill('SIGKILL'); } catch {} } }, 5000);
56
57
  return { ok: true };
57
58
  });
58
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.778",
3
+ "version": "1.0.780",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",
@@ -2,7 +2,10 @@
2
2
  var activeDialogs = [];
3
3
  var dialogZIndex = 10000;
4
4
 
5
- function escapeHtml(text) { return window._escHtml(text); }
5
+ function escapeHtml(text) {
6
+ if (typeof window._escHtml === 'function') return window._escHtml(text);
7
+ var d = document.createElement('div'); d.textContent = text; return d.innerHTML;
8
+ }
6
9
 
7
10
  function createOverlay() {
8
11
  var overlay = document.createElement('div');
@@ -32,7 +32,7 @@ class ConversationState {
32
32
 
33
33
  updateConversation(id, data, serverVersion) {
34
34
  if (id !== this.current.id) {
35
- return { success: false, reason: 'version_mismatch', prevState: this.current, newState: this.current };
35
+ return { success: false, reason: 'id_mismatch', prevState: this.current, newState: this.current };
36
36
  }
37
37
  if (serverVersion && serverVersion < this.current.version) {
38
38
  return { success: false, reason: 'stale_version', prevState: this.current, newState: this.current };
@@ -49,6 +49,7 @@ class SyntaxHighlighter {
49
49
  } catch (error) {
50
50
  console.error('Failed to load Prism:', error);
51
51
  this.isLoading = false;
52
+ this.loadPromise = null;
52
53
  throw error;
53
54
  }
54
55
  }
@@ -124,6 +124,7 @@
124
124
 
125
125
  function stopTerminal() {
126
126
  termActive = false;
127
+ if (_wsListener && window.wsManager) { window.wsManager.off('message', _wsListener); _wsListener = null; }
127
128
  wsSend({ type: 'terminal_stop' });
128
129
  }
129
130