# `MingaEditor.Agent.SemanticUI.Registry`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/agent/semantic_ui/registry.ex#L1)

Source-owned registry for semantic agent UI contributions.

Extensions and bundles register cached `Minga.RenderModel.UI.*` values here. Render builders and input handlers read the ETS table directly, so frame and keystroke hot paths never invoke extension render callbacks.

# `payload`

```elixir
@type payload() :: MingaEditor.Agent.SemanticUI.Entry.payload()
```

Existing render-model payload stored by an entry.

# `register_attrs`

```elixir
@type register_attrs() :: %{
  :id =&gt; String.t(),
  :surface =&gt; surface(),
  :payload =&gt; payload(),
  optional(:target) =&gt; term(),
  optional(:priority) =&gt; integer(),
  optional(:actions) =&gt; [Minga.RenderModel.UI.Action.t() | map() | keyword()]
}
```

Registration attributes.

# `source`

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

Source that owns semantic UI entries.

# `state`

```elixir
@type state() :: table()
```

# `surface`

```elixir
@type surface() :: MingaEditor.Agent.SemanticUI.Entry.surface()
```

Semantic surface name.

# `table`

```elixir
@type table() :: atom()
```

Registry table name.

# `all`

```elixir
@spec all() :: [MingaEditor.Agent.SemanticUI.Entry.t()]
```

Returns all entries ordered by priority and id.

# `all`

```elixir
@spec all(table()) :: [MingaEditor.Agent.SemanticUI.Entry.t()]
```

# `default_table`

```elixir
@spec default_table() :: table()
```

Returns the default production registry table.

# `dispatch_action`

```elixir
@spec dispatch_action(MingaEditor.State.t(), String.t(), String.t(), map()) ::
  MingaEditor.State.t()
```

Dispatches a semantic action through the editor command pipeline.

# `dispatch_action`

```elixir
@spec dispatch_action(table(), MingaEditor.State.t(), String.t(), String.t(), map()) ::
  MingaEditor.State.t()
```

# `entries`

```elixir
@spec entries(surface()) :: [MingaEditor.Agent.SemanticUI.Entry.t()]
```

Returns all entries for a semantic surface ordered by priority and id.

# `entries`

```elixir
@spec entries(table(), surface()) :: [MingaEditor.Agent.SemanticUI.Entry.t()]
```

# `get`

```elixir
@spec get(String.t()) :: MingaEditor.Agent.SemanticUI.Entry.t() | nil
```

Returns an entry by id.

# `get`

```elixir
@spec get(table(), String.t()) :: MingaEditor.Agent.SemanticUI.Entry.t() | nil
```

# `panels`

```elixir
@spec panels() :: [Minga.RenderModel.UI.ExtensionPanel.Panel.t()]
```

Returns cached extension-panel panels contributed to agent UI.

# `panels`

```elixir
@spec panels(table()) :: [Minga.RenderModel.UI.ExtensionPanel.Panel.t()]
```

# `publish`

```elixir
@spec publish(
  source(),
  String.t(),
  payload(),
  [Minga.RenderModel.UI.Action.t() | map() | keyword()] | nil
) :: :ok | {:error, term()}
```

Publishes a new cached render-model payload for an existing entry.

# `publish`

```elixir
@spec publish(
  table(),
  source(),
  String.t(),
  payload(),
  [Minga.RenderModel.UI.Action.t() | map() | keyword()] | nil
) :: :ok | {:error, term()}
```

# `register`

```elixir
@spec register(
  source(),
  register_attrs() | MingaEditor.Agent.SemanticUI.Entry.t() | keyword()
) ::
  :ok | {:error, term()}
```

Registers or replaces a source-owned semantic UI entry.

# `register`

```elixir
@spec register(
  table(),
  source(),
  register_attrs() | MingaEditor.Agent.SemanticUI.Entry.t() | keyword()
) ::
  :ok | {:error, term()}
```

# `register_many`

```elixir
@spec register_many(source(), [
  register_attrs() | MingaEditor.Agent.SemanticUI.Entry.t() | keyword()
]) ::
  :ok | {:error, term()}
```

Registers a source-owned batch, replacing all prior entries owned by the same source.

# `register_many`

```elixir
@spec register_many(table(), source(), [
  register_attrs() | MingaEditor.Agent.SemanticUI.Entry.t() | keyword()
]) :: :ok | {:error, term()}
```

# `start_link`

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

Starts the semantic UI registry.

# `table_for`

```elixir
@spec table_for(map() | nil) :: table()
```

Returns the semantic UI registry table for a state-like value.

# `transcript_enrichments`

```elixir
@spec transcript_enrichments() :: [
  {pos_integer(), Minga.RenderModel.UI.AgentChat.message_body()}
]
```

Returns cached transcript enrichment bodies.

# `transcript_enrichments`

```elixir
@spec transcript_enrichments(table()) :: [
  {pos_integer(), Minga.RenderModel.UI.AgentChat.message_body()}
]
```

# `unregister`

```elixir
@spec unregister(source(), String.t()) :: :ok | {:error, term()}
```

Unregisters an entry when it is owned by the caller's source.

# `unregister`

```elixir
@spec unregister(table(), source(), String.t()) :: :ok | {:error, term()}
```

# `unregister_source`

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

Removes every semantic UI entry owned by a source.

# `unregister_source`

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

---

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