ccjk 14.1.2 → 14.1.5
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/api-cli.mjs +5 -5
- package/dist/chunks/api-config-selector.mjs +18 -5
- package/dist/chunks/api-providers.mjs +24 -9
- package/dist/chunks/auto-updater.mjs +13 -13
- package/dist/chunks/boost.mjs +1 -1
- package/dist/chunks/ccjk-all.mjs +4 -4
- package/dist/chunks/ccjk-config.mjs +78 -1
- package/dist/chunks/ccjk-mcp.mjs +4 -4
- package/dist/chunks/ccjk-setup.mjs +4 -4
- package/dist/chunks/ccr.mjs +11 -11
- package/dist/chunks/check-updates.mjs +3 -3
- package/dist/chunks/claude-code-incremental-manager.mjs +8 -6
- package/dist/chunks/claude-config.mjs +73 -0
- package/dist/chunks/claude-wrapper.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +76 -1
- package/dist/chunks/code-type-resolver.mjs +14 -13
- package/dist/chunks/codex-config-switch.mjs +2 -2
- package/dist/chunks/codex-provider-manager.mjs +2 -2
- package/dist/chunks/codex.mjs +3 -3
- package/dist/chunks/config-switch.mjs +5 -5
- package/dist/chunks/config.mjs +531 -158
- package/dist/chunks/config2.mjs +22 -20
- package/dist/chunks/config3.mjs +6 -6
- package/dist/chunks/constants.mjs +20 -13
- package/dist/chunks/doctor.mjs +1 -1
- package/dist/chunks/features.mjs +59 -4
- package/dist/chunks/fs-operations.mjs +2 -14
- package/dist/chunks/index.mjs +1 -1
- package/dist/chunks/index10.mjs +115 -100
- package/dist/chunks/init.mjs +121 -53
- package/dist/chunks/installer.mjs +28 -21
- package/dist/chunks/mcp-cli.mjs +6 -6
- package/dist/chunks/mcp.mjs +6 -6
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/platform.mjs +3 -3
- package/dist/chunks/prompts.mjs +9 -7
- package/dist/chunks/quick-actions.mjs +1 -1
- package/dist/chunks/quick-provider.mjs +23 -31
- package/dist/chunks/quick-setup.mjs +3 -4
- package/dist/chunks/simple-config.mjs +57 -16
- package/dist/chunks/slash-commands.mjs +1 -1
- package/dist/chunks/smart-guide.mjs +23 -10
- package/dist/chunks/status.mjs +28 -24
- package/dist/chunks/update.mjs +19 -18
- package/dist/chunks/upgrade.mjs +88 -5
- package/dist/chunks/version-checker.mjs +2 -2
- package/dist/chunks/zero-config.mjs +121 -16
- package/dist/cli.mjs +50 -27
- package/dist/i18n/locales/en/configuration.json +5 -3
- package/dist/i18n/locales/en/language.json +1 -1
- package/dist/i18n/locales/en/menu.json +8 -7
- package/dist/i18n/locales/en/multi-config.json +1 -1
- package/dist/i18n/locales/zh-CN/configuration.json +5 -3
- package/dist/i18n/locales/zh-CN/language.json +1 -1
- package/dist/i18n/locales/zh-CN/menu.json +8 -7
- package/dist/i18n/locales/zh-CN/multi-config.json +1 -1
- package/dist/index.d.mts +13 -11
- package/dist/index.d.ts +13 -11
- package/dist/index.mjs +7 -7
- package/dist/shared/{ccjk.B6VCKdyy.mjs → ccjk.BXTrU9TN.mjs} +31 -68
- package/dist/shared/{ccjk.DScm_NnL.mjs → ccjk.Ccrqt7u2.mjs} +30 -1
- package/dist/shared/{ccjk.CVjfbEIj.mjs → ccjk.DZtwozOG.mjs} +1 -1
- package/dist/shared/{ccjk.D6wx-rxT.mjs → ccjk.Dxgd2vjc.mjs} +3 -3
- package/dist/shared/{ccjk.BO45TPXJ.mjs → ccjk.K8c6VnM2.mjs} +2 -2
- package/dist/shared/{ccjk.BJENIVf7.mjs → ccjk.MpkxXQJL.mjs} +179 -19
- package/dist/shared/{ccjk.Dh6Be-ef.mjs → ccjk.ygJzcD-n.mjs} +28 -24
- package/package.json +1 -30
- package/dist/chunks/auto-fix.mjs +0 -253
- package/dist/chunks/auto-init.mjs +0 -311
- package/dist/chunks/auto-upgrade.mjs +0 -152
- package/dist/chunks/migrator.mjs +0 -178
- package/dist/shared/ccjk.DDq2hqA5.mjs +0 -158
- package/dist/shared/ccjk.KPLeMP-o.mjs +0 -79
- package/templates/common/workflow/essential/en/agents/planner.md +0 -116
- package/templates/common/workflow/essential/zh-CN/agents/planner.md +0 -116
package/dist/chunks/config2.mjs
CHANGED
|
@@ -6,10 +6,10 @@ import { promisify } from 'node:util';
|
|
|
6
6
|
import a from './index5.mjs';
|
|
7
7
|
import { d as dayjs } from '../shared/ccjk.RyizuzOI.mjs';
|
|
8
8
|
import { i as inquirer } from './index6.mjs';
|
|
9
|
-
import { SETTINGS_FILE } from './constants.mjs';
|
|
10
9
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
11
|
-
import {
|
|
10
|
+
import { n as clearLegacyTopLevelRuntimeSettings, o as setPrimaryApiKey, q as addCompletedOnboarding, b as backupExistingConfig } from './config.mjs';
|
|
12
11
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
12
|
+
import { r as resolveClaudeFamilySettingsTarget } from '../shared/ccjk.Ccrqt7u2.mjs';
|
|
13
13
|
import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
|
|
14
14
|
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
15
15
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
@@ -26,16 +26,16 @@ import 'node:crypto';
|
|
|
26
26
|
import 'buffer';
|
|
27
27
|
import 'string_decoder';
|
|
28
28
|
import 'node:url';
|
|
29
|
+
import './constants.mjs';
|
|
30
|
+
import './ccjk-config.mjs';
|
|
31
|
+
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
32
|
+
import './index3.mjs';
|
|
33
|
+
import './fs-operations.mjs';
|
|
34
|
+
import 'node:fs/promises';
|
|
29
35
|
import './platform.mjs';
|
|
30
36
|
import './main.mjs';
|
|
31
37
|
import 'module';
|
|
32
38
|
import 'node:stream';
|
|
33
|
-
import './fs-operations.mjs';
|
|
34
|
-
import 'node:fs/promises';
|
|
35
|
-
import '../shared/ccjk.DScm_NnL.mjs';
|
|
36
|
-
import './ccjk-config.mjs';
|
|
37
|
-
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
38
|
-
import './index3.mjs';
|
|
39
39
|
import '../shared/ccjk.DeWpAShp.mjs';
|
|
40
40
|
|
|
41
41
|
const PROVIDER_PRESETS_URL = "https://pub-0dc3e1677e894f07bbea11b17a29e032.r2.dev/providers.json";
|
|
@@ -223,20 +223,22 @@ function writeCcrConfig(config) {
|
|
|
223
223
|
ensureCcrConfigDir();
|
|
224
224
|
writeJsonConfig(CCR_CONFIG_FILE, config);
|
|
225
225
|
}
|
|
226
|
-
async function configureCcrProxy(ccrConfig) {
|
|
227
|
-
const
|
|
226
|
+
async function configureCcrProxy(ccrConfig, codeTool) {
|
|
227
|
+
const target = resolveClaudeFamilySettingsTarget(codeTool);
|
|
228
|
+
const settings = readJsonConfig(target.settingsFile) || {};
|
|
228
229
|
const host = ccrConfig.HOST || "127.0.0.1";
|
|
229
230
|
const port = ccrConfig.PORT || 3456;
|
|
230
231
|
const apiKey = ccrConfig.APIKEY || "sk-ccjk-x-ccr";
|
|
231
232
|
if (!settings.env) {
|
|
232
233
|
settings.env = {};
|
|
233
234
|
}
|
|
235
|
+
clearLegacyTopLevelRuntimeSettings(settings);
|
|
234
236
|
delete settings.env.ANTHROPIC_AUTH_TOKEN;
|
|
235
237
|
settings.env.ANTHROPIC_BASE_URL = `http://${host}:${port}`;
|
|
236
238
|
settings.env.ANTHROPIC_API_KEY = apiKey;
|
|
237
|
-
writeJsonConfig(
|
|
239
|
+
writeJsonConfig(target.settingsFile, settings);
|
|
238
240
|
try {
|
|
239
|
-
setPrimaryApiKey();
|
|
241
|
+
setPrimaryApiKey(target.codeTool);
|
|
240
242
|
} catch (error) {
|
|
241
243
|
ensureI18nInitialized();
|
|
242
244
|
console.error(i18n.t("mcp:primaryApiKeySetFailed"), error);
|
|
@@ -394,7 +396,7 @@ function createDefaultCcrConfig() {
|
|
|
394
396
|
// Empty router configuration - user configures in UI
|
|
395
397
|
};
|
|
396
398
|
}
|
|
397
|
-
async function setupCcrConfiguration() {
|
|
399
|
+
async function setupCcrConfiguration(codeTool) {
|
|
398
400
|
ensureI18nInitialized();
|
|
399
401
|
try {
|
|
400
402
|
const existingConfig = readCcrConfig();
|
|
@@ -415,11 +417,11 @@ async function setupCcrConfiguration() {
|
|
|
415
417
|
}
|
|
416
418
|
if (!shouldBackupAndReconfigure) {
|
|
417
419
|
console.log(a.yellow(`${i18n.t("ccr:keepingExistingConfig")}`));
|
|
418
|
-
await configureCcrProxy(existingConfig);
|
|
420
|
+
await configureCcrProxy(existingConfig, codeTool);
|
|
419
421
|
try {
|
|
420
|
-
const { manageApiKeyApproval } = await import('./config.mjs').then(function (n) { return n.
|
|
422
|
+
const { manageApiKeyApproval } = await import('./config.mjs').then(function (n) { return n.H; });
|
|
421
423
|
const apiKey = existingConfig.APIKEY || "sk-ccjk-x-ccr";
|
|
422
|
-
manageApiKeyApproval(apiKey);
|
|
424
|
+
manageApiKeyApproval(apiKey, resolveClaudeFamilySettingsTarget(codeTool).codeTool);
|
|
423
425
|
console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
|
|
424
426
|
} catch (error) {
|
|
425
427
|
console.error(a.red(`${i18n.t("ccr:apiKeyApprovalFailed")}:`), error);
|
|
@@ -441,19 +443,19 @@ async function setupCcrConfiguration() {
|
|
|
441
443
|
}
|
|
442
444
|
writeCcrConfig(config);
|
|
443
445
|
console.log(a.green(`\u2714 ${i18n.t("ccr:ccrConfigSuccess")}`));
|
|
444
|
-
await configureCcrProxy(config);
|
|
446
|
+
await configureCcrProxy(config, codeTool);
|
|
445
447
|
console.log(a.green(`\u2714 ${i18n.t("ccr:proxyConfigSuccess")}`));
|
|
446
448
|
await restartAndCheckCcrStatus();
|
|
447
449
|
await showConfigurationTips(config.APIKEY);
|
|
448
450
|
try {
|
|
449
|
-
addCompletedOnboarding();
|
|
451
|
+
addCompletedOnboarding(resolveClaudeFamilySettingsTarget(codeTool).codeTool);
|
|
450
452
|
} catch (error) {
|
|
451
453
|
console.error(a.red(i18n.t("errors:failedToSetOnboarding")), error);
|
|
452
454
|
}
|
|
453
455
|
try {
|
|
454
|
-
const { manageApiKeyApproval } = await import('./config.mjs').then(function (n) { return n.
|
|
456
|
+
const { manageApiKeyApproval } = await import('./config.mjs').then(function (n) { return n.H; });
|
|
455
457
|
const apiKey = config.APIKEY || "sk-ccjk-x-ccr";
|
|
456
|
-
manageApiKeyApproval(apiKey);
|
|
458
|
+
manageApiKeyApproval(apiKey, resolveClaudeFamilySettingsTarget(codeTool).codeTool);
|
|
457
459
|
console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
|
|
458
460
|
} catch (error) {
|
|
459
461
|
console.error(a.red(`${i18n.t("ccr:apiKeyApprovalFailed")}:`), error);
|
package/dist/chunks/config3.mjs
CHANGED
|
@@ -21,21 +21,21 @@ import 'node:os';
|
|
|
21
21
|
import 'node:crypto';
|
|
22
22
|
import 'buffer';
|
|
23
23
|
import 'string_decoder';
|
|
24
|
-
import 'node:url';
|
|
25
24
|
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
25
|
+
import 'node:url';
|
|
26
26
|
import '../shared/ccjk.RyizuzOI.mjs';
|
|
27
|
-
import './
|
|
27
|
+
import './ccjk-config.mjs';
|
|
28
|
+
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
29
|
+
import './index3.mjs';
|
|
28
30
|
import './fs-operations.mjs';
|
|
29
31
|
import 'node:fs/promises';
|
|
32
|
+
import './json-config.mjs';
|
|
33
|
+
import '../shared/ccjk.Ccrqt7u2.mjs';
|
|
30
34
|
import './platform.mjs';
|
|
31
35
|
import './main.mjs';
|
|
32
36
|
import 'module';
|
|
33
37
|
import 'node:child_process';
|
|
34
38
|
import 'node:stream';
|
|
35
|
-
import '../shared/ccjk.DScm_NnL.mjs';
|
|
36
|
-
import './ccjk-config.mjs';
|
|
37
|
-
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
38
|
-
import './index3.mjs';
|
|
39
39
|
|
|
40
40
|
async function getConfig(key, options = {}) {
|
|
41
41
|
const isZh = i18n.language === "zh-CN";
|
|
@@ -11,6 +11,10 @@ join(CLAUDE_DIR, "CLAUDE.md");
|
|
|
11
11
|
const CLAUDE_AGENTS_DIR = join(CLAUDE_DIR, "agents");
|
|
12
12
|
const ClAUDE_CONFIG_FILE = join(homedir(), ".claude.json");
|
|
13
13
|
const CLAUDE_VSC_CONFIG_FILE = join(CLAUDE_DIR, "config.json");
|
|
14
|
+
const CLAVUE_DIR = join(homedir(), ".clavue");
|
|
15
|
+
const CLAVUE_SETTINGS_FILE = join(CLAVUE_DIR, "settings.json");
|
|
16
|
+
const CLAVUE_CONFIG_FILE = join(CLAVUE_DIR, ".clavue.json");
|
|
17
|
+
const CLAVUE_CREDENTIALS_FILE = join(CLAVUE_DIR, ".credentials.json");
|
|
14
18
|
const CODEX_DIR = join(homedir(), ".codex");
|
|
15
19
|
const CODEX_CONFIG_FILE = join(CODEX_DIR, "config.toml");
|
|
16
20
|
const CODEX_AUTH_FILE = join(CODEX_DIR, "auth.json");
|
|
@@ -79,12 +83,12 @@ const LEGACY_ZCF_CONFIG_FILES = [
|
|
|
79
83
|
];
|
|
80
84
|
const ZCF_CONFIG_DIR = CCJK_CONFIG_DIR;
|
|
81
85
|
const ZCF_CONFIG_FILE = CCJK_CONFIG_FILE;
|
|
82
|
-
const CODE_TOOL_TYPES = ["claude-code", "
|
|
83
|
-
const DEFAULT_CODE_TOOL_TYPE = "
|
|
84
|
-
const CLAUDE_FAMILY_CODE_TOOL_TYPES = ["claude-code", "
|
|
86
|
+
const CODE_TOOL_TYPES = ["claude-code", "clavue", "codex", "aider", "continue", "cline", "cursor"];
|
|
87
|
+
const DEFAULT_CODE_TOOL_TYPE = "clavue";
|
|
88
|
+
const CLAUDE_FAMILY_CODE_TOOL_TYPES = ["claude-code", "clavue"];
|
|
85
89
|
const CODE_TOOL_BANNERS = {
|
|
86
90
|
"claude-code": "for Claude Code",
|
|
87
|
-
"
|
|
91
|
+
"clavue": "for Clavue",
|
|
88
92
|
"codex": "for Codex",
|
|
89
93
|
"aider": "for Aider",
|
|
90
94
|
"continue": "for Continue",
|
|
@@ -93,8 +97,11 @@ const CODE_TOOL_BANNERS = {
|
|
|
93
97
|
};
|
|
94
98
|
const CODE_TOOL_ALIASES = {
|
|
95
99
|
cc: "claude-code",
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
clavue: "clavue",
|
|
101
|
+
cv: "clavue",
|
|
102
|
+
mc: "clavue",
|
|
103
|
+
myclaude: "clavue",
|
|
104
|
+
mycode: "clavue",
|
|
98
105
|
cx: "codex",
|
|
99
106
|
ad: "aider",
|
|
100
107
|
ct: "continue",
|
|
@@ -156,14 +163,14 @@ const CODE_TOOL_INFO = {
|
|
|
156
163
|
],
|
|
157
164
|
managesProviderProfiles: false
|
|
158
165
|
},
|
|
159
|
-
"
|
|
160
|
-
name: "
|
|
161
|
-
description: "
|
|
162
|
-
website: "https://
|
|
163
|
-
installCmd: "npm install -g
|
|
166
|
+
"clavue": {
|
|
167
|
+
name: "Clavue",
|
|
168
|
+
description: "Execution-first AI coding CLI with provider profiles",
|
|
169
|
+
website: "https://www.clavue.com",
|
|
170
|
+
installCmd: "npm install -g clavue && clavue install --force",
|
|
164
171
|
configFormat: "json",
|
|
165
172
|
category: "cli",
|
|
166
|
-
runtimeCommand: "
|
|
173
|
+
runtimeCommand: "clavue",
|
|
167
174
|
configBackend: "claude-family",
|
|
168
175
|
nativeSlashCommands: [
|
|
169
176
|
"/help",
|
|
@@ -309,4 +316,4 @@ function getAiOutputLanguageLabel(lang) {
|
|
|
309
316
|
return lang;
|
|
310
317
|
}
|
|
311
318
|
|
|
312
|
-
export { AIDER_DIR, AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, CCJK_CLOUD_API_URL, CCJK_CLOUD_PLUGINS_CACHE_DIR, CCJK_CLOUD_PLUGINS_DIR, CCJK_CLOUD_PLUGINS_INSTALLED_DIR, CCJK_CONFIG_DIR, CCJK_CONFIG_FILE, CCJK_PLUGINS_DIR, CCJK_SKILLS_DIR, CLAUDE_AGENTS_DIR, CLAUDE_DIR, CLAUDE_FAMILY_CODE_TOOL_TYPES, CLAUDE_VSC_CONFIG_FILE, CLINE_DIR, CLOUD_ENDPOINTS, CODEX_AGENTS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_PROMPTS_DIR, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_INFO, CODE_TOOL_TYPES, CONTINUE_DIR, CURSOR_DIR, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_ZCF_CONFIG_DIR, LEGACY_ZCF_CONFIG_FILE, LEGACY_ZCF_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, ZCF_CONFIG_DIR, ZCF_CONFIG_FILE, getAiOutputLanguageLabel, getCloudApiUrl, getCloudBaseUrl, getCodeToolNativeSlashCommands, getCodeToolRuntimeCommand, isClaudeFamilyCodeTool, isCodeToolType, resolveCodeToolType };
|
|
319
|
+
export { AIDER_DIR, AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, CCJK_CLOUD_API_URL, CCJK_CLOUD_PLUGINS_CACHE_DIR, CCJK_CLOUD_PLUGINS_DIR, CCJK_CLOUD_PLUGINS_INSTALLED_DIR, CCJK_CONFIG_DIR, CCJK_CONFIG_FILE, CCJK_PLUGINS_DIR, CCJK_SKILLS_DIR, CLAUDE_AGENTS_DIR, CLAUDE_DIR, CLAUDE_FAMILY_CODE_TOOL_TYPES, CLAUDE_VSC_CONFIG_FILE, CLAVUE_CONFIG_FILE, CLAVUE_CREDENTIALS_FILE, CLAVUE_DIR, CLAVUE_SETTINGS_FILE, CLINE_DIR, CLOUD_ENDPOINTS, CODEX_AGENTS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_PROMPTS_DIR, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_INFO, CODE_TOOL_TYPES, CONTINUE_DIR, CURSOR_DIR, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_ZCF_CONFIG_DIR, LEGACY_ZCF_CONFIG_FILE, LEGACY_ZCF_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, ZCF_CONFIG_DIR, ZCF_CONFIG_FILE, getAiOutputLanguageLabel, getCloudApiUrl, getCloudBaseUrl, getCodeToolNativeSlashCommands, getCodeToolRuntimeCommand, isClaudeFamilyCodeTool, isCodeToolType, resolveCodeToolType };
|
package/dist/chunks/doctor.mjs
CHANGED
|
@@ -814,7 +814,7 @@ async function checkPermissionRules() {
|
|
|
814
814
|
}
|
|
815
815
|
async function fixSettingsFile() {
|
|
816
816
|
const isZh = i18n.language === "zh-CN";
|
|
817
|
-
const { copyConfigFiles } = await import('./config.mjs').then(function (n) { return n.
|
|
817
|
+
const { copyConfigFiles } = await import('./config.mjs').then(function (n) { return n.F; });
|
|
818
818
|
console.log("");
|
|
819
819
|
console.log(a.bold.cyan("\u{1F527} Fixing settings.json"));
|
|
820
820
|
console.log(a.dim("\u2500".repeat(50)));
|
package/dist/chunks/features.mjs
CHANGED
|
@@ -8,10 +8,11 @@ import { SUPPORTED_LANGS, LANG_LABELS } from './constants.mjs';
|
|
|
8
8
|
import { ensureI18nInitialized, i18n, changeLanguage } from './index2.mjs';
|
|
9
9
|
import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
|
|
10
10
|
import { g as getExistingModelConfig, a as getExistingCustomModelConfig, u as updateCustomModel, c as updateDefaultModel, r as readMcpConfig, f as fixWindowsMcpConfig, w as writeMcpConfig, d as backupMcpConfig, e as buildMcpServerConfig, m as mergeMcpServers, h as getExistingApiConfig, p as promptApiConfigurationAction, i as configureApi } from './config.mjs';
|
|
11
|
-
import { c as configureOutputStyle, m as modifyApiConfigPartially, v as validateApiKey, f as formatApiKeyDisplay } from '../shared/ccjk.
|
|
11
|
+
import { c as configureOutputStyle, m as modifyApiConfigPartially, v as validateApiKey, f as formatApiKeyDisplay } from '../shared/ccjk.ygJzcD-n.mjs';
|
|
12
12
|
import { s as selectMcpServices } from '../shared/ccjk.BI-hdI7P.mjs';
|
|
13
13
|
import { i as isWindows } from './platform.mjs';
|
|
14
14
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
15
|
+
import { openSettingsJson, importRecommendedPermissions, importRecommendedEnv } from './simple-config.mjs';
|
|
15
16
|
import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
|
|
16
17
|
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
17
18
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
@@ -36,7 +37,7 @@ import './fs-operations.mjs';
|
|
|
36
37
|
import 'node:fs/promises';
|
|
37
38
|
import './json-config.mjs';
|
|
38
39
|
import '../shared/ccjk.RyizuzOI.mjs';
|
|
39
|
-
import '../shared/ccjk.
|
|
40
|
+
import '../shared/ccjk.Ccrqt7u2.mjs';
|
|
40
41
|
import './main.mjs';
|
|
41
42
|
import 'module';
|
|
42
43
|
import 'node:stream';
|
|
@@ -106,7 +107,7 @@ async function handleCustomApiMode() {
|
|
|
106
107
|
ensureI18nInitialized();
|
|
107
108
|
const zcfConfig = readZcfConfig();
|
|
108
109
|
const codeToolType = zcfConfig?.codeToolType || "claude-code";
|
|
109
|
-
if (codeToolType === "claude-code" || codeToolType === "
|
|
110
|
+
if (codeToolType === "claude-code" || codeToolType === "clavue") {
|
|
110
111
|
const { configureIncrementalManagement } = await import('./claude-code-incremental-manager.mjs');
|
|
111
112
|
await configureIncrementalManagement();
|
|
112
113
|
return;
|
|
@@ -511,6 +512,60 @@ async function ensureLanguageDirectiveInAgents(aiOutputLang) {
|
|
|
511
512
|
async function updateCodexLanguageDirective(aiOutputLang) {
|
|
512
513
|
return setCodexLanguageDirective(aiOutputLang, "update");
|
|
513
514
|
}
|
|
515
|
+
async function configureMergedPermissionsFeature() {
|
|
516
|
+
ensureI18nInitialized();
|
|
517
|
+
const isZh = i18n.language === "zh-CN";
|
|
518
|
+
const { choice } = await inquirer.prompt({
|
|
519
|
+
type: "list",
|
|
520
|
+
name: "choice",
|
|
521
|
+
message: isZh ? "\u6743\u9650 & \u73AF\u5883\u914D\u7F6E \u2014 \u9009\u62E9\u64CD\u4F5C:" : "Permissions & Env Setup \u2014 Select action:",
|
|
522
|
+
choices: addNumbersToChoices([
|
|
523
|
+
{
|
|
524
|
+
name: isZh ? `\u5BFC\u5165\u63A8\u8350\u73AF\u5883\u53D8\u91CF ${a.gray("- \u5199\u5165\u9690\u79C1\u4FDD\u62A4 env \u5230 settings.json")}` : `Import recommended env vars ${a.gray("- Write privacy env to settings.json")}`,
|
|
525
|
+
value: "env"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
name: isZh ? `\u5BFC\u5165\u63A8\u8350\u6743\u9650\u914D\u7F6E ${a.gray("- \u8FFD\u52A0\u63A8\u8350 allow \u89C4\u5219\u5230 settings.json")}` : `Import recommended permissions ${a.gray("- Append recommended allow rules")}`,
|
|
529
|
+
value: "permissions"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
name: isZh ? `\u4E00\u952E\u6743\u9650\u9884\u8BBE ${a.gray("- \u6700\u5927(max) / \u5F00\u53D1\u8005(dev) / \u5B89\u5168(safe) \u9884\u8BBE")}` : `Zero-config permission preset ${a.gray("- max / dev / safe preset")}`,
|
|
533
|
+
value: "preset"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
name: isZh ? `\u6253\u5F00 settings.json ${a.gray("- \u5728\u7F16\u8F91\u5668\u4E2D\u67E5\u770B\u5F53\u524D\u914D\u7F6E")}` : `Open settings.json ${a.gray("- View current config in editor")}`,
|
|
537
|
+
value: "open"
|
|
538
|
+
}
|
|
539
|
+
])
|
|
540
|
+
});
|
|
541
|
+
if (!choice) {
|
|
542
|
+
await handleCancellation();
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
try {
|
|
546
|
+
switch (choice) {
|
|
547
|
+
case "env":
|
|
548
|
+
await importRecommendedEnv();
|
|
549
|
+
console.log(a.green(`\u2705 ${i18n.t("configuration:envImportSuccess")}`));
|
|
550
|
+
break;
|
|
551
|
+
case "permissions":
|
|
552
|
+
await importRecommendedPermissions();
|
|
553
|
+
console.log(a.green(`\u2705 ${i18n.t("configuration:permissionsImportSuccess") || "Permissions imported"}`));
|
|
554
|
+
break;
|
|
555
|
+
case "preset": {
|
|
556
|
+
const { zeroConfig } = await import('./zero-config.mjs');
|
|
557
|
+
await zeroConfig();
|
|
558
|
+
break;
|
|
559
|
+
}
|
|
560
|
+
case "open":
|
|
561
|
+
console.log(a.green(i18n.t("configuration:openingSettingsJson") || "Opening settings.json..."));
|
|
562
|
+
await openSettingsJson();
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
} catch (error) {
|
|
566
|
+
console.error(a.red(`${i18n.t("common:error")}: ${error.message}`));
|
|
567
|
+
}
|
|
568
|
+
}
|
|
514
569
|
async function configureMemoryFeature() {
|
|
515
570
|
ensureI18nInitialized();
|
|
516
571
|
const isZh = i18n.language === "zh-CN";
|
|
@@ -640,4 +695,4 @@ ${ansis2.bold(i18n.t("memory:memoryContent"))}`);
|
|
|
640
695
|
}
|
|
641
696
|
}
|
|
642
697
|
|
|
643
|
-
export { CODEX_MODEL_CHOICES, DEFAULT_MODEL_CHOICES, changeScriptLanguageFeature, configureCodexAiMemoryFeature, configureCodexDefaultModelFeature, configureDefaultModelFeature, configureMcpFeature, configureMemoryFeature, formatCodexModelLabel, handleCustomApiMode, promptCustomModels };
|
|
698
|
+
export { CODEX_MODEL_CHOICES, DEFAULT_MODEL_CHOICES, changeScriptLanguageFeature, configureCodexAiMemoryFeature, configureCodexDefaultModelFeature, configureDefaultModelFeature, configureMcpFeature, configureMemoryFeature, configureMergedPermissionsFeature, formatCodexModelLabel, handleCustomApiMode, promptCustomModels };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomBytes } from 'node:crypto';
|
|
2
|
-
import { existsSync, mkdirSync,
|
|
2
|
+
import { existsSync, mkdirSync, writeFileSync, renameSync, unlinkSync, readdirSync, statSync, copyFileSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { mkdir, writeFile as writeFile$1, rename, unlink } from 'node:fs/promises';
|
|
4
4
|
import { d as dirname, j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
5
5
|
|
|
@@ -106,18 +106,6 @@ function readJsonFile(path) {
|
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
function writeJsonFile(path, data, pretty = true) {
|
|
110
|
-
try {
|
|
111
|
-
const content = pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data);
|
|
112
|
-
writeFile(path, content, "utf-8");
|
|
113
|
-
} catch (error) {
|
|
114
|
-
throw new FileSystemError(
|
|
115
|
-
`Failed to write JSON file: ${path}`,
|
|
116
|
-
path,
|
|
117
|
-
error
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
109
|
function copyFile(src, dest) {
|
|
122
110
|
try {
|
|
123
111
|
ensureFileDir(dest);
|
|
@@ -189,4 +177,4 @@ function copyDir(src, dest, options = {}) {
|
|
|
189
177
|
}
|
|
190
178
|
}
|
|
191
179
|
|
|
192
|
-
export { FileSystemError, copyDir, copyFile, ensureDir, ensureFileDir, exists, getStatsSafe, readDir, readFile, readJsonFile, removeFile, writeFile, writeFileAtomic, writeFileAtomicAsync
|
|
180
|
+
export { FileSystemError, copyDir, copyFile, ensureDir, ensureFileDir, exists, getStatsSafe, readDir, readFile, readJsonFile, removeFile, writeFile, writeFileAtomic, writeFileAtomicAsync };
|
package/dist/chunks/index.mjs
CHANGED