ccg-workflow 1.1.1 → 1.1.3

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
@@ -95,8 +95,6 @@
95
95
  # 交互式配置安装
96
96
  npx ccg-workflow
97
97
 
98
- # 或简写
99
- npx ccg
100
98
  ```
101
99
 
102
100
  ### 方式二:全局安装
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 { r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, a as i18n } from './shared/ccg-workflow.BJvXd6ru.mjs';
4
+ import { r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, a as i18n } from './shared/ccg-workflow.CKdNMDkU.mjs';
5
5
  import 'inquirer';
6
6
  import 'node:os';
7
7
  import 'pathe';
@@ -13,7 +13,7 @@ import 'smol-toml';
13
13
  import 'node:child_process';
14
14
  import 'node:util';
15
15
 
16
- const version = "1.1.1";
16
+ const version = "1.1.3";
17
17
 
18
18
  function customizeHelp(sections) {
19
19
  sections.unshift({
package/dist/index.d.mts CHANGED
@@ -75,6 +75,8 @@ interface InstallResult {
75
75
  installedPrompts: string[];
76
76
  errors: string[];
77
77
  configPath: string;
78
+ binPath?: string;
79
+ binInstalled?: boolean;
78
80
  }
79
81
  interface AceToolConfig {
80
82
  baseUrl: string;
package/dist/index.d.ts CHANGED
@@ -75,6 +75,8 @@ interface InstallResult {
75
75
  installedPrompts: string[];
76
76
  errors: string[];
77
77
  configPath: string;
78
+ binPath?: string;
79
+ binInstalled?: boolean;
78
80
  }
79
81
  interface AceToolConfig {
80
82
  baseUrl: string;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as changeLanguage, q as checkForUpdates, t as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, o as getCurrentVersion, p as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, k as installWorkflows, r as readCcgConfig, s as showMainMenu, n as uninstallAceTool, m as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.BJvXd6ru.mjs';
1
+ export { c as changeLanguage, q as checkForUpdates, t as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, o as getCurrentVersion, p as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, k as installWorkflows, r as readCcgConfig, s as showMainMenu, n as uninstallAceTool, m as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.CKdNMDkU.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'node:os';
@@ -76,6 +76,21 @@ const zhCN = {
76
76
  installCancelled: "\u5B89\u88C5\u5DF2\u53D6\u6D88",
77
77
  installedCommands: "\u5DF2\u5B89\u88C5\u547D\u4EE4:",
78
78
  installedPrompts: "\u5DF2\u5B89\u88C5\u89D2\u8272\u63D0\u793A\u8BCD:",
79
+ installedBinary: "\u5DF2\u5B89\u88C5\u4E8C\u8FDB\u5236\u6587\u4EF6:",
80
+ pathWarning: "\u9700\u8981\u5C06 codeagent-wrapper \u6DFB\u52A0\u5230 PATH \u624D\u80FD\u4F7F\u7528",
81
+ autoConfigurePathPrompt: "\u662F\u5426\u81EA\u52A8\u914D\u7F6E PATH \u73AF\u5883\u53D8\u91CF\uFF1F",
82
+ pathConfigured: "PATH \u5DF2\u6DFB\u52A0\u5230 {{file}}",
83
+ pathAlreadyConfigured: "PATH \u5DF2\u914D\u7F6E\u5728 {{file}} \u4E2D",
84
+ pathConfigFailed: "\u81EA\u52A8\u914D\u7F6E\u5931\u8D25",
85
+ restartShellPrompt: "\u8BF7\u8FD0\u884C\u4EE5\u4E0B\u547D\u4EE4\u4F7F\u914D\u7F6E\u751F\u6548:",
86
+ manualConfigInstructions: "\u8BF7\u624B\u52A8\u6DFB\u52A0\u4EE5\u4E0B\u547D\u4EE4\u5230 {{file}}:",
87
+ windowsPathInstructions: "Windows \u7528\u6237 - \u624B\u52A8\u6DFB\u52A0\u5230\u7CFB\u7EDF\u73AF\u5883\u53D8\u91CF:",
88
+ windowsStep1: '\u6309 Win+X\uFF0C\u9009\u62E9"\u7CFB\u7EDF"',
89
+ windowsStep2: '\u70B9\u51FB"\u9AD8\u7EA7\u7CFB\u7EDF\u8BBE\u7F6E" \u2192 "\u73AF\u5883\u53D8\u91CF"',
90
+ windowsStep3: '\u5728"\u7528\u6237\u53D8\u91CF"\u4E2D\u627E\u5230 Path\uFF0C\u70B9\u51FB"\u7F16\u8F91"\uFF0C\u6DFB\u52A0:',
91
+ windowsStep4: '\u70B9\u51FB"\u786E\u5B9A"\u4FDD\u5B58\uFF0C\u91CD\u542F\u7EC8\u7AEF',
92
+ orUsePowerShell: "\u6216\u5728 PowerShell (\u7BA1\u7406\u5458) \u4E2D\u8FD0\u884C:",
93
+ addToShellConfig: "\u8BF7\u6DFB\u52A0\u4EE5\u4E0B\u547D\u4EE4\u5230 {{file}} \u5E76\u91CD\u542F\u7EC8\u7AEF",
79
94
  configSavedTo: "\u914D\u7F6E\u5DF2\u4FDD\u5B58\u81F3:",
80
95
  validation: {
81
96
  selectAtLeastOne: "\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6A21\u578B"
@@ -220,6 +235,21 @@ const en = {
220
235
  installCancelled: "Installation cancelled",
221
236
  installedCommands: "Installed Commands:",
222
237
  installedPrompts: "Installed Role Prompts:",
238
+ installedBinary: "Installed Binary:",
239
+ pathWarning: "codeagent-wrapper needs to be added to PATH",
240
+ autoConfigurePathPrompt: "Automatically configure PATH environment variable?",
241
+ pathConfigured: "PATH has been added to {{file}}",
242
+ pathAlreadyConfigured: "PATH is already configured in {{file}}",
243
+ pathConfigFailed: "Auto-configuration failed",
244
+ restartShellPrompt: "Run the following command to apply changes:",
245
+ manualConfigInstructions: "Please manually add the following to {{file}}:",
246
+ windowsPathInstructions: "Windows Users - Manually add to System Environment Variables:",
247
+ windowsStep1: 'Press Win+X, select "System"',
248
+ windowsStep2: 'Click "Advanced system settings" \u2192 "Environment Variables"',
249
+ windowsStep3: 'Find "Path" in User variables, click "Edit", add:',
250
+ windowsStep4: 'Click "OK" to save, restart terminal',
251
+ orUsePowerShell: "Or run in PowerShell (Admin):",
252
+ addToShellConfig: "Add the following command to {{file}} and restart your terminal",
223
253
  configSavedTo: "Config saved to:",
224
254
  validation: {
225
255
  selectAtLeastOne: "Please select at least one model"
@@ -716,6 +746,41 @@ ${workflow.description}
716
746
  }
717
747
  }
718
748
  }
749
+ try {
750
+ const binDir = join(installDir, "bin");
751
+ await fs.ensureDir(binDir);
752
+ const platform = process.platform;
753
+ const arch = process.arch;
754
+ let binaryName;
755
+ if (platform === "darwin") {
756
+ binaryName = arch === "arm64" ? "codeagent-wrapper-darwin-arm64" : "codeagent-wrapper-darwin-amd64";
757
+ } else if (platform === "linux") {
758
+ binaryName = "codeagent-wrapper-linux-amd64";
759
+ } else if (platform === "win32") {
760
+ binaryName = "codeagent-wrapper-windows-amd64.exe";
761
+ } else {
762
+ result.errors.push(`Unsupported platform: ${platform}`);
763
+ result.success = false;
764
+ result.configPath = commandsDir;
765
+ return result;
766
+ }
767
+ const srcBinary = join(PACKAGE_ROOT$1, "bin", binaryName);
768
+ const destBinary = join(binDir, platform === "win32" ? "codeagent-wrapper.exe" : "codeagent-wrapper");
769
+ if (await fs.pathExists(srcBinary)) {
770
+ await fs.copy(srcBinary, destBinary);
771
+ if (platform !== "win32") {
772
+ await fs.chmod(destBinary, 493);
773
+ }
774
+ result.binPath = binDir;
775
+ result.binInstalled = true;
776
+ } else {
777
+ result.errors.push(`Binary not found: ${binaryName}`);
778
+ result.success = false;
779
+ }
780
+ } catch (error) {
781
+ result.errors.push(`Failed to install codeagent-wrapper: ${error}`);
782
+ result.success = false;
783
+ }
719
784
  result.configPath = commandsDir;
720
785
  return result;
721
786
  }
@@ -1050,6 +1115,77 @@ async function init(options = {}) {
1050
1115
  console.log(` ${ansis.green("\u2713")} ${model}: ${roles.join(", ")}`);
1051
1116
  });
1052
1117
  }
1118
+ if (result.binInstalled && result.binPath) {
1119
+ console.log();
1120
+ console.log(ansis.cyan(` ${i18n.t("init:installedBinary")}`));
1121
+ console.log(` ${ansis.green("\u2713")} codeagent-wrapper ${ansis.gray(`\u2192 ${result.binPath}`)}`);
1122
+ console.log();
1123
+ const platform = process.platform;
1124
+ const exportCommand = `export PATH="${result.binPath}:$PATH"`;
1125
+ if (platform === "win32") {
1126
+ console.log(ansis.yellow(` \u26A0 ${i18n.t("init:pathWarning")}`));
1127
+ console.log();
1128
+ console.log(ansis.cyan(` ${i18n.t("init:windowsPathInstructions")}`));
1129
+ console.log(ansis.gray(` 1. ${i18n.t("init:windowsStep1")}`));
1130
+ console.log(ansis.gray(` 2. ${i18n.t("init:windowsStep2")}`));
1131
+ console.log(ansis.gray(` 3. ${i18n.t("init:windowsStep3")}`));
1132
+ console.log(ansis.gray(` ${result.binPath.replace(/\//g, "\\")}`));
1133
+ console.log(ansis.gray(` 4. ${i18n.t("init:windowsStep4")}`));
1134
+ console.log();
1135
+ console.log(ansis.cyan(` ${i18n.t("init:orUsePowerShell")}`));
1136
+ console.log(ansis.gray(` [System.Environment]::SetEnvironmentVariable('PATH', "$env:PATH;${result.binPath.replace(/\//g, "\\")}", 'User')`));
1137
+ } else {
1138
+ console.log(ansis.yellow(` \u26A0 ${i18n.t("init:pathWarning")}`));
1139
+ if (!options.skipPrompt) {
1140
+ console.log();
1141
+ const { autoConfigurePath } = await inquirer.prompt([{
1142
+ type: "confirm",
1143
+ name: "autoConfigurePath",
1144
+ message: i18n.t("init:autoConfigurePathPrompt"),
1145
+ default: true
1146
+ }]);
1147
+ if (autoConfigurePath) {
1148
+ const shellRc = process.env.SHELL?.includes("zsh") ? join(homedir(), ".zshrc") : join(homedir(), ".bashrc");
1149
+ const shellRcDisplay = process.env.SHELL?.includes("zsh") ? "~/.zshrc" : "~/.bashrc";
1150
+ try {
1151
+ let rcContent = "";
1152
+ if (await fs.pathExists(shellRc)) {
1153
+ rcContent = await fs.readFile(shellRc, "utf-8");
1154
+ }
1155
+ if (rcContent.includes(result.binPath) || rcContent.includes("/.claude/bin")) {
1156
+ console.log(ansis.green(` \u2713 ${i18n.t("init:pathAlreadyConfigured", { file: shellRcDisplay })}`));
1157
+ } else {
1158
+ const configLine = `
1159
+ # CCG multi-model collaboration system
1160
+ ${exportCommand}
1161
+ `;
1162
+ await fs.appendFile(shellRc, configLine, "utf-8");
1163
+ console.log(ansis.green(` \u2713 ${i18n.t("init:pathConfigured", { file: shellRcDisplay })}`));
1164
+ console.log();
1165
+ console.log(ansis.cyan(` ${i18n.t("init:restartShellPrompt")}`));
1166
+ console.log(ansis.gray(` source ${shellRcDisplay}`));
1167
+ }
1168
+ } catch (error) {
1169
+ console.log(ansis.red(` \u2717 ${i18n.t("init:pathConfigFailed")}`));
1170
+ console.log(ansis.gray(` ${i18n.t("init:manualConfigInstructions", { file: shellRcDisplay })}`));
1171
+ console.log(ansis.gray(` ${exportCommand}`));
1172
+ }
1173
+ } else {
1174
+ const shellRc = process.env.SHELL?.includes("zsh") ? "~/.zshrc" : "~/.bashrc";
1175
+ console.log();
1176
+ console.log(ansis.cyan(` ${i18n.t("init:manualConfigInstructions", { file: shellRc })}`));
1177
+ console.log(ansis.gray(` ${exportCommand}`));
1178
+ console.log(ansis.gray(` source ${shellRc}`));
1179
+ }
1180
+ } else {
1181
+ const shellRc = process.env.SHELL?.includes("zsh") ? "~/.zshrc" : "~/.bashrc";
1182
+ console.log();
1183
+ console.log(ansis.cyan(` ${i18n.t("init:manualConfigInstructions", { file: shellRc })}`));
1184
+ console.log(ansis.gray(` ${exportCommand}`));
1185
+ console.log(ansis.gray(` source ${shellRc}`));
1186
+ }
1187
+ }
1188
+ }
1053
1189
  console.log();
1054
1190
  console.log(ansis.gray(` ${i18n.t("init:configSavedTo")} ${getCcgDir()}/config.toml`));
1055
1191
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Claude-Codex-Gemini 多模型协作系统 - 智能路由多模型开发工作流",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",