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>, ) -> ActionRequest
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 moreSource§impl Debug for ActionRequest
impl Debug for ActionRequest
Source§impl<'de> Deserialize<'de> for ActionRequest
impl<'de> Deserialize<'de> for ActionRequest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActionRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActionRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for ActionRequest
Source§impl PartialEq for ActionRequest
impl PartialEq for ActionRequest
Source§impl Serialize for ActionRequest
impl Serialize for ActionRequest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ActionRequest
Auto Trait Implementations§
impl Freeze for ActionRequest
impl RefUnwindSafe for ActionRequest
impl Send for ActionRequest
impl Sync for ActionRequest
impl Unpin for ActionRequest
impl UnsafeUnpin for ActionRequest
impl UnwindSafe for ActionRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more