//! Model Context Protocol (MCP) client implementation.
//!
//! ## Modules
//!
//! - [`core`]: MCP client infrastructure (manager, config, connections)
//! - [`inventory`]: Tool storage and indexing
//! - [`approval`]: Approval system for tool execution
//!
//! ## Shared Types
//!
//! - [`ToolAnnotations`]: Tool behavior hints (read_only, destructive, etc.)
//! - [`TenantContext`]: Per-tenant isolation and configuration

// Shared types (used across modules)
pub mod annotations;
pub mod error;
pub mod tenant;
pub mod transform;

// Subsystems
pub mod approval;
pub mod core;
pub mod inventory;
pub mod responses_bridge;

// Backward-compatible re-exports (old module paths)
// These allow `mcp::config::*` to continue working
pub use core::{config, pool as connection_pool};
// Re-export from core
pub use core::{
    ArgMappingConfig, BuiltinToolType, ConfigValidationError, HandlerRequestContext,
    LatencySnapshot, McpConfig, McpMetrics, McpOrchestrator, McpRequestContext, McpServerConfig,
    McpToolSession, McpTransport, MetricsSnapshot, PolicyConfig, PolicyDecisionConfig, PoolKey,
    RefreshRequest, ResponseFormatConfig, ServerPolicyConfig, SmgClientHandler, Tool,
    ToolCallResult, ToolConfig, ToolExecutionInput, ToolExecutionOutput, TrustLevelConfig,
};

// Re-export shared types
pub use annotations::{AnnotationType, ToolAnnotations};
// Re-export from approval
pub use approval::{
    ApprovalDecision, ApprovalKey, ApprovalManager, ApprovalMode, ApprovalOutcome, ApprovalParams,
    AuditEntry, AuditLog, DecisionResult, DecisionSource, McpApprovalRequest, McpApprovalResponse,
    PolicyDecision, PolicyEngine, PolicyRule, RuleCondition, RulePattern, ServerPolicy, TrustLevel,
};
pub use error::{ApprovalError, McpError, McpResult};
// Re-export from inventory
pub use inventory::{
    AliasTarget, ArgMapping, QualifiedToolName, ToolCategory, ToolEntry, ToolInventory,
};
pub use responses_bridge::{
    build_chat_function_tools, build_chat_function_tools_with_names, build_function_tools_json,
    build_function_tools_json_with_names, build_mcp_list_tools_item, build_mcp_list_tools_json,
    build_mcp_tool_infos, build_response_tools, build_response_tools_with_names,
};
pub use tenant::{SessionId, TenantContext, TenantId};
// Re-export from transform
pub use transform::{ResponseFormat, ResponseTransformer};
