mcp-execution-core 0.10.0

Core types, traits, and error handling for MCP execution
Documentation
//! Core types, traits, and errors for MCP Code Execution.
//!
//! This crate provides the foundational types and abstractions used across
//! all other crates in the MCP execution workspace.
//!
//! # Architecture
//!
//! The core consists of:
//! - Strong domain types (`ServerId`, `ToolName`)
//! - Error hierarchy with contextual information
//! - Server configuration with security validation
//! - Command validation utilities
//!
//! # Examples
//!
//! ```
//! use mcp_execution_core::{ServerConfig, ServerId};
//!
//! // Create a server configuration
//! let config = ServerConfig::builder()
//!     .command("docker".to_string())
//!     .arg("run".to_string())
//!     .env("LOG_LEVEL".to_string(), "debug".to_string())
//!     .build()
//!     .unwrap();
//!
//! // Server ID
//! let server_id = ServerId::new("github").unwrap();
//! ```

#![deny(unsafe_code)]
#![warn(missing_docs, missing_debug_implementations)]

mod command;
mod confinement;
mod error;
mod path;
mod redact;
mod server_config;
mod types;

pub mod cli;
pub mod metadata;
pub mod provenance;
pub mod untrusted;

// Re-export error types
pub use error::{Error, ResourceKind, Result};

// Re-export domain types
pub use types::{
    MAX_SERVER_ID_LENGTH, ServerId, ServerIdError, ServerIdSlugError, ToolName, ToolNameError,
    validate_server_id_slug,
};

// Re-export server configuration types
pub use server_config::{ServerConfig, ServerConfigBuilder, Transport};

// Re-export command validation
pub use command::{
    MAX_ARG_COUNT, MAX_ARG_LEN, MAX_ENV_COUNT, MAX_ENV_VALUE_LEN, MAX_HEADER_COUNT,
    MAX_HEADER_VALUE_LEN, MAX_URL_LEN, env_name_charset_desc, env_name_charset_pattern,
    forbidden_chars, forbidden_env_names, forbidden_env_prefix, validate_server_config,
    validate_url_scheme,
};

// Re-export path helpers shared by confinement checks
pub use path::{
    contains_parent_dir, first_disallowed_identifier_char, sanitize_path_for_error,
    validate_path_segment,
};

// Re-export the shared path-confinement walk
pub use confinement::{
    ConfinementError, ConfinementTarget, open_confined_write, resolve_confined_path,
    write_confined_file,
};

// Re-export Debug-redaction helpers shared by secret-shaped fields
pub use redact::{
    REDACTED_PLACEHOLDER, RedactedItems, RedactedMapValues, RedactedUrl, redact_urls_in_text,
};