Expand description
Hook configuration, matching, merging, and SDK registration.
This crate converts plugin hooks.json files and SDK-registered callbacks
into ordered hook dispatch plans. It also contains the merge rules that turn
multiple hook outputs into one runtime decision.
Structs§
- Agent
Hook Config - Agent hook configuration.
- Command
Hook Config - Command hook configuration.
- Configured
Handler - Runtime-ready hook handler.
- Handler
Priority - Full ordering key for one hook handler.
- Hook
- SDK hook definition registered into a builder.
- Hook
Dispatch Outcome - Final hook dispatch result after merging all handler outputs.
- Hook
Dispatch Request - Input used to select and run hooks for one event.
- Hook
Handler - Parsed hook handler with common metadata and backend config.
- Hook
Input - Input passed to an SDK hook callback.
- Hook
Matcher Group - Hooks that share one optional matcher for an event.
- Hook
Merged Outcome - Single effective outcome after all hook outputs are merged.
- Hook
Output - Wire-compatible hook output accepted from plugin and SDK handlers.
- Hook
Registry Source - One plugin hook source used to build a registry.
- Hook
Response - Builder-style response returned by SDK hooks.
- Hook
Specific Output - Hook output fields whose meaning depends on the event type.
- Hooks
- Prepared hook registry keyed by event.
- Hooks
File - Parsed
hooks.jsonfile. - Hooks
Load Warning - Non-fatal issue found while loading a hook file.
- Http
Hook Config - HTTP hook configuration.
- Merge
Input - Hook output plus the metadata needed to merge it deterministically.
- Prepared
Hook Dispatch - Hook dispatch plan before handlers have executed.
- Prompt
Hook Config - Prompt hook configuration.
- Registered
Hook - SDK hook with plugin identity and priority metadata.
- Registered
Hooks - Collection of SDK hooks registered before runtime construction.
Enums§
- Compiled
Matcher - A matcher pattern compiled once at config-parse time.
- Configured
Handler Config - Executable handler configuration.
- Handler
Priority Group - Priority lane used when ordering hook handlers.
- Hook
Decision - Basic allow/block decision emitted by hooks.
- Hook
Event Name - Canonical hook event name.
- Hook
Handler Config - Backend-specific hook handler configuration.
- Hook
Kind - Executable SDK hook backend.
- Hook
Shell - Shell used by command hooks.
- Matcher
Compile Error - Permission
Decision - Variants ordered least-restrictive first so the derived
Ordmatches the semantic “strength” of the decision:Passthrough < Allow < Ask < Deny. Merging two outputs picks the stronger decision with.max(...)rather than a hand-rolled rank table (finding L16). Serde uses variant names (snake_case), not declaration position, so the reordering is safe. - Registered
Hook Priority - Relative priority for SDK hooks compared with plugin-file hooks.
Constants§
- HOOK_
PROTOCOL_ VERSION - Current hook file protocol version.
Functions§
- merge_
outputs - Merge ordered hook outputs into one runtime outcome.
- summary_
entries - Convert one hook output into summary entries for event reporting.
Type Aliases§
- Hook
Callback - Shared callback used by SDK-registered hooks.
- Hook
Callback Future - Boxed future returned by an SDK hook callback.
- Hook
Function Factory - Factory for hooks that need a fresh callback instance per dispatch.