ccg-workflow 1.7.9 → 1.7.11

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
@@ -307,6 +307,10 @@ Windows:
307
307
  <details>
308
308
  <summary><strong>Q6: 如何卸载?</strong></summary>
309
309
 
310
+ **⚠️ 重要:根据安装方式选择卸载方法**
311
+
312
+ #### 方式 1:npx 安装用户(推荐)
313
+
310
314
  ```bash
311
315
  npx ccg-workflow
312
316
  # 选择 "卸载工作流"
@@ -316,9 +320,55 @@ npx ccg-workflow
316
320
  - `~/.claude/commands/ccg/` - 命令文件
317
321
  - `~/.claude/agents/ccg/` - 子智能体
318
322
  - `~/.claude/skills/` - skills
319
- - `~/.claude/bin/codeagent-wrapper` - 二进制文件
323
+ - `~/.claude/bin/codeagent-wrapper*` - 二进制文件
320
324
  - `~/.claude/.ccg/` - 配置目录(可选保留)
321
325
 
326
+ #### 方式 2:npm 全局安装用户
327
+
328
+ **如果你曾经运行过 `npm install -g ccg-workflow`,需要两步卸载:**
329
+
330
+ ```bash
331
+ # 第 1 步:卸载工作流文件
332
+ npx ccg-workflow
333
+ # 选择 "卸载工作流"
334
+
335
+ # 第 2 步:卸载 npm 全局包(必须执行,否则 ccg 命令仍可用)
336
+ npm uninstall -g ccg-workflow
337
+ ```
338
+
339
+ **v1.7.11 新增**:系统会自动检测全局安装并提示第 2 步操作。
340
+
341
+ #### 方式 3:手动清理
342
+
343
+ ```bash
344
+ # 删除所有工作流文件
345
+ rm -rf ~/.claude/commands/ccg
346
+ rm -rf ~/.claude/agents/ccg
347
+ rm -rf ~/.claude/skills/multi-model-collaboration
348
+ rm -rf ~/.claude/bin/codeagent-wrapper*
349
+ rm -rf ~/.claude/.ccg
350
+
351
+ # 如果是全局安装,还需执行
352
+ npm uninstall -g ccg-workflow
353
+
354
+ # 清理 MCP 配置(如果安装了 ace-tool)
355
+ # 手动编辑 ~/.claude.json 删除 ace-tool 相关配置
356
+ ```
357
+
358
+ **⚠️ 注意:npx 缓存问题**
359
+
360
+ 如果卸载后重新安装仍使用旧版本,清理 npx 缓存:
361
+
362
+ ```bash
363
+ # 清理 npx 缓存
364
+ npx clear-npx-cache
365
+ # 或
366
+ rm -rf ~/.npm/_npx
367
+
368
+ # 然后重新安装
369
+ npx ccg-workflow@latest
370
+ ```
371
+
322
372
  </details>
323
373
 
324
374
  ---
@@ -352,7 +402,7 @@ Copyright (c) 2025 fengshao1227
352
402
 
353
403
  <div align="center">
354
404
 
355
- **版本**: v1.7.3 | **最后更新**: 2026-01-09
405
+ **版本**: v1.7.10 | **最后更新**: 2026-01-09
356
406
 
357
407
  Made with ❤️ by the CCG Community
358
408
 
Binary file
Binary file
Binary file
Binary file
package/dist/cli.mjs CHANGED
@@ -1,8 +1,10 @@
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.B3Q7Aaqq.mjs';
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.DR-W9Rb6.mjs';
5
5
  import 'inquirer';
6
+ import 'node:child_process';
7
+ import 'node:util';
6
8
  import 'node:os';
7
9
  import 'pathe';
8
10
  import 'fs-extra';
@@ -10,8 +12,6 @@ import 'node:url';
10
12
  import 'i18next';
11
13
  import 'ora';
12
14
  import 'smol-toml';
13
- import 'node:child_process';
14
- import 'node:util';
15
15
 
16
16
  async function diagnoseMcp() {
17
17
  console.log();
package/dist/index.mjs CHANGED
@@ -1,6 +1,8 @@
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.B3Q7Aaqq.mjs';
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.DR-W9Rb6.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
+ import 'node:child_process';
5
+ import 'node:util';
4
6
  import 'node:os';
5
7
  import 'pathe';
6
8
  import 'fs-extra';
@@ -8,5 +10,3 @@ import 'node:url';
8
10
  import 'i18next';
9
11
  import 'ora';
10
12
  import 'smol-toml';
11
- import 'node:child_process';
12
- import 'node:util';
@@ -1,5 +1,7 @@
1
1
  import ansis from 'ansis';
2
2
  import inquirer from 'inquirer';
3
+ import { exec } from 'node:child_process';
4
+ import { promisify } from 'node:util';
3
5
  import { homedir } from 'node:os';
4
6
  import { join, dirname } from 'pathe';
5
7
  import fs from 'fs-extra';
@@ -7,10 +9,8 @@ import { fileURLToPath } from 'node:url';
7
9
  import i18next from 'i18next';
8
10
  import ora from 'ora';
9
11
  import { parse, stringify } from 'smol-toml';
10
- import { exec } from 'node:child_process';
11
- import { promisify } from 'node:util';
12
12
 
13
- const version = "1.7.9";
13
+ const version = "1.7.11";
14
14
 
15
15
  function isWindows() {
16
16
  return process.platform === "win32";
@@ -344,11 +344,24 @@ function injectConfigVariables(content, config) {
344
344
  processed = processed.replace(/\{\{ROUTING_MODE\}\}/g, routingMode);
345
345
  return processed;
346
346
  }
347
+ function convertToGitBashPath(windowsPath) {
348
+ if (!isWindows()) {
349
+ return windowsPath;
350
+ }
351
+ let path = windowsPath.replace(/\\/g, "/");
352
+ path = path.replace(/^([A-Z]):/i, (_, drive) => `/${drive.toLowerCase()}`);
353
+ return path;
354
+ }
347
355
  function replaceHomePathsInTemplate(content, installDir) {
348
356
  const userHome = homedir();
349
357
  const ccgDir = join(installDir, ".ccg");
350
- let processed = content.replace(/~\/\.claude\/\.ccg/g, ccgDir);
351
- processed = processed.replace(/~\//g, `${userHome}/`);
358
+ const binDir = join(installDir, "bin");
359
+ const userHomePath = convertToGitBashPath(userHome);
360
+ const ccgDirPath = convertToGitBashPath(ccgDir);
361
+ const binDirPath = convertToGitBashPath(binDir);
362
+ let processed = content.replace(/~\/\.claude\/\.ccg/g, ccgDirPath);
363
+ processed = processed.replace(/~\/\.claude\/bin/g, binDirPath);
364
+ processed = processed.replace(/~\//g, `${userHomePath}/`);
352
365
  return processed;
353
366
  }
354
367
  async function installWorkflows(workflowIds, installDir, force = false, config) {
@@ -1592,7 +1605,7 @@ ${exportCommand}
1592
1605
  }
1593
1606
  }
1594
1607
 
1595
- const execAsync$1 = promisify(exec);
1608
+ const execAsync$2 = promisify(exec);
1596
1609
  const __filename$1 = fileURLToPath(import.meta.url);
1597
1610
  const __dirname$1 = dirname(__filename$1);
1598
1611
  function findPackageRoot(startDir) {
@@ -1617,7 +1630,7 @@ async function getCurrentVersion() {
1617
1630
  }
1618
1631
  async function getLatestVersion(packageName = "ccg-workflow") {
1619
1632
  try {
1620
- const { stdout } = await execAsync$1(`npm view ${packageName} version`);
1633
+ const { stdout } = await execAsync$2(`npm view ${packageName} version`);
1621
1634
  return stdout.trim();
1622
1635
  } catch {
1623
1636
  return null;
@@ -1654,7 +1667,7 @@ async function checkForUpdates() {
1654
1667
  };
1655
1668
  }
1656
1669
 
1657
- const execAsync = promisify(exec);
1670
+ const execAsync$1 = promisify(exec);
1658
1671
  async function update() {
1659
1672
  console.log();
1660
1673
  console.log(ansis.cyan.bold("\u{1F504} \u68C0\u67E5\u66F4\u65B0..."));
@@ -1687,19 +1700,98 @@ async function update() {
1687
1700
  console.log(ansis.red(`\u274C \u66F4\u65B0\u5931\u8D25: ${error}`));
1688
1701
  }
1689
1702
  }
1703
+ async function checkIfGlobalInstall$1() {
1704
+ try {
1705
+ const { stdout } = await execAsync$1("npm list -g ccg-workflow --depth=0", { timeout: 5e3 });
1706
+ return stdout.includes("ccg-workflow@");
1707
+ } catch {
1708
+ return false;
1709
+ }
1710
+ }
1690
1711
  async function performUpdate(fromVersion, toVersion, isNewVersion) {
1691
1712
  console.log();
1692
1713
  console.log(ansis.yellow.bold("\u2699\uFE0F \u5F00\u59CB\u66F4\u65B0..."));
1693
1714
  console.log();
1715
+ const isGlobalInstall = await checkIfGlobalInstall$1();
1716
+ if (isGlobalInstall) {
1717
+ console.log(ansis.yellow("\u26A0\uFE0F \u68C0\u6D4B\u5230\u4F60\u662F\u901A\u8FC7 npm \u5168\u5C40\u5B89\u88C5\u7684"));
1718
+ console.log();
1719
+ console.log("\u63A8\u8350\u7684\u66F4\u65B0\u65B9\u5F0F\uFF1A");
1720
+ console.log();
1721
+ console.log(ansis.cyan(" npm install -g ccg-workflow@latest"));
1722
+ console.log();
1723
+ console.log(ansis.gray("\u8FD9\u5C06\u540C\u65F6\u66F4\u65B0\u547D\u4EE4\u548C\u5DE5\u4F5C\u6D41\u6587\u4EF6"));
1724
+ console.log();
1725
+ const { useNpmUpdate } = await inquirer.prompt([{
1726
+ type: "confirm",
1727
+ name: "useNpmUpdate",
1728
+ message: "\u6539\u7528 npm \u66F4\u65B0\uFF08\u63A8\u8350\uFF09\uFF1F",
1729
+ default: true
1730
+ }]);
1731
+ if (useNpmUpdate) {
1732
+ console.log();
1733
+ console.log(ansis.cyan("\u8BF7\u5728\u65B0\u7684\u7EC8\u7AEF\u7A97\u53E3\u4E2D\u8FD0\u884C\uFF1A"));
1734
+ console.log();
1735
+ console.log(ansis.cyan.bold(" npm install -g ccg-workflow@latest"));
1736
+ console.log();
1737
+ console.log(ansis.gray("(\u8FD0\u884C\u5B8C\u6210\u540E\uFF0C\u5F53\u524D\u7248\u672C\u5C06\u81EA\u52A8\u66F4\u65B0)"));
1738
+ console.log();
1739
+ return;
1740
+ }
1741
+ console.log();
1742
+ console.log(ansis.yellow("\u26A0\uFE0F \u7EE7\u7EED\u4F7F\u7528\u5185\u7F6E\u66F4\u65B0\uFF08\u4EC5\u66F4\u65B0\u5DE5\u4F5C\u6D41\u6587\u4EF6\uFF09"));
1743
+ console.log(ansis.gray("\u6CE8\u610F\uFF1A\u8FD9\u4E0D\u4F1A\u66F4\u65B0 ccg \u547D\u4EE4\u672C\u8EAB"));
1744
+ console.log();
1745
+ }
1694
1746
  let spinner = ora("\u6B63\u5728\u4E0B\u8F7D\u6700\u65B0\u7248\u672C...").start();
1695
1747
  try {
1696
- await execAsync(`npx --yes ccg-workflow@latest --version`, { timeout: 6e4 });
1748
+ if (process.platform === "win32") {
1749
+ spinner.text = "\u6B63\u5728\u6E05\u7406 npx \u7F13\u5B58...";
1750
+ try {
1751
+ await execAsync$1("npx clear-npx-cache", { timeout: 1e4 });
1752
+ } catch {
1753
+ const npxCachePath = join(homedir(), ".npm", "_npx");
1754
+ try {
1755
+ const fs = await import('fs-extra');
1756
+ await fs.remove(npxCachePath);
1757
+ } catch {
1758
+ }
1759
+ }
1760
+ }
1761
+ spinner.text = "\u6B63\u5728\u4E0B\u8F7D\u6700\u65B0\u7248\u672C...";
1762
+ await execAsync$1(`npx --yes ccg-workflow@latest --version`, { timeout: 6e4 });
1697
1763
  spinner.succeed("\u6700\u65B0\u7248\u672C\u4E0B\u8F7D\u5B8C\u6210");
1698
1764
  } catch (error) {
1699
1765
  spinner.fail("\u4E0B\u8F7D\u6700\u65B0\u7248\u672C\u5931\u8D25");
1700
1766
  console.log(ansis.red(`\u9519\u8BEF: ${error}`));
1701
1767
  return;
1702
1768
  }
1769
+ if (await needsMigration()) {
1770
+ spinner = ora("\u68C0\u6D4B\u5230\u65E7\u7248\u672C\u914D\u7F6E\uFF0C\u6B63\u5728\u8FC1\u79FB...").start();
1771
+ const migrationResult = await migrateToV1_4_0();
1772
+ if (migrationResult.migratedFiles.length > 0) {
1773
+ spinner.info(ansis.cyan("\u914D\u7F6E\u8FC1\u79FB\u5B8C\u6210:"));
1774
+ console.log();
1775
+ for (const file of migrationResult.migratedFiles) {
1776
+ console.log(` ${ansis.green("\u2713")} ${file}`);
1777
+ }
1778
+ if (migrationResult.skipped.length > 0) {
1779
+ console.log();
1780
+ console.log(ansis.gray(" \u5DF2\u8DF3\u8FC7:"));
1781
+ for (const file of migrationResult.skipped) {
1782
+ console.log(` ${ansis.gray("\u25CB")} ${file}`);
1783
+ }
1784
+ }
1785
+ console.log();
1786
+ }
1787
+ if (migrationResult.errors.length > 0) {
1788
+ spinner.warn(ansis.yellow("\u8FC1\u79FB\u5B8C\u6210\uFF0C\u4F46\u6709\u90E8\u5206\u9519\u8BEF:"));
1789
+ for (const error of migrationResult.errors) {
1790
+ console.log(` ${ansis.red("\u2717")} ${error}`);
1791
+ }
1792
+ console.log();
1793
+ }
1794
+ }
1703
1795
  const config = await readCcgConfig();
1704
1796
  spinner = ora("\u6B63\u5728\u66F4\u65B0\u5DE5\u4F5C\u6D41\u548C codeagent-wrapper \u4E8C\u8FDB\u5236...").start();
1705
1797
  try {
@@ -1749,6 +1841,7 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
1749
1841
  console.log();
1750
1842
  }
1751
1843
 
1844
+ const execAsync = promisify(exec);
1752
1845
  async function showMainMenu() {
1753
1846
  console.log();
1754
1847
  console.log(ansis.cyan.bold(` CCG - Claude + Codex + Gemini`));
@@ -1804,12 +1897,29 @@ function showHelp() {
1804
1897
  console.log(ansis.gray(i18n.t("menu:help.hint")));
1805
1898
  console.log();
1806
1899
  }
1900
+ async function checkIfGlobalInstall() {
1901
+ try {
1902
+ const { stdout } = await execAsync("npm list -g ccg-workflow --depth=0", { timeout: 5e3 });
1903
+ return stdout.includes("ccg-workflow@");
1904
+ } catch {
1905
+ return false;
1906
+ }
1907
+ }
1807
1908
  async function uninstall() {
1808
1909
  console.log();
1910
+ const isGlobalInstall = await checkIfGlobalInstall();
1911
+ if (isGlobalInstall) {
1912
+ console.log(ansis.yellow("\u26A0\uFE0F \u68C0\u6D4B\u5230\u4F60\u662F\u901A\u8FC7 npm \u5168\u5C40\u5B89\u88C5\u7684"));
1913
+ console.log();
1914
+ console.log("\u5B8C\u6574\u5378\u8F7D\u9700\u8981\u4E24\u6B65\uFF1A");
1915
+ console.log(` ${ansis.cyan("1. \u79FB\u9664\u5DE5\u4F5C\u6D41\u6587\u4EF6")} (\u5373\u5C06\u6267\u884C)`);
1916
+ console.log(` ${ansis.cyan("2. \u5378\u8F7D npm \u5168\u5C40\u5305")} (\u9700\u8981\u624B\u52A8\u6267\u884C)`);
1917
+ console.log();
1918
+ }
1809
1919
  const { confirm } = await inquirer.prompt([{
1810
1920
  type: "confirm",
1811
1921
  name: "confirm",
1812
- message: i18n.t("menu:uninstall.confirm"),
1922
+ message: isGlobalInstall ? "\u7EE7\u7EED\u5378\u8F7D\u5DE5\u4F5C\u6D41\u6587\u4EF6\uFF1F" : i18n.t("menu:uninstall.confirm"),
1813
1923
  default: false
1814
1924
  }]);
1815
1925
  if (!confirm) {
@@ -1827,7 +1937,7 @@ async function uninstall() {
1827
1937
  const installDir = join(homedir(), ".claude");
1828
1938
  const result = await uninstallWorkflows(installDir);
1829
1939
  if (result.success) {
1830
- console.log(ansis.green(i18n.t("menu:uninstall.success")));
1940
+ console.log(ansis.green("\u2705 \u5DE5\u4F5C\u6D41\u6587\u4EF6\u5DF2\u79FB\u9664"));
1831
1941
  if (result.removedCommands.length > 0) {
1832
1942
  console.log();
1833
1943
  console.log(ansis.cyan(i18n.t("menu:uninstall.removedCommands")));
@@ -1852,6 +1962,16 @@ async function uninstall() {
1852
1962
  console.log(ansis.cyan("\u5DF2\u79FB\u9664\u4E8C\u8FDB\u5236\u6587\u4EF6:"));
1853
1963
  console.log(` ${ansis.gray("\u2022")} codeagent-wrapper`);
1854
1964
  }
1965
+ if (isGlobalInstall) {
1966
+ console.log();
1967
+ console.log(ansis.yellow.bold("\u{1F538} \u6700\u540E\u4E00\u6B65\uFF1A\u5378\u8F7D npm \u5168\u5C40\u5305"));
1968
+ console.log();
1969
+ console.log("\u8BF7\u5728\u65B0\u7684\u7EC8\u7AEF\u7A97\u53E3\u4E2D\u8FD0\u884C\uFF1A");
1970
+ console.log();
1971
+ console.log(ansis.cyan.bold(" npm uninstall -g ccg-workflow"));
1972
+ console.log();
1973
+ console.log(ansis.gray("(\u5B8C\u6210\u540E ccg \u547D\u4EE4\u5C06\u5F7B\u5E95\u79FB\u9664)"));
1974
+ }
1855
1975
  } else {
1856
1976
  console.log(ansis.red(i18n.t("menu:uninstall.failed")));
1857
1977
  for (const error of result.errors) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.7.9",
3
+ "version": "1.7.11",
4
4
  "description": "Claude-Codex-Gemini 多模型协作系统 - 智能路由多模型开发工作流",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",