# apps/aroflo_connector_app/agent/cheap/plan.py
from __future__ import annotations

from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Literal


@dataclass
class MissingParam:
    name: str
    hint: str = ""


@dataclass
class Plan:
    """
    Execution plan produced by the cheap agent.

    - For reads: execute directly
    - For writes: execute with dry_run=True first, then require confirm token for apply
    """
    zone_code: str
    op_code: str
    params: Dict[str, Any] = field(default_factory=dict)

    side_effect: Literal["read", "write"] = "read"
    needs_confirmation: bool = False

    # Optional user-facing info
    summary: str = ""
    missing: List[MissingParam] = field(default_factory=list)

    def is_ready(self) -> bool:
        return not self.missing
