"""Pydantic models for system endpoints."""

from __future__ import annotations

from typing import Any

from pydantic import BaseModel


class SystemInfoResponse(BaseModel):
    version: str


class HeartbeatUpsert(BaseModel):
    project_id: str | None = None
    pid: int
    hostname: str
    discord_status: str = ""


class LoopsResponse(BaseModel):
    active_count: int
    loops: list[dict[str, Any]]


class GitHubAppInstallation(BaseModel):
    owner: str
    installation_id: str
    token_status: str  # "active", "expired", or "none"


class GitHubAppStatusResponse(BaseModel):
    configured: bool
    app_id: str = ""
    installations: list[GitHubAppInstallation] = []
    install_url: str = ""
