Add WebSocket client infrastructure for testing the daemon without Playwright:
- DaemonClient class with full lifecycle management:
- connect/close for WebSocket connection
- createAgent, deleteAgent, listAgents for agent lifecycle
- sendMessage, cancelAgent, setAgentMode for agent interaction
- waitForAgentIdle, waitForPermission for async waiting
- respondToPermission for permission handling
- Event subscription via on() method
- Test context helper (createDaemonTestContext) that creates isolated
daemon + connected client for each test
- One working E2E test that creates a Codex agent, sends a message,
and verifies the full turn lifecycle (turn_started, assistant_message,
turn_completed events)
Key implementation details:
- Uses skipQueueBefore option in waitFor to ignore stale messages
- waitForAgentIdle tracks "running" state to avoid false positives
- All methods properly typed using existing Zod schemas
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>