# `MingaAgent.Hooks.Result`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_agent/hooks/result.ex#L1)

Structured result returned by agent hook runners.

`:allow` means execution may continue. `:veto` means the hook blocked the
tool call and the tool callback must not run.

# `reason`

```elixir
@type reason() :: {:exit, non_neg_integer()} | :timeout | {:failed_to_start, term()}
```

Why a hook vetoed or failed.

# `t`

```elixir
@type t() :: %MingaAgent.Hooks.Result{
  exit_status: non_neg_integer() | nil,
  hook: MingaAgent.Hooks.Hook.t() | nil,
  reason: reason() | nil,
  status: :allow | :veto,
  stderr: String.t()
}
```

Structured hook result.

# `allow`

```elixir
@spec allow(MingaAgent.Hooks.Hook.t() | nil) :: t()
```

Builds an allow result.

# `dispatch_error`

```elixir
@spec dispatch_error(String.t()) :: t()
```

Builds a veto result for dispatch-level failures (no hook context available).

# `message`

```elixir
@spec message(t()) :: String.t()
```

Returns a concise user-facing error for a veto result.

# `veto`

```elixir
@spec veto(MingaAgent.Hooks.Hook.t(), String.t(), reason()) :: t()
```

Builds a veto result.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
