from __future__ import annotations

from typing import List, Protocol

from r9s.agents.models import Agent, AgentExecution, AgentVersion


class AgentStore(Protocol):
    def get_agent(self, name: str) -> Agent: ...

    def get_version(self, name: str, version: str = "latest") -> AgentVersion: ...

    def create(self, name: str, **config: object) -> Agent: ...

    def update(self, name: str, **config: object) -> AgentVersion: ...

    def list(self) -> List[Agent]: ...

    def list_versions(self, name: str) -> List[AgentVersion]: ...

    def delete(self, name: str) -> None: ...


class AuditStore(Protocol):
    def record(self, execution: AgentExecution) -> None: ...

    def query(self, **filters: object) -> List[AgentExecution]: ...

    def export(self, format: str = "json") -> bytes: ...
