ccg-workflow 3.1.2 → 3.1.3

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
@@ -253,4 +253,4 @@ MIT
253
253
 
254
254
  ---
255
255
 
256
- v3.1.2 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
256
+ v3.1.3 | [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 { B as diagnoseMcpConfig, C as isWindows, D as readClaudeCodeConfig, E as fixWindowsMcpConfig, F as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, G as configMcp, H as version } from './shared/ccg-workflow.CTnUpMWE.mjs';
4
+ import { B as diagnoseMcpConfig, C as isWindows, D as readClaudeCodeConfig, E as fixWindowsMcpConfig, F as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, G as configMcp, H as version } from './shared/ccg-workflow.DCFZF0Bl.mjs';
5
5
  import 'inquirer';
6
6
  import 'ora';
7
7
  import 'node:child_process';
package/dist/index.d.mts CHANGED
@@ -196,6 +196,7 @@ interface UninstallResult {
196
196
  removedAgents: string[];
197
197
  removedSkills: string[];
198
198
  removedRules: boolean;
199
+ removedHooks: boolean;
199
200
  removedBin: boolean;
200
201
  errors: string[];
201
202
  }
package/dist/index.d.ts CHANGED
@@ -196,6 +196,7 @@ interface UninstallResult {
196
196
  removedAgents: string[];
197
197
  removedSkills: string[];
198
198
  removedRules: boolean;
199
+ removedHooks: boolean;
199
200
  removedBin: boolean;
200
201
  errors: string[];
201
202
  }
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as changeLanguage, z as checkForUpdates, A as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, x as getCurrentVersion, y as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, n as installCodexMode, k as installWorkflows, t as migrateToV1_4_0, v as needsMigration, r as readCcgConfig, s as showMainMenu, q as uninstallAceTool, o as uninstallCodexMode, p as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.CTnUpMWE.mjs';
1
+ export { c as changeLanguage, z as checkForUpdates, A as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, x as getCurrentVersion, y as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, n as installCodexMode, k as installWorkflows, t as migrateToV1_4_0, v as needsMigration, r as readCcgConfig, s as showMainMenu, q as uninstallAceTool, o as uninstallCodexMode, p as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.DCFZF0Bl.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'ora';
@@ -10,7 +10,7 @@ import fs from 'fs-extra';
10
10
  import { parse, stringify } from 'smol-toml';
11
11
  import i18next from 'i18next';
12
12
 
13
- const version = "3.1.2";
13
+ const version = "3.1.3";
14
14
 
15
15
  function cmd(id, order, category, name, nameEn, description, descriptionEn, cmdOverride) {
16
16
  return {
@@ -1541,6 +1541,7 @@ async function uninstallWorkflows(installDir, options) {
1541
1541
  removedAgents: [],
1542
1542
  removedSkills: [],
1543
1543
  removedRules: false,
1544
+ removedHooks: false,
1544
1545
  removedBin: false,
1545
1546
  errors: []
1546
1547
  };
@@ -1605,6 +1606,46 @@ async function uninstallWorkflows(installDir, options) {
1605
1606
  result.errors.push(`Failed to remove .ccg directory: ${error}`);
1606
1607
  }
1607
1608
  }
1609
+ const hooksCcgDir = join(installDir, "hooks", "ccg");
1610
+ if (await fs.pathExists(hooksCcgDir)) {
1611
+ try {
1612
+ await fs.remove(hooksCcgDir);
1613
+ result.removedHooks = true;
1614
+ } catch (error) {
1615
+ result.errors.push(`Failed to remove hooks directory: ${error}`);
1616
+ result.success = false;
1617
+ }
1618
+ }
1619
+ const settingsPath = join(installDir, "settings.json");
1620
+ if (await fs.pathExists(settingsPath)) {
1621
+ try {
1622
+ const settings = JSON.parse(await fs.readFile(settingsPath, "utf-8"));
1623
+ const hooks = settings.hooks;
1624
+ if (hooks && typeof hooks === "object") {
1625
+ const isCcgEntry = (h) => {
1626
+ const hHooks = h?.hooks || [];
1627
+ return hHooks.some((hh) => typeof hh?.command === "string" && /hooks[\\/]ccg[\\/]/.test(hh.command));
1628
+ };
1629
+ let modified = false;
1630
+ for (const event of Object.keys(hooks)) {
1631
+ const arr = Array.isArray(hooks[event]) ? hooks[event] : [];
1632
+ const filtered = arr.filter((h) => !isCcgEntry(h));
1633
+ if (filtered.length !== arr.length) {
1634
+ modified = true;
1635
+ if (filtered.length === 0) delete hooks[event];
1636
+ else hooks[event] = filtered;
1637
+ }
1638
+ }
1639
+ if (modified) {
1640
+ if (Object.keys(hooks).length === 0) delete settings.hooks;
1641
+ await fs.writeFile(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
1642
+ result.removedHooks = true;
1643
+ }
1644
+ }
1645
+ } catch (error) {
1646
+ result.errors.push(`Failed to deregister hooks from settings.json: ${error}`);
1647
+ }
1648
+ }
1608
1649
  return result;
1609
1650
  }
1610
1651
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
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",