"""Plugin architecture framework for CleverAgents.

Provides dynamic plugin discovery, loading, validation, and lifecycle
management.  Plugins are resolved via ``module:ClassName`` strings and
validated against ``@runtime_checkable`` Protocol types.

Key components:

- :class:`PluginLoader` — dynamic import and entry-point discovery.
- :class:`PluginManager` — lifecycle management (discover/activate/deactivate).
- :class:`PluginDescriptor` — immutable metadata for a discovered plugin.
- :class:`PluginState` — lifecycle state enum.
- :func:`register_all_extension_points` — registers all 30 spec-defined
  extension points.

Based on ``docs/specification.md`` Extension Points Summary and
issue #585, #939.

ISSUES CLOSED: #585
"""

from __future__ import annotations

from cleveragents.infrastructure.plugins.exceptions import (
    PluginError,
    PluginLoadError,
    PluginNotFoundError,
    ProtocolMismatchError,
)
from cleveragents.infrastructure.plugins.extension_catalog import (
    TOTAL_EXTENSION_POINTS,
    get_extension_point_definitions,
    get_extension_points_by_category,
    register_all_extension_points,
)
from cleveragents.infrastructure.plugins.loader import PluginLoader
from cleveragents.infrastructure.plugins.manager import PluginManager
from cleveragents.infrastructure.plugins.types import (
    ExtensionPoint,
    PluginDescriptor,
    PluginState,
)

__all__ = [
    "TOTAL_EXTENSION_POINTS",
    "ExtensionPoint",
    "PluginDescriptor",
    "PluginError",
    "PluginLoadError",
    "PluginLoader",
    "PluginManager",
    "PluginNotFoundError",
    "PluginState",
    "ProtocolMismatchError",
    "get_extension_point_definitions",
    "get_extension_points_by_category",
    "register_all_extension_points",
]
