# `SuperPi.Event.History`
[🔗](https://github.com/oleksandr/super-pi-beam/blob/v0.1.0/lib/super_pi/event/history.ex#L1)

The visible messages of a conversation in a neutral shape, for protocols that must replay history:
the AG-UI `MESSAGES_SNAPSHOT` (a reconnect, or a compaction) and the ACP `session/load`.

Each message is a map with `"id"`, `"role"` (`"user"`, `"assistant"` or `"tool"`) and
`"text"` (the joined text blocks). An assistant message may have `"tool_calls"` (a list of
`%{"id", "name", "arguments"}`), a tool message has `"tool_call_id"`, `"name"` and `"is_error"`.
Entries that are not messages (compactions, system state) are left out. A compaction summary
appears as an assistant message, because the entries that it replaces are no longer visible.

# `agui_messages`

```elixir
@spec agui_messages(integer()) :: [map()]
```

The AG-UI form of `messages/1`.

# `messages`

```elixir
@spec messages(integer()) :: [map()]
```

---

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