agentgui 1.0.155 → 1.0.157

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
@@ -1,183 +1,91 @@
1
- # Claude Code Reliable Integration
1
+ # AgentGUI
2
2
 
3
- **Status**: Production Ready
4
- **Date**: 2026-02-05
3
+ Multi-agent GUI client for AI coding agents (Claude Code, Gemini CLI, OpenCode, Goose, etc.) with real-time streaming, WebSocket sync, and SQLite persistence.
5
4
 
6
- ## Overview
5
+ ## Running
7
6
 
8
- agentgui is a multi-agent ACP client with real-time communication, WebSocket streaming, and beautiful semantic HTML UI using RippleUI components.
9
-
10
- ## Features
11
-
12
- ✅ `--dangerously-skip-permissions` flag support
13
- ✅ JSON streaming mode for real-time execution capture
14
- ✅ Database persistence with zero data loss guarantees
15
- ✅ Real-time WebSocket broadcasting to clients
16
- ✅ Automatic crash recovery and conflict resolution
17
- ✅ Production-ready monitoring and observability
18
-
19
- ## Architecture
20
-
21
- ### Server Components
22
- - **server.js**: REST API + WebSocket endpoints, event broadcasting
23
- - **lib/claude-runner.js**: Claude Code CLI execution with streaming support
24
- - **lib/database-service.ts**: SQLite persistence with WAL mode
25
- - **lib/sync-service.ts**: Real-time event synchronization and recovery
26
-
27
- ### Streaming Features
28
- - JSON streaming via `--output-format=stream-json`
29
- - Real-time WebSocket event broadcasting
30
- - Session-based client subscriptions
31
- - Event persistence and recovery
32
- - Exponential backoff for offline queues
33
-
34
- ### Database
35
- - SQLite with WAL mode for reliability
36
- - Tables: conversations, messages, sessions, events, stream_updates
37
- - Foreign key constraints for data integrity
38
- - Transactions for atomic operations
39
-
40
- ## API Endpoints
41
-
42
- ### REST API
43
- - `GET /` - HTTP 302 redirect to /gm/
44
- - `GET /gm/` - RippleUI agent interface
45
- - `POST /api/conversations` - Create conversation
46
- - `POST /api/conversations/:id/messages` - Send message
47
- - `POST /api/conversations/:id/stream` - Stream Claude Code execution
48
- - `GET /api/sessions/:id/execution` - Get execution history
49
-
50
- ### WebSocket
51
- - **Endpoint**: `/sync`
52
- - **Commands**:
53
- - `subscribe` - Subscribe to session events
54
- - `unsubscribe` - Unsubscribe from session
55
- - `ping` - Keepalive
56
- - **Events**:
57
- - `streaming_start` - Execution started
58
- - `streaming_progress` - Event received
59
- - `streaming_complete` - Execution finished
60
- - `streaming_error` - Execution failed
61
-
62
- ## Usage
63
-
64
- ### Start Server
65
7
  ```bash
66
8
  npm install
67
- npm run dev
68
- # Server runs on http://localhost:3000
9
+ npm run dev # node server.js --watch
69
10
  ```
70
11
 
