ExMCP.ACP.Adapters.Codex.Sessions (ex_mcp v1.0.0-rc.1)

View Source

Pure session and thread helpers for the Codex ACP adapter.

Summary

Types

session()

@type session() :: map()

session_state()

@type session_state() :: %{
  :sessions => map(),
  :model => any(),
  :mode_id => any(),
  :reasoning_effort => any(),
  optional(any()) => any()
}

store_state()

@type store_state() :: %{:sessions => map(), optional(any()) => any()}

Functions

current_id(arg1)

@spec current_id(store_state()) :: String.t() | nil

empty(session_id, state)

@spec empty(String.t() | nil, session_state()) :: session()

fetch(state, session_id)

@spec fetch(store_state(), String.t()) :: {:ok, session()} | {:error, String.t()}

fetch_id(arg1)

@spec fetch_id(map()) :: {:ok, String.t()} | {:error, String.t()}

from_result(session_id, result, state, model_id_fun \\ fn _session -> nil end)

@spec from_result(String.t(), map(), session_state(), (session() -> any())) ::
  session()

id_from_params(params, state)

@spec id_from_params(map(), store_state()) :: String.t() | nil

put(state, session_id, session)

@spec put(state, String.t() | nil, session()) :: state when state: store_state()

thread_id(thread, result)

@spec thread_id(map(), map()) :: String.t()

update(state, session_id, fun)

@spec update(state, String.t() | nil, (session() -> session())) :: state
when state: session_state()