"""Health check endpoint.""" import platform from typing import Any from fastapi import APIRouter, Request from .. import __version__ from ..auth import auth_enabled router = APIRouter(prefix="/api", tags=["health"]) @router.get("/health") async def health_check(request: Request) -> dict[str, Any]: """Health check endpoint - no authentication required. Returns: Health status and server information """ result: dict[str, Any] = { "status": "healthy", "platform": platform.system(), "version": __version__, "auth_required": auth_enabled(), } # Include cached update info if available checker = getattr(request.app.state, "update_checker", None) if checker is not None and checker.cached_update is not None: result["update_available"] = checker.cached_update return result