"""LangGraph primitives adapted for actor-first routing.

``graph`` sub-module is lazy-loaded because it pulls in
``langchain_core``, ``langsmith``, and ``rx.operators`` which add
multiple seconds of import overhead.  Lightweight symbols from
``nodes`` and ``state`` are available eagerly.
"""

from .nodes import Edge, NodeConfig, NodeType
from .state import GraphState


def __getattr__(name: str):
    _GRAPH_ATTRS = {"GraphConfig", "LangGraph"}
    if name in _GRAPH_ATTRS:
        from .graph import GraphConfig as _GraphConfig
        from .graph import LangGraph as _LangGraph

        globals()["GraphConfig"] = _GraphConfig
        globals()["LangGraph"] = _LangGraph
        return globals()[name]
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")


__all__ = [
    "Edge",
    "GraphConfig",
    "GraphState",
    "LangGraph",
    "NodeConfig",
    "NodeType",
]
