ccg-workflow 1.7.3 → 1.7.5

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.B7LrdmRN.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.B7LrdmRN.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.5";
14
14
 
15
15
  function isWindows() {
16
16
  return process.platform === "win32";
@@ -246,6 +246,17 @@ const WORKFLOW_CONFIGS = [
246
246
  description: "\u53CC\u6A21\u578B\u4EE3\u7801\u5BA1\u67E5\uFF0C\u65E0\u53C2\u6570\u65F6\u81EA\u52A8\u5BA1\u67E5 git diff",
247
247
  descriptionEn: "Dual-model code review, auto-review git diff when no args"
248
248
  },
249
+ {
250
+ id: "enhance",
251
+ name: "Prompt \u589E\u5F3A",
252
+ nameEn: "Prompt Enhancement",
253
+ category: "development",
254
+ commands: ["enhance"],
255
+ defaultSelected: true,
256
+ order: 9.5,
257
+ description: "ace-tool Prompt \u589E\u5F3A\u5DE5\u5177",
258
+ descriptionEn: "ace-tool prompt enhancement"
259
+ },
249
260
  {
250
261
  id: "init-project",
251
262
  name: "\u9879\u76EE\u521D\u59CB\u5316",
@@ -1580,7 +1591,7 @@ ${exportCommand}
1580
1591
  }
1581
1592
  }
1582
1593
 
1583
- const execAsync = promisify(exec);
1594
+ const execAsync$1 = promisify(exec);
1584
1595
  const __filename$1 = fileURLToPath(import.meta.url);
1585
1596
  const __dirname$1 = dirname(__filename$1);
