"""Application configuration."""

from pydantic_settings import BaseSettings


class Settings(BaseSettings):
    # Neo4j
    neo4j_uri: str = "bolt://localhost:7687"
    neo4j_user: str = "neo4j"
    neo4j_password: str = "codegraph123"

    # Server
    host: str = "0.0.0.0"
    port: int = 8000

    # Qdrant (vector store)
    qdrant_mode: str = "disk"  # "memory" (no persist), "disk" (local folder), "server" (Docker)
    qdrant_url: str = "http://localhost:6333"  # only used when qdrant_mode="server"
    qdrant_path: str = ".codegraph/vectors"  # only used when qdrant_mode="disk"

    # Embeddings — local only, free, no API key needed
    embedding_dimension: int = 384
    local_embedding_model: str = "all-MiniLM-L6-v2"  # ~80MB, fast on CPU

    # Indexing
    max_file_size_kb: int = 500
    ignored_dirs: list[str] = [
        "node_modules", ".git", "__pycache__", ".venv", "venv",
        "dist", "build", ".next", ".nuxt", "target", "vendor",
        ".idea", ".vscode", "coverage", ".tox", "egg-info",
    ]
    supported_extensions: dict[str, str] = {
        ".py": "python",
        ".js": "javascript",
        ".jsx": "javascript",
        ".ts": "typescript",
        ".tsx": "typescript",
    }

    model_config = {"env_prefix": "CODEGRAPH_"}


settings = Settings()
