from __future__ import annotations

from typing_extensions import TypedDict

from app.schemas import Evidence, QualityGrade, RetrievalPlan, RouteDecision, ToolResult


class AgentState(TypedDict, total=False):
    original_query: str
    current_query: str
    session_id: str
    debug: bool
    route_decision: RouteDecision
    retrieval_plan: RetrievalPlan
    evidence: list[Evidence]
    tool_results: list[ToolResult]
    executed_queries: list[dict]
    quality_grade: QualityGrade
    retrieval_round: int
    errors: list[dict]
    trace: list[dict]
    final_answer: str
    termination_reason: str