agentgui 1.0.754 → 1.0.756

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
@@ -24,6 +24,7 @@ lib/acp-runner.js ACP JSON-RPC session lifecycle (init, session/new, prompt
24
24
  lib/acp-protocol.js ACP session/update message normalization (shared by all ACP agents)
25
25
  lib/acp-sdk-manager.js ACP tool lifecycle - on-demand start opencode/kilo/codex, health checks, idle timeout
26
26
  lib/acp-server-machine.js XState v5 machine per ACP tool: stopped/starting/running/crashed/restarting states
27
+ lib/agent-discovery.js Agent binary detection (findCommand), ACP server query, discoverAgents, CLI wrapper logic
27
28
  lib/agent-registry-configs.js Agent registration configs (Claude Code, OpenCode, Gemini, 10+ ACP agents)
28
29
  lib/agent-descriptors.js Data-driven ACP agent descriptor builder
29
30
  lib/checkpoint-manager.js Session recovery - load checkpoints, inject into resume flow, idempotency
@@ -32,15 +33,19 @@ lib/db-queries.js All 88 query functions (createQueries factory, extracted
32
33
  lib/execution-machine.js XState v5 machine per conversation: idle/streaming/draining/rate_limited states
33
34
  lib/gm-agent-configs.js GM agent configuration and spawning
34
35
  lib/jsonl-watcher.js Watches ~/.claude/projects for JSONL file changes
36
+ lib/oauth-common.js Shared OAuth helpers (buildBaseUrl, isRemoteRequest, encodeOAuthState, result/relay pages)
37
+ lib/oauth-gemini.js Gemini OAuth flow (credential discovery, token exchange, callback handling)
38
+ lib/oauth-codex.js Codex CLI OAuth flow (PKCE S256, token exchange, callback handling)
35
39
  lib/plugin-interface.js Plugin interface contract definition
36
40
  lib/plugin-loader.js Plugin discovery and loading (EventEmitter-based)
37
41
  lib/pm2-manager.js PM2 process management wrapper
42
+ lib/speech.js Speech-to-text and text-to-speech via @huggingface/transformers
43
+ lib/speech-manager.js TTS orchestration (eager TTS, voice cache, model download, broadcastModelProgress)
38
44
  lib/tool-install-machine.js XState v5 machine per tool: unchecked/checking/idle/installing/installed/updating/needs_update/failed states
39
45
  lib/tool-manager.js Tool facade - re-exports from tool-version, tool-spawner, tool-provisioner
40
46
  lib/tool-version.js Version detection for CLI tools and plugins (data-driven framework paths)
41
47
  lib/tool-spawner.js npm/bun install/update spawn with timeout and heartbeat
42
48
  lib/tool-provisioner.js Auto-provisioning and periodic update checking
43
- lib/speech.js Speech-to-text and text-to-speech via @huggingface/transformers
44
49
  lib/ws-protocol.js WebSocket RPC router (WsRouter class)
45
50
  lib/ws-optimizer.js Per-client priority queue for WS event batching
46
51
  lib/ws-handlers-conv.js Conversation CRUD, chunks, cancel, steer, inject RPC handlers
@@ -130,6 +135,9 @@ XState v5 machines are authoritative for their respective state domains. Ad-hoc
130
135
  - `STARTUP_CWD` - Working directory passed to agents
131
136
  - `HOT_RELOAD` - Set to "false" to disable watch mode
132
137
  - `CODEX_HOME` - Override Codex CLI home directory (default: `~/.codex`)
138
+ - `RATE_LIMIT_MAX` - Max HTTP requests per IP per minute (default: 300)
139
+ - `PASSWORD` - Basic auth password for all HTTP routes (optional)
140
+ - `AGENTGUI_BASE_URL` - Override base URL for OAuth callbacks (e.g., `https://myserver.com`)
133
141
 
134
142
  ## ACP Tool Lifecycle
135
143
 
@@ -159,6 +167,7 @@ All routes are prefixed with `BASE_URL` (default `/gm`).
159
167
  - `GET /api/sessions/:id/execution` - Get execution events (query: limit, offset, filterType)
160
168
  - `GET /api/agents` - List discovered agents
161
169
  - `GET /api/acp/status` - ACP tool lifecycle status (ports, health, PIDs, restart counts)
170
+ - `GET /api/health` - Server health check (version, uptime, agents, wsClients, memory, acp status)
162
171
  - `GET /api/home` - Get home directory
163
172
  - `POST /api/stt` - Speech-to-text (raw audio body)
164
173
  - `POST /api/tts` - Text-to-speech (body: text)
package/lib/db-queries.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { createACPQueries } from '../acp-queries.js';
2
-
3
- export function createQueries(db, prep, generateId) {
4
- return {
5
- _db: db,
2
+
3
+ export function createQueries(db, prep, generateId) {
4
+ return {
5
+ _db: db,
6
6
  createConversation(agentType, title = null, workingDirectory = null, model = null, subAgent = null) {
7
7
  const id = generateId('conv');
8
8
  const now = Date.now();
@@ -36,14 +36,33 @@ export function createQueries(db, prep, generateId) {
36
36
 
37
37
  getConversationsList() {
38
38
  const stmt = prep(
39
- 'SELECT id, agentId, title, agentType, created_at, updated_at, messageCount, workingDirectory, isStreaming, model, subAgent, pinned FROM conversations WHERE status != ? ORDER BY pinned DESC, updated_at DESC'
39
+ 'SELECT id, agentId, title, agentType, created_at, updated_at, messageCount, workingDirectory, isStreaming, model, subAgent, pinned FROM conversations WHERE status NOT IN (?, ?) ORDER BY pinned DESC, updated_at DESC'
40
40
  );
41
- return stmt.all('deleted');
41
+ return stmt.all('deleted', 'archived');
42
42
  },
43
43
 
44
44
  getConversations() {
45
- const stmt = prep('SELECT * FROM conversations WHERE status != ? ORDER BY pinned DESC, updated_at DESC');
46
- return stmt.all('deleted');
45
+ const stmt = prep('SELECT * FROM conversations WHERE status NOT IN (?, ?) ORDER BY pinned DESC, updated_at DESC');
46
+ return stmt.all('deleted', 'archived');
47
+ },
48
+
49
+ getArchivedConversations() {
50
+ const stmt = prep('SELECT id, agentId, title, agentType, created_at, updated_at, messageCount, workingDirectory, model, subAgent FROM conversations WHERE status = ? ORDER BY updated_at DESC');
51
+ return stmt.all('archived');
52
+ },
53
+
54
+ archiveConversation(id) {
55
+ const conv = this.getConversation(id);
56
+ if (!conv) return null;
57
+ prep('UPDATE conversations SET status = ?, updated_at = ? WHERE id = ?').run('archived', Date.now(), id);
58
+ return this.getConversation(id);
59
+ },
60
+
61
+ restoreConversation(id) {
62
+ const conv = this.getConversation(id);
63
+ if (!conv) return null;
64
+ prep('UPDATE conversations SET status = ?, updated_at = ? WHERE id = ?').run('active', Date.now(), id);
65
+ return this.getConversation(id);
47
66
  },
48
67
 
49
68
  updateConversation(id, data) {
@@ -1336,5 +1355,5 @@ export function createQueries(db, prep, generateId) {
1336
1355
 
1337
1356
  // ============ ACP-COMPATIBLE QUERIES ============
1338
1357
  ...createACPQueries(db, prep)
1339
- };
1340
- }
1358
+ };
1359
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.754",
3
+ "version": "1.0.756",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",
package/server.js CHANGED
@@ -601,6 +601,29 @@ const server = http.createServer(async (req, res) => {
601
601
  }
602
602
  }
603
603
 
604
+ if (pathOnly === '/api/conversations/archived' && req.method === 'GET') {
605
+ sendJSON(req, res, 200, { conversations: queries.getArchivedConversations() });
606
+ return;
607
+ }
608
+
609
+ const archiveMatch = pathOnly.match(/^\/api\/conversations\/([^/]+)\/archive$/);
610
+ if (archiveMatch && req.method === 'POST') {
611
+ const conv = queries.archiveConversation(archiveMatch[1]);
612
+ if (!conv) { sendJSON(req, res, 404, { error: 'Not found' }); return; }
613
+ broadcastSync({ type: 'conversation_deleted', conversationId: archiveMatch[1] });
614
+ sendJSON(req, res, 200, { conversation: conv });
615
+ return;
616
+ }
617
+
618
+ const restoreMatch = pathOnly.match(/^\/api\/conversations\/([^/]+)\/restore$/);
619
+ if (restoreMatch && req.method === 'POST') {
620
+ const conv = queries.restoreConversation(restoreMatch[1]);
621
+ if (!conv) { sendJSON(req, res, 404, { error: 'Not found' }); return; }
622
+ broadcastSync({ type: 'conversation_created', conversation: conv });
623
+ sendJSON(req, res, 200, { conversation: conv });
624
+ return;
625
+ }
626
+
604
627
  const messagesMatch = pathOnly.match(/^\/api\/conversations\/([^/]+)\/messages$/);
605
628
  if (messagesMatch) {
606
629
  if (req.method === 'GET') {
@@ -275,7 +275,8 @@
275
275
  overflow: hidden;
276
276
  }
277
277
 
278
- .conversation-item-delete {
278
+ .conversation-item-delete,
279
+ .conversation-item-archive {
279
280
  flex-shrink: 0;
280
281
  width: 28px;
281
282
  height: 28px;
@@ -292,7 +293,8 @@
292
293
  transition: all 0.15s;
293
294
  }
294
295
 
295
- .conversation-item:hover .conversation-item-delete {
296
+ .conversation-item:hover .conversation-item-delete,
297
+ .conversation-item:hover .conversation-item-archive {
296
298
  opacity: 1;
297
299
  }
298
300
 
@@ -301,11 +303,18 @@
301
303
  color: white;
302
304
  }
303
305
 
304
- .conversation-item.active .conversation-item-delete {
306
+ .conversation-item-archive:hover {
307
+ background-color: #f59e0b;
308
+ color: white;
309
+ }
310
+
311
+ .conversation-item.active .conversation-item-delete,
312
+ .conversation-item.active .conversation-item-archive {
305
313
  color: rgba(255,255,255,0.8);
306
314
  }
307
315
 
308
- .conversation-item.active .conversation-item-delete:hover {
316
+ .conversation-item.active .conversation-item-delete:hover,
317
+ .conversation-item.active .conversation-item-archive:hover {
309
318
  background-color: rgba(255,255,255,0.2);
310
319
  color: white;
311
320
  }
@@ -117,6 +117,12 @@ class ConversationManager {
117
117
 
118
118
  setupDelegatedListeners() {
119
119
  this.listEl.addEventListener('click', (e) => {
120
+ const archiveBtn = e.target.closest('[data-archive-conv]');
121
+ if (archiveBtn) {
122
+ e.stopPropagation();
123
+ this.archiveConversation(archiveBtn.dataset.archiveConv);
124
+ return;
125
+ }
120
126
  const deleteBtn = e.target.closest('[data-delete-conv]');
121
127
  if (deleteBtn) {
122
128
  e.stopPropagation();
@@ -477,6 +483,13 @@ class ConversationManager {
477
483
  h('div', { class: 'conversation-item-title' }, ...(badge ? [badge, title] : [title])),
478
484
  h('div', { class: 'conversation-item-meta' }, metaParts.join(' \u2022 '))
479
485
  ),
486
+ h('button', { class: 'conversation-item-archive', title: 'Archive conversation', 'data-archive-conv': conv.id },
487
+ h('svg', { width: '14', height: '14', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', 'stroke-width': '2' },
488
+ h('path', { d: 'M21 8v13H3V8' }),
489
+ h('path', { d: 'M1 3h22v5H1z' }),
490
+ h('path', { d: 'M10 12h4' })
491
+ )
492
+ ),
480
493
  h('button', { class: 'conversation-item-delete', title: 'Delete conversation', 'data-delete-conv': conv.id },
481
494
  h('svg', { width: '14', height: '14', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', 'stroke-width': '2' },
482
495
  h('polyline', { points: '3 6 5 6 21 6' }),
@@ -584,6 +597,16 @@ class ConversationManager {
584
597
  this.render();
585
598
  }
586
599
 
600
+ async archiveConversation(convId) {
601
+ try {
602
+ const resp = await fetch(`${window.__BASE_URL || ''}/api/conversations/${convId}/archive`, { method: 'POST' });
603
+ if (!resp.ok) return;
604
+ this.deleteConversation(convId);
605
+ } catch (e) {
606
+ console.error('[archive] Failed:', e.message);
607
+ }
608
+ }
609
+
587
610
  setupWebSocketListener() {
588
611
  window.addEventListener('ws-message', (event) => {
589
612
  const msg = event.detail;