pub trait ToolAdapter: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn display_name(&self) -> &str;
fn is_installed(&self) -> bool;
fn hooks_registered(&self) -> bool;
fn register_hooks(&self, bridge_script: &Path) -> Result<()>;
fn unregister_hooks(&self) -> Result<()>;
fn config_path(&self) -> Option<PathBuf>;
fn supported_events(&self) -> &[&str];
// Provided method
fn status(&self) -> ToolStatus { ... }
}Expand description
Adapter for an AI CLI tool’s hook system.
Each implementation knows how to detect whether a tool is installed, check if agent-hand hooks are registered, and register/unregister them.
Required Methods§
Sourcefn display_name(&self) -> &str
fn display_name(&self) -> &str
Human-readable display name (e.g. “Claude Code”, “Cursor”).
Sourcefn is_installed(&self) -> bool
fn is_installed(&self) -> bool
Check if this tool is installed on the system.
Sourcefn hooks_registered(&self) -> bool
fn hooks_registered(&self) -> bool
Check if agent-hand hooks are registered in this tool’s config.
Sourcefn register_hooks(&self, bridge_script: &Path) -> Result<()>
fn register_hooks(&self, bridge_script: &Path) -> Result<()>
Register agent-hand hooks into this tool’s config.
bridge_script is the absolute path to hook_event_bridge.sh.
Sourcefn unregister_hooks(&self) -> Result<()>
fn unregister_hooks(&self) -> Result<()>
Remove agent-hand hooks from this tool’s config.
Sourcefn config_path(&self) -> Option<PathBuf>
fn config_path(&self) -> Option<PathBuf>
Path to this tool’s configuration file (for display purposes).
Sourcefn supported_events(&self) -> &[&str]
fn supported_events(&self) -> &[&str]
Event types this tool supports.
Provided Methods§
Sourcefn status(&self) -> ToolStatus
fn status(&self) -> ToolStatus
Get the current status of this tool.