# `Codex.Protocol.SessionSource`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.16.1/lib/codex/protocol/session_source.ex#L1)

Typed representation of thread/session source metadata returned by Codex.

This normalizes both core-session source values such as `"mcp"` and
app-server v2 values such as `"appServer"` into a single SDK-facing shape.

# `kind`

```elixir
@type kind() :: :cli | :vscode | :exec | :app_server | :sub_agent | :unknown
```

# `source_kind`

```elixir
@type source_kind() ::
  :cli
  | :vscode
  | :exec
  | :app_server
  | :sub_agent
  | :sub_agent_review
  | :sub_agent_compact
  | :sub_agent_thread_spawn
  | :sub_agent_other
  | :unknown
```

# `t`

```elixir
@type t() :: %Codex.Protocol.SessionSource{
  kind: kind(),
  sub_agent: (Codex.Protocol.SubAgentSource.t() | nil) | nil
}
```

# `from_map`

```elixir
@spec from_map(map() | atom() | String.t() | t() | nil) :: t()
```

# `normalize_source_kind`

```elixir
@spec normalize_source_kind(atom() | String.t() | nil) :: source_kind() | nil
```

# `source_kind`

```elixir
@spec source_kind(map() | atom() | String.t() | t() | nil) :: source_kind()
```

# `to_map`

```elixir
@spec to_map(t()) :: map() | String.t()
```

---

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