1586
1597
  function findPackageRoot(startDir) {
@@ -1605,7 +1616,7 @@ async function getCurrentVersion() {
1605
1616
  }
1606
1617
  async function getLatestVersion(packageName = "ccg-workflow") {
1607
1618
  try {
1608
- const { stdout } = await execAsync(`npm view ${packageName} version`);
1619
+ const { stdout } = await execAsync$1(`npm view ${packageName} version`);
1609
1620
  return stdout.trim();
1610
1621
  } catch {
1611
1622
  return null;
@@ -1642,7 +1653,7 @@ async function checkForUpdates() {
1642
1653
  };
1643
1654
  }
1644
1655
 
1645
- promisify(exec);
1656
+ const execAsync = promisify(exec);
1646
1657
  async function update() {
1647
1658
  console.log();
1648
1659
  console.log(ansis.cyan.bold("\u{1F504} \u68C0\u67E5\u66F4\u65B0..."));
@@ -1658,118 +1669,47 @@ async function update() {
1658
1669
  console.log(`\u5F53\u524D\u7248\u672C: ${ansis.yellow(`v${currentVersion}`)}`);
1659
1670
  console.log(`\u6700\u65B0\u7248\u672C: ${ansis.green(`v${latestVersion}`)}`);
1660
1671
  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
- }
1672
+ 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";
1673
+ const { confirmUpdate } = await inquirer.prompt([{
1674
+ type: "confirm",
1675
+ name: "confirmUpdate",
1676
+ message,
1677
+ default: hasUpdate
1678
+ }]);
1679
+ if (!confirmUpdate) {
1680
+ console.log(ansis.gray("\u5DF2\u53D6\u6D88\u66F4\u65B0"));
1681
+ return;
1683
1682
  }
1684
- await performUpdate(currentVersion, latestVersion || currentVersion);
1683
+ await performUpdate(currentVersion, latestVersion || currentVersion, hasUpdate);
1685
1684
  } catch (error) {
1686
1685
  spinner.stop();
1687
1686
  console.log(ansis.red(`\u274C \u66F4\u65B0\u5931\u8D25: ${error}`));
1688
1687
  }
1689
1688
  }
1690
- async function askReconfigureRouting(currentRouting) {
1691
- console.log();
1692
- console.log(ansis.cyan.bold("\u{1F527} \u6A21\u578B\u8DEF\u7531\u914D\u7F6E"));
1693
- console.log();
1694
- if (currentRouting) {
1695
- console.log(ansis.gray("\u5F53\u524D\u914D\u7F6E:"));
1696
- console.log(` ${ansis.cyan("\u524D\u7AEF\u6A21\u578B:")} ${currentRouting.frontend.models.map((m) => ansis.green(m)).join(", ")}`);
1697
- console.log(` ${ansis.cyan("\u540E\u7AEF\u6A21\u578B:")} ${currentRouting.backend.models.map((m) => ansis.blue(m)).join(", ")}`);
1698
- console.log();
1699
- }
1700
- const { reconfigure } = await inquirer.prompt([{
1701
- type: "confirm",
1702
- name: "reconfigure",
1703
- message: "\u662F\u5426\u91CD\u65B0\u914D\u7F6E\u524D\u7AEF\u548C\u540E\u7AEF\u6A21\u578B\uFF1F",
1704
- default: false
1705
- }]);
1706
- if (!reconfigure) {
1707
- return null;
1708
- }
1709
- console.log();
1710
- const { selectedFrontend } = await inquirer.prompt([{
1711
- type: "checkbox",
1712
- name: "selectedFrontend",
1713
- message: i18n.t("init:selectFrontendModels"),
1714
- choices: [
1715
- { name: "Gemini", value: "gemini", checked: currentRouting?.frontend.models.includes("gemini") ?? true },
1716
- { name: "Claude", value: "claude", checked: currentRouting?.frontend.models.includes("claude") ?? false },
1717
- { name: "Codex", value: "codex", checked: currentRouting?.frontend.models.includes("codex") ?? false }
1718
- ],
1719
- validate: (answer) => answer.length > 0 || i18n.t("init:validation.selectAtLeastOne")
1720
- }]);
1721
- const { selectedBackend } = await inquirer.prompt([{
1722
- type: "checkbox",
1723
- name: "selectedBackend",
1724
- message: i18n.t("init:selectBackendModels"),
1725
- choices: [
1726
- { name: "Codex", value: "codex", checked: currentRouting?.backend.models.includes("codex") ?? true },
1727
- { name: "Gemini", value: "gemini", checked: currentRouting?.backend.models.includes("gemini") ?? false },
1728
- { name: "Claude", value: "claude", checked: currentRouting?.backend.models.includes("claude") ?? false }
1729
- ],
1730
- validate: (answer) => answer.length > 0 || i18n.t("init:validation.selectAtLeastOne")
1731
- }]);
1732
- const frontendModels = selectedFrontend;
1733
- const backendModels = selectedBackend;
1734
- const newRouting = {
1735
- frontend: {
1736
- models: frontendModels,
1737
- primary: frontendModels[0],
1738
- strategy: frontendModels.length > 1 ? "parallel" : "fallback"
1739
- },
1740
- backend: {
1741
- models: backendModels,
1742
- primary: backendModels[0],
1743
- strategy: backendModels.length > 1 ? "parallel" : "fallback"
1744
- },
1745
- review: {
1746
- models: [.../* @__PURE__ */ new Set([...frontendModels, ...backendModels])],
1747
- strategy: "parallel"
1748
- },
1749
- mode: currentRouting?.mode || "smart"
1750
- };
1751
- console.log();
1752
- console.log(ansis.green("\u2713 \u65B0\u914D\u7F6E:"));
1753
- console.log(` ${ansis.cyan("\u524D\u7AEF\u6A21\u578B:")} ${frontendModels.map((m) => ansis.green(m)).join(", ")}`);
1754
- console.log(` ${ansis.cyan("\u540E\u7AEF\u6A21\u578B:")} ${backendModels.map((m) => ansis.blue(m)).join(", ")}`);
1755
- console.log();
1756
- return newRouting;
1757
- }
1758
- async function performUpdate(fromVersion, toVersion) {
1689
+ async function performUpdate(fromVersion, toVersion, isNewVersion) {
1759
1690
  console.log();
1760
1691
  console.log(ansis.yellow.bold("\u2699\uFE0F \u5F00\u59CB\u66F4\u65B0..."));
1761
1692
  console.log();
1693
+ let spinner = ora("\u6B63\u5728\u4E0B\u8F7D\u6700\u65B0\u7248\u672C...").start();
1694
+ try {
1695
+ await execAsync(`npx --yes ccg-workflow@latest --version`, { timeout: 6e4 });
1696
+ spinner.succeed("\u6700\u65B0\u7248\u672C\u4E0B\u8F7D\u5B8C\u6210");
1697
+ } catch (error) {
1698
+ spinner.fail("\u4E0B\u8F7D\u6700\u65B0\u7248\u672C\u5931\u8D25");
1699
+ console.log(ansis.red(`\u9519\u8BEF: ${error}`));
1700
+ return;
1701
+ }
1762
1702
  const config = await readCcgConfig();
1763
- const newRouting = await askReconfigureRouting(config?.routing);
1764
- const spinner = ora("\u66F4\u65B0\u547D\u4EE4\u6A21\u677F\u548C\u63D0\u793A\u8BCD...").start();
1703
+ spinner = ora("\u6B63\u5728\u66F4\u65B0\u5DE5\u4F5C\u6D41\u548C codeagent-wrapper \u4E8C\u8FDB\u5236...").start();
1765
1704
  try {
1766
1705
  const workflows = config?.workflows?.installed || [];
1767
1706
  const installDir = join(homedir(), ".claude");
1768
1707
  const result = await installWorkflows(workflows, installDir, true, {
1769
- routing: newRouting || config?.routing
1708
+ routing: config?.routing
1709
+ // Use existing routing (fixed: Gemini frontend + Codex backend)
1770
1710
  });
1771
1711
  if (result.success) {
1772
- spinner.succeed("\u547D\u4EE4\u6A21\u677F\u548C\u63D0\u793A\u8BCD\u66F4\u65B0\u6210\u529F");
1712
+ spinner.succeed("\u5DE5\u4F5C\u6D41\u548C\u4E8C\u8FDB\u5236\u6587\u4EF6\u66F4\u65B0\u6210\u529F");
1773
1713
  console.log();
1774
1714
  console.log(ansis.cyan(`\u5DF2\u66F4\u65B0 ${result.installedCommands.length} \u4E2A\u547D\u4EE4:`));
1775
1715
  for (const cmd of result.installedCommands) {
@@ -1777,15 +1717,8 @@ async function performUpdate(fromVersion, toVersion) {
1777
1717
  }
1778
1718
  if (config) {
1779
1719
  config.general.version = toVersion;
1780
- if (newRouting) {
1781
- config.routing = newRouting;
1782
- }
1783
1720
  await writeCcgConfig(config);
1784
1721
  }
1785
- if (newRouting) {
1786
- console.log();
1787
- console.log(ansis.green("\u2713 \u6A21\u578B\u8DEF\u7531\u914D\u7F6E\u5DF2\u66F4\u65B0"));
1788
- }
1789
1722
  } else {
1790
1723
  spinner.fail("\u66F4\u65B0\u5931\u8D25");
1791
1724
  console.log(ansis.red("\u90E8\u5206\u6587\u4EF6\u66F4\u65B0\u5931\u8D25:"));
@@ -1802,7 +1735,11 @@ async function performUpdate(fromVersion, toVersion) {
1802
1735
  console.log();
1803
1736
  console.log(ansis.green.bold("\u2705 \u66F4\u65B0\u5B8C\u6210\uFF01"));
1804
1737
  console.log();
1805
- console.log(ansis.gray(`\u4ECE v${fromVersion} \u5347\u7EA7\u5230 v${toVersion}`));
1738
+ if (isNewVersion) {
1739
+ console.log(ansis.gray(`\u4ECE v${fromVersion} \u5347\u7EA7\u5230 v${toVersion}`));
1740
+ } else {
1741
+ console.log(ansis.gray(`\u91CD\u65B0\u5B89\u88C5\u4E86 v${toVersion}`));
1742
+ }
1806
1743
  console.log();
1807
1744
  }
1808
1745
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "Claude-Codex-Gemini 多模型协作系统 - 智能路由多模型开发工作流",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",