do-memory-mcp 0.1.26

Model Context Protocol (MCP) server with secure code execution sandbox for AI agents
Documentation
//! WASM-based JavaScript execution sandbox
//!
//! This module provides a secure WebAssembly-based sandbox for executing JavaScript code
//! using rquickjs (QuickJS bindings for Rust). It offers superior performance and security
//! compared to process-based isolation.
//!
//! ## Security Architecture
//!
//! The WASM sandbox uses a capability-based security model:
//!
//! - **Memory Isolation**: Code runs in isolated WASM memory space
//! - **Capability System**: Fine-grained control over available APIs
//! - **Resource Limits**: Hardware-enforced memory and execution limits
//! - **No File System**: No filesystem access by default
//! - **No Network**: Network access disabled by default
//! - **Time Limits**: Execution fuel limits for infinite loop prevention
//!
//! ## Performance Benefits
//!
//! - **Fast Startup**: 5-20ms vs 50-150ms for Node.js
//! - **Low Memory**: 2-5MB vs 30-50MB per execution
//! - **High Concurrency**: 1200+ concurrent executions vs ~200
//!
//! ## Example
//!
//! ```no_run
//! use do_memory_mcp::wasm_sandbox::{WasmSandbox, WasmConfig};
//! use do_memory_mcp::types::ExecutionContext;
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//!     let sandbox = WasmSandbox::new(WasmConfig::restrictive())?;
//!     let code = "const result = 1 + 1; result";
//!     let context = ExecutionContext::new("test".to_string(), serde_json::json!({}));
//!
//!     let result = sandbox.execute(code, &context).await?;
//!     println!("Result: {:?}", result);
//!     Ok(())
//! }
//! ```

mod config;
mod executor;
mod sandbox;
mod types;

#[cfg(test)]
mod tests;

// Re-export public types
pub use config::WasmConfig;
pub use sandbox::WasmSandbox;
pub use types::{WasmHealthStatus, WasmMetrics};