gestura_core_hooks/
lib.rs

1//! Safe-by-default hooks engine for event-driven command templates.
2//!
3//! `gestura-core-hooks` provides a small hooks system for wiring specific agent
4//! or application events to command templates, while keeping execution tightly
5//! constrained and auditable.
6//!
7//! ## Safety model
8//!
9//! Hooks are intentionally conservative:
10//!
11//! - hook execution is opt-in
12//! - configured programs must appear in `allowed_programs`
13//! - templates are rendered from explicit `HookContext` values
14//! - execution records are captured for inspection and testing
15//!
16//! This crate focuses on the hooks data model and execution engine rather than
17//! broader pipeline orchestration.
18//!
19//! ## Main entry points
20//!
21//! - `HookDefinition` and `HookCommandTemplate`: the declarative hook model
22//! - `HookEvent`: supported events that can trigger hooks
23//! - `HooksSettings`: engine configuration including allow-listed programs
24//! - `HookEngine`: safe dispatcher that resolves and runs matching hooks
25//! - `HookExecutionRecord`: audit-friendly result of a hook run
26
27mod engine;
28mod executor;
29mod template;
30mod types;
31
32pub use engine::{HookEngine, HookExecutionRecord};
33pub use executor::{HookExecutor, ProcessHookExecutor};
34pub use template::{TemplateVars, render_template};
35pub use types::{HookCommandTemplate, HookContext, HookDefinition, HookEvent, HooksSettings};