Codex.AppServer (Codex SDK v0.3.0)

View Source

App-server transport for stateful, bidirectional communication with Codex.

Summary

Types

connect_opts()

@type connect_opts() :: [
  init_timeout_ms: pos_integer(),
  client_name: String.t(),
  client_title: String.t(),
  client_version: String.t()
]

connection()

@type connection() :: pid()

Functions

alive?(conn)

@spec alive?(connection()) :: boolean()

command_exec(conn, command, opts \\ [])

@spec command_exec(connection(), [String.t()], keyword()) ::
  {:ok, map()} | {:error, term()}

config_batch_write(conn, edits, opts \\ [])

@spec config_batch_write(connection(), [map()], keyword()) ::
  {:ok, map()} | {:error, term()}

config_read(conn, opts \\ [])

@spec config_read(
  connection(),
  keyword()
) :: {:ok, map()} | {:error, term()}

config_write(conn, key_path, value, opts \\ [])

@spec config_write(connection(), String.t(), term(), keyword()) ::
  {:ok, map()} | {:error, term()}

connect(codex_opts, opts \\ [])

@spec connect(Codex.Options.t(), connect_opts()) ::
  {:ok, connection()} | {:error, term()}

disconnect(conn)

@spec disconnect(connection()) :: :ok

feedback_upload(conn, opts)

@spec feedback_upload(
  connection(),
  keyword()
) :: {:ok, map()} | {:error, term()}

model_list(conn, opts \\ [])

@spec model_list(
  connection(),
  keyword()
) :: {:ok, map()} | {:error, term()}

respond(conn, id, result)

@spec respond(connection(), String.t() | integer(), map()) :: :ok | {:error, term()}

review_start(conn, thread_id, target, opts \\ [])

@spec review_start(connection(), String.t(), term(), keyword()) ::
  {:ok, map()} | {:error, term()}

skills_list(conn, opts \\ [])

@spec skills_list(
  connection(),
  keyword()
) :: {:ok, map()} | {:error, term()}

subscribe(conn, opts \\ [])

@spec subscribe(
  connection(),
  keyword()
) :: :ok | {:error, term()}

thread_archive(conn, thread_id)

@spec thread_archive(connection(), String.t()) :: :ok | {:error, term()}

thread_compact(conn, thread_id)

@spec thread_compact(connection(), String.t()) :: :ok | {:error, term()}

thread_list(conn, opts \\ [])

@spec thread_list(
  connection(),
  keyword()
) :: {:ok, map()} | {:error, term()}

thread_resume(conn, thread_id, params \\ %{})

@spec thread_resume(connection(), String.t(), map() | keyword()) ::
  {:ok, map()} | {:error, term()}

thread_start(conn, params \\ %{})

@spec thread_start(connection(), map() | keyword()) :: {:ok, map()} | {:error, term()}

turn_interrupt(conn, thread_id, turn_id)

@spec turn_interrupt(connection(), String.t(), String.t()) :: :ok | {:error, term()}

turn_start(conn, thread_id, input, opts \\ [])

@spec turn_start(connection(), String.t(), String.t() | [map()], keyword()) ::
  {:ok, map()} | {:error, term()}

unsubscribe(conn)

@spec unsubscribe(connection()) :: :ok