Files
deepseek-harness/examples/acp-agent/README.zh.md
T
Tianyi Cui d8dbb8235c refactor(acp): launch automation through the dsh acp profile
Replace the standalone @deepseek-ai/dsh-acp-demo application with dsh --profile acp plus ordered example patches. The shipped acp-app bundle owns only the protocol bridge; every example overlay now targets shared dsh-base rows instead of copying a complete application tree.

Move launcher responsibilities into the ACP snapshot harness: it materializes profile patches, links required packages, reserves stdout for JSON-RPC, observes spawn and drain failures, and escalates process teardown deterministically. The relocated control-surface fixture and the ACP/subagent integration tests now exercise the real CLI/profile path.

This commit contains authored runtime, configuration, and test changes only. Generated transcript and projection churn is deliberately left for the next commit so reviewers can inspect the migration logic without hundreds of expected-output edits.
2026-08-23 10:59:00 +08:00

2.3 KiB
Raw Blame History

acp-agent 示例

English | 中文

通过 JSON-RPC stdio 提供的面向自动化的 ACPAgent Client Protocol 服务器。它面向 parent agent(父智能体)、subagent 提供方和其他程序化客户端,而非产品 UI。

pnpm run demo:acp             # needs DEEPSEEK_API_KEY (repo-root .env or env)
pnpm run demo:code-mode       # same protocol with the Code Mode tool transport

dsh 启动器先应用随附 acp profiledsh-basedsh-acp-app),再应用本叶节点的 cordis.yml patch。profile 提供 ACP bridge、DeepSeek 适配器、受沙箱限制的 shell 与文件系统栈、批准策略、压缩(compaction)、subagent、工作流、会话查询索引和重复守卫;本叶节点固定 demo 与 snapshot 值并添加 hook bridge。bridge 为每次 session/new 创建一个新 agent,将会话持久化到 JSONL,并保持 stdout 只含协议内容。可选 patch overlay 可添加会话查询工具、spill 设置、Code Mode 或 Web 抓取。

协议通道

Stdout 只携带以换行分隔的 ACP JSON-RPC。@deepseek-ai/dsh-acp-app 与本 patch 均不安装 stdout logger;新增插件必须使用 stderr 输出诊断信息。

自动化约定(支持的方法、基线提示词内容、已提交文本输出,以及有意缺少的 UI 界面)位于 @deepseek-ai/dsh-acp

会话 workspace 与权限

每次 session/new 都提供一个绝对 cwd。受沙箱限制的 bash 和文件系统修改会以该会话 cwd 为基准应用 workspace-write,因此并发会话可以使用不同的项目根目录;平台临时根目录仍是共享可写暂存空间(参见沙箱约定)。DSH_PERMISSION_MODE 为部署选择 workspace-writedanger-full-access

workspace-write 下,如果模型重试请求更广泛的沙箱访问权限,就会触发 session/request_permission,选项为 allow_oncereject_once。客户端以程序方式决策;客户端放弃选择或无法给出答复时,系统会按拒绝处理。选定结果仅适用于该次重试,并通过常规工具结果/审计路径记录。服务器绝不公开权限选择器,也不持久化客户端策略。