## Goal Create a robust TypeScript WebSocket client used by cauweb for realtime updates (topics, reconnect, schema validation). ## Tasks - [ ] Add `frontend/src/lib/wsClient.ts` (TS) implementing: - [ ] typed message interfaces (Request/Response/Event) - [ ] subscribe(topic)/unsubscribe(topic) semantics - [ ] exponential reconnect with jitter and backoff - [ ] heartbeat/ping-pong handling and stale detection - [ ] Use JSON Schema or zod for runtime validation of inbound messages. - [ ] Add a simple mock server used by unit tests and Playwright e2e. - [ ] Add docs: usage examples and error handling patterns. ## Acceptance criteria - [ ] Components can call `useWS.subscribe('price:AAPL')` and receive typed messages. - [ ] Client reconnects and resumes subscriptions automatically.