pub struct ActionRequest {
pub tool: String,
pub category: ToolCategory,
pub summary: String,
pub command: Option<String>,
pub path: Option<String>,
pub arguments: Option<Value>,
pub mcp_read_only_hint: bool,
pub cwd: Option<PathBuf>,
}Fields§
§tool: String§category: ToolCategory§summary: String§command: Option<String>§path: Option<String>§arguments: Option<Value>Complete structured tool arguments. Treat as untrusted input and redact before sending it to an external classifier or persistence sink.
mcp_read_only_hint: boolFor ToolCategory::Mcp only: the server-advertised readOnlyHint.
UNTRUSTED (servers self-declare), so it can only keep a read at the
permissiveness every MCP tool had before the external-writes floor
existed — it never grants more than the safety mode gives. false
(the default, and every unannotated tool) means write-shaped and
subject to the floor.
cwd: Option<PathBuf>The directory command will actually run in, when that is not the
project root — i.e. an explicit working_dir argument.
Relative paths in a command resolve against THIS, not the project root.
The gate used to match the plan-file carve-out against the project root
while the shell ran the command elsewhere, so
execute_command{command: "echo … > .mermaid/plans/x.md", working_dir: "other/tree"} was approved as a plan write and landed
somewhere else entirely. Carrying the cwd on the request keeps the
wrong value out of reach: see ActionRequest::resolve_dir.
Implementations§
Source§impl ActionRequest
impl ActionRequest
pub fn new( tool: impl Into<String>, category: ToolCategory, summary: impl Into<String>, ) -> Self
Sourcepub fn resolve_dir<'a>(&'a self, fallback: &'a Path) -> &'a Path
pub fn resolve_dir<'a>(&'a self, fallback: &'a Path) -> &'a Path
The directory command-relative paths must resolve against: the
request’s own cwd when it has one, else fallback (the project root).
Trait Implementations§
Source§impl Clone for ActionRequest
impl Clone for ActionRequest
Source§fn clone(&self) -> ActionRequest
fn clone(&self) -> ActionRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more