//! MCP protocol client: handshake, request/response correlation,
//! notification routing, and graceful shutdown.
//!
//! Why a dedicated module here: ADR-0002 settled the wire-types story
//! (track upstream `rust-mcp-schema` later). For the  milestone we
//! own only the JSON-RPC plumbing: monotonic request IDs, an in-flight
//! map keyed by ID, a router for server-initiated notifications and
//! requests, and a typed error surface that callers can match on. The
//! transport is supplied through a small [`Transport`] trait so the
//! Client can drive stdio, streamable HTTP, or SSE behind the same API.
//!
//! ADR-0002 explicitly rejected a general-purpose `Transport` trait for
//! the engine. The trait here is the smallest possible abstraction the
//! Client needs (send one envelope, receive one envelope, shut down)
//! and lives under `protocol/` precisely because that is where it is
//! consumed. Concrete transports remain sibling modules and stay free of
//! the trait if they want to expose their own native API.
//!
//! ## Public surface
//!
//! - [`Client`]: the high-level handle. Drives `initialize`, sends
//!   requests, dispatches notifications and server-initiated requests.
//! - [`Transport`]: the minimal byte pipe the Client drives.
//! - [`ProtocolVersion`]: the four spec revisions the v1 engine accepts.
//! - [`ClientCapabilities`] / [`ServerCapabilities`]: opaque JSON
//!   capability blocks exchanged during the handshake. Treated as
//!   pass-through values until  pulls in the upstream schema.
//! - [`ProtocolError`]: typed errors raised by every protocol op.
//! - [`ProtocolViolation`] / [`ProtocolViolationSummary`]: evidence of
//!   peer misbehavior (string-id echoes, orphan responses, malformed
//!   frames) recorded by the pump instead of dropped (WOR-1311).

mod client;
pub mod elicitation;
mod error;
mod message;
mod request_meta;
pub mod tasks;
mod transport;
mod violations;

pub use client::{
    Client, ClientBuilder, ClientCapabilities, InitializeOutcome, PendingRequest,
    ServerCapabilities, ServerRequestHandler,
};
pub use elicitation::{
    build_retry_params, recognize_input_required, InputRequest, InputRequiredResult, InputResponse,
    RequestState,
};
pub use error::ProtocolError;
pub use message::{JsonRpcErrorBody, JsonRpcId, JsonRpcMessage, MessageKind, ProtocolVersion};
pub use request_meta::build_request_meta;
pub use tasks::{
    create_task_result, parse_task_get, recognize_task_handle, task_get_result, Task,
    TaskGetResult, TaskStatus,
};
pub use transport::{Transport, TransportReceiver, TransportSendError, TransportSender};
pub use violations::{ProtocolViolation, ProtocolViolationKind, ProtocolViolationSummary};
