from __future__ import annotations

from ai_orchestrator.services.model_router import ModelRouter


class PlannerAgent:
    def __init__(self, model_router: ModelRouter) -> None:
        self.model_router = model_router

    async def create_plan(
        self,
        *,
        user_goal: str,
        repo_context: dict,
        test_command: str | None,
        memory_context: list[str],
        instruction: str | None = None,
        overrides: dict[str, str] | None = None,
    ) -> list[str]:
        repo_snapshot = dict(repo_context)
        if memory_context:
            repo_snapshot["memory_context"] = memory_context
        return await self.model_router.plan(
            goal=user_goal,
            repo_snapshot=repo_snapshot,
            test_command=test_command,
            instruction=instruction,
            overrides=overrides,
        )
