//! mcp-host: Production-grade MCP server implementation
//!
//! This crate provides a comprehensive Model Context Protocol (MCP) server
//! implementation with sophisticated features like middleware chains, task management,
//! progress tracking, and more.

pub mod protocol;
pub mod content;
pub mod server;
pub mod managers;
pub mod registry;
pub mod transport;
pub mod logging;
pub mod utils;

// Re-export commonly used types
pub mod prelude {
    // Protocol types
    pub use crate::protocol::types::{JsonRpcRequest, JsonRpcResponse, JsonRpcError};
    pub use crate::protocol::capabilities::{ServerCapabilities, ClientCapabilities};

    // Content types and builders
    pub use crate::content::types::{Content, TextContent, ImageContent, AudioContent, ResourceLink};
    pub use crate::content::resource::ResourceContent;
    pub use crate::content::annotations::Annotations;
    pub use crate::content::builder::{text, image, audio, resource};

    // Server types
    pub use crate::server::core::Server;
    pub use crate::server::builder::{ServerBuilder, server};
    pub use crate::server::session::Session;
    pub use crate::server::visibility::{ExecutionContext, VisibilityContext, Environment, SimpleEnvironment};
    pub use crate::server::profile::SessionProfile;
    pub use crate::server::multiplexer::{
        ClientRequester, RequestMultiplexer, MultiplexerError, JsonRpcClientRequest,
        Root, ListRootsResult,
        SamplingMessage, SamplingContent, ModelPreferences, ModelHint,
        CreateMessageParams, CreateMessageResult,
    };

    // Registry types
    pub use crate::registry::tools::{Tool, ToolRegistry, ToolInfo, ToolError, ToolBreakerConfig, ToolHelpers};
    pub use crate::registry::resources::{Resource, ResourceTemplate, ResourceManager, ResourceInfo, ResourceTemplateInfo, ResourceError, ResourceRetryConfig};
    pub use crate::registry::prompts::{Prompt, PromptManager, PromptInfo, PromptArgument, PromptError, GetPromptResult};

    // Prompt message types
    pub use crate::content::prompt::{PromptMessage, PromptRole, PromptContent};

    // Middleware and resilience types
    pub use crate::server::middleware::{RateLimiter, RateLimiterConfig};

    // Logging types
    pub use crate::logging::{LogLevel, McpLogger, LoggerConfig, send_log_notification};

    // Progress tracking
    pub use crate::managers::progress::{ProgressTracker, ProgressToken};

    // Utility functions
    pub use crate::utils::{collect_files, byte_to_line_col, is_safe_path, base64_encode, base64_decode};

    // Transport types
    pub use crate::transport::traits::{Transport, TransportError, JsonRpcNotification, IncomingMessage};

    #[cfg(feature = "stdio")]
    pub use crate::transport::stdio::StdioTransport;

    #[cfg(feature = "http")]
    pub use crate::transport::http::{HttpTransport, HttpTransportConfig, HttpTransportError};
}
