"""Compact NON graph toolkit (experimental).

The NON graph helpers remain an experimental surface intended for early adopters
building custom orchestration grammars.  They may change without notice while we
iterate on the public API; prefer higher-level operator utilities unless you are
explicitly exploring the compact notation.
"""

from __future__ import annotations

from .compact import (
    AggregatorStage,
    CandidateStage,
    CompactGraph,
    CompactNode,
    ExecutionPlan,
    FlowEndpoint,
    FlowSpec,
    JudgeStage,
    VerifierStage,
    build_graph,
    describe_graph,
    parse_flow_spec,
    parse_node_spec,
)
# Lazy imports for gepa_adapter (optional dependency)
# Import at call time to avoid requiring gepa in all environments
def __getattr__(name: str):
    """Lazy import for gepa_adapter symbols."""
    _gepa_exports = {
        "EvaluationMetrics",
        "NonEvaluationRequest",
        "NonGEPAAdapter",
        "ScoreWeights",
        "build_seed_candidate",
    }
    if name in _gepa_exports:
        try:
            from . import gepa_adapter
            return getattr(gepa_adapter, name)
        except ImportError as e:
            raise ImportError(
                f"{name} requires gepa to be installed: {e}"
            ) from e
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
from .registry import DEFAULT_NODE_REGISTRY, NodeRegistry, NodeRole, NodeType

__all__ = [
    # Compact notation
    "ExecutionPlan",
    "CandidateStage",
    "AggregatorStage",
    "JudgeStage",
    "VerifierStage",
    "CompactGraph",
    "CompactNode",
    "FlowEndpoint",
    "FlowSpec",
    "build_graph",
    "describe_graph",
    "parse_flow_spec",
    "parse_node_spec",
    # Registry
    "NodeRegistry",
    "NodeType",
    "NodeRole",
    "DEFAULT_NODE_REGISTRY",
    # GEPA integration
    "EvaluationMetrics",
    "ScoreWeights",
    "NonEvaluationRequest",
    "NonGEPAAdapter",
    "build_seed_candidate",
]
