pub struct AgentRegistry { /* private fields */ }Expand description
A registry of named agent templates.
Templates are loaded from TOML files and cached in memory. The registry is
not Sync by itself — wrap it in an Arc<RwLock<_>> if concurrent
access is needed (the Ring does this internally via
its own synchronization).
Implementations§
Source§impl AgentRegistry
impl AgentRegistry
Sourcepub fn load_templates(&mut self, agents_dir: &Path) -> PunchResult<()>
pub fn load_templates(&mut self, agents_dir: &Path) -> PunchResult<()>
Scan agents_dir for agent templates and load them.
The expected directory structure is:
agents/
coder/
agent.toml
reviewer/
agent.tomlEach agent.toml is deserialized into a FighterManifest. The
directory name is used as the template key (lowercased).
Sourcepub fn get_template(&self, name: &str) -> Option<&FighterManifest>
pub fn get_template(&self, name: &str) -> Option<&FighterManifest>
Retrieve a template by name (case-insensitive lookup).
Sourcepub fn list_templates(&self) -> Vec<String>
pub fn list_templates(&self) -> Vec<String>
List all registered template names.
Sourcepub fn register(&mut self, name: String, manifest: FighterManifest)
pub fn register(&mut self, name: String, manifest: FighterManifest)
Register a template manually (e.g. from an API call).
Sourcepub fn unregister(&mut self, name: &str) -> Option<FighterManifest>
pub fn unregister(&mut self, name: &str) -> Option<FighterManifest>
Remove a template by name.
Trait Implementations§
Source§impl Debug for AgentRegistry
impl Debug for AgentRegistry
Source§impl Default for AgentRegistry
impl Default for AgentRegistry
Source§fn default() -> AgentRegistry
fn default() -> AgentRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AgentRegistry
impl RefUnwindSafe for AgentRegistry
impl Send for AgentRegistry
impl Sync for AgentRegistry
impl Unpin for AgentRegistry
impl UnsafeUnpin for AgentRegistry
impl UnwindSafe for AgentRegistry
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