ccjk 13.6.0 → 13.6.2
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.mjs +12 -9
- package/dist/chunks/ccjk-setup.mjs +2 -2
- package/dist/chunks/ccjk-skills.mjs +6 -2
- package/dist/chunks/index10.mjs +5 -2
- package/dist/chunks/index2.mjs +8 -1
- package/dist/chunks/index4.mjs +4 -2
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/quick-setup.mjs +2 -2
- package/dist/chunks/skills.mjs +26 -16
- package/dist/chunks/uninstall.mjs +6 -2
- package/dist/cli.mjs +0 -0
- package/dist/shared/{ccjk.CQd7SKNC.mjs → ccjk.B2f-cwUP.mjs} +17 -9
- package/package.json +65 -68
package/dist/chunks/api.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import a from './index5.mjs';
|
|
2
|
-
import { i18n, format } from './index2.mjs';
|
|
2
|
+
import { i18n, resolveSupportedLanguage, format } from './index2.mjs';
|
|
3
3
|
import { STATUS, COLORS as theme } from './banner.mjs';
|
|
4
|
-
import { r as runConfigWizard, t as testApiConnection, d as displayCurrentStatus, q as quickSetup } from '../shared/ccjk.
|
|
4
|
+
import { r as runConfigWizard, t as testApiConnection, d as displayCurrentStatus, q as quickSetup } from '../shared/ccjk.B2f-cwUP.mjs';
|
|
5
5
|
import { g as getAllPresets } from '../shared/ccjk.DopKzo3z.mjs';
|
|
6
6
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
7
7
|
import 'node:fs';
|
|
@@ -27,6 +27,9 @@ import 'string_decoder';
|
|
|
27
27
|
import './fs-operations.mjs';
|
|
28
28
|
import 'node:fs/promises';
|
|
29
29
|
|
|
30
|
+
function resolveApiCommandLanguage(lang) {
|
|
31
|
+
return resolveSupportedLanguage(lang || i18n.language);
|
|
32
|
+
}
|
|
30
33
|
function listProviders(lang = "en") {
|
|
31
34
|
const presets = getAllPresets();
|
|
32
35
|
console.log("");
|
|
@@ -64,17 +67,17 @@ function setupApi(providerId, apiKey, _lang = "en") {
|
|
|
64
67
|
console.log(STATUS.error(format(i18n.t("api:configFailed"), { error: result.error || "Unknown error" })));
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
|
-
function showStatus(lang
|
|
68
|
-
displayCurrentStatus(lang);
|
|
70
|
+
function showStatus(lang) {
|
|
71
|
+
displayCurrentStatus(resolveApiCommandLanguage(lang));
|
|
69
72
|
}
|
|
70
|
-
async function testApi(lang
|
|
71
|
-
await testApiConnection(lang);
|
|
73
|
+
async function testApi(lang) {
|
|
74
|
+
await testApiConnection(resolveApiCommandLanguage(lang));
|
|
72
75
|
}
|
|
73
|
-
async function runWizard(lang
|
|
74
|
-
await runConfigWizard(lang);
|
|
76
|
+
async function runWizard(lang) {
|
|
77
|
+
await runConfigWizard(resolveApiCommandLanguage(lang));
|
|
75
78
|
}
|
|
76
79
|
async function apiCommand(action = "wizard", args = [], options = {}) {
|
|
77
|
-
const lang = options.lang
|
|
80
|
+
const lang = resolveApiCommandLanguage(options.lang);
|
|
78
81
|
switch (action) {
|
|
79
82
|
case "list":
|
|
80
83
|
case "ls":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import a from './index5.mjs';
|
|
2
2
|
import { c as consola, P as ProjectAnalyzer } from '../shared/ccjk.Cv13QsGp.mjs';
|
|
3
|
-
import { i18n } from './index2.mjs';
|
|
3
|
+
import { i18n, resolveSupportedLanguage } from './index2.mjs';
|
|
4
4
|
import { promises } from 'node:fs';
|
|
5
5
|
import { performance } from 'node:perf_hooks';
|
|
6
6
|
import { ccjkAgents } from './ccjk-agents.mjs';
|
|
@@ -680,7 +680,7 @@ class SetupOrchestrator {
|
|
|
680
680
|
}
|
|
681
681
|
|
|
682
682
|
async function ccjkSetup(options = {}) {
|
|
683
|
-
const lang = options.lang
|
|
683
|
+
const lang = resolveSupportedLanguage(options.lang);
|
|
684
684
|
if (lang !== i18n.language) {
|
|
685
685
|
await i18n.changeLanguage(lang);
|
|
686
686
|
}
|
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
import a from './index5.mjs';
|
|
6
6
|
import { c as consola, a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.Cv13QsGp.mjs';
|
|
7
7
|
import { i as inquirer } from './index6.mjs';
|
|
8
|
-
import { i18n } from './index2.mjs';
|
|
8
|
+
import { resolveSupportedLanguage, i18n } from './index2.mjs';
|
|
9
9
|
import { g as getSkillParser } from '../shared/ccjk.DsYaCCx4.mjs';
|
|
10
10
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
11
11
|
import './index9.mjs';
|
|
@@ -33,8 +33,12 @@ async function ccjkSkills(options = {}) {
|
|
|
33
33
|
const logger = consola.withTag("ccjk:skills");
|
|
34
34
|
const startTime = Date.now();
|
|
35
35
|
try {
|
|
36
|
+
const lang = resolveSupportedLanguage(options.lang);
|
|
37
|
+
if (lang !== i18n.language) {
|
|
38
|
+
await i18n.changeLanguage(lang);
|
|
39
|
+
}
|
|
36
40
|
const opts = {
|
|
37
|
-
lang
|
|
41
|
+
lang,
|
|
38
42
|
interactive: options.interactive ?? true,
|
|
39
43
|
category: options.category || "",
|
|
40
44
|
tags: options.tags || [],
|
package/dist/chunks/index10.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import a from './index5.mjs';
|
|
2
2
|
import { i as inquirer } from './index6.mjs';
|
|
3
3
|
import { CLOUD_ENDPOINTS, CCJK_CONFIG_DIR, SUPPORTED_LANGS, LANG_LABELS, CODE_TOOL_BANNERS, isCodeToolType, DEFAULT_CODE_TOOL_TYPE } from './constants.mjs';
|
|
4
|
-
import { ensureI18nInitialized, i18n, changeLanguage } from './index2.mjs';
|
|
4
|
+
import { ensureI18nInitialized, i18n, resolveSupportedLanguage, changeLanguage } from './index2.mjs';
|
|
5
5
|
import { displayBannerWithInfo } from './banner.mjs';
|
|
6
6
|
import { readZcfConfig, updateZcfConfig } from './ccjk-config.mjs';
|
|
7
7
|
import { c as runCodexUpdate, m as runCodexUninstall, n as configureCodexAiMemoryFeature, o as configureCodexDefaultModelFeature, p as configureCodexMcp, q as configureCodexApi, t as configureCodexPresetFeature, u as runCodexWorkflowImportWithLanguageSelection, k as runCodexFullInit } from './codex.mjs';
|
|
@@ -2653,7 +2653,10 @@ async function hooksSync(options = {}) {
|
|
|
2653
2653
|
if (!options.skipBanner) {
|
|
2654
2654
|
displayBannerWithInfo();
|
|
2655
2655
|
}
|
|
2656
|
-
const lang = options.lang
|
|
2656
|
+
const lang = resolveSupportedLanguage(options.lang);
|
|
2657
|
+
if (lang !== i18n.language) {
|
|
2658
|
+
await i18n.changeLanguage(lang);
|
|
2659
|
+
}
|
|
2657
2660
|
if (options.action) {
|
|
2658
2661
|
switch (options.action) {
|
|
2659
2662
|
case "sync":
|
package/dist/chunks/index2.mjs
CHANGED
|
@@ -7618,6 +7618,13 @@ function format(template, values) {
|
|
|
7618
7618
|
async function changeLanguage(lng) {
|
|
7619
7619
|
await i18n.changeLanguage(lng);
|
|
7620
7620
|
}
|
|
7621
|
+
function resolveSupportedLanguage(language, fallback = "en") {
|
|
7622
|
+
const effectiveLanguage = language || i18n.language || fallback;
|
|
7623
|
+
if (typeof effectiveLanguage === "string" && effectiveLanguage.toLowerCase().startsWith("zh")) {
|
|
7624
|
+
return "zh-CN";
|
|
7625
|
+
}
|
|
7626
|
+
return "en";
|
|
7627
|
+
}
|
|
7621
7628
|
function getTranslation(_lang) {
|
|
7622
7629
|
return (key, options) => {
|
|
7623
7630
|
if (key.includes(":")) {
|
|
@@ -7627,4 +7634,4 @@ function getTranslation(_lang) {
|
|
|
7627
7634
|
};
|
|
7628
7635
|
}
|
|
7629
7636
|
|
|
7630
|
-
export { changeLanguage, ensureI18nInitialized, format, getTranslation, i18n, initI18n };
|
|
7637
|
+
export { changeLanguage, ensureI18nInitialized, format, getTranslation, i18n, initI18n, resolveSupportedLanguage };
|
package/dist/chunks/index4.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as configureOfficialMode, a as configureSimpleMode, b as configureWithPreset, e as detectCurrentMode, d as displayCurrentStatus, g as getCurrentConfig, q as quickSetup, r as runConfigWizard, t as testApiConnection, v as validateApiKey } from '../shared/ccjk.
|
|
1
|
+
export { c as configureOfficialMode, a as configureSimpleMode, b as configureWithPreset, e as detectCurrentMode, d as displayCurrentStatus, g as getCurrentConfig, q as quickSetup, r as runConfigWizard, t as testApiConnection, v as validateApiKey } from '../shared/ccjk.B2f-cwUP.mjs';
|
|
2
2
|
export { P as PROVIDER_PRESETS, g as getAllPresets, a as getChinesePresets, b as getPresetById, c as getRecommendedPresets } from '../shared/ccjk.DopKzo3z.mjs';
|
|
3
3
|
import './index5.mjs';
|
|
4
4
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
@@ -18,7 +18,9 @@ import 'node:os';
|
|
|
18
18
|
import 'node:crypto';
|
|
19
19
|
import 'buffer';
|
|
20
20
|
import 'string_decoder';
|
|
21
|
+
import './index2.mjs';
|
|
21
22
|
import 'node:fs';
|
|
23
|
+
import 'node:url';
|
|
24
|
+
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
22
25
|
import './fs-operations.mjs';
|
|
23
26
|
import 'node:fs/promises';
|
|
24
|
-
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
package/dist/chunks/package.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import a from './index5.mjs';
|
|
2
2
|
import { i as inquirer } from './index6.mjs';
|
|
3
3
|
import { d as detectSmartDefaults } from './smart-defaults.mjs';
|
|
4
|
-
import { i18n } from './index2.mjs';
|
|
4
|
+
import { resolveSupportedLanguage, i18n } from './index2.mjs';
|
|
5
5
|
import { updateZcfConfig } from './ccjk-config.mjs';
|
|
6
6
|
import { g as getRuntimeVersion } from '../shared/ccjk.gDEDGD_t.mjs';
|
|
7
7
|
import { i as init } from './init.mjs';
|
|
@@ -274,7 +274,7 @@ async function quickSetup(options = {}) {
|
|
|
274
274
|
errors: []
|
|
275
275
|
};
|
|
276
276
|
try {
|
|
277
|
-
const lang = options.lang
|
|
277
|
+
const lang = resolveSupportedLanguage(options.lang);
|
|
278
278
|
if (lang !== i18n.language) {
|
|
279
279
|
await i18n.changeLanguage(lang);
|
|
280
280
|
}
|
package/dist/chunks/skills.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import a from './index5.mjs';
|
|
2
2
|
import { i as inquirer } from './index6.mjs';
|
|
3
|
-
import { i18n } from './index2.mjs';
|
|
3
|
+
import { i18n, resolveSupportedLanguage } from './index2.mjs';
|
|
4
4
|
import { searchSkills, getSkill, getAllSkills, addSkill, setSkillEnabled, removeSkill, getBatchCategories, createBatchSkills } from './manager.mjs';
|
|
5
5
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
6
6
|
import 'node:readline';
|
|
@@ -26,7 +26,11 @@ import './skill.mjs';
|
|
|
26
26
|
import './fs-operations.mjs';
|
|
27
27
|
import 'node:fs/promises';
|
|
28
28
|
|
|
29
|
+
function resolveSkillsLanguage(lang) {
|
|
30
|
+
return resolveSupportedLanguage(lang);
|
|
31
|
+
}
|
|
29
32
|
async function listSkills(options = {}) {
|
|
33
|
+
const lang = resolveSkillsLanguage(options.lang);
|
|
30
34
|
console.log("");
|
|
31
35
|
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
32
36
|
console.log(a.bold.cyan(` ${i18n.t("skills:title.list")}`));
|
|
@@ -56,8 +60,8 @@ async function listSkills(options = {}) {
|
|
|
56
60
|
console.log("");
|
|
57
61
|
for (const skill of categorySkills) {
|
|
58
62
|
const statusIcon = skill.enabled ? a.green("\u2713") : a.dim("\u25CB");
|
|
59
|
-
const name = skill.name[
|
|
60
|
-
const description = skill.description[
|
|
63
|
+
const name = skill.name[lang];
|
|
64
|
+
const description = skill.description[lang];
|
|
61
65
|
const triggers = skill.triggers.map((t) => a.green(t)).join(", ");
|
|
62
66
|
console.log(` ${statusIcon} ${a.bold(name)} ${a.dim(`(${skill.id})`)}`);
|
|
63
67
|
console.log(` ${a.dim(description)}`);
|
|
@@ -78,6 +82,7 @@ async function listSkills(options = {}) {
|
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
async function runSkill(skillName, options = {}) {
|
|
85
|
+
const lang = resolveSkillsLanguage(options.lang);
|
|
81
86
|
console.log("");
|
|
82
87
|
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
83
88
|
console.log(a.bold.cyan(` ${i18n.t("skills:title.run")}`));
|
|
@@ -98,15 +103,15 @@ async function runSkill(skillName, options = {}) {
|
|
|
98
103
|
return;
|
|
99
104
|
}
|
|
100
105
|
if (!skill.enabled) {
|
|
101
|
-
console.warn(a.yellow(` ${i18n.t("skills:warning.skillDisabled", { name: skill.name[
|
|
106
|
+
console.warn(a.yellow(` ${i18n.t("skills:warning.skillDisabled", { name: skill.name[lang] })}`));
|
|
102
107
|
console.log("");
|
|
103
108
|
console.log(a.dim(` ${i18n.t("skills:hint.enableSkill")}`));
|
|
104
109
|
console.log(a.dim(` ccjk skills enable ${skill.id}`));
|
|
105
110
|
console.log("");
|
|
106
111
|
return;
|
|
107
112
|
}
|
|
108
|
-
console.log(a.bold(` ${skill.name[
|
|
109
|
-
console.log(a.dim(` ${skill.description[
|
|
113
|
+
console.log(a.bold(` ${skill.name[lang]}`));
|
|
114
|
+
console.log(a.dim(` ${skill.description[lang]}`));
|
|
110
115
|
console.log("");
|
|
111
116
|
console.log(a.bold.green(` ${i18n.t("skills:label.template")}:`));
|
|
112
117
|
console.log("");
|
|
@@ -125,6 +130,7 @@ async function runSkill(skillName, options = {}) {
|
|
|
125
130
|
}
|
|
126
131
|
}
|
|
127
132
|
async function showSkillInfo(skillName, options = {}) {
|
|
133
|
+
const lang = resolveSkillsLanguage(options.lang);
|
|
128
134
|
console.log("");
|
|
129
135
|
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
130
136
|
console.log(a.bold.cyan(` ${i18n.t("skills:title.info")}`));
|
|
@@ -137,8 +143,8 @@ async function showSkillInfo(skillName, options = {}) {
|
|
|
137
143
|
console.log("");
|
|
138
144
|
return;
|
|
139
145
|
}
|
|
140
|
-
const name = skill.name[
|
|
141
|
-
const description = skill.description[
|
|
146
|
+
const name = skill.name[lang];
|
|
147
|
+
const description = skill.description[lang];
|
|
142
148
|
const statusBadge = skill.enabled ? a.bgGreen.white(" ENABLED ") : a.bgRed.white(" DISABLED ");
|
|
143
149
|
console.log(`${a.bold.green(` ${name}`)} ${statusBadge}`);
|
|
144
150
|
console.log(a.dim(` ${description}`));
|
|
@@ -179,6 +185,7 @@ async function showSkillInfo(skillName, options = {}) {
|
|
|
179
185
|
}
|
|
180
186
|
}
|
|
181
187
|
async function createSkill(skillName, options = {}) {
|
|
188
|
+
const lang = resolveSkillsLanguage(options.lang);
|
|
182
189
|
console.log("");
|
|
183
190
|
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
184
191
|
console.log(a.bold.cyan(` ${i18n.t("skills:title.create")}`));
|
|
@@ -247,7 +254,7 @@ async function createSkill(skillName, options = {}) {
|
|
|
247
254
|
type: "editor",
|
|
248
255
|
name: "template",
|
|
249
256
|
message: i18n.t("skills:prompt.template"),
|
|
250
|
-
default: getDefaultTemplate(skillName,
|
|
257
|
+
default: getDefaultTemplate(skillName, lang)
|
|
251
258
|
}
|
|
252
259
|
]);
|
|
253
260
|
const skill = {
|
|
@@ -269,7 +276,7 @@ async function createSkill(skillName, options = {}) {
|
|
|
269
276
|
const result = addSkill(skill);
|
|
270
277
|
if (result.success) {
|
|
271
278
|
console.log(a.green(`
|
|
272
|
-
\u2713 ${i18n.t("skills:message.skillCreated", { name: skill.name[
|
|
279
|
+
\u2713 ${i18n.t("skills:message.skillCreated", { name: skill.name[lang] })}`));
|
|
273
280
|
console.log(a.dim(` ${i18n.t("skills:label.path")}: ${result.path}`));
|
|
274
281
|
console.log("");
|
|
275
282
|
console.log(a.dim(` ${i18n.t("skills:hint.runSkill")}`));
|
|
@@ -287,18 +294,19 @@ async function createSkill(skillName, options = {}) {
|
|
|
287
294
|
}
|
|
288
295
|
async function enableSkill(skillName, options = {}) {
|
|
289
296
|
try {
|
|
297
|
+
const lang = resolveSkillsLanguage(options.lang);
|
|
290
298
|
const skill = getSkill(skillName);
|
|
291
299
|
if (!skill) {
|
|
292
300
|
console.error(a.red(` ${i18n.t("skills:error.skillNotFound", { name: skillName })}`));
|
|
293
301
|
return;
|
|
294
302
|
}
|
|
295
303
|
if (skill.enabled) {
|
|
296
|
-
console.log(a.yellow(` ${i18n.t("skills:message.alreadyEnabled", { name: skill.name[
|
|
304
|
+
console.log(a.yellow(` ${i18n.t("skills:message.alreadyEnabled", { name: skill.name[lang] })}`));
|
|
297
305
|
return;
|
|
298
306
|
}
|
|
299
307
|
const success = setSkillEnabled(skillName, true);
|
|
300
308
|
if (success) {
|
|
301
|
-
console.log(a.green(` \u2713 ${i18n.t("skills:message.skillEnabled", { name: skill.name[
|
|
309
|
+
console.log(a.green(` \u2713 ${i18n.t("skills:message.skillEnabled", { name: skill.name[lang] })}`));
|
|
302
310
|
} else {
|
|
303
311
|
console.error(a.red(` ${i18n.t("skills:error.enableFailed")}`));
|
|
304
312
|
}
|
|
@@ -310,18 +318,19 @@ async function enableSkill(skillName, options = {}) {
|
|
|
310
318
|
}
|
|
311
319
|
async function disableSkill(skillName, options = {}) {
|
|
312
320
|
try {
|
|
321
|
+
const lang = resolveSkillsLanguage(options.lang);
|
|
313
322
|
const skill = getSkill(skillName);
|
|
314
323
|
if (!skill) {
|
|
315
324
|
console.error(a.red(` ${i18n.t("skills:error.skillNotFound", { name: skillName })}`));
|
|
316
325
|
return;
|
|
317
326
|
}
|
|
318
327
|
if (!skill.enabled) {
|
|
319
|
-
console.log(a.yellow(` ${i18n.t("skills:message.alreadyDisabled", { name: skill.name[
|
|
328
|
+
console.log(a.yellow(` ${i18n.t("skills:message.alreadyDisabled", { name: skill.name[lang] })}`));
|
|
320
329
|
return;
|
|
321
330
|
}
|
|
322
331
|
const success = setSkillEnabled(skillName, false);
|
|
323
332
|
if (success) {
|
|
324
|
-
console.log(a.green(` \u2713 ${i18n.t("skills:message.skillDisabled", { name: skill.name[
|
|
333
|
+
console.log(a.green(` \u2713 ${i18n.t("skills:message.skillDisabled", { name: skill.name[lang] })}`));
|
|
325
334
|
} else {
|
|
326
335
|
console.error(a.red(` ${i18n.t("skills:error.disableFailed")}`));
|
|
327
336
|
}
|
|
@@ -333,6 +342,7 @@ async function disableSkill(skillName, options = {}) {
|
|
|
333
342
|
}
|
|
334
343
|
async function deleteSkill(skillName, options = {}) {
|
|
335
344
|
try {
|
|
345
|
+
const lang = resolveSkillsLanguage(options.lang);
|
|
336
346
|
const skill = getSkill(skillName);
|
|
337
347
|
if (!skill) {
|
|
338
348
|
console.error(a.red(` ${i18n.t("skills:error.skillNotFound", { name: skillName })}`));
|
|
@@ -341,7 +351,7 @@ async function deleteSkill(skillName, options = {}) {
|
|
|
341
351
|
const { confirm } = await inquirer.prompt({
|
|
342
352
|
type: "confirm",
|
|
343
353
|
name: "confirm",
|
|
344
|
-
message: i18n.t("skills:prompt.confirmDelete", { name: skill.name[
|
|
354
|
+
message: i18n.t("skills:prompt.confirmDelete", { name: skill.name[lang] }),
|
|
345
355
|
default: false
|
|
346
356
|
});
|
|
347
357
|
if (!confirm) {
|
|
@@ -350,7 +360,7 @@ async function deleteSkill(skillName, options = {}) {
|
|
|
350
360
|
}
|
|
351
361
|
const success = removeSkill(skillName);
|
|
352
362
|
if (success) {
|
|
353
|
-
console.log(a.green(` \u2713 ${i18n.t("skills:message.skillDeleted", { name: skill.name[
|
|
363
|
+
console.log(a.green(` \u2713 ${i18n.t("skills:message.skillDeleted", { name: skill.name[lang] })}`));
|
|
354
364
|
} else {
|
|
355
365
|
console.error(a.red(` ${i18n.t("skills:error.deleteFailed")}`));
|
|
356
366
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import a from './index5.mjs';
|
|
2
2
|
import { i as inquirer } from './index6.mjs';
|
|
3
3
|
import { ZCF_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, isCodeToolType } from './constants.mjs';
|
|
4
|
-
import { i18n, ensureI18nInitialized } from './index2.mjs';
|
|
4
|
+
import { i18n, ensureI18nInitialized, resolveSupportedLanguage } from './index2.mjs';
|
|
5
5
|
import { readZcfConfig } from './ccjk-config.mjs';
|
|
6
6
|
import { r as resolveCodeType } from '../shared/ccjk.CiKtBUW_.mjs';
|
|
7
7
|
import { a as handleExitPromptError, h as handleGeneralError } from '../shared/ccjk.DGllfVCZ.mjs';
|
|
@@ -612,7 +612,11 @@ async function uninstall(options = {}) {
|
|
|
612
612
|
const config = readZcfConfig();
|
|
613
613
|
codeType = config?.codeToolType && isCodeToolType(config.codeToolType) ? config.codeToolType : DEFAULT_CODE_TOOL_TYPE;
|
|
614
614
|
}
|
|
615
|
-
const
|
|
615
|
+
const lang = resolveSupportedLanguage(options.lang);
|
|
616
|
+
if (lang !== i18n.language) {
|
|
617
|
+
await i18n.changeLanguage(lang);
|
|
618
|
+
}
|
|
619
|
+
const uninstaller = new ZcfUninstaller(lang);
|
|
616
620
|
if (codeType === "codex") {
|
|
617
621
|
const { runCodexUninstall } = await import('./codex.mjs').then(function (n) { return n.v; });
|
|
618
622
|
await runCodexUninstall();
|
package/dist/cli.mjs
CHANGED
|
File without changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import a from '../chunks/index5.mjs';
|
|
2
2
|
import { i as inquirer } from '../chunks/index6.mjs';
|
|
3
|
+
import { i18n } from '../chunks/index2.mjs';
|
|
3
4
|
import { b as getPresetById, c as getRecommendedPresets, a as getChinesePresets, g as getAllPresets } from './ccjk.DopKzo3z.mjs';
|
|
4
5
|
import { existsSync, readFileSync, mkdirSync } from 'node:fs';
|
|
5
6
|
import { homedir } from 'node:os';
|
|
@@ -182,7 +183,12 @@ function quickSetup(providerId, apiKey) {
|
|
|
182
183
|
return configureWithPreset(preset, apiKey);
|
|
183
184
|
}
|
|
184
185
|
|
|
185
|
-
function
|
|
186
|
+
function resolveApiRouterLang(lang) {
|
|
187
|
+
const effectiveLang = lang || i18n.language;
|
|
188
|
+
return typeof effectiveLang === "string" && effectiveLang.toLowerCase().startsWith("zh") ? "zh-CN" : "en";
|
|
189
|
+
}
|
|
190
|
+
function displayCurrentStatus(lang) {
|
|
191
|
+
lang = resolveApiRouterLang(lang);
|
|
186
192
|
const { mode, provider } = detectCurrentMode();
|
|
187
193
|
const config = getCurrentConfig();
|
|
188
194
|
console.log("");
|
|
@@ -215,7 +221,8 @@ function displayCurrentStatus(lang = "en") {
|
|
|
215
221
|
}
|
|
216
222
|
console.log("");
|
|
217
223
|
}
|
|
218
|
-
async function runConfigWizard(lang
|
|
224
|
+
async function runConfigWizard(lang) {
|
|
225
|
+
lang = resolveApiRouterLang(lang);
|
|
219
226
|
console.log("");
|
|
220
227
|
console.log(a.green("\u2550".repeat(50)));
|
|
221
228
|
console.log(a.bold.cyan(lang === "zh-CN" ? " API \u914D\u7F6E\u5411\u5BFC" : " API Configuration Wizard"));
|
|
@@ -223,20 +230,20 @@ async function runConfigWizard(lang = "en") {
|
|
|
223
230
|
console.log("");
|
|
224
231
|
const modeChoices = [
|
|
225
232
|
{
|
|
226
|
-
name: lang === "zh-CN" ? "1. \
|
|
227
|
-
value: "
|
|
233
|
+
name: lang === "zh-CN" ? "1. \u81EA\u5B9A\u4E49\u914D\u7F6E - \u624B\u52A8\u8F93\u5165 API \u5730\u5740\u548C\u5BC6\u94A5" : "1. Custom Configuration - Manual API URL and key",
|
|
234
|
+
value: "custom"
|
|
228
235
|
},
|
|
229
236
|
{
|
|
230
237
|
name: lang === "zh-CN" ? "2. \u5B98\u65B9 Anthropic API - \u76F4\u63A5\u8FDE\u63A5 Anthropic" : "2. Official Anthropic API - Direct connection",
|
|
231
238
|
value: "official"
|
|
232
239
|
},
|
|
233
240
|
{
|
|
234
|
-
name: lang === "zh-CN" ? "3. \
|
|
235
|
-
value: "
|
|
241
|
+
name: lang === "zh-CN" ? "3. CCR \u9AD8\u7EA7\u8DEF\u7531 - \u5B8C\u6574 Claude Code Router \u914D\u7F6E" : "3. CCR Advanced Router - Full Claude Code Router setup",
|
|
242
|
+
value: "ccr"
|
|
236
243
|
},
|
|
237
244
|
{
|
|
238
|
-
name: lang === "zh-CN" ? "4.
|
|
239
|
-
value: "
|
|
245
|
+
name: lang === "zh-CN" ? "4. \u5FEB\u901F\u914D\u7F6E (\u63A8\u8350) - \u9009\u62E9\u9884\u8BBE\u63D0\u4F9B\u5546" : "4. Quick Setup (Recommended) - Choose preset provider",
|
|
246
|
+
value: "quick"
|
|
240
247
|
}
|
|
241
248
|
];
|
|
242
249
|
const { mode } = await inquirer.prompt({
|
|
@@ -426,7 +433,8 @@ async function runCcrSetup(lang) {
|
|
|
426
433
|
};
|
|
427
434
|
}
|
|
428
435
|
}
|
|
429
|
-
async function testApiConnection(lang
|
|
436
|
+
async function testApiConnection(lang) {
|
|
437
|
+
lang = resolveApiRouterLang(lang);
|
|
430
438
|
const config = getCurrentConfig();
|
|
431
439
|
if (!config || !config.ANTHROPIC_API_KEY && !config.ANTHROPIC_AUTH_TOKEN) {
|
|
432
440
|
console.log(a.yellow(lang === "zh-CN" ? "\u26A0 \u672A\u914D\u7F6E API" : "\u26A0 No API configured"));
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccjk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "13.6.
|
|
5
|
-
"packageManager": "pnpm@10.17.1",
|
|
4
|
+
"version": "13.6.2",
|
|
6
5
|
"description": "Production-ready AI dev environment for Claude Code, Codex, and modern coding workflows with 30-second onboarding, persistent memory, Agent Teams, remote control, and capability discovery.",
|
|
7
6
|
"author": {
|
|
8
7
|
"name": "CCJK Team",
|
|
@@ -81,71 +80,6 @@
|
|
|
81
80
|
"engines": {
|
|
82
81
|
"node": ">=20"
|
|
83
82
|
},
|
|
84
|
-
"scripts": {
|
|
85
|
-
"dev": "tsx ./src/cli.ts",
|
|
86
|
-
"build": "unbuild",
|
|
87
|
-
"start": "node bin/ccjk.mjs",
|
|
88
|
-
"typecheck": "tsc --noEmit",
|
|
89
|
-
"release:verify": "node scripts/release-verify.mjs",
|
|
90
|
-
"release:verify:full": "node scripts/release-verify.mjs --with-tests",
|
|
91
|
-
"prepublishOnly": "node scripts/validate-prepublish.mjs && pnpm contract:check && pnpm build",
|
|
92
|
-
"lint": "eslint",
|
|
93
|
-
"lint:fix": "eslint --fix",
|
|
94
|
-
"test": "vitest",
|
|
95
|
-
"test:ui": "vitest --ui",
|
|
96
|
-
"test:coverage": "vitest run --coverage",
|
|
97
|
-
"test:run": "vitest run",
|
|
98
|
-
"test:watch": "vitest watch",
|
|
99
|
-
"test:e2e": "NODE_ENV=test vitest --config vitest.e2e.config.ts",
|
|
100
|
-
"test:e2e:run": "NODE_ENV=test vitest run --config vitest.e2e.config.ts",
|
|
101
|
-
"test:e2e:ui": "NODE_ENV=test vitest --config vitest.e2e.config.ts --ui",
|
|
102
|
-
"test:e2e:coverage": "NODE_ENV=test vitest run --config vitest.e2e.config.ts --coverage",
|
|
103
|
-
"test:e2e:debug": "NODE_ENV=test CCJK_E2E_DEBUG=true vitest --config vitest.e2e.config.ts",
|
|
104
|
-
"test:v2": "vitest --config vitest.config.v2.ts",
|
|
105
|
-
"test:v2:ui": "vitest --config vitest.config.v2.ts --ui",
|
|
106
|
-
"test:v2:coverage": "vitest run --config vitest.config.v2.ts --coverage",
|
|
107
|
-
"test:v2:run": "vitest run --config vitest.config.v2.ts",
|
|
108
|
-
"test:v2:watch": "vitest watch --config vitest.config.v2.ts",
|
|
109
|
-
"test:integration": "NODE_ENV=test vitest --config vitest.integration.config.ts",
|
|
110
|
-
"test:integration:run": "NODE_ENV=test vitest run --config vitest.integration.config.ts",
|
|
111
|
-
"test:integration:ui": "NODE_ENV=test vitest --config vitest.integration.config.ts --ui",
|
|
112
|
-
"test:integration:coverage": "NODE_ENV=test vitest run --config vitest.integration.config.ts --coverage",
|
|
113
|
-
"prepare": "husky",
|
|
114
|
-
"format": "prettier --write src/**/*.ts",
|
|
115
|
-
"prepublish:fix": "node scripts/fix-package-catalog.mjs",
|
|
116
|
-
"cleanup": "node scripts/cleanup.js",
|
|
117
|
-
"cleanup:auto": "node scripts/cleanup.js --auto",
|
|
118
|
-
"cleanup:dry": "node scripts/cleanup.js --dry-run",
|
|
119
|
-
"clean": "rm -rf dist coverage .turbo *.tsbuildinfo",
|
|
120
|
-
"benchmark:compression": "tsx scripts/benchmark-compression.ts",
|
|
121
|
-
"v2:setup": "chmod +x scripts/v2-dev-setup.sh && ./scripts/v2-dev-setup.sh",
|
|
122
|
-
"v2:setup:skip-tests": "chmod +x scripts/v2-dev-setup.sh && ./scripts/v2-dev-setup.sh --skip-tests",
|
|
123
|
-
"v2:services:up": "docker-compose -f docker-compose.dev.yml up -d",
|
|
124
|
-
"v2:services:down": "docker-compose -f docker-compose.dev.yml down",
|
|
125
|
-
"v2:services:restart": "docker-compose -f docker-compose.dev.yml restart",
|
|
126
|
-
"v2:services:logs": "docker-compose -f docker-compose.dev.yml logs -f",
|
|
127
|
-
"v2:services:status": "docker-compose -f docker-compose.dev.yml ps",
|
|
128
|
-
"v2:db:reset": "docker-compose -f docker-compose.dev.yml down postgres && docker volume rm ccjk-public_postgres_data && docker-compose -f docker-compose.dev.yml up -d postgres",
|
|
129
|
-
"v2:db:migrate": "echo 'Database migration script - to be implemented'",
|
|
130
|
-
"v2:db:seed": "echo 'Database seeding script - to be implemented'",
|
|
131
|
-
"v2:cache:clear": "docker exec ccjk-redis-dev redis-cli FLUSHALL",
|
|
132
|
-
"v2:search:reindex": "curl -X DELETE http://localhost:9200/ccjk_dev* && echo 'Elasticsearch indexes cleared'",
|
|
133
|
-
"v2:health": "chmod +x scripts/health-check.sh && ./scripts/health-check.sh",
|
|
134
|
-
"v2:dev": "concurrently \"pnpm v2:services:up\" \"pnpm dev\"",
|
|
135
|
-
"v2:test:integration": "NODE_ENV=test pnpm test -- --config vitest.integration.config.ts",
|
|
136
|
-
"v2:test:e2e": "NODE_ENV=test pnpm test -- --config vitest.e2e.config.ts",
|
|
137
|
-
"v2:monitoring:up": "docker-compose -f docker-compose.dev.yml --profile monitoring up -d",
|
|
138
|
-
"v2:tracing:up": "docker-compose -f docker-compose.dev.yml --profile tracing up -d",
|
|
139
|
-
"v2:clean": "pnpm clean && docker-compose -f docker-compose.dev.yml down -v && docker system prune -f",
|
|
140
|
-
"benchmark": "tsx src/v2/__tests__/benchmarks.ts",
|
|
141
|
-
"benchmark:save": "tsx src/v2/__tests__/benchmarks.ts && echo 'Results saved to .ccjk/benchmark-results.json'",
|
|
142
|
-
"benchmark:detailed": "tsx src/v2/__tests__/benchmarks.ts --detailed",
|
|
143
|
-
"benchmark:server": "npx http-server docs/v2 -p 8080 -o dashboard.html",
|
|
144
|
-
"benchmark:open": "open docs/v2/dashboard.html || xdg-open docs/v2/dashboard.html || start docs/v2/dashboard.html",
|
|
145
|
-
"i18n:check": "tsx scripts/check-i18n.ts",
|
|
146
|
-
"i18n:report": "tsx scripts/check-i18n.ts --report",
|
|
147
|
-
"contract:check": "node scripts/check-remote-contract.mjs"
|
|
148
|
-
},
|
|
149
83
|
"dependencies": {
|
|
150
84
|
"better-sqlite3": "^12.6.2",
|
|
151
85
|
"fdir": "^6.5.0",
|
|
@@ -208,5 +142,68 @@
|
|
|
208
142
|
"unbuild": "^3.6.1",
|
|
209
143
|
"uuid": "^11.1.0",
|
|
210
144
|
"vitest": "^3.2.4"
|
|
145
|
+
},
|
|
146
|
+
"scripts": {
|
|
147
|
+
"dev": "tsx ./src/cli.ts",
|
|
148
|
+
"build": "unbuild",
|
|
149
|
+
"start": "node bin/ccjk.mjs",
|
|
150
|
+
"typecheck": "tsc --noEmit",
|
|
151
|
+
"release:verify": "node scripts/release-verify.mjs",
|
|
152
|
+
"release:verify:full": "node scripts/release-verify.mjs --with-tests",
|
|
153
|
+
"lint": "eslint",
|
|
154
|
+
"lint:fix": "eslint --fix",
|
|
155
|
+
"test": "vitest",
|
|
156
|
+
"test:ui": "vitest --ui",
|
|
157
|
+
"test:coverage": "vitest run --coverage",
|
|
158
|
+
"test:run": "vitest run",
|
|
159
|
+
"test:watch": "vitest watch",
|
|
160
|
+
"test:e2e": "NODE_ENV=test vitest --config vitest.e2e.config.ts",
|
|
161
|
+
"test:e2e:run": "NODE_ENV=test vitest run --config vitest.e2e.config.ts",
|
|
162
|
+
"test:e2e:ui": "NODE_ENV=test vitest --config vitest.e2e.config.ts --ui",
|
|
163
|
+
"test:e2e:coverage": "NODE_ENV=test vitest run --config vitest.e2e.config.ts --coverage",
|
|
164
|
+
"test:e2e:debug": "NODE_ENV=test CCJK_E2E_DEBUG=true vitest --config vitest.e2e.config.ts",
|
|
165
|
+
"test:v2": "vitest --config vitest.config.v2.ts",
|
|
166
|
+
"test:v2:ui": "vitest --config vitest.config.v2.ts --ui",
|
|
167
|
+
"test:v2:coverage": "vitest run --config vitest.config.v2.ts --coverage",
|
|
168
|
+
"test:v2:run": "vitest run --config vitest.config.v2.ts",
|
|
169
|
+
"test:v2:watch": "vitest watch --config vitest.config.v2.ts",
|
|
170
|
+
"test:integration": "NODE_ENV=test vitest --config vitest.integration.config.ts",
|
|
171
|
+
"test:integration:run": "NODE_ENV=test vitest run --config vitest.integration.config.ts",
|
|
172
|
+
"test:integration:ui": "NODE_ENV=test vitest --config vitest.integration.config.ts --ui",
|
|
173
|
+
"test:integration:coverage": "NODE_ENV=test vitest run --config vitest.integration.config.ts --coverage",
|
|
174
|
+
"format": "prettier --write src/**/*.ts",
|
|
175
|
+
"prepublish:fix": "node scripts/fix-package-catalog.mjs",
|
|
176
|
+
"cleanup": "node scripts/cleanup.js",
|
|
177
|
+
"cleanup:auto": "node scripts/cleanup.js --auto",
|
|
178
|
+
"cleanup:dry": "node scripts/cleanup.js --dry-run",
|
|
179
|
+
"clean": "rm -rf dist coverage .turbo *.tsbuildinfo",
|
|
180
|
+
"benchmark:compression": "tsx scripts/benchmark-compression.ts",
|
|
181
|
+
"v2:setup": "chmod +x scripts/v2-dev-setup.sh && ./scripts/v2-dev-setup.sh",
|
|
182
|
+
"v2:setup:skip-tests": "chmod +x scripts/v2-dev-setup.sh && ./scripts/v2-dev-setup.sh --skip-tests",
|
|
183
|
+
"v2:services:up": "docker-compose -f docker-compose.dev.yml up -d",
|
|
184
|
+
"v2:services:down": "docker-compose -f docker-compose.dev.yml down",
|
|
185
|
+
"v2:services:restart": "docker-compose -f docker-compose.dev.yml restart",
|
|
186
|
+
"v2:services:logs": "docker-compose -f docker-compose.dev.yml logs -f",
|
|
187
|
+
"v2:services:status": "docker-compose -f docker-compose.dev.yml ps",
|
|
188
|
+
"v2:db:reset": "docker-compose -f docker-compose.dev.yml down postgres && docker volume rm ccjk-public_postgres_data && docker-compose -f docker-compose.dev.yml up -d postgres",
|
|
189
|
+
"v2:db:migrate": "echo 'Database migration script - to be implemented'",
|
|
190
|
+
"v2:db:seed": "echo 'Database seeding script - to be implemented'",
|
|
191
|
+
"v2:cache:clear": "docker exec ccjk-redis-dev redis-cli FLUSHALL",
|
|
192
|
+
"v2:search:reindex": "curl -X DELETE http://localhost:9200/ccjk_dev* && echo 'Elasticsearch indexes cleared'",
|
|
193
|
+
"v2:health": "chmod +x scripts/health-check.sh && ./scripts/health-check.sh",
|
|
194
|
+
"v2:dev": "concurrently \"pnpm v2:services:up\" \"pnpm dev\"",
|
|
195
|
+
"v2:test:integration": "NODE_ENV=test pnpm test -- --config vitest.integration.config.ts",
|
|
196
|
+
"v2:test:e2e": "NODE_ENV=test pnpm test -- --config vitest.e2e.config.ts",
|
|
197
|
+
"v2:monitoring:up": "docker-compose -f docker-compose.dev.yml --profile monitoring up -d",
|
|
198
|
+
"v2:tracing:up": "docker-compose -f docker-compose.dev.yml --profile tracing up -d",
|
|
199
|
+
"v2:clean": "pnpm clean && docker-compose -f docker-compose.dev.yml down -v && docker system prune -f",
|
|
200
|
+
"benchmark": "tsx src/v2/__tests__/benchmarks.ts",
|
|
201
|
+
"benchmark:save": "tsx src/v2/__tests__/benchmarks.ts && echo 'Results saved to .ccjk/benchmark-results.json'",
|
|
202
|
+
"benchmark:detailed": "tsx src/v2/__tests__/benchmarks.ts --detailed",
|
|
203
|
+
"benchmark:server": "npx http-server docs/v2 -p 8080 -o dashboard.html",
|
|
204
|
+
"benchmark:open": "open docs/v2/dashboard.html || xdg-open docs/v2/dashboard.html || start docs/v2/dashboard.html",
|
|
205
|
+
"i18n:check": "tsx scripts/check-i18n.ts",
|
|
206
|
+
"i18n:report": "tsx scripts/check-i18n.ts --report",
|
|
207
|
+
"contract:check": "node scripts/check-remote-contract.mjs"
|
|
211
208
|
}
|
|
212
|
-
}
|
|
209
|
+
}
|