# `Raxol.AgentClientProtocol.Session.Turn`
[🔗](https://github.com/DROOdotFOO/raxol-agent/blob/raxol_agent_client_protocol-v0.1.0/packages/raxol_agent_client_protocol/lib/raxol/agent_client_protocol/session.ex#L1)

Ephemeral per-turn state, held by a `Raxol.AgentClientProtocol.Session` only
while a `session/prompt` turn is in flight. `outcome` is written once by the
root leg; the cancel leg overwrites it.

`monitors` is the turn's task group: `ref => pid` for every live task
(`async_nolink` monitor ref keyed to its pid). It is a map rather than a set of
refs because the 30s backstop must `Process.exit(pid, :kill)` each remaining
member — the pids are load-bearing. `map_size/1` is the drain gate.

# `outcome`

```elixir
@type outcome() ::
  {:stop, Raxol.AgentClientProtocol.Schema.AgentTypes.StopReason.t()}
  | {:error, Raxol.AgentClientProtocol.Error.t()}
```

# `t`

```elixir
@type t() :: %Raxol.AgentClientProtocol.Session.Turn{
  backstop_timer: reference() | nil,
  monitors: %{required(reference()) =&gt; pid()},
  non_empty_prompt?: boolean(),
  outcome: outcome() | nil,
  pending_perms: %{required(reference()) =&gt; %{from: GenServer.from()}},
  prompt_seq: non_neg_integer(),
  reply_ref: reference(),
  respond?: boolean(),
  root_pid: pid(),
  root_ref: reference(),
  turn_ref: reference(),
  updates_emitted?: boolean()
}
```

---

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