"""This module defines the types for the MCP protocol.

Check the latest schema at:
https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/draft/schema.json
"""

# Re-export everything from _types for backward compatibility
from mcp_types._types import (
    CLIENT_CAPABILITIES_META_KEY,
    CLIENT_INFO_META_KEY,
    CORE_RESULT_TYPES,
    DEFAULT_NEGOTIATED_VERSION,
    LOG_LEVEL_META_KEY,
    PROTOCOL_VERSION_META_KEY,
    Annotations,
    AudioContent,
    BaseMetadata,
    BlobResourceContents,
    CacheableResult,
    CallToolRequest,
    CallToolRequestParams,
    CallToolResult,
    CancelledNotification,
    CancelledNotificationParams,
    CancelTaskRequest,
    CancelTaskRequestParams,
    CancelTaskResult,
    ClientCapabilities,
    ClientNotification,
    ClientRequest,
    ClientResult,
    ClientTasksCapability,
    ClientTasksRequestsCapability,
    CompleteRequest,
    CompleteRequestParams,
    CompleteResult,
    Completion,
    CompletionArgument,
    CompletionContext,
    CompletionsCapability,
    ContentBlock,
    CreateMessageRequest,
    CreateMessageRequestParams,
    CreateMessageResult,
    CreateMessageResultWithTools,
    CreateTaskResult,
    DiscoverRequest,
    DiscoverResult,
    ElicitationCapability,
    ElicitationRequiredErrorData,
    ElicitCompleteNotification,
    ElicitCompleteNotificationParams,
    ElicitRequest,
    ElicitRequestedSchema,
    ElicitRequestFormParams,
    ElicitRequestParams,
    ElicitRequestURLParams,
    ElicitResult,
    EmbeddedResource,
    EmptyResult,
    FormElicitationCapability,
    GetPromptRequest,
    GetPromptRequestParams,
    GetPromptResult,
    GetTaskPayloadRequest,
    GetTaskPayloadRequestParams,
    GetTaskPayloadResult,
    GetTaskRequest,
    GetTaskRequestParams,
    GetTaskResult,
    Icon,
    IconTheme,
    ImageContent,
    Implementation,
    IncludeContext,
    InitializedNotification,
    InitializeRequest,
    InitializeRequestParams,
    InitializeResult,
    InputRequest,
    InputRequests,
    InputRequiredResult,
    InputResponse,
    InputResponseRequestParams,
    InputResponses,
    ListPromptsRequest,
    ListPromptsResult,
    ListResourcesRequest,
    ListResourcesResult,
    ListResourceTemplatesRequest,
    ListResourceTemplatesResult,
    ListRootsRequest,
    ListRootsResult,
    ListTasksRequest,
    ListTasksResult,
    ListToolsRequest,
    ListToolsResult,
    LoggingCapability,
    LoggingLevel,
    LoggingMessageNotification,
    LoggingMessageNotificationParams,
    MissingRequiredClientCapabilityErrorData,
    ModelHint,
    ModelPreferences,
    Notification,
    NotificationParams,
    PaginatedRequest,
    PaginatedRequestParams,
    PaginatedResult,
    PingRequest,
    ProgressNotification,
    ProgressNotificationParams,
    ProgressToken,
    Prompt,
    PromptArgument,
    PromptListChangedNotification,
    PromptMessage,
    PromptReference,
    PromptsCapability,
    ReadResourceRequest,
    ReadResourceRequestParams,
    ReadResourceResult,
    RelatedTaskMetadata,
    Request,
    RequestParams,
    RequestParamsMeta,
    Resource,
    ResourceContents,
    ResourceLink,
    ResourceListChangedNotification,
    ResourcesCapability,
    ResourceTemplate,
    ResourceTemplateReference,
    ResourceUpdatedNotification,
    ResourceUpdatedNotificationParams,
    Result,
    ResultType,
    Role,
    Root,
    RootsCapability,
    RootsListChangedNotification,
    SamplingCapability,
    SamplingContent,
    SamplingContextCapability,
    SamplingMessage,
    SamplingMessageContentBlock,
    SamplingToolsCapability,
    ServerCapabilities,
    ServerNotification,
    ServerRequest,
    ServerResult,
    ServerTasksCapability,
    ServerTasksRequestsCapability,
    SetLevelRequest,
    SetLevelRequestParams,
    StopReason,
    SubscribeRequest,
    SubscribeRequestParams,
    SubscriptionFilter,
    SubscriptionsAcknowledgedNotification,
    SubscriptionsAcknowledgedNotificationParams,
    SubscriptionsListenRequest,
    SubscriptionsListenRequestParams,
    SubscriptionsListenResult,
    Task,
    TaskMetadata,
    TasksCallCapability,
    TasksCancelCapability,
    TasksCreateElicitationCapability,
    TasksCreateMessageCapability,
    TasksElicitationCapability,
    TasksListCapability,
    TasksSamplingCapability,
    TaskStatus,
    TaskStatusNotification,
    TaskStatusNotificationParams,
    TasksToolsCapability,
    TextContent,
    TextResourceContents,
    Tool,
    ToolAnnotations,
    ToolChoice,
    ToolExecution,
    ToolListChangedNotification,
    ToolResultContent,
    ToolsCapability,
    ToolUseContent,
    UnsubscribeRequest,
    UnsubscribeRequestParams,
    UnsupportedProtocolVersionErrorData,
    UrlElicitationCapability,
    client_notification_adapter,
    client_request_adapter,
    client_result_adapter,
    server_notification_adapter,
    server_request_adapter,
    server_result_adapter,
)

