Skip to main content

Crate halter_hooks

Crate halter_hooks 

Source
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§

AgentHookConfig
Agent hook configuration.
CommandHookConfig
Command hook configuration.
ConfiguredHandler
Runtime-ready hook handler.
HandlerPriority
Full ordering key for one hook handler.
Hook
SDK hook definition registered into a builder.
HookDispatchOutcome
Final hook dispatch result after merging all handler outputs.
HookDispatchRequest
Input used to select and run hooks for one event.
HookHandler
Parsed hook handler with common metadata and backend config.
HookInput
Input passed to an SDK hook callback.
HookMatcherGroup
Hooks that share one optional matcher for an event.
HookMergedOutcome
Single effective outcome after all hook outputs are merged.
HookOutput
Wire-compatible hook output accepted from plugin and SDK handlers.
HookRegistrySource
One plugin hook source used to build a registry.
HookResponse
Builder-style response returned by SDK hooks.
HookSpecificOutput
Hook output fields whose meaning depends on the event type.
Hooks
Prepared hook registry keyed by event.
HooksFile
Parsed hooks.json file.
HooksLoadWarning
Non-fatal issue found while loading a hook file.
HttpHookConfig
HTTP hook configuration.
MergeInput
Hook output plus the metadata needed to merge it deterministically.
PreparedHookDispatch
Hook dispatch plan before handlers have executed.
PromptHookConfig
Prompt hook configuration.
RegisteredHook
SDK hook with plugin identity and priority metadata.
RegisteredHooks
Collection of SDK hooks registered before runtime construction.

Enums§

CompiledMatcher
A matcher pattern compiled once at config-parse time.
ConfiguredHandlerConfig
Executable handler configuration.
HandlerPriorityGroup
Priority lane used when ordering hook handlers.
HookDecision
Basic allow/block decision emitted by hooks.
HookEventName
Canonical hook event name.
HookHandlerConfig
Backend-specific hook handler configuration.
HookKind
Executable SDK hook backend.
HookShell
Shell used by command hooks.
MatcherCompileError
PermissionDecision
Variants ordered least-restrictive first so the derived Ord matches 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.
RegisteredHookPriority
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§

HookCallback
Shared callback used by SDK-registered hooks.
HookCallbackFuture
Boxed future returned by an SDK hook callback.
HookFunctionFactory
Factory for hooks that need a fresh callback instance per dispatch.