# `Minga.Frontend.Adapter.GUI.AgentChatEncoder`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga/frontend/adapter/gui/agent_chat_encoder.ex#L1)

Pure GUI adapter encoder for the agent chat surface (`gui_agent_chat`, 0x78).

Encodes a `Minga.RenderModel.UI.AgentChat` semantic model into the sectioned
wire format and gates on a `:erlang.phash2/1` fingerprint stored in
`Minga.Frontend.Adapter.GUI.Caches`. Depends only on the model, the protocol
opcodes, and the caches struct; it touches no processes and references no
product module. The editor builder pre-resolves every agent struct into the
core views (`AgentChat.ToolCallView`, `AgentChat.ApprovalView`,
`AgentChat.Usage`) before they reach this encoder.

# `gui_chat_message`

```elixir
@type gui_chat_message() :: Minga.RenderModel.UI.AgentChat.message_body()
```

A chat message that may carry pre-computed styled runs.

# `encode`

```elixir
@spec encode(
  Minga.RenderModel.UI.AgentChat.t(),
  Minga.Frontend.Adapter.GUI.Caches.t()
) ::
  {binary() | nil, Minga.Frontend.Adapter.GUI.Caches.t()}
```

---

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