ccg-workflow 1.7.95 → 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.
|
|
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.
|
|
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.
|
|
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: "Cloudflare
|
|
633
|
-
{ name: "GitHub Release", url: `https://github.com/${GITHUB_REPO}/releases/download/${RELEASE_TAG}`, timeoutMs:
|
|
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
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
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}"
|
package/package.json
CHANGED