ccg-workflow 1.7.77 → 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
@@ -5,7 +5,7 @@
5
5
  [![npm version](https://img.shields.io/npm/v/ccg-workflow.svg)](https://www.npmjs.com/package/ccg-workflow)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Claude Code](https://img.shields.io/badge/Claude%20Code-Compatible-green.svg)](https://claude.ai/code)
8
- [![Tests](https://img.shields.io/badge/Tests-131%20passed-brightgreen.svg)]()
8
+ [![Tests](https://img.shields.io/badge/Tests-134%20passed-brightgreen.svg)]()
9
9
 
10
10
  [简体中文](./README.zh-CN.md) | English
11
11
 
@@ -268,7 +268,7 @@ Add to `~/.claude/settings.json`:
268
268
  "hooks": [
269
269
  {
270
270
  "type": "command",
271
- "command": "jq -r '.tool_input.command' | grep -q 'codeagent-wrapper' && echo '{\"hookSpecificOutput\": {\"hookEventName\": \"PreToolUse\", \"permissionDecision\": \"allow\", \"permissionDecisionReason\": \"codeagent-wrapper auto-approved\"}}' || exit 1",
271
+ "command": "jq -r '.tool_input.command' 2>/dev/null | grep -q 'codeagent-wrapper' && echo '{\"hookSpecificOutput\": {\"hookEventName\": \"PreToolUse\", \"permissionDecision\": \"allow\", \"permissionDecisionReason\": \"codeagent-wrapper auto-approved\"}}' || true",
272
272
  "timeout": 1
273
273
  }
274
274
  ]
@@ -315,6 +315,20 @@ We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guideline
315
315
 
316
316
  Looking for a place to start? Check out issues labeled [`good first issue`](https://github.com/fengshao1227/ccg-workflow/labels/good%20first%20issue).
317
317
 
318
+ ## Contributors
319
+
320
+ <!-- readme: contributors,claude/-,bots/- -start -->
321
+ <table>
322
+ <tr>
323
+ <td align="center"><a href="https://github.com/fengshao1227"><img src="https://avatars.githubusercontent.com/fengshao1227?v=4&s=100" width="100;" alt="fengshao1227"/><br /><sub><b>fengshao1227</b></sub></a></td>
324
+ <td align="center"><a href="https://github.com/RebornQ"><img src="https://avatars.githubusercontent.com/RebornQ?v=4&s=100" width="100;" alt="RebornQ"/><br /><sub><b>RebornQ</b></sub></a></td>
325
+ <td align="center"><a href="https://github.com/23q3"><img src="https://avatars.githubusercontent.com/23q3?v=4&s=100" width="100;" alt="23q3"/><br /><sub><b>23q3</b></sub></a></td>
326
+ <td align="center"><a href="https://github.com/MrNine-666"><img src="https://avatars.githubusercontent.com/MrNine-666?v=4&s=100" width="100;" alt="MrNine-666"/><br /><sub><b>MrNine-666</b></sub></a></td>
327
+ <td align="center"><a href="https://github.com/GGzili"><img src="https://avatars.githubusercontent.com/GGzili?v=4&s=100" width="100;" alt="GGzili"/><br /><sub><b>GGzili</b></sub></a></td>
328
+ </tr>
329
+ </table>
330
+ <!-- readme: contributors,claude/-,bots/- -end -->
331
+
318
332
  ## Credits
319
333
 
320
334
  - [cexll/myclaude](https://github.com/cexll/myclaude) — codeagent-wrapper
@@ -326,10 +340,16 @@ Looking for a place to start? Check out issues labeled [`good first issue`](http
326
340
 
327
341
  [![Star History Chart](https://api.star-history.com/svg?repos=fengshao1227/ccg-workflow&type=timeline&legend=top-left)](https://www.star-history.com/#fengshao1227/ccg-workflow&type=timeline&legend=top-left)
328
342
 
343
+ ## Contact
344
+
345
+ - **Email**: [fengshao1227@gmail.com](mailto:fengshao1227@gmail.com) — Sponsorship, collaboration, or development ideas
346
+ - **Issues**: [GitHub Issues](https://github.com/fengshao1227/ccg-workflow/issues) — Bug reports and feature requests
347
+ - **Discussions**: [GitHub Discussions](https://github.com/fengshao1227/ccg-workflow/discussions) — Questions and community chat
348
+
329
349
  ## License
330
350
 
331
351
  MIT
332
352
 
333
353
  ---
334
354
 
335
- v1.7.77 | [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
@@ -5,7 +5,7 @@
5
5
  [![npm version](https://img.shields.io/npm/v/ccg-workflow.svg)](https://www.npmjs.com/package/ccg-workflow)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Claude Code](https://img.shields.io/badge/Claude%20Code-Compatible-green.svg)](https://claude.ai/code)
8
- [![Tests](https://img.shields.io/badge/Tests-131%20passed-brightgreen.svg)]()
8
+ [![Tests](https://img.shields.io/badge/Tests-134%20passed-brightgreen.svg)]()
9
9
 
10
10
  简体中文 | [English](./README.md)
11
11
 
@@ -268,7 +268,7 @@ CCG 安装时自动写入 Hook,自动授权 `codeagent-wrapper` 命令(需 [
268
268
  "hooks": [
269
269
  {
270
270
  "type": "command",
271
- "command": "jq -r '.tool_input.command' | grep -q 'codeagent-wrapper' && echo '{\"hookSpecificOutput\": {\"hookEventName\": \"PreToolUse\", \"permissionDecision\": \"allow\", \"permissionDecisionReason\": \"codeagent-wrapper auto-approved\"}}' || exit 1",
271
+ "command": "jq -r '.tool_input.command' 2>/dev/null | grep -q 'codeagent-wrapper' && echo '{\"hookSpecificOutput\": {\"hookEventName\": \"PreToolUse\", \"permissionDecision\": \"allow\", \"permissionDecisionReason\": \"codeagent-wrapper auto-approved\"}}' || true",
272
272
  "timeout": 1
273
273
  }
274
274
  ]
@@ -315,6 +315,20 @@ npm uninstall -g ccg-workflow # npm 全局用户需额外执行
315
315
 
316
316
  想找一个入手点?查看标记为 [`good first issue`](https://github.com/fengshao1227/ccg-workflow/labels/good%20first%20issue) 的 Issue。
317
317
 
318
+ ## 贡献者
319
+
320
+ <!-- readme: contributors,claude/-,bots/- -start -->
321
+ <table>
322
+ <tr>
323
+ <td align="center"><a href="https://github.com/fengshao1227"><img src="https://avatars.githubusercontent.com/fengshao1227?v=4&s=100" width="100;" alt="fengshao1227"/><br /><sub><b>fengshao1227</b></sub></a></td>
324
+ <td align="center"><a href="https://github.com/RebornQ"><img src="https://avatars.githubusercontent.com/RebornQ?v=4&s=100" width="100;" alt="RebornQ"/><br /><sub><b>RebornQ</b></sub></a></td>
325
+ <td align="center"><a href="https://github.com/23q3"><img src="https://avatars.githubusercontent.com/23q3?v=4&s=100" width="100;" alt="23q3"/><br /><sub><b>23q3</b></sub></a></td>
326
+ <td align="center"><a href="https://github.com/MrNine-666"><img src="https://avatars.githubusercontent.com/MrNine-666?v=4&s=100" width="100;" alt="MrNine-666"/><br /><sub><b>MrNine-666</b></sub></a></td>
327
+ <td align="center"><a href="https://github.com/GGzili"><img src="https://avatars.githubusercontent.com/GGzili?v=4&s=100" width="100;" alt="GGzili"/><br /><sub><b>GGzili</b></sub></a></td>
328
+ </tr>
329
+ </table>
330
+ <!-- readme: contributors,claude/-,bots/- -end -->
331
+
318
332
  ## 致谢
319
333
 
320
334
  - [cexll/myclaude](https://github.com/cexll/myclaude) — codeagent-wrapper
@@ -326,10 +340,16 @@ npm uninstall -g ccg-workflow # npm 全局用户需额外执行
326
340
 
327
341
  [![Star History Chart](https://api.star-history.com/svg?repos=fengshao1227/ccg-workflow&type=timeline&legend=top-left)](https://www.star-history.com/#fengshao1227/ccg-workflow&type=timeline&legend=top-left)
328
342
 
343
+ ## 联系方式
344
+
345
+ - **邮箱**: [fengshao1227@gmail.com](mailto:fengshao1227@gmail.com) — 赞助、合作洽谈、开发交流
346
+ - **Issues**: [GitHub Issues](https://github.com/fengshao1227/ccg-workflow/issues) — Bug 反馈与功能建议
347
+ - **讨论区**: [GitHub Discussions](https://github.com/fengshao1227/ccg-workflow/discussions) — 问题咨询与社区交流
348
+
329
349
  ## License
330
350
 
331
351
  MIT
332
352
 
333
353
  ---
334
354
 
335
- v1.7.77 | [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.Dgh3VYDe.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.Dgh3VYDe.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.77";
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
  {
@@ -746,21 +767,7 @@ ${workflow.description}
746
767
  return result;
747
768
  }
748
769
  const destBinary = join(binDir, platform === "win32" ? "codeagent-wrapper.exe" : "codeagent-wrapper");
749
- let installed = false;
750
- try {
751
- installed = await downloadBinaryFromRelease(binaryName, destBinary);
752
- } catch {
753
- }
754
- if (!installed) {
755
- const srcBinary = join(PACKAGE_ROOT$1, "bin", binaryName);
756
- if (await fs.pathExists(srcBinary)) {
757
- await fs.copy(srcBinary, destBinary);
758
- if (platform !== "win32") {
759
- await fs.chmod(destBinary, 493);
760
- }
761
- installed = true;
762
- }
763
- }
770
+ const installed = await downloadBinaryFromRelease(binaryName, destBinary);
764
771
  if (installed) {
765
772
  try {
766
773
  const { execSync } = await import('node:child_process');
@@ -768,16 +775,13 @@ ${workflow.description}
768
775
  result.binPath = binDir;
769
776
  result.binInstalled = true;
770
777
  } catch (verifyError) {
771
- result.errors.push(`Binary verification failed: ${verifyError}`);
772
- result.success = false;
778
+ result.errors.push(`Binary verification failed (non-blocking): ${verifyError}`);
773
779
  }
774
780
  } else {
775
- result.errors.push(`Failed to obtain binary: ${binaryName} (download failed, no local fallback)`);
776
- 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}`);
777
782
  }
778
783
  } catch (error) {
779
- result.errors.push(`Failed to install codeagent-wrapper: ${error}`);
780
- result.success = false;
784
+ result.errors.push(`Failed to install codeagent-wrapper (non-blocking): ${error}`);
781
785
  }
782
786
  result.configPath = commandsDir;
783
787
  return result;
@@ -2503,26 +2507,58 @@ async function installHook(settingsPath) {
2503
2507
  if (await fs.pathExists(settingsPath)) {
2504
2508
  settings = await fs.readJSON(settingsPath);
2505
2509
  }
2510
+ if (isWindows()) {
2511
+ if (settings.hooks?.PreToolUse) {
2512
+ const hookIdx = settings.hooks.PreToolUse.findIndex(
2513
+ (h) => h.matcher === "Bash" && h.hooks?.some((hh) => hh.command?.includes("codeagent-wrapper"))
2514
+ );
2515
+ if (hookIdx >= 0) {
2516
+ settings.hooks.PreToolUse.splice(hookIdx, 1);
2517
+ if (settings.hooks.PreToolUse.length === 0)
2518
+ delete settings.hooks.PreToolUse;
2519
+ if (settings.hooks && Object.keys(settings.hooks).length === 0)
2520
+ delete settings.hooks;
2521
+ }
2522
+ }
2523
+ if (!settings.permissions)
2524
+ settings.permissions = {};
2525
+ if (!settings.permissions.allow)
2526
+ settings.permissions.allow = [];
2527
+ const permEntry = "Bash(codeagent-wrapper*)";
2528
+ if (!settings.permissions.allow.includes(permEntry)) {
2529
+ settings.permissions.allow.push(permEntry);
2530
+ }
2531
+ await fs.writeJSON(settingsPath, settings, { spaces: 2 });
2532
+ return "permission";
2533
+ }
2506
2534
  if (!settings.hooks)
2507
2535
  settings.hooks = {};
2508
2536
  if (!settings.hooks.PreToolUse)
2509
2537
  settings.hooks.PreToolUse = [];
2510
- const existingHook = settings.hooks.PreToolUse.find(
2538
+ const newCommand = `jq -r '.tool_input.command' 2>/dev/null | grep -q 'codeagent-wrapper' && echo '{"hookSpecificOutput": {"hookEventName": "PreToolUse", "permissionDecision": "allow", "permissionDecisionReason": "codeagent-wrapper auto-approved"}}' || true`;
2539
+ const existingIdx = settings.hooks.PreToolUse.findIndex(
2511
2540
  (h) => h.matcher === "Bash" && h.hooks?.some((hh) => hh.command?.includes("codeagent-wrapper"))
2512
2541
  );
2513
- if (!existingHook) {
2542
+ if (existingIdx >= 0) {
2543
+ const oldCmd = settings.hooks.PreToolUse[existingIdx]?.hooks?.[0]?.command || "";
2544
+ if (oldCmd.includes("exit 1")) {
2545
+ settings.hooks.PreToolUse[existingIdx].hooks[0].command = newCommand;
2546
+ await fs.writeJSON(settingsPath, settings, { spaces: 2 });
2547
+ }
2548
+ } else {
2514
2549
  settings.hooks.PreToolUse.push({
2515
2550
  matcher: "Bash",
2516
2551
  hooks: [
2517
2552
  {
2518
2553
  type: "command",
2519
- command: `jq -r '.tool_input.command' | grep -q 'codeagent-wrapper' && echo '{"hookSpecificOutput": {"hookEventName": "PreToolUse", "permissionDecision": "allow", "permissionDecisionReason": "codeagent-wrapper auto-approved"}}' || exit 1`,
2554
+ command: newCommand,
2520
2555
  timeout: 1
2521
2556
  }
2522
2557
  ]
2523
2558
  });
2524
2559
  await fs.writeJSON(settingsPath, settings, { spaces: 2 });
2525
2560
  }
2561
+ return "hook";
2526
2562
  }
2527
2563
  async function appendGrokSearchPrompt() {
2528
2564
  const rulesDir = join(homedir(), ".claude", "rules");
@@ -2999,9 +3035,13 @@ async function init(options = {}) {
2999
3035
  console.log();
3000
3036
  console.log(` ${ansis.green("\u2713")} API ${ansis.gray(`\u2192 ${settingsPath}`)}`);
3001
3037
  }
3002
- await installHook(settingsPath);
3038
+ const hookMethod = await installHook(settingsPath);
3003
3039
  console.log();
3004
- console.log(` ${ansis.green("\u2713")} ${i18n.t("init:hooks.installed")}`);
3040
+ if (hookMethod === "permission") {
3041
+ console.log(` ${ansis.green("\u2713")} ${i18n.t("init:hooks.installed")} ${ansis.gray("(permissions.allow)")}`);
3042
+ } else {
3043
+ console.log(` ${ansis.green("\u2713")} ${i18n.t("init:hooks.installed")}`);
3044
+ }
3005
3045
  if (wantGrokSearch && (tavilyKey || firecrawlKey || grokApiUrl || grokApiKey)) {
3006
3046
  spinner.text = i18n.t("init:grok.installing");
3007
3047
  const grokResult = await installGrokSearchMcp({
@@ -3045,15 +3085,16 @@ async function init(options = {}) {
3045
3085
  console.log(ansis.gray(` ${codexSyncResult.message}`));
3046
3086
  }
3047
3087
  }
3048
- const hasJq = await checkJqAvailable();
3049
- if (!hasJq) {
3050
- console.log();
3051
- console.log(ansis.yellow(` \u26A0 ${i18n.t("init:hooks.jqNotFound")}`));
3052
- console.log();
3053
- console.log(ansis.cyan(` \u{1F4D6} ${i18n.t("init:hooks.jqInstallHint")}:`));
3054
- console.log(ansis.gray(` ${i18n.t("init:hooks.jqMac")}`));
3055
- console.log(ansis.gray(` ${i18n.t("init:hooks.jqLinux")}`));
3056
- console.log(ansis.gray(` ${i18n.t("init:hooks.jqWindows")}`));
3088
+ if (hookMethod === "hook") {
3089
+ const hasJq = await checkJqAvailable();
3090
+ if (!hasJq) {
3091
+ console.log();
3092
+ console.log(ansis.yellow(` \u26A0 ${i18n.t("init:hooks.jqNotFound")}`));
3093
+ console.log();
3094
+ console.log(ansis.cyan(` \u{1F4D6} ${i18n.t("init:hooks.jqInstallHint")}:`));
3095
+ console.log(ansis.gray(` ${i18n.t("init:hooks.jqMac")}`));
3096
+ console.log(ansis.gray(` ${i18n.t("init:hooks.jqLinux")}`));
3097
+ }
3057
3098
  }
3058
3099
  console.log();
3059
3100
  console.log(ansis.cyan(` ${i18n.t("init:installedCommands")}`));
@@ -3139,6 +3180,39 @@ ${exportCommand}
3139
3180
  console.log(` ${ansis.cyan(exportCommand)}`);
3140
3181
  }
3141
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();
3142
3216
  }
3143
3217
  if (mcpProvider === "skip" || (mcpProvider === "ace-tool" || mcpProvider === "ace-tool-rs") && !aceToolToken || mcpProvider === "contextweaver" && !contextWeaverApiKey) {
3144
3218
  console.log();
@@ -3376,8 +3450,18 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
3376
3450
  }
3377
3451
  }
3378
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;
3379
3459
  try {
3380
- 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
+ }
3381
3465
  const uninstallResult = await uninstallWorkflows(installDir);
3382
3466
  if (uninstallResult.success) {
3383
3467
  spinner.succeed(i18n.t("update:oldRemoved"));
@@ -3393,13 +3477,19 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
3393
3477
  spinner = ora(i18n.t("update:installingNew")).start();
3394
3478
  try {
3395
3479
  await execAsync$1(`npx --yes ccg-workflow@latest init --force --skip-mcp --skip-prompt`, {
3396
- timeout: 12e4,
3480
+ timeout: 3e5,
3481
+ // 5min — binary download from GitHub Release may be slow (especially in China)
3397
3482
  env: {
3398
3483
  ...process.env,
3399
3484
  CCG_UPDATE_MODE: "true"
3400
3485
  }
3401
3486
  });
3402
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
+ }
3403
3493
  const config = await readCcgConfig();
3404
3494
  if (config?.workflows?.installed) {
3405
3495
  console.log();
@@ -3410,6 +3500,17 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
3410
3500
  }
3411
3501
  } catch (error) {
3412
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
+ }
3413
3514
  console.log(ansis.red(`${i18n.t("common:error")}: ${error}`));
3414
3515
  console.log();
3415
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.77",
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",
@@ -91,7 +91,6 @@
91
91
  "devDependencies": {
92
92
  "@antfu/eslint-config": "^5.4.1",
93
93
  "@types/fs-extra": "^11.0.4",
94
- "@types/inquirer": "^9.0.9",
95
94
  "@types/node": "^22.0.0",
96
95
  "eslint": "^9.36.0",
97
96
  "tsx": "^4.20.5",