# `ASM.Extensions.ProviderSDK.Codex`
[🔗](https://github.com/nshkrdotcom/agent_session_manager/blob/v0.9.2/lib/asm/extensions/provider_sdk/codex.ex#L1)

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`.

# `available?`

```elixir
@spec available?() :: boolean()
```

# `codex_options`

```elixir
@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`

```elixir
@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`

```elixir
@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`

```elixir
@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`

```elixir
@spec extension() :: ASM.Extensions.ProviderSDK.Extension.t()
```

# `native_capabilities`

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

# `native_surface_modules`

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

# `sdk_app`

```elixir
@spec sdk_app() :: atom()
```

# `sdk_module`

```elixir
@spec sdk_module() :: module()
```

# `thread_options`

```elixir
@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`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
