Mohamed Boudra 99a5ac97fb Implement DaemonClient core for E2E testing (Phase 1)
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>
2025-12-25 16:49:38 +07:00
2025-12-25 11:31:56 +07:00
Description
Languages
TypeScript 98.1%
JavaScript 1.3%
Shell 0.1%
Swift 0.1%