Normalized agent hook declaration.
Hooks are declared in user config as maps or keyword lists, then normalized
by MingaAgent.Config.resolve/0 into this struct. The event field selects
the lifecycle point; tool_pattern is required only for tool-related events
(:pre_tool_use, :post_tool_use).
Summary
Types
Supported hook event names.
Hook type: shell command or in-process Elixir module.
Normalized hook declaration.
Functions
Returns the default per-hook timeout in milliseconds.
Returns the human-readable label for an event atom.
Returns true when this hook applies to the given non-tool event.
Returns true when this hook applies to the event and tool name.
Normalizes a user config hook declaration into a %Hook{}.
Returns true if the event is tool-related and uses tool_pattern matching.
Types
@type event() ::
:pre_tool_use
| :post_tool_use
| :session_start
| :session_end
| :stop
| :user_prompt_submit
| :pre_compact
| :notification
Supported hook event names.
@type hook_type() :: :shell | :module
Hook type: shell command or in-process Elixir module.
@type t() :: %MingaAgent.Hooks.Hook{ command: String.t() | nil, event: event(), extension_module: module() | nil, extension_source: atom() | nil, function: atom() | nil, module: module() | nil, timeout_ms: pos_integer(), tool_pattern: String.t() | nil, type: hook_type() }
Normalized hook declaration.
Functions
@spec default_timeout_ms() :: pos_integer()
Returns the default per-hook timeout in milliseconds.
Returns the human-readable label for an event atom.
Returns true when this hook applies to the given non-tool event.
Returns true when this hook applies to the event and tool name.
Normalizes a user config hook declaration into a %Hook{}.
Returns true if the event is tool-related and uses tool_pattern matching.