"""Tool runtime and lifecycle package for CleverAgents v3.

Re-exports public types from the runtime, runner, and registry modules
(C0.runtime) and the four-stage tool lifecycle with capability enforcement,
JSON Schema validation, per-plan activation caching, execution tracing,
and cancellation propagation (C5.lifecycle).  Also re-exports the
tool call router for provider format translation (C5.router) and the
tool-calling actor runtime for execution actors (M1.actor-runtime).
"""

from cleveragents.tool.actor_context import ToolActorContext, ToolCallRecord
from cleveragents.tool.actor_runtime import (
    LLMCaller,
    LLMResponse,
    LLMToolCall,
    MaxIterationsExceededError,
    ToolCallingRuntime,
    ToolCallRunResult,
)
from cleveragents.tool.container_executor import (
    ContainerConfig,
    ContainerExecutionError,
    ContainerMetadata,
    ContainerTimeoutError,
    ContainerToolExecutor,
)
from cleveragents.tool.context import (
    BoundResource,
    CancellationToken,
    Change,
    ChangeOperation,
    ToolCancelledError,
    ToolExecutionContext,
    ToolExecutionTrace,
)
from cleveragents.tool.lifecycle import (
    ToolAccessDeniedError,
    ToolActivationError,
    ToolCheckpointRequiredError,
    ToolCostLimitExceededError,
    ToolDeactivationError,
    ToolDescriptor,
    ToolExecutionError,
    ToolHumanApprovalRequiredError,
    ToolInstance,
    ToolLifecycleCache,
    ToolNotActivatedError,
    ToolRetryLimitExceededError,
    ToolRuntime,
    ToolRuntimeError,
    ToolSafetyViolationError,
    ToolSandboxRequiredError,
)
from cleveragents.tool.lifecycle import (
    ToolResult as LifecycleToolResult,
)
from cleveragents.tool.path_mapper import PathMapper
from cleveragents.tool.registry import ToolRegistry
from cleveragents.tool.router import (
    NormalizedToolCallResult,
    ProviderFormat,
    StreamingStatus,
    StreamingToolUpdate,
    ToolCallErrorCategory,
    ToolCallRequest,
    ToolCallRouter,
    classify_tool_error,
    detect_provider_format,
    generate_tool_call_id,
    normalize_tool_call,
    normalize_tool_schema_for_provider,
)
from cleveragents.tool.runner import ToolRunner
from cleveragents.tool.runtime import ToolError, ToolResult, ToolSpec
from cleveragents.tool.schema_validator import (
    ToolSchemaValidationError,
    validate_tool_input,
    validate_tool_output,
)
from cleveragents.tool.wrapping import (
    ArgumentMapper,
    TransformExecutionError,
    TransformExecutor,
    WrappedToolExecutor,
    WrappedToolNotFoundError,
    WrappingCycleError,
    WrappingDepthExceededError,
)

__all__ = [
    "ArgumentMapper",
    "BoundResource",
    "CancellationToken",
    "Change",
    "ChangeOperation",
    "ContainerConfig",
    "ContainerExecutionError",
    "ContainerMetadata",
    "ContainerTimeoutError",
    "ContainerToolExecutor",
    "LLMCaller",
    "LLMResponse",
    "LLMToolCall",
    "LifecycleToolResult",
    "MaxIterationsExceededError",
    "NormalizedToolCallResult",
    "PathMapper",
    "ProviderFormat",
    "StreamingStatus",
    "StreamingToolUpdate",
    "ToolAccessDeniedError",
    "ToolActivationError",
    "ToolActorContext",
    "ToolCallErrorCategory",
    "ToolCallRecord",
    "ToolCallRequest",
    "ToolCallRouter",
    "ToolCallRunResult",
    "ToolCallingRuntime",
    "ToolCancelledError",
    "ToolCheckpointRequiredError",
    "ToolCostLimitExceededError",
    "ToolDeactivationError",
    "ToolDescriptor",
    "ToolError",
    "ToolExecutionContext",
    "ToolExecutionError",
    "ToolExecutionTrace",
    "ToolHumanApprovalRequiredError",
    "ToolInstance",
    "ToolLifecycleCache",
    "ToolNotActivatedError",
    "ToolRegistry",
    "ToolResult",
    "ToolRetryLimitExceededError",
    "ToolRunner",
    "ToolRuntime",
    "ToolRuntimeError",
    "ToolSafetyViolationError",
    "ToolSandboxRequiredError",
    "ToolSchemaValidationError",
    "ToolSpec",
    "TransformExecutionError",
    "TransformExecutor",
    "WrappedToolExecutor",
    "WrappedToolNotFoundError",
    "WrappingCycleError",
    "WrappingDepthExceededError",
    "classify_tool_error",
    "detect_provider_format",
    "generate_tool_call_id",
    "normalize_tool_call",
    "normalize_tool_schema_for_provider",
    "validate_tool_input",
    "validate_tool_output",
]
