Struct ModeConfig
pub struct ModeConfig {
pub mode: ExecutionMode,
pub tool_overrides: HashMap<String, ToolPermission>,
pub persist_mode: bool,
pub auto_fallback_on_error: bool,
}Expand description
Configuration for execution mode behavior
Fields§
§mode: ExecutionModeCurrent execution mode
tool_overrides: HashMap<String, ToolPermission>Custom tool overrides (tool_name -> permission)
persist_mode: boolWhether to persist mode across sessions
auto_fallback_on_error: boolAuto-switch to Agent mode after errors
Implementations§
§impl ModeConfig
impl ModeConfig
pub fn with_mode(mode: ExecutionMode) -> ModeConfig
pub fn with_mode(mode: ExecutionMode) -> ModeConfig
Create a new config with the specified mode
pub fn get_tool_permission(
&self,
tool_name: &str,
category: ToolCategory,
) -> ToolPermission
pub fn get_tool_permission( &self, tool_name: &str, category: ToolCategory, ) -> ToolPermission
Get the effective permission for a tool
pub fn set_tool_override(
&mut self,
tool_name: impl Into<String>,
permission: ToolPermission,
)
pub fn set_tool_override( &mut self, tool_name: impl Into<String>, permission: ToolPermission, )
Set a custom permission for a specific tool
pub fn remove_tool_override(&mut self, tool_name: &str)
pub fn remove_tool_override(&mut self, tool_name: &str)
Remove a custom permission override
pub fn is_tool_allowed(&self, tool_name: &str, category: ToolCategory) -> bool
pub fn is_tool_allowed(&self, tool_name: &str, category: ToolCategory) -> bool
Check if a tool is allowed (Allowed or RequiresConfirmation)
pub fn tool_requires_confirmation(
&self,
tool_name: &str,
category: ToolCategory,
) -> bool
pub fn tool_requires_confirmation( &self, tool_name: &str, category: ToolCategory, ) -> bool
Check if a tool requires confirmation
Trait Implementations§
§impl Clone for ModeConfig
impl Clone for ModeConfig
§fn clone(&self) -> ModeConfig
fn clone(&self) -> ModeConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ModeConfig
impl Debug for ModeConfig
§impl Default for ModeConfig
impl Default for ModeConfig
§fn default() -> ModeConfig
fn default() -> ModeConfig
Returns the “default value” for a type. Read more
§impl<'de> Deserialize<'de> for ModeConfig
impl<'de> Deserialize<'de> for ModeConfig
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModeConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModeConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for ModeConfig
impl Serialize for ModeConfig
§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,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ModeConfig
impl RefUnwindSafe for ModeConfig
impl Send for ModeConfig
impl Sync for ModeConfig
impl Unpin for ModeConfig
impl UnwindSafe for ModeConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().