# Generated by @typespec-fastapi/emitter
# Do not edit this file manually — regenerate with: tsp compile .
"""Repository Protocol interface for file-based data access.

Defines the data access contract for the API. Methods are
inferred from TypeSpec operations and grouped by domain.
"""
from __future__ import annotations


from typing import Protocol, runtime_checkable

from ..models.common import NotFoundError, ValidationError
from ..models.session_hub import BackfillResult, MessageRow, MessageSearchResult, SessionDetail, SessionRow, SessionSearchResult


@runtime_checkable
class Repository(Protocol):
    """File-system data access interface for the API.

    Provides read and write access to context, source, and renderer
    data stored as YAML files on disk. Implementations should
    be free of HTTP/pagination concerns — the service layer wraps these
    methods with validation, slug derivation, and renderer resolution.
"""

    # ── misc ──
    """POST /api/embeddings/backfill"""
    async def create_backfill_embeddings(self, only_sessions: bool | None = None, only_messages: bool | None = None) -> BackfillResult | ValidationError:
        ...
    """GET /api/sessions/{host}/{tool}/{session_id}/messages"""
    async def get_messages_misc(self, host: str, tool: str, session_id: str) -> list[MessageRow] | NotFoundError:
        ...
    """GET /api/sessions/{host}/{tool}/{session_id}"""
    async def get_session_misc(self, host: str, tool: str, session_id: str) -> SessionDetail | NotFoundError:
        ...
    """GET /api/sessions"""
    async def list_sessions_misc(self, tool: str | None = None, host: str | None = None, working_directory: str | None = None, limit: int | None = None, offset: int | None = None) -> list[SessionRow] | ValidationError:
        ...

    # ── search ──
    """GET /api/search"""
    async def search_messages_search(self, query: str, tool: str | None = None, host: str | None = None, role: str | None = None, limit: int | None = None, mode: str | None = None) -> list[MessageSearchResult] | ValidationError:
        ...
    """GET /api/search/sessions"""
    async def search_sessions_search(self, query: str, tool: str | None = None, host: str | None = None, limit: int | None = None, mode: str | None = None) -> list[SessionRow] | ValidationError:
        ...
    """GET /api/search/similar/messages"""
    async def search_similar_messages_search(self, query: str, tool: str | None = None, host: str | None = None, role: str | None = None, limit: int | None = None) -> list[MessageSearchResult]:
        ...
    """GET /api/search/similar/sessions"""
    async def search_similar_sessions_search(self, query: str, tool: str | None = None, host: str | None = None, limit: int | None = None) -> list[SessionSearchResult]:
        ...
