# `ExMCP.ACP.Adapters.Pi.RPC`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.4.0/lib/ex_mcp/acp/adapters/pi/rpc.ex#L1)

Pure native RPC protocol helpers for the Pi ACP adapter.

Owns NDJSON envelope construction, command type names, inbound response
classification, and request-id correlation shapes. The root adapter retains
process ownership, Port I/O, and lifecycle state.

# `command`

```elixir
@type command() :: String.t()
```

# `control_entry`

```elixir
@type control_entry() :: %{
  rpc_id: request_id(),
  kind: control_kind(),
  group_id: String.t()
}
```

# `control_kind`

```elixir
@type control_kind() :: atom()
```

# `inbound`

```elixir
@type inbound() ::
  {:response, request_id(), {:ok, map()}}
  | {:response, request_id(), {:error, map()}}
  | {:event, String.t(), map()}
  | :unknown
```

# `request_id`

```elixir
@type request_id() :: String.t()
```

# `classify_inbound`

```elixir
@spec classify_inbound(term()) :: inbound()
```

# `compact`

```elixir
@spec compact(map() | term()) :: map() | term()
```

# `control_entry`

```elixir
@spec control_entry(request_id(), control_kind(), String.t()) :: control_entry()
```

# `decode_line`

```elixir
@spec decode_line(String.t()) :: inbound()
```

# `encode_many`

```elixir
@spec encode_many([map()]) :: binary()
```

# `encode_notification`

```elixir
@spec encode_notification(String.t(), map()) :: String.t()
```

# `encode_request`

```elixir
@spec encode_request(request_id(), String.t(), map()) :: String.t()
```

# `line`

```elixir
@spec line(map()) :: String.t()
```

# `method`

```elixir
@spec method(atom()) :: String.t()
```

# `methods`

```elixir
@spec methods() :: %{required(atom()) =&gt; String.t()}
```

# `next_prompt_id`

```elixir
@spec next_prompt_id(integer()) :: {request_id(), integer()}
```

# `notification`

```elixir
@spec notification(String.t(), map()) :: map()
```

# `prompt_id`

```elixir
@spec prompt_id(integer()) :: request_id()
```

# `request`

```elixir
@spec request(request_id(), String.t(), map()) :: map()
```

# `rpc_id`

```elixir
@spec rpc_id(integer()) :: request_id()
```

---

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