__all__ = [
    "FlowEngine",
    "OperatorAction",
    "OperatorHandler",
    "FilterOperatorHandler",
    "PipeOperatorHandler",
    "OperatorRegistry",
    "FlowEngineContext",
    "OperatorContext",
    "EnginePort",
]


def __getattr__(name: str):
    if name == "FlowEngine":
        from flownet.engine.flow_engine import FlowEngine
        return FlowEngine
    if name in {"OperatorAction", "OperatorHandler", "FilterOperatorHandler", "PipeOperatorHandler"}:
        from flownet.engine.operators.base import OperatorAction, OperatorHandler
        from flownet.engine.operators.stateless import FilterOperatorHandler, PipeOperatorHandler
        return {
            "OperatorAction": OperatorAction,
            "OperatorHandler": OperatorHandler,
            "FilterOperatorHandler": FilterOperatorHandler,
            "PipeOperatorHandler": PipeOperatorHandler,
        }[name]
    if name == "OperatorRegistry":
        from flownet.engine.operator_registry import OperatorRegistry
        return OperatorRegistry
    if name in {"FlowEngineContext", "OperatorContext"}:
        from flownet.engine.context import OperatorContext, FlowEngineContext
        return {"FlowEngineContext": FlowEngineContext, "OperatorContext": OperatorContext}[name]
    if name == "EnginePort":
        from flownet.engine.port import EnginePort
        return EnginePort
    raise AttributeError(name)
