ccg-workflow 1.7.84 → 1.7.86
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
CHANGED
package/README.zh-CN.md
CHANGED
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 { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.
|
|
4
|
+
import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.BzAMcd9h.mjs';
|
|
5
5
|
import 'inquirer';
|
|
6
6
|
import 'node:child_process';
|
|
7
7
|
import 'node:util';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.
|
|
1
|
+
export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.BzAMcd9h.mjs';
|
|
2
2
|
import 'ansis';
|
|
3
3
|
import 'inquirer';
|
|
4
4
|
import 'node:child_process';
|
|
@@ -10,7 +10,7 @@ import { parse, stringify } from 'smol-toml';
|
|
|
10
10
|
import i18next from 'i18next';
|
|
11
11
|
import ora from 'ora';
|
|
12
12
|
|
|
13
|
-
const version = "1.7.
|
|
13
|
+
const version = "1.7.86";
|
|
14
14
|
|
|
15
15
|
function cmd(id, order, category, name, nameEn, description, descriptionEn, cmdOverride) {
|
|
16
16
|
return {
|
|
@@ -91,12 +91,23 @@ const __filename$2 = fileURLToPath(import.meta.url);
|
|
|
91
91
|
const __dirname$2 = dirname(__filename$2);
|
|
92
92
|
function findPackageRoot$1(startDir) {
|
|
93
93
|
let dir = startDir;
|
|
94
|
-
for (let i = 0; i <
|
|
94
|
+
for (let i = 0; i < 10; i++) {
|
|
95
95
|
if (fs.existsSync(join(dir, "package.json"))) {
|
|
96
|
-
|
|
96
|
+
if (fs.existsSync(join(dir, "templates"))) {
|
|
97
|
+
return dir;
|
|
98
|
+
}
|
|
97
99
|
}
|
|
98
|
-
|
|
100
|
+
const parent = dirname(dir);
|
|
101
|
+
if (parent === dir) break;
|
|
102
|
+
dir = parent;
|
|
99
103
|
}
|
|
104
|
+
console.error(
|
|
105
|
+
`[CCG] \u26A0 PACKAGE_ROOT resolution failed: could not find package.json with templates/ directory.
|
|
106
|
+
Start dir: ${startDir}
|
|
107
|
+
Last checked: ${dir}
|
|
108
|
+
This will cause commands/skills/prompts to not be installed.
|
|
109
|
+
Please report this issue at: https://github.com/fengshao1227/ccg-workflow/issues`
|
|
110
|
+
);
|
|
100
111
|
return startDir;
|
|
101
112
|
}
|
|
102
113
|
const PACKAGE_ROOT$1 = findPackageRoot$1(__dirname$2);
|
|
@@ -637,19 +648,19 @@ async function removeFastContextPrompt() {
|
|
|
637
648
|
|
|
638
649
|
const GITHUB_REPO = "fengshao1227/ccg-workflow";
|
|
639
650
|
const RELEASE_TAG = "preset";
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
for (let attempt = 1; attempt <=
|
|
651
|
+
const BINARY_SOURCES = [
|
|
652
|
+
{ name: "GitHub Release", url: `https://github.com/${GITHUB_REPO}/releases/download/${RELEASE_TAG}`, timeoutMs: 8e3 },
|
|
653
|
+
{ name: "Cloudflare R2", url: "https://pub-29270440a0854a49bf1589cd3662c067.r2.dev/preset", timeoutMs: 6e4 }
|
|
654
|
+
];
|
|
655
|
+
async function downloadFromUrl(url, destPath, timeoutMs, maxAttempts = 2) {
|
|
656
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
646
657
|
try {
|
|
647
658
|
const controller = new AbortController();
|
|
648
|
-
const timer = setTimeout(() => controller.abort(),
|
|
659
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
649
660
|
const response = await fetch(url, { redirect: "follow", signal: controller.signal });
|
|
650
661
|
if (!response.ok) {
|
|
651
662
|
clearTimeout(timer);
|
|
652
|
-
if (attempt <
|
|
663
|
+
if (attempt < maxAttempts) {
|
|
653
664
|
await new Promise((resolve) => setTimeout(resolve, attempt * 2e3));
|
|
654
665
|
continue;
|
|
655
666
|
}
|
|
@@ -663,7 +674,7 @@ async function downloadBinaryFromRelease(binaryName, destPath) {
|
|
|
663
674
|
}
|
|
664
675
|
return true;
|
|
665
676
|
} catch {
|
|
666
|
-
if (attempt <
|
|
677
|
+
if (attempt < maxAttempts) {
|
|
667
678
|
await new Promise((resolve) => setTimeout(resolve, attempt * 2e3));
|
|
668
679
|
continue;
|
|
669
680
|
}
|
|
@@ -672,9 +683,20 @@ async function downloadBinaryFromRelease(binaryName, destPath) {
|
|
|
672
683
|
}
|
|
673
684
|
return false;
|
|
674
685
|
}
|
|
686
|
+
async function downloadBinaryFromRelease(binaryName, destPath) {
|
|
687
|
+
for (const source of BINARY_SOURCES) {
|
|
688
|
+
const url = `${source.url}/${binaryName}`;
|
|
689
|
+
const ok = await downloadFromUrl(url, destPath, source.timeoutMs);
|
|
690
|
+
if (ok) return true;
|
|
691
|
+
}
|
|
692
|
+
return false;
|
|
693
|
+
}
|
|
675
694
|
async function copyMdTemplates(ctx, srcDir, destDir, options = {}) {
|
|
676
695
|
const installed = [];
|
|
677
|
-
if (!await fs.pathExists(srcDir))
|
|
696
|
+
if (!await fs.pathExists(srcDir)) {
|
|
697
|
+
console.error(`[CCG] Template source directory not found: ${srcDir}`);
|
|
698
|
+
return installed;
|
|
699
|
+
}
|
|
678
700
|
await fs.ensureDir(destDir);
|
|
679
701
|
const files = await fs.readdir(srcDir);
|
|
680
702
|
for (const file of files) {
|
|
@@ -747,7 +769,10 @@ async function installAgentFiles(ctx) {
|
|
|
747
769
|
async function installPromptFiles(ctx) {
|
|
748
770
|
const promptsTemplateDir = join(ctx.templateDir, "prompts");
|
|
749
771
|
const promptsDir = join(ctx.installDir, ".ccg", "prompts");
|
|
750
|
-
if (!await fs.pathExists(promptsTemplateDir))
|
|
772
|
+
if (!await fs.pathExists(promptsTemplateDir)) {
|
|
773
|
+
ctx.result.errors.push(`Prompts template directory not found: ${promptsTemplateDir}`);
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
751
776
|
for (const model of ["codex", "gemini", "claude"]) {
|
|
752
777
|
try {
|
|
753
778
|
const installed = await copyMdTemplates(
|
|
@@ -775,7 +800,11 @@ async function collectSkillNames(dir, depth = 0) {
|
|
|
775
800
|
names.push(basename(dir));
|
|
776
801
|
}
|
|
777
802
|
}
|
|
778
|
-
} catch {
|
|
803
|
+
} catch (error) {
|
|
804
|
+
const code = error.code;
|
|
805
|
+
if (code !== "ENOENT") {
|
|
806
|
+
console.error(`[CCG] Failed to read skills directory ${dir}: ${code || error}`);
|
|
807
|
+
}
|
|
779
808
|
}
|
|
780
809
|
return names;
|
|
781
810
|
}
|
|
@@ -789,7 +818,10 @@ async function removeDirCollectMdNames(dir) {
|
|
|
789
818
|
async function installSkillFiles(ctx) {
|
|
790
819
|
const skillsTemplateDir = join(ctx.templateDir, "skills");
|
|
791
820
|
const skillsDestDir = join(ctx.installDir, "skills", "ccg");
|
|
792
|
-
if (!await fs.pathExists(skillsTemplateDir))
|
|
821
|
+
if (!await fs.pathExists(skillsTemplateDir)) {
|
|
822
|
+
ctx.result.errors.push(`Skills template directory not found: ${skillsTemplateDir}`);
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
793
825
|
try {
|
|
794
826
|
const oldSkillsRoot = join(ctx.installDir, "skills");
|
|
795
827
|
const ccgLegacyItems = ["tools", "orchestration", "SKILL.md", "run_skill.js"];
|
|
@@ -800,12 +832,16 @@ async function installSkillFiles(ctx) {
|
|
|
800
832
|
const oldPath = join(oldSkillsRoot, item);
|
|
801
833
|
const newPath = join(skillsDestDir, item);
|
|
802
834
|
if (await fs.pathExists(oldPath)) {
|
|
803
|
-
|
|
835
|
+
try {
|
|
836
|
+
await fs.move(oldPath, newPath, { overwrite: true });
|
|
837
|
+
} catch (moveErr) {
|
|
838
|
+
ctx.result.errors.push(`Skills migration: failed to move ${item}: ${moveErr}`);
|
|
839
|
+
}
|
|
804
840
|
}
|
|
805
841
|
}
|
|
806
842
|
}
|
|
807
843
|
await fs.copy(skillsTemplateDir, skillsDestDir, {
|
|
808
|
-
overwrite:
|
|
844
|
+
overwrite: true,
|
|
809
845
|
errorOnExist: false
|
|
810
846
|
});
|
|
811
847
|
const replacePathsInDir = async (dir) => {
|
|
@@ -824,7 +860,13 @@ async function installSkillFiles(ctx) {
|
|
|
824
860
|
}
|
|
825
861
|
};
|
|
826
862
|
await replacePathsInDir(skillsDestDir);
|
|
827
|
-
|
|
863
|
+
const installedSkills = await collectSkillNames(skillsDestDir);
|
|
864
|
+
ctx.result.installedSkills = installedSkills.length;
|
|
865
|
+
if (installedSkills.length === 0) {
|
|
866
|
+
ctx.result.errors.push(
|
|
867
|
+
`Skills copy completed but no SKILL.md found in ${skillsDestDir}. Possible cause: file locking (antivirus), permission denied, or path too long. Try running as administrator or disabling antivirus real-time scanning temporarily.`
|
|
868
|
+
);
|
|
869
|
+
}
|
|
828
870
|
} catch (error) {
|
|
829
871
|
ctx.result.errors.push(`Failed to install skills: ${error}`);
|
|
830
872
|
ctx.result.success = false;
|
|
@@ -885,7 +927,8 @@ function showBinaryDownloadWarning(binDir) {
|
|
|
885
927
|
console.log(ansis.gray(` \u2192 \u627E\u5230 ${ansis.white(binaryFileName)} \u5E76\u4E0B\u8F7D`));
|
|
886
928
|
console.log();
|
|
887
929
|
console.log(ansis.white(` 2. \u653E\u5230 / Place at:`));
|
|
888
|
-
|
|
930
|
+
const displayPath = process.platform === "win32" ? `${binDir.replace(/\//g, "\\")}\\${destFileName}` : `${binDir}/${destFileName}`;
|
|
931
|
+
console.log(ansis.cyan(` ${displayPath}`));
|
|
889
932
|
console.log();
|
|
890
933
|
if (process.platform !== "win32") {
|
|
891
934
|
console.log(ansis.white(` 3. \u52A0\u6743\u9650 / Make executable:`));
|
|
@@ -957,6 +1000,12 @@ async function installWorkflows(workflowIds, installDir, force = false, config)
|
|
|
957
1000
|
configPath: ""
|
|
958
1001
|
}
|
|
959
1002
|
};
|
|
1003
|
+
if (!await fs.pathExists(ctx.templateDir)) {
|
|
1004
|
+
const errorMsg = `Template directory not found: ${ctx.templateDir} (PACKAGE_ROOT=${PACKAGE_ROOT$1}). This usually means the npm package is incomplete or the cache is corrupted. Try: npm cache clean --force && npx ccg-workflow@latest`;
|
|
1005
|
+
ctx.result.errors.push(errorMsg);
|
|
1006
|
+
ctx.result.success = false;
|
|
1007
|
+
return ctx.result;
|
|
1008
|
+
}
|
|
960
1009
|
await fs.ensureDir(join(installDir, "commands", "ccg"));
|
|
961
1010
|
await fs.ensureDir(join(installDir, ".ccg"));
|
|
962
1011
|
await fs.ensureDir(join(installDir, ".ccg", "prompts"));
|
|
@@ -966,6 +1015,12 @@ async function installWorkflows(workflowIds, installDir, force = false, config)
|
|
|
966
1015
|
await installSkillFiles(ctx);
|
|
967
1016
|
await installRuleFiles(ctx);
|
|
968
1017
|
await installBinaryFile(ctx);
|
|
1018
|
+
if (ctx.result.installedCommands.length === 0 && ctx.result.errors.length === 0) {
|
|
1019
|
+
ctx.result.errors.push(
|
|
1020
|
+
`No commands were installed (expected ${workflowIds.length}). Template dir: ${ctx.templateDir}. This may indicate a corrupted package or file permission issue.`
|
|
1021
|
+
);
|
|
1022
|
+
ctx.result.success = false;
|
|
1023
|
+
}
|
|
969
1024
|
ctx.result.configPath = join(installDir, "commands", "ccg");
|
|
970
1025
|
return ctx.result;
|
|
971
1026
|
}
|
|
@@ -3118,10 +3173,23 @@ async function init(options = {}) {
|
|
|
3118
3173
|
}
|
|
3119
3174
|
if (result.errors.length > 0) {
|
|
3120
3175
|
console.log();
|
|
3121
|
-
|
|
3176
|
+
if (!result.success) {
|
|
3177
|
+
console.log(ansis.red.bold(` \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557`));
|
|
3178
|
+
console.log(ansis.red.bold(` \u2551 \u26A0 \u5B89\u88C5\u51FA\u73B0\u9519\u8BEF / Installation errors detected \u2551`));
|
|
3179
|
+
console.log(ansis.red.bold(` \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D`));
|
|
3180
|
+
} else {
|
|
3181
|
+
console.log(ansis.yellow(` \u26A0 ${i18n.t("init:installationErrors")}`));
|
|
3182
|
+
}
|
|
3122
3183
|
result.errors.forEach((error) => {
|
|
3123
3184
|
console.log(` ${ansis.red("\u2717")} ${error}`);
|
|
3124
3185
|
});
|
|
3186
|
+
if (!result.success) {
|
|
3187
|
+
console.log();
|
|
3188
|
+
console.log(ansis.yellow(` \u5C1D\u8BD5\u4FEE\u590D / Try to fix:`));
|
|
3189
|
+
console.log(ansis.cyan(` npx ccg-workflow@latest init --force`));
|
|
3190
|
+
console.log(ansis.gray(` \u5982\u4ECD\u5931\u8D25\uFF0C\u8BF7\u63D0\u4EA4 issue \u5E76\u9644\u4E0A\u4EE5\u4E0A\u9519\u8BEF\u4FE1\u606F`));
|
|
3191
|
+
console.log(ansis.gray(` If still failing, report an issue with the errors above`));
|
|
3192
|
+
}
|
|
3125
3193
|
}
|
|
3126
3194
|
if (result.binInstalled && result.binPath) {
|
|
3127
3195
|
console.log();
|
|
@@ -3376,7 +3444,6 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
|
|
|
3376
3444
|
} catch {
|
|
3377
3445
|
const npxCachePath = join(homedir(), ".npm", "_npx");
|
|
3378
3446
|
try {
|
|
3379
|
-
const fs = await import('fs-extra');
|
|
3380
3447
|
await fs.remove(npxCachePath);
|
|
3381
3448
|
} catch {
|
|
3382
3449
|
}
|
|
@@ -3416,22 +3483,43 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
|
|
|
3416
3483
|
console.log();
|
|
3417
3484
|
}
|
|
3418
3485
|
}
|
|
3419
|
-
spinner = ora(i18n.t("update:removingOld")).start();
|
|
3420
3486
|
const installDir = join(homedir(), ".claude");
|
|
3487
|
+
const BACKUP_SUFFIX = ".ccg-update-bak";
|
|
3488
|
+
const backupTargets = [
|
|
3489
|
+
join(installDir, "commands", "ccg"),
|
|
3490
|
+
join(installDir, "agents", "ccg"),
|
|
3491
|
+
join(installDir, "skills", "ccg")
|
|
3492
|
+
];
|
|
3493
|
+
spinner = ora(i18n.t("update:removingOld")).start();
|
|
3494
|
+
const backedUp = [];
|
|
3421
3495
|
try {
|
|
3422
|
-
const
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3496
|
+
for (const dir of backupTargets) {
|
|
3497
|
+
if (await fs.pathExists(dir)) {
|
|
3498
|
+
const backupPath = dir + BACKUP_SUFFIX;
|
|
3499
|
+
if (await fs.pathExists(backupPath)) {
|
|
3500
|
+
await fs.remove(backupPath);
|
|
3501
|
+
}
|
|
3502
|
+
await fs.move(dir, backupPath);
|
|
3503
|
+
backedUp.push(dir);
|
|
3429
3504
|
}
|
|
3430
3505
|
}
|
|
3506
|
+
spinner.succeed(i18n.t("update:oldRemoved"));
|
|
3431
3507
|
} catch (error) {
|
|
3432
|
-
spinner.warn(
|
|
3508
|
+
spinner.warn(`Backup failed: ${error}`);
|
|
3509
|
+
for (const dir of backedUp) {
|
|
3510
|
+
const backupPath = dir + BACKUP_SUFFIX;
|
|
3511
|
+
try {
|
|
3512
|
+
if (await fs.pathExists(backupPath)) {
|
|
3513
|
+
await fs.move(backupPath, dir);
|
|
3514
|
+
}
|
|
3515
|
+
} catch {
|
|
3516
|
+
}
|
|
3517
|
+
}
|
|
3518
|
+
console.log(ansis.yellow(" \u65E7\u7248\u672C\u6587\u4EF6\u5DF2\u4FDD\u7559 / Old files preserved"));
|
|
3519
|
+
return;
|
|
3433
3520
|
}
|
|
3434
3521
|
spinner = ora(i18n.t("update:installingNew")).start();
|
|
3522
|
+
let installSuccess = false;
|
|
3435
3523
|
try {
|
|
3436
3524
|
await execAsync$1(`npx --yes ccg-workflow@latest init --force --skip-mcp --skip-prompt`, {
|
|
3437
3525
|
timeout: 3e5,
|
|
@@ -3441,21 +3529,59 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
|
|
|
3441
3529
|
CCG_UPDATE_MODE: "true"
|
|
3442
3530
|
}
|
|
3443
3531
|
});
|
|
3444
|
-
|
|
3445
|
-
const
|
|
3446
|
-
if (
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3532
|
+
const commandsDir = join(installDir, "commands", "ccg");
|
|
3533
|
+
const hasCommands = await fs.pathExists(commandsDir) && (await fs.readdir(commandsDir)).some((f) => f.endsWith(".md"));
|
|
3534
|
+
if (hasCommands) {
|
|
3535
|
+
installSuccess = true;
|
|
3536
|
+
spinner.succeed(i18n.t("update:installDone"));
|
|
3537
|
+
const config = await readCcgConfig();
|
|
3538
|
+
if (config?.workflows?.installed) {
|
|
3539
|
+
console.log();
|
|
3540
|
+
console.log(ansis.cyan(i18n.t("update:installed", { count: config.workflows.installed.length })));
|
|
3541
|
+
for (const cmd of config.workflows.installed) {
|
|
3542
|
+
console.log(` ${ansis.gray("\u2022")} /ccg:${cmd}`);
|
|
3543
|
+
}
|
|
3451
3544
|
}
|
|
3452
|
-
}
|
|
3453
|
-
|
|
3454
|
-
|
|
3545
|
+
} else {
|
|
3546
|
+
spinner.fail(i18n.t("update:installFailed"));
|
|
3547
|
+
console.log(ansis.red(" Install subprocess completed but no command files were created"));
|
|
3455
3548
|
}
|
|
3456
3549
|
} catch (error) {
|
|
3457
3550
|
spinner.fail(i18n.t("update:installFailed"));
|
|
3458
3551
|
console.log(ansis.red(`${i18n.t("common:error")}: ${error}`));
|
|
3552
|
+
}
|
|
3553
|
+
if (installSuccess) {
|
|
3554
|
+
for (const dir of backedUp) {
|
|
3555
|
+
try {
|
|
3556
|
+
await fs.remove(dir + BACKUP_SUFFIX);
|
|
3557
|
+
} catch {
|
|
3558
|
+
}
|
|
3559
|
+
}
|
|
3560
|
+
if (!await verifyBinary(installDir)) {
|
|
3561
|
+
showBinaryDownloadWarning(join(installDir, "bin"));
|
|
3562
|
+
}
|
|
3563
|
+
} else {
|
|
3564
|
+
console.log();
|
|
3565
|
+
console.log(ansis.yellow.bold(" \u26A0 \u6B63\u5728\u6062\u590D\u65E7\u7248\u672C\u6587\u4EF6 / Restoring old version files..."));
|
|
3566
|
+
let restored = 0;
|
|
3567
|
+
for (const dir of backedUp) {
|
|
3568
|
+
const backupPath = dir + BACKUP_SUFFIX;
|
|
3569
|
+
try {
|
|
3570
|
+
if (await fs.pathExists(dir)) {
|
|
3571
|
+
await fs.remove(dir);
|
|
3572
|
+
}
|
|
3573
|
+
if (await fs.pathExists(backupPath)) {
|
|
3574
|
+
await fs.move(backupPath, dir);
|
|
3575
|
+
restored++;
|
|
3576
|
+
}
|
|
3577
|
+
} catch (restoreErr) {
|
|
3578
|
+
console.log(ansis.red(` Failed to restore ${dir}: ${restoreErr}`));
|
|
3579
|
+
}
|
|
3580
|
+
}
|
|
3581
|
+
if (restored > 0) {
|
|
3582
|
+
console.log(ansis.green(` \u2713 \u5DF2\u6062\u590D ${restored} \u4E2A\u76EE\u5F55 / Restored ${restored} directories`));
|
|
3583
|
+
console.log(ansis.gray(" \u65E7\u7248\u547D\u4EE4\u4ECD\u53EF\u6B63\u5E38\u4F7F\u7528 / Old commands still work"));
|
|
3584
|
+
}
|
|
3459
3585
|
console.log();
|
|
3460
3586
|
console.log(ansis.yellow(i18n.t("update:manualRetry")));
|
|
3461
3587
|
console.log(ansis.cyan(" npx ccg-workflow@latest"));
|
package/package.json
CHANGED
|
@@ -59,14 +59,14 @@ Refactoring: refactor → /verify-change → /verify-quality → /verify-secu
|
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
61
|
# Unified runner
|
|
62
|
-
node ~/.claude/skills/run_skill.js <skill-name> [args...]
|
|
62
|
+
node ~/.claude/skills/ccg/run_skill.js <skill-name> [args...]
|
|
63
63
|
|
|
64
64
|
# Examples
|
|
65
|
-
node ~/.claude/skills/run_skill.js verify-security ./src
|
|
66
|
-
node ~/.claude/skills/run_skill.js verify-quality ./src -v
|
|
67
|
-
node ~/.claude/skills/run_skill.js verify-change --mode staged
|
|
68
|
-
node ~/.claude/skills/run_skill.js verify-module ./my-module
|
|
69
|
-
node ~/.claude/skills/run_skill.js gen-docs ./new-module --force
|
|
65
|
+
node ~/.claude/skills/ccg/run_skill.js verify-security ./src
|
|
66
|
+
node ~/.claude/skills/ccg/run_skill.js verify-quality ./src -v
|
|
67
|
+
node ~/.claude/skills/ccg/run_skill.js verify-change --mode staged
|
|
68
|
+
node ~/.claude/skills/ccg/run_skill.js verify-module ./my-module
|
|
69
|
+
node ~/.claude/skills/ccg/run_skill.js gen-docs ./new-module --force
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
---
|