# AUTO-GENERATED by ninja-codegen — DO NOT EDIT
# Re-run `ninjastack sync` to regenerate.
# Coordinator Agent wiring all domain agents.

from __future__ import annotations

from ninja_agents.base import CoordinatorAgent, DomainAgent
from ninja_core.schema.agent import AgentConfig, ReasoningLevel

{% for domain in domains %}
from .{{ domain.name | lower }}_agent import create_{{ domain.name | lower }}_domain_agent
{% endfor %}

DOMAIN_NAMES: list[str] = {{ domain_names | repr }}


def create_coordinator(domain_agents: list[DomainAgent] | None = None) -> CoordinatorAgent:
    """Create the top-level CoordinatorAgent.

    Args:
        domain_agents: Pre-built DomainAgent instances. If None, creates
                       empty domain agents from the generated factories.
    """
    if domain_agents is None:
        domain_agents = [
{% for domain in domains %}
            create_{{ domain.name | lower }}_domain_agent(),
{% endfor %}
        ]

    return CoordinatorAgent(
        domain_agents=domain_agents,
        config=AgentConfig(reasoning_level=ReasoningLevel.HIGH),
    )
