ccg-workflow 1.7.78 → 1.7.79

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
@@ -352,4 +352,4 @@ MIT
352
352
 
353
353
  ---
354
354
 
355
- v1.7.78 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
355
+ v1.7.79 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
package/README.zh-CN.md CHANGED
@@ -352,4 +352,4 @@ MIT
352
352
 
353
353
  ---
354
354
 
355
- v1.7.78 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [参与贡献](./CONTRIBUTING.md)
355
+ v1.7.79 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [参与贡献](./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.CiXIRxs4.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.O8zwMZ2s.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, 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.CiXIRxs4.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.O8zwMZ2s.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.78";
13
+ const version = "1.7.79";
14
14
 
15
15
  function isWindows() {
16
16
  return process.platform === "win32";
@@ -174,16 +174,37 @@ function findPackageRoot$1(startDir) {
174
174
  const PACKAGE_ROOT$1 = findPackageRoot$1(__dirname$2);
175
175
  async function downloadBinaryFromRelease(binaryName, destPath) {
176
176
  const url = `${BINARY_DOWNLOAD_URL}/${binaryName}`;
177
- const response = await fetch(url, { redirect: "follow" });
178
- if (!response.ok) {
179
- return false;
180
- }
181
- const buffer = Buffer.from(await response.arrayBuffer());
182
- await fs.writeFile(destPath, buffer);
183
- if (process.platform !== "win32") {
184
- await fs.chmod(destPath, 493);
177
+ const MAX_ATTEMPTS = 3;
178
+ const TIMEOUT_MS = 6e4;
179
+ for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
180
+ try {
181
+ const controller = new AbortController();
182
+ const timer = setTimeout(() => controller.abort(), TIMEOUT_MS);
183
+ const response = await fetch(url, { redirect: "follow", signal: controller.signal });
184
+ if (!response.ok) {
185
+ clearTimeout(timer);
186
+ if (attempt < MAX_ATTEMPTS) {
187
+ await new Promise((resolve) => setTimeout(resolve, attempt * 2e3));
188
+ continue;
189
+ }
190
+ return false;
191
+ }
192
+ const buffer = Buffer.from(await response.arrayBuffer());
193
+ clearTimeout(timer);
194
+ await fs.writeFile(destPath, buffer);
195
+ if (process.platform !== "win32") {
196
+ await fs.chmod(destPath, 493);
197
+ }
198
+ return true;
199
+ } catch {
200
+ if (attempt < MAX_ATTEMPTS) {
201
+ await new Promise((resolve) => setTimeout(resolve, attempt * 2e3));
202
+ continue;
203
+ }
204
+ return false;
205
+ }
185
206
  }
186
- return true;
207
+ return false;
187
208
  }
188
209
  const WORKFLOW_CONFIGS = [
189
210
  {
@@ -754,16 +775,13 @@ ${workflow.description}
754
775
  result.binPath = binDir;
755
776
  result.binInstalled = true;
756
777
  } catch (verifyError) {
757
- result.errors.push(`Binary verification failed: ${verifyError}`);
758
- result.success = false;
778
+ result.errors.push(`Binary verification failed (non-blocking): ${verifyError}`);
759
779
  }
760
780
  } else {
761
- result.errors.push(`Failed to download binary: ${binaryName} from GitHub Release. Check network or visit https://github.com/${GITHUB_REPO}/releases/tag/${RELEASE_TAG}`);
762
- result.success = false;
781
+ result.errors.push(`Failed to download binary: ${binaryName} from GitHub Release (after 3 attempts). Check network or visit https://github.com/${GITHUB_REPO}/releases/tag/${RELEASE_TAG}`);
763
782
  }
764
783
  } catch (error) {
765
- result.errors.push(`Failed to install codeagent-wrapper: ${error}`);
766
- result.success = false;
784
+ result.errors.push(`Failed to install codeagent-wrapper (non-blocking): ${error}`);
767
785
  }
768
786
  result.configPath = commandsDir;
769
787
  return result;
@@ -3162,6 +3180,39 @@ ${exportCommand}
3162
3180
  console.log(` ${ansis.cyan(exportCommand)}`);
3163
3181
  }
3164
3182
  }
