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.
Summary
Types
@type kind() :: :cli | :vscode | :exec | :app_server | :sub_agent | :unknown
@type source_kind() ::
:cli
| :vscode
| :exec
| :app_server
| :sub_agent
| :sub_agent_review
| :sub_agent_compact
| :sub_agent_thread_spawn
| :sub_agent_other
| :unknown
@type t() :: %Codex.Protocol.SessionSource{ kind: kind(), sub_agent: (Codex.Protocol.SubAgentSource.t() | nil) | nil }
Functions
@spec normalize_source_kind(atom() | String.t() | nil) :: source_kind() | nil
@spec source_kind(map() | atom() | String.t() | t() | nil) :: source_kind()