Centralize WebSocket upgrade handling
Create a single HTTP server upgrade handler that dispatches to per-route
WebSocketServers using returned { wss, pathRegex } from attachWebSocket.
Change attachWebSocket APIs to no longer bind to the server and instead
return their wss and pathRegex. Reject unmatched upgrades cleanly.
Also add JWT pre-validation and improved session error handling in the
PTY WS flow, update app-proxy to forward /pty and /tty to the API, and
add a CLI log of the WebSocket URL.