ccg-ros2-workflow 1.0.9 → 1.1.0
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 +33 -9
- package/bin/cli.js +96 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
ROS2 多模型协作开发工具 - 基于 Claude Code CLI
|
|
7
7
|
|
|
8
|
-
> **v1.0
|
|
8
|
+
> **v1.1.0** - 支持直接安装 ace-tool,无需手动安装
|
|
9
9
|
|
|
10
10
|
## 特性
|
|
11
11
|
|
|
@@ -176,22 +176,35 @@ npm install -g @google/gemini-cli
|
|
|
176
176
|
|
|
177
177
|
ace-tool 是 Augment Code 的代码上下文引擎,让 AI 自动理解项目结构。
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
### 安装方式
|
|
180
|
+
|
|
181
|
+
运行安装程序,选择「配置 ace-tool MCP」:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
npx ccg-ros2-workflow
|
|
185
|
+
# 选择 3. 配置 ace-tool MCP
|
|
186
|
+
# 选择版本:ace-tool (Node.js) 或 ace-tool-rs (Rust,推荐)
|
|
187
|
+
# 输入 Token(从 augmentcode.com 或中转服务获取)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 配置示例
|
|
180
191
|
|
|
181
192
|
```json
|
|
182
193
|
{
|
|
183
194
|
"ace-tool": {
|
|
184
|
-
"command": "
|
|
185
|
-
"args": ["mcp"],
|
|
186
|
-
"env": {}
|
|
195
|
+
"command": "npx",
|
|
196
|
+
"args": ["ace-tool-rs", "mcp", "--token", "your-token"],
|
|
197
|
+
"env": { "RUST_LOG": "info" }
|
|
187
198
|
}
|
|
188
199
|
}
|
|
189
200
|
```
|
|
190
201
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
202
|
+
### Token 获取
|
|
203
|
+
|
|
204
|
+
- **官方服务**: https://augmentcode.com/ 注册获取
|
|
205
|
+
- **中转服务**: 使用第三方中转(需要配置 Base URL)
|
|
206
|
+
|
|
207
|
+
配置完成后重启 Claude Code 即可使用。
|
|
195
208
|
|
|
196
209
|
## 语言配置
|
|
197
210
|
|
|
@@ -222,6 +235,17 @@ MIT
|
|
|
222
235
|
|
|
223
236
|
## 更新日志
|
|
224
237
|
|
|
238
|
+
### v1.1.0
|
|
239
|
+
- 支持直接安装 ace-tool,无需手动安装 CLI
|
|
240
|
+
- 支持 ace-tool (Node.js) 和 ace-tool-rs (Rust) 两种版本
|
|
241
|
+
- 支持配置 Token 和 Base URL(中转服务)
|
|
242
|
+
- 使用 npx 自动下载运行,首次使用自动安装
|
|
243
|
+
|
|
244
|
+
### v1.0.9
|
|
245
|
+
- 提示词文件统一使用英文
|
|
246
|
+
- 保留 "Code comments in Chinese" 指令
|
|
247
|
+
- 语言规范:提示词(英文) / 交互(中文) / 注释(中文)
|
|
248
|
+
|
|
225
249
|
### v1.0.8
|
|
226
250
|
- 基于 Codex+Gemini 双模型交叉验证分析优化
|
|
227
251
|
- `gemini/architect.md`: 增加 QoS 策略设计 + Node Composition
|
package/bin/cli.js
CHANGED
|
@@ -158,62 +158,130 @@ async function configureMCP() {
|
|
|
158
158
|
console.log('ace-tool 是 Augment Code 的代码上下文引擎');
|
|
159
159
|
console.log('它能让 AI 自动理解你的项目结构和代码\n');
|
|
160
160
|
|
|
161
|
-
//
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
161
|
+
// 选择操作
|
|
162
|
+
console.log('请选择操作:');
|
|
163
|
+
console.log('1. 安装/更新 ace-tool (Node.js 版本)');
|
|
164
|
+
console.log('2. 安装/更新 ace-tool-rs (Rust 版本,推荐)');
|
|
165
|
+
console.log('3. 卸载 ace-tool MCP 配置');
|
|
166
|
+
console.log('4. 返回');
|
|
167
|
+
|
|
168
|
+
const choice = await question('\n请选择 (1-4): ');
|
|
169
|
+
|
|
170
|
+
if (choice === '4') return;
|
|
171
|
+
|
|
172
|
+
if (choice === '3') {
|
|
173
|
+
await uninstallMCP();
|
|
174
|
+
return;
|
|
169
175
|
}
|
|
170
176
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
console.log('1. 访问 https://augmentcode.com/ 注册账号');
|
|
174
|
-
console.log('2. 按照官方指引安装 ace-tool CLI\n');
|
|
177
|
+
const pkg = choice === '2' ? 'ace-tool-rs' : 'ace-tool';
|
|
178
|
+
const pkgName = choice === '2' ? 'ace-tool-rs (Rust)' : 'ace-tool (Node.js)';
|
|
175
179
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
+
console.log(`\n📦 配置 ${pkgName}\n`);
|
|
181
|
+
|
|
182
|
+
// 获取 Token
|
|
183
|
+
console.log('获取 Token 的方式:');
|
|
184
|
+
console.log('- 官方服务: https://augmentcode.com/ 注册获取');
|
|
185
|
+
console.log('- 中转服务: 使用第三方中转(需要 Base URL)\n');
|
|
186
|
+
|
|
187
|
+
const baseUrl = await question('Base URL (使用官方服务请留空): ');
|
|
188
|
+
const token = await question('Token (必填): ');
|
|
189
|
+
|
|
190
|
+
if (!token.trim()) {
|
|
191
|
+
console.log('\n❌ Token 不能为空');
|
|
192
|
+
return;
|
|
180
193
|
}
|
|
181
194
|
|
|
195
|
+
// 构建 MCP 配置
|
|
196
|
+
const args = [pkg, 'mcp'];
|
|
197
|
+
if (baseUrl.trim()) {
|
|
198
|
+
args.push('--base-url', baseUrl.trim());
|
|
199
|
+
}
|
|
200
|
+
args.push('--token', token.trim());
|
|
201
|
+
|
|
202
|
+
const mcpServerConfig = {
|
|
203
|
+
command: 'npx',
|
|
204
|
+
args: args,
|
|
205
|
+
env: pkg === 'ace-tool-rs' ? { RUST_LOG: 'info' } : {}
|
|
206
|
+
};
|
|
207
|
+
|
|
182
208
|
// 读取或创建 MCP 配置
|
|
183
209
|
let mcpConfig = {};
|
|
184
210
|
if (fs.existsSync(MCP_CONFIG_PATH)) {
|
|
185
211
|
try {
|
|
186
212
|
mcpConfig = JSON.parse(fs.readFileSync(MCP_CONFIG_PATH, 'utf8'));
|
|
187
|
-
console.log('检测到已有 MCP
|
|
213
|
+
console.log('\n检测到已有 MCP 配置,将更新 ace-tool\n');
|
|
188
214
|
} catch {
|
|
189
215
|
mcpConfig = {};
|
|
190
216
|
}
|
|
191
217
|
}
|
|
192
218
|
|
|
219
|
+
// 备份现有配置
|
|
220
|
+
if (Object.keys(mcpConfig).length > 0) {
|
|
221
|
+
const backupDir = path.join(CLAUDE_DIR, 'backup');
|
|
222
|
+
fs.mkdirSync(backupDir, { recursive: true });
|
|
223
|
+
const backupPath = path.join(backupDir, `mcp_servers_${Date.now()}.json`);
|
|
224
|
+
fs.writeFileSync(backupPath, JSON.stringify(mcpConfig, null, 2));
|
|
225
|
+
console.log(`已备份配置到: ${backupPath}`);
|
|
226
|
+
}
|
|
227
|
+
|
|
193
228
|
// 添加 ace-tool 配置
|
|
194
|
-
mcpConfig['ace-tool'] =
|
|
195
|
-
command: 'ace-tool',
|
|
196
|
-
args: ['mcp'],
|
|
197
|
-
env: {}
|
|
198
|
-
};
|
|
229
|
+
mcpConfig['ace-tool'] = mcpServerConfig;
|
|
199
230
|
|
|
200
231
|
// 写入配置
|
|
201
232
|
fs.mkdirSync(CLAUDE_DIR, { recursive: true });
|
|
202
233
|
fs.writeFileSync(MCP_CONFIG_PATH, JSON.stringify(mcpConfig, null, 2));
|
|
203
234
|
|
|
204
|
-
console.log('✅ MCP 配置已写入: ~/.claude/mcp_servers.json\n');
|
|
235
|
+
console.log('\n✅ MCP 配置已写入: ~/.claude/mcp_servers.json\n');
|
|
205
236
|
console.log('配置内容:');
|
|
206
|
-
console.log(JSON.stringify(
|
|
237
|
+
console.log(JSON.stringify(mcpServerConfig, null, 2));
|
|
238
|
+
|
|
239
|
+
console.log('\n📌 说明:');
|
|
240
|
+
console.log(`- 使用 npx ${pkg} 自动下载运行,无需手动安装`);
|
|
241
|
+
console.log('- Token 已配置,首次运行会自动下载包');
|
|
242
|
+
console.log('- 重启 Claude Code 使 MCP 生效');
|
|
207
243
|
|
|
208
|
-
console.log('\n📌 后续步骤:');
|
|
209
|
-
console.log('1. 确保已安装 ace-tool CLI');
|
|
210
|
-
console.log('2. 运行 ace-tool login 登录 Augment 账号');
|
|
211
|
-
console.log('3. 重启 Claude Code 使 MCP 生效');
|
|
212
244
|
console.log('\n使用方式:');
|
|
213
245
|
console.log(' 在 workflow 中自动调用 mcp__ace-tool__search_context');
|
|
214
246
|
console.log(' 或手动调用 mcp__ace-tool__enhance_prompt');
|
|
215
247
|
}
|
|
216
248
|
|
|
249
|
+
async function uninstallMCP() {
|
|
250
|
+
console.log('\n🗑️ 卸载 ace-tool MCP 配置\n');
|
|
251
|
+
|
|
252
|
+
if (!fs.existsSync(MCP_CONFIG_PATH)) {
|
|
253
|
+
console.log('未找到 MCP 配置文件');
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const confirm = await question('确定要移除 ace-tool MCP 配置吗? (y/N): ');
|
|
258
|
+
if (confirm.toLowerCase() !== 'y') {
|
|
259
|
+
console.log('取消卸载');
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
try {
|
|
264
|
+
let mcpConfig = JSON.parse(fs.readFileSync(MCP_CONFIG_PATH, 'utf8'));
|
|
265
|
+
|
|
266
|
+
if (!mcpConfig['ace-tool']) {
|
|
267
|
+
console.log('MCP 配置中没有 ace-tool');
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
delete mcpConfig['ace-tool'];
|
|
272
|
+
|
|
273
|
+
if (Object.keys(mcpConfig).length === 0) {
|
|
274
|
+
fs.unlinkSync(MCP_CONFIG_PATH);
|
|
275
|
+
console.log('✅ 已删除: ~/.claude/mcp_servers.json');
|
|
276
|
+
} else {
|
|
277
|
+
fs.writeFileSync(MCP_CONFIG_PATH, JSON.stringify(mcpConfig, null, 2));
|
|
278
|
+
console.log('✅ 已从 MCP 配置中移除 ace-tool');
|
|
279
|
+
}
|
|
280
|
+
} catch (e) {
|
|
281
|
+
console.log('❌ 移除失败:', e.message);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
217
285
|
async function configureApiKeys() {
|
|
218
286
|
console.log('\n🔑 配置 API 密钥\n');
|
|
219
287
|
|
package/package.json
CHANGED