Agent Client Protocol (ACP) for Elixir.
A standardized protocol for communication between code editors (clients) and AI coding agents. This library provides the schema types, JSON-RPC primitives, behaviours, and connection management for building ACP-compliant clients and agents.
Schema Types
ACP.ProtocolVersion- Protocol version negotiationACP.Error- JSON-RPC error codes and constructorsACP.ContentBlock- Content blocks (text, image, audio, resource)ACP.Plan/ACP.PlanEntry- Execution plansACP.ToolCall/ACP.ToolCallUpdate- Tool call tracking
Agent Types
ACP.InitializeRequest/ACP.InitializeResponseACP.AuthenticateRequest/ACP.AuthenticateResponseACP.NewSessionRequest/ACP.NewSessionResponseACP.LoadSessionRequest/ACP.LoadSessionResponseACP.SetSessionModeRequest/ACP.SetSessionModeResponseACP.PromptRequest/ACP.PromptResponseACP.CancelNotificationACP.AgentCapabilities/ACP.SessionCapabilities
Client Types
ACP.SessionNotification/ACP.SessionUpdateACP.RequestPermissionRequest/ACP.RequestPermissionResponseACP.WriteTextFileRequest/ACP.ReadTextFileRequestACP.CreateTerminalRequest/ACP.TerminalOutputRequestACP.ClientCapabilities
Behaviours
ACP.Agent- Agent behaviour (initialize, prompt, cancel, etc.)ACP.Client- Client behaviour (request_permission, session_notification, etc.)
Connections
ACP.Connection- Low-level JSON-RPC GenServerACP.ClientSideConnection- Client-side connection wrapperACP.AgentSideConnection- Agent-side connection wrapper
RPC
ACP.RPC.Request/ACP.RPC.Response/ACP.RPC.NotificationACP.RPC.JsonRpcMessage- JSON-RPC 2.0 message wrapperACP.ClientSide/ACP.AgentSide- Side implementations for message decoding
Stream Broadcast
ACP.StreamBroadcast- PubSub for observing RPC message streamsACP.StreamMessage- Stream message struct
Summary
Types
@type session_id() :: String.t()