Pure native app-server protocol helpers for the Codex ACP adapter.
Owns envelope construction, method names, inbound response classification, and pending-request correlation shapes. The root adapter retains process ownership, Port I/O, and lifecycle state.
Summary
Types
@type inbound() :: {:response, request_id(), {:ok, term()}} | {:response, request_id(), {:error, term()}} | {:request, request_id(), String.t(), map()} | {:notification, String.t(), map()} | :unknown
@type request_entry() :: %{type: request_type(), acp_id: term(), meta: map()}
@type request_type() :: atom()
Functions
@spec encode_error(request_id(), integer(), String.t()) :: iodata()
@spec encode_request(request_id(), String.t(), map() | nil) :: iodata()
@spec encode_response(request_id(), term()) :: iodata()
@spec error(request_id(), integer(), String.t()) :: map()
@spec request(request_id(), String.t(), map() | nil) :: map()
@spec request_entry(request_type(), term(), map()) :: request_entry()
@spec response(request_id(), term()) :: map()