Skip to main content

ToolAdapter

Trait ToolAdapter 

Source
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§

Source

fn name(&self) -> &str

Internal identifier (e.g. “claude”, “cursor”).

Source

fn display_name(&self) -> &str

Human-readable display name (e.g. “Claude Code”, “Cursor”).

Source

fn is_installed(&self) -> bool

Check if this tool is installed on the system.

Source

fn hooks_registered(&self) -> bool

Check if agent-hand hooks are registered in this tool’s config.

Source

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.

Source

fn unregister_hooks(&self) -> Result<()>

Remove agent-hand hooks from this tool’s config.

Source

fn config_path(&self) -> Option<PathBuf>

Path to this tool’s configuration file (for display purposes).

Source

fn supported_events(&self) -> &[&str]

Event types this tool supports.

Provided Methods§

Source

fn status(&self) -> ToolStatus

Get the current status of this tool.

Implementors§