"""
Event system for Information Spaces.

This package provides event-driven architecture for space operations:
- SpaceEvent: Event dataclass with type, payload, timestamp
- SpaceEventType: Enum of all event types
- EventBus: In-process publish/subscribe for space events
- Event factory functions for common events

Events emitted:
- Space lifecycle: SPACE_CREATED, SPACE_UPDATED, SPACE_DELETED, SPACE_ACTIVATED, SPACE_ARCHIVED
- Document: DOCUMENT_ADDED, DOCUMENT_UPDATED, DOCUMENT_REMOVED, DOCUMENT_MOVED, DOCUMENT_CONTENT_CHANGED
- Variable: VARIABLE_SET, VARIABLE_DELETED
- Reference: REFERENCE_ADDED, REFERENCE_CLEARED
- Rendering: RENDER_STARTED, RENDER_COMPLETED, RENDER_FAILED
- Sync: SYNC_STARTED, SYNC_COMPLETED, SYNC_CONFLICT
- Cache: CACHE_INVALIDATED
"""

from .models import (
    SpaceEvent,
    SpaceEventType,
    space_created_event,
    space_updated_event,
    space_deleted_event,
    document_added_event,
    document_updated_event,
    document_removed_event,
    document_content_changed_event,
    cache_invalidated_event,
)
from .bus import (
    EventBus,
    HandlerRegistration,
    get_event_bus,
    reset_event_bus,
)

__all__ = [
    # Event models
    "SpaceEvent",
    "SpaceEventType",
    # Event factories
    "space_created_event",
    "space_updated_event",
    "space_deleted_event",
    "document_added_event",
    "document_updated_event",
    "document_removed_event",
    "document_content_changed_event",
    "cache_invalidated_event",
    # Event bus
    "EventBus",
    "HandlerRegistration",
    "get_event_bus",
    "reset_event_bus",
]
