Skip to main content

halter_hooks/
lib.rs

1//! Hook configuration, matching, merging, and SDK registration.
2//!
3//! This crate converts plugin `hooks.json` files and SDK-registered callbacks
4//! into ordered hook dispatch plans. It also contains the merge rules that turn
5//! multiple hook outputs into one runtime decision.
6// pattern: Functional Core
7
8mod config;
9mod engine;
10mod matcher;
11mod merge;
12mod sdk;
13
14pub use config::{
15    AgentHookConfig, CommandHookConfig, HookEventName, HookHandler, HookHandlerConfig,
16    HookMatcherGroup, HookShell, HooksFile, HooksLoadWarning, HttpHookConfig, PromptHookConfig,
17};
18pub use engine::{
19    ConfiguredHandler, ConfiguredHandlerConfig, HOOK_PROTOCOL_VERSION, HookDispatchOutcome,
20    HookDispatchRequest, HookRegistrySource, Hooks, PreparedHookDispatch,
21};
22pub use matcher::{CompiledMatcher, MatcherCompileError};
23pub use merge::{
24    HandlerPriority, HandlerPriorityGroup, HookDecision, HookMergedOutcome, HookOutput,
25    HookSpecificOutput, MergeInput, PermissionDecision, merge_outputs, summary_entries,
26};
27pub use sdk::{
28    Hook, HookCallback, HookCallbackFuture, HookFunctionFactory, HookInput, HookKind, HookResponse,
29    RegisteredHook, RegisteredHookPriority, RegisteredHooks,
30};