ASM.Extensions.ProviderSDK.Codex (ASM v0.9.2)

Copy Markdown View Source

Discovery metadata and bridge helpers for the optional Codex-native ASM extension namespace.

This namespace lives above ASM's normalized kernel.

It does not implement Codex's richer APIs itself. Instead it:

  • publishes discovery metadata for the optional Codex-native surface
  • derives Codex.Options from ASM-style configuration, including normalized execution-surface data for CLI-backed families
  • derives Codex.Thread.Options from ASM-style configuration or session defaults
  • starts Codex.AppServer connections when callers explicitly opt into the SDK-local app-server family

The actual app-server, MCP, realtime, and voice families remain in codex_sdk.

Summary

Functions

Derives Codex.Options from ASM-style Codex configuration.

Derives Codex.Options from an ASM session plus optional ASM/native overrides.

Starts Codex.AppServer from ASM-style Codex configuration.

Starts Codex.AppServer from an ASM session plus optional ASM/native overrides.

Derives Codex.Thread.Options from ASM-style Codex configuration.

Derives Codex.Thread.Options from an ASM session plus optional ASM/native overrides.

Functions

available?()

@spec available?() :: boolean()

codex_options(asm_opts, native_overrides \\ [])

@spec codex_options(keyword(), keyword()) :: {:ok, struct()} | {:error, ASM.Error.t()}

Derives Codex.Options from ASM-style Codex configuration.

native_overrides remains the explicit home for Codex-native global SDK settings such as config overrides, model personality, review model, or history settings. Execution-surface placement stays on asm_opts.

codex_options_for_session(session, asm_overrides \\ [], native_overrides \\ [])

@spec codex_options_for_session(term(), keyword(), keyword()) ::
  {:ok, struct()} | {:error, ASM.Error.t()}

Derives Codex.Options from an ASM session plus optional ASM/native overrides.

connect_app_server(asm_opts, native_overrides \\ [], connect_opts \\ [])

@spec connect_app_server(keyword(), keyword(), keyword()) ::
  {:ok, pid()} | {:error, ASM.Error.t() | term()}

Starts Codex.AppServer from ASM-style Codex configuration.

ASM configuration stays on the first argument. Codex-native global overrides stay in native_overrides. App-server child launch overrides such as :experimental_api, :cwd, :process_env, or an explicit :execution_surface override stay in connect_opts.

connect_app_server_for_session(session, asm_overrides \\ [], native_overrides \\ [], connect_opts \\ [])

@spec connect_app_server_for_session(term(), keyword(), keyword(), keyword()) ::
  {:ok, pid()} | {:error, ASM.Error.t() | term()}

Starts Codex.AppServer from an ASM session plus optional ASM/native overrides.

extension()

native_capabilities()

@spec native_capabilities() :: [atom()]

native_surface_modules()

@spec native_surface_modules() :: [module()]

sdk_app()

@spec sdk_app() :: atom()

sdk_module()

@spec sdk_module() :: module()

thread_options(asm_opts, native_overrides \\ [])

@spec thread_options(keyword(), keyword()) ::
  {:ok, struct()} | {:error, ASM.Error.t()}

Derives Codex.Thread.Options from ASM-style Codex configuration.

ASM-derived thread defaults such as working directory, approval timeout, exec permission mode, and output schema stay on the ASM argument. Richer Codex-native fields such as personality, collaboration mode, attachments, or app-server family selection belong in native_overrides.

thread_options_for_session(session, asm_overrides \\ [], native_overrides \\ [])

@spec thread_options_for_session(term(), keyword(), keyword()) ::
  {:ok, struct()} | {:error, ASM.Error.t()}

Derives Codex.Thread.Options from an ASM session plus optional ASM/native overrides.