zcf 3.6.7 → 3.6.8
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/chunks/features.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
1
2
|
import ansis from 'ansis';
|
|
2
3
|
import inquirer from 'inquirer';
|
|
3
4
|
import { al as i18n, ak as ensureI18nInitialized, x as SUPPORTED_LANGS, am as addNumbersToChoices, y as LANG_LABELS, aB as updateZcfConfig, aC as changeLanguage, aD as readZcfConfig, ao as promptBoolean, o as openSettingsJson, d as importRecommendedPermissions, b as importRecommendedEnv, a1 as applyAiLanguageDirective, aE as configureOutputStyle, $ as getExistingModelConfig, X as updateCustomModel, Y as updateDefaultModel, aF as isWindows, F as readMcpConfig, K as fixWindowsMcpConfig, G as writeMcpConfig, aG as selectMcpServices, H as backupMcpConfig, aH as getMcpServices, J as buildMcpServerConfig, I as mergeMcpServers, aI as isCcrInstalled, aJ as installCcr, aK as setupCcrConfiguration, a0 as getExistingApiConfig, a3 as promptApiConfigurationAction, aL as modifyApiConfigPartially, an as validateApiKey, V as configureApi, aM as formatApiKeyDisplay, a2 as switchToOfficialLogin } from './simple-config.mjs';
|
|
4
5
|
import 'node:fs';
|
|
5
|
-
import 'node:process';
|
|
6
6
|
import 'node:child_process';
|
|
7
7
|
import 'node:os';
|
|
8
8
|
import 'node:util';
|
|
@@ -26,6 +26,14 @@ async function handleOfficialLoginMode() {
|
|
|
26
26
|
ensureI18nInitialized();
|
|
27
27
|
const success = switchToOfficialLogin();
|
|
28
28
|
if (success) {
|
|
29
|
+
const { ClaudeCodeConfigManager } = await import('./claude-code-config-manager.mjs');
|
|
30
|
+
const syncResult = await ClaudeCodeConfigManager.switchToOfficial();
|
|
31
|
+
if (!syncResult.success) {
|
|
32
|
+
console.error(ansis.red(i18n.t("api:officialLoginFailed")));
|
|
33
|
+
if (process.env.DEBUG) {
|
|
34
|
+
console.error(ansis.gray(syncResult.error));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
29
37
|
console.log(ansis.green(`\u2714 ${i18n.t("api:officialLoginConfigured")}`));
|
|
30
38
|
} else {
|
|
31
39
|
console.log(ansis.red(i18n.t("api:officialLoginFailed")));
|
|
@@ -131,6 +139,14 @@ async function handleCcrProxyMode() {
|
|
|
131
139
|
}
|
|
132
140
|
const ccrConfigured = await setupCcrConfiguration();
|
|
133
141
|
if (ccrConfigured) {
|
|
142
|
+
const { ClaudeCodeConfigManager } = await import('./claude-code-config-manager.mjs');
|
|
143
|
+
const result = await ClaudeCodeConfigManager.switchToCcr();
|
|
144
|
+
if (!result.success) {
|
|
145
|
+
console.error(ansis.red(i18n.t("ccr:ccrConfigFailed")));
|
|
146
|
+
if (process.env.DEBUG) {
|
|
147
|
+
console.error(ansis.gray(result.error));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
134
150
|
console.log(ansis.green(`\u2714 ${i18n.t("ccr:ccrSetupComplete")}`));
|
|
135
151
|
}
|
|
136
152
|
}
|
|
@@ -18,7 +18,7 @@ import { rm, mkdir, copyFile as copyFile$1 } from 'node:fs/promises';
|
|
|
18
18
|
import i18next from 'i18next';
|
|
19
19
|
import Backend from 'i18next-fs-backend';
|
|
20
20
|
|
|
21
|
-
const version = "3.6.
|
|
21
|
+
const version = "3.6.8";
|
|
22
22
|
const homepage = "https://github.com/UfoMiao/zcf";
|
|
23
23
|
|
|
24
24
|
const i18n = i18next.createInstance();
|
|
@@ -5636,6 +5636,14 @@ async function configureApiCompletely(preselectedAuthType) {
|
|
|
5636
5636
|
if (authType === "official") {
|
|
5637
5637
|
const success = switchToOfficialLogin$1();
|
|
5638
5638
|
if (success) {
|
|
5639
|
+
const { ClaudeCodeConfigManager } = await import('./claude-code-config-manager.mjs');
|
|
5640
|
+
const syncResult = await ClaudeCodeConfigManager.switchToOfficial();
|
|
5641
|
+
if (!syncResult.success) {
|
|
5642
|
+
console.error(ansis.red(i18n.t("api:officialLoginFailed")));
|
|
5643
|
+
if (process.env.DEBUG) {
|
|
5644
|
+
console.error(ansis.gray(syncResult.error));
|
|
5645
|
+
}
|
|
5646
|
+
}
|
|
5639
5647
|
return null;
|
|
5640
5648
|
} else {
|
|
5641
5649
|
console.log(ansis.red(i18n.t("api:officialLoginFailed")));
|
|
@@ -7193,6 +7201,14 @@ async function init(options = {}) {
|
|
|
7193
7201
|
console.log(ansis.green(`\u2714 ${i18n.t("ccr:ccrConfigSuccess")}`));
|
|
7194
7202
|
await configureCcrProxy(defaultCcrConfig);
|
|
7195
7203
|
console.log(ansis.green(`\u2714 ${i18n.t("ccr:proxyConfigSuccess")}`));
|
|
7204
|
+
const { ClaudeCodeConfigManager } = await import('./claude-code-config-manager.mjs');
|
|
7205
|
+
const ccrResult = await ClaudeCodeConfigManager.switchToCcr();
|
|
7206
|
+
if (!ccrResult.success) {
|
|
7207
|
+
console.error(ansis.red(i18n.t("ccr:ccrConfigFailed")));
|
|
7208
|
+
if (process.env.DEBUG) {
|
|
7209
|
+
console.error(ansis.gray(ccrResult.error));
|
|
7210
|
+
}
|
|
7211
|
+
}
|
|
7196
7212
|
try {
|
|
7197
7213
|
addCompletedOnboarding();
|
|
7198
7214
|
} catch (error) {
|
|
@@ -7207,6 +7223,14 @@ async function init(options = {}) {
|
|
|
7207
7223
|
case "official": {
|
|
7208
7224
|
const success = switchToOfficialLogin$1();
|
|
7209
7225
|
if (success) {
|
|
7226
|
+
const { ClaudeCodeConfigManager } = await import('./claude-code-config-manager.mjs');
|
|
7227
|
+
const syncResult = await ClaudeCodeConfigManager.switchToOfficial();
|
|
7228
|
+
if (!syncResult.success) {
|
|
7229
|
+
console.error(ansis.red(i18n.t("api:officialLoginFailed")));
|
|
7230
|
+
if (process.env.DEBUG) {
|
|
7231
|
+
console.error(ansis.gray(syncResult.error));
|
|
7232
|
+
}
|
|
7233
|
+
}
|
|
7210
7234
|
console.log(ansis.green(`\u2714 ${i18n.t("api:officialLoginConfigured")}`));
|
|
7211
7235
|
apiConfig = null;
|
|
7212
7236
|
} else {
|
|
@@ -7226,6 +7250,14 @@ async function init(options = {}) {
|
|
|
7226
7250
|
}
|
|
7227
7251
|
const ccrConfigured = await setupCcrConfiguration();
|
|
7228
7252
|
if (ccrConfigured) {
|
|
7253
|
+
const { ClaudeCodeConfigManager } = await import('./claude-code-config-manager.mjs');
|
|
7254
|
+
const ccrResult = await ClaudeCodeConfigManager.switchToCcr();
|
|
7255
|
+
if (!ccrResult.success) {
|
|
7256
|
+
console.error(ansis.red(i18n.t("ccr:ccrConfigFailed")));
|
|
7257
|
+
if (process.env.DEBUG) {
|
|
7258
|
+
console.error(ansis.gray(ccrResult.error));
|
|
7259
|
+
}
|
|
7260
|
+
}
|
|
7229
7261
|
console.log(ansis.green(`\u2714 ${i18n.t("ccr:ccrSetupComplete")}`));
|
|
7230
7262
|
apiConfig = null;
|
|
7231
7263
|
}
|