71
- ### Claude Code Execution with Streaming
72
- ```bash
73
- # In terminal where Claude Code is installed
74
- cd /tmp/test-repo
75
- claude . --dangerously-skip-permissions --output-format=stream-json < /dev/null
76
- ```
77
-
78
- ### Access UI
79
- Navigate to `http://localhost:3000` in browser to see RippleUI interface with real-time streaming visualization.
80
-
81
- ## Configuration
82
-
83
- **Database**: SQLite at `./data/agentgui.db` (auto-created)
84
- **Port**: 3000 (configurable via PORT environment variable)
85
- **WebSocket**: Enabled at `/sync` endpoint
86
- **Timeout**: 30 minutes for Claude Code execution (configurable)
87
-
88
- ## Performance Characteristics
89
-
90
- - **Event Latency**: <100ms (99th percentile)
91
- - **Throughput**: 100+ events/second
92
- - **Concurrent Streams**: 50+ without degradation
93
- - **Memory Usage**: Bounded with automatic cleanup
94
-
95
- ## Recovery & Reliability
96
-
97
- - **Crash Recovery**: Session checkpoint on startup
98
- - **Offline Queue**: Automatic retry with exponential backoff
99
- - **Conflict Resolution**: Last-write-wins strategy
100
- - **Background Cleanup**: Orphan session cleanup (7-day retention)
101
-
102
- ## Dependencies
103
-
104
- - `@anthropic-ai/claude-code` - Claude Code CLI integration
105
- - `better-sqlite3` - Database persistence
106
- - `ws` - WebSocket server
107
-
108
- ## Manual Testing
109
-
110
- To verify the system:
111
-
112
- 1. Start server: `npm run dev`
113
- 2. Navigate to http://localhost:3000
114
- 3. Clone test repositories:
115
- ```bash
116
- mkdir -p /tmp/test-repos
117
- git clone https://github.com/lodash/lodash /tmp/test-repos/lodash
118
- git clone https://github.com/chalk/chalk /tmp/test-repos/chalk
119
- ```
120
- 4. Execute Claude Code commands in the UI
121
- 5. Verify real-time streaming and WebSocket events
122
- 6. Check browser console for errors (should be zero)
12
+ Server starts on `http://localhost:3000`, redirects to `/gm/`.
123
13
 
124
- ## Deployment
125
-
126
- Production ready - no additional configuration needed beyond:
127
- 1. Install dependencies: `npm install`
128
- 2. Set PORT environment variable if needed
129
- 3. Run: `npm start` or `npm run dev` for development
130
-
131
- ## npm Publishing Setup
132
-
133
- Automated npm publishing is configured via GitHub Actions with OIDC authentication. To complete setup:
134
-
135
- ### Step 1: Configure OIDC Trusted Publisher on npm.org
136
-
137
- Visit: https://www.npmjs.com/package/agentgui/access
138
-
139
- Click "Add Trusted Publisher" and fill in:
140
- - **Publishing provider**: GitHub
141
- - **Owner**: AnEntrypoint
142
- - **Repository**: agentgui
143
- - **Workflow file**: `.github/workflows/publish-npm.yml`
144
-
145
- This requires npm account access with 2FA completion.
146
-
147
- ### Step 2: Trigger Publishing Workflow
148
-
149
- Once OIDC is configured, push to main branch to trigger automatic publishing:
14
+ ## Architecture
150
15
 
151
- ```bash
152
- git commit --allow-empty -m "test: verify npm publish with OIDC"
153
- git push
154
16
  ```
155
-
156
- Monitor at: https://github.com/AnEntrypoint/agentgui/actions
157
-
158
- ### Optional: Add Granular Token Backup
159
-
160
- Generate a 3-month granular access token for fallback authentication:
161
-
162
- Visit: https://www.npmjs.com/settings/lanmower/tokens
163
-
164
- Click "Generate New Token" → "Granular Access Token" and configure:
165
- - **Name**: github-actions-3month
166
- - **Permissions**: Read and write
167
- - **Package**: agentgui
168
- - **Expiration**: 90 days
169
- - **Bypass 2FA**: enabled
170
-
171
- Then add to GitHub Actions secrets:
172
- ```bash
173
- gh secret set NPM_TOKEN --body "YOUR_TOKEN" --repo AnEntrypoint/agentgui
17
+ server.js HTTP server + WebSocket + all API routes (raw http.createServer)
18
+ database.js SQLite setup (WAL mode), schema, query functions
19
+ lib/claude-runner.js Agent framework - spawns CLI processes, parses stream-json output
20
+ lib/speech.js Speech-to-text and text-to-speech via @huggingface/transformers
21
+ bin/gmgui.cjs CLI entry point (npx agentgui / bunx agentgui)
22
+ static/index.html Main HTML shell
23
+ static/app.js App initialization
24
+ static/theme.js Theme switching
25
+ static/js/client.js Main client logic
26
+ static/js/conversations.js Conversation management
27
+ static/js/streaming-renderer.js Renders Claude streaming events as HTML
28
+ static/js/event-processor.js Processes incoming events
29
+ static/js/event-filter.js Filters events by type
30
+ static/js/websocket-manager.js WebSocket connection handling
31
+ static/js/ui-components.js UI component helpers
32
+ static/js/syntax-highlighter.js Code syntax highlighting
33
+ static/js/voice.js Voice input/output
34
+ static/js/features.js Feature flags
35
+ static/templates/ 31 HTML template fragments for event rendering
174
36
  ```
