"""Execution plan schema — a multi-step plan produced by the planner LLM."""
from __future__ import annotations

from dataclasses import dataclass, field
from typing import Literal


@dataclass
class PlanStep:
    """A single step in an execution plan.

    message may contain template variables that are filled in at runtime after
    earlier steps complete:
      {new_page_route}      — route_path of the page added by the most recent add_page step
      {new_page_id}         — page_id  of that page
      {new_page_title}      — page_title of that page
      {new_page_component}  — component name (e.g. ReportsPage)
    """
    type: Literal["add_page", "edit"]
    message: str


@dataclass
class ExecutionPlan:
    steps: list[PlanStep] = field(default_factory=list)
    reasoning: str = ""
