1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Astrid Hooks - User-defined extension points for the Astrid runtime.
//!
//! This crate provides a flexible hook system that allows users to extend
//! the behavior of the Astrid runtime at key points in the execution flow.
//!
//! # Hook Events
//!
//! Hooks can be triggered on various events:
//! - Session lifecycle (start, end)
//! - User prompts
//! - Tool calls (before, after, on error)
//! - Approval flows
//! - Subagent operations
//!
//! # Hook Handlers
//!
//! Hooks can be implemented using different handlers:
//! - **Command**: Execute shell commands
//! - **HTTP**: Call webhooks
//! - **WASM**: Run WebAssembly modules
//! - **Agent**: Invoke LLM-based handlers (stubbed)
//!
//! # Example
//!
//! ```rust,ignore
//! use astrid_hooks::{Hook, HookEvent, HookHandler, HookManager};
//!
//! let mut manager = HookManager::new();
//!
//! let hook = Hook::new(HookEvent::PreToolCall)
//! .with_handler(HookHandler::Command {
//! command: "echo".to_string(),
//! args: vec!["Tool called: $TOOL_NAME".to_string()],
//! env: Default::default(),
//! });
//!
//! manager.register(hook);
//! ```
pub
pub
pub
pub
pub
pub
pub
pub use ;
pub use HookEvent;
pub use HookResult;