agentgui 1.0.859 → 1.0.861

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/CLAUDE.md CHANGED
@@ -365,3 +365,7 @@ The README.md uses shields.io badges with a consistent pattern:
365
365
  - **HTML cache** (`_htmlCache`) is only populated when client accepts gzip. In watch mode it's never cached (always fresh).
366
366
  - **`app.js` and `app-shortcuts.js` script loading:** Both are `<script defer>` tags loaded AFTER `agent-auth.js` in index.html. They depend on `window.wsClient`, `window.conversationManager`, and `window._escHtml` being initialized first. Defer order is guaranteed by source order — adding new defer scripts that depend on these modules requires careful ordering.
367
367
  - **`window.__debug.getSyncState()`:** Debug API in client.js exposes internal state machine snapshots: `convMachineStates`, `toolInstallMachineStates`, `voiceMachineState`, `convListMachineState`, `promptMachineState`, `wsConnectionState`, `rendererEventQueueLength`, `rendererEventHistoryLength`. All XState v5 machines have no parallel ad-hoc state — this API is the only way to inspect full machine state at once.
368
+ - **`isJsonlBacked` flag:** Only `claude-code` (protocol: `direct`) writes JSONL files. All other agents use `stream-event-handler.js` for broadcasting. `isJsonlBacked = resolvedAgentId === 'claude-code'` — guards in `stream-event-handler.js` prevent double-broadcast for claude-code, and gates ACP streaming for non-JSONL agents.
369
+ - **`toolIds` in `server-startup.js` must match `TOOLS` in `tool-manager.js`:** `initializeToolInstallations` runs for each toolId, creating the `tool_installations` row. `tool_install_history` has a FK to `tool_installations(tool_id)`. Any tool omitted from toolIds will cause a FOREIGN KEY constraint failure when the periodic update checker writes history for it.
370
+ - **`JsonlWatcher._read(fp)` override:** Captures `this._currentFp` before calling `super._read(fp)`, making the file path available to `_line()` callbacks for project-directory decoding in `_conv()`. JSONL project dirs are encoded (e.g., `-config-workspace-agentgui`) — decoded via `'/' + dirName.slice(1).replace(/-/g, '/')`.
371
+ - **`createHttpHandler` uses `getWss: () => wss` (lazy getter):** Passing `wss` directly would crash with TDZ since `wss` is declared after `createHttpHandler` is called. The function form defers access until request time when `wss` is initialized.
package/lib/db-queries.js CHANGED
@@ -62,6 +62,7 @@ export function createQueries(db, prep, generateId) {
62
62
  prep('UPDATE conversations SET claudeSessionId = ?, updated_at = ? WHERE id = ?').run(claudeSessionId, Date.now(), conversationId);
63
63
  if (sessionId) prep('UPDATE sessions SET claudeSessionId = ? WHERE id = ?').run(claudeSessionId, sessionId);
64
64
  },
65
+ getConversationByClaudeSessionId(claudeSessionId) { return prep('SELECT * FROM conversations WHERE claudeSessionId = ? AND status NOT IN (?, ?) LIMIT 1').get(claudeSessionId, 'deleted', 'archived') || null; },
65
66
  getClaudeSessionId(conversationId) { const row = prep('SELECT claudeSessionId FROM conversations WHERE id = ?').get(conversationId); return row?.claudeSessionId || null; },
66
67
  setIsStreaming(conversationId, isStreaming) { prep('UPDATE conversations SET isStreaming = ?, updated_at = ? WHERE id = ?').run(isStreaming ? 1 : 0, Date.now(), conversationId); },
67
68
  getIsStreaming(conversationId) { const row = prep('SELECT isStreaming FROM conversations WHERE id = ?').get(conversationId); return row?.isStreaming === 1; },
@@ -44,7 +44,7 @@ export class JsonlParser {
44
44
 
45
45
  _conv(sid, e, fp) {
46
46
  if (this._convMap.has(sid)) return this._convMap.get(sid);
47
- const found = this._q.getConversations().find(c => c.claudeSessionId === sid);
47
+ const found = this._q.getConversationByClaudeSessionId(sid);
48
48
  if (found) { this._convMap.set(sid, found.id); return found.id; }
49
49
  if (e.type === 'queue-operation' || e.type === 'last-prompt') return null;
50
50
  if (e.type === 'user' && e.isMeta) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.859",
3
+ "version": "1.0.861",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",