agentgui 1.0.787 → 1.0.789

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/acp-queries.js CHANGED
@@ -138,7 +138,7 @@ export function createACPQueries(db, prep) {
138
138
  if (status) { wh += ' AND status = ?'; prm.push(status); }
139
139
  if (dateRange?.start) { wh += ' AND created_at >= ?'; prm.push(new Date(dateRange.start).getTime()); }
140
140
  if (dateRange?.end) { wh += ' AND created_at <= ?'; prm.push(new Date(dateRange.end).getTime()); }
141
- if (metadata) { for (const [k, v] of Object.entries(metadata)) { wh += ' AND metadata LIKE ?'; prm.push(`%"${k}":"${v}"%`); } }
141
+ if (metadata) { for (const [k, v] of Object.entries(metadata)) { const ek = String(k).replace(/[%_]/g, ''); const ev = String(v).replace(/[%_]/g, ''); wh += ' AND metadata LIKE ?'; prm.push(`%"${ek}":"${ev}"%`); } }
142
142
  const tot = prep(`SELECT COUNT(*) as count FROM conversations WHERE ${wh}`).get(...prm).count;
143
143
  const rows = prep(`SELECT * FROM conversations WHERE ${wh} ORDER BY updated_at DESC LIMIT ? OFFSET ?`).all(...prm, limit, offset);
144
144
  const ths = rows.map(r => ({ thread_id: r.id, created_at: iso(r.created_at), updated_at: iso(r.updated_at), metadata: jp(r.metadata), status: r.status || 'idle' }));
@@ -77,9 +77,10 @@ class ClientQueue {
77
77
  }
78
78
  const allowedCount = 100 - this.messageCount;
79
79
  if (allowedCount <= 0) {
80
- // Put everything back and reschedule don't drop events
80
+ // Put everything back and wait for next 1-second window
81
81
  this.normalPriority.unshift(...batch);
82
- this.scheduleFlush();
82
+ const msUntilReset = Math.max(50, 1000 - (now - this.windowStart));
83
+ this.timer = setTimeout(() => { this.timer = null; this.flush(); }, msUntilReset);
83
84
  return;
84
85
  }
85
86
  // Return overflow to front of queue for next flush cycle
@@ -43,7 +43,8 @@ class WsRouter {
43
43
  let parsed;
44
44
  try {
45
45
  parsed = decode(rawData);
46
- } catch {
46
+ } catch (err) {
47
+ console.warn(`[ws-protocol] Decode failed for client ${ws.clientId}:`, err.message);
47
48
  sendBinary(ws, { r: null, e: { c: 400, m: 'Invalid message' } });
48
49
  return;
49
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.787",
3
+ "version": "1.0.789",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",
@@ -16,7 +16,7 @@ const wsMachine = createMachine({
16
16
  disconnected: {
17
17
  entry: assign({ lastDisconnectedAt: () => Date.now() }),
18
18
  on: {
19
- CONNECT: { target: 'connecting', guard: ({ context }) => !context.manualDisconnect || true },
19
+ CONNECT: { target: 'connecting', guard: ({ context }) => !context.manualDisconnect },
20
20
  MANUAL_DISCONNECT: { actions: assign({ manualDisconnect: true }) },
21
21
  },
22
22
  },