zcf 2.9.2 → 2.9.4
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 +2 -0
- package/dist/chunks/simple-config.mjs +21 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,6 +97,8 @@ CCR menu options:
|
|
|
97
97
|
|
|
98
98
|
After CCR setup, ZCF automatically configures Claude Code to use CCR as the API proxy.
|
|
99
99
|
|
|
100
|
+
> **Important Note for v2.9.1 Users**: If you have previously used ZCF v2.9.1 to initialize CCR, please re-run the CCR initialization process to ensure the correct `@musistudio/claude-code-router` package is installed. Version 2.9.1 had an incorrect package name that has been fixed in later versions.
|
|
101
|
+
|
|
100
102
|
### Setup Process
|
|
101
103
|
|
|
102
104
|
Full initialization (`npx zcf`) will automatically:
|
|
@@ -18,7 +18,7 @@ import { promisify as promisify$1 } from 'node:util';
|
|
|
18
18
|
import { homedir, platform } from 'node:os';
|
|
19
19
|
import { join as join$2 } from 'node:path';
|
|
20
20
|
|
|
21
|
-
const version = "2.9.
|
|
21
|
+
const version = "2.9.4";
|
|
22
22
|
const homepage = "https://github.com/UfoMiao/zcf";
|
|
23
23
|
|
|
24
24
|
const common$1 = {
|
|
@@ -372,6 +372,9 @@ const ccrMessages$1 = {
|
|
|
372
372
|
ccrInstallSuccess: "Claude Code Router \u5B89\u88C5\u6210\u529F",
|
|
373
373
|
ccrInstallFailed: "\u5B89\u88C5 Claude Code Router \u5931\u8D25",
|
|
374
374
|
ccrAlreadyInstalled: "Claude Code Router \u5DF2\u5B89\u88C5",
|
|
375
|
+
detectedIncorrectPackage: "\u68C0\u6D4B\u5230\u9519\u8BEF\u7684\u5305 claude-code-router\uFF0C\u6B63\u5728\u5378\u8F7D...",
|
|
376
|
+
uninstalledIncorrectPackage: "\u6210\u529F\u5378\u8F7D\u9519\u8BEF\u7684\u5305",
|
|
377
|
+
failedToUninstallIncorrectPackage: "\u5378\u8F7D\u9519\u8BEF\u7684\u5305\u5931\u8D25\uFF0C\u7EE7\u7EED\u5B89\u88C5",
|
|
375
378
|
// Configuration
|
|
376
379
|
configureCcr: "\u914D\u7F6E\u6A21\u578B\u4EE3\u7406 (CCR)",
|
|
377
380
|
useCcrProxy: "\u4F7F\u7528 CCR \u4EE3\u7406",
|
|
@@ -834,6 +837,9 @@ const ccrMessages = {
|
|
|
834
837
|
ccrInstallSuccess: "Claude Code Router installed successfully",
|
|
835
838
|
ccrInstallFailed: "Failed to install Claude Code Router",
|
|
836
839
|
ccrAlreadyInstalled: "Claude Code Router is already installed",
|
|
840
|
+
detectedIncorrectPackage: "Detected incorrect package claude-code-router, uninstalling...",
|
|
841
|
+
uninstalledIncorrectPackage: "Successfully uninstalled incorrect package",
|
|
842
|
+
failedToUninstallIncorrectPackage: "Failed to uninstall incorrect package, continuing with installation",
|
|
837
843
|
// Configuration
|
|
838
844
|
configureCcr: "Configure Model Proxy (CCR)",
|
|
839
845
|
useCcrProxy: "Use CCR Proxy",
|
|
@@ -2591,8 +2597,21 @@ async function isCcrInstalled() {
|
|
|
2591
2597
|
}
|
|
2592
2598
|
async function installCcr(scriptLang) {
|
|
2593
2599
|
const i18n = getTranslation(scriptLang);
|
|
2600
|
+
let hasIncorrectPackage = false;
|
|
2601
|
+
try {
|
|
2602
|
+
await execAsync$1("npm list -g claude-code-router");
|
|
2603
|
+
hasIncorrectPackage = true;
|
|
2604
|
+
console.log(ansis.yellow(`\u26A0 ${i18n.ccr.detectedIncorrectPackage}`));
|
|
2605
|
+
try {
|
|
2606
|
+
await execAsync$1("npm uninstall -g claude-code-router");
|
|
2607
|
+
console.log(ansis.green(`\u2714 ${i18n.ccr.uninstalledIncorrectPackage}`));
|
|
2608
|
+
} catch (uninstallError) {
|
|
2609
|
+
console.log(ansis.yellow(`\u26A0 ${i18n.ccr.failedToUninstallIncorrectPackage}`));
|
|
2610
|
+
}
|
|
2611
|
+
} catch {
|
|
2612
|
+
}
|
|
2594
2613
|
const installed = await isCcrInstalled();
|
|
2595
|
-
if (installed) {
|
|
2614
|
+
if (installed && !hasIncorrectPackage) {
|
|
2596
2615
|
console.log(ansis.green(`\u2714 ${i18n.ccr.ccrAlreadyInstalled}`));
|
|
2597
2616
|
await updateCcr(scriptLang);
|
|
2598
2617
|
return;
|
package/package.json
CHANGED