"""
scrylo/api/routers/health.py
-----------------------------
Health check endpoint — used by CLI startup check and Web UI status badge.
"""

from fastapi import APIRouter
from scrylo.core.config import settings
from scrylo.core.model_manager import is_downloaded

router = APIRouter(tags=["system"])


@router.get("/health")
def health_check():
    return {
        "status": "ok",
        "version": settings["app"]["version"],
        "model_downloaded": is_downloaded(),
        "model": settings["llm"]["model"],
    }
