@zaimokuza/dsh-acp-adapter 0.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/SECURITY.md +12 -0
- package/cordis.patch.yml +38 -0
- package/docs/agents/README.md +9 -0
- package/docs/agents/claude.md +20 -0
- package/docs/agents/codex.md +20 -0
- package/docs/agents/devin.md +25 -0
- package/docs/agents/kimi.md +22 -0
- package/docs/architecture.md +26 -0
- package/docs/compatibility.md +18 -0
- package/docs/getting-started.md +44 -0
- package/docs/operations.md +42 -0
- package/docs/troubleshooting.md +22 -0
- package/lib/client.js +11270 -0
- package/lib/client.js.map +1 -0
- package/lib/domain/observability/logging.js +73 -0
- package/lib/domain/observability/metrics.js +162 -0
- package/lib/domain/policy/capability-matrix.js +110 -0
- package/lib/domain/policy/errors.js +26 -0
- package/lib/domain/policy/events.js +176 -0
- package/lib/domain/policy/permissions.js +371 -0
- package/lib/domain/policy/platform/index.js +22 -0
- package/lib/domain/policy/platform/macos.js +59 -0
- package/lib/domain/policy/platform/staging.js +350 -0
- package/lib/domain/policy/platform/types.js +27 -0
- package/lib/domain/policy/platform/windows.js +75 -0
- package/lib/domain/policy/sandbox.js +282 -0
- package/lib/domain/session/agent-config.js +426 -0
- package/lib/domain/session/agent-state.js +51 -0
- package/lib/domain/session/agent.js +1905 -0
- package/lib/domain/session/launch-fingerprint.js +78 -0
- package/lib/domain/session/lifecycle.js +72 -0
- package/lib/domain/session/options-sync.js +360 -0
- package/lib/domain/session/resume.js +953 -0
- package/lib/host/composition/index.js +10 -0
- package/lib/host/composition/llm-stub.js +254 -0
- package/lib/host/composition/registry.js +401 -0
- package/lib/host/composition/subprocess.js +27 -0
- package/lib/host/factory/agent-loop.js +663 -0
- package/lib/host-compat/agent-loop.js +414 -0
- package/lib/host-compat/fiber-state.js +25 -0
- package/lib/host-compat/host-scope.js +193 -0
- package/lib/host-compat/structure-gate.js +248 -0
- package/lib/index.js +9 -0
- package/lib/persistence/options-snapshot.js +145 -0
- package/lib/persistence/sidecar.js +1088 -0
- package/lib/protocol/v1/commands.js +65 -0
- package/lib/protocol/v1/connection.js +572 -0
- package/lib/protocol/v1/errors.js +111 -0
- package/lib/protocol/v1/tool-content.js +76 -0
- package/lib/protocol/v1/tool-presentation.js +295 -0
- package/lib/protocol/v1/translate.js +1525 -0
- package/lib/protocol/v1/types.js +8 -0
- package/lib/remote/service.js +960 -0
- package/lib/runtime/process/agent-process.js +283 -0
- package/lib/runtime/process/stderr.js +49 -0
- package/lib/runtime/process/subprocess.js +100 -0
- package/lib/runtime/process/timeout.js +81 -0
- package/lib/runtime/process/types.js +9 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +985 -0
- package/lib/typert.remote-client.d.ts +38 -0
- package/lib/typert.remote-client.js +957 -0
- package/lib/types/client/data/acp-remote.d.ts +55 -0
- package/lib/types/client/data/controller.d.ts +115 -0
- package/lib/types/client/data/directory-controller.d.ts +57 -0
- package/lib/types/client/data/live-controller.d.ts +72 -0
- package/lib/types/client/data/logic.d.ts +444 -0
- package/lib/types/client/data/model-switch-controller.d.ts +66 -0
- package/lib/types/client/data/picker-service.d.ts +239 -0
- package/lib/types/client/data/picker-wire.d.ts +75 -0
- package/lib/types/client/data/selector-catalog.d.ts +121 -0
- package/lib/types/client/data/selector-logic.d.ts +472 -0
- package/lib/types/client/data/stores/directory-store.d.ts +31 -0
- package/lib/types/client/data/stores/disclosure-store.d.ts +23 -0
- package/lib/types/client/data/stores/engine.d.ts +84 -0
- package/lib/types/client/data/stores/live-options-store.d.ts +56 -0
- package/lib/types/client/data/stores/panel-store.d.ts +55 -0
- package/lib/types/client/data/stores/picker-store.d.ts +61 -0
- package/lib/types/client/data/tool-presentation.d.ts +153 -0
- package/lib/types/client/host-compat/model-picker/ModelPicker.d.ts +131 -0
- package/lib/types/client/host-compat/model-picker/popup.d.ts +74 -0
- package/lib/types/client/host-compat/model-picker/selector-locales.d.ts +142 -0
- package/lib/types/client/index.d.ts +51 -0
- package/lib/types/client/ui/AcpContextUsage.d.ts +79 -0
- package/lib/types/client/ui/AcpSection.d.ts +50 -0
- package/lib/types/client/ui/AcpToolRow.d.ts +79 -0
- package/lib/types/client/ui/locales.d.ts +126 -0
- package/lib/types/contract/remote.d.ts +406 -0
- package/lib/types/domain/observability/logging.d.ts +68 -0
- package/lib/types/domain/observability/metrics.d.ts +130 -0
- package/lib/types/domain/policy/capability-matrix.d.ts +63 -0
- package/lib/types/domain/policy/errors.d.ts +23 -0
- package/lib/types/domain/policy/events.d.ts +265 -0
- package/lib/types/domain/policy/permissions.d.ts +192 -0
- package/lib/types/domain/policy/platform/index.d.ts +17 -0
- package/lib/types/domain/policy/platform/macos.d.ts +28 -0
- package/lib/types/domain/policy/platform/staging.d.ts +167 -0
- package/lib/types/domain/policy/platform/types.d.ts +95 -0
- package/lib/types/domain/policy/platform/windows.d.ts +26 -0
- package/lib/types/domain/policy/sandbox.d.ts +251 -0
- package/lib/types/domain/session/agent-config.d.ts +335 -0
- package/lib/types/domain/session/agent-state.d.ts +71 -0
- package/lib/types/domain/session/agent.d.ts +652 -0
- package/lib/types/domain/session/launch-fingerprint.d.ts +52 -0
- package/lib/types/domain/session/lifecycle.d.ts +54 -0
- package/lib/types/domain/session/options-sync.d.ts +224 -0
- package/lib/types/domain/session/resume.d.ts +451 -0
- package/lib/types/host/composition/index.d.ts +10 -0
- package/lib/types/host/composition/llm-stub.d.ts +169 -0
- package/lib/types/host/composition/registry.d.ts +122 -0
- package/lib/types/host/composition/subprocess.d.ts +22 -0
- package/lib/types/host/factory/agent-loop.d.ts +209 -0
- package/lib/types/host-compat/agent-loop.d.ts +188 -0
- package/lib/types/host-compat/fiber-state.d.ts +25 -0
- package/lib/types/host-compat/host-scope.d.ts +71 -0
- package/lib/types/host-compat/structure-gate.d.ts +80 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/persistence/options-snapshot.d.ts +52 -0
- package/lib/types/persistence/sidecar.d.ts +588 -0
- package/lib/types/protocol/v1/commands.d.ts +80 -0
- package/lib/types/protocol/v1/connection.d.ts +198 -0
- package/lib/types/protocol/v1/errors.d.ts +60 -0
- package/lib/types/protocol/v1/tool-content.d.ts +46 -0
- package/lib/types/protocol/v1/tool-presentation.d.ts +217 -0
- package/lib/types/protocol/v1/translate.d.ts +838 -0
- package/lib/types/protocol/v1/types.d.ts +153 -0
- package/lib/types/remote/service.d.ts +426 -0
- package/lib/types/runtime/process/agent-process.d.ts +112 -0
- package/lib/types/runtime/process/stderr.d.ts +24 -0
- package/lib/types/runtime/process/subprocess.d.ts +146 -0
- package/lib/types/runtime/process/timeout.d.ts +48 -0
- package/lib/types/runtime/process/types.d.ts +86 -0
- package/package.json +145 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zaimokuza
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# @zaimokuza/dsh-acp-adapter
|
|
2
|
+
|
|
3
|
+
将外部 [Agent Client Protocol (ACP)](https://agentclientprotocol.com/) Agent 接入
|
|
4
|
+
[DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 的插件。DSH
|
|
5
|
+
继续负责会话、工作区、审批和宿主审计;ACP Agent 负责自己的推理、工具和运行时状态。
|
|
6
|
+
|
|
7
|
+
当前包为发布候选版本,已针对 DSH `0.1.1-rc.2` 在 macOS 上验证。Windows、远程 ACP
|
|
8
|
+
transport、同一会话跨 backend 迁移和 DSH tools/skills/MCP 注入不在已验证范围内。
|
|
9
|
+
|
|
10
|
+
## 安装
|
|
11
|
+
|
|
12
|
+
先安装并启动 DSH `0.1.1-rc.2`,然后在目标 profile 中安装插件:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
dsh plugin --profile web add @zaimokuza/dsh-acp-adapter
|
|
16
|
+
dsh web
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
本地 tarball 验证时,从本仓库执行 `pnpm pack`,再把生成的 `.tgz` 的绝对路径传给
|
|
20
|
+
`dsh plugin --profile web add`。发布前请用干净 profile 验证安装和卸载;不要把本机
|
|
21
|
+
认证文件复制到插件目录或日志中。
|
|
22
|
+
|
|
23
|
+
最低宿主版本是 `0.1.1-rc.2`。peer 依赖接受该版本及更高版本,但结构兼容门和本项目
|
|
24
|
+
实际验收仍以 rc.2 为准;不支持 rc.8。Node.js 支持范围与 DSH `0.1.1-rc.2` 一致:
|
|
25
|
+
`^22.19.0 || >=24.0.0`;本仓库门禁使用 Node 24.19.0 与 pnpm 11.7.0。
|
|
26
|
+
|
|
27
|
+
## 第一步
|
|
28
|
+
|
|
29
|
+
1. 按 [入门指南](docs/getting-started.md) 检查 DSH 与插件状态。
|
|
30
|
+
2. 先在 Agent 自己的 CLI 中完成登录和健康检查,再在 DSH ACP 设置中选择内置模板。
|
|
31
|
+
3. 创建一个 ACP 会话,确认 health 状态为 `ready` 后再发送 prompt。
|
|
32
|
+
4. 在 [Agent 指南索引](docs/agents/README.md) 中查阅命令、模型/mode 和数据目录说明。
|
|
33
|
+
|
|
34
|
+
登录始终由 Agent 自己管理。插件只使用命令、环境变量名和 opaque 路径引用,不读取、
|
|
35
|
+
复制或记录 token、cookie、配置中的 secret value。
|
|
36
|
+
|
|
37
|
+
## 能力与安全边界
|
|
38
|
+
|
|
39
|
+
- DSH 会话的 execution backend 在创建后不变;跨 native/ACP 必须新建会话。
|
|
40
|
+
- ACP 模型、mode 和思考强度只在 Agent 真实暴露相应 config option 时显示。
|
|
41
|
+
- `allowed-once` 审批保持一次性语义,绝不会映射为 `allow_always`。
|
|
42
|
+
- 会话恢复先做 staging reconciliation;无法证明连续性就 fail closed,不静默新建
|
|
43
|
+
ACP 会话接续旧 DSH 历史。
|
|
44
|
+
- sidecar 保存 ACP binding、恢复和审批审计;DSH session log 仍是用户可见历史真源。
|
|
45
|
+
- 外部 Agent 的 tools、skills、MCP、system prompt、原生 token 统计和重试策略不会
|
|
46
|
+
自动变成 DSH 原生能力。
|
|
47
|
+
|
|
48
|
+
详细边界见 [架构说明](docs/architecture.md)、[兼容性](docs/compatibility.md) 和
|
|
49
|
+
[安全说明](SECURITY.md)。
|
|
50
|
+
|
|
51
|
+
## 文档
|
|
52
|
+
|
|
53
|
+
- [入门与安装](docs/getting-started.md)
|
|
54
|
+
- [Agent 指南索引](docs/agents/README.md):[Devin](docs/agents/devin.md) · [Codex](docs/agents/codex.md) · [Kimi](docs/agents/kimi.md) · [Claude](docs/agents/claude.md)
|
|
55
|
+
- [操作与验收](docs/operations.md)
|
|
56
|
+
- [架构与生命周期](docs/architecture.md)
|
|
57
|
+
- [兼容性与已知限制](docs/compatibility.md)
|
|
58
|
+
- [故障排查](docs/troubleshooting.md)
|
|
59
|
+
- [安全策略](SECURITY.md)
|
|
60
|
+
|
|
61
|
+
## 本地开发
|
|
62
|
+
|
|
63
|
+
合同测试需要 DSH `0.1.1-rc.2` 的只读源码基线;该目录已被 Git 忽略:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git clone --depth 1 --branch dsh-v0.1.1-rc.2 \
|
|
67
|
+
https://github.com/deepseek-ai/deepseek-harness.git reference/deepseek-harness
|
|
68
|
+
export DSH_UPSTREAM_CHECKOUT="$PWD/reference/deepseek-harness"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
然后串行运行:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pnpm install --frozen-lockfile
|
|
75
|
+
pnpm typecheck
|
|
76
|
+
pnpm test
|
|
77
|
+
pnpm build
|
|
78
|
+
pnpm pack --dry-run
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
测试和构建必须串行执行,因为它们共享 `lib/` 与 `.typert/`。发布前还应运行
|
|
82
|
+
`pnpm check:stale-build`、`pnpm check:picker-diff` 和不带真实凭证的 install gate。
|
|
83
|
+
|
|
84
|
+
## 许可证
|
|
85
|
+
|
|
86
|
+
MIT,见 [LICENSE](LICENSE)。
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# 安全策略
|
|
2
|
+
|
|
3
|
+
本插件采用 external-login-only:认证由 Devin、Codex、Kimi 或 Claude 自己的 CLI 管理。
|
|
4
|
+
插件不会读取、复制、解析或回传 token、cookie、私钥、credential 文件内容;日志和
|
|
5
|
+
sidecar 只保存 opaque 路径引用、键名、哈希或脱敏摘要。
|
|
6
|
+
|
|
7
|
+
请不要在 issue、日志或测试夹具中提交凭证、完整环境变量、私有工作区内容或未脱敏的
|
|
8
|
+
ACP payload。若发现疑似泄漏,请不要公开创建 issue,发送最小化复现、受影响版本和
|
|
9
|
+
文件路径到仓库维护者,并在可能时先撤销/轮换凭证。报告中只保留类别和脱敏片段。
|
|
10
|
+
|
|
11
|
+
安全边界包括 host structure gate、进程终止梯子、审批语义保持、staging reconciliation
|
|
12
|
+
和模型切换 CAS;外部 Agent 自身的工具策略不等于 DSH sandbox 保证。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @zaimokuza/dsh-acp-adapter bundle patch layer for the DSH rc.2 host.
|
|
2
|
+
# The rows below replace the stock agent loop and model-selection contributions.
|
|
3
|
+
#
|
|
4
|
+
# This file becomes one patch layer when the package is listed in a profile's
|
|
5
|
+
# dsh.profile.bundles (`dsh plugin --profile <name> add <path>` reconciles it
|
|
6
|
+
# there). The Loader composes every bundle layer over the empty profile root in
|
|
7
|
+
# ONE applyEntryPatches call (vendor/include/src/index.ts:58), so the rows
|
|
8
|
+
# below address the stock rows inserted by @deepseek-ai/dsh-base and
|
|
9
|
+
# @deepseek-ai/dsh-web-app.
|
|
10
|
+
#
|
|
11
|
+
# Legacy replacement form: the
|
|
12
|
+
# vendored applyEntryPatches refuses id-targeted `name` swaps ("name mismatch
|
|
13
|
+
# ... skipping" — name is the match guard), so replacement = disable the
|
|
14
|
+
# original row + insert the subclass under a fresh id, restating the row's
|
|
15
|
+
# whole owned `config` (a patch replaces the targeted row's entire config
|
|
16
|
+
# rather than merging into it).
|
|
17
|
+
|
|
18
|
+
# Row ①: replace the agent-loop row with this package's AcpAgentLoop.
|
|
19
|
+
# The stock row (dsh-base cordis.patch.yml:436-439) carries
|
|
20
|
+
# `config: {agents: []}`; its maxParallelToolCalls is the schema default 10
|
|
21
|
+
# (core/agent-loop/src/constants.ts:6, resolveMaxParallelToolCalls at
|
|
22
|
+
# core/agent-loop/src/index.ts:133-134). The insert restates both keys with
|
|
23
|
+
# those exact values, so non-ACP sessions behave identically to stock.
|
|
24
|
+
- id: agent-loop
|
|
25
|
+
disabled: true
|
|
26
|
+
|
|
27
|
+
- insert:
|
|
28
|
+
- id: agent-loop-acp
|
|
29
|
+
name: '@zaimokuza/dsh-acp-adapter'
|
|
30
|
+
config:
|
|
31
|
+
maxParallelToolCalls: 10
|
|
32
|
+
agents: []
|
|
33
|
+
|
|
34
|
+
# Row ②: the enhanced ACP model picker replaces the built-in
|
|
35
|
+
# model-selection UI row (dsh-web-app cordis.patch.yml:249-251, no config of
|
|
36
|
+
# its own, so a plain id-targeted disable suffices).
|
|
37
|
+
- id: ui-model-selection
|
|
38
|
+
disabled: true
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Claude
|
|
2
|
+
|
|
3
|
+
## CLI 检查
|
|
4
|
+
|
|
5
|
+
插件使用 `claude-agent-acp`。请先按 Claude CLI 的官方流程完成登录,并在不暴露账户
|
|
6
|
+
详情的前提下确认可执行:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
claude-agent-acp --version
|
|
10
|
+
claude-agent-acp --help
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Claude 的认证由下游 CLI 管理;插件不读取认证目录,也不替用户 login/logout。若使用
|
|
14
|
+
自定义可执行文件,可在 DSH profile 中指定 `CLAUDE_CODE_EXECUTABLE`。
|
|
15
|
+
|
|
16
|
+
## 模型与配置
|
|
17
|
+
|
|
18
|
+
Claude session 返回的 model/config options 才是可选目录。切换通过 DSH 的模型事务和
|
|
19
|
+
Agent 的 config option 写入口完成;CAS 冲突不会覆盖并发用户选择。重启恢复时,插件
|
|
20
|
+
先恢复 binding 和已提交选择,再允许 prompt。
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Codex
|
|
2
|
+
|
|
3
|
+
## CLI 检查
|
|
4
|
+
|
|
5
|
+
插件使用 `codex-acp`:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
codex-acp --version
|
|
9
|
+
codex login
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
登录和认证状态由 Codex 自己管理。插件只使用 `CODEX_HOME` 的 opaque 路径引用,绝不
|
|
13
|
+
读取或输出 auth 文件内容。若本机 CLI 不接受上述命令,请以当前 `codex-acp --help`
|
|
14
|
+
为准,并在 DSH 配置中填写实际可执行文件。
|
|
15
|
+
|
|
16
|
+
## 审批与子任务
|
|
17
|
+
|
|
18
|
+
Codex 可能通过 ACP 请求一次性权限;在 DSH 中选择 `allowed-once` 时,回传 option
|
|
19
|
+
必须仍是 `allow_once`。Codex collaboration/subagent 事件只作有界的工具过程和终态
|
|
20
|
+
摘要展示,不等价于 DSH 原生 child session。
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Devin
|
|
2
|
+
|
|
3
|
+
## CLI 检查
|
|
4
|
+
|
|
5
|
+
插件使用 `devin acp`。先在 Devin 自己的终端完成登录,再检查 CLI:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
devin --version
|
|
9
|
+
devin auth login
|
|
10
|
+
devin auth status
|
|
11
|
+
devin acp --help
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`devin auth status` 的账户详情不要复制到日志或 issue。插件只保留认证路径的 opaque
|
|
15
|
+
引用,不打开 credentials 文件。
|
|
16
|
+
|
|
17
|
+
## DSH 配置
|
|
18
|
+
|
|
19
|
+
选择 Devin 内置模板,确认 workspace 权限与 Agent mode。Devin 的 ACP 会话状态可能
|
|
20
|
+
需要宿主临时目录;workspace-write 会话会经过状态目录和恢复对账门。审批被拒后,
|
|
21
|
+
恢复无法证明连续性时会进入 `reconciliation-required`,请回滚或新建会话,不要强行
|
|
22
|
+
继续旧历史。
|
|
23
|
+
|
|
24
|
+
Devin 不保证每个 `request_permission` 都带工具名称;审批面板会显示脱敏的 fallback
|
|
25
|
+
和有界目标信息,不会伪造工具名。
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Kimi
|
|
2
|
+
|
|
3
|
+
## CLI 检查
|
|
4
|
+
|
|
5
|
+
本机验证过 Kimi CLI 提供以下入口:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
kimi --version
|
|
9
|
+
kimi login
|
|
10
|
+
kimi doctor
|
|
11
|
+
kimi acp --help
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
请在 Kimi 自己的 CLI/浏览器流程中登录和修复健康问题。插件只引用 Kimi data home
|
|
15
|
+
中的 opaque 配置、credentials 和 oauth 路径,不读取、复制或记录其中的值。
|
|
16
|
+
|
|
17
|
+
## DSH 配置
|
|
18
|
+
|
|
19
|
+
选择 Kimi 模板后先等待 health 为 `ready`,再创建 ACP 会话。模型和思考选项以本次
|
|
20
|
+
Agent session 实际返回的 config options 为准;没有实时 option 时,界面不会猜测或
|
|
21
|
+
伪造模型身份。无需、也不要把 credential 或环境变量值填入 DSH;只在 ACP 面板选择
|
|
22
|
+
Kimi 模板并执行重新检查。Kimi 的文本、工具和上下文占用展示遵守统一 ACP 边界。
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# 架构说明
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
DSH host / Cordis
|
|
5
|
+
│ typed Remote + host structure gate
|
|
6
|
+
├── host/ 组合、profile、进程生命周期
|
|
7
|
+
├── protocol/v1/ ACP RPC 门卫、事件翻译、展示信封
|
|
8
|
+
├── domain/session/ binding、resume、reconciliation、options
|
|
9
|
+
├── domain/policy/ sandbox、审批、脱敏与能力矩阵
|
|
10
|
+
├── persistence/ sidecar SQLite 审计与恢复辅助状态
|
|
11
|
+
└── client/data + ui picker、模型事务、面板与工具卡
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
依赖方向从 host/protocol 经过 domain/persistence 到 typed remote/client glue;上游
|
|
15
|
+
`ModelPicker` 复制壳仅存在于 `client/host-compat/model-picker/`,不承载 ACP 业务逻辑。
|
|
16
|
+
兼容岛结构漂移时 fail closed,保护 DSH native 路由。
|
|
17
|
+
|
|
18
|
+
## 生命周期
|
|
19
|
+
|
|
20
|
+
创建时先启动和初始化 Agent,再持久化 binding,最后才允许首个 prompt。恢复时先在
|
|
21
|
+
staging 中 `session/load`,逐项核对 DSH 历史与 ACP 终态;无法证明同一会话就阻止续问。
|
|
22
|
+
模型切换使用 begin → Agent apply → DSH select → commit 的事务边界,CAS 冲突只回报
|
|
23
|
+
并发状态,不覆盖后来选择。
|
|
24
|
+
|
|
25
|
+
DSH session log 是用户可见历史真源。DSH rc.2 没有可忽略自定义事件写入口,因此 ACP
|
|
26
|
+
审批、binding、对账和降级审计写入 sidecar;sidecar 不是第二份对话历史。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# 兼容性
|
|
2
|
+
|
|
3
|
+
| 项目 | 接受范围 | 已验证 |
|
|
4
|
+
| --- | --- | --- |
|
|
5
|
+
| DSH | `>=0.1.1-rc.2` | `0.1.1-rc.2` |
|
|
6
|
+
| Node.js | `^22.19.0 || >=24.0.0` | 24.19.0 |
|
|
7
|
+
| 平台 | 以宿主和 Agent CLI 为准 | macOS |
|
|
8
|
+
| Agent | Devin / Codex / Kimi / Claude ACP | 各自的当前 descriptor 版本 |
|
|
9
|
+
|
|
10
|
+
“接受范围”是 package metadata 的版本约束,不等于每个版本或平台都经过真实 E2E。
|
|
11
|
+
Windows 尚未验收,不属于当前已验证平台;rc.8 不在兼容范围。远程 ACP transport、
|
|
12
|
+
跨 backend history handoff、通用 credential broker 和 DSH tools/skills/MCP 注入也不在
|
|
13
|
+
当前产品范围。
|
|
14
|
+
|
|
15
|
+
已知限制:被拒工具缺失导致的 Devin replay divergence 会被恢复对账拦截(fail closed);
|
|
16
|
+
DSH 会话删除没有 sidecar 删除钩子,插件 retention/compact 只能按自身生命周期清理;
|
|
17
|
+
完整 controller 故障注入需要宿主公开 seam,自动化矩阵覆盖了该补偿逻辑,但不冒充真机
|
|
18
|
+
DSH rejection 证据。
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# 入门
|
|
2
|
+
|
|
3
|
+
## 环境
|
|
4
|
+
|
|
5
|
+
- DSH `0.1.1-rc.2` 或更高版本(本项目已验证 rc.2;不支持 rc.8)。
|
|
6
|
+
- Node.js `^22.19.0 || >=24.0.0`,门禁版本 Node 24.19.0。
|
|
7
|
+
- 一个已安装、可独立运行的 ACP Agent CLI。
|
|
8
|
+
|
|
9
|
+
## 安装插件
|
|
10
|
+
|
|
11
|
+
公开包安装:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
dsh plugin --profile web add @zaimokuza/dsh-acp-adapter
|
|
15
|
+
dsh web
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
本地开发或发布前验证:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm pack
|
|
22
|
+
dsh plugin --profile web add /absolute/path/to/zaimokuza-dsh-acp-adapter-*.tgz
|
|
23
|
+
dsh web
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
卸载使用 `dsh plugin --profile web remove @zaimokuza/dsh-acp-adapter`。安装、卸载和
|
|
27
|
+
验证应在测试 profile 中完成;不要把生产 profile 的状态目录用于试验。
|
|
28
|
+
|
|
29
|
+
## 创建第一个 ACP 会话
|
|
30
|
+
|
|
31
|
+
1. 按 [Agent 指南索引](agents/README.md) 完成 CLI 自己的登录与健康检查。
|
|
32
|
+
2. 打开 DSH ACP 设置,选择 Devin、Codex、Kimi 或 Claude 模板。
|
|
33
|
+
3. 确认命令可执行、协议初始化通过、health 为 `ready`。
|
|
34
|
+
4. 选择 Agent 暴露的 model/mode/config option 后创建会话。
|
|
35
|
+
5. 首次 prompt 前确认设置面板已经显示 workspace 权限和 Agent mode 两条独立信息。
|
|
36
|
+
|
|
37
|
+
ACP 会话创建后 backend 不可变。需要从 native 切到 ACP,或从一个 ACP runtime 切到
|
|
38
|
+
另一个 runtime 时,请新建会话;插件不会把历史隐式迁移到新 Agent。
|
|
39
|
+
|
|
40
|
+
## 不要做的事
|
|
41
|
+
|
|
42
|
+
不要在插件配置、shell 日志、测试夹具或 issue 中粘贴认证文件、token、cookie、环境
|
|
43
|
+
变量值或完整 command line。问题报告请只保留 Agent 名称、版本、health 状态和脱敏的
|
|
44
|
+
错误类别。
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# 操作与发布检查
|
|
2
|
+
|
|
3
|
+
## 日常诊断
|
|
4
|
+
|
|
5
|
+
先记录 profile、Agent 命令、版本、health 状态和错误类别,不记录环境变量值或认证文件。
|
|
6
|
+
按顺序检查 DSH、Agent CLI、ACP initialize、临时 session 和目标 workspace 权限。health
|
|
7
|
+
不是 ready 时不要创建会话;已有会话按 UI 提供的回滚或新建出口处理。
|
|
8
|
+
|
|
9
|
+
## 本地门禁
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm install --frozen-lockfile
|
|
13
|
+
pnpm typecheck
|
|
14
|
+
pnpm test
|
|
15
|
+
pnpm build
|
|
16
|
+
pnpm pack --dry-run
|
|
17
|
+
pnpm check:stale-build
|
|
18
|
+
pnpm check:picker-diff
|
|
19
|
+
git diff --check
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
这些命令串行执行。install gate 必须使用隔离 profile 和 tarball;不带凭证运行时只验
|
|
23
|
+
证凭证缺失的降级路径,不为了门禁读取或打印已有 key,也不发送真实模型 prompt。
|
|
24
|
+
|
|
25
|
+
## 发布前
|
|
26
|
+
|
|
27
|
+
从最终工作树重新 `pnpm pack`,检查 tarball 只包含 lib、patch、许可证、README 和 docs
|
|
28
|
+
用户文档;在干净 DSH rc.2 profile 完成 install/boot/uninstall 后,再由发布负责人执行
|
|
29
|
+
npm/GitHub Actions。未实际执行的 CI、npm publish、Windows 或 Agent E2E 不得写成 PASS。
|
|
30
|
+
|
|
31
|
+
## npm 发布
|
|
32
|
+
|
|
33
|
+
首次发布需要维护者用 npm 账户完成一次 bootstrap。确认 `npm whoami` 返回包 scope 的
|
|
34
|
+
所有者,创建并推送与 `package.json` 完全一致的 tag(例如 `v0.1.0-rc.1`),然后执行
|
|
35
|
+
`pnpm verify:release` 和 `npm publish --access public --tag next`。前一个命令会验证当前
|
|
36
|
+
HEAD 正好位于版本 tag;预发布版本禁止占用 `latest`。
|
|
37
|
+
|
|
38
|
+
首次发布后,在 npm 包设置中把 GitHub Actions Trusted Publisher 绑定到
|
|
39
|
+
`zaimokuza-yoshiteru/dsh-acp-adapter`、工作流 `publish.yml` 和 environment
|
|
40
|
+
`npm-publish`,允许 `npm publish`。后续版本只需更新版本号、通过 CI、创建对应 tag,
|
|
41
|
+
再从该 tag 手动运行 `publish npm` 工作流。工作流使用 OIDC,不读取长期 npm token;
|
|
42
|
+
预发布版本自动进入 `next`,稳定版本自动进入 `latest`。
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# 故障排查
|
|
2
|
+
|
|
3
|
+
## health 不是 ready
|
|
4
|
+
|
|
5
|
+
确认 CLI 可执行、外部登录已完成、workspace 权限允许 Agent data home,并重新运行 Agent
|
|
6
|
+
自己的 doctor/help。插件不读取凭证;若认证失效,回到 Agent CLI 修复后重新检查。
|
|
7
|
+
|
|
8
|
+
## 审批没有通过
|
|
9
|
+
|
|
10
|
+
检查请求的 tool name/reason 是否为有界脱敏文本,并确认 UI 选择的是 `allowed-once`。
|
|
11
|
+
仅提供 `allow_always` 的 Agent 选项会被拒绝,插件不会把它降级成一次性允许。
|
|
12
|
+
|
|
13
|
+
## 会话变成 reconciliation-required
|
|
14
|
+
|
|
15
|
+
这是 fail-closed 保护:DSH 历史和 Agent 回放无法证明一致。不要删除或手改 sidecar。
|
|
16
|
+
按 UI 选择回滚、rebind blank 或新建 ACP 会话;需要报告时只提供 session id、状态和脱敏
|
|
17
|
+
错误类别。
|
|
18
|
+
|
|
19
|
+
## 模型切换失败
|
|
20
|
+
|
|
21
|
+
并发写入会显示 conflict,插件不会覆盖后来选择。补偿失败会同时说明新会话是否创建、
|
|
22
|
+
默认模型是否恢复;按提示人工检查 DSH 设置,再重试单次切换。
|