Skip to main content
Glama

microsandbox

by microsandbox
monitor.rs1.43 kB
use async_trait::async_trait; use tokio::{ fs::File, io::unix::AsyncFd, process::{ChildStderr, ChildStdin, ChildStdout}, }; use crate::MicrosandboxUtilsResult; //-------------------------------------------------------------------------------------------------- // Types //-------------------------------------------------------------------------------------------------- /// The type of child IO to use. pub enum ChildIo { /// A pseudo-TTY. TTY { /// The master read end of the pseudo-TTY. master_read: AsyncFd<std::fs::File>, /// The master write end of the pseudo-TTY. master_write: File, }, /// Pipes for stdin, stdout, and stderr. Piped { /// The stdin pipe. stdin: Option<ChildStdin>, /// The stdout pipe. stdout: Option<ChildStdout>, /// The stderr pipe. stderr: Option<ChildStderr>, }, } //-------------------------------------------------------------------------------------------------- // Traits //-------------------------------------------------------------------------------------------------- /// A trait for monitoring processes #[async_trait] pub trait ProcessMonitor { /// Start monitoring a process async fn start(&mut self, pid: u32, child_io: ChildIo) -> MicrosandboxUtilsResult<()>; /// Stop monitoring async fn stop(&mut self) -> MicrosandboxUtilsResult<()>; }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/microsandbox/microsandbox'

If you have feedback or need assistance with the MCP directory API, please join our Discord server