# Re-export JSONRPC types
from mcp_types.jsonrpc import (
    CONNECTION_CLOSED,
    HEADER_MISMATCH,
    INTERNAL_ERROR,
    INVALID_PARAMS,
    INVALID_REQUEST,
    JSONRPC_VERSION,
    METHOD_NOT_FOUND,
    MISSING_REQUIRED_CLIENT_CAPABILITY,
    PARSE_ERROR,
    REQUEST_TIMEOUT,
    UNSUPPORTED_PROTOCOL_VERSION,
    URL_ELICITATION_REQUIRED,
    ErrorData,
    JSONRPCError,
    JSONRPCMessage,
    JSONRPCNotification,
    JSONRPCRequest,
    JSONRPCResponse,
    RequestId,
    jsonrpc_message_adapter,
)
from mcp_types.version import LATEST_PROTOCOL_VERSION

__all__ = [
    # Protocol version constants
    "LATEST_PROTOCOL_VERSION",
    "DEFAULT_NEGOTIATED_VERSION",
    # Reserved request _meta keys
    "PROTOCOL_VERSION_META_KEY",
    "CLIENT_INFO_META_KEY",
    "CLIENT_CAPABILITIES_META_KEY",
    "LOG_LEVEL_META_KEY",
    # Type aliases and variables
    "CORE_RESULT_TYPES",
    "ContentBlock",
    "ElicitRequestedSchema",
    "ElicitRequestParams",
    "IncludeContext",
    "InputRequest",
    "InputRequests",
    "InputResponse",
    "InputResponses",
    "LoggingLevel",
    "ProgressToken",
    "ResultType",
    "Role",
    "SamplingContent",
    "SamplingMessageContentBlock",
    "StopReason",
    "TaskStatus",
    # Base classes
    "BaseMetadata",
    "Request",
    "Notification",
    "Result",
    "RequestParams",
    "RequestParamsMeta",
    "InputResponseRequestParams",
    "NotificationParams",
    "PaginatedRequest",
    "PaginatedRequestParams",
    "PaginatedResult",
    "CacheableResult",
    "EmptyResult",
    # Capabilities
    "ClientCapabilities",
    "ClientTasksCapability",
    "ClientTasksRequestsCapability",
    "CompletionsCapability",
    "ElicitationCapability",
    "FormElicitationCapability",
    "LoggingCapability",
    "PromptsCapability",
    "ResourcesCapability",
    "RootsCapability",
    "SamplingCapability",
    "SamplingContextCapability",
    "SamplingToolsCapability",
    "ServerCapabilities",
    "ServerTasksCapability",
    "ServerTasksRequestsCapability",
    "TasksCallCapability",
    "TasksCancelCapability",
    "TasksCreateElicitationCapability",
    "TasksCreateMessageCapability",
    "TasksElicitationCapability",
    "TasksListCapability",
    "TasksSamplingCapability",
    "TasksToolsCapability",
    "ToolsCapability",
    "UrlElicitationCapability",
    # Content types
    "Annotations",
    "AudioContent",
    "BlobResourceContents",
    "EmbeddedResource",
    "Icon",
    "IconTheme",
    "ImageContent",
    "ResourceContents",
    "ResourceLink",
    "TextContent",
    "TextResourceContents",
    "ToolResultContent",
    "ToolUseContent",
    # Entity types
    "Completion",
    "CompletionArgument",
    "CompletionContext",
    "Implementation",
    "ModelHint",
    "ModelPreferences",
    "Prompt",
    "PromptArgument",
    "PromptMessage",
    "PromptReference",
    "Resource",
    "ResourceTemplate",
    "ResourceTemplateReference",
    "Root",
    "SamplingMessage",
    "SubscriptionFilter",
    "Task",
    "TaskMetadata",
    "RelatedTaskMetadata",
    "Tool",
    "ToolAnnotations",
    "ToolChoice",
    "ToolExecution",
    # Requests
    "CallToolRequest",
    "CallToolRequestParams",
    "CompleteRequest",
    "CompleteRequestParams",
    "CancelTaskRequest",
    "CancelTaskRequestParams",
    "CreateMessageRequest",
    "CreateMessageRequestParams",
    "DiscoverRequest",
    "ElicitRequest",
    "ElicitRequestFormParams",
    "ElicitRequestURLParams",
    "GetPromptRequest",
    "GetPromptRequestParams",
    "GetTaskPayloadRequest",
    "GetTaskPayloadRequestParams",
    "GetTaskRequest",
    "GetTaskRequestParams",
    "InitializeRequest",
    "InitializeRequestParams",
    "ListPromptsRequest",
    "ListResourcesRequest",
    "ListResourceTemplatesRequest",
    "ListRootsRequest",
    "ListTasksRequest",
    "ListToolsRequest",
    "PingRequest",
    "ReadResourceRequest",
    "ReadResourceRequestParams",
    "SetLevelRequest",
    "SetLevelRequestParams",
    "SubscribeRequest",
    "SubscribeRequestParams",
    "SubscriptionsListenRequest",
    "SubscriptionsListenRequestParams",
    "UnsubscribeRequest",
    "UnsubscribeRequestParams",
    # Results
    "CallToolResult",
    "CancelTaskResult",
    "CompleteResult",
    "CreateMessageResult",
    "CreateMessageResultWithTools",
    "CreateTaskResult",
    "DiscoverResult",
    "ElicitResult",
    "ElicitationRequiredErrorData",
    "GetPromptResult",
    "GetTaskPayloadResult",
    "GetTaskResult",
    "InitializeResult",
    "InputRequiredResult",
    "ListPromptsResult",
    "ListResourcesResult",
    "ListResourceTemplatesResult",
    "ListRootsResult",
    "ListTasksResult",
    "ListToolsResult",
    "ReadResourceResult",
    "SubscriptionsListenResult",
    # Error data payloads
    "MissingRequiredClientCapabilityErrorData",
    "UnsupportedProtocolVersionErrorData",
    # Notifications
    "CancelledNotification",
    "CancelledNotificationParams",
    "ElicitCompleteNotification",
    "ElicitCompleteNotificationParams",
    "InitializedNotification",
    "LoggingMessageNotification",
    "LoggingMessageNotificationParams",
    "ProgressNotification",
    "ProgressNotificationParams",
    "PromptListChangedNotification",
    "ResourceListChangedNotification",
    "ResourceUpdatedNotification",
    "ResourceUpdatedNotificationParams",
    "RootsListChangedNotification",
    "SubscriptionsAcknowledgedNotification",
    "SubscriptionsAcknowledgedNotificationParams",
    "TaskStatusNotification",
    "TaskStatusNotificationParams",
    "ToolListChangedNotification",
    # Union types for request/response routing
    "ClientNotification",
    "ClientRequest",
    "ClientResult",
    "ServerNotification",
    "ServerRequest",
    "ServerResult",
    # Type adapters
    "client_notification_adapter",
    "client_request_adapter",
    "client_result_adapter",
    "server_notification_adapter",
    "server_request_adapter",
    "server_result_adapter",
    # JSON-RPC types
    "CONNECTION_CLOSED",
    "HEADER_MISMATCH",
    "INTERNAL_ERROR",
    "INVALID_PARAMS",
    "INVALID_REQUEST",
    "JSONRPC_VERSION",
    "METHOD_NOT_FOUND",
    "MISSING_REQUIRED_CLIENT_CAPABILITY",
    "PARSE_ERROR",
    "REQUEST_TIMEOUT",
    "UNSUPPORTED_PROTOCOL_VERSION",
    "URL_ELICITATION_REQUIRED",
    "ErrorData",
    "JSONRPCError",
    "JSONRPCMessage",
    "JSONRPCNotification",
    "JSONRPCRequest",
    "JSONRPCResponse",
    "RequestId",
    "jsonrpc_message_adapter",
]
