ccg-workflow 1.1.2 → 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/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.kbezU1LQ.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.2";
16
+ const version = "1.1.3";
17
17
 
18
18
  function customizeHelp(sections) {
19
19
  sections.unshift({
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.kbezU1LQ.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';
@@ -78,6 +78,18 @@ const zhCN = {
78
78
  installedPrompts: "\u5DF2\u5B89\u88C5\u89D2\u8272\u63D0\u793A\u8BCD:",
79
79
  installedBinary: "\u5DF2\u5B89\u88C5\u4E8C\u8FDB\u5236\u6587\u4EF6:",
80
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:",
81
93
  addToShellConfig: "\u8BF7\u6DFB\u52A0\u4EE5\u4E0B\u547D\u4EE4\u5230 {{file}} \u5E76\u91CD\u542F\u7EC8\u7AEF",
82
94
  configSavedTo: "\u914D\u7F6E\u5DF2\u4FDD\u5B58\u81F3:",
83
95
  validation: {
@@ -225,6 +237,18 @@ const en = {
225
237
  installedPrompts: "Installed Role Prompts:",
226
238
  installedBinary: "Installed Binary:",
227
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):",
228
252
  addToShellConfig: "Add the following command to {{file}} and restart your terminal",
229
253
  configSavedTo: "Config saved to:",
230
254
  validation: {
@@ -1096,10 +1120,71 @@ async function init(options = {}) {
1096
1120
  console.log(ansis.cyan(` ${i18n.t("init:installedBinary")}`));
1097
1121
  console.log(` ${ansis.green("\u2713")} codeagent-wrapper ${ansis.gray(`\u2192 ${result.binPath}`)}`);
1098
1122
  console.log();
1099
- console.log(ansis.yellow(` \u26A0 ${i18n.t("init:pathWarning")}`));
1100
- const shellRc = process.env.SHELL?.includes("zsh") ? "~/.zshrc" : "~/.bashrc";
1101
- console.log(ansis.gray(` export PATH="${result.binPath}:$PATH"`));
1102
- console.log(ansis.gray(` ${i18n.t("init:addToShellConfig", { file: shellRc })}`));
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
+ }
1103
1188
  }
1104
1189
  console.log();
1105
1190
  console.log(ansis.gray(` ${i18n.t("init:configSavedTo")} ${getCcgDir()}/config.toml`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Claude-Codex-Gemini 多模型协作系统 - 智能路由多模型开发工作流",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",