pub struct AgentDefinitions { /* private fields */ }Expand description
A read-only registry of named agent definitions loaded from disk.
Usage:
let defs = AgentDefinitions::load(Path::new("/workspace"))?;
if let Some(d) = defs.get("code-reviewer") {
println!("system_prompt = {}", d.system_prompt);
}Implementations§
Source§impl AgentDefinitions
impl AgentDefinitions
Sourcepub fn load(workspace_root: &Path) -> Result<Self>
pub fn load(workspace_root: &Path) -> Result<Self>
Walk .recursive/agents/**/*.md, parse each file, and return a
populated registry. Returns an empty registry (not an error) when
the directory does not exist — missing dir is a silent no-op.
Sourcepub fn get(&self, name: &str) -> Option<&AgentDefinition>
pub fn get(&self, name: &str) -> Option<&AgentDefinition>
Resolve a named definition.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&String, &AgentDefinition)>
pub fn iter(&self) -> impl Iterator<Item = (&String, &AgentDefinition)>
Iterate over all definitions.
Trait Implementations§
Source§impl Clone for AgentDefinitions
impl Clone for AgentDefinitions
Source§impl Debug for AgentDefinitions
impl Debug for AgentDefinitions
Auto Trait Implementations§
impl Freeze for AgentDefinitions
impl RefUnwindSafe for AgentDefinitions
impl Send for AgentDefinitions
impl Sync for AgentDefinitions
impl Unpin for AgentDefinitions
impl UnsafeUnpin for AgentDefinitions
impl UnwindSafe for AgentDefinitions
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.