ccg-workflow 1.7.3 → 1.7.4

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.
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.DAIrxq_G.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.B1tr28ka.mjs';
5
5
  import 'inquirer';
6
6
  import 'node:os';
7
7
  import 'pathe';
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.DAIrxq_G.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.B1tr28ka.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'node:os';
@@ -10,7 +10,7 @@ import { parse, stringify } from 'smol-toml';
10
10
  import { exec } from 'node:child_process';
11
11
  import { promisify } from 'node:util';
12
12
 
13
- const version = "1.7.3";
13
+ const version = "1.7.4";
14
14
 
15
15
  function isWindows() {
16
16
  return process.platform === "win32";
@@ -1580,7 +1580,7 @@ ${exportCommand}
1580
1580
  }
1581
1581
  }
1582
1582
 
1583
- const execAsync = promisify(exec);
1583
+ const execAsync$1 = promisify(exec);
1584
1584
  const __filename$1 = fileURLToPath(import.meta.url);
1585
1585
  const __dirname$1 = dirname(__filename$1);
1586
1586
  function findPackageRoot(startDir) {
@@ -1605,7 +1605,7 @@ async function getCurrentVersion() {
1605
1605
  }
1606
1606
  async function getLatestVersion(packageName = "ccg-workflow") {
1607
1607
  try {
1608
- const { stdout } = await execAsync(`npm view ${packageName} version`);
1608
+ const { stdout } = await execAsync$1(`npm view ${packageName} version`);
1609
1609
  return stdout.trim();
1610
1610
  } catch {
1611
1611
  return null;
@@ -1642,7 +1642,7 @@ async function checkForUpdates() {
1642
1642
  };
1643
1643
  }
1644
1644
 
1645
- promisify(exec);
1645
+ const execAsync = promisify(exec);
1646
1646
  async function update() {
1647
1647
  console.log();
1648
1648
  console.log(ansis.cyan.bold("\u{1F504} \u68C0\u67E5\u66F4\u65B0..."));
@@ -1658,30 +1658,18 @@ async function update() {
1658
1658
  console.log(`\u5F53\u524D\u7248\u672C: ${ansis.yellow(`v${currentVersion}`)}`);
1659
1659
  console.log(`\u6700\u65B0\u7248\u672C: ${ansis.green(`v${latestVersion}`)}`);
1660
1660
  console.log();
1661
- if (!hasUpdate) {
1662
- console.log(ansis.green("\u2705 \u5DF2\u662F\u6700\u65B0\u7248\u672C\uFF01"));
1663
- const { forceReinstall } = await inquirer.prompt([{
1664
- type: "confirm",
1665
- name: "forceReinstall",
1666
- message: "\u8981\u5F3A\u5236\u91CD\u65B0\u5B89\u88C5\u5F53\u524D\u7248\u672C\u5417\uFF1F\uFF08\u53EF\u4FEE\u590D\u635F\u574F\u7684\u6587\u4EF6\uFF09",
1667
- default: false
1668
- }]);
1669
- if (!forceReinstall) {
1670
- return;
1671
- }
1672
- } else {
1673
- const { confirmUpdate } = await inquirer.prompt([{
1674
- type: "confirm",
1675
- name: "confirmUpdate",
1676
- message: `\u786E\u8BA4\u8981\u66F4\u65B0\u5230 v${latestVersion} \u5417\uFF1F`,
1677
- default: true
1678
- }]);
1679
- if (!confirmUpdate) {
1680
- console.log(ansis.gray("\u5DF2\u53D6\u6D88\u66F4\u65B0"));
1681
- return;
1682
- }
1661
+ const message = hasUpdate ? `\u786E\u8BA4\u8981\u66F4\u65B0\u5230 v${latestVersion} \u5417\uFF1F\uFF08\u5148\u4E0B\u8F7D\u6700\u65B0\u5305 \u2192 \u5220\u9664\u65E7\u5DE5\u4F5C\u6D41 \u2192 \u5B89\u88C5\u65B0\u5DE5\u4F5C\u6D41\uFF09` : "\u5F53\u524D\u5DF2\u662F\u6700\u65B0\u7248\u672C\u3002\u8981\u91CD\u65B0\u5B89\u88C5\u5417\uFF1F\uFF08\u5148\u4E0B\u8F7D\u6700\u65B0\u5305 \u2192 \u5220\u9664\u65E7\u5DE5\u4F5C\u6D41 \u2192 \u5B89\u88C5\u65B0\u5DE5\u4F5C\u6D41\uFF09";
1662
+ const { confirmUpdate } = await inquirer.prompt([{
1663
+ type: "confirm",
1664
+ name: "confirmUpdate",
1665
+ message,
1666
+ default: hasUpdate
1667
+ }]);
1668
+ if (!confirmUpdate) {
1669
+ console.log(ansis.gray("\u5DF2\u53D6\u6D88\u66F4\u65B0"));
1670
+ return;
1683
1671
  }
1684
- await performUpdate(currentVersion, latestVersion || currentVersion);
1672
+ await performUpdate(currentVersion, latestVersion || currentVersion, hasUpdate);
1685
1673
  } catch (error) {
1686
1674
  spinner.stop();
1687
1675
  console.log(ansis.red(`\u274C \u66F4\u65B0\u5931\u8D25: ${error}`));
@@ -1755,13 +1743,22 @@ async function askReconfigureRouting(currentRouting) {
1755
1743
  console.log();
1756
1744
  return newRouting;
1757
1745
  }
1758
- async function performUpdate(fromVersion, toVersion) {
1746
+ async function performUpdate(fromVersion, toVersion, isNewVersion) {
1759
1747
  console.log();
1760
1748
  console.log(ansis.yellow.bold("\u2699\uFE0F \u5F00\u59CB\u66F4\u65B0..."));
1761
1749
  console.log();
1750
+ let spinner = ora("\u6B63\u5728\u4E0B\u8F7D\u6700\u65B0\u7248\u672C...").start();
1751
+ try {
1752
+ await execAsync(`npx --yes ccg-workflow@latest --version`, { timeout: 6e4 });
1753
+ spinner.succeed("\u6700\u65B0\u7248\u672C\u4E0B\u8F7D\u5B8C\u6210");
1754
+ } catch (error) {
1755
+ spinner.fail("\u4E0B\u8F7D\u6700\u65B0\u7248\u672C\u5931\u8D25");
1756
+ console.log(ansis.red(`\u9519\u8BEF: ${error}`));
1757
+ return;
1758
+ }
1762
1759
  const config = await readCcgConfig();
1763
1760
  const newRouting = await askReconfigureRouting(config?.routing);
1764
- const spinner = ora("\u66F4\u65B0\u547D\u4EE4\u6A21\u677F\u548C\u63D0\u793A\u8BCD...").start();
1761
+ spinner = ora("\u6B63\u5728\u5220\u9664\u65E7\u5DE5\u4F5C\u6D41\u5E76\u5B89\u88C5\u65B0\u5DE5\u4F5C\u6D41...").start();
1765
1762
  try {
1766
1763
  const workflows = config?.workflows?.installed || [];
1767
1764
  const installDir = join(homedir(), ".claude");
@@ -1769,7 +1766,7 @@ async function performUpdate(fromVersion, toVersion) {
1769
1766
  routing: newRouting || config?.routing
1770
1767
  });
1771
1768
  if (result.success) {
1772
- spinner.succeed("\u547D\u4EE4\u6A21\u677F\u548C\u63D0\u793A\u8BCD\u66F4\u65B0\u6210\u529F");
1769
+ spinner.succeed("\u5DE5\u4F5C\u6D41\u66F4\u65B0\u6210\u529F");
1773
1770
  console.log();
1774
1771
  console.log(ansis.cyan(`\u5DF2\u66F4\u65B0 ${result.installedCommands.length} \u4E2A\u547D\u4EE4:`));
1775
1772
  for (const cmd of result.installedCommands) {
@@ -1802,7 +1799,11 @@ async function performUpdate(fromVersion, toVersion) {
1802
1799
  console.log();
1803
1800
  console.log(ansis.green.bold("\u2705 \u66F4\u65B0\u5B8C\u6210\uFF01"));
1804
1801
  console.log();
1805
- console.log(ansis.gray(`\u4ECE v${fromVersion} \u5347\u7EA7\u5230 v${toVersion}`));
1802
+ if (isNewVersion) {
1803
+ console.log(ansis.gray(`\u4ECE v${fromVersion} \u5347\u7EA7\u5230 v${toVersion}`));
1804
+ } else {
1805
+ console.log(ansis.gray(`\u91CD\u65B0\u5B89\u88C5\u4E86 v${toVersion}`));
1806
+ }
1806
1807
  console.log();
1807
1808
  }
1808
1809
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "Claude-Codex-Gemini 多模型协作系统 - 智能路由多模型开发工作流",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",