ccg-workflow 1.1.0 → 1.1.2

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
@@ -14,9 +14,16 @@
14
14
 
15
15
  ---
16
16
 
17
- ## 🎉 v3.0.0 重大更新
17
+ ## 🎉 最新更新
18
18
 
19
- ### 安装方式革命性升级
19
+ ### v1.1.0 - 智能更新系统
20
+ - ✅ **一键更新**:`npx ccg-workflow` 选择"更新工作流"
21
+ - ✅ **自动版本检测**:自动对比当前版本与 npm 最新版本
22
+ - ✅ **增量更新**:仅更新命令模板和提示词,保留用户配置
23
+ - ✅ **强制修复**:支持强制重装,修复损坏的文件
24
+ - ✅ **零权限**:无需 sudo,无需全局安装
25
+
26
+ ### v3.0.0 - 三 CLI 协作时代
20
27
  - ✅ 从 Python 脚本重构为 **TypeScript + unbuild** 构建系统
21
28
  - ✅ 发布到 npm: **`npx ccg-workflow`** 一键安装
22
29
  - ✅ 交互式配置菜单(初始化/更新/卸载)
@@ -88,8 +95,6 @@
88
95
  # 交互式配置安装
89
96
  npx ccg-workflow
90
97
 
91
- # 或简写
92
- npx ccg
93
98
  ```
94
99
 
95
100
  ### 方式二:全局安装
@@ -132,7 +137,9 @@ pnpm start
132
137
  ✕ 退出
133
138
  ```
134
139
 
135
- 选择 "初始化 CCG 配置" 进行首次安装,会引导你:
140
+ ### 首次安装
141
+
142
+ 选择 **"初始化 CCG 配置"** 进行首次安装,会引导你:
136
143
  1. 选择语言(中文/English)
137
144
  2. 配置前端模型(Gemini/Codex/Claude)
138
145
  3. 配置后端模型(Codex/Gemini/Claude)
@@ -140,6 +147,20 @@ pnpm start
140
147
  5. 选择要安装的工作流
141
148
  6. 配置 ace-tool MCP(可选)
142
149
 
150
+ ### 更新到最新版
151
+
152
+ 选择 **"更新工作流"**,系统将:
153
+ 1. 🔍 检查 npm 最新版本
154
+ 2. 📊 显示当前版本 vs 最新版本对比
155
+ 3. 📥 自动更新所有命令模板和提示词
156
+ 4. ✅ 保留用户配置和自定义内容
157
+
158
+ **特性**:
159
+ - ✅ 自动检测版本,有更新时提示
160
+ - ✅ 已是最新版本时,可选择"强制重装"修复损坏文件
161
+ - ✅ 无需 sudo 权限
162
+ - ✅ 无需卸载重装
163
+
143
164
  ---
144
165
 
145
166
  ## 使用
@@ -324,6 +345,37 @@ strategy = "parallel"
324
345
 
325
346
  ---
326
347
 
348
+ ## 更新
349
+
350
+ ### 更新到最新版本
351
+
352
+ ```bash
353
+ # 运行 CCG 菜单
354
+ npx ccg-workflow
355
+
356
+ # 选择 "更新工作流"
357
+ ```
358
+
359
+ 系统会自动:
360
+ 1. 检查 npm 最新版本
361
+ 2. 对比当前版本与最新版本
362
+ 3. 更新所有命令模板(`~/.claude/commands/ccg/`)
363
+ 4. 更新所有角色提示词(`~/.claude/prompts/ccg/`)
364
+ 5. 保留用户配置(`~/.ccg/config.toml`)
365
+
366
+ ### 强制修复损坏文件
367
+
368
+ 如果已是最新版本但文件损坏,可选择"强制重新安装":
369
+
370
+ ```bash
371
+ npx ccg-workflow
372
+ # 选择 "更新工作流"
373
+ # 当提示"已是最新版本"时
374
+ # 选择 Yes 进行强制重装
375
+ ```
376
+
377
+ ---
378
+
327
379
  ## 卸载
