ccg-workflow 3.0.8 → 3.0.10
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 { A as diagnoseMcpConfig, B as isWindows, C as readClaudeCodeConfig, D as fixWindowsMcpConfig, E as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, F as configMcp, G as version } from './shared/ccg-workflow.
|
|
4
|
+
import { A as diagnoseMcpConfig, B as isWindows, C as readClaudeCodeConfig, D as fixWindowsMcpConfig, E as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, F as configMcp, G as version } from './shared/ccg-workflow.Btj19K42.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, y as checkForUpdates, z as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, v as getCurrentVersion, x 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, q as migrateToV1_4_0, t as needsMigration, r as readCcgConfig, s as showMainMenu, p as uninstallAceTool, o as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.
|
|
1
|
+
export { c as changeLanguage, y as checkForUpdates, z as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, v as getCurrentVersion, x 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, q as migrateToV1_4_0, t as needsMigration, r as readCcgConfig, s as showMainMenu, p as uninstallAceTool, o as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.Btj19K42.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.0.
|
|
13
|
+
const version = "3.0.10";
|
|
14
14
|
|
|
15
15
|
function cmd(id, order, category, name, nameEn, description, descriptionEn, cmdOverride) {
|
|
16
16
|
return {
|
|
@@ -121,7 +121,7 @@ function findPackageRoot$1(startDir) {
|
|
|
121
121
|
);
|
|
122
122
|
return startDir;
|
|
123
123
|
}
|
|
124
|
-
const PACKAGE_ROOT
|
|
124
|
+
const PACKAGE_ROOT = findPackageRoot$1(__dirname$2);
|
|
125
125
|
const MCP_PROVIDERS = {
|
|
126
126
|
"ace-tool": { tool: "mcp__ace-tool__search_context", param: "query" },
|
|
127
127
|
"ace-tool-rs": { tool: "mcp__ace-tool__search_context", param: "query" },
|
|
@@ -1093,7 +1093,7 @@ async function installSkillGeneratedCommands(ctx) {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
1095
|
async function installCodexMode() {
|
|
1096
|
-
const codexTemplateDir = join(PACKAGE_ROOT
|
|
1096
|
+
const codexTemplateDir = join(PACKAGE_ROOT, "templates", "codex");
|
|
1097
1097
|
if (!await fs.pathExists(codexTemplateDir)) {
|
|
1098
1098
|
return { success: false, message: "Codex template directory not found" };
|
|
1099
1099
|
}
|
|
@@ -1356,7 +1356,7 @@ async function installWorkflows(workflowIds, installDir, force = false, config)
|
|
|
1356
1356
|
mcpProvider: config?.mcpProvider || "fast-context",
|
|
1357
1357
|
skipImpeccable: config?.skipImpeccable || false
|
|
1358
1358
|
},
|
|
1359
|
-
templateDir: join(PACKAGE_ROOT
|
|
1359
|
+
templateDir: join(PACKAGE_ROOT, "templates"),
|
|
1360
1360
|
result: {
|
|
1361
1361
|
success: true,
|
|
1362
1362
|
installedCommands: [],
|
|
@@ -1366,7 +1366,7 @@ async function installWorkflows(workflowIds, installDir, force = false, config)
|
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
1368
|
if (!await fs.pathExists(ctx.templateDir)) {
|
|
1369
|
-
const errorMsg = `Template directory not found: ${ctx.templateDir} (PACKAGE_ROOT=${PACKAGE_ROOT
|
|
1369
|
+
const errorMsg = `Template directory not found: ${ctx.templateDir} (PACKAGE_ROOT=${PACKAGE_ROOT}). This usually means the npm package is incomplete or the cache is corrupted. Try: npm cache clean --force && npx ccg-workflow@latest`;
|
|
1370
1370
|
ctx.result.errors.push(errorMsg);
|
|
1371
1371
|
ctx.result.success = false;
|
|
1372
1372
|
return ctx.result;
|
|
@@ -2202,27 +2202,17 @@ const zhCN = {
|
|
|
2202
2202
|
exit: "\u9000\u51FA"
|
|
2203
2203
|
},
|
|
2204
2204
|
help: {
|
|
2205
|
-
title: "CCG \u547D\u4EE4:",
|
|
2206
|
-
hint: "\u66F4\u591A\u4FE1\u606F
|
|
2205
|
+
title: "CCG \u547D\u4EE4 (v3):",
|
|
2206
|
+
hint: "\u4F7F\u7528 /ccg:go \u63CF\u8FF0\u4EFB\u52A1\uFF0CAI \u81EA\u52A8\u9009\u62E9\u6700\u4F73\u7B56\u7565\u3002\u66F4\u591A\u4FE1\u606F: npx ccg --help",
|
|
2207
2207
|
sections: {
|
|
2208
|
-
|
|
2208
|
+
engine: "\u667A\u80FD\u5F15\u64CE:",
|
|
2209
2209
|
opsx: "OpenSpec \u89C4\u8303\u9A71\u52A8:",
|
|
2210
2210
|
gitTools: "Git \u5DE5\u5177:",
|
|
2211
|
-
projectMgmt: "\u9879\u76EE\u7BA1\u7406:"
|
|
2211
|
+
projectMgmt: "\u9879\u76EE\u7BA1\u7406:",
|
|
2212
|
+
qualityGates: "\u8D28\u91CF\u5173\u5361\uFF08\u81EA\u52A8\u89E6\u53D1\uFF09:"
|
|
2212
2213
|
},
|
|
2213
2214
|
descriptions: {
|
|
2214
|
-
|
|
2215
|
-
plan: "\u591A\u6A21\u578B\u534F\u4F5C\u89C4\u5212\uFF08Phase 1-2\uFF09",
|
|
2216
|
-
execute: "\u591A\u6A21\u578B\u534F\u4F5C\u6267\u884C\uFF08Phase 3-5\uFF09",
|
|
2217
|
-
dev: "\u5B8C\u6574\u516D\u9636\u6BB5\u5F00\u53D1\u5DE5\u4F5C\u6D41",
|
|
2218
|
-
frontend: "\u524D\u7AEF\u4EFB\u52A1 \u2192 Gemini",
|
|
2219
|
-
backend: "\u540E\u7AEF\u4EFB\u52A1 \u2192 Codex",
|
|
2220
|
-
feat: "\u667A\u80FD\u529F\u80FD\u5F00\u53D1",
|
|
2221
|
-
review: "\u53CC\u6A21\u578B\u4EE3\u7801\u5BA1\u67E5",
|
|
2222
|
-
analyze: "\u53CC\u6A21\u578B\u6280\u672F\u5206\u6790",
|
|
2223
|
-
debug: "\u95EE\u9898\u8BCA\u65AD + \u4FEE\u590D",
|
|
2224
|
-
optimize: "\u6027\u80FD\u4F18\u5316",
|
|
2225
|
-
test: "\u6D4B\u8BD5\u751F\u6210",
|
|
2215
|
+
go: "\u667A\u80FD\u5165\u53E3 \u2014 \u63CF\u8FF0\u4EFB\u52A1\uFF0C\u81EA\u52A8\u8DEF\u7531\u6700\u4F73\u7B56\u7565",
|
|
2226
2216
|
specInit: "\u521D\u59CB\u5316 OpenSpec \u73AF\u5883",
|
|
2227
2217
|
specResearch: "\u9700\u6C42\u7814\u7A76 \u2192 \u7EA6\u675F\u96C6",
|
|
2228
2218
|
specPlan: "\u591A\u6A21\u578B\u5206\u6790 \u2192 \u96F6\u51B3\u7B56\u8BA1\u5212",
|
|
@@ -2232,7 +2222,12 @@ const zhCN = {
|
|
|
2232
2222
|
rollback: "Git \u4EA4\u4E92\u5F0F\u56DE\u6EDA",
|
|
2233
2223
|
cleanBranches: "\u6E05\u7406\u5DF2\u5408\u5E76\u5206\u652F",
|
|
2234
2224
|
worktree: "Git Worktree \u7BA1\u7406",
|
|
2235
|
-
init: "\u521D\u59CB\u5316\u9879\u76EE CLAUDE.md"
|
|
2225
|
+
init: "\u521D\u59CB\u5316\u9879\u76EE CLAUDE.md",
|
|
2226
|
+
context: "\u9879\u76EE\u4E0A\u4E0B\u6587\u7BA1\u7406\uFF08\u65E5\u5FD7/\u538B\u7F29/\u5F52\u6863\uFF09",
|
|
2227
|
+
verifySecurity: "\u5B89\u5168\u6F0F\u6D1E\u626B\u63CF",
|
|
2228
|
+
verifyQuality: "\u4EE3\u7801\u8D28\u91CF\u68C0\u6D4B",
|
|
2229
|
+
verifyChange: "\u53D8\u66F4\u5F71\u54CD\u5206\u6790",
|
|
2230
|
+
verifyModule: "\u6A21\u5757\u5B8C\u6574\u6027\u6821\u9A8C"
|
|
2236
2231
|
}
|
|
2237
2232
|
},
|
|
2238
2233
|
api: {
|
|
@@ -2698,27 +2693,17 @@ const en = {
|
|
|
2698
2693
|
exit: "Exit"
|
|
2699
2694
|
},
|
|
2700
2695
|
help: {
|
|
2701
|
-
title: "CCG Commands:",
|
|
2702
|
-
hint: "
|
|
2696
|
+
title: "CCG Commands (v3):",
|
|
2697
|
+
hint: "Use /ccg:go to describe your task, AI auto-routes to the best strategy. More info: npx ccg --help",
|
|
2703
2698
|
sections: {
|
|
2704
|
-
|
|
2699
|
+
engine: "Smart Engine:",
|
|
2705
2700
|
opsx: "OpenSpec Spec-Driven:",
|
|
2706
2701
|
gitTools: "Git Tools:",
|
|
2707
|
-
projectMgmt: "Project Management:"
|
|
2702
|
+
projectMgmt: "Project Management:",
|
|
2703
|
+
qualityGates: "Quality Gates (auto-triggered):"
|
|
2708
2704
|
},
|
|
2709
2705
|
descriptions: {
|
|
2710
|
-
|
|
2711
|
-
plan: "Multi-model planning (Phase 1-2)",
|
|
2712
|
-
execute: "Multi-model execution (Phase 3-5)",
|
|
2713
|
-
dev: "Complete 6-phase development workflow",
|
|
2714
|
-
frontend: "Frontend tasks \u2192 Gemini",
|
|
2715
|
-
backend: "Backend tasks \u2192 Codex",
|
|
2716
|
-
feat: "Smart feature development",
|
|
2717
|
-
review: "Dual-model code review",
|
|
2718
|
-
analyze: "Dual-model technical analysis",
|
|
2719
|
-
debug: "Diagnosis + fix",
|
|
2720
|
-
optimize: "Performance optimization",
|
|
2721
|
-
test: "Test generation",
|
|
2706
|
+
go: "Smart entry \u2014 describe task, auto-route to best strategy",
|
|
2722
2707
|
specInit: "Initialize OpenSpec environment",
|
|
2723
2708
|
specResearch: "Requirements \u2192 Constraint set",
|
|
2724
2709
|
specPlan: "Multi-model analysis \u2192 Zero-decision plan",
|
|
@@ -2728,7 +2713,12 @@ const en = {
|
|
|
2728
2713
|
rollback: "Git interactive rollback",
|
|
2729
2714
|
cleanBranches: "Clean merged branches",
|
|
2730
2715
|
worktree: "Git Worktree management",
|
|
2731
|
-
init: "Initialize project CLAUDE.md"
|
|
2716
|
+
init: "Initialize project CLAUDE.md",
|
|
2717
|
+
context: "Project context management (log/compress/archive)",
|
|
2718
|
+
verifySecurity: "Security vulnerability scan",
|
|
2719
|
+
verifyQuality: "Code quality check",
|
|
2720
|
+
verifyChange: "Change impact analysis",
|
|
2721
|
+
verifyModule: "Module completeness check"
|
|
2732
2722
|
}
|
|
2733
2723
|
},
|
|
2734
2724
|
api: {
|
|
@@ -3000,6 +2990,18 @@ async function migrateToV1_4_0() {
|
|
|
3000
2990
|
return result;
|
|
3001
2991
|
}
|
|
3002
2992
|
async function needsMigration() {
|
|
2993
|
+
try {
|
|
2994
|
+
const configPath = join(homedir(), ".claude", ".ccg", "config.toml");
|
|
2995
|
+
if (await fs.pathExists(configPath)) {
|
|
2996
|
+
const content = await fs.readFile(configPath, "utf-8");
|
|
2997
|
+
const versionMatch = content.match(/version\s*=\s*"([^"]+)"/);
|
|
2998
|
+
if (versionMatch) {
|
|
2999
|
+
const major = Number.parseInt(versionMatch[1].split(".")[0], 10);
|
|
3000
|
+
if (major >= 2) return false;
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
} catch {
|
|
3004
|
+
}
|
|
3003
3005
|
const oldCcgDir = join(homedir(), ".ccg");
|
|
3004
3006
|
const oldPromptsDir = join(homedir(), ".claude", "prompts", "ccg");
|
|
3005
3007
|
const oldConfigFile = join(homedir(), ".claude", "commands", "ccg", "_config.md");
|
|
@@ -3993,30 +3995,11 @@ function findPackageRoot(startDir) {
|
|
|
3993
3995
|
dir = parentDir;
|
|
3994
3996
|
}
|
|
3995
3997
|
}
|
|
3996
|
-
|
|
3997
|
-
async function readPackageVersion(pkgPath) {
|
|
3998
|
-
try {
|
|
3999
|
-
if (!await fs.pathExists(pkgPath)) {
|
|
4000
|
-
return null;
|
|
4001
|
-
}
|
|
4002
|
-
const pkg = await fs.readJSON(pkgPath);
|
|
4003
|
-
return pkg.version || null;
|
|
4004
|
-
} catch {
|
|
4005
|
-
return null;
|
|
4006
|
-
}
|
|
4007
|
-
}
|
|
3998
|
+
findPackageRoot(__dirname$1);
|
|
4008
3999
|
async function getCurrentVersion() {
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
if (relativeVersion) {
|
|
4012
|
-
return relativeVersion;
|
|
4013
|
-
}
|
|
4014
|
-
const rootPkgPath = join(PACKAGE_ROOT, "package.json");
|
|
4015
|
-
const rootVersion = await readPackageVersion(rootPkgPath);
|
|
4016
|
-
if (rootVersion) {
|
|
4017
|
-
return rootVersion;
|
|
4000
|
+
{
|
|
4001
|
+
return version;
|
|
4018
4002
|
}
|
|
4019
|
-
return process.env.npm_package_version || "0.0.0";
|
|
4020
4003
|
}
|
|
4021
4004
|
async function getLatestVersion(packageName = "ccg-workflow") {
|
|
4022
4005
|
try {
|
|
@@ -4491,31 +4474,15 @@ async function showMainMenu() {
|
|
|
4491
4474
|
}
|
|
4492
4475
|
function showHelp() {
|
|
4493
4476
|
const config = readCcgConfigSync();
|
|
4494
|
-
|
|
4477
|
+
(config?.general?.language || "zh-CN") === "zh-CN";
|
|
4495
4478
|
console.log();
|
|
4496
4479
|
console.log(ansis.cyan.bold(` ${i18n.t("menu:help.title")}`));
|
|
4497
4480
|
console.log();
|
|
4498
4481
|
const col1 = 22;
|
|
4499
4482
|
const section = (title) => console.log(ansis.yellow.bold(` ${title}`));
|
|
4500
4483
|
const cmd = (name, desc) => console.log(` ${ansis.green(name.padEnd(col1))} ${ansis.gray(desc)}`);
|
|
4501
|
-
section(i18n.t("menu:help.sections.
|
|
4502
|
-
cmd("/ccg:
|
|
4503
|
-
cmd("/ccg:plan", i18n.t("menu:help.descriptions.plan"));
|
|
4504
|
-
cmd("/ccg:execute", i18n.t("menu:help.descriptions.execute"));
|
|
4505
|
-
cmd("/ccg:frontend", i18n.t("menu:help.descriptions.frontend"));
|
|
4506
|
-
cmd("/ccg:backend", i18n.t("menu:help.descriptions.backend"));
|
|
4507
|
-
cmd("/ccg:feat", i18n.t("menu:help.descriptions.feat"));
|
|
4508
|
-
cmd("/ccg:analyze", i18n.t("menu:help.descriptions.analyze"));
|
|
4509
|
-
cmd("/ccg:debug", i18n.t("menu:help.descriptions.debug"));
|
|
4510
|
-
cmd("/ccg:optimize", i18n.t("menu:help.descriptions.optimize"));
|
|
4511
|
-
cmd("/ccg:test", i18n.t("menu:help.descriptions.test"));
|
|
4512
|
-
cmd("/ccg:review", i18n.t("menu:help.descriptions.review"));
|
|
4513
|
-
console.log();
|
|
4514
|
-
section(isZh ? "Agent Teams \u5E76\u884C\u5B9E\u65BD:" : "Agent Teams Parallel:");
|
|
4515
|
-
cmd("/ccg:team-research", isZh ? "\u9700\u6C42 \u2192 \u7EA6\u675F\u96C6" : "Requirements \u2192 Constraints");
|
|
4516
|
-
cmd("/ccg:team-plan", isZh ? "\u7EA6\u675F \u2192 \u5E76\u884C\u8BA1\u5212" : "Constraints \u2192 Parallel plan");
|
|
4517
|
-
cmd("/ccg:team-exec", isZh ? "\u5E76\u884C\u5B9E\u65BD" : "Parallel execution");
|
|
4518
|
-
cmd("/ccg:team-review", isZh ? "\u53CC\u6A21\u578B\u5BA1\u67E5" : "Dual-model review");
|
|
4484
|
+
section(i18n.t("menu:help.sections.engine"));
|
|
4485
|
+
cmd("/ccg:go", i18n.t("menu:help.descriptions.go"));
|
|
4519
4486
|
console.log();
|
|
4520
4487
|
section(i18n.t("menu:help.sections.opsx"));
|
|
4521
4488
|
cmd("/ccg:spec-init", i18n.t("menu:help.descriptions.specInit"));
|
|
@@ -4532,7 +4499,13 @@ function showHelp() {
|
|
|
4532
4499
|
console.log();
|
|
4533
4500
|
section(i18n.t("menu:help.sections.projectMgmt"));
|
|
4534
4501
|
cmd("/ccg:init", i18n.t("menu:help.descriptions.init"));
|
|
4535
|
-
cmd("/ccg:
|
|
4502
|
+
cmd("/ccg:context", i18n.t("menu:help.descriptions.context"));
|
|
4503
|
+
console.log();
|
|
4504
|
+
section(i18n.t("menu:help.sections.qualityGates"));
|
|
4505
|
+
cmd("/ccg:verify-security", i18n.t("menu:help.descriptions.verifySecurity"));
|
|
4506
|
+
cmd("/ccg:verify-quality", i18n.t("menu:help.descriptions.verifyQuality"));
|
|
4507
|
+
cmd("/ccg:verify-change", i18n.t("menu:help.descriptions.verifyChange"));
|
|
4508
|
+
cmd("/ccg:verify-module", i18n.t("menu:help.descriptions.verifyModule"));
|
|
4536
4509
|
console.log();
|
|
4537
4510
|
console.log(ansis.gray(` ${i18n.t("menu:help.hint")}`));
|
|
4538
4511
|
console.log();
|
package/package.json
CHANGED