175
37
 
176
- ## Support
177
-
178
- For issues, check:
179
- - Browser DevTools Console (F12) for JavaScript errors
180
- - Server logs for backend issues
181
- - Database at `./data/agentgui.db` for data persistence
182
- - WebSocket connection in Network tab (should show `/sync` as connected)
183
- - GitHub Actions: https://github.com/AnEntrypoint/agentgui/actions for publishing errors
38
+ ## Key Details
39
+
40
+ - Express is used only for file upload (`/api/upload/:conversationId`) and fsbrowse file browser (`/files/:conversationId`). All other routes use raw `http.createServer` with manual routing.
41
+ - Agent discovery scans PATH for known CLI binaries (claude, opencode, gemini, goose, etc.) at startup.
42
+ - Database lives at `~/.gmgui/data.db`. Tables: conversations, messages, events, sessions, stream chunks.
43
+ - WebSocket endpoint is at `BASE_URL + /sync`. Supports subscribe/unsubscribe by sessionId or conversationId, and ping.
44
+
45
+ ## Environment Variables
46
+
47
+ - `PORT` - Server port (default: 3000)
48
+ - `BASE_URL` - URL prefix (default: /gm)
49
+ - `STARTUP_CWD` - Working directory passed to agents
50
+ - `HOT_RELOAD` - Set to "false" to disable watch mode
51
+
52
+ ## REST API
53
+
54
+ All routes are prefixed with `BASE_URL` (default `/gm`).
55
+
56
+ - `GET /api/conversations` - List conversations
57
+ - `POST /api/conversations` - Create conversation (body: agentId, title, workingDirectory)
58
+ - `GET /api/conversations/:id` - Get conversation with streaming status
59
+ - `POST /api/conversations/:id` - Update conversation
60
+ - `DELETE /api/conversations/:id` - Delete conversation
61
+ - `GET /api/conversations/:id/messages` - Get messages (query: limit, offset)
62
+ - `POST /api/conversations/:id/messages` - Send message (body: content, agentId)
63
+ - `POST /api/conversations/:id/stream` - Start streaming execution
64
+ - `GET /api/conversations/:id/full` - Full conversation load with chunks
65
+ - `GET /api/conversations/:id/chunks` - Get stream chunks (query: since)
66
+ - `GET /api/conversations/:id/sessions/latest` - Get latest session
67
+ - `GET /api/sessions/:id` - Get session
68
+ - `GET /api/sessions/:id/chunks` - Get session chunks (query: since)
69
+ - `GET /api/sessions/:id/execution` - Get execution events (query: limit, offset, filterType)
70
+ - `GET /api/agents` - List discovered agents
71
+ - `GET /api/home` - Get home directory
72
+ - `POST /api/stt` - Speech-to-text (raw audio body)
73
+ - `POST /api/tts` - Text-to-speech (body: text)
74
+ - `GET /api/speech-status` - Speech model loading status
75
+ - `POST /api/folders` - Create folder
76
+
77
+ ## WebSocket Protocol
78
+
79
+ Endpoint: `BASE_URL + /sync`
80
+
81
+ Client sends:
82
+ - `{ type: "subscribe", sessionId }` or `{ type: "subscribe", conversationId }`
83
+ - `{ type: "unsubscribe", sessionId }`
84
+ - `{ type: "ping" }`
85
+
86
+ Server broadcasts:
87
+ - `streaming_start` - Agent execution started
88
+ - `streaming_progress` - New event/chunk from agent
89
+ - `streaming_complete` - Execution finished
90
+ - `streaming_error` - Execution failed
91
+ - `conversation_created`, `conversation_updated`, `conversation_deleted`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.155",
3
+ "version": "1.0.157",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",