"""Discord integration scaffold."""

from .adapter import DiscordChatAdapter, DiscordTextRenderer
from .allowlist import DiscordAllowlist, allowlist_allows
from .chat_state_store import (
    DiscordChatStateStore,
    discord_conversation_key,
    parse_discord_conversation_key,
)
from .command_registry import sync_commands
from .commands import build_application_commands
from .config import (
    DEFAULT_STATE_FILE,
    DiscordBotConfig,
    DiscordBotConfigError,
    DiscordBotMediaConfig,
    DiscordCommandRegistration,
)
from .constants import (
    DISCORD_API_BASE_URL,
    DISCORD_GATEWAY_URL,
    DISCORD_INTENT_GUILD_MESSAGES,
    DISCORD_INTENT_GUILDS,
    DISCORD_INTENT_MESSAGE_CONTENT,
    DISCORD_MAX_MESSAGE_LENGTH,
)
from .doctor import discord_doctor_checks
from .errors import DiscordAPIError, DiscordConfigError, DiscordError
from .gateway import (
    DiscordGatewayClient,
    GatewayFrame,
    build_identify_payload,
    calculate_reconnect_backoff,
    parse_gateway_frame,
)
from .interactions import (
    extract_channel_id,
    extract_command_path_and_options,
    extract_guild_id,
    extract_interaction_id,
    extract_interaction_token,
    extract_user_id,
)
from .outbox import DiscordOutboxManager
from .rest import DiscordRestClient
from .service import DiscordBotService, create_discord_bot_service
from .state import DiscordStateStore, OutboxRecord

__all__ = [
    "DEFAULT_STATE_FILE",
    "DISCORD_API_BASE_URL",
    "DISCORD_GATEWAY_URL",
    "DISCORD_INTENT_GUILDS",
    "DISCORD_INTENT_GUILD_MESSAGES",
    "DISCORD_INTENT_MESSAGE_CONTENT",
    "DISCORD_MAX_MESSAGE_LENGTH",
    "DiscordAPIError",
    "DiscordAllowlist",
    "DiscordBotConfig",
    "DiscordBotConfigError",
    "DiscordBotMediaConfig",
    "DiscordBotService",
    "DiscordChatAdapter",
    "DiscordChatStateStore",
    "DiscordCommandRegistration",
    "DiscordConfigError",
    "DiscordError",
    "DiscordGatewayClient",
    "DiscordOutboxManager",
    "DiscordRestClient",
    "DiscordStateStore",
    "DiscordTextRenderer",
    "GatewayFrame",
    "OutboxRecord",
    "allowlist_allows",
    "build_application_commands",
    "build_identify_payload",
    "calculate_reconnect_backoff",
    "create_discord_bot_service",
    "discord_conversation_key",
    "discord_doctor_checks",
    "extract_channel_id",
    "extract_command_path_and_options",
    "extract_guild_id",
    "extract_interaction_id",
    "extract_interaction_token",
    "extract_user_id",
    "parse_discord_conversation_key",
    "parse_gateway_frame",
    "sync_commands",
]
