pub struct SubagentConfig {Show 14 fields
pub name: String,
pub description: String,
pub mode_override: Option<OperatingMode>,
pub intelligence: IntelligenceLevel,
pub tools: HashMap<String, ToolPermission>,
pub prompt: String,
pub parameters: Vec<ParameterDefinition>,
pub template: Option<String>,
pub timeout_seconds: u64,
pub chainable: bool,
pub parallelizable: bool,
pub metadata: HashMap<String, Value>,
pub file_patterns: Vec<String>,
pub tags: Vec<String>,
}Expand description
Complete configuration for a subagent
Fields§
§name: StringAgent name (must be unique)
description: StringHuman-readable description
mode_override: Option<OperatingMode>Override the operating mode when this agent is active
intelligence: IntelligenceLevelIntelligence level for AST processing and embeddings
tools: HashMap<String, ToolPermission>Tools and their permissions
prompt: StringCustom prompt template for this agent
parameters: Vec<ParameterDefinition>Parameter definitions
template: Option<String>Template this agent inherits from (optional)
timeout_seconds: u64Maximum execution time in seconds
chainable: boolWhether this agent can be chained with others
parallelizable: boolWhether this agent can run in parallel with others
metadata: HashMap<String, Value>Custom metadata for the agent
file_patterns: Vec<String>File patterns this agent is specialized for
Tags for categorizing agents
Implementations§
Source§impl SubagentConfig
impl SubagentConfig
Sourcepub fn from_file(path: &PathBuf) -> Result<Self, SubagentError>
pub fn from_file(path: &PathBuf) -> Result<Self, SubagentError>
Load a subagent configuration from a TOML file
Sourcepub fn to_file(&self, path: &PathBuf) -> Result<(), SubagentError>
pub fn to_file(&self, path: &PathBuf) -> Result<(), SubagentError>
Save this configuration to a TOML file
Sourcepub fn validate(&self) -> Result<(), SubagentError>
pub fn validate(&self) -> Result<(), SubagentError>
Validate the configuration
Sourcepub fn is_tool_allowed(&self, tool_name: &str) -> bool
pub fn is_tool_allowed(&self, tool_name: &str) -> bool
Check if a tool is allowed for this agent
Sourcepub fn get_tool_restrictions(
&self,
tool_name: &str,
) -> Option<&HashMap<String, String>>
pub fn get_tool_restrictions( &self, tool_name: &str, ) -> Option<&HashMap<String, String>>
Get tool restrictions for a specific tool
Sourcepub fn effective_mode(&self, current_mode: OperatingMode) -> OperatingMode
pub fn effective_mode(&self, current_mode: OperatingMode) -> OperatingMode
Get the effective operating mode (considering override)
Sourcepub fn matches_file(&self, file_path: &Path) -> bool
pub fn matches_file(&self, file_path: &Path) -> bool
Check if this agent matches the given file patterns
Trait Implementations§
Source§impl Clone for SubagentConfig
impl Clone for SubagentConfig
Source§fn clone(&self) -> SubagentConfig
fn clone(&self) -> SubagentConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubagentConfig
impl Debug for SubagentConfig
Source§impl<'de> Deserialize<'de> for SubagentConfig
impl<'de> Deserialize<'de> for SubagentConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SubagentConfig
impl PartialEq for SubagentConfig
Source§impl Serialize for SubagentConfig
impl Serialize for SubagentConfig
impl Eq for SubagentConfig
impl StructuralPartialEq for SubagentConfig
Auto Trait Implementations§
impl Freeze for SubagentConfig
impl RefUnwindSafe for SubagentConfig
impl Send for SubagentConfig
impl Sync for SubagentConfig
impl Unpin for SubagentConfig
impl UnwindSafe for SubagentConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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