from simorgh.apps.modules.registry import CapabilitySpec, FeatureSpec, ModuleManifest, register_module

register_module(
    ModuleManifest(
        name="events",
        version=1,
        domain="platform",
        label_key="events.module_label",
        description="Events — domain event bus with publish/subscribe and async dispatch",
        capabilities=(
            CapabilitySpec(slug="bus", label_key="events.capabilities.bus",
                          description="Event publishing and dispatch", icon="broadcast"),
        ),
        features=(
            FeatureSpec(code="bus.event_bus", label_key="events.features.event_bus", scope="tenant", default_enabled=True, is_always_on=True, is_platform_internal=True, description="Synchronous and asynchronous domain event dispatch"),
            FeatureSpec(code="bus.event_retry", label_key="events.features.event_retry", scope="tenant", default_enabled=True, is_always_on=True, is_platform_internal=True, description="Automatic retry with backoff for failed event handlers"),
        ),
    )
)
