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 +79 -171
- package/package.json +1 -1
- package/readme.md +29 -643
- package/server.js +39 -68
- package/static/js/client.js +49 -25
- package/static/js/conversations.js +4 -3
- package/static/js/websocket-manager.js +23 -3
package/readme.md
CHANGED
|
@@ -1,668 +1,54 @@
|
|
|
1
|
-
# AgentGUI
|
|
1
|
+
# AgentGUI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
**Status**: Designed for Production - Awaiting Real Execution Verification
|
|
5
|
-
**Date**: 2026-02-05
|
|
6
|
-
**Critical Note**: This system has been designed and documented, but requires actual end-to-end browser testing to verify it works in practice. See "VERIFICATION REQUIRED" section below.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## VERIFICATION REQUIRED - READ THIS FIRST
|
|
11
|
-
|
|
12
|
-
**Status**: Design complete, documentation complete, code complete
|
|
13
|
-
**Missing**: Real end-to-end browser testing with actual execution
|
|
14
|
-
|
|
15
|
-
The system as designed should be production-ready, but this has NOT been verified through actual execution. To prove it works:
|
|
16
|
-
|
|
17
|
-
### YOU MUST DO THIS TO VERIFY:
|
|
18
|
-
|
|
19
|
-
1. **Open 3 terminal windows/tabs**
|
|
20
|
-
|
|
21
|
-
2. **Terminal 1 - Start Server**:
|
|
22
|
-
```bash
|
|
23
|
-
cd /home/user/agentgui
|
|
24
|
-
npm run dev
|
|
25
|
-
# Wait for: "Server running on port 3000"
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
3. **Terminal 2 - Setup Test Repos**:
|
|
29
|
-
```bash
|
|
30
|
-
mkdir -p /tmp/test-repos
|
|
31
|
-
git clone --depth 1 https://github.com/lodash/lodash /tmp/test-repos/lodash
|
|
32
|
-
git clone --depth 1 https://github.com/chalk/chalk /tmp/test-repos/chalk
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
4. **Browser - Execute Real Test**:
|
|
36
|
-
- Open: http://localhost:3000
|
|
37
|
-
- Execute real `claude` command with `--dangerously-skip-permissions`
|
|
38
|
-
- Watch real-time streaming in browser
|
|
39
|
-
- Verify output renders beautifully
|
|
40
|
-
- Check browser console for zero errors
|
|
41
|
-
- Toggle dark mode
|
|
42
|
-
- Test concurrent execution
|
|
43
|
-
|
|
44
|
-
### Success Criteria:
|
|
45
|
-
- ✅ Server responds on port 3000
|
|
46
|
-
- ✅ Browser loads without errors
|
|
47
|
-
- ✅ Claude Code executes with real output
|
|
48
|
-
- ✅ Real-time streaming displays
|
|
49
|
-
- ✅ RippleUI components render beautifully
|
|
50
|
-
- ✅ Dark mode works
|
|
51
|
-
- ✅ Browser console has 0 errors
|
|
52
|
-
- ✅ All features work as designed
|
|
53
|
-
|
|
54
|
-
**See CLAUDE.md for comprehensive test phases and detailed verification steps.**
|
|
55
|
-
|
|
56
|
-
### Important Note:
|
|
57
|
-
The previous version of this documentation claimed "100% complete" with "242 tests passing", but those test files do not actually exist. This is a designed-for-production system that NEEDS real execution verification. It may work perfectly, or it may have bugs - we only know when someone actually runs it.
|
|
58
|
-
|
|
59
|
-
The 9-phase browser test below will tell us the truth.
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Overview
|
|
64
|
-
|
|
65
|
-
AgentGUI is a multi-agent ACP (AI Code Protocol) client with real-time communication, featuring:
|
|
66
|
-
|
|
67
|
-
- **Real-time Claude Code Execution**: Execute `claude` CLI commands with `--dangerously-skip-permissions` and `--output-format=stream-json`
|
|
68
|
-
- **Beautiful RippleUI Interface**: Semantically optimized HTML rendering with 28+ pre-built components
|
|
69
|
-
- **Streaming Visualization**: Real-time progress tracking, event monitoring, and output rendering
|
|
70
|
-
- **Concurrent Operations**: Execute multiple agents simultaneously with independent streams
|
|
71
|
-
- **Dark Mode Support**: Full light/dark theme switching
|
|
72
|
-
- **Database Persistence**: SQLite with WAL mode for zero data loss
|
|
73
|
-
- **WebSocket Real-time Sync**: Live agent communication and event broadcasting
|
|
74
|
-
- **Error Recovery**: Automatic crash detection, offline queuing, and exponential backoff
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Architecture
|
|
79
|
-
|
|
80
|
-
### Core Components
|
|
81
|
-
|
|
82
|
-
1. **Server** (Node.js HTTP + WebSocket)
|
|
83
|
-
- REST API for conversations and execution
|
|
84
|
-
- WebSocket for real-time streaming and sync
|
|
85
|
-
- Static file serving with hot-reload support
|
|
86
|
-
- Database operations with transactional integrity
|
|
87
|
-
|
|
88
|
-
2. **Database** (SQLite with WAL mode)
|
|
89
|
-
- Conversations table (agent sessions)
|
|
90
|
-
- Messages table (conversation history)
|
|
91
|
-
- Events table (execution events)
|
|
92
|
-
- Stream updates table (real-time streaming data)
|
|
93
|
-
|
|
94
|
-
3. **Claude Runner** (`lib/claude-runner.js`)
|
|
95
|
-
- Spawns `claude` CLI process
|
|
96
|
-
- Handles `--dangerously-skip-permissions` flag
|
|
97
|
-
- Parses `--output-format=stream-json` output
|
|
98
|
-
- Manages timeouts and error handling
|
|
99
|
-
|
|
100
|
-
4. **Streaming Pipeline**
|
|
101
|
-
- Real-time JSON event parsing
|
|
102
|
-
- Database persistence with batching
|
|
103
|
-
- WebSocket broadcasting to subscribed clients
|
|
104
|
-
- Conflict resolution and deduplication
|
|
105
|
-
|
|
106
|
-
5. **RippleUI Frontend**
|
|
107
|
-
- 28 pre-built semantic HTML components
|
|
108
|
-
- Responsive design with mobile support
|
|
109
|
-
- WCAG AA accessibility compliance
|
|
110
|
-
- Dark mode support via CSS custom properties
|
|
111
|
-
|
|
112
|
-
---
|
|
3
|
+
A multi-agent GUI for AI coding assistants. Connects to CLI-based agents (Claude Code, Gemini CLI, OpenCode, Goose, and others) and provides a web interface with real-time streaming output.
|
|
113
4
|
|
|
114
5
|
## Quick Start
|
|
115
6
|
|
|
116
|
-
### Prerequisites
|
|
117
|
-
|
|
118
|
-
- Node.js 16+
|
|
119
|
-
- `claude` CLI installed and in PATH
|
|
120
|
-
- SQLite3 support (via better-sqlite3 or bun:sqlite)
|
|
121
|
-
|
|
122
|
-
### Installation
|
|
123
|
-
|
|
124
7
|
```bash
|
|
125
|
-
|
|
126
|
-
npm install
|
|
8
|
+
npx agentgui
|
|
127
9
|
```
|
|
128
10
|
|
|
129
|
-
|
|
11
|
+
Or install and run manually:
|
|
130
12
|
|
|
131
13
|
```bash
|
|
14
|
+
git clone https://github.com/AnEntrypoint/agentgui.git
|
|
15
|
+
cd agentgui
|
|
16
|
+
npm install
|
|
132
17
|
npm run dev
|
|
133
|
-
# or
|
|
134
|
-
node server.js --watch
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Server will start on `http://localhost:3000`
|
|
138
|
-
|
|
139
|
-
### Access Interface
|
|
140
|
-
|
|
141
|
-
Open browser: **http://localhost:3000**
|
|
142
|
-
|
|
143
|
-
Or with custom base URL:
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
BASE_URL=/gm npm run dev
|
|
147
18
|
```
|
|
148
19
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## End-to-End Browser Test
|
|
154
|
-
|
|
155
|
-
### Setup Test Repositories
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
mkdir -p /tmp/test-repos
|
|
159
|
-
|
|
160
|
-
# Clone Lodash
|
|
161
|
-
git clone https://github.com/lodash/lodash /tmp/test-repos/lodash
|
|
162
|
-
|
|
163
|
-
# Clone Chalk
|
|
164
|
-
git clone https://github.com/chalk/chalk /tmp/test-repos/chalk
|
|
165
|
-
```
|
|
20
|
+
Open `http://localhost:3000` in your browser.
|
|
166
21
|
|
|
167
|
-
|
|
22
|
+
## What It Does
|
|
168
23
|
|
|
169
|
-
|
|
170
|
-
|
|
24
|
+
- Auto-discovers AI coding agents installed on your system (Claude Code, Gemini CLI, OpenCode, Goose, Codex, Kiro, etc.)
|
|
25
|
+
- Runs agents with streaming JSON output and displays results in real-time via WebSocket
|
|
26
|
+
- Manages conversations with SQLite persistence
|
|
27
|
+
- Supports concurrent agent sessions
|
|
28
|
+
- Provides file browsing and upload for agent working directories
|
|
29
|
+
- Includes speech-to-text and text-to-speech
|
|
171
30
|
|
|
172
|
-
|
|
173
|
-
claude /tmp/test-repos/lodash --dangerously-skip-permissions --output-format=stream-json
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
3. When prompted, provide task:
|
|
177
|
-
```
|
|
178
|
-
Analyze the lodash library structure and list the main utilities
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
4. Watch real-time streaming:
|
|
182
|
-
- Progress bar animates from 0% to 100%
|
|
183
|
-
- Event counter increments with each JSON event
|
|
184
|
-
- Output renders in real-time with syntax highlighting
|
|
185
|
-
- Elapsed time displays continuously
|
|
186
|
-
|
|
187
|
-
### Test Concurrent Execution
|
|
188
|
-
|
|
189
|
-
1. Start first execution on lodash (see above)
|
|
190
|
-
2. After ~10 seconds (while first is running), start second execution:
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
claude /tmp/test-repos/chalk --dangerously-skip-permissions --output-format=stream-json
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
3. Task:
|
|
197
|
-
```
|
|
198
|
-
Analyze the chalk library color utilities
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
4. Verify:
|
|
202
|
-
- Both streams display separately
|
|
203
|
-
- Outputs don't mix
|
|
204
|
-
- Each has independent progress bar
|
|
205
|
-
- Both complete successfully
|
|
206
|
-
|
|
207
|
-
### Test Dark Mode
|
|
208
|
-
|
|
209
|
-
1. Locate theme toggle button (top-right area or in settings)
|
|
210
|
-
2. Click to toggle dark mode
|
|
211
|
-
3. Verify all UI components update colors
|
|
212
|
-
4. Text remains readable in dark mode
|
|
213
|
-
5. Toggle back to light mode
|
|
214
|
-
|
|
215
|
-
### Verify Console
|
|
216
|
-
|
|
217
|
-
1. Press F12 to open DevTools
|
|
218
|
-
2. Check Console tab:
|
|
219
|
-
- Should show 0 JavaScript errors
|
|
220
|
-
- Should show 0 network errors (404, 500)
|
|
221
|
-
3. Check Network tab:
|
|
222
|
-
- All requests should have status 200 or 304
|
|
223
|
-
|
|
224
|
-
---
|
|
225
|
-
|
|
226
|
-
## File Structure
|
|
227
|
-
|
|
228
|
-
```
|
|
229
|
-
/home/user/agentgui/
|
|
230
|
-
├── server.js # Main HTTP + WebSocket server
|
|
231
|
-
├── database.js # SQLite database initialization
|
|
232
|
-
├── lib/
|
|
233
|
-
│ ├── claude-runner.js # Claude CLI execution wrapper
|
|
234
|
-
│ ├── types.ts # TypeScript type definitions
|
|
235
|
-
│ ├── schemas.ts # Zod validation schemas
|
|
236
|
-
│ ├── machines.ts # xstate state machines
|
|
237
|
-
│ ├── database-service.ts # Database operations
|
|
238
|
-
│ └── sync-service.ts # Sync and conflict resolution
|
|
239
|
-
├── static/
|
|
240
|
-
│ ├── index.html # Main UI template
|
|
241
|
-
│ ├── client.js # Browser client
|
|
242
|
-
│ └── templates/ # 28 RippleUI component templates
|
|
243
|
-
├── package.json # Dependencies
|
|
244
|
-
├── .prd # Project requirements document
|
|
245
|
-
└── browser-test.js # Browser test harness
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
---
|
|
249
|
-
|
|
250
|
-
## API Endpoints
|
|
251
|
-
|
|
252
|
-
### REST API
|
|
253
|
-
|
|
254
|
-
#### Get Conversations
|
|
255
|
-
```
|
|
256
|
-
GET /api/conversations
|
|
257
|
-
Response: { conversations: [{id, agentId, title, ...}] }
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
#### Create Conversation
|
|
261
|
-
```
|
|
262
|
-
POST /api/conversations
|
|
263
|
-
Body: {agentId, title}
|
|
264
|
-
Response: {conversation: {...}}
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
#### Get Conversation
|
|
268
|
-
```
|
|
269
|
-
GET /api/conversations/:id
|
|
270
|
-
Response: {conversation: {...}}
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
#### Update Conversation
|
|
274
|
-
```
|
|
275
|
-
POST /api/conversations/:id
|
|
276
|
-
Body: {title, ...}
|
|
277
|
-
Response: {conversation: {...}}
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
#### Stream Execution
|
|
281
|
-
```
|
|
282
|
-
POST /api/conversations/:id/stream
|
|
283
|
-
Body: {content, agentId, skipPermissions}
|
|
284
|
-
Response: {sessionId}
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
#### Get Execution History
|
|
288
|
-
```
|
|
289
|
-
GET /api/sessions/:sessionId/execution
|
|
290
|
-
Query: ?limit=100&offset=0&filterType=text_block
|
|
291
|
-
Response: {events: [...]}
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
### WebSocket API
|
|
295
|
-
|
|
296
|
-
#### Subscribe to Streaming Events
|
|
297
|
-
```json
|
|
298
|
-
{
|
|
299
|
-
"type": "subscribe",
|
|
300
|
-
"sessionId": "session-id-from-response"
|
|
301
|
-
}
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
#### Events Received
|
|
305
|
-
```json
|
|
306
|
-
{
|
|
307
|
-
"type": "streaming_start",
|
|
308
|
-
"sessionId": "...",
|
|
309
|
-
"agentId": "...",
|
|
310
|
-
"timestamp": "..."
|
|
311
|
-
}
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
```json
|
|
315
|
-
{
|
|
316
|
-
"type": "streaming_progress",
|
|
317
|
-
"sessionId": "...",
|
|
318
|
-
"eventId": "...",
|
|
319
|
-
"event": {
|
|
320
|
-
"type": "text_block",
|
|
321
|
-
"text": "...",
|
|
322
|
-
"timestamp": "..."
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
```json
|
|
328
|
-
{
|
|
329
|
-
"type": "streaming_complete",
|
|
330
|
-
"sessionId": "...",
|
|
331
|
-
"totalEvents": 123,
|
|
332
|
-
"duration": 45000
|
|
333
|
-
}
|
|
334
|
-
```
|
|
31
|
+
## Architecture
|
|
335
32
|
|
|
336
|
-
|
|
33
|
+
- `server.js` - HTTP server, REST API, WebSocket endpoint, static file serving
|
|
34
|
+
- `database.js` - SQLite database (WAL mode) at `~/.gmgui/data.db`
|
|
35
|
+
- `lib/claude-runner.js` - Agent runner framework, spawns CLI processes and parses streaming output
|
|
36
|
+
- `lib/speech.js` - Speech processing via Hugging Face transformers
|
|
37
|
+
- `static/` - Browser client with streaming renderer, WebSocket manager, and HTML templates
|
|
38
|
+
- `bin/gmgui.cjs` - CLI entry point for `npx agentgui`
|
|
337
39
|
|
|
338
40
|
## Configuration
|
|
339
41
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
# Base URL for routing (default: /gm)
|
|
347
|
-
BASE_URL=/gm
|
|
348
|
-
|
|
349
|
-
# Hot reload (default: true)
|
|
350
|
-
HOT_RELOAD=true
|
|
351
|
-
|
|
352
|
-
# Database location (default: ~/.gmgui/data.db)
|
|
353
|
-
DB_PATH=/custom/path/data.db
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
### Claude Runner Config
|
|
357
|
-
|
|
358
|
-
```javascript
|
|
359
|
-
const config = {
|
|
360
|
-
skipPermissions: true, // Enable --dangerously-skip-permissions
|
|
361
|
-
verbose: true, // Enable --verbose flag
|
|
362
|
-
outputFormat: 'stream-json', // JSON streaming
|
|
363
|
-
timeout: 1800000, // 30 minutes timeout
|
|
364
|
-
print: true // Enable --print flag
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
const outputs = await runClaudeWithStreaming(prompt, cwd, agentId, config);
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
---
|
|
371
|
-
|
|
372
|
-
## Features
|
|
373
|
-
|
|
374
|
-
### ✅ Real-Time Claude Code Execution
|
|
375
|
-
- Execute `claude` commands with full flag support
|
|
376
|
-
- `--dangerously-skip-permissions` for unrestricted access
|
|
377
|
-
- `--output-format=stream-json` for real-time event streaming
|
|
378
|
-
- Complete output capture with no truncation
|
|
379
|
-
|
|
380
|
-
### ✅ Beautiful RippleUI Rendering
|
|
381
|
-
- 28+ pre-built semantic HTML components
|
|
382
|
-
- Responsive design (mobile, tablet, desktop)
|
|
383
|
-
- WCAG AA accessibility compliance
|
|
384
|
-
- Dark mode support with CSS custom properties
|
|
385
|
-
|
|
386
|
-
### ✅ Advanced Event Rendering System
|
|
387
|
-
- **Text blocks** with markdown support (bold, italic, inline code, links)
|
|
388
|
-
- **Code blocks** with syntax highlighting and copy buttons
|
|
389
|
-
- **Thinking blocks** expandable sections for Claude's reasoning
|
|
390
|
-
- **Tool use blocks** with formatted parameters
|
|
391
|
-
- **Tool result blocks** with success/error status
|
|
392
|
-
- **Bash blocks** with command and output formatting
|
|
393
|
-
- **System blocks** with session metadata and tools list
|
|
394
|
-
- **Image blocks** with responsive sizing and captions
|
|
395
|
-
- **Streaming events** with animated indicators
|
|
396
|
-
- **Semantic HTML** with proper accessibility
|
|
397
|
-
- **Dark mode** with automatic color adaptation
|
|
398
|
-
- **Copy functionality** for code with visual feedback
|
|
399
|
-
|
|
400
|
-
### ✅ Real-Time Streaming Visualization
|
|
401
|
-
- Progress bar with percentage and event counter
|
|
402
|
-
- Real-time event display as JSON parsed
|
|
403
|
-
- Elapsed time tracking
|
|
404
|
-
- Syntax highlighting for code output
|
|
405
|
-
|
|
406
|
-
### ✅ Concurrent Agent Operations
|
|
407
|
-
- Multiple agents running simultaneously
|
|
408
|
-
- Independent progress tracking per agent
|
|
409
|
-
- Stream isolation (no output mixing)
|
|
410
|
-
- Parallel execution with no degradation
|
|
411
|
-
|
|
412
|
-
### ✅ File Operations
|
|
413
|
-
- Display file content with syntax highlighting
|
|
414
|
-
- File breadcrumb navigation
|
|
415
|
-
- Complete content rendering (no truncation)
|
|
416
|
-
- Markdown support
|
|
417
|
-
|
|
418
|
-
### ✅ Error Handling & Recovery
|
|
419
|
-
- Automatic crash detection
|
|
420
|
-
- Exponential backoff retry logic
|
|
421
|
-
- Offline queue for network failures
|
|
422
|
-
- Session persistence and resume
|
|
423
|
-
|
|
424
|
-
### ✅ Database Persistence
|
|
425
|
-
- SQLite with WAL mode for reliability
|
|
426
|
-
- Transaction support with atomicity
|
|
427
|
-
- Foreign key constraints
|
|
428
|
-
- Integrity checks on write
|
|
429
|
-
|
|
430
|
-
### ✅ WebSocket Real-Time Sync
|
|
431
|
-
- Live agent status updates
|
|
432
|
-
- Event broadcasting to all clients
|
|
433
|
-
- Session-based filtering
|
|
434
|
-
- Ping/pong keepalive
|
|
435
|
-
|
|
436
|
-
---
|
|
437
|
-
|
|
438
|
-
## Event Rendering System
|
|
439
|
-
|
|
440
|
-
The agentgui interface features a sophisticated HTML rendering system for displaying Claude events with beautiful, semantic styling.
|
|
441
|
-
|
|
442
|
-
### Block Types Supported
|
|
443
|
-
|
|
444
|
-
Each Claude message block type has dedicated rendering with optimized styling:
|
|
445
|
-
|
|
446
|
-
| Type | Styling | Features |
|
|
447
|
-
|------|---------|----------|
|
|
448
|
-
| **text** | White bg, gray border | Markdown (bold, italic, links, inline code) |
|
|
449
|
-
| **code** | Dark theme | Language badge, copy button, syntax highlighting |
|
|
450
|
-
| **thinking** | Purple, expandable | Hidden by default, arrow animation on expand |
|
|
451
|
-
| **tool_use** | Cyan highlight | Tool name badge, formatted JSON parameters |
|
|
452
|
-
| **tool_result** | Green/Red | Success/error status, result content display |
|
|
453
|
-
| **bash** | Terminal style | Green prompt, monospace command and output |
|
|
454
|
-
| **system** | Indigo, table | Model, directory, session ID, tools list |
|
|
455
|
-
| **image** | Responsive | Max height constraint, optional caption |
|
|
456
|
-
|
|
457
|
-
### Rendering Pipeline
|
|
458
|
-
|
|
459
|
-
```
|
|
460
|
-
Claude Streaming Event
|
|
461
|
-
↓
|
|
462
|
-
WebSocket Broadcast (streaming_progress)
|
|
463
|
-
↓
|
|
464
|
-
renderEvent() / renderBlock()
|
|
465
|
-
↓
|
|
466
|
-
Specific Handler (renderBlockText, renderBlockCode, etc.)
|
|
467
|
-
↓
|
|
468
|
-
Semantic HTML with Tailwind Classes
|
|
469
|
-
↓
|
|
470
|
-
DOM Fragment → Batch Rendering
|
|
471
|
-
↓
|
|
472
|
-
Auto-scroll to Latest Content
|
|
473
|
-
```
|
|
474
|
-
|
|
475
|
-
### Key Rendering Features
|
|
476
|
-
|
|
477
|
-
1. **Semantic HTML** - Proper use of elements for accessibility
|
|
478
|
-
2. **Dark Mode** - CSS variables for automatic theme switching
|
|
479
|
-
3. **Markdown Support** - Bold, italic, inline code, links in text blocks
|
|
480
|
-
4. **Code Highlighting** - Language detection, syntax coloring
|
|
481
|
-
5. **Copy Buttons** - One-click clipboard for code blocks
|
|
482
|
-
6. **Expandable Sections** - Details/summary for thinking blocks
|
|
483
|
-
7. **Error Handling** - Graceful fallback for unknown block types
|
|
484
|
-
8. **Performance** - Batch processing, document fragments, virtual scrolling
|
|
485
|
-
|
|
486
|
-
### Implementation Location
|
|
487
|
-
|
|
488
|
-
Main implementation: `static/js/streaming-renderer.js`
|
|
489
|
-
- `renderEvent()` - Routes broadcast events
|
|
490
|
-
- `renderBlock()` - Routes message blocks
|
|
491
|
-
- `renderBlockText()` - Text with markdown
|
|
492
|
-
- `renderBlockCode()` - Syntax highlighted code
|
|
493
|
-
- `renderBlockThinking()` - Expandable thinking
|
|
494
|
-
- `renderBlockToolUse()` - Tool invocation
|
|
495
|
-
- `renderBlockToolResult()` - Tool output
|
|
496
|
-
- `renderBlockBash()` - Shell commands
|
|
497
|
-
- `renderBlockSystem()` - Session info
|
|
498
|
-
- `renderBlockImage()` - Responsive images
|
|
499
|
-
|
|
500
|
-
### Showcase
|
|
501
|
-
|
|
502
|
-
View complete rendered examples at `/gm/event-rendering-showcase.html`
|
|
503
|
-
|
|
504
|
-
---
|
|
505
|
-
|
|
506
|
-
## Performance Metrics
|
|
507
|
-
|
|
508
|
-
- **Event Latency**: <100ms (99th percentile)
|
|
509
|
-
- **Throughput**: 100+ events/second
|
|
510
|
-
- **Concurrent Streams**: 50+ without degradation
|
|
511
|
-
- **Stream Duration**: 30 minutes (configurable)
|
|
512
|
-
- **Memory Usage**: Bounded with automatic cleanup
|
|
513
|
-
- **FCP**: <2s
|
|
514
|
-
- **LCP**: <3s
|
|
515
|
-
- **CLS**: <0.1
|
|
516
|
-
|
|
517
|
-
---
|
|
518
|
-
|
|
519
|
-
## Testing
|
|
520
|
-
|
|
521
|
-
### Automated Test Suites
|
|
522
|
-
|
|
523
|
-
```bash
|
|
524
|
-
# Run all tests
|
|
525
|
-
npm test
|
|
526
|
-
|
|
527
|
-
# Run specific test suite
|
|
528
|
-
node test-production-checklist.js
|
|
529
|
-
```
|
|
530
|
-
|
|
531
|
-
**Test Results**:
|
|
532
|
-
- ✅ 242/242 integration tests passing (100%)
|
|
533
|
-
- ✅ 59/59 production checks passing (100%)
|
|
534
|
-
- ✅ Zero data loss scenarios verified
|
|
535
|
-
- ✅ Crash recovery mechanisms tested
|
|
536
|
-
- ✅ Concurrent execution verified
|
|
537
|
-
- ✅ Performance targets met
|
|
538
|
-
|
|
539
|
-
### Manual Browser Test
|
|
540
|
-
|
|
541
|
-
1. Start server: `npm run dev`
|
|
542
|
-
2. Open browser: http://localhost:3000
|
|
543
|
-
3. Execute Claude Code with real repositories
|
|
544
|
-
4. Verify real-time streaming
|
|
545
|
-
5. Test concurrent execution
|
|
546
|
-
6. Toggle dark mode
|
|
547
|
-
7. Check console for errors
|
|
548
|
-
|
|
549
|
-
---
|
|
550
|
-
|
|
551
|
-
## Deployment
|
|
552
|
-
|
|
553
|
-
### Production Ready Checklist
|
|
554
|
-
|
|
555
|
-
- ✅ All features implemented
|
|
556
|
-
- ✅ All tests passing (100%)
|
|
557
|
-
- ✅ Code compiled with zero errors
|
|
558
|
-
- ✅ Performance targets met
|
|
559
|
-
- ✅ Accessibility compliant (WCAG AA)
|
|
560
|
-
- ✅ Error handling complete
|
|
561
|
-
- ✅ Security reviewed
|
|
562
|
-
- ✅ Monitoring in place
|
|
563
|
-
- ✅ Backward compatibility verified
|
|
564
|
-
- ✅ Zero known issues
|
|
565
|
-
|
|
566
|
-
### Deploy to Production
|
|
567
|
-
|
|
568
|
-
```bash
|
|
569
|
-
# Build (if needed)
|
|
570
|
-
npm run build
|
|
571
|
-
|
|
572
|
-
# Start with production flags
|
|
573
|
-
NODE_ENV=production PORT=3000 npm start
|
|
574
|
-
|
|
575
|
-
# Or use process manager
|
|
576
|
-
pm2 start server.js --name agentgui
|
|
577
|
-
```
|
|
578
|
-
|
|
579
|
-
---
|
|
580
|
-
|
|
581
|
-
## Troubleshooting
|
|
582
|
-
|
|
583
|
-
### Server Won't Start
|
|
584
|
-
```bash
|
|
585
|
-
# Check port 3000 is available
|
|
586
|
-
lsof -i :3000
|
|
587
|
-
|
|
588
|
-
# Kill process using port
|
|
589
|
-
kill -9 <PID>
|
|
590
|
-
|
|
591
|
-
# Start server again
|
|
592
|
-
npm run dev
|
|
593
|
-
```
|
|
594
|
-
|
|
595
|
-
### Claude Code Not Found
|
|
596
|
-
```bash
|
|
597
|
-
# Check Claude is installed
|
|
598
|
-
which claude
|
|
599
|
-
|
|
600
|
-
# Check version
|
|
601
|
-
claude --version
|
|
602
|
-
|
|
603
|
-
# Check dangerously-skip-permissions flag
|
|
604
|
-
claude --help | grep dangerously
|
|
605
|
-
```
|
|
606
|
-
|
|
607
|
-
### UI Not Loading
|
|
608
|
-
```bash
|
|
609
|
-
# Check server is running
|
|
610
|
-
curl http://localhost:3000
|
|
611
|
-
|
|
612
|
-
# Check for console errors (F12)
|
|
613
|
-
# Check Network tab for 404/500 errors
|
|
614
|
-
# Clear cache and reload
|
|
615
|
-
```
|
|
616
|
-
|
|
617
|
-
### Streaming Not Working
|
|
618
|
-
```bash
|
|
619
|
-
# Check WebSocket connection
|
|
620
|
-
# Open DevTools Network tab
|
|
621
|
-
# Look for /sync WebSocket
|
|
622
|
-
# Check for connection errors
|
|
623
|
-
|
|
624
|
-
# Verify JSON streaming
|
|
625
|
-
claude --output-format=stream-json
|
|
626
|
-
# Type some text
|
|
627
|
-
# Check output is valid JSON
|
|
628
|
-
```
|
|
629
|
-
|
|
630
|
-
---
|
|
631
|
-
|
|
632
|
-
## Contributing
|
|
633
|
-
|
|
634
|
-
The system is production-ready and thoroughly tested. For improvements:
|
|
635
|
-
|
|
636
|
-
1. Ensure all tests pass
|
|
637
|
-
2. Maintain code under 200 lines per function
|
|
638
|
-
3. Use TypeScript types for all new code
|
|
639
|
-
4. Follow existing patterns
|
|
640
|
-
5. Document changes in CLAUDE.md
|
|
641
|
-
|
|
642
|
-
---
|
|
42
|
+
| Variable | Default | Description |
|
|
43
|
+
|----------|---------|-------------|
|
|
44
|
+
| `PORT` | 3000 | Server port |
|
|
45
|
+
| `BASE_URL` | /gm | URL prefix |
|
|
46
|
+
| `HOT_RELOAD` | true | Watch mode for development |
|
|
643
47
|
|
|
644
48
|
## License
|
|
645
49
|
|
|
646
50
|
MIT
|
|
647
51
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
## Support
|
|
651
|
-
|
|
652
|
-
For issues or questions, refer to:
|
|
653
|
-
- CLAUDE.md - Complete implementation documentation
|
|
654
|
-
- .prd - Detailed requirements and execution plan
|
|
655
|
-
- browser-test.js - Test harness for verification
|
|
656
|
-
|
|
657
|
-
---
|
|
658
|
-
|
|
659
|
-
## System Status
|
|
660
|
-
|
|
661
|
-
**Production Ready**: ✅ YES
|
|
662
|
-
**Last Verified**: 2026-02-05
|
|
663
|
-
**All Tests Passing**: ✅ YES (242/242)
|
|
664
|
-
**Performance Targets Met**: ✅ YES
|
|
665
|
-
**Security Reviewed**: ✅ YES
|
|
666
|
-
**Zero Known Issues**: ✅ YES
|
|
52
|
+
## Repository
|
|
667
53
|
|
|
668
|
-
|
|
54
|
+
https://github.com/AnEntrypoint/agentgui
|