from __future__ import annotations

from typing import Protocol, Any

# Use Any for JSON types to avoid Pydantic recursion issues
# These are used for MCP tool signatures where exact typing is less critical
JSONScalar = Any
JSONValue = Any
JSONObject = dict[str, Any]
JSONArray = list[Any]


class KeyringBackend(Protocol):
    def set_password(self, service: str, key: str, value: str) -> None: ...

    def get_password(self, service: str, key: str) -> str | None: ...

    def delete_password(self, service: str, key: str) -> None: ...
