ccg-workflow 1.7.25 → 1.7.27
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/bin/codeagent-wrapper-darwin-amd64 +0 -0
- package/bin/codeagent-wrapper-darwin-arm64 +0 -0
- package/bin/codeagent-wrapper-linux-amd64 +0 -0
- package/bin/codeagent-wrapper-linux-arm64 +0 -0
- package/bin/codeagent-wrapper-windows-amd64.exe +0 -0
- package/bin/codeagent-wrapper-windows-arm64.exe +0 -0
- package/dist/cli.mjs +2 -2
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.mjs +1 -1
- package/dist/shared/{ccg-workflow.DJlWxdzA.mjs → ccg-workflow.DwzhzV2u.mjs} +80 -105
- package/package.json +1 -1
- package/templates/commands/analyze.md +10 -1
- package/templates/commands/backend.md +2 -2
- package/templates/commands/debug.md +10 -1
- package/templates/commands/feat.md +11 -2
- package/templates/commands/frontend.md +2 -2
- package/templates/commands/optimize.md +10 -1
- package/templates/commands/review.md +10 -1
- package/templates/commands/test.md +10 -1
- package/templates/commands/workflow.md +11 -2
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
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 { y as diagnoseMcpConfig, z as isWindows, A as readClaudeCodeConfig, B as fixWindowsMcpConfig, C as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, D as configMcp, E as version, a as i18n } from './shared/ccg-workflow.
|
|
4
|
+
import { y as diagnoseMcpConfig, z as isWindows, A as readClaudeCodeConfig, B as fixWindowsMcpConfig, C as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, D as configMcp, E as version, a as i18n } from './shared/ccg-workflow.DwzhzV2u.mjs';
|
|
5
5
|
import 'inquirer';
|
|
6
6
|
import 'node:child_process';
|
|
7
7
|
import 'node:util';
|
|
@@ -141,7 +141,7 @@ async function setupCommands(cli) {
|
|
|
141
141
|
}
|
|
142
142
|
await showMainMenu();
|
|
143
143
|
});
|
|
144
|
-
cli.command("init", "Initialize CCG multi-model collaboration system").alias("i").option("--lang, -l <lang>", "Display language (zh-CN, en)").option("--force, -f", "Force overwrite existing configuration").option("--skip-prompt, -s", "Skip all interactive prompts (non-interactive mode)").option("--frontend, -F <models>", "Frontend models (comma-separated: gemini,codex,claude)").option("--backend, -B <models>", "Backend models (comma-separated: codex,gemini,claude)").option("--mode, -m <mode>", "Collaboration mode (parallel, smart, sequential)").option("--workflows, -w <workflows>", 'Workflows to install (comma-separated or "all")').option("--install-dir, -d <path>", "Installation directory (default: ~/.claude)").action(async (options) => {
|
|
144
|
+
cli.command("init", "Initialize CCG multi-model collaboration system").alias("i").option("--lang, -l <lang>", "Display language (zh-CN, en)").option("--force, -f", "Force overwrite existing configuration").option("--skip-prompt, -s", "Skip all interactive prompts (non-interactive mode)").option("--skip-mcp", "Skip MCP configuration (used during update)").option("--frontend, -F <models>", "Frontend models (comma-separated: gemini,codex,claude)").option("--backend, -B <models>", "Backend models (comma-separated: codex,gemini,claude)").option("--mode, -m <mode>", "Collaboration mode (parallel, smart, sequential)").option("--workflows, -w <workflows>", 'Workflows to install (comma-separated or "all")').option("--install-dir, -d <path>", "Installation directory (default: ~/.claude)").action(async (options) => {
|
|
145
145
|
if (options.lang) {
|
|
146
146
|
await initI18n(options.lang);
|
|
147
147
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -4,6 +4,7 @@ interface CliOptions {
|
|
|
4
4
|
lang?: SupportedLang;
|
|
5
5
|
force?: boolean;
|
|
6
6
|
skipPrompt?: boolean;
|
|
7
|
+
skipMcp?: boolean;
|
|
7
8
|
frontend?: string;
|
|
8
9
|
backend?: string;
|
|
9
10
|
mode?: CollaborationMode;
|
|
@@ -51,6 +52,9 @@ interface CcgConfig {
|
|
|
51
52
|
provider: string;
|
|
52
53
|
setup_url: string;
|
|
53
54
|
};
|
|
55
|
+
performance?: {
|
|
56
|
+
liteMode?: boolean;
|
|
57
|
+
};
|
|
54
58
|
}
|
|
55
59
|
interface WorkflowConfig {
|
|
56
60
|
id: string;
|
|
@@ -66,6 +70,7 @@ interface WorkflowConfig {
|
|
|
66
70
|
interface InitOptions {
|
|
67
71
|
lang?: SupportedLang;
|
|
68
72
|
skipPrompt?: boolean;
|
|
73
|
+
skipMcp?: boolean;
|
|
69
74
|
force?: boolean;
|
|
70
75
|
frontend?: string;
|
|
71
76
|
backend?: string;
|
|
@@ -109,6 +114,7 @@ declare function createDefaultConfig(options: {
|
|
|
109
114
|
routing: ModelRouting;
|
|
110
115
|
installedWorkflows: string[];
|
|
111
116
|
mcpProvider?: string;
|
|
117
|
+
liteMode?: boolean;
|
|
112
118
|
}): CcgConfig;
|
|
113
119
|
declare function createDefaultRouting(): ModelRouting;
|
|
114
120
|
|
|
@@ -129,6 +135,7 @@ declare function installWorkflows(workflowIds: string[], installDir: string, for
|
|
|
129
135
|
models?: string[];
|
|
130
136
|
};
|
|
131
137
|
};
|
|
138
|
+
liteMode?: boolean;
|
|
132
139
|
}): Promise<InstallResult>;
|
|
133
140
|
/**
|
|
134
141
|
* Install and configure ace-tool MCP for Claude Code
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ interface CliOptions {
|
|
|
4
4
|
lang?: SupportedLang;
|
|
5
5
|
force?: boolean;
|
|
6
6
|
skipPrompt?: boolean;
|
|
7
|
+
skipMcp?: boolean;
|
|
7
8
|
frontend?: string;
|
|
8
9
|
backend?: string;
|
|
9
10
|
mode?: CollaborationMode;
|
|
@@ -51,6 +52,9 @@ interface CcgConfig {
|
|
|
51
52
|
provider: string;
|
|
52
53
|
setup_url: string;
|
|
53
54
|
};
|
|
55
|
+
performance?: {
|
|
56
|
+
liteMode?: boolean;
|
|
57
|
+
};
|
|
54
58
|
}
|
|
55
59
|
interface WorkflowConfig {
|
|
56
60
|
id: string;
|
|
@@ -66,6 +70,7 @@ interface WorkflowConfig {
|
|
|
66
70
|
interface InitOptions {
|
|
67
71
|
lang?: SupportedLang;
|
|
68
72
|
skipPrompt?: boolean;
|
|
73
|
+
skipMcp?: boolean;
|
|
69
74
|
force?: boolean;
|
|
70
75
|
frontend?: string;
|
|
71
76
|
backend?: string;
|
|
@@ -109,6 +114,7 @@ declare function createDefaultConfig(options: {
|
|
|
109
114
|
routing: ModelRouting;
|
|
110
115
|
installedWorkflows: string[];
|
|
111
116
|
mcpProvider?: string;
|
|
117
|
+
liteMode?: boolean;
|
|
112
118
|
}): CcgConfig;
|
|
113
119
|
declare function createDefaultRouting(): ModelRouting;
|
|
114
120
|
|
|
@@ -129,6 +135,7 @@ declare function installWorkflows(workflowIds: string[], installDir: string, for
|
|
|
129
135
|
models?: string[];
|
|
130
136
|
};
|
|
131
137
|
};
|
|
138
|
+
liteMode?: boolean;
|
|
132
139
|
}): Promise<InstallResult>;
|
|
133
140
|
/**
|
|
134
141
|
* Install and configure ace-tool MCP for Claude Code
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as changeLanguage, v as checkForUpdates, x as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, q as getCurrentVersion, t as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, k as installWorkflows, o as migrateToV1_4_0, p as needsMigration, r as readCcgConfig, s as showMainMenu, n as uninstallAceTool, m as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.
|
|
1
|
+
export { c as changeLanguage, v as checkForUpdates, x as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, q as getCurrentVersion, t as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, k as installWorkflows, o as migrateToV1_4_0, p as needsMigration, r as readCcgConfig, s as showMainMenu, n as uninstallAceTool, m as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.DwzhzV2u.mjs';
|
|
2
2
|
import 'ansis';
|
|
3
3
|
import 'inquirer';
|
|
4
4
|
import 'node:child_process';
|
|
@@ -10,7 +10,7 @@ import i18next from 'i18next';
|
|
|
10
10
|
import ora from 'ora';
|
|
11
11
|
import { parse, stringify } from 'smol-toml';
|
|
12
12
|
|
|
13
|
-
const version = "1.7.
|
|
13
|
+
const version = "1.7.27";
|
|
14
14
|
|
|
15
15
|
function isWindows() {
|
|
16
16
|
return process.platform === "win32";
|
|
@@ -365,6 +365,8 @@ function injectConfigVariables(content, config) {
|
|
|
365
365
|
processed = processed.replace(/\{\{REVIEW_MODELS\}\}/g, JSON.stringify(reviewModels));
|
|
366
366
|
const routingMode = routing.mode || "smart";
|
|
367
367
|
processed = processed.replace(/\{\{ROUTING_MODE\}\}/g, routingMode);
|
|
368
|
+
const liteModeFlag = config.liteMode ? "--lite " : "";
|
|
369
|
+
processed = processed.replace(/\{\{LITE_MODE_FLAG\}\}/g, liteModeFlag);
|
|
368
370
|
return processed;
|
|
369
371
|
}
|
|
370
372
|
function replaceHomePathsInTemplate(content, installDir) {
|
|
@@ -390,7 +392,8 @@ async function installWorkflows(workflowIds, installDir, force = false, config)
|
|
|
390
392
|
frontend: { models: ["gemini"], primary: "gemini" },
|
|
391
393
|
backend: { models: ["codex"], primary: "codex" },
|
|
392
394
|
review: { models: ["codex", "gemini"] }
|
|
393
|
-
}
|
|
395
|
+
},
|
|
396
|
+
liteMode: config?.liteMode || false
|
|
394
397
|
};
|
|
395
398
|
const result = {
|
|
396
399
|
success: true,
|
|
@@ -721,17 +724,6 @@ async function installAceTool(config) {
|
|
|
721
724
|
}
|
|
722
725
|
}
|
|
723
726
|
|
|
724
|
-
const installer = {
|
|
725
|
-
__proto__: null,
|
|
726
|
-
getAllCommandIds: getAllCommandIds,
|
|
727
|
-
getWorkflowById: getWorkflowById,
|
|
728
|
-
getWorkflowConfigs: getWorkflowConfigs,
|
|
729
|
-
installAceTool: installAceTool,
|
|
730
|
-
installWorkflows: installWorkflows,
|
|
731
|
-
uninstallAceTool: uninstallAceTool,
|
|
732
|
-
uninstallWorkflows: uninstallWorkflows
|
|
733
|
-
};
|
|
734
|
-
|
|
735
727
|
async function configMcp() {
|
|
736
728
|
console.log();
|
|
737
729
|
console.log(ansis.cyan.bold(` \u914D\u7F6E ace-tool MCP`));
|
|
@@ -1207,6 +1199,9 @@ function createDefaultConfig(options) {
|
|
|
1207
1199
|
mcp: {
|
|
1208
1200
|
provider: options.mcpProvider || "ace-tool",
|
|
1209
1201
|
setup_url: "https://augmentcode.com/"
|
|
1202
|
+
},
|
|
1203
|
+
performance: {
|
|
1204
|
+
liteMode: options.liteMode || false
|
|
1210
1205
|
}
|
|
1211
1206
|
};
|
|
1212
1207
|
}
|
|
@@ -1323,10 +1318,13 @@ async function init(options = {}) {
|
|
|
1323
1318
|
const backendModels = ["codex"];
|
|
1324
1319
|
const mode = "smart";
|
|
1325
1320
|
const selectedWorkflows = getAllCommandIds();
|
|
1321
|
+
let liteMode = false;
|
|
1326
1322
|
let mcpProvider = "ace-tool";
|
|
1327
1323
|
let aceToolBaseUrl = "";
|
|
1328
1324
|
let aceToolToken = "";
|
|
1329
|
-
if (
|
|
1325
|
+
if (options.skipMcp) {
|
|
1326
|
+
mcpProvider = "skip";
|
|
1327
|
+
} else if (!options.skipPrompt) {
|
|
1330
1328
|
console.log();
|
|
1331
1329
|
console.log(ansis.cyan.bold(` \u{1F527} MCP \u5DE5\u5177\u914D\u7F6E`));
|
|
1332
1330
|
console.log();
|
|
@@ -1399,6 +1397,14 @@ async function init(options = {}) {
|
|
|
1399
1397
|
console.log(ansis.gray(` \u2022 \u53EF\u7A0D\u540E\u624B\u52A8\u914D\u7F6E\u4EFB\u4F55 MCP \u670D\u52A1`));
|
|
1400
1398
|
console.log();
|
|
1401
1399
|
}
|
|
1400
|
+
console.log();
|
|
1401
|
+
const { enableWebUI } = await inquirer.prompt([{
|
|
1402
|
+
type: "confirm",
|
|
1403
|
+
name: "enableWebUI",
|
|
1404
|
+
message: `\u542F\u7528 Web UI \u5B9E\u65F6\u8F93\u51FA\uFF1F${ansis.gray("(\u7981\u7528\u53EF\u52A0\u901F\u54CD\u5E94)")}`,
|
|
1405
|
+
default: true
|
|
1406
|
+
}]);
|
|
1407
|
+
liteMode = !enableWebUI;
|
|
1402
1408
|
}
|
|
1403
1409
|
const routing = {
|
|
1404
1410
|
frontend: {
|
|
@@ -1424,6 +1430,7 @@ async function init(options = {}) {
|
|
|
1424
1430
|
console.log(` ${ansis.cyan("\u6A21\u578B\u8DEF\u7531")} ${ansis.green("Gemini")} (\u524D\u7AEF) + ${ansis.blue("Codex")} (\u540E\u7AEF)`);
|
|
1425
1431
|
console.log(` ${ansis.cyan("\u547D\u4EE4\u6570\u91CF")} ${ansis.yellow(selectedWorkflows.length.toString())} \u4E2A`);
|
|
1426
1432
|
console.log(` ${ansis.cyan("MCP \u5DE5\u5177")} ${mcpProvider === "ace-tool" ? aceToolToken ? ansis.green("ace-tool") : ansis.yellow("ace-tool (\u5F85\u914D\u7F6E)") : ansis.gray("\u8DF3\u8FC7")}`);
|
|
1433
|
+
console.log(` ${ansis.cyan("Web UI")} ${liteMode ? ansis.gray("\u7981\u7528") : ansis.green("\u542F\u7528")}`);
|
|
1427
1434
|
console.log(ansis.yellow("\u2501".repeat(50)));
|
|
1428
1435
|
console.log();
|
|
1429
1436
|
if (!options.skipPrompt) {
|
|
@@ -1473,12 +1480,14 @@ async function init(options = {}) {
|
|
|
1473
1480
|
language,
|
|
1474
1481
|
routing,
|
|
1475
1482
|
installedWorkflows: selectedWorkflows,
|
|
1476
|
-
mcpProvider
|
|
1483
|
+
mcpProvider,
|
|
1484
|
+
liteMode
|
|
1477
1485
|
});
|
|
1478
1486
|
await writeCcgConfig(config);
|
|
1479
1487
|
const installDir = options.installDir || join(homedir(), ".claude");
|
|
1480
1488
|
const result = await installWorkflows(selectedWorkflows, installDir, options.force, {
|
|
1481
|
-
routing
|
|
1489
|
+
routing,
|
|
1490
|
+
liteMode
|
|
1482
1491
|
});
|
|
1483
1492
|
if (mcpProvider === "ace-tool" && aceToolToken) {
|
|
1484
1493
|
spinner.text = i18n.t("init:aceTool.installing");
|
|
@@ -1532,75 +1541,37 @@ async function init(options = {}) {
|
|
|
1532
1541
|
console.log();
|
|
1533
1542
|
console.log(ansis.cyan(` ${i18n.t("init:installedBinary")}`));
|
|
1534
1543
|
console.log(` ${ansis.green("\u2713")} codeagent-wrapper ${ansis.gray(`\u2192 ${result.binPath}`)}`);
|
|
1535
|
-
console.log();
|
|
1536
1544
|
const platform = process.platform;
|
|
1537
|
-
const exportCommand = `export PATH="${result.binPath}:$PATH"`;
|
|
1538
1545
|
if (platform === "win32") {
|
|
1539
|
-
console.log(ansis.yellow(` \u26A0 ${i18n.t("init:pathWarning")}`));
|
|
1540
|
-
console.log();
|
|
1541
|
-
console.log(ansis.cyan(` ${i18n.t("init:windowsPathInstructions")}`));
|
|
1542
|
-
console.log(ansis.gray(` 1. ${i18n.t("init:windowsStep1")}`));
|
|
1543
|
-
console.log(ansis.gray(` 2. ${i18n.t("init:windowsStep2")}`));
|
|
1544
|
-
console.log(ansis.gray(` 3. ${i18n.t("init:windowsStep3")}`));
|
|
1545
|
-
console.log(ansis.gray(` ${result.binPath.replace(/\//g, "\\")}`));
|
|
1546
|
-
console.log(ansis.gray(` 4. ${i18n.t("init:windowsStep4")}`));
|
|
1547
|
-
console.log();
|
|
1548
|
-
console.log(ansis.cyan(` ${i18n.t("init:orUsePowerShell")}`));
|
|
1549
1546
|
const windowsPath = result.binPath.replace(/\//g, "\\");
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
if (
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
rcContent = await fs.readFile(shellRc, "utf-8");
|
|
1572
|
-
}
|
|
1573
|
-
if (rcContent.includes(result.binPath) || rcContent.includes("/.claude/bin")) {
|
|
1574
|
-
console.log(ansis.green(` \u2713 ${i18n.t("init:pathAlreadyConfigured", { file: shellRcDisplay })}`));
|
|
1575
|
-
} else {
|
|
1576
|
-
const configLine = `
|
|
1547
|
+
try {
|
|
1548
|
+
const { execSync } = await import('node:child_process');
|
|
1549
|
+
const currentPath = execSync(`powershell -Command "[System.Environment]::GetEnvironmentVariable('PATH', 'User')"`, { encoding: "utf-8" }).trim();
|
|
1550
|
+
if (!currentPath.includes(windowsPath) && !currentPath.includes(".claude\\bin")) {
|
|
1551
|
+
execSync(`powershell -Command "[System.Environment]::SetEnvironmentVariable('PATH', '$env:PATH;${windowsPath}', 'User')"`, { stdio: "pipe" });
|
|
1552
|
+
console.log(` ${ansis.green("\u2713")} PATH ${ansis.gray("\u2192 \u7528\u6237\u73AF\u5883\u53D8\u91CF")}`);
|
|
1553
|
+
}
|
|
1554
|
+
} catch {
|
|
1555
|
+
}
|
|
1556
|
+
} else if (!options.skipPrompt) {
|
|
1557
|
+
const exportCommand = `export PATH="${result.binPath}:$PATH"`;
|
|
1558
|
+
const shellRc = process.env.SHELL?.includes("zsh") ? join(homedir(), ".zshrc") : join(homedir(), ".bashrc");
|
|
1559
|
+
const shellRcDisplay = process.env.SHELL?.includes("zsh") ? "~/.zshrc" : "~/.bashrc";
|
|
1560
|
+
try {
|
|
1561
|
+
let rcContent = "";
|
|
1562
|
+
if (await fs.pathExists(shellRc)) {
|
|
1563
|
+
rcContent = await fs.readFile(shellRc, "utf-8");
|
|
1564
|
+
}
|
|
1565
|
+
if (rcContent.includes(result.binPath) || rcContent.includes("/.claude/bin")) {
|
|
1566
|
+
} else {
|
|
1567
|
+
const configLine = `
|
|
1577
1568
|
# CCG multi-model collaboration system
|
|
1578
1569
|
${exportCommand}
|
|
1579
1570
|
`;
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
console.log();
|
|
1583
|
-
console.log(ansis.cyan(` ${i18n.t("init:restartShellPrompt")}`));
|
|
1584
|
-
console.log(ansis.gray(` source ${shellRcDisplay}`));
|
|
1585
|
-
}
|
|
1586
|
-
} catch (error) {
|
|
1587
|
-
console.log(ansis.red(` \u2717 ${i18n.t("init:pathConfigFailed")}`));
|
|
1588
|
-
console.log(ansis.gray(` ${i18n.t("init:manualConfigInstructions", { file: shellRcDisplay })}`));
|
|
1589
|
-
console.log(ansis.gray(` ${exportCommand}`));
|
|
1590
|
-
}
|
|
1591
|
-
} else {
|
|
1592
|
-
const shellRc = process.env.SHELL?.includes("zsh") ? "~/.zshrc" : "~/.bashrc";
|
|
1593
|
-
console.log();
|
|
1594
|
-
console.log(ansis.cyan(` ${i18n.t("init:manualConfigInstructions", { file: shellRc })}`));
|
|
1595
|
-
console.log(ansis.gray(` ${exportCommand}`));
|
|
1596
|
-
console.log(ansis.gray(` source ${shellRc}`));
|
|
1571
|
+
await fs.appendFile(shellRc, configLine, "utf-8");
|
|
1572
|
+
console.log(` ${ansis.green("\u2713")} PATH ${ansis.gray(`\u2192 ${shellRcDisplay}`)}`);
|
|
1597
1573
|
}
|
|
1598
|
-
}
|
|
1599
|
-
const shellRc = process.env.SHELL?.includes("zsh") ? "~/.zshrc" : "~/.bashrc";
|
|
1600
|
-
console.log();
|
|
1601
|
-
console.log(ansis.cyan(` ${i18n.t("init:manualConfigInstructions", { file: shellRc })}`));
|
|
1602
|
-
console.log(ansis.gray(` ${exportCommand}`));
|
|
1603
|
-
console.log(ansis.gray(` source ${shellRc}`));
|
|
1574
|
+
} catch {
|
|
1604
1575
|
}
|
|
1605
1576
|
}
|
|
1606
1577
|
}
|
|
@@ -1827,42 +1798,46 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
|
|
|
1827
1798
|
console.log();
|
|
1828
1799
|
}
|
|
1829
1800
|
}
|
|
1830
|
-
|
|
1831
|
-
spinner = ora("\u6B63\u5728\u66F4\u65B0\u5DE5\u4F5C\u6D41\u548C codeagent-wrapper \u4E8C\u8FDB\u5236...").start();
|
|
1801
|
+
spinner = ora("\u6B63\u5728\u5220\u9664\u65E7\u5DE5\u4F5C\u6D41...").start();
|
|
1832
1802
|
try {
|
|
1833
|
-
const { getAllCommandIds } = await Promise.resolve().then(function () { return installer; });
|
|
1834
|
-
const workflows = getAllCommandIds();
|
|
1835
1803
|
const installDir = join(homedir(), ".claude");
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1838
|
-
|
|
1804
|
+
const uninstallResult = await uninstallWorkflows(installDir);
|
|
1805
|
+
if (uninstallResult.success) {
|
|
1806
|
+
spinner.succeed("\u65E7\u5DE5\u4F5C\u6D41\u5DF2\u5220\u9664");
|
|
1807
|
+
} else {
|
|
1808
|
+
spinner.warn("\u90E8\u5206\u6587\u4EF6\u5220\u9664\u5931\u8D25\uFF0C\u7EE7\u7EED\u5B89\u88C5...");
|
|
1809
|
+
for (const error of uninstallResult.errors) {
|
|
1810
|
+
console.log(ansis.yellow(` \u2022 ${error}`));
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
} catch (error) {
|
|
1814
|
+
spinner.warn(`\u5220\u9664\u65E7\u5DE5\u4F5C\u6D41\u65F6\u51FA\u9519: ${error}\uFF0C\u7EE7\u7EED\u5B89\u88C5...`);
|
|
1815
|
+
}
|
|
1816
|
+
spinner = ora("\u6B63\u5728\u5B89\u88C5\u65B0\u7248\u672C\u5DE5\u4F5C\u6D41\u548C\u4E8C\u8FDB\u5236...").start();
|
|
1817
|
+
try {
|
|
1818
|
+
await execAsync$1(`npx --yes ccg-workflow@latest init --force --skip-mcp`, {
|
|
1819
|
+
timeout: 12e4,
|
|
1820
|
+
env: {
|
|
1821
|
+
...process.env,
|
|
1822
|
+
CCG_UPDATE_MODE: "true"
|
|
1823
|
+
// Signal to init that this is an update
|
|
1824
|
+
}
|
|
1839
1825
|
});
|
|
1840
|
-
|
|
1841
|
-
|
|
1826
|
+
spinner.succeed("\u65B0\u7248\u672C\u5B89\u88C5\u6210\u529F");
|
|
1827
|
+
const config = await readCcgConfig();
|
|
1828
|
+
if (config?.workflows?.installed) {
|
|
1842
1829
|
console.log();
|
|
1843
|
-
console.log(ansis.cyan(`\u5DF2\
|
|
1844
|
-
for (const cmd of
|
|
1830
|
+
console.log(ansis.cyan(`\u5DF2\u5B89\u88C5 ${config.workflows.installed.length} \u4E2A\u547D\u4EE4:`));
|
|
1831
|
+
for (const cmd of config.workflows.installed) {
|
|
1845
1832
|
console.log(` ${ansis.gray("\u2022")} /ccg:${cmd}`);
|
|
1846
1833
|
}
|
|
1847
|
-
if (config) {
|
|
1848
|
-
config.general.version = toVersion;
|
|
1849
|
-
config.workflows = {
|
|
1850
|
-
installed: workflows
|
|
1851
|
-
// Update to include all current commands
|
|
1852
|
-
};
|
|
1853
|
-
await writeCcgConfig(config);
|
|
1854
|
-
}
|
|
1855
|
-
} else {
|
|
1856
|
-
spinner.fail("\u66F4\u65B0\u5931\u8D25");
|
|
1857
|
-
console.log(ansis.red("\u90E8\u5206\u6587\u4EF6\u66F4\u65B0\u5931\u8D25:"));
|
|
1858
|
-
for (const error of result.errors) {
|
|
1859
|
-
console.log(ansis.red(` \u2022 ${error}`));
|
|
1860
|
-
}
|
|
1861
|
-
return;
|
|
1862
1834
|
}
|
|
1863
1835
|
} catch (error) {
|
|
1864
|
-
spinner.fail("\
|
|
1836
|
+
spinner.fail("\u5B89\u88C5\u65B0\u7248\u672C\u5931\u8D25");
|
|
1865
1837
|
console.log(ansis.red(`\u9519\u8BEF: ${error}`));
|
|
1838
|
+
console.log();
|
|
1839
|
+
console.log(ansis.yellow("\u8BF7\u5C1D\u8BD5\u624B\u52A8\u8FD0\u884C:"));
|
|
1840
|
+
console.log(ansis.cyan(" npx ccg-workflow@latest"));
|
|
1866
1841
|
return;
|
|
1867
1842
|
}
|
|
1868
1843
|
console.log();
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@ description: '多模型技术分析(并行执行):Codex 后端视角 + Gem
|
|
|
28
28
|
|
|
29
29
|
```
|
|
30
30
|
Bash({
|
|
31
|
-
command: "~/.claude/bin/codeagent-wrapper --backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
31
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
32
32
|
ROLE_FILE: <角色提示词路径>
|
|
33
33
|
<TASK>
|
|
34
34
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
@@ -51,6 +51,15 @@ EOF",
|
|
|
51
51
|
|
|
52
52
|
**并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
|
|
53
53
|
|
|
54
|
+
**等待后台任务**(使用最大超时 600000ms = 10分钟):
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**重要**:必须指定 `timeout: 600000`,否则默认只有 30 秒会导致提前超时。
|
|
61
|
+
如果 10 分钟后仍未完成,继续用 `TaskOutput` 轮询,**绝对不要 Kill 进程**。
|
|
62
|
+
|
|
54
63
|
---
|
|
55
64
|
|
|
56
65
|
## 执行工作流
|
|
@@ -34,7 +34,7 @@ description: '后端专项工作流(研究→构思→计划→执行→优化
|
|
|
34
34
|
```
|
|
35
35
|
# 新会话调用
|
|
36
36
|
Bash({
|
|
37
|
-
command: "~/.claude/bin/codeagent-wrapper --backend codex - \"$PWD\" <<'EOF'
|
|
37
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend codex - \"$PWD\" <<'EOF'
|
|
38
38
|
ROLE_FILE: <角色提示词路径>
|
|
39
39
|
<TASK>
|
|
40
40
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
@@ -49,7 +49,7 @@ EOF",
|
|
|
49
49
|
|
|
50
50
|
# 复用会话调用
|
|
51
51
|
Bash({
|
|
52
|
-
command: "~/.claude/bin/codeagent-wrapper --backend codex resume <SESSION_ID> - \"$PWD\" <<'EOF'
|
|
52
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend codex resume <SESSION_ID> - \"$PWD\" <<'EOF'
|
|
53
53
|
ROLE_FILE: <角色提示词路径>
|
|
54
54
|
<TASK>
|
|
55
55
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
@@ -27,7 +27,7 @@ description: '多模型调试:Codex 后端诊断 + Gemini 前端诊断,交
|
|
|
27
27
|
|
|
28
28
|
```
|
|
29
29
|
Bash({
|
|
30
|
-
command: "~/.claude/bin/codeagent-wrapper --backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
30
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
31
31
|
<TASK>
|
|
32
32
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
33
33
|
上下文:<错误日志、堆栈信息、复现步骤等>
|
|
@@ -42,6 +42,15 @@ EOF",
|
|
|
42
42
|
|
|
43
43
|
**并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
|
|
44
44
|
|
|
45
|
+
**等待后台任务**(使用最大超时 600000ms = 10分钟):
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**重要**:必须指定 `timeout: 600000`,否则默认只有 30 秒会导致提前超时。
|
|
52
|
+
如果 10 分钟后仍未完成,继续用 `TaskOutput` 轮询,**绝对不要 Kill 进程**。
|
|
53
|
+
|
|
45
54
|
---
|
|
46
55
|
|
|
47
56
|
## 执行工作流
|
|
@@ -15,7 +15,7 @@ $ARGUMENTS
|
|
|
15
15
|
```
|
|
16
16
|
# 新会话调用
|
|
17
17
|
Bash({
|
|
18
|
-
command: "~/.claude/bin/codeagent-wrapper --backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
18
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
19
19
|
ROLE_FILE: <角色提示词路径>
|
|
20
20
|
<TASK>
|
|
21
21
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
@@ -30,7 +30,7 @@ EOF",
|
|
|
30
30
|
|
|
31
31
|
# 复用会话调用
|
|
32
32
|
Bash({
|
|
33
|
-
command: "~/.claude/bin/codeagent-wrapper --backend <codex|gemini> resume <SESSION_ID> - \"$PWD\" <<'EOF'
|
|
33
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> resume <SESSION_ID> - \"$PWD\" <<'EOF'
|
|
34
34
|
ROLE_FILE: <角色提示词路径>
|
|
35
35
|
<TASK>
|
|
36
36
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
@@ -57,6 +57,15 @@ EOF",
|
|
|
57
57
|
|
|
58
58
|
**并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
|
|
59
59
|
|
|
60
|
+
**等待后台任务**(使用最大超时 600000ms = 10分钟):
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**重要**:必须指定 `timeout: 600000`,否则默认只有 30 秒会导致提前超时。
|
|
67
|
+
如果 10 分钟后仍未完成,继续用 `TaskOutput` 轮询,**绝对不要 Kill 进程**。
|
|
68
|
+
|
|
60
69
|
---
|
|
61
70
|
|
|
62
71
|
## 核心工作流程
|
|
@@ -34,7 +34,7 @@ description: '前端专项工作流(研究→构思→计划→执行→优化
|
|
|
34
34
|
```
|
|
35
35
|
# 新会话调用
|
|
36
36
|
Bash({
|
|
37
|
-
command: "~/.claude/bin/codeagent-wrapper --backend gemini - \"$PWD\" <<'EOF'
|
|
37
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend gemini - \"$PWD\" <<'EOF'
|
|
38
38
|
ROLE_FILE: <角色提示词路径>
|
|
39
39
|
<TASK>
|
|
40
40
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
@@ -49,7 +49,7 @@ EOF",
|
|
|
49
49
|
|
|
50
50
|
# 复用会话调用
|
|
51
51
|
Bash({
|
|
52
|
-
command: "~/.claude/bin/codeagent-wrapper --backend gemini resume <SESSION_ID> - \"$PWD\" <<'EOF'
|
|
52
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend gemini resume <SESSION_ID> - \"$PWD\" <<'EOF'
|
|
53
53
|
ROLE_FILE: <角色提示词路径>
|
|
54
54
|
<TASK>
|
|
55
55
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
@@ -33,7 +33,7 @@ description: '多模型性能优化:Codex 后端优化 + Gemini 前端优化'
|
|
|
33
33
|
|
|
34
34
|
```
|
|
35
35
|
Bash({
|
|
36
|
-
command: "~/.claude/bin/codeagent-wrapper --backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
36
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
37
37
|
<TASK>
|
|
38
38
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
39
39
|
上下文:<目标代码、现有性能指标等>
|
|
@@ -48,6 +48,15 @@ EOF",
|
|
|
48
48
|
|
|
49
49
|
**并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
|
|
50
50
|
|
|
51
|
+
**等待后台任务**(使用最大超时 600000ms = 10分钟):
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**重要**:必须指定 `timeout: 600000`,否则默认只有 30 秒会导致提前超时。
|
|
58
|
+
如果 10 分钟后仍未完成,继续用 `TaskOutput` 轮询,**绝对不要 Kill 进程**。
|
|
59
|
+
|
|
51
60
|
---
|
|
52
61
|
|
|
53
62
|
## 执行工作流
|
|
@@ -23,7 +23,7 @@ description: '多模型代码审查:无参数时自动审查 git diff,双模
|
|
|
23
23
|
|
|
24
24
|
```
|
|
25
25
|
Bash({
|
|
26
|
-
command: "~/.claude/bin/codeagent-wrapper --backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
26
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
27
27
|
<TASK>
|
|
28
28
|
审查以下代码变更:
|
|
29
29
|
<git diff 内容>
|
|
@@ -38,6 +38,15 @@ EOF",
|
|
|
38
38
|
|
|
39
39
|
**并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
|
|
40
40
|
|
|
41
|
+
**等待后台任务**(使用最大超时 600000ms = 10分钟):
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**重要**:必须指定 `timeout: 600000`,否则默认只有 30 秒会导致提前超时。
|
|
48
|
+
如果 10 分钟后仍未完成,继续用 `TaskOutput` 轮询,**绝对不要 Kill 进程**。
|
|
49
|
+
|
|
41
50
|
---
|
|
42
51
|
|
|
43
52
|
## 执行工作流
|
|
@@ -33,7 +33,7 @@ description: '多模型测试生成:智能路由 Codex 后端测试 / Gemini
|
|
|
33
33
|
|
|
34
34
|
```
|
|
35
35
|
Bash({
|
|
36
|
-
command: "~/.claude/bin/codeagent-wrapper --backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
36
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
37
37
|
<TASK>
|
|
38
38
|
需求:为以下代码生成测试
|
|
39
39
|
<代码内容>
|
|
@@ -60,6 +60,15 @@ EOF",
|
|
|
60
60
|
|
|
61
61
|
**并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
|
|
62
62
|
|
|
63
|
+
**等待后台任务**(使用最大超时 600000ms = 10分钟):
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**重要**:必须指定 `timeout: 600000`,否则默认只有 30 秒会导致提前超时。
|
|
70
|
+
如果 10 分钟后仍未完成,继续用 `TaskOutput` 轮询,**绝对不要 Kill 进程**。
|
|
71
|
+
|
|
63
72
|
---
|
|
64
73
|
|
|
65
74
|
## 执行工作流
|
|
@@ -38,7 +38,7 @@ description: '多模型协作开发工作流(研究→构思→计划→执行
|
|
|
38
38
|
```
|
|
39
39
|
# 新会话调用
|
|
40
40
|
Bash({
|
|
41
|
-
command: "~/.claude/bin/codeagent-wrapper --backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
41
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
42
42
|
ROLE_FILE: <角色提示词路径>
|
|
43
43
|
<TASK>
|
|
44
44
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
@@ -53,7 +53,7 @@ EOF",
|
|
|
53
53
|
|
|
54
54
|
# 复用会话调用
|
|
55
55
|
Bash({
|
|
56
|
-
command: "~/.claude/bin/codeagent-wrapper --backend <codex|gemini> resume <SESSION_ID> - \"$PWD\" <<'EOF'
|
|
56
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> resume <SESSION_ID> - \"$PWD\" <<'EOF'
|
|
57
57
|
ROLE_FILE: <角色提示词路径>
|
|
58
58
|
<TASK>
|
|
59
59
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
@@ -79,6 +79,15 @@ EOF",
|
|
|
79
79
|
|
|
80
80
|
**并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
|
|
81
81
|
|
|
82
|
+
**等待后台任务**(使用最大超时 600000ms = 10分钟):
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**重要**:必须指定 `timeout: 600000`,否则默认只有 30 秒会导致提前超时。
|
|
89
|
+
如果 10 分钟后仍未完成,继续用 `TaskOutput` 轮询,**绝对不要 Kill 进程**。
|
|
90
|
+
|
|
82
91
|
---
|
|
83
92
|
|
|
84
93
|
## 沟通守则
|