Stdio-first MCP servers exit the moment they see EOF on fd 0. Under the launchd agent the daemon's stdin is /dev/null, so a server that also speaks HTTP still shuts down seconds after binding its port, and there was no way to ask xy for anything else. Adds a per-server `stdin` mode: `inherit` (the default, unchanged), `null`, or `keep-open`. Under `keep-open` the child gets a pipe whose write end RealChild holds and never writes to, so a read blocks. The handle has to live on RealChild rather than on the TokioChild: `Child::wait()` opens with `drop(self.stdin.take())`, so leaving it where tokio put it reproduces the original bug the instant supervision starts. Refs #2 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TWLFEoRaRafJm1SpdhWQ6F
16 lines
454 B
Rust
16 lines
454 B
Rust
//! Wire types and config schema shared between the xy daemon and CLI.
|
|
|
|
pub mod config;
|
|
pub mod error;
|
|
pub mod kdl_parse;
|
|
pub mod rpc;
|
|
pub mod state;
|
|
|
|
pub use config::{
|
|
RestartConfig, RestartPolicy, ServerConfig, StdinMode, StopConfig, WaitCondition,
|
|
WaitForConfig, default_wait_interval, default_wait_timeout,
|
|
};
|
|
pub use error::{ConfigError, RpcErrorCode};
|
|
pub use kdl_parse::{load_all_configs, parse_server_config};
|
|
pub use state::ServerState;
|