terminal-mcp 0.1.6

Model Context Protocol (MCP) server for long-lived shell execution.
// src/protocol/params/io.rs
use rmcp::schemars;
use serde::Deserialize;

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct SendParams {
    /// Content to send
    pub input: String,
    /// Target session identifier
    pub tag: String,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct OutputParams {
    /// Target session identifier
    pub tag: String,
    /// Idle timeout, in milliseconds, with a default value of 200 (if the terminal screen content changes, it refreshes and waits until there is no change within idle_ms. Usually, the default value is sufficient. If set, a range of 100–1000 is recommended.)
    pub idle_ms: Option<u64>,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct WaitForParams {
    /// Target session identifier
    pub tag: String,
    /// Substring expected to appear in stdout or stderr; returns immediately once matched
    pub substring: String,
    /// Maximum waiting time (milliseconds); returns all content collected so far, even if the pattern does not match. The default value is 5000. (Generally, the default value is sufficient. If you must set it, a range of 500 to 10000 is recommended.)
    pub timeout_ms: Option<u64>,
}