CodexEx.AppServer.Turn (codex_ex v0.1.0)

Copy Markdown View Source

Stable typed snapshot of an app-server turn.

Summary

Types

result()

@type result() :: {:ok, t()} | {:error, {:invalid_turn, term()}}

t()

@type t() :: %CodexEx.AppServer.Turn{
  diff: binary() | nil,
  duration_ms: non_neg_integer() | nil,
  error: CodexEx.AppServer.Turn.Error.t() | nil,
  id: binary(),
  items: [CodexEx.AppServer.ThreadItem.t()],
  status: binary(),
  thread_id: binary()
}

Functions

completed?(turn)

@spec completed?(term()) :: boolean()

failed?(turn)

@spec failed?(term()) :: boolean()

from_protocol(turn, thread_id)

@spec from_protocol(map(), binary()) ::
  {:ok,
   %CodexEx.AppServer.Turn{
     diff: term(),
     duration_ms: term(),
     error: term(),
     id: term(),
     items: term(),
     status: term(),
     thread_id: term()
   }}
  | {:error, {:invalid_turn, term()}}

interrupted?(turn)

@spec interrupted?(term()) :: boolean()