"""Flow execution orchestration."""

from __future__ import annotations

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from agent_flows.executors.registry import ExecutorRegistry

    from .flow_executor import FlowExecutor
    from .orchestrator import FlowOrchestrator
    from .state import ExecutionResult, ExecutionStateTracker

__all__ = [
    "FlowExecutor",
    "ExecutorRegistry",
    "FlowOrchestrator",
    "ExecutionResult",
    "ExecutionStateTracker",
]


def __getattr__(name: str) -> type:
    """Lazy import for execution module classes."""
    if name == "FlowExecutor":
        from .flow_executor import FlowExecutor

        return FlowExecutor
    if name == "ExecutorRegistry":
        from agent_flows.executors.registry import ExecutorRegistry

        return ExecutorRegistry
    if name == "FlowOrchestrator":
        from .orchestrator import FlowOrchestrator

        return FlowOrchestrator
    if name == "ExecutionResult":
        from .state import ExecutionResult

        return ExecutionResult
    if name == "ExecutionStateTracker":
        from .state import ExecutionStateTracker

        return ExecutionStateTracker
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
