# `WardrikEvents.Timeline`

A view of an agent's conversation: each message people sent, and each run that answered, step
by step.

    {timeline, cursor} = WardrikEvents.view(MyApp.Events, "acme/triage", WardrikEvents.Timeline)
    WardrikEvents.Timeline.items(timeline)

## Items

Each item is a map with an `:id` and a `:kind`.

  * `:user` - a message someone sent. Has `:text`, `:sender` and `:at`.
  * `:run` - the agent's answer. Has `:status`, `:steps` (oldest first), `:model`,
    `:cost_micro_usd`, `:started_at`, `:finished_at`, `:error` and `:interrupts`. `:status` is
    `:running`, `:completed`, `:failed`, `:cancelled` or `:waiting`.

## Steps

Each step is a map with a `:type`.

  * `:thinking` and `:text` - have `:text`, and `:live` while it streams.
  * `:tool` - has `:name`, `:arguments`, `:status`, `:result` and `:error`. `:status` is
    `:running`, `:ok`, `:error` or `:denied`.

`touched/1` returns the ids of the items the last event changed.

# `t`

```elixir
@type t() :: %WardrikEvents.Timeline{
  items: %{required(String.t()) =&gt; map()},
  order: [String.t()],
  touched: [String.t()]
}
```

# `items`

```elixir
@spec items(t()) :: [map()]
```

Returns the items, oldest first.

# `touched`

```elixir
@spec touched(t()) :: [String.t()]
```

Returns the ids of the items the last event changed.

---

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