ccg-workflow 1.7.83 → 1.7.85

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
@@ -354,4 +354,4 @@ MIT
354
354
 
355
355
  ---
356
356
 
357
- v1.7.83 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
357
+ v1.7.85 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
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 { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.OKd5dIP0.mjs';
4
+ import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.B9Mj76CP.mjs';
5
5
  import 'inquirer';
6
6
  import 'node:child_process';
7
7
  import 'node:util';
package/dist/index.d.mts CHANGED
@@ -178,9 +178,12 @@ interface UninstallResult {
178
178
  errors: string[];
179
179
  }
180
180
  /**
181
- * Uninstall workflows by removing their command files
181
+ * Uninstall workflows by removing their command files.
182
+ * @param options.preserveBinary — when true, skip binary removal (used during update)
182
183
  */
183
- declare function uninstallWorkflows(installDir: string): Promise<UninstallResult>;
184
+ declare function uninstallWorkflows(installDir: string, options?: {
185
+ preserveBinary?: boolean;
186
+ }): Promise<UninstallResult>;
184
187
 
185
188
  /**
186
189
  * Migration utilities for v1.4.0
package/dist/index.d.ts CHANGED
@@ -178,9 +178,12 @@ interface UninstallResult {
178
178
  errors: string[];
179
179
  }
180
180
  /**
181
- * Uninstall workflows by removing their command files
181
+ * Uninstall workflows by removing their command files.
182
+ * @param options.preserveBinary — when true, skip binary removal (used during update)
182
183
  */
183
- declare function uninstallWorkflows(installDir: string): Promise<UninstallResult>;
184
+ declare function uninstallWorkflows(installDir: string, options?: {
185
+ preserveBinary?: boolean;
186
+ }): Promise<UninstallResult>;
184
187
 
185
188
  /**
186
189
  * Migration utilities for v1.4.0
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.OKd5dIP0.mjs';
1
+ export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.B9Mj76CP.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'node:child_process';
@@ -10,7 +10,7 @@ import { parse, stringify } from 'smol-toml';
10
10
  import i18next from 'i18next';
11
11
  import ora from 'ora';
12
12
 
13
- const version = "1.7.83";
13
+ const version = "1.7.85";
14
14
 
15
15
  function cmd(id, order, category, name, nameEn, description, descriptionEn, cmdOverride) {
16
16
  return {
@@ -637,19 +637,19 @@ async function removeFastContextPrompt() {
637
637
 
638
638
  const GITHUB_REPO = "fengshao1227/ccg-workflow";
639
639
  const RELEASE_TAG = "preset";
640
- const BINARY_DOWNLOAD_URL = `https://github.com/${GITHUB_REPO}/releases/download/${RELEASE_TAG}`;
641
- async function downloadBinaryFromRelease(binaryName, destPath) {
642
- const url = `${BINARY_DOWNLOAD_URL}/${binaryName}`;
643
- const MAX_ATTEMPTS = 3;
644
- const TIMEOUT_MS = 6e4;
645
- for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
640
+ const BINARY_SOURCES = [
641
+ { name: "GitHub Release", url: `https://github.com/${GITHUB_REPO}/releases/download/${RELEASE_TAG}`, timeoutMs: 8e3 },
642
+ { name: "Cloudflare R2", url: "https://pub-29270440a0854a49bf1589cd3662c067.r2.dev/preset", timeoutMs: 6e4 }
643
+ ];
644
+ async function downloadFromUrl(url, destPath, timeoutMs, maxAttempts = 2) {
645
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
646
646
  try {
647
647
  const controller = new AbortController();
648
- const timer = setTimeout(() => controller.abort(), TIMEOUT_MS);
648
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
649
649
  const response = await fetch(url, { redirect: "follow", signal: controller.signal });
650
650
  if (!response.ok) {
651
651
  clearTimeout(timer);
652
- if (attempt < MAX_ATTEMPTS) {
652
+ if (attempt < maxAttempts) {
653
653
  await new Promise((resolve) => setTimeout(resolve, attempt * 2e3));
654
654
  continue;
655
655
  }
@@ -663,7 +663,7 @@ async function downloadBinaryFromRelease(binaryName, destPath) {
663
663
  }
664
664
  return true;
665
665
  } catch {
666
- if (attempt < MAX_ATTEMPTS) {
666
+ if (attempt < maxAttempts) {
667
667
  await new Promise((resolve) => setTimeout(resolve, attempt * 2e3));
668
668
  continue;
669
669
  }
@@ -672,6 +672,14 @@ async function downloadBinaryFromRelease(binaryName, destPath) {
672
672
  }
673
673
  return false;
674
674
  }
675
+ async function downloadBinaryFromRelease(binaryName, destPath) {
676
+ for (const source of BINARY_SOURCES) {
677
+ const url = `${source.url}/${binaryName}`;
678
+ const ok = await downloadFromUrl(url, destPath, source.timeoutMs);
679
+ if (ok) return true;
680
+ }
681
+ return false;
682
+ }
675
683
  async function copyMdTemplates(ctx, srcDir, destDir, options = {}) {
676
684
  const installed = [];
677
685
  if (!await fs.pathExists(srcDir)) return installed;
@@ -850,6 +858,52 @@ function getBinaryName() {
850
858
  const ext = process.platform === "win32" ? ".exe" : "";
851
859
  return `codeagent-wrapper-${os}-${arch}${ext}`;
852
860
  }
861
+ async function verifyBinary(installDir) {
862
+ const binDir = join(installDir, "bin");
863
+ const wrapperName = process.platform === "win32" ? "codeagent-wrapper.exe" : "codeagent-wrapper";
864
+ const wrapperPath = join(binDir, wrapperName);
865
+ if (!await fs.pathExists(wrapperPath)) return false;
866
+ try {
867
+ const { execSync } = await import('node:child_process');
868
+ execSync(`"${wrapperPath}" --version`, { stdio: "pipe" });
869
+ return true;
870
+ } catch {
871
+ return false;
872
+ }
873
+ }
874
+ function showBinaryDownloadWarning(binDir) {
875
+ const binaryExt = process.platform === "win32" ? ".exe" : "";
876
+ const platformLabel = process.platform === "darwin" ? process.arch === "arm64" ? "darwin-arm64" : "darwin-amd64" : process.platform === "linux" ? process.arch === "arm64" ? "linux-arm64" : "linux-amd64" : process.arch === "arm64" ? "windows-arm64" : "windows-amd64";
877
+ const binaryFileName = `codeagent-wrapper-${platformLabel}${binaryExt}`;
878
+ const destFileName = `codeagent-wrapper${binaryExt}`;
879
+ const releaseUrl = `https://github.com/${GITHUB_REPO}/releases/tag/${RELEASE_TAG}`;
880
+ console.log();
881
+ console.log(ansis.red.bold(` \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557`));
882
+ console.log(ansis.red.bold(` \u2551 \u26A0 codeagent-wrapper \u4E0B\u8F7D\u5931\u8D25 \u2551`));
883
+ console.log(ansis.red.bold(` \u2551 Binary download failed (network issue) \u2551`));
884
+ console.log(ansis.red.bold(` \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D`));
885
+ console.log();
886
+ console.log(ansis.yellow(` \u591A\u6A21\u578B\u534F\u4F5C\u547D\u4EE4 (/ccg:workflow, /ccg:plan \u7B49) \u9700\u8981\u6B64\u6587\u4EF6\u624D\u80FD\u5DE5\u4F5C\u3002`));
887
+ console.log(ansis.yellow(` Multi-model commands require this binary to work.`));
888
+ console.log();
889
+ console.log(ansis.cyan(` \u624B\u52A8\u4FEE\u590D / Manual fix:`));
890
+ console.log();
891
+ console.log(ansis.white(` 1. \u4E0B\u8F7D / Download:`));
892
+ console.log(ansis.cyan(` ${releaseUrl}`));
893
+ console.log(ansis.gray(` \u2192 \u627E\u5230 ${ansis.white(binaryFileName)} \u5E76\u4E0B\u8F7D`));
894
+ console.log();
895
+ console.log(ansis.white(` 2. \u653E\u5230 / Place at:`));
896
+ console.log(ansis.cyan(` ${binDir}/${destFileName}`));
897
+ console.log();
898
+ if (process.platform !== "win32") {
899
+ console.log(ansis.white(` 3. \u52A0\u6743\u9650 / Make executable:`));
900
+ console.log(ansis.cyan(` chmod +x "${binDir}/${destFileName}"`));
901
+ console.log();
902
+ }
903
+ console.log(ansis.white(` \u6216\u91CD\u65B0\u5B89\u88C5 / Or re-install:`));
904
+ console.log(ansis.cyan(` npx ccg-workflow@latest`));
905
+ console.log();
906
+ }
853
907
  async function installBinaryFile(ctx) {
854
908
  try {
855
909
  const binDir = join(ctx.installDir, "bin");
@@ -861,6 +915,16 @@ async function installBinaryFile(ctx) {
861
915
  return;
862
916
  }
863
917
  const destBinary = join(binDir, process.platform === "win32" ? "codeagent-wrapper.exe" : "codeagent-wrapper");
918
+ if (await fs.pathExists(destBinary)) {
919
+ try {
920
+ const { execSync } = await import('node:child_process');
921
+ execSync(`"${destBinary}" --version`, { stdio: "pipe" });
922
+ ctx.result.binPath = binDir;
923
+ ctx.result.binInstalled = true;
924
+ return;
925
+ } catch {
926
+ }
927
+ }
864
928
  const installed = await downloadBinaryFromRelease(binaryName, destBinary);
865
929
  if (installed) {
866
930
  try {
@@ -913,7 +977,7 @@ async function installWorkflows(workflowIds, installDir, force = false, config)
913
977
  ctx.result.configPath = join(installDir, "commands", "ccg");
914
978
  return ctx.result;
915
979
  }
916
- async function uninstallWorkflows(installDir) {
980
+ async function uninstallWorkflows(installDir, options) {
917
981
  const result = {
918
982
  success: true,
919
983
  removedCommands: [],
@@ -964,7 +1028,7 @@ async function uninstallWorkflows(installDir) {
964
1028
  result.errors.push(`Failed to remove rules: ${error}`);
965
1029
  }
966
1030
  }
967
- if (await fs.pathExists(binDir)) {
1031
+ if (!options?.preserveBinary && await fs.pathExists(binDir)) {
968
1032
  try {
969
1033
  const wrapperName = process.platform === "win32" ? "codeagent-wrapper.exe" : "codeagent-wrapper";
970
1034
  const wrapperPath = join(binDir, wrapperName);
@@ -988,6 +1052,17 @@ async function uninstallWorkflows(installDir) {
988
1052
  return result;
989
1053
  }
990
1054
 
1055
+ async function syncMcpMirrors() {
1056
+ const [codex, gemini] = await Promise.all([syncMcpToCodex(), syncMcpToGemini()]);
1057
+ const synced = [];
1058
+ if (codex.success && codex.synced.length > 0) synced.push(`Codex(${codex.synced.join(",")})`);
1059
+ if (gemini.success && gemini.synced.length > 0) synced.push(`Gemini(${gemini.synced.join(",")})`);
1060
+ if (synced.length > 0) {
1061
+ console.log(ansis.green(`\u2713 MCP \u5DF2\u540C\u6B65\u5230 ${synced.join(" + ")}`));
1062
+ }
1063
+ if (!codex.success) console.log(ansis.yellow(`\u26A0 Codex \u540C\u6B65\u5931\u8D25: ${codex.message}`));
1064
+ if (!gemini.success) console.log(ansis.yellow(`\u26A0 Gemini \u540C\u6B65\u5931\u8D25: ${gemini.message}`));
1065
+ }
991
1066
  async function configMcp() {
992
1067
  console.log();
993
1068
  console.log(ansis.cyan.bold(` \u914D\u7F6E MCP \u5DE5\u5177`));
@@ -1063,6 +1138,7 @@ async function handleInstallAceTool(isRs) {
1063
1138
  console.log();
1064
1139
  if (result.success) {
1065
1140
  console.log(ansis.green(`\u2713 ${toolName} MCP \u914D\u7F6E\u6210\u529F\uFF01`));
1141
+ await syncMcpMirrors();
1066
1142
  console.log(ansis.gray(` \u91CD\u542F Claude Code CLI \u4F7F\u914D\u7F6E\u751F\u6548`));
1067
1143
  } else {
1068
1144
  console.log(ansis.red(`\u2717 ${toolName} MCP \u914D\u7F6E\u5931\u8D25: ${result.message}`));
@@ -1088,6 +1164,7 @@ async function handleInstallContextWeaver() {
1088
1164
  console.log();
1089
1165
  if (result.success) {
1090
1166
  console.log(ansis.green("\u2713 ContextWeaver MCP \u914D\u7F6E\u6210\u529F\uFF01"));
1167
+ await syncMcpMirrors();
1091
1168
  console.log(ansis.gray(" \u91CD\u542F Claude Code CLI \u4F7F\u914D\u7F6E\u751F\u6548"));
1092
1169
  } else {
1093
1170
  console.log(ansis.red(`\u2717 ContextWeaver MCP \u914D\u7F6E\u5931\u8D25: ${result.message}`));
@@ -1121,6 +1198,7 @@ async function handleInstallFastContext() {
1121
1198
  await writeFastContextPrompt();
1122
1199
  console.log(ansis.green("\u2713 fast-context MCP \u914D\u7F6E\u6210\u529F\uFF01"));
1123
1200
  console.log(ansis.green("\u2713 \u641C\u7D22\u63D0\u793A\u8BCD\u5DF2\u5199\u5165 ~/.claude/rules/ + ~/.codex/AGENTS.md + ~/.gemini/GEMINI.md"));
1201
+ await syncMcpMirrors();
1124
1202
  console.log(ansis.gray(" \u91CD\u542F Claude Code CLI \u4F7F\u914D\u7F6E\u751F\u6548"));
1125
1203
  } else {
1126
1204
  console.log(ansis.red(`\u2717 fast-context MCP \u914D\u7F6E\u5931\u8D25: ${result.message}`));
@@ -1213,6 +1291,7 @@ async function handleGrokSearch() {
1213
1291
  await writeGrokPromptToRules();
1214
1292
  console.log(ansis.green("\u2713 grok-search MCP \u914D\u7F6E\u6210\u529F\uFF01"));
1215
1293
  console.log(ansis.green("\u2713 \u5168\u5C40\u641C\u7D22\u63D0\u793A\u8BCD\u5DF2\u5199\u5165 ~/.claude/rules/ccg-grok-search.md"));
1294
+ await syncMcpMirrors();
1216
1295
  console.log(ansis.gray(" \u91CD\u542F Claude Code CLI \u4F7F\u914D\u7F6E\u751F\u6548"));
1217
1296
  } else {
1218
1297
  console.log(ansis.red(`\u2717 grok-search MCP \u5B89\u88C5\u5931\u8D25: ${result.message}`));
@@ -1265,6 +1344,7 @@ async function handleAuxiliary() {
1265
1344
  }
1266
1345
  }
1267
1346
  console.log();
1347
+ await syncMcpMirrors();
1268
1348
  console.log(ansis.gray("\u91CD\u542F Claude Code CLI \u4F7F\u914D\u7F6E\u751F\u6548"));
1269
1349
  }
1270
1350
  async function handleUninstall() {
@@ -1306,6 +1386,7 @@ async function handleUninstall() {
1306
1386
  console.log(ansis.red(`\u2717 ${target} \u5378\u8F7D\u5931\u8D25: ${result.message}`));
1307
1387
  }
1308
1388
  }
1389
+ await syncMcpMirrors();
1309
1390
  console.log();
1310
1391
  }
1311
1392
 
@@ -3103,38 +3184,7 @@ ${exportCommand}
3103
3184
  }
3104
3185
  }
3105
3186
  } else {
3106
- const binDest = join(installDir, "bin");
3107
- const binaryExt = process.platform === "win32" ? ".exe" : "";
3108
- const platformLabel = process.platform === "darwin" ? process.arch === "arm64" ? "darwin-arm64" : "darwin-amd64" : process.platform === "linux" ? process.arch === "arm64" ? "linux-arm64" : "linux-amd64" : process.arch === "arm64" ? "windows-arm64" : "windows-amd64";
3109
- const binaryFileName = `codeagent-wrapper-${platformLabel}${binaryExt}`;
3110
- const destFileName = `codeagent-wrapper${binaryExt}`;
3111
- const releaseUrl = `https://github.com/fengshao1227/ccg-workflow/releases/tag/preset`;
3112
- console.log();
3113
- console.log(ansis.red.bold(` \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557`));
3114
- console.log(ansis.red.bold(` \u2551 \u26A0 codeagent-wrapper \u4E0B\u8F7D\u5931\u8D25 \u2551`));
3115
- console.log(ansis.red.bold(` \u2551 Binary download failed (network issue) \u2551`));
3116
- console.log(ansis.red.bold(` \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D`));
3117
- console.log();
3118
- console.log(ansis.yellow(` \u591A\u6A21\u578B\u534F\u4F5C\u547D\u4EE4 (/ccg:workflow, /ccg:plan \u7B49) \u9700\u8981\u6B64\u6587\u4EF6\u624D\u80FD\u5DE5\u4F5C\u3002`));
3119
- console.log(ansis.yellow(` Multi-model commands require this binary to work.`));
3120
- console.log();
3121
- console.log(ansis.cyan(` \u624B\u52A8\u4FEE\u590D / Manual fix:`));
3122
- console.log();
3123
- console.log(ansis.white(` 1. \u4E0B\u8F7D / Download:`));
3124
- console.log(ansis.cyan(` ${releaseUrl}`));
3125
- console.log(ansis.gray(` \u2192 \u627E\u5230 ${ansis.white(binaryFileName)} \u5E76\u4E0B\u8F7D`));
3126
- console.log();
3127
- console.log(ansis.white(` 2. \u653E\u5230 / Place at:`));
3128
- console.log(ansis.cyan(` ${binDest}/${destFileName}`));
3129
- console.log();
3130
- if (process.platform !== "win32") {
3131
- console.log(ansis.white(` 3. \u52A0\u6743\u9650 / Make executable:`));
3132
- console.log(ansis.cyan(` chmod +x "${binDest}/${destFileName}"`));
3133
- console.log();
3134
- }
3135
- console.log(ansis.white(` \u6216\u91CD\u65B0\u5B89\u88C5 / Or re-install:`));
3136
- console.log(ansis.cyan(` npx ccg-workflow@latest`));
3137
- console.log();
3187
+ showBinaryDownloadWarning(join(installDir, "bin"));
3138
3188
  }
3139
3189
  if (mcpProvider === "skip" || (mcpProvider === "ace-tool" || mcpProvider === "ace-tool-rs") && !aceToolToken || mcpProvider === "contextweaver" && !contextWeaverApiKey) {
3140
3190
  console.log();
@@ -3376,18 +3426,8 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
3376
3426
  }
3377
3427
  spinner = ora(i18n.t("update:removingOld")).start();
3378
3428
  const installDir = join(homedir(), ".claude");
3379
- const binDir = join(installDir, "bin");
3380
- const wrapperName = process.platform === "win32" ? "codeagent-wrapper.exe" : "codeagent-wrapper";
3381
- const wrapperPath = join(binDir, wrapperName);
3382
- const wrapperBackup = join(binDir, `${wrapperName}.bak`);
3383
- let binaryBackedUp = false;
3384
3429
  try {
3385
- const fsExtra = await import('fs-extra');
3386
- if (await fsExtra.pathExists(wrapperPath)) {
3387
- await fsExtra.copy(wrapperPath, wrapperBackup);
3388
- binaryBackedUp = true;
3389
- }
3390
- const uninstallResult = await uninstallWorkflows(installDir);
3430
+ const uninstallResult = await uninstallWorkflows(installDir, { preserveBinary: true });
3391
3431
  if (uninstallResult.success) {
3392
3432
  spinner.succeed(i18n.t("update:oldRemoved"));
3393
3433
  } else {
@@ -3410,11 +3450,6 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
3410
3450
  }
3411
3451
  });
3412
3452
  spinner.succeed(i18n.t("update:installDone"));
3413
- if (binaryBackedUp) {
3414
- const fsExtra = await import('fs-extra');
3415
- await fsExtra.remove(wrapperBackup).catch(() => {
3416
- });
3417
- }
3418
3453
  const config = await readCcgConfig();
3419
3454
  if (config?.workflows?.installed) {
3420
3455
  console.log();
@@ -3423,19 +3458,11 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
3423
3458
  console.log(` ${ansis.gray("\u2022")} /ccg:${cmd}`);
3424
3459
  }
3425
3460
  }
3461
+ if (!await verifyBinary(installDir)) {
3462
+ showBinaryDownloadWarning(join(installDir, "bin"));
3463
+ }
3426
3464
  } catch (error) {
3427
3465
  spinner.fail(i18n.t("update:installFailed"));
3428
- if (binaryBackedUp) {
3429
- try {
3430
- const fsExtra = await import('fs-extra');
3431
- if (await fsExtra.pathExists(wrapperBackup)) {
3432
- await fsExtra.ensureDir(binDir);
3433
- await fsExtra.move(wrapperBackup, wrapperPath, { overwrite: true });
3434
- console.log(ansis.yellow(` \u2022 codeagent-wrapper restored from backup`));
3435
- }
3436
- } catch {
3437
- }
3438
- }
3439
3466
  console.log(ansis.red(`${i18n.t("common:error")}: ${error}`));
3440
3467
  console.log();
3441
3468
  console.log(ansis.yellow(i18n.t("update:manualRetry")));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.7.83",
3
+ "version": "1.7.85",
4
4
  "description": "Claude + Codex + Gemini multi-model collaboration system - smart routing development workflow",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",
@@ -77,7 +77,10 @@
77
77
  "prepublishOnly": "pnpm build",
78
78
  "test": "vitest run",
79
79
  "lint": "eslint",
80
- "lint:fix": "eslint --fix"
80
+ "lint:fix": "eslint --fix",
81
+ "docs:dev": "vitepress dev docs",
82
+ "docs:build": "vitepress build docs",
83
+ "docs:preview": "vitepress preview docs"
81
84
  },
82
85
  "dependencies": {
83
86
  "ansis": "^4.1.0",
@@ -90,6 +93,9 @@
90
93
  "pathe": "^2.0.3",
91
94
  "smol-toml": "^1.4.2"
92
95
  },
96
+ "pnpm": {
97
+ "onlyBuiltDependencies": ["esbuild"]
98
+ },
93
99
  "devDependencies": {
94
100
  "@antfu/eslint-config": "^5.4.1",
95
101
  "@types/fs-extra": "^11.0.4",
@@ -98,6 +104,7 @@
98
104
  "tsx": "^4.20.5",
99
105
  "typescript": "^5.9.2",
100
106
  "unbuild": "^3.6.1",
107
+ "vitepress": "^1.6.4",
101
108
  "vitest": "^3.1.1"
102
109
  }
103
110
  }