App-server transport for stateful, bidirectional communication with Codex.
Summary
Types
Options for launching and initializing a managed codex app-server child process.
Functions
Lists available apps/connectors.
Lists collaboration mode presets (experimental).
Writes bytes to a running command/exec session.
Backwards-compatible alias for command_exec_write/3 using raw stdin text.
Reads config requirements enforced by the server (if any).
Starts a supervised codex app-server subprocess and completes the initialize handshake.
Copies a file or directory via the app-server filesystem API.
Creates a directory via the app-server filesystem API.
Fetches file or directory metadata via the app-server filesystem API.
Lists directory entries via the app-server filesystem API.
Reads a file via the app-server filesystem API, returning a base64 payload.
Removes a file or directory via the app-server filesystem API.
Writes base64-encoded file contents via the app-server filesystem API.
Reads plugin details from a marketplace entry via the app-server plugin API.
Writes a skills config entry enabling or disabling a skill by path.
Starts server-side context compaction for a thread.
Explicit alias for thread_compact/2.
Types
@type connect_opts() :: [ init_timeout_ms: pos_integer(), client_name: String.t(), client_title: String.t(), client_version: String.t(), experimental_api: boolean(), cwd: String.t(), process_env: map() | keyword(), env: map() | keyword(), oauth: keyword() ]
Options for launching and initializing a managed codex app-server child process.
cwd and process_env / env apply to the child process itself. Per-thread working
directories still belong on thread/start, thread/resume, or Codex.Thread.Options.
@type connection() :: pid()
Functions
@spec alive?(connection()) :: boolean()
@spec apps_list( connection(), keyword() ) :: {:ok, map()} | {:error, term()}
Lists available apps/connectors.
@spec collaboration_mode_list(connection()) :: {:ok, map()} | {:error, term()}
Lists collaboration mode presets (experimental).
@spec command_exec(connection(), [String.t()], keyword()) :: {:ok, map()} | {:error, term()}
@spec command_exec_terminate(connection(), String.t()) :: {:ok, map()} | {:error, term()}
@spec command_exec_write(connection(), String.t(), keyword()) :: {:ok, map()} | {:error, term()}
Writes bytes to a running command/exec session.
@spec command_write_stdin(connection(), String.t(), String.t(), keyword()) :: {:ok, map()} | {:error, term()}
Backwards-compatible alias for command_exec_write/3 using raw stdin text.
@spec config_batch_write(connection(), [map()], keyword()) :: {:ok, map()} | {:error, term()}
@spec config_read( connection(), keyword() ) :: {:ok, map()} | {:error, term()}
@spec config_requirements(connection()) :: {:ok, map()} | {:error, term()}
Reads config requirements enforced by the server (if any).
@spec connect(Codex.Options.t(), connect_opts()) :: {:ok, connection()} | {:error, term()}
Starts a supervised codex app-server subprocess and completes the initialize handshake.
Use cwd and process_env (or the env alias) when the app-server child must run with an
isolated working directory or CODEX_HOME without mutating the caller's shell environment.
@spec disconnect(connection()) :: :ok
@spec experimental_feature_list( connection(), keyword() ) :: {:ok, map()} | {:error, term()}
@spec external_agent_config_detect( connection(), keyword() ) :: {:ok, map()} | {:error, term()}
@spec external_agent_config_import(connection(), [map()]) :: {:ok, map()} | {:error, term()}
@spec feedback_upload( connection(), keyword() ) :: {:ok, map()} | {:error, term()}
Copies a file or directory via the app-server filesystem API.
@spec fs_create_directory(connection(), String.t(), keyword()) :: {:ok, map()} | {:error, term()}
Creates a directory via the app-server filesystem API.
@spec fs_get_metadata(connection(), String.t()) :: {:ok, map()} | {:error, term()}
Fetches file or directory metadata via the app-server filesystem API.
@spec fs_read_directory(connection(), String.t()) :: {:ok, map()} | {:error, term()}
Lists directory entries via the app-server filesystem API.
@spec fs_read_file(connection(), String.t()) :: {:ok, map()} | {:error, term()}
Reads a file via the app-server filesystem API, returning a base64 payload.
@spec fs_remove(connection(), String.t(), keyword()) :: {:ok, map()} | {:error, term()}
Removes a file or directory via the app-server filesystem API.
@spec fs_write_file(connection(), String.t(), String.t()) :: {:ok, map()} | {:error, term()}
Writes base64-encoded file contents via the app-server filesystem API.
@spec fuzzy_file_search(connection(), String.t(), keyword()) :: {:ok, map()} | {:error, term()}
@spec fuzzy_file_search_session_start(connection(), String.t(), [String.t()]) :: {:ok, map()} | {:error, term()}
@spec fuzzy_file_search_session_stop(connection(), String.t()) :: {:ok, map()} | {:error, term()}
@spec fuzzy_file_search_session_update(connection(), String.t(), String.t()) :: {:ok, map()} | {:error, term()}
@spec model_list( connection(), keyword() ) :: {:ok, map()} | {:error, term()}
@spec plugin_install(connection(), String.t(), String.t()) :: {:ok, map()} | {:error, term()}
@spec plugin_list( connection(), keyword() ) :: {:ok, map()} | {:error, term()}
@spec plugin_read(connection(), String.t(), String.t()) :: {:ok, map()} | {:error, term()}
Reads plugin details from a marketplace entry via the app-server plugin API.
@spec plugin_uninstall(connection(), String.t()) :: {:ok, map()} | {:error, term()}
@spec respond(connection(), String.t() | integer(), map()) :: :ok | {:error, term()}
@spec skills_config_write(connection(), String.t(), boolean()) :: {:ok, map()} | {:error, term()}
Writes a skills config entry enabling or disabling a skill by path.
@spec skills_list( connection(), keyword() ) :: {:ok, map()} | {:error, term()}
@spec skills_remote_export(connection(), String.t()) :: {:ok, map()} | {:error, term()}
@spec skills_remote_list( connection(), keyword() ) :: {:ok, map()} | {:error, term()}
@spec subscribe( connection(), keyword() ) :: :ok | {:error, term()}
@spec thread_archive(connection(), String.t()) :: :ok | {:error, term()}
@spec thread_compact(connection(), String.t()) :: {:ok, map()} | {:error, term()}
Starts server-side context compaction for a thread.
@spec thread_compact_start(connection(), String.t()) :: {:ok, map()} | {:error, term()}
Explicit alias for thread_compact/2.
@spec thread_list( connection(), keyword() ) :: {:ok, map()} | {:error, term()}
@spec thread_loaded_list( connection(), keyword() ) :: {:ok, map()} | {:error, term()}
@spec thread_name_set(connection(), String.t(), String.t()) :: {:ok, map()} | {:error, term()}
@spec thread_read(connection(), String.t(), keyword()) :: {:ok, map()} | {:error, term()}
@spec thread_realtime_append_text(connection(), String.t(), String.t()) :: {:ok, map()} | {:error, term()}
@spec thread_realtime_stop(connection(), String.t()) :: {:ok, map()} | {:error, term()}
@spec thread_rollback(connection(), String.t(), pos_integer()) :: {:ok, map()} | {:error, term()}
@spec thread_start(connection(), map() | keyword()) :: {:ok, map()} | {:error, term()}
@spec thread_unarchive(connection(), String.t()) :: {:ok, map()} | {:error, term()}
@spec thread_unsubscribe(connection(), String.t()) :: {:ok, map()} | {:error, term()}
@spec turn_interrupt(connection(), String.t(), String.t()) :: :ok | {:error, term()}
@spec unsubscribe(connection()) :: :ok