feat(resilience): add connection guardian with circuit breaker and network retry
Add comprehensive connection resilience for Nia plugin tools: - Network error retry: NiaClient retries transient errors (ECONNREFUSED, DNS, fetch failures) with exponential backoff up to MAX_RETRIES - Circuit breaker: ConnectionGuardian implements CLOSED → OPEN → HALF_OPEN → CLOSED state machine with 30s cooldown - Debounced reconnection: Multiple simultaneous failures trigger exactly ONE reconnect attempt via mutex - Actionable errors: Credit exhaustion, rate limiting, auth errors now show clear guidance with URLs - E2E tool coverage: All E2E encryption tools benefit from resilience - Configuration: New env vars NIA_MCP_SERVER_NAME, NIA_MCP_MAX_RETRIES, NIA_MCP_RECONNECT_DELAY - Tests: 453 unit tests pass, 0 failures Fixes pre-existing lint/type issues: - Remove unused types (Registry, TracerQueryValue) - Fix non-null assertions in tests - Fix 'any' types in job-manager tests - Fix template literal patterns - Fix AbortSignal type issues BREAKING CHANGE: None
V
Vacbo committed
bb9e11ab5ef842714c65d6677e13072ec236c4fe
Parent: 45e20fc