Skip to main content

Module command_spec

Module command_spec 

Source
Expand description

The allow.commands capability schema and ${var} resolution.

A plugin declares each command it may run; the handler can only invoke declared names (default-deny). A spec is either a shorthand string (a sh -c line) or an object with explicit execution policy. Resolution is strict: every ${placeholder} must have a supplied value and every value must be a scalar — a typo fails loudly instead of expanding to empty.

Deserializer-agnostic by hand (no #[serde(untagged)]): the same types are read from serde_json (the MCP manifest round-trip) and from rquickjs-serde (a defineTool call), so the impls only use deserialize_any + visitors, which both back-ends support.

Structs§

CommandSpec
One declared command. Constructed only via deserialization (manifest or defineTool); never hand-built by a handler.
ResolvedCommand

Enums§

CommandOutput
How commands.run interprets the command’s stdout.
CommandRun
What to execute. A string runs through sh -c (shell features live); an array is executed directly with no shell (each element is one argv entry — no quoting, no metacharacter interpretation).
ResolvedExec
A command resolved against caller vars: ready to spawn.