"""Resource handler implementations for CleverAgents.

This package provides the handler runtime that bridges resource types
to sandbox provisioning.  Each handler resolves a :class:`Resource`
into a sandboxed working path via the :class:`SandboxManager`.

## Handler Protocol

All handlers implement
:class:`~cleveragents.resource.handlers.protocol.ResourceHandler`,
which defines a single ``resolve`` method returning a
:class:`~cleveragents.tool.context.BoundResource` with a populated
``sandbox_path``.

## Built-in Handlers

| Handler                  | Resource Type(s)          | Strategy             |
|--------------------------|---------------------------|----------------------|
| ``GitCheckoutHandler``   | ``git-checkout``          | ``git_worktree``     |
| ``FsDirectoryHandler``   | ``fs-directory``          | ``copy_on_write``    |
| ``DevcontainerHandler``  | ``devcontainer-instance`` | ``snapshot``         |
| ``CloudResourceHandler`` | ``cloud-*``, ``aws-*``   | ``none``             |
| ``DatabaseHandler``      | ``postgres``, ``mysql``   | ``transaction``      |

## Handler Resolution

Handler strings stored on :class:`ResourceTypeSpec` use the format
``module.path:ClassName``.  The :func:`resolve_handler` function
dynamically imports the module and returns an instance.
"""

from cleveragents.resource.handlers.cloud import CloudResourceHandler
from cleveragents.resource.handlers.database import DatabaseResourceHandler
from cleveragents.resource.handlers.devcontainer import DevcontainerHandler
from cleveragents.resource.handlers.fs_directory import FsDirectoryHandler
from cleveragents.resource.handlers.git_checkout import GitCheckoutHandler
from cleveragents.resource.handlers.protocol import (
    AccessResult,
    CheckpointResult,
    Content,
    DeleteResult,
    DiffResult,
    ResourceHandler,
    RollbackResult,
    SandboxResult,
    WriteResult,
)
from cleveragents.resource.handlers.resolver import (
    HandlerResolutionError,
    resolve_handler,
)

__all__ = [
    "AccessResult",
    "CheckpointResult",
    "CloudResourceHandler",
    "Content",
    "DatabaseResourceHandler",
    "DeleteResult",
    "DevcontainerHandler",
    "DiffResult",
    "FsDirectoryHandler",
    "GitCheckoutHandler",
    "HandlerResolutionError",
    "ResourceHandler",
    "RollbackResult",
    "SandboxResult",
    "WriteResult",
    "resolve_handler",
]
