ccg-workflow 3.1.0 → 3.1.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/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import cac from 'cac';
|
|
3
3
|
import ansis from 'ansis';
|
|
4
|
-
import { B as diagnoseMcpConfig, C as isWindows, D as readClaudeCodeConfig, E as fixWindowsMcpConfig, F as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, G as configMcp, H as version } from './shared/ccg-workflow.
|
|
4
|
+
import { B as diagnoseMcpConfig, C as isWindows, D as readClaudeCodeConfig, E as fixWindowsMcpConfig, F as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, G as configMcp, H as version } from './shared/ccg-workflow.k-Wk5rrs.mjs';
|
|
5
5
|
import 'inquirer';
|
|
6
6
|
import 'ora';
|
|
7
7
|
import 'node:child_process';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as changeLanguage, z as checkForUpdates, A as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, x as getCurrentVersion, y as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, n as installCodexMode, k as installWorkflows, t as migrateToV1_4_0, v as needsMigration, r as readCcgConfig, s as showMainMenu, q as uninstallAceTool, o as uninstallCodexMode, p as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.
|
|
1
|
+
export { c as changeLanguage, z as checkForUpdates, A as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, x as getCurrentVersion, y as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, n as installCodexMode, k as installWorkflows, t as migrateToV1_4_0, v as needsMigration, r as readCcgConfig, s as showMainMenu, q as uninstallAceTool, o as uninstallCodexMode, p as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.k-Wk5rrs.mjs';
|
|
2
2
|
import 'ansis';
|
|
3
3
|
import 'inquirer';
|
|
4
4
|
import 'ora';
|
|
@@ -10,7 +10,7 @@ import fs from 'fs-extra';
|
|
|
10
10
|
import { parse, stringify } from 'smol-toml';
|
|
11
11
|
import i18next from 'i18next';
|
|
12
12
|
|
|
13
|
-
const version = "3.1.
|
|
13
|
+
const version = "3.1.1";
|
|
14
14
|
|
|
15
15
|
function cmd(id, order, category, name, nameEn, description, descriptionEn, cmdOverride) {
|
|
16
16
|
return {
|
|
@@ -197,6 +197,79 @@ function replaceHomePathsInTemplate(content, installDir) {
|
|
|
197
197
|
return processed;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
+
const CCG_DIR = join(homedir(), ".claude", ".ccg");
|
|
201
|
+
const CONFIG_FILE = join(CCG_DIR, "config.toml");
|
|
202
|
+
function getCcgDir() {
|
|
203
|
+
return CCG_DIR;
|
|
204
|
+
}
|
|
205
|
+
function getConfigPath() {
|
|
206
|
+
return CONFIG_FILE;
|
|
207
|
+
}
|
|
208
|
+
async function ensureCcgDir() {
|
|
209
|
+
await fs.ensureDir(CCG_DIR);
|
|
210
|
+
}
|
|
211
|
+
async function readCcgConfig() {
|
|
212
|
+
try {
|
|
213
|
+
if (await fs.pathExists(CONFIG_FILE)) {
|
|
214
|
+
const content = await fs.readFile(CONFIG_FILE, "utf-8");
|
|
215
|
+
return parse(content);
|
|
216
|
+
}
|
|
217
|
+
} catch {
|
|
218
|
+
}
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
async function writeCcgConfig(config) {
|
|
222
|
+
await ensureCcgDir();
|
|
223
|
+
const content = stringify(config);
|
|
224
|
+
await fs.writeFile(CONFIG_FILE, content, "utf-8");
|
|
225
|
+
}
|
|
226
|
+
function createDefaultConfig(options) {
|
|
227
|
+
return {
|
|
228
|
+
general: {
|
|
229
|
+
version: version,
|
|
230
|
+
language: options.language,
|
|
231
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
232
|
+
},
|
|
233
|
+
routing: options.routing,
|
|
234
|
+
workflows: {
|
|
235
|
+
installed: options.installedWorkflows
|
|
236
|
+
},
|
|
237
|
+
paths: {
|
|
238
|
+
commands: join(homedir(), ".claude", "commands", "ccg"),
|
|
239
|
+
prompts: join(CCG_DIR, "prompts"),
|
|
240
|
+
// v1.4.0: 移到配置目录
|
|
241
|
+
backup: join(CCG_DIR, "backup")
|
|
242
|
+
},
|
|
243
|
+
mcp: {
|
|
244
|
+
provider: options.mcpProvider || "fast-context",
|
|
245
|
+
setup_url: "https://augmentcode.com/"
|
|
246
|
+
},
|
|
247
|
+
performance: {
|
|
248
|
+
liteMode: options.liteMode || false,
|
|
249
|
+
skipImpeccable: options.skipImpeccable || false
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function createDefaultRouting() {
|
|
254
|
+
return {
|
|
255
|
+
frontend: {
|
|
256
|
+
models: ["antigravity"],
|
|
257
|
+
primary: "antigravity",
|
|
258
|
+
strategy: "parallel"
|
|
259
|
+
},
|
|
260
|
+
backend: {
|
|
261
|
+
models: ["codex"],
|
|
262
|
+
primary: "codex",
|
|
263
|
+
strategy: "parallel"
|
|
264
|
+
},
|
|
265
|
+
review: {
|
|
266
|
+
models: ["codex", "antigravity"],
|
|
267
|
+
strategy: "parallel"
|
|
268
|
+
},
|
|
269
|
+
mode: "smart"
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
|
|
200
273
|
const DEFAULT_ALLOWED_TOOLS = ["Read"];
|
|
201
274
|
const NAME_SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
202
275
|
const TOOL_NAME_RE = /^[A-Z][A-Za-z0-9]*$/;
|
|
@@ -1111,7 +1184,18 @@ async function installCodexMode() {
|
|
|
1111
1184
|
}
|
|
1112
1185
|
const agentsMdSrc = join(codexTemplateDir, "AGENTS.md");
|
|
1113
1186
|
if (await fs.pathExists(agentsMdSrc)) {
|
|
1114
|
-
|
|
1187
|
+
const config = await readCcgConfig();
|
|
1188
|
+
if (config) {
|
|
1189
|
+
let content = await fs.readFile(agentsMdSrc, "utf-8");
|
|
1190
|
+
content = injectConfigVariables(content, {
|
|
1191
|
+
routing: config.routing,
|
|
1192
|
+
liteMode: config.performance?.liteMode || false,
|
|
1193
|
+
mcpProvider: config.mcp?.provider || "skip"
|
|
1194
|
+
});
|
|
1195
|
+
await fs.writeFile(join(codexHome, "AGENTS.md"), content, "utf-8");
|
|
1196
|
+
} else {
|
|
1197
|
+
await fs.copy(agentsMdSrc, join(codexHome, "AGENTS.md"), { overwrite: true });
|
|
1198
|
+
}
|
|
1115
1199
|
}
|
|
1116
1200
|
const hooksSrc = join(codexTemplateDir, "hooks");
|
|
1117
1201
|
if (await fs.pathExists(hooksSrc)) {
|
|
@@ -2888,79 +2972,6 @@ async function changeLanguage(lang) {
|
|
|
2888
2972
|
await i18n.changeLanguage(lang);
|
|
2889
2973
|
}
|
|
2890
2974
|
|
|
2891
|
-
const CCG_DIR = join(homedir(), ".claude", ".ccg");
|
|
2892
|
-
const CONFIG_FILE = join(CCG_DIR, "config.toml");
|
|
2893
|
-
function getCcgDir() {
|
|
2894
|
-
return CCG_DIR;
|
|
2895
|
-
}
|
|
2896
|
-
function getConfigPath() {
|
|
2897
|
-
return CONFIG_FILE;
|
|
2898
|
-
}
|
|
2899
|
-
async function ensureCcgDir() {
|
|
2900
|
-
await fs.ensureDir(CCG_DIR);
|
|
2901
|
-
}
|
|
2902
|
-
async function readCcgConfig() {
|
|
2903
|
-
try {
|
|
2904
|
-
if (await fs.pathExists(CONFIG_FILE)) {
|
|
2905
|
-
const content = await fs.readFile(CONFIG_FILE, "utf-8");
|
|
2906
|
-
return parse(content);
|
|
2907
|
-
}
|
|
2908
|
-
} catch {
|
|
2909
|
-
}
|
|
2910
|
-
return null;
|
|
2911
|
-
}
|
|
2912
|
-
async function writeCcgConfig(config) {
|
|
2913
|
-
await ensureCcgDir();
|
|
2914
|
-
const content = stringify(config);
|
|
2915
|
-
await fs.writeFile(CONFIG_FILE, content, "utf-8");
|
|
2916
|
-
}
|
|
2917
|
-
function createDefaultConfig(options) {
|
|
2918
|
-
return {
|
|
2919
|
-
general: {
|
|
2920
|
-
version: version,
|
|
2921
|
-
language: options.language,
|
|
2922
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2923
|
-
},
|
|
2924
|
-
routing: options.routing,
|
|
2925
|
-
workflows: {
|
|
2926
|
-
installed: options.installedWorkflows
|
|
2927
|
-
},
|
|
2928
|
-
paths: {
|
|
2929
|
-
commands: join(homedir(), ".claude", "commands", "ccg"),
|
|
2930
|
-
prompts: join(CCG_DIR, "prompts"),
|
|
2931
|
-
// v1.4.0: 移到配置目录
|
|
2932
|
-
backup: join(CCG_DIR, "backup")
|
|
2933
|
-
},
|
|
2934
|
-
mcp: {
|
|
2935
|
-
provider: options.mcpProvider || "fast-context",
|
|
2936
|
-
setup_url: "https://augmentcode.com/"
|
|
2937
|
-
},
|
|
2938
|
-
performance: {
|
|
2939
|
-
liteMode: options.liteMode || false,
|
|
2940
|
-
skipImpeccable: options.skipImpeccable || false
|
|
2941
|
-
}
|
|
2942
|
-
};
|
|
2943
|
-
}
|
|
2944
|
-
function createDefaultRouting() {
|
|
2945
|
-
return {
|
|
2946
|
-
frontend: {
|
|
2947
|
-
models: ["antigravity"],
|
|
2948
|
-
primary: "antigravity",
|
|
2949
|
-
strategy: "parallel"
|
|
2950
|
-
},
|
|
2951
|
-
backend: {
|
|
2952
|
-
models: ["codex"],
|
|
2953
|
-
primary: "codex",
|
|
2954
|
-
strategy: "parallel"
|
|
2955
|
-
},
|
|
2956
|
-
review: {
|
|
2957
|
-
models: ["codex", "antigravity"],
|
|
2958
|
-
strategy: "parallel"
|
|
2959
|
-
},
|
|
2960
|
-
mode: "smart"
|
|
2961
|
-
};
|
|
2962
|
-
}
|
|
2963
|
-
|
|
2964
2975
|
async function migrateToV1_4_0() {
|
|
2965
2976
|
const result = {
|
|
2966
2977
|
success: true,
|
package/package.json
CHANGED
|
@@ -127,13 +127,13 @@ ls .ccg/spec/ 2>/dev/null
|
|
|
127
127
|
### ⛔ 默认调用方式:双模型并行(M+ 复杂度必须用这个)
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
|
-
~/.claude/bin/codeagent-wrapper --progress --backend
|
|
131
|
-
ROLE_FILE: ~/.claude/.ccg/prompts/
|
|
130
|
+
~/.claude/bin/codeagent-wrapper --progress --backend {{FRONTEND_PRIMARY}} - "$(pwd)" <<'FRONTEND_EOF'
|
|
131
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/$ROLE.md
|
|
132
132
|
<TASK>
|
|
133
133
|
{任务描述 + 上下文}
|
|
134
134
|
</TASK>
|
|
135
135
|
OUTPUT: {期望输出格式}
|
|
136
|
-
|
|
136
|
+
FRONTEND_EOF
|
|
137
137
|
&
|
|
138
138
|
~/.claude/bin/codeagent-wrapper --progress --backend claude - "$(pwd)" <<'CLAUDE_EOF'
|
|
139
139
|
ROLE_FILE: ~/.claude/.ccg/prompts/claude/$ROLE.md
|
|
@@ -152,8 +152,8 @@ wait
|
|
|
152
152
|
|
|
153
153
|
#### Gemini(前端/UI 分析)
|
|
154
154
|
```bash
|
|
155
|
-
~/.claude/bin/codeagent-wrapper --progress --backend
|
|
156
|
-
ROLE_FILE: ~/.claude/.ccg/prompts/
|
|
155
|
+
~/.claude/bin/codeagent-wrapper --progress --backend {{FRONTEND_PRIMARY}} - "$(pwd)" <<'EOF'
|
|
156
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/$ROLE.md
|
|
157
157
|
<TASK>
|
|
158
158
|
{任务描述 + 上下文}
|
|
159
159
|
</TASK>
|
|
@@ -287,8 +287,8 @@ Critical 问题 → spawn 修复代理。Warning → 视情况修复。
|
|
|
287
287
|
|
|
288
288
|
```bash
|
|
289
289
|
# 必须并行调用两个模型审查 git diff
|
|
290
|
-
~/.claude/bin/codeagent-wrapper --progress --backend
|
|
291
|
-
ROLE_FILE: ~/.claude/.ccg/prompts/
|
|
290
|
+
~/.claude/bin/codeagent-wrapper --progress --backend {{FRONTEND_PRIMARY}} - "$(pwd)" <<'EOF'
|
|
291
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/reviewer.md
|
|
292
292
|
<TASK>审查以下代码变更:$(git diff)</TASK>
|
|
293
293
|
OUTPUT: Critical/Warning/Info 分级审查报告
|
|
294
294
|
EOF
|