pub struct CommandPalaceRunner { /* private fields */ }Expand description
Runs program args... per request: the JSON request goes to its stdin,
the JSON response is read from its stdout.
Intended to be built by the host as docker <hardened palace run args>,
so palace code runs only inside a locked-down container as mcp-palace.
The child gets a cleared environment holding only PATH (a standard
default when the host has none), LANG and TZ, plus whatever the
caller adds explicitly with Self::with_env.
Defaults: stdout capped at DEFAULT_MAX_OUTPUT_BYTES, at most
DEFAULT_MAX_CONCURRENCY calls in flight (excess callers wait up to
timeout, then get PalaceError::Busy).
Killing the client process on timeout does not necessarily stop a container it started; the container side must bound its own runtime.
Implementations§
Source§impl CommandPalaceRunner
impl CommandPalaceRunner
Sourcepub fn new(program: PathBuf, args: Vec<String>, timeout: Duration) -> Self
pub fn new(program: PathBuf, args: Vec<String>, timeout: Duration) -> Self
Runner for program args... with a per-call timeout.
Sourcepub fn with_env(
self,
key: impl Into<OsString>,
value: impl Into<OsString>,
) -> Self
pub fn with_env( self, key: impl Into<OsString>, value: impl Into<OsString>, ) -> Self
Add (or replace) one environment variable of the child, e.g.
DOCKER_HOST for a rootless daemon. Never pass secrets this way.
Sourcepub fn with_max_output(self, bytes: usize) -> Self
pub fn with_max_output(self, bytes: usize) -> Self
Override the stdout cap (bytes, at least 1).
Sourcepub fn with_max_concurrency(self, n: usize) -> Self
pub fn with_max_concurrency(self, n: usize) -> Self
Override the concurrency limit (at least 1).
Sourcepub fn args(&self) -> &[String]
pub fn args(&self) -> &[String]
The arguments passed to Self::program.