feat: xterm.js + node-pty architecture for Claude CLI web terminal

Complete rewrite from tmux + JSONL parsing to a clean PTY-based approach.
The proxy spawns Claude CLI in a pseudo-terminal via node-pty and relays
terminal I/O as binary WebSocket frames to the simple-chat backend,
which forwards them to the browser where xterm.js renders a full terminal.

- node-pty PTY manager with 50KB replay buffer per session
- Binary frame protocol with chatId multiplexing
- WebSocket client with auto-reconnection and heartbeat
- Directory listing and session listing for the web UI
- README with setup instructions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-22 00:24:29 +03:00
commit 4a91896732
17 changed files with 6146 additions and 0 deletions

8
.env.example Normal file
View File

@ -0,0 +1,8 @@
# Токен устройства (получить в simple-chat: Настройки → Устройство)
PROXY_TOKEN=
# WebSocket URL бэкенда simple-chat
# Локальная разработка:
SERVER_URL=ws://localhost:3000/ws/agent-proxy
# Продакшен:
# SERVER_URL=wss://ai-chat.vigdorov.ru/ws/agent-proxy