pub struct AgentPlugin { /* private fields */ }Expand description
Agent spawn/stop/list plugin.
Manages ralph agent processes spawned from within a room. Tracks PIDs,
provides /agent spawn, /agent list, and /agent stop commands.
Implementations§
Source§impl AgentPlugin
impl AgentPlugin
Sourcepub fn new(state_path: PathBuf, socket_path: PathBuf, log_dir: PathBuf) -> Self
pub fn new(state_path: PathBuf, socket_path: PathBuf, log_dir: PathBuf) -> Self
Create a new agent plugin.
Loads previously persisted agent state and prunes entries whose processes are no longer running.
Sourcepub fn default_commands() -> Vec<CommandInfo>
pub fn default_commands() -> Vec<CommandInfo>
Returns the command info for the TUI command palette without needing
an instantiated plugin. Used by all_known_commands().
Trait Implementations§
Source§impl Plugin for AgentPlugin
impl Plugin for AgentPlugin
Source§fn commands(&self) -> Vec<CommandInfo>
fn commands(&self) -> Vec<CommandInfo>
Commands this plugin handles. Each entry drives
/help output
and TUI autocomplete. Read moreSource§fn on_message(&self, msg: &Message)
fn on_message(&self, msg: &Message)
Called after every message is broadcast to the room. The default is a
no-op. Read more
Source§fn handle(&self, ctx: CommandContext) -> BoxFuture<'_, Result<PluginResult>>
fn handle(&self, ctx: CommandContext) -> BoxFuture<'_, Result<PluginResult>>
Handle an invocation of one of this plugin’s commands. Read more
Source§fn api_version(&self) -> u32
fn api_version(&self) -> u32
Plugin API version this plugin was written against. Read more
Source§fn min_protocol(&self) -> &str
fn min_protocol(&self) -> &str
Minimum
room-protocol crate version this plugin requires, as a
semver string (e.g. "3.1.0"). Read moreSource§fn on_user_join(&self, _user: &str)
fn on_user_join(&self, _user: &str)
Called after a user joins the room. The default is a no-op. Read more
Source§fn on_user_leave(&self, _user: &str)
fn on_user_leave(&self, _user: &str)
Called after a user leaves the room. The default is a no-op. Read more
Auto Trait Implementations§
impl Freeze for AgentPlugin
impl RefUnwindSafe for AgentPlugin
impl Send for AgentPlugin
impl Sync for AgentPlugin
impl Unpin for AgentPlugin
impl UnsafeUnpin for AgentPlugin
impl UnwindSafe for AgentPlugin
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