ccg-workflow 1.7.94 → 1.7.96

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.Bqgh_sGZ.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.CW80f46-.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.Bqgh_sGZ.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.CW80f46-.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.94";
13
+ const version = "1.7.96";
14
14
 
15
15
  function cmd(id, order, category, name, nameEn, description, descriptionEn, cmdOverride) {
16
16
  return {
@@ -629,36 +629,49 @@ const EXPECTED_BINARY_VERSION = "5.8.0";
629
629
  const GITHUB_REPO = "fengshao1227/ccg-workflow";
630
630
  const RELEASE_TAG = "preset";
631
631
  const BINARY_SOURCES = [
632
- { name: "GitHub Release", url: `https://github.com/${GITHUB_REPO}/releases/download/${RELEASE_TAG}`, timeoutMs: 8e3 },
633
- { name: "Cloudflare R2", url: "https://pub-29270440a0854a49bf1589cd3662c067.r2.dev/preset", timeoutMs: 6e4 }
632
+ { name: "Cloudflare CDN", url: "https://github.20031227.xyz/preset", timeoutMs: 3e4 },
633
+ { name: "GitHub Release", url: `https://github.com/${GITHUB_REPO}/releases/download/${RELEASE_TAG}`, timeoutMs: 12e4 }
634
634
  ];
635
635
  async function downloadFromUrl(url, destPath, timeoutMs, maxAttempts = 2) {
636
+ const timeoutSec = Math.ceil(timeoutMs / 1e3);
636
637
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
637
638
  try {
638
- const controller = new AbortController();
639
- const timer = setTimeout(() => controller.abort(), timeoutMs);
640
- const response = await fetch(url, { redirect: "follow", signal: controller.signal });
641
- if (!response.ok) {
639
+ const { execSync } = await import('node:child_process');
640
+ execSync(
641
+ `curl -fsSL --max-time ${timeoutSec} -o "${destPath}" "${url}"`,
642
+ { stdio: "pipe", timeout: timeoutMs + 5e3 }
643
+ );
644
+ if (process.platform !== "win32") {
645
+ await fs.chmod(destPath, 493);
646
+ }
647
+ return true;
648
+ } catch {
649
+ try {
650
+ const controller = new AbortController();
651
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
652
+ const response = await fetch(url, { redirect: "follow", signal: controller.signal });
653
+ if (!response.ok) {
654
+ clearTimeout(timer);
655
+ if (attempt < maxAttempts) {
656
+ await new Promise((resolve) => setTimeout(resolve, attempt * 2e3));
657
+ continue;
658
+ }
659
+ return false;
660
+ }
661
+ const buffer = Buffer.from(await response.arrayBuffer());
642
662
  clearTimeout(timer);
663
+ await fs.writeFile(destPath, buffer);
664
+ if (process.platform !== "win32") {
665
+ await fs.chmod(destPath, 493);
666
+ }
667
+ return true;
668
+ } catch {
643
669
  if (attempt < maxAttempts) {
644
670
  await new Promise((resolve) => setTimeout(resolve, attempt * 2e3));
645
671
  continue;
646
672
  }
647
673
  return false;
648
674
  }
649
- const buffer = Buffer.from(await response.arrayBuffer());
650
- clearTimeout(timer);
651
- await fs.writeFile(destPath, buffer);
652
- if (process.platform !== "win32") {
653
- await fs.chmod(destPath, 493);
654
- }
655
- return true;
656
- } catch {
657
- if (attempt < maxAttempts) {
658
- await new Promise((resolve) => setTimeout(resolve, attempt * 2e3));
659
- continue;
660
- }
661
- return false;
662
675
  }
663
676
  }
664
677
  return false;
@@ -710,8 +723,8 @@ async function installCommandFiles(ctx, workflowIds) {
710
723
  content = injectConfigVariables(content, ctx.config);
711
724
  content = replaceHomePathsInTemplate(content, ctx.installDir);
712
725
  await fs.writeFile(destFile, content, "utf-8");
713
- ctx.result.installedCommands.push(cmd);
714
726
  }
727
+ ctx.result.installedCommands.push(cmd);
715
728
  } else {
716
729
  const placeholder = `---
717
730
  description: "${workflow.descriptionEn}"
@@ -885,6 +898,19 @@ async function verifyBinary(installDir) {
885
898
  return false;
886
899
  }
887
900
  }
901
+ async function verifyBinaryVersion(installDir) {
902
+ const binDir = join(installDir, "bin");
903
+ const wrapperName = process.platform === "win32" ? "codeagent-wrapper.exe" : "codeagent-wrapper";
904
+ const wrapperPath = join(binDir, wrapperName);
905
+ try {
906
+ const { execSync } = await import('node:child_process');
907
+ const output = execSync(`"${wrapperPath}" --version`, { stdio: "pipe" }).toString().trim();
908
+ const version = output.replace(/^.*version\s*/, "");
909
+ return version === EXPECTED_BINARY_VERSION;
910
+ } catch {
911
+ return false;
912
+ }
913
+ }
888
914
  function showBinaryDownloadWarning(binDir) {
889
915
  const binaryExt = process.platform === "win32" ? ".exe" : "";
890
916
  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";
@@ -1083,6 +1109,32 @@ async function uninstallWorkflows(installDir, options) {
1083
1109
  return result;
1084
1110
  }
1085
1111
 
1112
+ const installer = {
1113
+ __proto__: null,
1114
+ getAllCommandIds: getAllCommandIds,
1115
+ getWorkflowById: getWorkflowById,
1116
+ getWorkflowConfigs: getWorkflowConfigs,
1117
+ injectConfigVariables: injectConfigVariables,
1118
+ installAceTool: installAceTool,
1119
+ installAceToolRs: installAceToolRs,
1120
+ installContextWeaver: installContextWeaver,
1121
+ installFastContext: installFastContext,
1122
+ installMcpServer: installMcpServer,
1123
+ installWorkflows: installWorkflows,
1124
+ removeFastContextPrompt: removeFastContextPrompt,
1125
+ showBinaryDownloadWarning: showBinaryDownloadWarning,
1126
+ syncMcpToCodex: syncMcpToCodex,
1127
+ syncMcpToGemini: syncMcpToGemini,
1128
+ uninstallAceTool: uninstallAceTool,
1129
+ uninstallContextWeaver: uninstallContextWeaver,
1130
+ uninstallFastContext: uninstallFastContext,
1131
+ uninstallMcpServer: uninstallMcpServer,
1132
+ uninstallWorkflows: uninstallWorkflows,
1133
+ verifyBinary: verifyBinary,
1134
+ verifyBinaryVersion: verifyBinaryVersion,
1135
+ writeFastContextPrompt: writeFastContextPrompt
1136
+ };
1137
+
1086
1138
  async function syncMcpMirrors() {
1087
1139
  const [codex, gemini] = await Promise.all([syncMcpToCodex(), syncMcpToGemini()]);
1088
1140
  const synced = [];
@@ -3494,6 +3546,12 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
3494
3546
  }
3495
3547
  if (!await verifyBinary(installDir)) {
3496
3548
  showBinaryDownloadWarning(join(installDir, "bin"));
3549
+ } else {
3550
+ const { verifyBinaryVersion } = await Promise.resolve().then(function () { return installer; });
3551
+ const versionOk = await verifyBinaryVersion(installDir);
3552
+ if (!versionOk) {
3553
+ showBinaryDownloadWarning(join(installDir, "bin"));
3554
+ }
3497
3555
  }
3498
3556
  } else {
3499
3557
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.7.94",
3
+ "version": "1.7.96",
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",