"""Contracts for v2 retrieval-plan resolvers."""

from __future__ import annotations

from typing import Protocol

from app.core.agent.utils.process_v2.models import V2RouteResult
from app.core.rag.retrieval.session_retriever import RetrievalPlan


class RetrievalPlanResolver(Protocol):
    """Minimal contract used by workflows to build retrieval plans."""

    def resolve(self, route: V2RouteResult) -> RetrievalPlan:
        """Build a retrieval plan for the provided route."""


class WorkflowRetrievalPlanResolver(Protocol):
    """Route-aware resolver implementation used by delegating policy resolver."""

    def supports(self, route: V2RouteResult) -> bool:
        """Return True when this resolver can handle the route."""

    def resolve(self, route: V2RouteResult) -> RetrievalPlan:
        """Build a retrieval plan for the provided route."""

