# `Wardrik.Notice`

Tells someone what an agent did while nobody watched.

`agent` is the agent's ID. `at` is when it happened. `kind` is one of:

  * `:parked` - a turn waits on a person. `calls` lists each `Wardrik.Interrupt`, with the
    `arguments` the model wrote, where known.
  * `:failed` - a turn failed. `reason` says why.
  * `:finished` - a turn answered. `text` is the answer.

# `call`

```elixir
@type call() :: %{interrupt: Wardrik.Interrupt.t(), arguments: term()}
```

A call a parked turn waits on, with its arguments.

# `kind`

```elixir
@type kind() :: :parked | :failed | :finished
```

# `t`

```elixir
@type t() :: %Wardrik.Notice{
  agent: String.t(),
  at: DateTime.t(),
  calls: [call()],
  kind: kind(),
  reason: String.t() | nil,
  text: String.t() | nil
}
```

# `event`

```elixir
@spec event(t()) :: String.t()
```

Returns the notice's event name: `turn_parked`, `turn_failed` or `turn_finished`.

# `json`

```elixir
@spec json(t()) :: map()
```

Returns the notice as the JSON a webhook receives.

    Wardrik.Notice.json(notice)
    #=> %{"event" => "turn_failed", "agent" => "acme/triage", "reason" => "It timed out.", ...}

# `kinds`

```elixir
@spec kinds() :: [kind()]
```

Returns every kind of notice.

---

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