from __future__ import annotations

from dataclasses import dataclass
from typing import Any

from niannian.agents.loop_registry import AgentLoopRegistry


@dataclass
class AgentInfrastructure:
    loop_registry: AgentLoopRegistry

    def health_summary(self) -> dict[str, Any]:
        return {
            "llm": {"source": "providers.local", "multi_pool": False},
            "agent_loops": self.loop_registry.health_summary(),
        }


def build_agent_infrastructure(agents_cfg: dict[str, Any] | None) -> AgentInfrastructure:
    return AgentInfrastructure(loop_registry=AgentLoopRegistry(agents_cfg))
