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/platform.mjs
CHANGED
|
@@ -230,7 +230,7 @@ async function getHomebrewCommandPaths(command) {
|
|
|
230
230
|
}
|
|
231
231
|
const caskNameMap = {
|
|
232
232
|
claude: "claude-code",
|
|
233
|
-
|
|
233
|
+
clavue: "clavue",
|
|
234
234
|
codex: "codex"
|
|
235
235
|
};
|
|
236
236
|
const caskName = caskNameMap[command];
|
|
@@ -357,7 +357,7 @@ function getRecommendedInstallMethods(codeType) {
|
|
|
357
357
|
return ["powershell", "npm"];
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
if (codeType === "
|
|
360
|
+
if (codeType === "clavue") {
|
|
361
361
|
return ["npm"];
|
|
362
362
|
}
|
|
363
363
|
if (codeType === "codex") {
|
|
@@ -392,4 +392,4 @@ const platform = {
|
|
|
392
392
|
wrapCommandWithSudo: wrapCommandWithSudo
|
|
393
393
|
};
|
|
394
394
|
|
|
395
|
-
export { getHomebrewCommandPaths as a, isTermux as b, getTermuxPrefix as c, isWSL as d, getWSLInfo as e, findCommandPath as f, getPlatform as g, commandExists as h, isWindows as i, getRecommendedInstallMethods as j,
|
|
395
|
+
export { getHomebrewCommandPaths as a, isTermux as b, getTermuxPrefix as c, isWSL as d, getWSLInfo as e, findCommandPath as f, getPlatform as g, commandExists as h, isWindows as i, getRecommendedInstallMethods as j, getSystemRoot as k, findRealCommandPath as l, getMcpCommand as m, normalizeTomlPath as n, platform as p, shouldUseSudoForGlobalInstall as s, wrapCommandWithSudo as w };
|
package/dist/chunks/prompts.mjs
CHANGED
|
@@ -132,8 +132,9 @@ async function resolveAiOutputLanguage(scriptLang, commandLineOption, savedConfi
|
|
|
132
132
|
}
|
|
133
133
|
return await selectAiOutputLanguage(scriptLang);
|
|
134
134
|
}
|
|
135
|
-
async function selectTemplateLanguage() {
|
|
135
|
+
async function selectTemplateLanguage(codeTool) {
|
|
136
136
|
ensureI18nInitialized();
|
|
137
|
+
const runtimeLabel = codeTool === "clavue" ? "Clavue" : "Claude Code";
|
|
137
138
|
const LANG_HINT_KEYS = {
|
|
138
139
|
"zh-CN": i18n.t("language:configLangHint.zh-CN"),
|
|
139
140
|
"en": i18n.t("language:configLangHint.en")
|
|
@@ -141,7 +142,7 @@ async function selectTemplateLanguage() {
|
|
|
141
142
|
const { lang } = await inquirer.prompt({
|
|
142
143
|
type: "list",
|
|
143
144
|
name: "lang",
|
|
144
|
-
message: i18n.t("language:selectConfigLang"),
|
|
145
|
+
message: i18n.t("language:selectConfigLang", { runtime: runtimeLabel }),
|
|
145
146
|
choices: addNumbersToChoices(
|
|
146
147
|
SUPPORTED_LANGS.map((l) => ({
|
|
147
148
|
name: `${LANG_LABELS[l]} - ${LANG_HINT_KEYS[l]}`,
|
|
@@ -155,8 +156,9 @@ async function selectTemplateLanguage() {
|
|
|
155
156
|
}
|
|
156
157
|
return lang;
|
|
157
158
|
}
|
|
158
|
-
async function resolveTemplateLanguage(commandLineOption, savedConfig, skipPrompt) {
|
|
159
|
+
async function resolveTemplateLanguage(commandLineOption, savedConfig, skipPrompt, codeTool) {
|
|
159
160
|
ensureI18nInitialized();
|
|
161
|
+
const runtimeLabel = codeTool === "clavue" ? "Clavue" : "Claude Code";
|
|
160
162
|
if (commandLineOption) {
|
|
161
163
|
return commandLineOption;
|
|
162
164
|
}
|
|
@@ -171,10 +173,10 @@ async function resolveTemplateLanguage(commandLineOption, savedConfig, skipPromp
|
|
|
171
173
|
defaultValue: false
|
|
172
174
|
});
|
|
173
175
|
if (!shouldModify) {
|
|
174
|
-
console.log(a.gray(`\u2714 ${i18n.t("language:selectConfigLang")}: ${currentLanguageLabel}`));
|
|
176
|
+
console.log(a.gray(`\u2714 ${i18n.t("language:selectConfigLang", { runtime: runtimeLabel })}: ${currentLanguageLabel}`));
|
|
175
177
|
return savedConfig.templateLang;
|
|
176
178
|
}
|
|
177
|
-
return await selectTemplateLanguage();
|
|
179
|
+
return await selectTemplateLanguage(codeTool);
|
|
178
180
|
}
|
|
179
181
|
if (savedConfig?.preferredLang && !savedConfig?.templateLang) {
|
|
180
182
|
if (skipPrompt) {
|
|
@@ -188,12 +190,12 @@ async function resolveTemplateLanguage(commandLineOption, savedConfig, skipPromp
|
|
|
188
190
|
if (!shouldModify) {
|
|
189
191
|
return savedConfig.preferredLang;
|
|
190
192
|
}
|
|
191
|
-
return await selectTemplateLanguage();
|
|
193
|
+
return await selectTemplateLanguage(codeTool);
|
|
192
194
|
}
|
|
193
195
|
if (skipPrompt) {
|
|
194
196
|
return "en";
|
|
195
197
|
}
|
|
196
|
-
return await selectTemplateLanguage();
|
|
198
|
+
return await selectTemplateLanguage(codeTool);
|
|
197
199
|
}
|
|
198
200
|
async function resolveSystemPromptStyle(availablePrompts, commandLineOption, savedConfig, skipPrompt) {
|
|
199
201
|
ensureI18nInitialized();
|
|
@@ -3,7 +3,7 @@ import { homedir } from 'node:os';
|
|
|
3
3
|
import a from './index5.mjs';
|
|
4
4
|
import { MetricsDisplay } from './metrics-display.mjs';
|
|
5
5
|
import { getContextPersistence } from './persistence.mjs';
|
|
6
|
-
import { r as runHealthCheck } from '../shared/ccjk.
|
|
6
|
+
import { r as runHealthCheck } from '../shared/ccjk.Dxgd2vjc.mjs';
|
|
7
7
|
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
8
8
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
9
9
|
import 'better-sqlite3';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import a from './index5.mjs';
|
|
2
2
|
import { i as inquirer } from './index6.mjs';
|
|
3
3
|
import ora from './index8.mjs';
|
|
4
|
+
import { CLOUD_ENDPOINTS, SETTINGS_FILE } from './constants.mjs';
|
|
4
5
|
import { c as createApiClient } from '../shared/ccjk.D6ycHbak.mjs';
|
|
5
|
-
import {
|
|
6
|
+
import { i as configureApi, x as overwriteModelSettings } from './config.mjs';
|
|
7
|
+
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
6
8
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
7
9
|
import 'node:readline';
|
|
8
10
|
import 'stream';
|
|
@@ -24,6 +26,18 @@ import './index2.mjs';
|
|
|
24
26
|
import 'node:fs';
|
|
25
27
|
import 'node:url';
|
|
26
28
|
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
29
|
+
import '../shared/ccjk.RyizuzOI.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';
|
|
35
|
+
import '../shared/ccjk.Ccrqt7u2.mjs';
|
|
36
|
+
import './platform.mjs';
|
|
37
|
+
import './main.mjs';
|
|
38
|
+
import 'module';
|
|
39
|
+
import 'node:child_process';
|
|
40
|
+
import 'node:stream';
|
|
27
41
|
|
|
28
42
|
const CLOUD_API_BASE_URL = `${CLOUD_ENDPOINTS.MAIN.BASE_URL}${CLOUD_ENDPOINTS.MAIN.API_VERSION}`;
|
|
29
43
|
const REQUEST_TIMEOUT = 1e4;
|
|
@@ -635,36 +649,14 @@ async function configureProvider(provider, _options) {
|
|
|
635
649
|
async function saveProviderConfig(config) {
|
|
636
650
|
const spinner = ora("\u6B63\u5728\u4FDD\u5B58\u914D\u7F6E...").start();
|
|
637
651
|
try {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
}
|
|
647
|
-
let settings = {};
|
|
648
|
-
try {
|
|
649
|
-
if (existsSync(settingsPath)) {
|
|
650
|
-
settings = readJsonFile(settingsPath) || {};
|
|
651
|
-
}
|
|
652
|
-
} catch {
|
|
653
|
-
}
|
|
654
|
-
settings.apiProvider = "custom";
|
|
655
|
-
settings.apiUrl = config.provider.apiUrl;
|
|
656
|
-
settings.apiKey = config.apiKey;
|
|
657
|
-
settings.model = config.model;
|
|
658
|
-
const envConfig = {
|
|
659
|
-
ANTHROPIC_BASE_URL: config.provider.apiUrl,
|
|
660
|
-
ANTHROPIC_API_KEY: config.apiKey,
|
|
661
|
-
ANTHROPIC_MODEL: config.model
|
|
662
|
-
};
|
|
663
|
-
settings.env = {
|
|
664
|
-
...settings.env || {},
|
|
665
|
-
...envConfig
|
|
666
|
-
};
|
|
667
|
-
writeJsonFile(settingsPath, settings);
|
|
652
|
+
configureApi({
|
|
653
|
+
url: config.provider.apiUrl,
|
|
654
|
+
key: config.apiKey,
|
|
655
|
+
authType: "api_key"
|
|
656
|
+
});
|
|
657
|
+
const settings = readJsonConfig(SETTINGS_FILE) || {};
|
|
658
|
+
overwriteModelSettings(settings, { primaryModel: config.model }, "override");
|
|
659
|
+
writeJsonConfig(SETTINGS_FILE, settings);
|
|
668
660
|
spinner.succeed(a.green("\u914D\u7F6E\u5DF2\u4FDD\u5B58"));
|
|
669
661
|
} catch (error) {
|
|
670
662
|
spinner.fail(a.red("\u4FDD\u5B58\u5931\u8D25"));
|
|
@@ -40,7 +40,7 @@ import '../shared/ccjk.DKXs7Fbm.mjs';
|
|
|
40
40
|
import './banner.mjs';
|
|
41
41
|
import './config2.mjs';
|
|
42
42
|
import './config.mjs';
|
|
43
|
-
import '../shared/ccjk.
|
|
43
|
+
import '../shared/ccjk.Ccrqt7u2.mjs';
|
|
44
44
|
import '../shared/ccjk.DZ2LLOa-.mjs';
|
|
45
45
|
import '../shared/ccjk.DeWpAShp.mjs';
|
|
46
46
|
import './auto-updater.mjs';
|
|
@@ -50,12 +50,11 @@ import '../shared/ccjk.CxpGa6MC.mjs';
|
|
|
50
50
|
import './codex.mjs';
|
|
51
51
|
import '../shared/ccjk.BFQ7yr5S.mjs';
|
|
52
52
|
import './prompts.mjs';
|
|
53
|
-
import '../shared/ccjk.
|
|
54
|
-
import '../shared/ccjk.
|
|
53
|
+
import '../shared/ccjk.MpkxXQJL.mjs';
|
|
54
|
+
import '../shared/ccjk.ygJzcD-n.mjs';
|
|
55
55
|
import '../shared/ccjk.DGllfVCZ.mjs';
|
|
56
56
|
import './installer.mjs';
|
|
57
57
|
import '../shared/ccjk.BI-hdI7P.mjs';
|
|
58
|
-
import '../shared/ccjk.BJENIVf7.mjs';
|
|
59
58
|
import '../shared/ccjk.Bq8TqZG_.mjs';
|
|
60
59
|
|
|
61
60
|
const ccjkVersion = getRuntimeVersion();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readFileSync, existsSync } from 'node:fs';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
|
-
import './main.mjs';
|
|
4
|
-
import { SETTINGS_FILE, CLAUDE_DIR } from './constants.mjs';
|
|
3
|
+
import { exec as q } from './main.mjs';
|
|
5
4
|
import { ensureDir, writeFileAtomic } from './fs-operations.mjs';
|
|
6
|
-
import { m as mergeAndCleanPermissions } from '../shared/ccjk.
|
|
5
|
+
import { r as resolveClaudeFamilySettingsTarget, m as mergeAndCleanPermissions } from '../shared/ccjk.Ccrqt7u2.mjs';
|
|
6
|
+
import { g as getPlatform } from './platform.mjs';
|
|
7
7
|
import { j as join, d as dirname } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
8
8
|
import 'module';
|
|
9
9
|
import 'node:child_process';
|
|
@@ -11,10 +11,17 @@ import 'node:path';
|
|
|
11
11
|
import 'node:process';
|
|
12
12
|
import 'node:stream';
|
|
13
13
|
import 'node:readline';
|
|
14
|
-
import 'node:os';
|
|
15
|
-
import './index2.mjs';
|
|
16
14
|
import 'node:crypto';
|
|
17
15
|
import 'node:fs/promises';
|
|
16
|
+
import './constants.mjs';
|
|
17
|
+
import 'node:os';
|
|
18
|
+
import './index2.mjs';
|
|
19
|
+
import './ccjk-config.mjs';
|
|
20
|
+
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
21
|
+
import './index3.mjs';
|
|
22
|
+
import './json-config.mjs';
|
|
23
|
+
import '../shared/ccjk.RyizuzOI.mjs';
|
|
24
|
+
import '../shared/ccjk.BAGoDD49.mjs';
|
|
18
25
|
|
|
19
26
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
20
27
|
function getTemplateSettings() {
|
|
@@ -22,33 +29,35 @@ function getTemplateSettings() {
|
|
|
22
29
|
const content = readFileSync(templatePath, "utf-8");
|
|
23
30
|
return JSON.parse(content);
|
|
24
31
|
}
|
|
25
|
-
function loadCurrentSettings() {
|
|
26
|
-
if (!existsSync(
|
|
32
|
+
function loadCurrentSettings(target = resolveClaudeFamilySettingsTarget()) {
|
|
33
|
+
if (!existsSync(target.settingsFile)) {
|
|
27
34
|
return {};
|
|
28
35
|
}
|
|
29
36
|
try {
|
|
30
|
-
const content = readFileSync(
|
|
37
|
+
const content = readFileSync(target.settingsFile, "utf-8");
|
|
31
38
|
return JSON.parse(content);
|
|
32
39
|
} catch {
|
|
33
40
|
return {};
|
|
34
41
|
}
|
|
35
42
|
}
|
|
36
|
-
function saveSettings(settings) {
|
|
37
|
-
ensureDir(
|
|
38
|
-
writeFileAtomic(
|
|
43
|
+
function saveSettings(settings, target = resolveClaudeFamilySettingsTarget()) {
|
|
44
|
+
ensureDir(target.configDir);
|
|
45
|
+
writeFileAtomic(target.settingsFile, JSON.stringify(settings, null, 2));
|
|
39
46
|
}
|
|
40
47
|
async function importRecommendedEnv() {
|
|
48
|
+
const target = resolveClaudeFamilySettingsTarget();
|
|
41
49
|
const templateSettings = getTemplateSettings();
|
|
42
|
-
const currentSettings = loadCurrentSettings();
|
|
50
|
+
const currentSettings = loadCurrentSettings(target);
|
|
43
51
|
currentSettings.env = {
|
|
44
52
|
...currentSettings.env,
|
|
45
53
|
...templateSettings.env
|
|
46
54
|
};
|
|
47
|
-
saveSettings(currentSettings);
|
|
55
|
+
saveSettings(currentSettings, target);
|
|
48
56
|
}
|
|
49
57
|
async function importRecommendedPermissions() {
|
|
58
|
+
const target = resolveClaudeFamilySettingsTarget();
|
|
50
59
|
const templateSettings = getTemplateSettings();
|
|
51
|
-
const currentSettings = loadCurrentSettings();
|
|
60
|
+
const currentSettings = loadCurrentSettings(target);
|
|
52
61
|
if (templateSettings.permissions && templateSettings.permissions.allow) {
|
|
53
62
|
currentSettings.permissions = {
|
|
54
63
|
...templateSettings.permissions,
|
|
@@ -60,7 +69,39 @@ async function importRecommendedPermissions() {
|
|
|
60
69
|
} else {
|
|
61
70
|
currentSettings.permissions = templateSettings.permissions;
|
|
62
71
|
}
|
|
63
|
-
saveSettings(currentSettings);
|
|
72
|
+
saveSettings(currentSettings, target);
|
|
73
|
+
}
|
|
74
|
+
async function openSettingsJson() {
|
|
75
|
+
const target = resolveClaudeFamilySettingsTarget();
|
|
76
|
+
ensureDir(target.configDir);
|
|
77
|
+
if (!existsSync(target.settingsFile)) {
|
|
78
|
+
saveSettings({}, target);
|
|
79
|
+
}
|
|
80
|
+
const platform = getPlatform();
|
|
81
|
+
let command;
|
|
82
|
+
switch (platform) {
|
|
83
|
+
case "macos":
|
|
84
|
+
command = "open";
|
|
85
|
+
break;
|
|
86
|
+
case "windows":
|
|
87
|
+
command = "start";
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
command = "xdg-open";
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
await q(command, [target.settingsFile]);
|
|
94
|
+
} catch {
|
|
95
|
+
try {
|
|
96
|
+
await q("code", [target.settingsFile]);
|
|
97
|
+
} catch {
|
|
98
|
+
try {
|
|
99
|
+
await q("vim", [target.settingsFile]);
|
|
100
|
+
} catch {
|
|
101
|
+
await q("nano", [target.settingsFile]);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
64
105
|
}
|
|
65
106
|
|
|
66
|
-
export { importRecommendedEnv, importRecommendedPermissions };
|
|
107
|
+
export { importRecommendedEnv, importRecommendedPermissions, openSettingsJson };
|
|
@@ -122,7 +122,7 @@ function getSlashCommands() {
|
|
|
122
122
|
descriptionZh: "\u521B\u5EFA\u914D\u7F6E\u5907\u4EFD",
|
|
123
123
|
category: "system",
|
|
124
124
|
handler: async () => {
|
|
125
|
-
const { backupExistingConfig } = await import('./config.mjs').then(function (n) { return n.
|
|
125
|
+
const { backupExistingConfig } = await import('./config.mjs').then(function (n) { return n.F; });
|
|
126
126
|
const backupPath = backupExistingConfig();
|
|
127
127
|
if (backupPath) {
|
|
128
128
|
console.log(a.green(`\u2705 Backup created: ${backupPath}`));
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { r as resolveClaudeFamilySettingsTarget } from '../shared/ccjk.Ccrqt7u2.mjs';
|
|
4
|
+
import './constants.mjs';
|
|
5
|
+
import 'node:os';
|
|
6
|
+
import './index2.mjs';
|
|
7
|
+
import 'node:process';
|
|
8
|
+
import 'node:url';
|
|
9
|
+
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
10
|
+
import './ccjk-config.mjs';
|
|
11
|
+
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
12
|
+
import './index3.mjs';
|
|
13
|
+
import './fs-operations.mjs';
|
|
14
|
+
import 'node:crypto';
|
|
15
|
+
import './json-config.mjs';
|
|
16
|
+
import '../shared/ccjk.RyizuzOI.mjs';
|
|
17
|
+
import '../shared/ccjk.BAGoDD49.mjs';
|
|
5
18
|
|
|
6
19
|
const QUICK_ACTIONS = [
|
|
7
20
|
{
|
|
@@ -181,11 +194,11 @@ Auto-suggest based on user input:
|
|
|
181
194
|
`;
|
|
182
195
|
return directive;
|
|
183
196
|
}
|
|
184
|
-
function getClaudeMdPath() {
|
|
185
|
-
return
|
|
197
|
+
function getClaudeMdPath(codeTool) {
|
|
198
|
+
return resolveClaudeFamilySettingsTarget(codeTool).instructionsFile;
|
|
186
199
|
}
|
|
187
|
-
async function injectSmartGuide(lang = "en") {
|
|
188
|
-
const claudeMdPath = getClaudeMdPath();
|
|
200
|
+
async function injectSmartGuide(lang = "en", codeTool) {
|
|
201
|
+
const claudeMdPath = getClaudeMdPath(codeTool);
|
|
189
202
|
try {
|
|
190
203
|
let content = "";
|
|
191
204
|
if (existsSync(claudeMdPath)) {
|
|
@@ -204,8 +217,8 @@ ${directive}`;
|
|
|
204
217
|
return false;
|
|
205
218
|
}
|
|
206
219
|
}
|
|
207
|
-
async function removeSmartGuide() {
|
|
208
|
-
const claudeMdPath = getClaudeMdPath();
|
|
220
|
+
async function removeSmartGuide(codeTool) {
|
|
221
|
+
const claudeMdPath = getClaudeMdPath(codeTool);
|
|
209
222
|
try {
|
|
210
223
|
if (!existsSync(claudeMdPath)) {
|
|
211
224
|
return true;
|
|
@@ -218,8 +231,8 @@ async function removeSmartGuide() {
|
|
|
218
231
|
return false;
|
|
219
232
|
}
|
|
220
233
|
}
|
|
221
|
-
async function isSmartGuideInstalled() {
|
|
222
|
-
const claudeMdPath = getClaudeMdPath();
|
|
234
|
+
async function isSmartGuideInstalled(codeTool) {
|
|
235
|
+
const claudeMdPath = getClaudeMdPath(codeTool);
|
|
223
236
|
try {
|
|
224
237
|
if (!existsSync(claudeMdPath)) {
|
|
225
238
|
return false;
|
package/dist/chunks/status.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
2
|
import process__default from 'node:process';
|
|
4
3
|
import a from './index5.mjs';
|
|
5
|
-
import { g as getRuntimeCapabilityDescriptor } from '../shared/ccjk.
|
|
6
|
-
import {
|
|
4
|
+
import { g as getRuntimeCapabilityDescriptor } from '../shared/ccjk.K8c6VnM2.mjs';
|
|
5
|
+
import { r as resolveCodeType, s as scanProject } from './code-type-resolver.mjs';
|
|
6
|
+
import { CLAVUE_CONFIG_FILE, CLAVUE_SETTINGS_FILE, SETTINGS_FILE } from './constants.mjs';
|
|
7
7
|
import { MetricsDisplay } from './metrics-display.mjs';
|
|
8
8
|
import { getContextPersistence } from './persistence.mjs';
|
|
9
|
-
import { r as runHealthCheck } from '../shared/ccjk.
|
|
10
|
-
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
9
|
+
import { r as runHealthCheck } from '../shared/ccjk.Dxgd2vjc.mjs';
|
|
11
10
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
12
11
|
import 'node:child_process';
|
|
12
|
+
import 'node:os';
|
|
13
13
|
import 'node:path';
|
|
14
14
|
import 'node:util';
|
|
15
15
|
import './index6.mjs';
|
|
@@ -24,17 +24,17 @@ import 'child_process';
|
|
|
24
24
|
import 'node:crypto';
|
|
25
25
|
import 'buffer';
|
|
26
26
|
import 'string_decoder';
|
|
27
|
-
import './constants.mjs';
|
|
28
|
-
import './index2.mjs';
|
|
29
|
-
import 'node:url';
|
|
30
27
|
import './json-config.mjs';
|
|
31
28
|
import '../shared/ccjk.RyizuzOI.mjs';
|
|
32
29
|
import './fs-operations.mjs';
|
|
33
30
|
import 'node:fs/promises';
|
|
31
|
+
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
34
32
|
import './platform.mjs';
|
|
35
33
|
import './main.mjs';
|
|
36
34
|
import 'module';
|
|
37
35
|
import 'node:stream';
|
|
36
|
+
import './index2.mjs';
|
|
37
|
+
import 'node:url';
|
|
38
38
|
import './ccjk-config.mjs';
|
|
39
39
|
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
40
40
|
import './index3.mjs';
|
|
@@ -85,8 +85,11 @@ function renderScoreBar(score) {
|
|
|
85
85
|
bar += a.gray("\u2591".repeat(empty));
|
|
86
86
|
return bar;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
88
|
+
function getRuntimeSettingsPath(codeTool) {
|
|
89
|
+
return codeTool === "clavue" ? CLAVUE_SETTINGS_FILE : SETTINGS_FILE;
|
|
90
|
+
}
|
|
91
|
+
function loadInstalledSettings(codeTool) {
|
|
92
|
+
const settingsPath = getRuntimeSettingsPath(codeTool);
|
|
90
93
|
try {
|
|
91
94
|
if (!existsSync(settingsPath))
|
|
92
95
|
return { mcpServers: {}, hooks: {} };
|
|
@@ -239,8 +242,8 @@ function renderHooksSection(recommended, installed) {
|
|
|
239
242
|
}
|
|
240
243
|
function getRuntimeSectionTitle(codeTool) {
|
|
241
244
|
switch (codeTool) {
|
|
242
|
-
case "
|
|
243
|
-
return "
|
|
245
|
+
case "clavue":
|
|
246
|
+
return "clavue";
|
|
244
247
|
case "codex":
|
|
245
248
|
return "Codex";
|
|
246
249
|
case "claude-code":
|
|
@@ -270,8 +273,8 @@ function renderClaudeCodeSection(defaults, codeTool) {
|
|
|
270
273
|
}
|
|
271
274
|
}
|
|
272
275
|
try {
|
|
273
|
-
const settingsPath =
|
|
274
|
-
const
|
|
276
|
+
const settingsPath = getRuntimeSettingsPath(codeTool);
|
|
277
|
+
const clavuePath = CLAVUE_CONFIG_FILE;
|
|
275
278
|
if (existsSync(settingsPath)) {
|
|
276
279
|
const data = JSON.parse(readFileSync(settingsPath, "utf-8"));
|
|
277
280
|
const env = data.env || {};
|
|
@@ -280,13 +283,14 @@ function renderClaudeCodeSection(defaults, codeTool) {
|
|
|
280
283
|
const opus = env.ANTHROPIC_DEFAULT_OPUS_MODEL;
|
|
281
284
|
const primary = data.model || env.ANTHROPIC_MODEL;
|
|
282
285
|
const hasAdaptive = Boolean(haiku || sonnet || opus);
|
|
283
|
-
if (existsSync(
|
|
286
|
+
if (codeTool === "clavue" && existsSync(clavuePath)) {
|
|
284
287
|
try {
|
|
285
|
-
const
|
|
286
|
-
const activeId =
|
|
287
|
-
const
|
|
288
|
+
const clavueData = JSON.parse(readFileSync(clavuePath, "utf-8"));
|
|
289
|
+
const activeId = clavueData.clavueActiveProviderProfileId || clavueData.myclaudeActiveProviderProfileId;
|
|
290
|
+
const profiles = Array.isArray(clavueData.clavueProviderProfiles) ? clavueData.clavueProviderProfiles : Array.isArray(clavueData.myclaudeProviderProfiles) ? clavueData.myclaudeProviderProfiles : [];
|
|
291
|
+
const activeProfile = Array.isArray(profiles) ? profiles.find((profile) => String(profile?.id) === String(activeId)) : null;
|
|
288
292
|
if (activeId) {
|
|
289
|
-
lines.push(` ${label("Provider:".padEnd(14))} ${val(`
|
|
293
|
+
lines.push(` ${label("Provider:".padEnd(14))} ${val(`clavue/${activeId}`)}`);
|
|
290
294
|
}
|
|
291
295
|
if (activeProfile?.baseUrl) {
|
|
292
296
|
lines.push(` ${label("API Base:".padEnd(14))} ${val(activeProfile.baseUrl)}`);
|
|
@@ -294,7 +298,7 @@ function renderClaudeCodeSection(defaults, codeTool) {
|
|
|
294
298
|
} catch {
|
|
295
299
|
}
|
|
296
300
|
}
|
|
297
|
-
if (data.model && hasAdaptive) {
|
|
301
|
+
if (codeTool !== "clavue" && data.model && hasAdaptive) {
|
|
298
302
|
lines.push(` ${label("Model:".padEnd(14))} ${a.red(data.model)} ${a.red("(overrides adaptive routing!)")}`);
|
|
299
303
|
lines.push(` ${label("".padEnd(14))} ${a.yellow("Run: ccjk boost --fix-model")}`);
|
|
300
304
|
} else if (hasAdaptive) {
|
|
@@ -403,12 +407,12 @@ function suggestNextAction(health, _ctx) {
|
|
|
403
407
|
}
|
|
404
408
|
async function statusCommand(options = {}) {
|
|
405
409
|
try {
|
|
406
|
-
const
|
|
410
|
+
const codeTool = await resolveCodeType();
|
|
411
|
+
const [ctx, defaults, installed, health] = await Promise.all([
|
|
407
412
|
scanProject(),
|
|
408
413
|
loadSmartDefaults(),
|
|
409
|
-
Promise.resolve(loadInstalledSettings()),
|
|
410
|
-
runHealthCheck()
|
|
411
|
-
resolveCodeType()
|
|
414
|
+
Promise.resolve(loadInstalledSettings(codeTool)),
|
|
415
|
+
runHealthCheck()
|
|
412
416
|
]);
|
|
413
417
|
const capability = getRuntimeCapabilityDescriptor(codeTool);
|
|
414
418
|
if (options.json) {
|
package/dist/chunks/update.mjs
CHANGED
|
@@ -2,20 +2,20 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import a from './index5.mjs';
|
|
3
3
|
import { i as inquirer } from './index6.mjs';
|
|
4
4
|
import { M as MCP_SERVICE_CONFIGS, g as getMcpServices } from '../shared/ccjk.DKXs7Fbm.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { DEFAULT_CODE_TOOL_TYPE, resolveCodeToolType as resolveCodeToolType$1, isCodeToolType } from './constants.mjs';
|
|
6
6
|
import { i18n } from './index2.mjs';
|
|
7
7
|
import { displayBanner } from './banner.mjs';
|
|
8
8
|
import { readZcfConfig, updateZcfConfig } from './ccjk-config.mjs';
|
|
9
9
|
import { k as copyConfigFiles, r as readMcpConfig } from './config.mjs';
|
|
10
10
|
import { c as runCodexUpdate } from './codex.mjs';
|
|
11
|
-
import { n as needsMigration, m as migrateSettingsForTokenRetrieval, d as displayMigrationResult, p as promptMigration } from '../shared/ccjk.
|
|
12
|
-
import { u as updatePromptOnly } from '../shared/ccjk.
|
|
11
|
+
import { n as needsMigration, m as migrateSettingsForTokenRetrieval, d as displayMigrationResult, p as promptMigration, s as selectAndInstallWorkflows } from '../shared/ccjk.MpkxXQJL.mjs';
|
|
12
|
+
import { u as updatePromptOnly } from '../shared/ccjk.ygJzcD-n.mjs';
|
|
13
13
|
import { a as handleExitPromptError, h as handleGeneralError } from '../shared/ccjk.DGllfVCZ.mjs';
|
|
14
|
-
import { a as installMcpServices } from '../shared/ccjk.
|
|
14
|
+
import { a as installMcpServices } from '../shared/ccjk.BXTrU9TN.mjs';
|
|
15
15
|
import { resolveAiOutputLanguage } from './prompts.mjs';
|
|
16
16
|
import { g as getRuntimeVersion } from '../shared/ccjk.gDEDGD_t.mjs';
|
|
17
|
+
import { r as resolveClaudeFamilySettingsTarget } from '../shared/ccjk.Ccrqt7u2.mjs';
|
|
17
18
|
import { checkClaudeCodeVersionAndPrompt } from './version-checker.mjs';
|
|
18
|
-
import { s as selectAndInstallWorkflows } from '../shared/ccjk.BJENIVf7.mjs';
|
|
19
19
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
20
20
|
import 'node:readline';
|
|
21
21
|
import 'stream';
|
|
@@ -45,7 +45,6 @@ import './platform.mjs';
|
|
|
45
45
|
import './main.mjs';
|
|
46
46
|
import 'module';
|
|
47
47
|
import 'node:stream';
|
|
48
|
-
import '../shared/ccjk.DScm_NnL.mjs';
|
|
49
48
|
import './index8.mjs';
|
|
50
49
|
import '../shared/ccjk.DeWpAShp.mjs';
|
|
51
50
|
import '../shared/ccjk.CxpGa6MC.mjs';
|
|
@@ -65,9 +64,9 @@ function resolveCodeToolType(optionValue, savedValue) {
|
|
|
65
64
|
}
|
|
66
65
|
return DEFAULT_CODE_TOOL_TYPE;
|
|
67
66
|
}
|
|
68
|
-
async function checkAndPromptNewMcpServices(skipPrompt) {
|
|
67
|
+
async function checkAndPromptNewMcpServices(codeToolType, skipPrompt) {
|
|
69
68
|
try {
|
|
70
|
-
const mcpConfig = readMcpConfig();
|
|
69
|
+
const mcpConfig = readMcpConfig(codeToolType);
|
|
71
70
|
const installedIds = new Set(Object.keys(mcpConfig?.mcpServers || {}));
|
|
72
71
|
const newServices = MCP_SERVICE_CONFIGS.filter(
|
|
73
72
|
(c) => c.defaultSelected && !installedIds.has(c.id)
|
|
@@ -79,7 +78,7 @@ async function checkAndPromptNewMcpServices(skipPrompt) {
|
|
|
79
78
|
console.log(a.cyan(`
|
|
80
79
|
\u2728 New recommended services available: ${a.bold(newServiceNames)}`));
|
|
81
80
|
if (skipPrompt) {
|
|
82
|
-
await installMcpServices(newServices.map((s) => s.id));
|
|
81
|
+
await installMcpServices(newServices.map((s) => s.id), codeToolType);
|
|
83
82
|
console.log(a.green("\u2713 New services installed automatically"));
|
|
84
83
|
return;
|
|
85
84
|
}
|
|
@@ -92,7 +91,7 @@ async function checkAndPromptNewMcpServices(skipPrompt) {
|
|
|
92
91
|
}
|
|
93
92
|
]);
|
|
94
93
|
if (install) {
|
|
95
|
-
await installMcpServices(newServices.map((s) => s.id));
|
|
94
|
+
await installMcpServices(newServices.map((s) => s.id), codeToolType);
|
|
96
95
|
console.log(a.green("\u2713 New services installed"));
|
|
97
96
|
}
|
|
98
97
|
} catch {
|
|
@@ -128,19 +127,21 @@ async function update(options = {}) {
|
|
|
128
127
|
options.configLang,
|
|
129
128
|
// Command line option
|
|
130
129
|
zcfConfig,
|
|
131
|
-
options.skipPrompt
|
|
130
|
+
options.skipPrompt,
|
|
132
131
|
// Non-interactive mode flag
|
|
132
|
+
codeToolType
|
|
133
133
|
);
|
|
134
134
|
const aiOutputLang = await resolveAiOutputLanguage(i18n.language, options.aiOutputLang, zcfConfig, options.skipPrompt);
|
|
135
|
-
|
|
135
|
+
const runtimeTarget = resolveClaudeFamilySettingsTarget(codeToolType);
|
|
136
|
+
if (existsSync(runtimeTarget.settingsFile) && needsMigration(codeToolType)) {
|
|
136
137
|
if (options.skipPrompt) {
|
|
137
138
|
console.log(a.yellow("\n\u26A0\uFE0F Problematic configuration detected. Auto-fixing...\n"));
|
|
138
|
-
const result = migrateSettingsForTokenRetrieval();
|
|
139
|
+
const result = migrateSettingsForTokenRetrieval(codeToolType);
|
|
139
140
|
displayMigrationResult(result);
|
|
140
141
|
} else {
|
|
141
142
|
const shouldMigrate = await promptMigration();
|
|
142
143
|
if (shouldMigrate) {
|
|
143
|
-
const result = migrateSettingsForTokenRetrieval();
|
|
144
|
+
const result = migrateSettingsForTokenRetrieval(codeToolType);
|
|
144
145
|
displayMigrationResult(result);
|
|
145
146
|
}
|
|
146
147
|
}
|
|
@@ -149,10 +150,10 @@ async function update(options = {}) {
|
|
|
149
150
|
${i18n.t("configuration:updatingPrompts")}
|
|
150
151
|
`));
|
|
151
152
|
console.log(a.dim("\u2714 Checking and fixing configuration format...\n"));
|
|
152
|
-
copyConfigFiles(false);
|
|
153
|
-
await updatePromptOnly(aiOutputLang);
|
|
154
|
-
await selectAndInstallWorkflows(configLang);
|
|
155
|
-
await checkAndPromptNewMcpServices(options.skipPrompt);
|
|
153
|
+
copyConfigFiles(false, codeToolType);
|
|
154
|
+
await updatePromptOnly(aiOutputLang, codeToolType);
|
|
155
|
+
await selectAndInstallWorkflows(configLang, void 0, { codeToolType });
|
|
156
|
+
await checkAndPromptNewMcpServices(codeToolType, options.skipPrompt);
|
|
156
157
|
await checkClaudeCodeVersionAndPrompt(false);
|
|
157
158
|
updateZcfConfig({
|
|
158
159
|
version: ccjkVersion,
|