from __future__ import annotations

from enum import Enum

from pydantic import BaseModel, Field


class IndexingState(str, Enum):
    PENDING = "pending"
    INDEXING = "indexing"
    READY = "ready"
    STALE = "stale"


class IndexingStatusResponse(BaseModel):
    repo_id: str
    state: IndexingState
    files_total: int = 0
    files_indexed: int = 0
    chunks_total: int = 0
    stale_count: int = 0
    last_indexed_at: str | None = None