3183
+ } else {
3184
+ const binDest = join(installDir, "bin");
3185
+ const binaryExt = process.platform === "win32" ? ".exe" : "";
3186
+ 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";
3187
+ const binaryFileName = `codeagent-wrapper-${platformLabel}${binaryExt}`;
3188
+ const destFileName = `codeagent-wrapper${binaryExt}`;
3189
+ const releaseUrl = `https://github.com/fengshao1227/ccg-workflow/releases/tag/preset`;
3190
+ console.log();
3191
+ 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`));
3192
+ console.log(ansis.red.bold(` \u2551 \u26A0 codeagent-wrapper \u4E0B\u8F7D\u5931\u8D25 \u2551`));
3193
+ console.log(ansis.red.bold(` \u2551 Binary download failed (network issue) \u2551`));
3194
+ 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`));
3195
+ console.log();
3196
+ 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`));
3197
+ console.log(ansis.yellow(` Multi-model commands require this binary to work.`));
3198
+ console.log();
3199
+ console.log(ansis.cyan(` \u624B\u52A8\u4FEE\u590D / Manual fix:`));
3200
+ console.log();
3201
+ console.log(ansis.white(` 1. \u4E0B\u8F7D / Download:`));
3202
+ console.log(ansis.cyan(` ${releaseUrl}`));
3203
+ console.log(ansis.gray(` \u2192 \u627E\u5230 ${ansis.white(binaryFileName)} \u5E76\u4E0B\u8F7D`));
3204
+ console.log();
3205
+ console.log(ansis.white(` 2. \u653E\u5230 / Place at:`));
3206
+ console.log(ansis.cyan(` ${binDest}/${destFileName}`));
3207
+ console.log();
3208
+ if (process.platform !== "win32") {
3209
+ console.log(ansis.white(` 3. \u52A0\u6743\u9650 / Make executable:`));
3210
+ console.log(ansis.cyan(` chmod +x "${binDest}/${destFileName}"`));
3211
+ console.log();
3212
+ }
3213
+ console.log(ansis.white(` \u6216\u91CD\u65B0\u5B89\u88C5 / Or re-install:`));
3214
+ console.log(ansis.cyan(` npx ccg-workflow@latest`));
3215
+ console.log();
3165
3216
  }
3166
3217
  if (mcpProvider === "skip" || (mcpProvider === "ace-tool" || mcpProvider === "ace-tool-rs") && !aceToolToken || mcpProvider === "contextweaver" && !contextWeaverApiKey) {
3167
3218
  console.log();
@@ -3399,8 +3450,18 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
3399
3450
  }
3400
3451
  }
3401
3452
  spinner = ora(i18n.t("update:removingOld")).start();
3453
+ const installDir = join(homedir(), ".claude");
3454
+ const binDir = join(installDir, "bin");
3455
+ const wrapperName = process.platform === "win32" ? "codeagent-wrapper.exe" : "codeagent-wrapper";
3456
+ const wrapperPath = join(binDir, wrapperName);
3457
+ const wrapperBackup = join(binDir, `${wrapperName}.bak`);
3458
+ let binaryBackedUp = false;
3402
3459
  try {
3403
- const installDir = join(homedir(), ".claude");
3460
+ const fsExtra = await import('fs-extra');
3461
+ if (await fsExtra.pathExists(wrapperPath)) {
3462
+ await fsExtra.copy(wrapperPath, wrapperBackup);
3463
+ binaryBackedUp = true;
3464
+ }
3404
3465
  const uninstallResult = await uninstallWorkflows(installDir);
3405
3466
  if (uninstallResult.success) {
3406
3467
  spinner.succeed(i18n.t("update:oldRemoved"));
@@ -3416,13 +3477,19 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
3416
3477
  spinner = ora(i18n.t("update:installingNew")).start();
3417
3478
  try {
3418
3479
  await execAsync$1(`npx --yes ccg-workflow@latest init --force --skip-mcp --skip-prompt`, {
3419
- timeout: 12e4,
3480
+ timeout: 3e5,
3481
+ // 5min — binary download from GitHub Release may be slow (especially in China)
3420
3482
  env: {
3421
3483
  ...process.env,
3422
3484
  CCG_UPDATE_MODE: "true"
3423
3485
  }
3424
3486
  });
3425
3487
  spinner.succeed(i18n.t("update:installDone"));
3488
+ if (binaryBackedUp) {
3489
+ const fsExtra = await import('fs-extra');
3490
+ await fsExtra.remove(wrapperBackup).catch(() => {
3491
+ });
3492
+ }
3426
3493
  const config = await readCcgConfig();
3427
3494
  if (config?.workflows?.installed) {
3428
3495
  console.log();
@@ -3433,6 +3500,17 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
3433
3500
  }
3434
3501
  } catch (error) {
3435
3502
  spinner.fail(i18n.t("update:installFailed"));
3503
+ if (binaryBackedUp) {
3504
+ try {
3505
+ const fsExtra = await import('fs-extra');
3506
+ if (await fsExtra.pathExists(wrapperBackup)) {
3507
+ await fsExtra.ensureDir(binDir);
3508
+ await fsExtra.move(wrapperBackup, wrapperPath, { overwrite: true });
3509
+ console.log(ansis.yellow(` \u2022 codeagent-wrapper restored from backup`));
3510
+ }
3511
+ } catch {
3512
+ }
3513
+ }
3436
3514
  console.log(ansis.red(`${i18n.t("common:error")}: ${error}`));
3437
3515
  console.log();
3438
3516
  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.78",
3
+ "version": "1.7.79",
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",