Understand the Hermes Web UI Server Architecture
masterThe Hermes Web UI server is built using Python's ThreadingHTTPServer. Each HTTP request is handled in its own thread. The server uses a flat routing structure (if/elif chains) within do_GET and do_POST methods rather than a routing framework.
Key API Routes
GET Routes:
/: Root/health: Health check/api/session: Session data/api/sessions: List of sessions/api/list: File listing/api/chat/stream: SSE streaming endpoint/api/file: File access/api/approval/pending: Check for pending tool approvals/api/session/worktree/status: Worktree status
POST Routes:
/api/upload: File upload/api/session/new: Create a new session/api/session/update: Update session metadata/api/session/delete: Delete a session/api/chat/start: Initiate an agent chat session (returnsstream_id)/api/chat: Synchronous chat fallback/api/approval/respond: Respond to a pending tool approval/api/session/worktree/remove: Remove a worktree