feat(health): add health check endpoint module
Implements src/health.ts (bead assistant-69t.3)
Endpoints:
- healthCheck(): full dependency health check
- Checks Letta API (/v1/health)
- Checks Anthropic proxy (/health)
- Checks database (optional, skipped in M0)
- Returns 200 if all healthy, 503 otherwise
- 5-second timeout per check using AbortSignal.timeout
- simpleHealthCheck(): basic liveness probe
- Returns 200 immediately
- Used before dependencies are configured
Response format:
{
"healthy": boolean,
"checks": {
"db": boolean,
"letta": boolean,
"proxy": boolean
}
}
Features:
- Dynamic import for optional DB module (M0 compatible)
- Graceful degradation when DB not yet implemented
- Structured JSON responses for monitoring integration
Includes:
- health.test.ts: unit tests with fetch mocking
- health.integration.test.ts: integration test examples
- health.README.md: documentation
- index.example.ts: server integration example
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>