Commit Graph

6 Commits

Author SHA1 Message Date
Lukas May
acf3b8dae3 feat(04-04): add AgentManager to tRPC context
- Import AgentManager type into context.ts
- Add optional agentManager field to TRPCContext interface
- Add optional agentManager to CreateContextOptions
- Update TrpcAdapterOptions with optional agentManager
- Pass agentManager through to createContext in adapter
2026-01-30 20:11:01 +01:00
Lukas May
9da12a890d feat(01.1-06): add tRPC HTTP adapter and CLI client
- Create src/server/trpc-adapter.ts with fetch adapter for node:http
- Create src/cli/trpc-client.ts with typed client factory functions
- Update CoordinationServer to route /trpc/* to tRPC handler
- Move @trpc/client from devDeps to regular deps
- Keep /health and /status HTTP endpoints for backwards compatibility
2026-01-30 14:07:31 +01:00
Lukas May
1f255ee8e3 feat(01.1-05): add event emission to server and shutdown handler
- CoordinationServer accepts optional EventBus parameter
- Emit ServerStarted event on start (port, host, pid)
- Emit ServerStopped event on stop (uptime)
- Add event emission tests to server tests
- Add GracefulShutdown tests for shutdown() and install()
2026-01-30 14:03:24 +01:00
Lukas May
ea79b3bf08 test(01.1-05): add comprehensive tests for CoordinationServer
- Test server lifecycle (start, stop, isRunning)
- Test HTTP endpoints (GET /health, GET /status, 404, 405)
- Test PID file management (create, remove, stale cleanup)
- Verify server throws on double-start or existing PID file
2026-01-30 14:01:48 +01:00
Lukas May
59b233792a feat(01-05): implement graceful shutdown with signal handlers
- GracefulShutdown class handles SIGTERM, SIGINT, SIGHUP
- 10-second timeout before force exit
- Double SIGINT forces immediate exit
- Shutdown sequence: stop HTTP server, stop processes, cleanup
- Integrates with CoordinationServer and ProcessManager
2026-01-30 13:23:58 +01:00
Lukas May
bec46aa234 feat(01-05): add HTTP server with health endpoint and PID file
- CoordinationServer class using node:http
- GET /health returns status, uptime, processCount
- GET /status returns full server state and process list
- PID file at ~/.cw/server.pid prevents duplicate servers
- CLI --server flag and --port option for server mode
- CW_PORT env var support for custom port
2026-01-30 13:22:35 +01:00