ccg-workflow 1.7.76 → 1.7.78

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.76 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
355
+ v1.7.78 | [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.76 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [参与贡献](./CONTRIBUTING.md)
355
+ v1.7.78 | [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.Dt7J0_mT.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.CiXIRxs4.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.Dt7J0_mT.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.CiXIRxs4.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.76";
13
+ const version = "1.7.78";
14
14
 
15
15
  function isWindows() {
16
16
  return process.platform === "win32";
@@ -156,6 +156,9 @@ async function diagnoseMcpConfig() {
156
156
  return issues;
157
157
  }
158
158
 
159
+ const GITHUB_REPO = "fengshao1227/ccg-workflow";
160
+ const RELEASE_TAG = "preset";
161
+ const BINARY_DOWNLOAD_URL = `https://github.com/${GITHUB_REPO}/releases/download/${RELEASE_TAG}`;
159
162
  const __filename$2 = fileURLToPath(import.meta.url);
160
163
  const __dirname$2 = dirname(__filename$2);
161
164
  function findPackageRoot$1(startDir) {
@@ -169,6 +172,19 @@ function findPackageRoot$1(startDir) {
169
172
  return startDir;
170
173
  }
171
174
  const PACKAGE_ROOT$1 = findPackageRoot$1(__dirname$2);
175
+ async function downloadBinaryFromRelease(binaryName, destPath) {
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);
185
+ }
186
+ return true;
187
+ }
172
188
  const WORKFLOW_CONFIGS = [
173
189
  {
174
190
  id: "workflow",
@@ -729,13 +745,9 @@ ${workflow.description}
729
745
  result.configPath = commandsDir;
730
746
  return result;
731
747
  }
732
- const srcBinary = join(PACKAGE_ROOT$1, "bin", binaryName);
733
748
  const destBinary = join(binDir, platform === "win32" ? "codeagent-wrapper.exe" : "codeagent-wrapper");
734
- if (await fs.pathExists(srcBinary)) {
735
- await fs.copy(srcBinary, destBinary);
736
- if (platform !== "win32") {
737
- await fs.chmod(destBinary, 493);
738
- }
749
+ const installed = await downloadBinaryFromRelease(binaryName, destBinary);
750
+ if (installed) {
739
751
  try {
740
752
  const { execSync } = await import('node:child_process');
741
753
  execSync(`"${destBinary}" --version`, { stdio: "pipe" });
@@ -746,7 +758,7 @@ ${workflow.description}
746
758
  result.success = false;
747
759
  }
748
760
  } else {
749
- result.errors.push(`Binary not found in package: ${binaryName}`);
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}`);
750
762
  result.success = false;
751
763
  }
752
764
  } catch (error) {
@@ -2477,26 +2489,58 @@ async function installHook(settingsPath) {
2477
2489
  if (await fs.pathExists(settingsPath)) {
2478
2490
  settings = await fs.readJSON(settingsPath);
2479
2491
  }
2492
+ if (isWindows()) {
2493
+ if (settings.hooks?.PreToolUse) {
2494
+ const hookIdx = settings.hooks.PreToolUse.findIndex(
2495
+ (h) => h.matcher === "Bash" && h.hooks?.some((hh) => hh.command?.includes("codeagent-wrapper"))
2496
+ );
2497
+ if (hookIdx >= 0) {
2498
+ settings.hooks.PreToolUse.splice(hookIdx, 1);
2499
+ if (settings.hooks.PreToolUse.length === 0)
2500
+ delete settings.hooks.PreToolUse;
2501
+ if (settings.hooks && Object.keys(settings.hooks).length === 0)
2502
+ delete settings.hooks;
2503
+ }
2504
+ }
2505
+ if (!settings.permissions)
2506
+ settings.permissions = {};
2507
+ if (!settings.permissions.allow)
2508
+ settings.permissions.allow = [];
2509
+ const permEntry = "Bash(codeagent-wrapper*)";
2510
+ if (!settings.permissions.allow.includes(permEntry)) {
2511
+ settings.permissions.allow.push(permEntry);
2512
+ }
2513
+ await fs.writeJSON(settingsPath, settings, { spaces: 2 });
2514
+ return "permission";
2515
+ }
2480
2516
  if (!settings.hooks)
2481
2517
  settings.hooks = {};
2482
2518
  if (!settings.hooks.PreToolUse)
2483
2519
  settings.hooks.PreToolUse = [];
2484
- const existingHook = settings.hooks.PreToolUse.find(
2520
+ 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`;
2521
+ const existingIdx = settings.hooks.PreToolUse.findIndex(
2485
2522
  (h) => h.matcher === "Bash" && h.hooks?.some((hh) => hh.command?.includes("codeagent-wrapper"))
2486
2523
  );
2487
- if (!existingHook) {
2524
+ if (existingIdx >= 0) {
2525
+ const oldCmd = settings.hooks.PreToolUse[existingIdx]?.hooks?.[0]?.command || "";
2526
+ if (oldCmd.includes("exit 1")) {
2527
+ settings.hooks.PreToolUse[existingIdx].hooks[0].command = newCommand;
2528
+ await fs.writeJSON(settingsPath, settings, { spaces: 2 });
2529
+ }
2530
+ } else {
2488
2531
  settings.hooks.PreToolUse.push({
2489
2532
  matcher: "Bash",
2490
2533
  hooks: [
2491
2534
  {
2492
2535
  type: "command",
2493
- command: `jq -r '.tool_input.command' | grep -q 'codeagent-wrapper' && echo '{"hookSpecificOutput": {"hookEventName": "PreToolUse", "permissionDecision": "allow", "permissionDecisionReason": "codeagent-wrapper auto-approved"}}' || exit 1`,
2536
+ command: newCommand,
2494
2537
  timeout: 1
2495
2538
  }
2496
2539
  ]
2497
2540
  });
2498
2541
  await fs.writeJSON(settingsPath, settings, { spaces: 2 });
2499
2542
  }
2543
+ return "hook";
2500
2544
  }
2501
2545
  async function appendGrokSearchPrompt() {
2502
2546
  const rulesDir = join(homedir(), ".claude", "rules");
@@ -2973,9 +3017,13 @@ async function init(options = {}) {
2973
3017
  console.log();
2974
3018
  console.log(` ${ansis.green("\u2713")} API ${ansis.gray(`\u2192 ${settingsPath}`)}`);
2975
3019
  }
2976
- await installHook(settingsPath);
3020
+ const hookMethod = await installHook(settingsPath);
2977
3021
  console.log();
2978
- console.log(` ${ansis.green("\u2713")} ${i18n.t("init:hooks.installed")}`);
3022
+ if (hookMethod === "permission") {
3023
+ console.log(` ${ansis.green("\u2713")} ${i18n.t("init:hooks.installed")} ${ansis.gray("(permissions.allow)")}`);
3024
+ } else {
3025
+ console.log(` ${ansis.green("\u2713")} ${i18n.t("init:hooks.installed")}`);
3026
+ }
2979
3027
  if (wantGrokSearch && (tavilyKey || firecrawlKey || grokApiUrl || grokApiKey)) {
2980
3028
  spinner.text = i18n.t("init:grok.installing");
2981
3029
  const grokResult = await installGrokSearchMcp({
@@ -3019,15 +3067,16 @@ async function init(options = {}) {
3019
3067
  console.log(ansis.gray(` ${codexSyncResult.message}`));
3020
3068
  }
3021
3069
  }
3022
- const hasJq = await checkJqAvailable();
3023
- if (!hasJq) {
3024
- console.log();
3025
- console.log(ansis.yellow(` \u26A0 ${i18n.t("init:hooks.jqNotFound")}`));
3026
- console.log();
3027
- console.log(ansis.cyan(` \u{1F4D6} ${i18n.t("init:hooks.jqInstallHint")}:`));
3028
- console.log(ansis.gray(` ${i18n.t("init:hooks.jqMac")}`));
3029
- console.log(ansis.gray(` ${i18n.t("init:hooks.jqLinux")}`));
3030
- console.log(ansis.gray(` ${i18n.t("init:hooks.jqWindows")}`));
3070
+ if (hookMethod === "hook") {
3071
+ const hasJq = await checkJqAvailable();
3072
+ if (!hasJq) {
3073
+ console.log();
3074
+ console.log(ansis.yellow(` \u26A0 ${i18n.t("init:hooks.jqNotFound")}`));
3075
+ console.log();
3076
+ console.log(ansis.cyan(` \u{1F4D6} ${i18n.t("init:hooks.jqInstallHint")}:`));
3077
+ console.log(ansis.gray(` ${i18n.t("init:hooks.jqMac")}`));
3078
+ console.log(ansis.gray(` ${i18n.t("init:hooks.jqLinux")}`));
3079
+ }
3031
3080
  }
3032
3081
  console.log();
3033
3082
  console.log(ansis.cyan(` ${i18n.t("init:installedCommands")}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.7.76",
3
+ "version": "1.7.78",
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",
@@ -25,7 +25,7 @@
25
25
  "module": "dist/index.mjs",
26
26
  "types": "dist/index.d.mts",
27
27
  "files": [
28
- "bin",
28
+ "bin/ccg.mjs",
29
29
  "dist",
30
30
  "templates/commands/analyze.md",
31
31
  "templates/commands/backend.md",
@@ -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",
Binary file
Binary file
Binary file
Binary file