Dispatches normalized agent hooks for lifecycle events.
The dispatcher is intentionally stateless. It receives a list of hooks from
MingaAgent.Config, filters matching hooks in registration order, and asks a
runner to execute each hook. For veto-capable events the first veto
short-circuits later hooks; for notification-only events vetoes are
broadcast as events and logged as warnings but do not block.
Summary
Functions
Runs all matching hooks for an event in registration order.
Runs all matching Notification hooks (notification-only).
Runs all matching PostToolUse hooks (notification-only).
Runs all matching PreCompact hooks (veto-capable).
Runs all matching PreToolUse hooks in registration order.
Runs matching PreToolUse hooks with an injected runner.
Runs all matching SessionEnd hooks (notification-only).
Runs all matching SessionStart hooks (notification-only).
Runs all matching Stop hooks (notification-only).
Runs all matching UserPromptSubmit hooks (veto-capable).
Types
@type runner() :: (MingaAgent.Hooks.Hook.t(), map() -> MingaAgent.Hooks.Result.t())
Hook runner used by tests and production command execution.
Functions
@spec dispatch( MingaAgent.Hooks.Hook.event(), [MingaAgent.Hooks.Hook.t()], map(), keyword() ) :: :ok | {:error, MingaAgent.Hooks.Result.t()}
Runs all matching hooks for an event in registration order.
@spec notification([MingaAgent.Hooks.Hook.t()], map(), keyword()) :: :ok
Runs all matching Notification hooks (notification-only).
@spec post_tool_use([MingaAgent.Hooks.Hook.t()], map(), keyword()) :: :ok
Runs all matching PostToolUse hooks (notification-only).
@spec pre_compact([MingaAgent.Hooks.Hook.t()], map(), keyword()) :: :ok | {:error, MingaAgent.Hooks.Result.t()}
Runs all matching PreCompact hooks (veto-capable).
@spec pre_tool_use( [MingaAgent.Hooks.Hook.t()], MingaAgent.Hooks.PreToolUsePayload.t() ) :: :ok | {:error, MingaAgent.Hooks.Result.t()}
Runs all matching PreToolUse hooks in registration order.
@spec pre_tool_use( [MingaAgent.Hooks.Hook.t()], MingaAgent.Hooks.PreToolUsePayload.t(), keyword() ) :: :ok | {:error, MingaAgent.Hooks.Result.t()}
Runs matching PreToolUse hooks with an injected runner.
@spec session_end([MingaAgent.Hooks.Hook.t()], map(), keyword()) :: :ok
Runs all matching SessionEnd hooks (notification-only).
@spec session_start([MingaAgent.Hooks.Hook.t()], map(), keyword()) :: :ok
Runs all matching SessionStart hooks (notification-only).
@spec stop([MingaAgent.Hooks.Hook.t()], map(), keyword()) :: :ok
Runs all matching Stop hooks (notification-only).
@spec user_prompt_submit([MingaAgent.Hooks.Hook.t()], map(), keyword()) :: :ok | {:error, MingaAgent.Hooks.Result.t()}
Runs all matching UserPromptSubmit hooks (veto-capable).