# `Codex.Protocol.Ops`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.18.1/lib/codex/protocol/ops.ex#L1)

Encoders for Codex protocol operations submitted to the runtime.

# `op_type`

```elixir
@type op_type() ::
  :interrupt
  | :user_input
  | :user_turn
  | :override_turn_context
  | :exec_approval
  | :patch_approval
  | :resolve_elicitation
  | :user_input_answer
  | :add_to_history
  | :get_history_entry_request
  | :list_mcp_tools
  | :refresh_mcp_servers
  | :list_custom_prompts
  | :list_skills
  | :compact
  | :undo
  | :thread_rollback
  | :review
  | :shutdown
  | :run_user_shell_command
  | :list_models
```

# `review_decision`

```elixir
@type review_decision() ::
  :approved
  | :approved_for_session
  | :denied
  | :abort
  | {:approved_execpolicy_amendment, term()}
```

# `t`

```elixir
@type t() :: %Codex.Protocol.Ops{payload: map(), type: op_type()}
```

Operation payload wrapper.

# `new`

```elixir
@spec new(op_type(), map()) :: t()
```

Builds a protocol operation wrapper.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Encodes an operation into a protocol map.

---

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