from ._api import secure_sandbox
from .core.types import (
    ExecOpts,
    ExecResult,
    ReadFileFailure,
    ReadFileResult,
    ReadFileSuccess,
    SandboxAdapter,
    SandboxAdapterBase,
    SecuredSandbox,
    SecureConfig,
    WriteFileFailure,
    WriteFileResult,
    WriteFileSuccess,
)
from .core.errors import (
    AgentSHError,
    PolicyValidationError,
    ProvisioningError,
    IntegrityError,
    TransportError,
    RuntimeError as RuntimeError,
)
from .policies.schema import PolicyDefinition
try:
    from .toolset.pydantic_ai import SecureSandboxToolset
except ModuleNotFoundError as _exc:
    if _exc.name and _exc.name.split(".")[0] == "pydantic_ai":

        def _missing_toolset(*_a: object, **_kw: object) -> object:
            raise ImportError(
                "SecureSandboxToolset requires the pydantic-ai extra. "
                "Install it with: pip install agentsh-secure-sandbox[pydantic-ai]"
            )

        SecureSandboxToolset = _missing_toolset  # type: ignore[assignment,misc]
    else:
        raise

__all__ = [
    "secure_sandbox",
    "SecuredSandbox",
    "SandboxAdapter",
    "SandboxAdapterBase",
    "ExecResult",
    "ExecOpts",
    "SecureConfig",
    "PolicyDefinition",
    "ReadFileResult",
    "ReadFileSuccess",
    "ReadFileFailure",
    "WriteFileResult",
    "WriteFileSuccess",
    "WriteFileFailure",
    "AgentSHError",
    "PolicyValidationError",
    "ProvisioningError",
    "IntegrityError",
    "TransportError",
    "RuntimeError",
    "SecureSandboxToolset",
]
