Skip to content

Agent Client Protocol (ACP) is a JSON-RPC-based protocol for talking to agent runtimes. dsh ships an automation-only ACP server (packages/acp/acp) over JSON-RPC stdio: programmatic clients create fresh harness agents, send text prompts, collect committed assistant text, resolve one-shot permission requests by policy, and cancel work. The primary in-repository client is dsh-subagent-acp (see Subagents).

PackageRole
@deepseek-ai/dsh-acpACP server plugin over JSON-RPC stdio
@deepseek-ai/dsh-subagent-acpACP-backed subagent transport

What this package is (and is not)

From packages/acp/acp/README.md: this package is a transport adapter, not a UI integration or a capability seam. It does not expose editor navigation, transcript replay, commands, modes, configuration pickers, elicitation, reasoning, plans, titles, or tool presentation — interactive rendering and human questions belong to the Web host and client modules. The server's surface is deliberately small: the automation contract only.

Plugin and configuration

apply(ctx, config) opens an AgentSideConnection on stdin/stdout and drives ctx.agents. Stdout is reserved for protocol frames.

ConfigDefaultMeaning
providerInitial provider route for every created agent
modelInitial model for every created agent

Both fields are optional so another agent/request listener may supply the target; the runnable ACP composition requires both.

Protocol contract

MethodBehavior
initializeNegotiates the supported version and advertises baseline-only prompts (no image, audio, or embedded-context capability). No session, editor, terminal, filesystem, or MCP capability is advertised.
authenticateNo-op, because the server advertises no authentication methods.
(task methods)Fresh agents per task, text prompts in, committed assistant text out, one-shot permission requests resolved by policy, cancellation supported.

The implementation lives in packages/acp/acp/src/index.ts (the plugin, connection loop, method dispatch), codec.ts (JSON-RPC frame codec over stdio), and invariant.ts (its invariant companion, per the repo's per-package invariant convention).

The consumer: dsh-subagent-acp

The ACP server is not a standalone product surface; inside dsh it is the backend of the acp subagent transport. When an agent spawns a subagent through ctx.subagents with the ACP transport, dsh-subagent-acp launches the ACP server (a fresh harness agent inside a child process speaking ACP over stdio) and proxies the delegation through it — giving the subagent an isolated process boundary while keeping the uniform subagent API (see Subagents for the transport matrix: spawn, fork, acp, codex/claude-code/dsh-sdk).

The worked examples

Two runnable examples demonstrate the server surface:

  • examples/acp-agent (acp-agent-example) — an ACP server composition over JSON-RPC stdio: boot the dsh-acp bundle, accept client sessions, run the agent loop, stream text back.
  • packages/examples/acp-demo (@deepseek-ai/dsh-acp-demo) — the in-tree demo plugin that examples/acp-agent's cordis.yml wires into the server, providing the provider/model config that shows the server in action.

Key source files

Repo-relative pathWhat it provides
packages/acp/acp/src/index.tsPlugin, AgentSideConnection, method dispatch
packages/acp/acp/src/codec.tsJSON-RPC frame codec
packages/subagent/subagent-acp/src/The ACP subagent transport
examples/acp-agent/Server-side worked example
packages/examples/acp-demo/The demo plugin the example boots

Further reading

  • Subagents — the transport matrix and dsh-subagent-acp
  • SDK Protocol — dsh's other JSON-RPC wire, for comparison
  • Examples & Demos — how to run acp-agent and acp-demo
  • Repo: packages/acp/acp/README.md, packages/subagent/subagent-acp/README.md