# `ReqManagedAgents.Providers.ClaudeManagedAgents.Event`
[🔗](https://github.com/cash-mckeeman/req_managed_agents/blob/v0.13.0/req_managed_agents/lib/req_managed_agents/providers/claude_managed_agents/event.ex#L1)

Outbound event builders and inbound event classification for Managed Agents.

Events are plain JSON maps with string keys (the wire shape). Builders produce
events to POST to `/v1/sessions/{id}/events`; `classify/1` reduces an inbound
event to a terminal/flow atom for loop control.

# `event`

```elixir
@type event() :: %{required(String.t()) =&gt; term()}
```

# `terminal`

```elixir
@type terminal() ::
  :end_turn
  | :requires_action
  | :retries_exhausted
  | :terminated
  | :error
  | :unknown_idle
  | :other
```

# `classify`

```elixir
@spec classify(event()) :: terminal()
```

Classify an inbound event into a flow-control atom.

# `custom_tool_result`

```elixir
@spec custom_tool_result(String.t(), String.t(), keyword()) :: event()
```

Build a `user.custom_tool_result` event. Pass `is_error: true` for failures.

# `define_outcome`

```elixir
@spec define_outcome(String.t(), String.t(), keyword()) :: event()
```

Build a `user.define_outcome` event. `rubric_md` is inline markdown criteria.

# `tool_confirmation`

```elixir
@spec tool_confirmation(String.t(), :allow | :deny) :: event()
```

Build a `user.tool_confirmation` event (`:allow` or `:deny`).

# `user_message`

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

Build a `user.message` text event.

---

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