ccg-workflow 1.7.32 → 1.7.34

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.pCwgynzL.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.C1GkMuhn.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, 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.pCwgynzL.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.C1GkMuhn.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'node:child_process';
@@ -10,7 +10,7 @@ import i18next from 'i18next';
10
10
  import ora from 'ora';
11
11
  import { parse, stringify } from 'smol-toml';
12
12
 
13
- const version = "1.7.32";
13
+ const version = "1.7.34";
14
14
 
15
15
  function isWindows() {
16
16
  return process.platform === "win32";
@@ -1553,35 +1553,50 @@ async function init(options = {}) {
1553
1553
  console.log(` ${ansis.green("\u2713")} codeagent-wrapper ${ansis.gray(`\u2192 ${result.binPath}`)}`);
1554
1554
  const platform = process.platform;
1555
1555
  if (platform === "win32") {
1556
- const windowsPath = result.binPath.replace(/\//g, "\\");
1556
+ const windowsPath = result.binPath.replace(/\//g, "\\").replace(/\\$/, "");
1557
1557
  try {
1558
1558
  const { execSync } = await import('node:child_process');
1559
- const currentPath = execSync(`powershell -Command "[System.Environment]::GetEnvironmentVariable('PATH', 'User')"`, { encoding: "utf-8" }).trim();
1560
- if (!currentPath.includes(windowsPath) && !currentPath.includes(".claude\\bin")) {
1561
- execSync(`powershell -Command "$currentPath = [System.Environment]::GetEnvironmentVariable('PATH', 'User'); [System.Environment]::SetEnvironmentVariable('PATH', \\"$currentPath;${windowsPath}\\", 'User')"`, { stdio: "pipe" });
1559
+ const psFlags = "-NoProfile -NonInteractive -ExecutionPolicy Bypass";
1560
+ const currentPath = execSync(`powershell ${psFlags} -Command "[System.Environment]::GetEnvironmentVariable('PATH', 'User')"`, { encoding: "utf-8" }).trim();
1561
+ const currentPathNorm = currentPath.toLowerCase().replace(/\\$/g, "");
1562
+ const windowsPathNorm = windowsPath.toLowerCase();
1563
+ if (!currentPathNorm.includes(windowsPathNorm) && !currentPathNorm.includes(".claude\\bin")) {
1564
+ const escapedPath = windowsPath.replace(/'/g, "''");
1565
+ const psScript = currentPath ? `$p=[System.Environment]::GetEnvironmentVariable('PATH','User');[System.Environment]::SetEnvironmentVariable('PATH',($p+';'+'${escapedPath}'),'User')` : `[System.Environment]::SetEnvironmentVariable('PATH','${escapedPath}','User')`;
1566
+ execSync(`powershell ${psFlags} -Command "${psScript}"`, { stdio: "pipe" });
1562
1567
  console.log(` ${ansis.green("\u2713")} PATH ${ansis.gray("\u2192 \u7528\u6237\u73AF\u5883\u53D8\u91CF")}`);
1563
1568
  }
1564
1569
  } catch {
1565
1570
  }
1566
1571
  } else if (!options.skipPrompt) {
1567
1572
  const exportCommand = `export PATH="${result.binPath}:$PATH"`;
1568
- const shellRc = process.env.SHELL?.includes("zsh") ? join(homedir(), ".zshrc") : join(homedir(), ".bashrc");
1569
- const shellRcDisplay = process.env.SHELL?.includes("zsh") ? "~/.zshrc" : "~/.bashrc";
1570
- try {
1571
- let rcContent = "";
1572
- if (await fs.pathExists(shellRc)) {
1573
- rcContent = await fs.readFile(shellRc, "utf-8");
1574
- }
1575
- if (rcContent.includes(result.binPath) || rcContent.includes("/.claude/bin")) {
1576
- } else {
1577
- const configLine = `
1573
+ const shell = process.env.SHELL || "";
1574
+ const isZsh = shell.includes("zsh");
1575
+ const isBash = shell.includes("bash");
1576
+ const isMacDefaultZsh = process.platform === "darwin" && !shell;
1577
+ if (isZsh || isBash || isMacDefaultZsh) {
1578
+ const shellRc = isZsh || isMacDefaultZsh ? join(homedir(), ".zshrc") : join(homedir(), ".bashrc");
1579
+ const shellRcDisplay = isZsh || isMacDefaultZsh ? "~/.zshrc" : "~/.bashrc";
1580
+ try {
1581
+ let rcContent = "";
1582
+ if (await fs.pathExists(shellRc)) {
1583
+ rcContent = await fs.readFile(shellRc, "utf-8");
1584
+ }
1585
+ if (rcContent.includes(result.binPath) || rcContent.includes("/.claude/bin")) {
1586
+ console.log(` ${ansis.green("\u2713")} PATH ${ansis.gray(`\u2192 ${shellRcDisplay} (\u5DF2\u914D\u7F6E)`)}`);
1587
+ } else {
1588
+ const configLine = `
1578
1589
  # CCG multi-model collaboration system
1579
1590
  ${exportCommand}
1580
1591
  `;
1581
- await fs.appendFile(shellRc, configLine, "utf-8");
1582
- console.log(` ${ansis.green("\u2713")} PATH ${ansis.gray(`\u2192 ${shellRcDisplay}`)}`);
1592
+ await fs.appendFile(shellRc, configLine, "utf-8");
1593
+ console.log(` ${ansis.green("\u2713")} PATH ${ansis.gray(`\u2192 ${shellRcDisplay}`)}`);
1594
+ }
1595
+ } catch {
1583
1596
  }
1584
- } catch {
1597
+ } else {
1598
+ console.log(` ${ansis.yellow("\u26A0")} PATH ${ansis.gray("\u2192 \u8BF7\u624B\u52A8\u6DFB\u52A0\u5230 shell \u914D\u7F6E:")}`);
1599
+ console.log(` ${ansis.cyan(exportCommand)}`);
1585
1600
  }
1586
1601
  }
1587
1602
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.7.32",
3
+ "version": "1.7.34",
4
4
  "description": "Claude-Codex-Gemini 多模型协作系统 - 智能路由多模型开发工作流",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",