Add live web UI for Claude agent with WebSocket streaming
New --web PORT option enables a real-time dashboard that shows:
- Agent thinking/activity status
- Tool calls with input/output
- Text responses as they stream
- Errors and sync events
- Turn costs and running total
Architecture:
- event.ml: Event types and pub/sub bus for broadcasting
- web.ml: Minimal WebSocket server with inline HTML/CSS/JS
- SHA1/Base64 for WebSocket handshake (digestif, base64)
- Each WS connection subscribes directly to event bus
- Dark theme, monospace font, auto-reconnect
Usage:
unpac-claude --web 8080 # Interactive with web UI
unpac-claude -a --web 8080 -w /path # Autonomous with web UI
The UI auto-scrolls to show latest events and displays:
- Tool names with syntax-highlighted JSON input
- Collapsible tool output (truncated for large results)
- Turn count and cumulative cost in footer
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>