from ..dtypes import Environment
from .binary_search import BinarySearchEnvironment
from .calculator import CalculatorEnvironment
from .compose import ComposedEnvironment, compose
from .git_worktree import GitWorktreeEnvironment
from .handoff import HandoffEnvironment
from .localfs import LocalFilesystemEnvironment
from .no_tools import BasicEnvironment, NoToolsEnvironment
from .oracle import OracleEnvironment
from .repl import MessageParsingREPLEnvironment, REPLEnvironment

__all__ = [
    "Environment",
    "CalculatorEnvironment",
    "BinarySearchEnvironment",
    "BasicEnvironment",
    "NoToolsEnvironment",
    "LocalFilesystemEnvironment",
    "GitWorktreeEnvironment",
    "HandoffEnvironment",
    "OracleEnvironment",
    "BrowsingEnvironment",
    "ChessPuzzleEnvironment",
    "REPLEnvironment",
    "MessageParsingREPLEnvironment",
    "ComposedEnvironment",
    "compose",
    "TerminalBenchEnvironment",
]


def __getattr__(name: str) -> type:
    """Lazy imports for environments with heavy dependencies."""
    if name == "BrowsingEnvironment":
        from .browsing import BrowsingEnvironment

        return BrowsingEnvironment
    if name == "ChessPuzzleEnvironment":
        from .chess_puzzle import ChessPuzzleEnvironment

        return ChessPuzzleEnvironment
    if name == "TerminalBenchEnvironment":
        from .terminal_bench import TerminalBenchEnvironment

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