dushaobindoudou/dsh-acp0

dsh-acp

适用于 DeepSeek Harness (dsh) 的 Agent Client Protocol (ACP) 服务端插件——通过 Zed 和任何 ACP 客户端驱动 dsh 智能体

AI 分析

核心用途是建立 ACP 服务端,允许用户从 Zed、JetBrains 等支持 ACP 协议的外部编辑器中直接调用和驱动 DSH 编程智能体。适合习惯在本地 IDE 中编写代码的开发者。

包名
dsh-acp
版本
0.1.0
许可证
MIT
最近更新
2026年8月17日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:dushaobindoudou/dsh-acp

dsh-acp

CI License: MIT

Agent Client Protocol (ACP) server for the DeepSeek Harness (dsh).

Drive a full dsh coding agent - streaming output, tool calls, permission prompts, durable sessions - from Zed, JetBrains, or any ACP v1 client, exactly like opencode or Gemini CLI.

English | 中文

What it does

dsh-acp is a dsh profile bundle: booting dsh --profile acp starts the entire DeepSeek Harness (agent loop, tools, sandbox, session persistence) with an ACP v1 JSON-RPC server on stdio instead of the web UI.

M1 (current release) implements:

ACP methodStatus
initialize✅ capabilities + agent info
session/new✅ creates a durable dsh agent (persisted under $DSH_HOME/sessions)
session/prompt✅ streaming agent_message_chunk / agent_thought_chunk (reasoning), plan updates, {stopReason}
tool calls✅ full lifecycle: tool_call (pending, with title/kind/locations/rawInput) → in_progresscompleted/failed with content
session/request_permission✅ dsh's approval seam bridged to the client (allow once/always, reject once/always)
session/cancel✅ aborts the turn, prompt resolves cancelled
session/close✅ cancels, flushes, disposes the agent

Roadmap: session/load replay, session/resume/list, modes (plan mode) + config options (model), slash commands, images, elicitation - see the design doc.

Install

Requires Node.js ≥ 22, pnpm, and the dsh CLI (npm i -g @deepseek-ai/dsh).

# from a checkout of this repo (published package works the same way)
node bin/setup-profile.mjs --pkg /path/to/dsh-acp

# boots the ACP server on stdio
dsh --profile acp

The setup script creates $DSH_HOME/profiles/acp with dsh.profile.bundles = ["@deepseek-ai/dsh-base", "dsh-acp"] and installs the bundle via pnpm. Re-run it any time; --force rewrites the manifest.

Use with Zed

Zed → Settings → agent_servers:

{
  "dsh": {
    "type": "custom",
    "command": "dsh-acp",
    "args": []
  }
}

dsh-acp (installed by this package) is a thin launcher for dsh --profile acp; point DSH_BIN at a non-PATH dsh. Model credentials come from the usual dsh places ($DSH_HOME settings / DEEPSEEK_API_KEY), shared with the web UI - no second setup.

Development

pnpm install
pnpm run build     # tsc -> lib/
pnpm test          # unit tests (pure translation layer)

# end-to-end: boots the REAL dsh --profile acp in a throwaway $DSH_HOME
# with a deterministic mock LLM, and asserts the full M1 wire behavior
node test/e2e/e2e.test.mjs

The e2e harness is also the fastest way to iterate on protocol behavior: it drives initialize → new → prompt (text) → prompt (tool call) → close over real stdio.

How it maps

ACP client (Zed) ⇄ NDJSON JSON-RPC ⇄ dsh-acp plugin ⇄ dsh services
                                          ├─ ctx.agents.create/resume   (session/new, load)
                                          ├─ agent.followup/cancel      (session/prompt, cancel)
                                          ├─ 'session/event'            (streaming session/update)
                                          ├─ 'approval/request'         (session/request_permission)
                                          └─ dsh-base: tools, sandbox, persistence, settings

Full research behind every mapping: research/ - ACP protocol, DSH architecture, prior art, design blueprint.

Contributing

PRs welcome - see CONTRIBUTING.md. Milestone plan lives in research/acp-dsh-design.md §4.

License

MIT