"""broker_core — Async-first message broker abstraction layer.

Public API.  Import from here in consuming code::

    from broker_core import create_kafka_client, KafkaClient, MessageBuilder
"""

from .clients.base import BrokerClient
from .clients.factory import (
    create_kafka_client,
    get_kafka_client,
    create_nats_client,
    get_nats_client,
    create_rabbitmq_client,
    get_rabbitmq_client,
)
from .clients.kafka import KafkaClient, KafkaConfig
from .message.builder import MessageBuilder, Message
from .message.result import (
    MessageResult,
    Subscription,
    ReceivedMessage,
)
from .message.routing import TopicPattern, PartitionTarget
from .topics import (
    Topic,
    BackfillJobPayload,
    CrawlerEventPayload,
    TelegramAnalyzeReadyPayload,
    TelegramCrawlMetricPayload,
    TelegramParsedMessagePayload,
    MessageDetailPayload,
    MessageReactionPayload,
    TelegramMessagePayload,
    TelegramParsedPayload,
    PipelineErrorPayload,
    TOPIC_PAYLOAD_MAP,
    get_payload_model,
)

__all__ = [
    # Base
    "BrokerClient",
    # Client
    "KafkaClient",
    "KafkaConfig",
    # Factory
    "create_kafka_client",
    "get_kafka_client",
    "create_nats_client",
    "get_nats_client",
    "create_rabbitmq_client",
    "get_rabbitmq_client",
    # Message model
    "MessageBuilder",
    "Message",
    # Result types
    "MessageResult",
    "Subscription",
    "ReceivedMessage",
    # Routing
    "TopicPattern",
    "PartitionTarget",
    # Topics
    "Topic",
    "BackfillJobPayload",
    "CrawlerEventPayload",
    "TelegramAnalyzeReadyPayload",
    "TelegramCrawlMetricPayload",
    "TelegramParsedMessagePayload",
    "MessageDetailPayload",
    "MessageReactionPayload",
    "TelegramMessagePayload",
    "TelegramParsedPayload",
    "PipelineErrorPayload",
    "TOPIC_PAYLOAD_MAP",
    "get_payload_model",
]
