agentgui 1.0.39 → 1.0.40

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.
@@ -1,189 +0,0 @@
1
- # AgentGUI Implementation Status
2
-
3
- ## ✅ Completed Features
4
-
5
- ### 1. OAuth Authentication
6
- - ✅ Binary discovery for `claude-code-acp`
7
- - ✅ Automatic PATH management
8
- - ✅ Timeout optimization for ACP bridge
9
- - ✅ Uses local Claude Code credentials (no API key needed)
10
-
11
- ### 2. Response Formatting Infrastructure
12
- - ✅ ResponseFormatter module for parsing responses
13
- - ✅ Segment detection (code, headings, text, lists)
14
- - ✅ Metadata extraction (tools, thinking, tasks, subagents)
15
- - ✅ Frontend rendering for segments and metadata
16
-
17
- ### 3. HTML/RippleUI System
18
- - ✅ Enhanced system prompt with detailed HTML instructions
19
- - ✅ HTMLWrapper module for automatic HTML wrapping
20
- - ✅ Markdown parsing to HTML conversion
21
- - ✅ Tailwind CSS styling integration
22
-
23
- ### 4. Frontend Improvements
24
- - ✅ Enhanced HTML detection (tags + Tailwind classes)
25
- - ✅ Rich CSS styling for code blocks, metadata, segments
26
- - ✅ Responsive design for all components
27
- - ✅ Print-friendly styles
28
-
29
- ### 5. Infrastructure
30
- - ✅ Hot reload preparation (HotReloadManager module)
31
- - ✅ Git version control with comprehensive commit history
32
- - ✅ Port configuration (3000 dev, 9897 production)
33
- - ✅ Database persistence
34
-
35
- ## 🔄 Partially Implemented
36
-
37
- ### Hot Reload for Node Modules
38
- - ⚠️ Static files auto-reload: YES (CSS, HTML, JS in browser)
39
- - ⚠️ Node.js module changes: NO (requires server restart)
40
- - **Workaround**: Changes to `.js` files in `/config/workspace/agentgui/` require manual server restart
41
- - **Future**: Implement full ES module reloading
42
-
43
- ## 📊 Current Architecture
44
-
45
- ```
46
- User → Browser (9897)
47
-
48
- Server.js (Node.js)
49
- ├→ ACP Pool (connects to claude-code-acp)
50
- │ └→ OAuth via local credentials
51
- ├→ HTMLWrapper (wraps responses in HTML)
52
- ├→ ResponseFormatter (segments & metadata)
53
- └→ Database (SQLite)
54
- ```
55
-
56
- ## 🎯 Current Limitations
57
-
58
- 1. **System Prompt Not Fully Enforced**
59
- - Claude Code's system prompt about HTML responses works partially
60
- - Plain text responses are now auto-wrapped by HTMLWrapper
61
- - Result: All responses display as HTML regardless of original format
62
-
63
- 2. **Hot Module Reloading**
64
- - Static files (CSS, HTML) reload automatically
65
- - JavaScript/Node modules need manual restart
66
- - Recommendation: Changes to server logic need restart
67
-
68
- 3. **ACP Skill Injection**
69
- - `session/skill_inject` not supported by current ACP version
70
- - Falls back gracefully without error
71
- - System prompt still injected via context
72
-
73
- ## 📋 Next Steps
74
-
75
- ### For Full HTML Response Enforcement
76
- 1. ✅ Already Done: HTMLWrapper auto-converts plain text to HTML
77
- 2. No further action needed - all responses now display as beautifully formatted HTML
78
-
79
- ### For True Hot Module Reloading
80
- 1. Implement dynamic `import()` for module reloading
81
- 2. Add module-level cache busting
82
- 3. Handle state preservation during reload
83
-
84
- ### For Enhanced Display
85
- 1. Add streaming responses (real-time message display)
86
- 2. Add more sophisticated metadata visualization
87
- 3. Add export/sharing functionality
88
-
89
- ## 🧪 Testing
90
-
91
- ### Test a Message
92
- ```bash
93
- CONV=$(curl -s -X POST http://localhost:9897/gm/api/conversations \
94
- -H "Content-Type: application/json" \
95
- -d '{"agentId": "claude-code", "title": "Test"}' | python3 -c "import sys,json; print(json.load(sys.stdin)['conversation']['id'])")
96
-
97
- curl -s -X POST "http://localhost:9897/gm/api/conversations/$CONV/messages" \
98
- -H "Content-Type: application/json" \
99
- -d '{"agentId": "claude-code", "content": "Your question here", "idempotencyKey": "test-1"}'
100
-
101
- # Check response after ~30-50 seconds
102
- curl -s "http://localhost:9897/gm/api/conversations/$CONV/messages" | python3 -m json.tool
103
- ```
104
-
105
- ## 📝 Files Structure
106
-
107
- ```
108
- agentgui/
109
- ├── server.js # Main HTTP server + WebSocket
110
- ├── acp-launcher.js # ACP connection management + system prompt
111
- ├── database.js # SQLite persistence
112
- ├── response-formatter.js # Response parsing & segmentation
113
- ├── html-wrapper.js # Markdown to HTML conversion
114
- ├── hot-reload-manager.js # Hot reload infrastructure (prepared)
115
- ├── static/
116
- │ ├── app.js # Frontend logic
117
- │ ├── index.html # UI template
118
- │ ├── styles.css # Comprehensive styling
119
- │ └── theme.js # Theme management
120
- └── package.json # Dependencies
121
- ```
122
-
123
- ## 🚀 Running the Server
124
-
125
- ```bash
126
- # Development (port 3000)
127
- npm start
128
-
129
- # Production (port 9897)
130
- PORT=9897 npm start
131
-
132
- # With hot reload enabled (default)
133
- PORT=9897 HOT_RELOAD=true npm start
134
-
135
- # To disable hot reload
136
- PORT=9897 HOT_RELOAD=false npm start
137
- ```
138
-
139
- ## 💡 Key Implementation Details
140
-
141
- ### HTML Wrapping Flow
142
- ```
143
- Claude's plain text response
144
-
145
- HTMLWrapper.wrapResponse()
146
-
147
- Parse markdown syntax
148
-
149
- Convert to HTML with Tailwind classes
150
-
151
- Wrap in container div
152
-
153
- Store as messageContent.text
154
-
155
- Frontend detects HTML (starts with <div)
156
-
157
- Renders with sanitization
158
- ```
159
-
160
- ### Response Structure
161
- ```json
162
- {
163
- "id": "msg-xxx",
164
- "role": "assistant",
165
- "content": {
166
- "text": "<div class=\"space-y-4 p-6\">...HTML...</div>",
167
- "segments": [...],
168
- "metadata": {...},
169
- "updateChunks": [...],
170
- "blocks": [],
171
- "isHTML": true
172
- }
173
- }
174
- ```
175
-
176
- ## ✨ Results
177
-
178
- - All responses now display as beautiful, styled HTML
179
- - Code blocks are properly syntax-highlighted
180
- - Metadata (tools, thinking, tasks) are rich and interactive
181
- - System runs on port 9897 for production
182
- - OAuth authentication works seamlessly
183
- - Database persists conversations and history
184
-
185
- ---
186
-
187
- **Last Updated**: February 3, 2026
188
- **Version**: 1.0.16+
189
- **Status**: Production Ready (with auto-HTML wrapping)
package/README.md DELETED
@@ -1,213 +0,0 @@
1
- # GMGUI - Multi-Agent ACP Client
2
-
3
- A buildless, hot-reloading web client for managing multiple Claude Agent Protocol (ACP) agents with real-time communication via WebSocket and MessagePack.
4
-
5
- **Status**: ✅ Production Ready | **Version**: 1.0.0 | **License**: MIT
6
-
7
- ## Get Started Now - One Command
8
-
9
- ```bash
10
- bunx agentgui
11
- ```
12
-
13
- That's it. One command starts the server and opens http://localhost:3000/gm/ in your browser.
14
-
15
- **Works anywhere:** Any system with Bun installed.
16
-
17
- **Stop anytime:** Press Ctrl+C - clean shutdown.
18
-
19
- ## Features
20
-
21
- - **Multi-Agent Management**: Connect unlimited ACP agents and switch between them instantly
22
- - **Real-Time Communication**: WebSocket + MessagePack for efficient bidirectional messaging
23
- - **Desktop Screenshots**: Capture and share desktop screenshots with agents (via scrot)
24
- - **File Upload/Download**: Upload files for agents to access, download files from conversations
25
- - **Modern Responsive UI**: Beautiful interface that works on mobile, tablet, and desktop
26
- - **Conversation History**: Full message history with timestamps
27
- - **Zero Build Step**: Pure HTML/CSS/JavaScript - no bundling or transpilation
28
- - **Minimal Dependencies**: Only 1 production dependency (ws)
29
-
30
- ## How It Works
31
-
32
- **Chat Interface**
33
- - Real-time message display with timestamps
34
- - Send/receive messages with agents
35
- - Clear chat history
36
-
37
- **File Management**
38
- - Upload files for agents to access
39
- - Download files from conversations
40
- - Files stored automatically
41
-
42
- **Desktop Sharing**
43
- - Capture desktop screenshots
44
- - Share directly with agents
45
-
46
- **Agent Management**
47
- - Add agents by ID and endpoint
48
- - View connection status
49
- - Switch between agents
50
-
51
- **Responsive Design**
52
- - Works on desktop, tablet, and mobile
53
- - Touch-friendly interface
54
- - Optimized for all screen sizes
55
-
56
- ## API Endpoints
57
-
58
- ### Get Agents
59
- ```
60
- GET /api/agents
61
- ```
62
- Response: `{"agents": [...]}`
63
-
64
- ### Send Message to Agent
65
- ```
66
- POST /api/agents/{agentId}
67
- Content-Type: application/json
68
-
69
- {"type": "message", "content": "..."}
70
- ```
71
-
72
- ### Upload Files
73
- ```
74
- POST /api/upload
75
- Content-Type: multipart/form-data
76
-
77
- file=@path/to/file.txt
78
- ```
79
-
80
- ### Capture Screenshot
81
- ```
82
- POST /api/screenshot
83
- ```
84
-
85
- ### Download File
86
- ```
87
- GET /uploads/{filename}
88
- ```
89
-
90
- ## Configuration
91
-
92
- ### Environment Variables
93
- - `PORT` (default: 3000) - Server port
94
- - `UPLOAD_DIR` (default: /tmp/gmgui-conversations) - File storage location
95
-
96
- ### Data Storage
97
-
98
- **Conversation History**: Stored in `~/.gmgui/data.db` (hidden folder in your home directory)
99
- - Uses SQLite database for persistent storage
100
- - Auto-created on first run with proper permissions
101
- - Contains conversations, messages, sessions, and event history
102
- - Data persists across runs and restarts
103
- - Private to current user (mode 0644)
104
-
105
- **Browser Local Storage**
106
- - `gmgui-settings` - User preferences and configuration
107
-
108
- **Why Hidden Folder?**
109
- Using `~/.gmgui/` follows Unix conventions:
110
- - Hidden folders (starting with `.`) keep user directories clean
111
- - Prevents accidental deletion or modification
112
- - Private by convention - not visible in casual `ls` output
113
- - Standard practice for application data (`.config`, `.local`, `.cache`)
114
-
115
- ## Architecture
116
-
117
- ### Server (Node.js)
118
- - HTTP server with static file serving
119
- - WebSocket server for agent connections
120
- - File upload/download endpoints
121
- - Screenshot capture endpoint
122
- - Agent management
123
-
124
- ### Client (Browser)
125
- - Real-time message display
126
- - File management UI
127
- - Screenshot capture and preview
128
- - Agent connection management
129
- - Settings persistence
130
-
131
- ### File Structure
132
- ```
133
- gmgui/
134
- ├── server.js # HTTP + WebSocket server
135
- ├── database.js # SQLite persistence
136
- ├── acp-launcher.js # Agent management
137
- ├── bin/gmgui.cjs # npm entry point
138
- ├── static/
139
- │ ├── index.html # Main UI
140
- │ ├── app.js # Frontend logic
141
- │ ├── styles.css # Responsive styles
142
- │ ├── theme.js # Theme management
143
- │ └── rippleui.css # CSS framework
144
- ├── install.sh # One-liner installer
145
- ├── package.json # Dependencies
146
- └── README.md # This file
147
- ```
148
-
149
- ## Development
150
-
151
- ### Enable Hot Reload (during development)
152
- ```bash
153
- npm run dev
154
- ```
155
- Changes to `static/` files auto-refresh the browser.
156
-
157
- ## Browser Support
158
-
159
- Works on all modern browsers:
160
- - Chrome/Edge 63+
161
- - Firefox 55+
162
- - Safari 11+
163
- - Mobile browsers (iOS Safari, Chrome Mobile, etc.)
164
-
165
- ## Performance
166
-
167
- - **Fast Startup**: ~100ms with Bun
168
- - **No Build Step**: Source code runs directly
169
- - **Efficient Messaging**: MessagePack reduces payload size by 50%
170
- - **Real-time Updates**: <50ms WebSocket latency
171
- - **Memory Efficient**: ~20MB typical usage
172
-
173
- ## Troubleshooting
174
-
175
- **Port Already in Use**
176
- ```bash
177
- PORT=3001 bunx gmgui
178
- ```
179
-
180
- **Agent Won't Connect**
181
- - Verify agent endpoint is accessible
182
- - Check browser console for errors
183
- - Ensure agent is sending valid ACP messages
184
-
185
- **Files Not Uploading**
186
- - Check browser console for errors
187
- - Verify sufficient disk space available
188
-
189
- ## Security
190
-
191
- - Path traversal protection on file uploads
192
- - WebSocket message validation
193
- - File upload restrictions
194
- - No sensitive data in logs
195
-
196
- ## License
197
-
198
- MIT - Free to use, modify, and distribute
199
-
200
- ## Need Help?
201
-
202
- Open an issue on GitHub: https://github.com/AnEntrypoint/gmgui/issues
203
-
204
- ---
205
-
206
- **Ready to manage multiple ACP agents?** Run this now:
207
-
208
- ```bash
209
- curl -fsSL https://raw.githubusercontent.com/AnEntrypoint/gmgui/main/install.sh | bash
210
- ```
211
-
212
- Then open http://localhost:3000/gm/ in your browser
213
- # Triggered npm publishing
package/RECENT_UPDATES.md DELETED
@@ -1,209 +0,0 @@
1
- # AgentGUI Recent Updates
2
-
3
- ## Overview
4
- AgentGUI has been significantly enhanced to use local Claude Code OAuth authentication and provide rich, metadata-aware response rendering.
5
-
6
- ## Key Changes
7
-
8
- ### 1. OAuth Authentication via Local Claude Code
9
- **File**: `acp-launcher.js`, `server.js`
10
-
11
- - **Binary Discovery**: Automatically finds `claude-code-acp` in common installation locations
12
- - `/config/.gmweb/npm-global/bin/claude-code-acp`
13
- - `~/.local/bin/claude-code-acp`
14
- - Falls back to PATH if configured
15
-
16
- - **PATH Management**: Enhanced environment variable handling to ensure npm global binaries are discoverable
17
-
18
- - **Timeout Optimization**:
19
- - Initialize: 4s → 10s
20
- - Session creation: 4s → 30s
21
- - Mode setting: 2s → 10s
22
- - Handshake deadline: 5s → 60s
23
-
24
- **Benefits**:
25
- - Uses existing Claude Code authentication
26
- - No additional API key setup needed
27
- - Seamless integration with system auth
28
-
29
- ### 2. Response Segmentation & Metadata Extraction
30
- **Files**: `response-formatter.js`, `server.js`, `static/app.js`
31
-
32
- #### ResponseFormatter
33
- - Intelligent parsing of Claude responses into semantic units:
34
- - Code blocks (with language detection)
35
- - Headings (h1-h6)
36
- - Text paragraphs
37
- - Blockquotes
38
- - Lists
39
-
40
- - Metadata extraction:
41
- - Tool calls and function names
42
- - Thinking/reasoning blocks
43
- - Task references
44
- - Subagent usage
45
-
46
- - Proper formatting with inline code highlighting
47
-
48
- #### Frontend Rendering
49
- - `renderSegment()`: Beautiful display of each segment type
50
- - `renderMetadata()`: Rich metadata sidebar with:
51
- - Tools used (with code highlighting)
52
- - Thinking blocks (collapsible details element)
53
- - Subagents employed
54
- - Tasks referenced
55
-
56
- ### 3. Rich HTML/RippleUI Responses
57
- **Files**: `acp-launcher.js`, `static/app.js`
58
-
59
- #### System Prompt Enhancement
60
- Comprehensive instruction set forcing Claude to respond with HTML:
61
- - RippleUI components (cards, alerts, tables, badges)
62
- - Tailwind CSS styling
63
- - Semantic HTML structure
64
- - Code block formatting with language hints
65
- - Never raw text - always wrapped HTML
66
-
67
- #### HTML Detection Improvement
68
- - Detects HTML by tags, structure, AND Tailwind classes
69
- - Lower tag count threshold for detection (2 vs 3)
70
- - Better recognition of styled components
71
-
72
- ### 4. Professional CSS Styling
73
- **File**: `static/styles.css`
74
-
75
- Added comprehensive styling for:
76
- - Code blocks with language-specific colors
77
- - Inline code with syntax highlighting
78
- - Markdown formatting (bold, italic, code)
79
- - Collapsible thinking blocks
80
- - Metadata sections with visual hierarchy
81
- - Print-friendly styles
82
- - Dark mode support
83
-
84
- ### 5. Hot Reload Infrastructure
85
- **File**: `hot-reload-manager.js`
86
-
87
- Prepared for hot reloading:
88
- - File watching with debouncing
89
- - WebSocket-based reload signaling
90
- - Graceful client-side reloading
91
- - Ready for future implementation
92
-
93
- ## System Architecture
94
-
95
- ### Ports
96
- - Production: **9897** (via system startup)
97
- - Development: **3000** (via `npm start`)
98
-
99
- ### Request Flow
100
- ```
101
- User Message
102
-
103
- API endpoint (/api/conversations/:id/messages)
104
-
105
- Server (processMessage)
106
-
107
- getACP() - Gets or creates connection
108
-
109
- conn.sendPrompt() - Sends to Claude Code via ACP bridge
110
-
111
- ResponseFormatter.segmentResponse()
112
-
113
- Database storage with segments + metadata
114
-
115
- Frontend display with rich rendering
116
- ```
117
-
118
- ### Connection Management
119
- - ACP Pool: Maintains persistent connections per agent
120
- - OAuth via local Claude Code credentials
121
- - Graceful error handling and fallback
122
- - Automatic reconnection
123
-
124
- ## Display Examples
125
-
126
- ### Segmented Response
127
- Plain text becomes:
128
- ```
129
- [Heading] Problem Analysis
130
- [Text] Explanation paragraph
131
- [Code] javascript function example
132
- [Metadata] Tools used, reasoning blocks
133
- ```
134
-
135
- ### Metadata Display
136
- - **Tools Used**: List of functions/tools called
137
- - **Reasoning**: Collapsible thinking process
138
- - **Subagents**: External agents employed
139
- - **Tasks**: Itemized task list
140
-
141
- ## Configuration
142
-
143
- ### Environment Variables
144
- ```bash
145
- PORT=9897 # Server port (default: 3000)
146
- BASE_URL=/gm # Route prefix (default: /gm)
147
- HOT_RELOAD=false # Disable hot reload (default: true)
148
- ```
149
-
150
- ### Database
151
- - Location: `~/.gmgui/data.db`
152
- - Persists conversations, messages, sessions
153
- - Auto-created on first run
154
-
155
- ## Testing
156
-
157
- ### Quick Start
158
- ```bash
159
- npm start # Start on port 3000
160
- PORT=9897 npm start # Start on port 9897
161
- ```
162
-
163
- ### Test Endpoints
164
- ```bash
165
- # Get agents
166
- curl http://localhost:3000/gm/api/agents
167
-
168
- # Create conversation
169
- curl -X POST http://localhost:3000/gm/api/conversations \
170
- -H "Content-Type: application/json" \
171
- -d '{"agentId": "claude-code", "title": "Test"}'
172
-
173
- # Send message
174
- curl -X POST http://localhost:3000/gm/api/conversations/{id}/messages \
175
- -H "Content-Type: application/json" \
176
- -d '{"agentId": "claude-code", "content": "Hello"}'
177
-
178
- # Get messages
179
- curl http://localhost:3000/gm/api/conversations/{id}/messages
180
- ```
181
-
182
- ## Future Enhancements
183
-
184
- 1. **Full Hot Reloading**: Complete implementation of HotReloadManager
185
- 2. **Streaming Responses**: Real-time message streaming to client
186
- 3. **Task Tracking**: Enhanced task and subagent visualization
187
- 4. **Export Functions**: Share/export conversations as HTML/PDF
188
- 5. **Theme Customization**: Allow user-defined themes
189
-
190
- ## Files Modified
191
-
192
- - `acp-launcher.js` - OAuth and timeout fixes, system prompt
193
- - `server.js` - Response segmentation, metadata extraction
194
- - `static/app.js` - Rich rendering, HTML detection
195
- - `static/styles.css` - Professional styling for all components
196
- - `response-formatter.js` - NEW: Response parsing and formatting
197
- - `hot-reload-manager.js` - NEW: Hot reload infrastructure
198
-
199
- ## Git Commits
200
-
201
- 1. **Fix OAuth Connection** - Binary discovery and PATH management
202
- 2. **Increase ACP Timeouts** - Proper timeout values for connection establishment
203
- 3. **Rich Response Formatting** - Segmentation and metadata rendering
204
- 4. **Enforce HTML Responses** - System prompt and detection improvements
205
-
206
- ---
207
-
208
- **Last Updated**: February 3, 2026
209
- **Version**: 1.0.15