Agentic.Protocol.ACP (agentic v0.2.2)

Copy Markdown

Generic ACP (Agent Client Protocol) implementation.

Implements Agentic.AgentProtocol for any ACP-compatible agent. One module handles all ACP agents -- the agent identity (kimi, cursor, etc.) is specified via backend config, not via separate modules.

Usage

# Direct use
{:ok, session_id} = Agentic.Protocol.ACP.start(
  %{command: "kimi", args: ["acp"], workspace: "/path"},
  context
)

# Via registry
Agentic.Protocol.Registry.register({:acp, :kimi}, Agentic.Protocol.ACP)
{:ok, module} = Agentic.Protocol.Registry.lookup({:acp, :kimi})

Backend Config

%{
  command: "kimi",           # CLI binary name
  args: ["acp"],             # Arguments to enable ACP mode
  env: %{},                  # Extra environment variables
  workspace: "/path/to/dir", # Working directory (cwd)
  mcp_servers: [],           # MCP servers to forward to agent
  permission_policy: :ask    # :ask | :allow_all | :deny_all
}

Summary

Functions

Check availability for a specific agent command.

Callback implementation for Agentic.AgentProtocol.get_usage/1.

Functions

available_for?(command)

@spec available_for?(String.t()) :: boolean()

Check availability for a specific agent command.

Unlike other protocols, ACP availability depends on the command specified in the backend config. Use available_for?/1 to check.

estimate_cost(_)

Callback implementation for Agentic.AgentProtocol.estimate_cost/1.

get_usage(_)

Callback implementation for Agentic.AgentProtocol.get_usage/1.

stream_message(_, _, _)

Callback implementation for Agentic.AgentProtocol.stream_message/3.