//! Subprocess plugin protocol.
//!
//! Why this lives in `mcptest-core`: a polyglot escape hatch lets users
//! extend mcptest from any language that can read stdin and write stdout
//! (Go, Node, Ruby, Python, a shell script). The host side that spawns
//! and talks to the plugin is pure logic over `tokio::process`; keeping
//! it in core means future runners and matchers can adopt it without
//! depending on the CLI crate.
//!
//! The wire format is the JSON-RPC-like shape documented in
//! [`docs/reference/plugin-protocol.md`](https://mcptest.sh/reference/plugin-protocol).
//! One newline-delimited JSON object per request, one matching object
//! per response, correlated by the caller-assigned `id` field.
//!
//! ## Public surface
//!
//! - [`protocol`]: wire types ([`PluginRequest`], [`PluginResponse`],
//!   [`PluginError`]). Pure serde, no I/O.
//! - [`host`]: [`PluginHost`] that spawns the plugin on first use, keeps
//!   the child alive for the run's lifetime, and surfaces typed errors
//!   for the crash, timeout, and malformed-response cases.
//!
//! ## Scope (and what is deferred)
//!
//! v1.0 ships the spec, the wire types, the host client, and the
//! reference echo plugin. CLI plumbing for `--plugin <path>` and the
//! `imports.subprocess_matchers:` config block follow in a separate
//! ticket. WASM and embedded-Lua plugins are explicitly out of scope.

pub mod host;
pub mod protocol;

pub use host::{HostError, PluginHost, PluginHostConfig};
pub use protocol::{PluginError, PluginRequest, PluginResponse, PROTOCOL_VERSION};
