pub struct HookRunner { /* private fields */ }Expand description
Engine adapter around the standalone hook dispatcher.
bamboo-hooks owns matching and handler execution. This adapter translates
completed executions into engine checkpoints and lifecycle events.
Implementations§
Source§impl HookRunner
impl HookRunner
pub fn new() -> Self
pub fn register(&mut self, hook: Arc<dyn AgentHook>)
Sourcepub fn with_lifecycle_config(
&self,
config: &LifecycleHooksConfig,
fallback_cwd: Option<PathBuf>,
) -> Self
pub fn with_lifecycle_config( &self, config: &LifecycleHooksConfig, fallback_cwd: Option<PathBuf>, ) -> Self
Clone this registry and append configured handlers from one frozen config snapshot. The original registry remains reusable by future runs.
Sourcepub async fn run_hooks(
&self,
point: AgentHookPoint,
payload: &HookPayload,
session: &Session,
runtime_state: &mut AgentRuntimeState,
event_tx: Option<&Sender<AgentEvent>>,
) -> HookRunOutcome
pub async fn run_hooks( &self, point: AgentHookPoint, payload: &HookPayload, session: &Session, runtime_state: &mut AgentRuntimeState, event_tx: Option<&Sender<AgentEvent>>, ) -> HookRunOutcome
Run all hooks matching the given point.
Records checkpoints in runtime_state. Returns the first
Suspend or Abort result, or the aggregate result otherwise.
Sourcepub async fn run_observer_hooks(
&self,
point: AgentHookPoint,
payload: &HookPayload,
session: &Session,
runtime_state: &mut AgentRuntimeState,
event_tx: Option<&Sender<AgentEvent>>,
) -> HookRunOutcome
pub async fn run_observer_hooks( &self, point: AgentHookPoint, payload: &HookPayload, session: &Session, runtime_state: &mut AgentRuntimeState, event_tx: Option<&Sender<AgentEvent>>, ) -> HookRunOutcome
Run every matching hook while recording checkpoints/events, but never
short-circuit on a control decision. Observer/advisory seams such as
SessionEnd, PreCompact, and Notification use this so a command’s
control-shaped output cannot suppress later hooks or reverse an
operation that must proceed for correctness.
pub fn has_hooks_for(&self, point: AgentHookPoint) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for HookRunner
impl Clone for HookRunner
Source§fn clone(&self) -> HookRunner
fn clone(&self) -> HookRunner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more