328
380
 
329
381
  ```bash
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.kbezU1LQ.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.0";
16
+ const version = "1.1.2";
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.kbezU1LQ.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'node:os';
@@ -76,6 +76,9 @@ 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
+ addToShellConfig: "\u8BF7\u6DFB\u52A0\u4EE5\u4E0B\u547D\u4EE4\u5230 {{file}} \u5E76\u91CD\u542F\u7EC8\u7AEF",
79
82
  configSavedTo: "\u914D\u7F6E\u5DF2\u4FDD\u5B58\u81F3:",
80
83
  validation: {
81
84
  selectAtLeastOne: "\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6A21\u578B"
@@ -220,6 +223,9 @@ const en = {
220
223
  installCancelled: "Installation cancelled",
221
224
  installedCommands: "Installed Commands:",
222
225
  installedPrompts: "Installed Role Prompts:",
226
+ installedBinary: "Installed Binary:",
227
+ pathWarning: "codeagent-wrapper needs to be added to PATH",
228
+ addToShellConfig: "Add the following command to {{file}} and restart your terminal",
223
229
  configSavedTo: "Config saved to:",
224
230
  validation: {
225
231
  selectAtLeastOne: "Please select at least one model"
@@ -716,6 +722,41 @@ ${workflow.description}
716
722
  }
717
723
  }
718
724
  }
725
+ try {
726
+ const binDir = join(installDir, "bin");
727
+ await fs.ensureDir(binDir);
728
+ const platform = process.platform;
729
+ const arch = process.arch;
730
+ let binaryName;
731
+ if (platform === "darwin") {
732
+ binaryName = arch === "arm64" ? "codeagent-wrapper-darwin-arm64" : "codeagent-wrapper-darwin-amd64";
733
+ } else if (platform === "linux") {
734
+ binaryName = "codeagent-wrapper-linux-amd64";
735
+ } else if (platform === "win32") {
736
+ binaryName = "codeagent-wrapper-windows-amd64.exe";
737
+ } else {
738
+ result.errors.push(`Unsupported platform: ${platform}`);
739
+ result.success = false;
740
+ result.configPath = commandsDir;
741
+ return result;
742
+ }
743
+ const srcBinary = join(PACKAGE_ROOT$1, "bin", binaryName);
744
+ const destBinary = join(binDir, platform === "win32" ? "codeagent-wrapper.exe" : "codeagent-wrapper");
745
+ if (await fs.pathExists(srcBinary)) {
746
+ await fs.copy(srcBinary, destBinary);
747
+ if (platform !== "win32") {
748
+ await fs.chmod(destBinary, 493);
749
+ }
750
+ result.binPath = binDir;
751
+ result.binInstalled = true;
752
+ } else {
753
+ result.errors.push(`Binary not found: ${binaryName}`);
754
+ result.success = false;
755
+ }
756
+ } catch (error) {
757
+ result.errors.push(`Failed to install codeagent-wrapper: ${error}`);
758
+ result.success = false;
759
+ }
719
760
  result.configPath = commandsDir;
720
761
  return result;
721
762
  }
@@ -1050,6 +1091,16 @@ async function init(options = {}) {
1050
1091
  console.log(` ${ansis.green("\u2713")} ${model}: ${roles.join(", ")}`);
1051
1092
  });
1052
1093
  }
1094
+ if (result.binInstalled && result.binPath) {
1095
+ console.log();
1096
+ console.log(ansis.cyan(` ${i18n.t("init:installedBinary")}`));
1097
+ console.log(` ${ansis.green("\u2713")} codeagent-wrapper ${ansis.gray(`\u2192 ${result.binPath}`)}`);
1098
+ 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 })}`));
1103
+ }
1053
1104
  console.log();
1054
1105
  console.log(ansis.gray(` ${i18n.t("init:configSavedTo")} ${getCcgDir()}/config.toml`));
1055
1106
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Claude-Codex-Gemini 多模型协作系统 - 智能路由多模型开发工作流",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",