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

Source-owned registry for extension-contributed agent hooks.

User config hooks still live on `MingaAgent.Config`. Extension hooks are normalized here so session lifecycle hooks and provider tool hooks read the same source-aware view, and extension cleanup can remove a whole source deterministically.

# `entry`

```elixir
@type entry() :: %{source: source(), id: String.t(), hook: MingaAgent.Hooks.Hook.t()}
```

Registry entry for one normalized hook.

# `source`

```elixir
@type source() :: Minga.Extension.ContributionCleanup.contribution_source()
```

Source that contributed hooks.

# `state`

```elixir
@type state() :: [entry()]
```

# `all`

```elixir
@spec all() :: [MingaAgent.Hooks.Hook.t()]
```

Returns all normalized hooks in registration order.

# `entries`

```elixir
@spec entries() :: [entry()]
```

Returns all registry entries in registration order.

# `register_many`

```elixir
@spec register_many(source(), [{atom() | String.t(), keyword()}], keyword()) :: :ok
```

Registers a source-owned batch of raw hook declarations. Same-source batches replace prior entries.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Starts the hook registry.

# `unregister_source`

```elixir
@spec unregister_source(source()) :: :ok
```

Removes all hooks owned by a source.

---

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