zcf 2.9.1 → 2.9.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
@@ -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.1";
21
+ const version = "2.9.3";
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",
@@ -2111,10 +2117,7 @@ function shouldUpdate(current, latest) {
2111
2117
  }
2112
2118
  async function checkCcrVersion() {
2113
2119
  const currentVersion = await getInstalledVersion("ccr");
2114
- let latestVersion = await getLatestVersion("@musistudio/claude-code-router");
2115
- if (!latestVersion) {
2116
- latestVersion = await getLatestVersion("claude-code-router");
2117
- }
2120
+ const latestVersion = await getLatestVersion("@musistudio/claude-code-router");
2118
2121
  return {
2119
2122
  installed: currentVersion !== null,
2120
2123
  currentVersion,
@@ -2166,11 +2169,7 @@ async function updateCcr(scriptLang, force = false) {
2166
2169
  }
2167
2170
  const updateSpinner = ora(format(i18n.updater.updating, { tool: "CCR" })).start();
2168
2171
  try {
2169
- try {
2170
- await execAsync$2("npm update -g @musistudio/claude-code-router");
2171
- } catch {
2172
- await execAsync$2("npm update -g claude-code-router");
2173
- }
2172
+ await execAsync$2("npm update -g @musistudio/claude-code-router");
2174
2173
  updateSpinner.succeed(format(i18n.updater.updateSuccess, { tool: "CCR" }));
2175
2174
  return true;
2176
2175
  } catch (error) {
@@ -2606,7 +2605,18 @@ async function installCcr(scriptLang) {
2606
2605
  }
2607
2606
  console.log(ansis.cyan(`\u{1F4E6} ${i18n.ccr.installingCcr}`));
2608
2607
  try {
2609
- await execAsync$1("npm install -g claude-code-router --force");
2608
+ await execAsync$1("npm list -g claude-code-router");
2609
+ console.log(ansis.yellow(`\u26A0 ${i18n.ccr.detectedIncorrectPackage}`));
2610
+ try {
2611
+ await execAsync$1("npm uninstall -g claude-code-router");
2612
+ console.log(ansis.green(`\u2714 ${i18n.ccr.uninstalledIncorrectPackage}`));
2613
+ } catch (uninstallError) {
2614
+ console.log(ansis.yellow(`\u26A0 ${i18n.ccr.failedToUninstallIncorrectPackage}`));
2615
+ }
2616
+ } catch {
2617
+ }
2618
+ try {
2619
+ await execAsync$1("npm install -g @musistudio/claude-code-router --force");
2610
2620
  console.log(ansis.green(`\u2714 ${i18n.ccr.ccrInstallSuccess}`));
2611
2621
  } catch (error) {
2612
2622
  if (error.message?.includes("EEXIST")) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zcf",
3
3
  "type": "module",
4
- "version": "2.9.1",
4
+ "version": "2.9.3",
5
5
  "description": "Zero-Config Claude-Code Flow - One-click configuration tool for Claude Code",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/UfoMiao/zcf",