agentdock-cli 1.2.0 → 1.4.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/README.md +59 -2
- package/dist/package.json +2 -2
- package/dist/src/agents/registry.js +551 -0
- package/dist/src/agents/semantic.js +208 -0
- package/dist/src/cli.js +3 -0
- package/dist/src/commands/agents.js +84 -0
- package/dist/src/commands/diff.js +3 -1
- package/dist/src/commands/history.js +3 -1
- package/dist/src/commands/list.js +2 -1
- package/dist/src/commands/recover.js +10 -5
- package/dist/src/commands/snapshot.js +2 -1
- package/dist/src/commands/sync.js +5 -1
- package/dist/src/core/doctor.js +151 -50
- package/dist/src/core/installer.js +18 -15
- package/dist/src/core/list.js +6 -0
- package/dist/src/core/report.js +29 -8
- package/dist/src/core/scan-export.js +31 -30
- package/dist/src/core/scan.js +59 -34
- package/dist/src/core/snapshot-diff.js +2 -13
- package/dist/src/core/snapshot.js +14 -14
- package/dist/src/core/uninstall.js +12 -7
- package/dist/src/i18n/index.js +24 -8
- package/dist/src/scanners/semantic-scanner.js +272 -0
- package/dist/src/scanners/sensitive.js +35 -2
- package/dist/src/utils/config-format.js +168 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AgentDock
|
|
2
2
|
|
|
3
|
-
> 你的 AI
|
|
3
|
+
> 你的 AI 编码环境(Claude Code、Codex、Gemini CLI、TRAE、Cursor / Grok Build、Cline、Roo Code、Continue、Goose、Windsurf、GitHub Copilot、OpenCode 等 37 款工具)的**诊断 · 迁移 · 交付**工具。
|
|
4
4
|
> 一条命令体检环境,生成中文 HTML 报告与修复建议;再把 MCP Server、Skill、Agent、Plugin、Hook、记忆**原样、安全、可复现**地搬到另一台机器 —— **而且绝不把 token 一起带走。**
|
|
5
5
|
|
|
6
6
|
[](https://www.npmjs.com/package/agentdock-cli)
|
|
@@ -157,6 +157,7 @@ restore/
|
|
|
157
157
|
| `doctor` | 体检环境 / 包:配置健康度、可迁移性、是否泄密、MCP 重复定义(每项附**修复建议**);`--baseline` 与指定团队基线比对 | `agentdock doctor --baseline <id>` |
|
|
158
158
|
| `report` | 生成可分享的环境健康报告(评分 / 清单 / 检查 / 修复建议,HTML + JSON);`--profile xinchuang` 追加信创适配启发式检查(需人工确认) | `agentdock report --agent all --out ./report` |
|
|
159
159
|
| `list` | 列出已捕获的 MCP / Skill / Agent 等定义清单 | `agentdock list --package ./pkg` |
|
|
160
|
+
| `agents` | 列出自动支持的全部 AI 编程工具、本机检测结果与配置文件 | `agentdock agents` |
|
|
160
161
|
| `diff` | 对比「包内容」与「目标机现状」(不落盘);`--since-last` / `--snapshot <id>` 改为比对配置快照与当前配置 | `agentdock diff ./pkg ~` · `agentdock diff --since-last` |
|
|
161
162
|
| `snapshot` | 采集关键配置文件为本地快照;`list` 查看历史,`--redact` 打码,`--if-changed` 无变化跳过;`push` / `pull` 经共享目录(如内网 Git)分发快照 | `agentdock snapshot --redact` · `agentdock snapshot push ./git-repo` |
|
|
162
163
|
| `history` | 快照时间线:每次变化一行摘要(新增 / 删除 / 修改数量 + 关键路径) | `agentdock history` |
|
|
@@ -168,7 +169,62 @@ restore/
|
|
|
168
169
|
|
|
169
170
|
`doctor` 退出码已量化,便于 CI / 自动化区分严重度:**0** = 全通过、**1** = 仅有警告(可迁移但有隐患)、**2** = 存在失败(需处理)。加 `--json` 可机读,remediation 字段随报告一同返回。
|
|
170
171
|
|
|
171
|
-
|
|
172
|
+
## 支持的 AI 编程工具
|
|
173
|
+
|
|
174
|
+
文件级能力(`snapshot` / `diff` / `restore` / `history` / `recover` / `doctor` 配置基线)由适配器注册表自动覆盖以下 37 款工具,`--agent` 接受工具 id 或别名(如 `cursor` → `grok-build`、`roo` → `roo-code`),`--agent all` 自动采集全部已安装工具:
|
|
175
|
+
|
|
176
|
+
| 工具 id | 显示名 | 关键配置 |
|
|
177
|
+
|---|---|---|
|
|
178
|
+
| `claude` | Claude Code | `.claude.json`、`.claude/settings*.json` |
|
|
179
|
+
| `codex` | OpenAI Codex | `.codex/config.toml` |
|
|
180
|
+
| `gemini` | Gemini CLI | `.gemini/settings.json`、`GEMINI.md` |
|
|
181
|
+
| `antigravity` | Antigravity | `.gemini/config/mcp_config.json` |
|
|
182
|
+
| `opencode` | OpenCode | `.config/opencode/opencode.json(c)`、`AGENTS.md` |
|
|
183
|
+
| `grok-build` | Grok Build(原 Cursor) | `.cursor/mcp.json`、Cursor 用户设置 |
|
|
184
|
+
| `trae` | TRAE | `Trae CN` / `Trae` 用户设置与 `mcp.json` |
|
|
185
|
+
| `qoder` | Qoder(含 Qoder CN / 通义灵码) | `Qoder` / `Qoder CN` 用户设置与 `mcp.json`、Lingma 扩展目录 |
|
|
186
|
+
| `cline` | Cline | VS Code `globalStorage/.../cline_mcp_settings.json` |
|
|
187
|
+
| `windsurf` | Windsurf | `.codeium/windsurf/mcp_config.json` |
|
|
188
|
+
| `copilot` | GitHub Copilot | VS Code 用户 `settings.json`、`mcp.json`、`~/.copilot/mcp-config.json` |
|
|
189
|
+
| `roo-code` | Roo Code | VS Code `globalStorage/rooveterinaryinc.roo-cline/` 的 MCP 与自定义模式 |
|
|
190
|
+
| `kilo-code` | Kilo Code | VS Code `globalStorage/kilocode.kilo-code/` 的 MCP 与自定义模式 |
|
|
191
|
+
| `continue` | Continue | `.continue/config.yaml`(兼容旧 `config.json`) |
|
|
192
|
+
| `goose` | Goose(Block) | `.config/goose/config.yaml`(Windows `AppData/Roaming/Block/goose/`) |
|
|
193
|
+
| `qwen` | Qwen Code | `.qwen/settings.json`、`QWEN.md` |
|
|
194
|
+
| `kiro` | Kiro(AWS) | `.kiro/settings/mcp.json` |
|
|
195
|
+
| `aider` | Aider | `.aider.conf.yml` / `.aider.conf.yaml` |
|
|
196
|
+
| `zed` | Zed | `.config/zed/settings.json`(`context_servers`) |
|
|
197
|
+
| `crush` | Crush(Charm) | `.config/crush/crush.json` |
|
|
198
|
+
| `claude-desktop` | Claude Desktop | `claude_desktop_config.json`(MCP 宿主) |
|
|
199
|
+
| `lm-studio` | LM Studio | `.lmstudio/mcp.json`(MCP 宿主) |
|
|
200
|
+
| `codebuddy` | CodeBuddy(腾讯) | `.codebuddy/settings.json`、`settings.local.json`、`mcp.json`、`CODEBUDDY.md` |
|
|
201
|
+
| `kimi` | Kimi Code CLI | `.kimi/config.toml`、`.kimi-code/mcp.json` |
|
|
202
|
+
| `iflow` | iFlow CLI(心流) | `.iflow/settings.json` |
|
|
203
|
+
| `junie` | JetBrains Junie | `.junie/mcp/mcp.json`、`.junie/config.json` |
|
|
204
|
+
| `amazon-q` | Amazon Q Developer | `.aws/amazonq/agents/default.json` |
|
|
205
|
+
| `amp` | Amp(Sourcegraph) | `.config/amp/settings.json(c)`、Windows `%APPDATA%/amp/` |
|
|
206
|
+
| `factory-droid` | Factory Droid | `.factory/mcp.json` |
|
|
207
|
+
| `warp` | Warp | `.warp/mcp.json` |
|
|
208
|
+
| `comate` | 百度 Comate | `.comate/mcp.json`(用户级路径待实测) |
|
|
209
|
+
| `gptme` | gptme | `.config/gptme/config.toml` |
|
|
210
|
+
| `void` | Void | `Void/User/settings.json`(实验性) |
|
|
211
|
+
| `pearai` | PearAI | `PearAI/User/settings.json`(实验性) |
|
|
212
|
+
| `omp` | omp(oh-my-pi) | `.omp/agent/config.yml` |
|
|
213
|
+
| `deepseek-harness` | DeepSeek Harness | `.dsh/settings.yaml` |
|
|
214
|
+
| `pi` | Pi | `.pi/agent/config.json`(实验性) |
|
|
215
|
+
|
|
216
|
+
`agentdock agents` 可查看本机实际检测到的工具与配置文件。
|
|
217
|
+
|
|
218
|
+
**语义化迁移(v1.4)**:`scan` / `export` / `pack` / `sync` 与文件级能力一样覆盖全部 37 款工具——`--agent` 接受任意工具 id 或 `all`。每个工具按自身格式读取 MCP、全局指令、规则与技能:
|
|
219
|
+
|
|
220
|
+
- **MCP**:按工具声明的配置文件与容器键提取(`mcpServers` / `mcp` / `context_servers` / `extensions` / `amp.mcpServers`),支持 JSON、JSONC、YAML、TOML。
|
|
221
|
+
- **指令 / 规则**:`CLAUDE.md`、`AGENTS.md`、`GEMINI.md`、`CODEBUDDY.md`、`QWEN.md`、Windsurf `global_rules.md`,以及 `.cursor/rules`、`.continue/rules`、`.codebuddy/rules` 等规则目录。
|
|
222
|
+
- **技能 / 子代理**:`.claude/skills`、`.codebuddy/skills`、`.factory/skills`、`.codebuddy/agents`、Amazon Q `cli-agents/` 等目录按子目录 / 文件采集。
|
|
223
|
+
- **目录型配置**:DeepSeek Harness 的 `.dsh/profiles/**` 补丁文件自动纳入。
|
|
224
|
+
|
|
225
|
+
安装采用**整文件深合并**:目标机已有的配置键与 MCP 会保留,包内同名键覆盖;全新目标机则完整还原。Claude 仍只合并 `.claude.json` 的 `mcpServers`,Codex 仍只合并 `config.toml` 的 `mcp_servers`,行为与此前一致。
|
|
226
|
+
|
|
227
|
+
**已知限制**:系统钥匙串 / VS Code SecretStorage 中的密钥不会被扫描;账号云同步的配置可能只落盘部分内容;Qoder CN、Comate、Void、PearAI 与 Pi 的部分路径仍属实验性;JSONC 注释在导出后不保留(内容仍有效);没有 MCP 的工具(如 Aider)只迁移配置文件。CodeGeeX、CodeArts Snap、Augment Code、Sourcegraph Cody、OpenHands、Plandex 等仍未加入,需先实测路径。
|
|
172
228
|
|
|
173
229
|
**Codex 配置合并(与 Claude 同权)**:`config.toml` 以 `merge` 方式安装——目标机若已存在 `config.toml`,只深度合并包内的 `mcp_servers`,**保留其原有的 `model` / `provider` 等设置**,绝不整体覆盖;全新目标机则整文件还原。卸载时同样只精确摘回包贡献的 `mcp_servers`,不动用户既有配置。这与 Claude `.claude.json` 仅合并 `mcpServers` 的语义完全对齐。
|
|
174
230
|
|
|
@@ -263,6 +319,7 @@ agentdock recover --undo --apply # 撤销
|
|
|
263
319
|
- 默认**明文**保存(仅本机、不联网、不上传),请勿把 `~/.agentdock/snapshots` 提交到仓库;需要分享差异时用 `--redact` 重新采集。
|
|
264
320
|
- `doctor` 新增「配置基线」检查:与本 agent 最近快照相比,顶层键减少 ≥30% 或 `model` / `modelPicker` / `mcpServers` / `env` 等关键项消失时判为失败,并给出 `diff` / `restore` 命令。
|
|
265
321
|
- `recover` 的完整度评分:文件齐全度 0–60、顶层键 0–20、env 0–10、MCP 0–10;脱敏快照无法还原真实密钥,扣 20 分。恢复前同样自动生成写前快照。
|
|
322
|
+
- 快照与基线已支持全部 37 款工具:`agentdock snapshot --agent gemini`、`agentdock doctor --agent roo-code`;配置格式覆盖 JSON / JSONC(含注释)/ YAML / TOML,`--agent all` 自动取并集并去重。
|
|
266
323
|
|
|
267
324
|
## 离线交付(pack / verify / attest)
|
|
268
325
|
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentdock-cli",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Diagnose, migrate, and back up your AI coding
|
|
3
|
+
"version": "1.4.1",
|
|
4
|
+
"description": "Diagnose, migrate, and back up your AI coding environment — Claude Code, Codex, Gemini CLI, TRAE, Cursor/Grok Build, Cline, Windsurf, Copilot, OpenCode and more — with config snapshots, restore, and secret isolation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
7
7
|
"codex",
|
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AI 编程工具适配器注册表(v1.3)。
|
|
4
|
+
*
|
|
5
|
+
* 目标:把「文件级能力」(snapshot / diff / restore / history / recover /
|
|
6
|
+
* doctor 配置基线)从硬编码的 claude / codex 扩展为按工具注册表自动覆盖。
|
|
7
|
+
* 每个适配器只声明自己的配置文件位置与关键配置项,命令层不再判断具体工具。
|
|
8
|
+
*
|
|
9
|
+
* 路径约定:统一使用相对用户主目录的 `/` 分隔路径(Windows 的
|
|
10
|
+
* `AppData/Roaming` 与 macOS 的 `Library/Application Support` 都在主目录内),
|
|
11
|
+
* 这样快照与恢复仍受 `safeResolveWithin(root)` 保护,不会写到家目录之外。
|
|
12
|
+
*/
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.AGENT_ADAPTERS = void 0;
|
|
18
|
+
exports.appDataDir = appDataDir;
|
|
19
|
+
exports.vsCodeUser = vsCodeUser;
|
|
20
|
+
exports.listAgentAdapters = listAgentAdapters;
|
|
21
|
+
exports.resolveAgentAdapter = resolveAgentAdapter;
|
|
22
|
+
exports.normalizeAgentId = normalizeAgentId;
|
|
23
|
+
exports.agentConfigFiles = agentConfigFiles;
|
|
24
|
+
exports.agentCriticalKeys = agentCriticalKeys;
|
|
25
|
+
exports.agentMcpKeys = agentMcpKeys;
|
|
26
|
+
exports.isAgentInstalled = isAgentInstalled;
|
|
27
|
+
exports.detectInstalledAgents = detectInstalledAgents;
|
|
28
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
29
|
+
const fs_1 = require("../utils/fs");
|
|
30
|
+
function joinRel(...parts) {
|
|
31
|
+
return parts.join('/');
|
|
32
|
+
}
|
|
33
|
+
/** Windows 使用 AppData/Roaming,macOS 使用 Library/Application Support,Linux 使用 XDG .config。 */
|
|
34
|
+
function appDataDir() {
|
|
35
|
+
if (process.platform === 'win32')
|
|
36
|
+
return 'AppData/Roaming';
|
|
37
|
+
if (process.platform === 'darwin')
|
|
38
|
+
return 'Library/Application Support';
|
|
39
|
+
return '.config';
|
|
40
|
+
}
|
|
41
|
+
function json(relPath) {
|
|
42
|
+
return { relPath, kind: 'json' };
|
|
43
|
+
}
|
|
44
|
+
function jsonc(relPath) {
|
|
45
|
+
return { relPath, kind: 'jsonc' };
|
|
46
|
+
}
|
|
47
|
+
function yaml(relPath) {
|
|
48
|
+
return { relPath, kind: 'yaml' };
|
|
49
|
+
}
|
|
50
|
+
function toml(relPath) {
|
|
51
|
+
return { relPath, kind: 'toml' };
|
|
52
|
+
}
|
|
53
|
+
function text(relPath) {
|
|
54
|
+
return { relPath, kind: 'text' };
|
|
55
|
+
}
|
|
56
|
+
function vsCodeUser(appName) {
|
|
57
|
+
return joinRel(appDataDir(), appName, 'User');
|
|
58
|
+
}
|
|
59
|
+
exports.AGENT_ADAPTERS = [
|
|
60
|
+
{
|
|
61
|
+
id: 'claude',
|
|
62
|
+
aliases: ['claude-code', 'anthropic'],
|
|
63
|
+
displayName: 'Claude Code',
|
|
64
|
+
criticalKeys: ['model', 'modelPicker', 'mcpServers', 'env'],
|
|
65
|
+
mcpKeys: ['mcpServers'],
|
|
66
|
+
configFiles: () => [
|
|
67
|
+
json('.claude.json'),
|
|
68
|
+
json('.claude/settings.json'),
|
|
69
|
+
json('.claude/settings.local.json'),
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'codex',
|
|
74
|
+
aliases: ['openai-codex', 'codex-cli'],
|
|
75
|
+
displayName: 'OpenAI Codex',
|
|
76
|
+
criticalKeys: ['model', 'model_providers', 'mcp_servers'],
|
|
77
|
+
mcpKeys: ['mcp_servers'],
|
|
78
|
+
configFiles: () => [toml('.codex/config.toml')],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'gemini',
|
|
82
|
+
aliases: ['gemini-cli', 'google-gemini'],
|
|
83
|
+
displayName: 'Gemini CLI',
|
|
84
|
+
criticalKeys: ['model', 'mcpServers', 'selectedAuthType'],
|
|
85
|
+
mcpKeys: ['mcpServers'],
|
|
86
|
+
configFiles: () => [json('.gemini/settings.json'), text('.gemini/GEMINI.md')],
|
|
87
|
+
note: '与 Antigravity 共用 ~/.gemini;本工具只认领 settings.json 与 GEMINI.md,按文件归属避免重复快照。',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'antigravity',
|
|
91
|
+
aliases: ['antigravity-ide', 'google-antigravity'],
|
|
92
|
+
displayName: 'Antigravity',
|
|
93
|
+
criticalKeys: ['mcpServers'],
|
|
94
|
+
mcpKeys: ['mcpServers'],
|
|
95
|
+
configFiles: () => [json('.gemini/config/mcp_config.json')],
|
|
96
|
+
note: '工作区级 .agents/mcp_config.json 属于项目配置,不在主目录快照内。',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 'opencode',
|
|
100
|
+
aliases: ['open-code', 'sst-opencode'],
|
|
101
|
+
displayName: 'OpenCode',
|
|
102
|
+
criticalKeys: ['model', 'provider', 'mcp', 'instructions'],
|
|
103
|
+
mcpKeys: ['mcp'],
|
|
104
|
+
configFiles: () => [
|
|
105
|
+
jsonc('.config/opencode/opencode.json'),
|
|
106
|
+
jsonc('.config/opencode/opencode.jsonc'),
|
|
107
|
+
text('.config/opencode/AGENTS.md'),
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'grok-build',
|
|
112
|
+
aliases: ['cursor', 'grok', 'cursor-ide'],
|
|
113
|
+
displayName: 'Grok Build(原 Cursor)',
|
|
114
|
+
criticalKeys: ['mcpServers', 'model'],
|
|
115
|
+
mcpKeys: ['mcpServers'],
|
|
116
|
+
configFiles: () => [
|
|
117
|
+
json('.cursor/mcp.json'),
|
|
118
|
+
json(joinRel(vsCodeUser('Cursor'), 'settings.json')),
|
|
119
|
+
],
|
|
120
|
+
note: 'Cursor 已更名为 Grok Build;保留 ~/.cursor 旧目录与 Cursor 用户设置目录兼容。',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: 'trae',
|
|
124
|
+
aliases: ['trae-cn', 'trae-ide'],
|
|
125
|
+
displayName: 'TRAE',
|
|
126
|
+
criticalKeys: ['model', 'mcp', 'mcpServers'],
|
|
127
|
+
mcpKeys: ['mcpServers', 'mcp'],
|
|
128
|
+
configFiles: () => [
|
|
129
|
+
json(joinRel(vsCodeUser('Trae CN'), 'settings.json')),
|
|
130
|
+
json(joinRel(vsCodeUser('Trae CN'), 'mcp.json')),
|
|
131
|
+
json(joinRel(vsCodeUser('Trae'), 'settings.json')),
|
|
132
|
+
json(joinRel(vsCodeUser('Trae'), 'mcp.json')),
|
|
133
|
+
],
|
|
134
|
+
note: '同时探测 Trae CN 与 Trae 两个用户数据目录。',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: 'qoder',
|
|
138
|
+
aliases: ['qoder-ide', 'qoder-cn', 'lingma', 'tongyi-lingma'],
|
|
139
|
+
displayName: 'Qoder(含 Qoder CN / 通义灵码)',
|
|
140
|
+
criticalKeys: ['model', 'mcpServers'],
|
|
141
|
+
mcpKeys: ['mcpServers', 'mcp'],
|
|
142
|
+
configFiles: () => [
|
|
143
|
+
json(joinRel(vsCodeUser('Qoder'), 'settings.json')),
|
|
144
|
+
json(joinRel(vsCodeUser('Qoder'), 'mcp.json')),
|
|
145
|
+
json(joinRel(vsCodeUser('Qoder CN'), 'settings.json')),
|
|
146
|
+
json(joinRel(vsCodeUser('Qoder CN'), 'mcp.json')),
|
|
147
|
+
json(joinRel(vsCodeUser('Code'), 'globalStorage/alibaba-cloud.tongyi-lingma/settings.json')),
|
|
148
|
+
],
|
|
149
|
+
experimental: true,
|
|
150
|
+
note: 'Qoder CN 已由通义灵码更名;同时探测 Qoder / Qoder CN 用户目录与 VS Code 的 alibaba-cloud.tongyi-lingma 扩展目录,部分路径仍待全平台实测。',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: 'cline',
|
|
154
|
+
aliases: ['claude-dev', 'cline-vscode'],
|
|
155
|
+
displayName: 'Cline',
|
|
156
|
+
criticalKeys: ['mcpServers'],
|
|
157
|
+
mcpKeys: ['mcpServers'],
|
|
158
|
+
configFiles: () => [
|
|
159
|
+
json(joinRel(vsCodeUser('Code'), 'globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json')),
|
|
160
|
+
json(joinRel(vsCodeUser('Code - Insiders'), 'globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json')),
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: 'windsurf',
|
|
165
|
+
aliases: ['codeium-windsurf'],
|
|
166
|
+
displayName: 'Windsurf',
|
|
167
|
+
criticalKeys: ['mcpServers'],
|
|
168
|
+
mcpKeys: ['mcpServers'],
|
|
169
|
+
configFiles: () => [json('.codeium/windsurf/mcp_config.json')],
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
id: 'copilot',
|
|
173
|
+
aliases: ['github-copilot', 'copilot-vscode'],
|
|
174
|
+
displayName: 'GitHub Copilot',
|
|
175
|
+
criticalKeys: ['mcp', 'mcpServers', 'github.copilot'],
|
|
176
|
+
mcpKeys: ['mcp', 'mcpServers'],
|
|
177
|
+
configFiles: () => [
|
|
178
|
+
json(joinRel(vsCodeUser('Code'), 'settings.json')),
|
|
179
|
+
json(joinRel(vsCodeUser('Code'), 'mcp.json')),
|
|
180
|
+
json(joinRel(vsCodeUser('Code - Insiders'), 'settings.json')),
|
|
181
|
+
json('.copilot/config.json'),
|
|
182
|
+
json('.copilot/settings.json'),
|
|
183
|
+
json('.copilot/mcp-config.json'),
|
|
184
|
+
],
|
|
185
|
+
note: '同时覆盖 VS Code 扩展与 GitHub Copilot CLI(~/.copilot);仓库级 .github/copilot-instructions.md 与 .vscode/mcp.json 属于项目配置。',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: 'roo-code',
|
|
189
|
+
aliases: ['roo', 'roocode', 'roo-cline'],
|
|
190
|
+
displayName: 'Roo Code',
|
|
191
|
+
criticalKeys: ['mcpServers'],
|
|
192
|
+
mcpKeys: ['mcpServers'],
|
|
193
|
+
configFiles: () => [
|
|
194
|
+
json(joinRel(vsCodeUser('Code'), 'globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json')),
|
|
195
|
+
json(joinRel(vsCodeUser('Code - Insiders'), 'globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json')),
|
|
196
|
+
yaml(joinRel(vsCodeUser('Code'), 'globalStorage/rooveterinaryinc.roo-cline/settings/custom_modes.yaml')),
|
|
197
|
+
],
|
|
198
|
+
note: 'Cline 生态分支;项目级 .roorules 与 .roo/ 不在主目录快照内。',
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: 'kilo-code',
|
|
202
|
+
aliases: ['kilo', 'kilocode'],
|
|
203
|
+
displayName: 'Kilo Code',
|
|
204
|
+
criticalKeys: ['mcpServers'],
|
|
205
|
+
mcpKeys: ['mcpServers'],
|
|
206
|
+
configFiles: () => [
|
|
207
|
+
json(joinRel(vsCodeUser('Code'), 'globalStorage/kilocode.kilo-code/settings/mcp_settings.json')),
|
|
208
|
+
json(joinRel(vsCodeUser('Code - Insiders'), 'globalStorage/kilocode.kilo-code/settings/mcp_settings.json')),
|
|
209
|
+
yaml(joinRel(vsCodeUser('Code'), 'globalStorage/kilocode.kilo-code/settings/custom_modes.yaml')),
|
|
210
|
+
],
|
|
211
|
+
note: 'Roo / Cline 生态分支;项目级 .kilocoderules 不在主目录快照内。',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: 'continue',
|
|
215
|
+
aliases: ['continue-dev'],
|
|
216
|
+
displayName: 'Continue',
|
|
217
|
+
criticalKeys: ['models', 'model', 'mcpServers', 'context'],
|
|
218
|
+
mcpKeys: ['mcpServers', 'mcp'],
|
|
219
|
+
configFiles: () => [
|
|
220
|
+
yaml('.continue/config.yaml'),
|
|
221
|
+
json('.continue/config.json'),
|
|
222
|
+
yaml('.continue/permissions.yaml'),
|
|
223
|
+
],
|
|
224
|
+
note: '新版使用 config.yaml;旧版 config.json 仍兼容读取。assistants/ 与 prompts/ 为目录,v1.4 再做语义化采集。',
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: 'goose',
|
|
228
|
+
aliases: ['block-goose'],
|
|
229
|
+
displayName: 'Goose(Block)',
|
|
230
|
+
criticalKeys: ['extensions', 'provider', 'model'],
|
|
231
|
+
mcpKeys: ['extensions'],
|
|
232
|
+
configFiles: () => (process.platform === 'win32'
|
|
233
|
+
? [
|
|
234
|
+
yaml(joinRel(appDataDir(), 'Block', 'goose', 'config', 'config.yaml')),
|
|
235
|
+
yaml(joinRel(appDataDir(), 'Block', 'goose', 'config', 'profiles.yaml')),
|
|
236
|
+
]
|
|
237
|
+
: [
|
|
238
|
+
yaml('.config/goose/config.yaml'),
|
|
239
|
+
yaml('.config/goose/profiles.yaml'),
|
|
240
|
+
]),
|
|
241
|
+
note: 'extensions 即 MCP;secrets 默认在系统钥匙串,不进入快照。',
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
id: 'qwen',
|
|
245
|
+
aliases: ['qwen-code', 'qwen-cli'],
|
|
246
|
+
displayName: 'Qwen Code',
|
|
247
|
+
criticalKeys: ['model', 'mcpServers', 'selectedAuthType'],
|
|
248
|
+
mcpKeys: ['mcpServers'],
|
|
249
|
+
configFiles: () => [json('.qwen/settings.json'), text('.qwen/QWEN.md')],
|
|
250
|
+
note: 'Gemini CLI 分支,配置结构与 Gemini CLI 基本一致。',
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
id: 'kiro',
|
|
254
|
+
aliases: ['aws-kiro'],
|
|
255
|
+
displayName: 'Kiro(AWS)',
|
|
256
|
+
criticalKeys: ['mcpServers'],
|
|
257
|
+
mcpKeys: ['mcpServers'],
|
|
258
|
+
configFiles: () => [json('.kiro/settings/mcp.json')],
|
|
259
|
+
note: '项目级 steering 规则(.kiro/steering/*.md)不在主目录快照内。',
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
id: 'aider',
|
|
263
|
+
aliases: ['aider-chat'],
|
|
264
|
+
displayName: 'Aider',
|
|
265
|
+
criticalKeys: ['model', 'openai-api-key', 'anthropic-api-key'],
|
|
266
|
+
mcpKeys: [],
|
|
267
|
+
configFiles: () => [yaml('.aider.conf.yml'), yaml('.aider.conf.yaml')],
|
|
268
|
+
note: '无 MCP;密钥通常放在 .env / 环境变量,快照只保留配置结构。',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
id: 'zed',
|
|
272
|
+
aliases: ['zed-ai', 'zed-editor'],
|
|
273
|
+
displayName: 'Zed',
|
|
274
|
+
criticalKeys: ['context_servers', 'language_models', 'assistant'],
|
|
275
|
+
mcpKeys: ['context_servers'],
|
|
276
|
+
configFiles: () => (process.platform === 'win32'
|
|
277
|
+
? [
|
|
278
|
+
json(joinRel(appDataDir(), 'Zed', 'settings.json')),
|
|
279
|
+
json('.config/zed/settings.json'),
|
|
280
|
+
]
|
|
281
|
+
: [json('.config/zed/settings.json')]),
|
|
282
|
+
note: 'Zed 的 MCP 配置键为 context_servers;项目级 .rules 不在主目录快照内。',
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
id: 'crush',
|
|
286
|
+
aliases: ['charm-crush'],
|
|
287
|
+
displayName: 'Crush(Charm)',
|
|
288
|
+
criticalKeys: ['models', 'providers', 'mcp'],
|
|
289
|
+
mcpKeys: ['mcp'],
|
|
290
|
+
configFiles: () => [json('.config/crush/crush.json')],
|
|
291
|
+
note: '项目级 .crush.json 不在主目录快照内;Windows 若使用自定义 XDG 目录需用 --root 指定。',
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
id: 'claude-desktop',
|
|
295
|
+
aliases: ['claude-app'],
|
|
296
|
+
displayName: 'Claude Desktop',
|
|
297
|
+
criticalKeys: ['mcpServers'],
|
|
298
|
+
mcpKeys: ['mcpServers'],
|
|
299
|
+
configFiles: () => [json(joinRel(appDataDir(), 'Claude', 'claude_desktop_config.json'))],
|
|
300
|
+
note: 'MCP 宿主而非编码 CLI;常用于本机 MCP Server 备份。',
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
id: 'lm-studio',
|
|
304
|
+
aliases: ['lmstudio'],
|
|
305
|
+
displayName: 'LM Studio',
|
|
306
|
+
criticalKeys: ['mcpServers'],
|
|
307
|
+
mcpKeys: ['mcpServers'],
|
|
308
|
+
configFiles: () => [json('.lmstudio/mcp.json')],
|
|
309
|
+
note: '本地模型 + MCP 宿主;模型文件本身不在快照范围。',
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
id: 'codebuddy',
|
|
313
|
+
aliases: ['codebuddy-code', 'tencent-codebuddy'],
|
|
314
|
+
displayName: 'CodeBuddy(腾讯)',
|
|
315
|
+
criticalKeys: ['model', 'mcpServers', 'permissions'],
|
|
316
|
+
mcpKeys: ['mcpServers', 'mcp'],
|
|
317
|
+
configFiles: () => [
|
|
318
|
+
json('.codebuddy/settings.json'),
|
|
319
|
+
json('.codebuddy/settings.local.json'),
|
|
320
|
+
json('.codebuddy/mcp.json'),
|
|
321
|
+
text('.codebuddy/CODEBUDDY.md'),
|
|
322
|
+
],
|
|
323
|
+
note: '官方文档确认 ~/.codebuddy 全局目录;agents/、rules/、skills/ 为目录,v1.4 做语义化采集。',
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
id: 'kimi',
|
|
327
|
+
aliases: ['kimi-code', 'kimi-cli', 'moonshot-kimi'],
|
|
328
|
+
displayName: 'Kimi Code CLI',
|
|
329
|
+
criticalKeys: ['model', 'provider', 'providers'],
|
|
330
|
+
mcpKeys: ['mcpServers', 'mcp'],
|
|
331
|
+
configFiles: () => [
|
|
332
|
+
toml('.kimi/config.toml'),
|
|
333
|
+
json('.kimi/config.json'),
|
|
334
|
+
json('.kimi-code/mcp.json'),
|
|
335
|
+
],
|
|
336
|
+
note: '全局设置 ~/.kimi/config.toml;MCP 单独存放在 ~/.kimi-code/mcp.json(官方文档)。',
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
id: 'iflow',
|
|
340
|
+
aliases: ['iflow-cli'],
|
|
341
|
+
displayName: 'iFlow CLI(心流)',
|
|
342
|
+
criticalKeys: ['modelName', 'apiKey', 'selectedAuthType'],
|
|
343
|
+
mcpKeys: ['mcpServers', 'mcp'],
|
|
344
|
+
configFiles: () => [json('.iflow/settings.json')],
|
|
345
|
+
note: '官方文档确认 ~/.iflow/settings.json;MCP 是否独立文件待实测。',
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
id: 'junie',
|
|
349
|
+
aliases: ['jetbrains-junie', 'junie-cli'],
|
|
350
|
+
displayName: 'JetBrains Junie',
|
|
351
|
+
criticalKeys: ['mcpServers', 'model'],
|
|
352
|
+
mcpKeys: ['mcpServers'],
|
|
353
|
+
configFiles: () => [json('.junie/mcp/mcp.json'), json('.junie/config.json')],
|
|
354
|
+
note: 'Junie CLI / IDE 共用 ~/.junie/mcp/mcp.json;JetBrains AI Assistant 的 IDE 级配置不在此范围。',
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
id: 'amazon-q',
|
|
358
|
+
aliases: ['amazon-q-developer', 'q-developer', 'q-cli'],
|
|
359
|
+
displayName: 'Amazon Q Developer',
|
|
360
|
+
criticalKeys: ['mcpServers'],
|
|
361
|
+
mcpKeys: ['mcpServers'],
|
|
362
|
+
configFiles: () => [json('.aws/amazonq/agents/default.json')],
|
|
363
|
+
note: 'IDE 全局 MCP 在 ~/.aws/amazonq/agents/default.json;CLI 的 ~/.aws/amazonq/cli-agents/ 为目录,v1.4 支持通配。',
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id: 'amp',
|
|
367
|
+
aliases: ['sourcegraph-amp', 'amp-cli'],
|
|
368
|
+
displayName: 'Amp(Sourcegraph)',
|
|
369
|
+
criticalKeys: ['amp.mcpServers', 'amp.model'],
|
|
370
|
+
mcpKeys: ['amp.mcpServers'],
|
|
371
|
+
configFiles: () => (process.platform === 'win32'
|
|
372
|
+
? [
|
|
373
|
+
json(joinRel(appDataDir(), 'amp', 'settings.json')),
|
|
374
|
+
json('.config/amp/settings.json'),
|
|
375
|
+
jsonc('.config/amp/settings.jsonc'),
|
|
376
|
+
]
|
|
377
|
+
: [json('.config/amp/settings.json'), jsonc('.config/amp/settings.jsonc')]),
|
|
378
|
+
note: '官方文档:macOS/Linux ~/.config/amp/settings.json(c),Windows %APPDATA%/amp/settings.json;MCP 键为 amp.mcpServers。',
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
id: 'factory-droid',
|
|
382
|
+
aliases: ['factory', 'droid', 'droid-cli'],
|
|
383
|
+
displayName: 'Factory Droid',
|
|
384
|
+
criticalKeys: ['mcpServers'],
|
|
385
|
+
mcpKeys: ['mcpServers'],
|
|
386
|
+
configFiles: () => [json('.factory/mcp.json')],
|
|
387
|
+
note: '官方文档确认用户级 MCP 在 ~/.factory/mcp.json;其他 settings 文件路径待实测。',
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
id: 'warp',
|
|
391
|
+
aliases: ['warp-terminal'],
|
|
392
|
+
displayName: 'Warp',
|
|
393
|
+
criticalKeys: ['mcpServers'],
|
|
394
|
+
mcpKeys: ['mcpServers'],
|
|
395
|
+
configFiles: () => [json('.warp/mcp.json')],
|
|
396
|
+
note: '全局 MCP 在 ~/.warp/mcp.json;settings.toml 平台路径不同,暂不纳入。',
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
id: 'comate',
|
|
400
|
+
aliases: ['baidu-comate', 'comate-ai'],
|
|
401
|
+
displayName: '百度 Comate',
|
|
402
|
+
criticalKeys: ['mcpServers'],
|
|
403
|
+
mcpKeys: ['mcpServers'],
|
|
404
|
+
configFiles: () => [json('.comate/mcp.json')],
|
|
405
|
+
experimental: true,
|
|
406
|
+
note: '公开资料以项目级 .comate/mcp.json 为主;用户级 ~/.comate 路径待实测。',
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
id: 'gptme',
|
|
410
|
+
aliases: ['gptme-cli'],
|
|
411
|
+
displayName: 'gptme',
|
|
412
|
+
criticalKeys: ['model', 'provider', 'mcp'],
|
|
413
|
+
mcpKeys: ['mcp'],
|
|
414
|
+
configFiles: () => [toml('.config/gptme/config.toml')],
|
|
415
|
+
note: '官方配置路径 ~/.config/gptme/config.toml;Windows 自定义 XDG 目录需 --root 指定。',
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
id: 'void',
|
|
419
|
+
aliases: ['void-editor'],
|
|
420
|
+
displayName: 'Void',
|
|
421
|
+
criticalKeys: ['mcp', 'mcpServers'],
|
|
422
|
+
mcpKeys: ['mcp', 'mcpServers', 'context_servers'],
|
|
423
|
+
configFiles: () => [json(joinRel(vsCodeUser('Void'), 'settings.json'))],
|
|
424
|
+
experimental: true,
|
|
425
|
+
note: 'VS Code 分支,按 Void/User/settings.json 探测;MCP 配置位置待实测。',
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
id: 'pearai',
|
|
429
|
+
aliases: ['pear-ai'],
|
|
430
|
+
displayName: 'PearAI',
|
|
431
|
+
criticalKeys: ['mcp', 'mcpServers'],
|
|
432
|
+
mcpKeys: ['mcp', 'mcpServers'],
|
|
433
|
+
configFiles: () => [json(joinRel(vsCodeUser('PearAI'), 'settings.json'))],
|
|
434
|
+
experimental: true,
|
|
435
|
+
note: 'VS Code 分支,按 PearAI/User/settings.json 探测;路径待实测。',
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
id: 'omp',
|
|
439
|
+
aliases: ['oh-my-pi', 'omp-agent'],
|
|
440
|
+
displayName: 'omp(oh-my-pi)',
|
|
441
|
+
criticalKeys: ['model', 'providers', 'mcp'],
|
|
442
|
+
mcpKeys: ['mcp', 'mcpServers'],
|
|
443
|
+
configFiles: () => [yaml('.omp/agent/config.yml')],
|
|
444
|
+
note: '支持 PI_CODING_AGENT_DIR 覆盖目录(v1.3 仅默认路径)。',
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
id: 'deepseek-harness',
|
|
448
|
+
aliases: ['dsh', 'deepseek'],
|
|
449
|
+
displayName: 'DeepSeek Harness',
|
|
450
|
+
criticalKeys: ['model', 'providers', 'mcp'],
|
|
451
|
+
mcpKeys: ['mcp', 'mcpServers'],
|
|
452
|
+
configFiles: () => [yaml('.dsh/settings.yaml')],
|
|
453
|
+
note: 'profiles/*/cordis.patch.yml 需要目录通配,计划在 v1.4 支持。',
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
id: 'pi',
|
|
457
|
+
aliases: ['pi-agent', 'pi-coding-agent'],
|
|
458
|
+
displayName: 'Pi',
|
|
459
|
+
criticalKeys: ['model', 'mcp'],
|
|
460
|
+
mcpKeys: ['mcp', 'mcpServers'],
|
|
461
|
+
configFiles: () => [json('.pi/agent/config.json'), json('.pi/settings.json')],
|
|
462
|
+
experimental: true,
|
|
463
|
+
note: '公开资料未完全证实路径,按 ~/.pi 探测;未找到时不影响其他工具。',
|
|
464
|
+
},
|
|
465
|
+
];
|
|
466
|
+
function listAgentAdapters() {
|
|
467
|
+
return exports.AGENT_ADAPTERS;
|
|
468
|
+
}
|
|
469
|
+
/** 按 id 或别名查找适配器(大小写不敏感)。 */
|
|
470
|
+
function resolveAgentAdapter(value) {
|
|
471
|
+
const needle = value.trim().toLowerCase();
|
|
472
|
+
return exports.AGENT_ADAPTERS.find((adapter) => adapter.id === needle || adapter.aliases.includes(needle));
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* 把 `--agent` 输入规范化为稳定 id;`all` 原样返回。
|
|
476
|
+
* 未知工具抛出 `UNKNOWN_AGENT`,由命令层转成稳定错误码。
|
|
477
|
+
*/
|
|
478
|
+
function normalizeAgentId(value, allowAll = true) {
|
|
479
|
+
const normalized = value.trim().toLowerCase();
|
|
480
|
+
if (allowAll && normalized === 'all') {
|
|
481
|
+
return 'all';
|
|
482
|
+
}
|
|
483
|
+
const adapter = resolveAgentAdapter(normalized);
|
|
484
|
+
if (!adapter) {
|
|
485
|
+
const supported = exports.AGENT_ADAPTERS.map((item) => item.id).join('、');
|
|
486
|
+
throw new Error(`UNKNOWN_AGENT: 不支持的 AI 编程工具 "${value}";可用:${supported}(运行 \`agentdock agents\` 查看详情)`);
|
|
487
|
+
}
|
|
488
|
+
return adapter.id;
|
|
489
|
+
}
|
|
490
|
+
/** 单个工具或 `all`(全部工具取并集、按路径去重)的关键配置文件。 */
|
|
491
|
+
function agentConfigFiles(agent) {
|
|
492
|
+
if (agent === 'all') {
|
|
493
|
+
const seen = new Set();
|
|
494
|
+
const files = [];
|
|
495
|
+
for (const adapter of exports.AGENT_ADAPTERS) {
|
|
496
|
+
for (const file of adapter.configFiles()) {
|
|
497
|
+
if (seen.has(file.relPath)) {
|
|
498
|
+
continue;
|
|
499
|
+
}
|
|
500
|
+
seen.add(file.relPath);
|
|
501
|
+
files.push(file);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
return files;
|
|
505
|
+
}
|
|
506
|
+
const adapter = resolveAgentAdapter(agent);
|
|
507
|
+
if (!adapter) {
|
|
508
|
+
throw new Error(`UNKNOWN_AGENT: 不支持的 AI 编程工具 "${agent}"`);
|
|
509
|
+
}
|
|
510
|
+
return adapter.configFiles();
|
|
511
|
+
}
|
|
512
|
+
/** 关键配置项(`all` 时取并集)。 */
|
|
513
|
+
function agentCriticalKeys(agent) {
|
|
514
|
+
if (agent === 'all') {
|
|
515
|
+
return [...new Set(exports.AGENT_ADAPTERS.flatMap((adapter) => adapter.criticalKeys))];
|
|
516
|
+
}
|
|
517
|
+
const adapter = resolveAgentAdapter(agent);
|
|
518
|
+
return adapter ? [...adapter.criticalKeys] : [];
|
|
519
|
+
}
|
|
520
|
+
/** 承载 MCP 定义的键(`all` 时取并集)。 */
|
|
521
|
+
function agentMcpKeys(agent) {
|
|
522
|
+
if (agent === 'all') {
|
|
523
|
+
return [...new Set(exports.AGENT_ADAPTERS.flatMap((adapter) => adapter.mcpKeys))];
|
|
524
|
+
}
|
|
525
|
+
const adapter = resolveAgentAdapter(agent);
|
|
526
|
+
return adapter ? [...adapter.mcpKeys] : [];
|
|
527
|
+
}
|
|
528
|
+
/** 主目录下是否存在该工具的任意配置文件。 */
|
|
529
|
+
async function isAgentInstalled(root, agent) {
|
|
530
|
+
const adapter = resolveAgentAdapter(agent);
|
|
531
|
+
if (!adapter) {
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
for (const file of adapter.configFiles()) {
|
|
535
|
+
const abs = node_path_1.default.join(root, ...file.relPath.split('/'));
|
|
536
|
+
if (await (0, fs_1.pathExists)(abs)) {
|
|
537
|
+
return true;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return false;
|
|
541
|
+
}
|
|
542
|
+
/** 已安装的工具 id 列表(只包含检测到配置文件的工具)。 */
|
|
543
|
+
async function detectInstalledAgents(root) {
|
|
544
|
+
const installed = [];
|
|
545
|
+
for (const adapter of exports.AGENT_ADAPTERS) {
|
|
546
|
+
if (await isAgentInstalled(root, adapter.id)) {
|
|
547
|
+
installed.push(adapter.id);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
return installed;
|
|
551
|
+
}
|