ccg-workflow 1.7.88 → 1.7.89

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/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.ZTLL0ziy.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.BF0FhMt8.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.ZTLL0ziy.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.BF0FhMt8.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.88";
13
+ const version = "1.7.89";
14
14
 
15
15
  function cmd(id, order, category, name, nameEn, description, descriptionEn, cmdOverride) {
16
16
  return {
@@ -2460,72 +2460,40 @@ async function needsMigration() {
2460
2460
  return hasOldCcgDir || hasOldPromptsDir || hasOldConfigFile;
2461
2461
  }
2462
2462
 
2463
- async function checkJqAvailable() {
2464
- try {
2465
- const { execSync } = await import('node:child_process');
2466
- execSync("jq --version", { stdio: "pipe" });
2467
- return true;
2468
- } catch {
2469
- return false;
2470
- }
2471
- }
2472
2463
  async function installHook(settingsPath) {
2473
2464
  let settings = {};
2474
2465
  if (await fs.pathExists(settingsPath)) {
2475
2466
  settings = await fs.readJSON(settingsPath);
2476
2467
  }
2477
- if (isWindows()) {
2478
- if (settings.hooks?.PreToolUse) {
2479
- const hookIdx = settings.hooks.PreToolUse.findIndex(
2480
- (h) => h.matcher === "Bash" && h.hooks?.some((hh) => hh.command?.includes("codeagent-wrapper"))
2481
- );
2482
- if (hookIdx >= 0) {
2483
- settings.hooks.PreToolUse.splice(hookIdx, 1);
2484
- if (settings.hooks.PreToolUse.length === 0)
2485
- delete settings.hooks.PreToolUse;
2486
- if (settings.hooks && Object.keys(settings.hooks).length === 0)
2487
- delete settings.hooks;
2488
- }
2489
- }
2490
- if (!settings.permissions)
2491
- settings.permissions = {};
2492
- if (!settings.permissions.allow)
2493
- settings.permissions.allow = [];
2494
- const permEntry = "Bash(codeagent-wrapper*)";
2495
- if (!settings.permissions.allow.includes(permEntry)) {
2496
- settings.permissions.allow.push(permEntry);
2468
+ if (settings.hooks?.PreToolUse) {
2469
+ const hookIdx = settings.hooks.PreToolUse.findIndex(
2470
+ (h) => h.matcher === "Bash" && h.hooks?.some((hh) => hh.command?.includes("codeagent-wrapper"))
2471
+ );
2472
+ if (hookIdx >= 0) {
2473
+ settings.hooks.PreToolUse.splice(hookIdx, 1);
2474
+ if (settings.hooks.PreToolUse.length === 0)
2475
+ delete settings.hooks.PreToolUse;
2476
+ if (settings.hooks && Object.keys(settings.hooks).length === 0)
2477
+ delete settings.hooks;
2497
2478
  }
2498
- await fs.writeJSON(settingsPath, settings, { spaces: 2 });
2499
- return "permission";
2500
- }
2501
- if (!settings.hooks)
2502
- settings.hooks = {};
2503
- if (!settings.hooks.PreToolUse)
2504
- settings.hooks.PreToolUse = [];
2505
- 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`;
2506
- const existingIdx = settings.hooks.PreToolUse.findIndex(
2507
- (h) => h.matcher === "Bash" && h.hooks?.some((hh) => hh.command?.includes("codeagent-wrapper"))
2508
- );
2509
- if (existingIdx >= 0) {
2510
- const oldCmd = settings.hooks.PreToolUse[existingIdx]?.hooks?.[0]?.command || "";
2511
- if (oldCmd.includes("exit 1")) {
2512
- settings.hooks.PreToolUse[existingIdx].hooks[0].command = newCommand;
2513
- await fs.writeJSON(settingsPath, settings, { spaces: 2 });
2479
+ }
2480
+ if (settings.permissions?.allow) {
2481
+ const oldEntry = "Bash(codeagent-wrapper*)";
2482
+ const oldIdx = settings.permissions.allow.indexOf(oldEntry);
2483
+ if (oldIdx >= 0) {
2484
+ settings.permissions.allow.splice(oldIdx, 1);
2514
2485
  }
2515
- } else {
2516
- settings.hooks.PreToolUse.push({
2517
- matcher: "Bash",
2518
- hooks: [
2519
- {
2520
- type: "command",
2521
- command: newCommand,
2522
- timeout: 1
2523
- }
2524
- ]
2525
- });
2526
- await fs.writeJSON(settingsPath, settings, { spaces: 2 });
2527
2486
  }
2528
- return "hook";
2487
+ if (!settings.permissions)
2488
+ settings.permissions = {};
2489
+ if (!settings.permissions.allow)
2490
+ settings.permissions.allow = [];
2491
+ const permEntry = "Bash(*codeagent-wrapper*)";
2492
+ if (!settings.permissions.allow.includes(permEntry)) {
2493
+ settings.permissions.allow.push(permEntry);
2494
+ }
2495
+ await fs.writeJSON(settingsPath, settings, { spaces: 2 });
2496
+ return "permission";
2529
2497
  }
2530
2498
  async function appendGrokSearchPrompt() {
2531
2499
  const rulesDir = join(homedir(), ".claude", "rules");
@@ -3070,13 +3038,9 @@ async function init(options = {}) {
3070
3038
  console.log();
3071
3039
  console.log(` ${ansis.green("\u2713")} API ${ansis.gray(`\u2192 ${settingsPath}`)}`);
3072
3040
  }
3073
- const hookMethod = await installHook(settingsPath);
3041
+ await installHook(settingsPath);
3074
3042
  console.log();
3075
- if (hookMethod === "permission") {
3076
- console.log(` ${ansis.green("\u2713")} ${i18n.t("init:hooks.installed")} ${ansis.gray("(permissions.allow)")}`);
3077
- } else {
3078
- console.log(` ${ansis.green("\u2713")} ${i18n.t("init:hooks.installed")}`);
3079
- }
3043
+ console.log(` ${ansis.green("\u2713")} ${i18n.t("init:hooks.installed")} ${ansis.gray("(permissions.allow)")}`);
3080
3044
  if (wantGrokSearch && (tavilyKey || firecrawlKey || grokApiUrl || grokApiKey)) {
3081
3045
  spinner.text = i18n.t("init:grok.installing");
3082
3046
  const grokResult = await installGrokSearchMcp({
@@ -3129,17 +3093,6 @@ async function init(options = {}) {
3129
3093
  console.log(ansis.gray(` ${geminiSyncResult.message}`));
3130
3094
  }
3131
3095
  }
3132
- if (hookMethod === "hook") {
3133
- const hasJq = await checkJqAvailable();
3134
- if (!hasJq) {
3135
- console.log();
3136
- console.log(ansis.yellow(` \u26A0 ${i18n.t("init:hooks.jqNotFound")}`));
3137
- console.log();
3138
- console.log(ansis.cyan(` \u{1F4D6} ${i18n.t("init:hooks.jqInstallHint")}:`));
3139
- console.log(ansis.gray(` ${i18n.t("init:hooks.jqMac")}`));
3140
- console.log(ansis.gray(` ${i18n.t("init:hooks.jqLinux")}`));
3141
- }
3142
- }
3143
3096
  console.log();
3144
3097
  console.log(ansis.cyan(` ${i18n.t("init:installedCommands")}`));
3145
3098
  result.installedCommands.forEach((cmd) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.7.88",
3
+ "version": "1.7.89",
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",
@@ -62,11 +62,11 @@ description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP 工具'
62
62
  - **工作目录**:`{{WORKDIR}}` 替换为目标工作目录的绝对路径。如果用户通过 `/add-dir` 添加了多个工作区,先确定任务相关的工作区。
63
63
  - Test Codex backend:
64
64
  ```bash
65
- ~/.claude/bin/codeagent-wrapper --backend codex - "{{WORKDIR}}" <<< "echo test"
65
+ echo "echo test" | ~/.claude/bin/codeagent-wrapper --backend codex - "{{WORKDIR}}"
66
66
  ```
67
67
  - Test Gemini backend:
68
68
  ```bash
69
- ~/.claude/bin/codeagent-wrapper --backend gemini --gemini-model gemini-3.1-pro-preview - "{{WORKDIR}}" <<< "echo test"
69
+ echo "echo test" | ~/.claude/bin/codeagent-wrapper --backend gemini --gemini-model gemini-3.1-pro-preview - "{{WORKDIR}}"
70
70
  ```
71
71
  - For each unavailable tool, display warning with installation instructions.
72
72