Codex.Protocol.SessionSource (Codex SDK v0.14.0)

Copy Markdown View Source

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

kind()

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

source_kind()

@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()

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

Functions

from_map(source)

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

normalize_source_kind(value)

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

source_kind(value)

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

to_map(session_source)

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