ccjk 5.2.1 → 5.2.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 +6 -6
- package/dist/chunks/auto-updater.mjs +57 -57
- package/dist/chunks/ccm.mjs +7 -7
- package/dist/chunks/ccr.mjs +7 -4
- package/dist/chunks/ccu.mjs +6 -6
- package/dist/chunks/check-updates.mjs +3 -3
- package/dist/chunks/claude-code-incremental-manager.mjs +38 -38
- package/dist/chunks/cloud-v5.mjs +1651 -0
- package/dist/chunks/codex.mjs +70 -70
- package/dist/chunks/commands.mjs +25 -25
- package/dist/chunks/commit.mjs +16 -16
- package/dist/chunks/config-consolidator.mjs +9 -9
- package/dist/chunks/config-switch.mjs +39 -39
- package/dist/chunks/config.mjs +5 -5
- package/dist/chunks/config2.mjs +85 -85
- package/dist/chunks/context.mjs +2 -2
- package/dist/chunks/doctor.mjs +31 -31
- package/dist/chunks/features.mjs +84 -83
- package/dist/chunks/help.mjs +116 -116
- package/dist/chunks/index4.mjs +46 -46
- package/dist/chunks/init.mjs +214 -191
- package/dist/chunks/interview.mjs +102 -102
- package/dist/chunks/manager.mjs +238 -0
- package/dist/chunks/marketplace.mjs +59 -59
- package/dist/chunks/mcp.mjs +82 -82
- package/dist/chunks/menu.mjs +441 -379
- package/dist/chunks/notification.mjs +112 -112
- package/dist/chunks/onboarding.mjs +7 -7
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/permission-manager.mjs +8 -8
- package/dist/chunks/plugin.mjs +100 -100
- package/dist/chunks/prompts.mjs +15 -15
- package/dist/chunks/providers.mjs +65 -65
- package/dist/chunks/session.mjs +83 -83
- package/dist/chunks/skills-sync.mjs +72 -72
- package/dist/chunks/skills.mjs +88 -88
- package/dist/chunks/team.mjs +6 -6
- package/dist/chunks/uninstall.mjs +35 -35
- package/dist/chunks/update.mjs +6 -6
- package/dist/chunks/upgrade-manager.mjs +4 -4
- package/dist/chunks/workflows2.mjs +13 -13
- package/dist/cli.mjs +21 -0
- package/dist/i18n/locales/en/menu.json +16 -1
- package/dist/i18n/locales/en/skills.json +29 -0
- package/dist/i18n/locales/zh-CN/menu.json +16 -1
- package/dist/i18n/locales/zh-CN/skills.json +29 -0
- package/dist/index.mjs +4 -4
- package/dist/shared/{ccjk.f40us0yY.mjs → ccjk.BiJujy5w.mjs} +4 -4
- package/dist/shared/{ccjk.CQzwtnZ1.mjs → ccjk.C_3BYaWc.mjs} +50 -50
- package/dist/shared/{ccjk.Zwx-YR_P.mjs → ccjk.DjD9Rzxq.mjs} +32 -32
- package/dist/shared/{ccjk.DtWIPt8E.mjs → ccjk.XgW1H2t3.mjs} +68 -68
- package/dist/shared/{ccjk.BlPCiSHj.mjs → ccjk.tI4PJA0c.mjs} +30 -30
- package/package.json +3 -3
package/dist/chunks/features.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ansis__default from 'ansis';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import { s as selectMcpServices, g as getMcpServices } from './codex.mjs';
|
|
4
4
|
import { SUPPORTED_LANGS, LANG_LABELS } from './constants.mjs';
|
|
@@ -6,7 +6,7 @@ import { ensureI18nInitialized, i18n, changeLanguage } from './index2.mjs';
|
|
|
6
6
|
import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
|
|
7
7
|
import { i as isCcrInstalled, a as installCcr, s as setupCcrConfiguration } from './init.mjs';
|
|
8
8
|
import { a as applyAiLanguageDirective, g as getExistingModelConfig, u as updateCustomModel, b 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, s as switchToOfficialLogin } from './config.mjs';
|
|
9
|
-
import { c as configureOutputStyle, m as modifyApiConfigPartially, v as validateApiKey, f as formatApiKeyDisplay } from '../shared/ccjk.
|
|
9
|
+
import { c as configureOutputStyle, m as modifyApiConfigPartially, v as validateApiKey, f as formatApiKeyDisplay } from '../shared/ccjk.XgW1H2t3.mjs';
|
|
10
10
|
import { isWindows } from './platform.mjs';
|
|
11
11
|
import { a as addNumbersToChoices, p as promptBoolean } from '../shared/ccjk.DhBeLRzf.mjs';
|
|
12
12
|
import { o as openSettingsJson, i as importRecommendedPermissions, a as importRecommendedEnv } from '../shared/ccjk.BjUZt6kx.mjs';
|
|
@@ -31,25 +31,26 @@ import 'i18next-fs-backend';
|
|
|
31
31
|
import 'inquirer-toggle';
|
|
32
32
|
import 'node:child_process';
|
|
33
33
|
import './workflows.mjs';
|
|
34
|
-
import '
|
|
34
|
+
import './manager.mjs';
|
|
35
|
+
import '../shared/ccjk.DjD9Rzxq.mjs';
|
|
35
36
|
import 'node:util';
|
|
36
37
|
import './auto-updater.mjs';
|
|
37
38
|
import './version-checker.mjs';
|
|
38
39
|
import 'node:path';
|
|
39
40
|
import '../shared/ccjk.CUdzQluX.mjs';
|
|
40
|
-
import '../shared/ccjk.
|
|
41
|
+
import '../shared/ccjk.BiJujy5w.mjs';
|
|
41
42
|
|
|
42
43
|
async function handleCancellation() {
|
|
43
44
|
ensureI18nInitialized();
|
|
44
|
-
console.log(
|
|
45
|
+
console.log(ansis__default.yellow(i18n.t("common:cancelled")));
|
|
45
46
|
}
|
|
46
47
|
async function handleOfficialLoginMode() {
|
|
47
48
|
ensureI18nInitialized();
|
|
48
49
|
const success = switchToOfficialLogin();
|
|
49
50
|
if (success) {
|
|
50
|
-
console.log(
|
|
51
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("api:officialLoginConfigured")}`));
|
|
51
52
|
} else {
|
|
52
|
-
console.log(
|
|
53
|
+
console.log(ansis__default.red(i18n.t("api:officialLoginFailed")));
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
async function handleCustomApiMode() {
|
|
@@ -65,7 +66,7 @@ async function handleCustomApiMode() {
|
|
|
65
66
|
if (existingConfig) {
|
|
66
67
|
const configAction = await promptApiConfigurationAction();
|
|
67
68
|
if (configAction === "keep-existing") {
|
|
68
|
-
console.log(
|
|
69
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("api:keepExistingConfig")}`));
|
|
69
70
|
return;
|
|
70
71
|
} else if (configAction === "modify-partial") {
|
|
71
72
|
await modifyApiConfigPartially(existingConfig);
|
|
@@ -78,12 +79,12 @@ async function handleCustomApiMode() {
|
|
|
78
79
|
message: i18n.t("api:configureApi"),
|
|
79
80
|
choices: addNumbersToChoices([
|
|
80
81
|
{
|
|
81
|
-
name: `${i18n.t("api:useAuthToken")} - ${
|
|
82
|
+
name: `${i18n.t("api:useAuthToken")} - ${ansis__default.gray(i18n.t("api:authTokenDesc"))}`,
|
|
82
83
|
value: "auth_token",
|
|
83
84
|
short: i18n.t("api:useAuthToken")
|
|
84
85
|
},
|
|
85
86
|
{
|
|
86
|
-
name: `${i18n.t("api:useApiKey")} - ${
|
|
87
|
+
name: `${i18n.t("api:useApiKey")} - ${ansis__default.gray(i18n.t("api:apiKeyDesc"))}`,
|
|
87
88
|
value: "api_key",
|
|
88
89
|
short: i18n.t("api:useApiKey")
|
|
89
90
|
},
|
|
@@ -137,9 +138,9 @@ async function handleCustomApiMode() {
|
|
|
137
138
|
const apiConfig = { url, key, authType: apiChoice };
|
|
138
139
|
const configuredApi = configureApi(apiConfig);
|
|
139
140
|
if (configuredApi) {
|
|
140
|
-
console.log(
|
|
141
|
-
console.log(
|
|
142
|
-
console.log(
|
|
141
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("api:apiConfigSuccess")}`));
|
|
142
|
+
console.log(ansis__default.gray(` URL: ${configuredApi.url}`));
|
|
143
|
+
console.log(ansis__default.gray(` Key: ${formatApiKeyDisplay(configuredApi.key)}`));
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
146
|
async function handleCcrProxyMode() {
|
|
@@ -148,11 +149,11 @@ async function handleCcrProxyMode() {
|
|
|
148
149
|
if (!ccrStatus.hasCorrectPackage) {
|
|
149
150
|
await installCcr();
|
|
150
151
|
} else {
|
|
151
|
-
console.log(
|
|
152
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("ccr:ccrAlreadyInstalled")}`));
|
|
152
153
|
}
|
|
153
154
|
const ccrConfigured = await setupCcrConfiguration();
|
|
154
155
|
if (ccrConfigured) {
|
|
155
|
-
console.log(
|
|
156
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("ccr:ccrSetupComplete")}`));
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
async function handleSwitchConfigMode() {
|
|
@@ -207,7 +208,7 @@ async function configureMcpFeature() {
|
|
|
207
208
|
const existingConfig = readMcpConfig() || { mcpServers: {} };
|
|
208
209
|
const fixedConfig = fixWindowsMcpConfig(existingConfig);
|
|
209
210
|
writeMcpConfig(fixedConfig);
|
|
210
|
-
console.log(
|
|
211
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:windowsMcpConfigFixed")}`));
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
const selectedServices = await selectMcpServices();
|
|
@@ -217,7 +218,7 @@ async function configureMcpFeature() {
|
|
|
217
218
|
if (selectedServices.length > 0) {
|
|
218
219
|
const mcpBackupPath = backupMcpConfig();
|
|
219
220
|
if (mcpBackupPath) {
|
|
220
|
-
console.log(
|
|
221
|
+
console.log(ansis__default.gray(`\u2714 ${i18n.t("mcp:mcpBackupSuccess")}: ${mcpBackupPath}`));
|
|
221
222
|
}
|
|
222
223
|
const newServers = {};
|
|
223
224
|
for (const serviceId of selectedServices) {
|
|
@@ -244,7 +245,7 @@ async function configureMcpFeature() {
|
|
|
244
245
|
let mergedConfig = mergeMcpServers(existingConfig, newServers);
|
|
245
246
|
mergedConfig = fixWindowsMcpConfig(mergedConfig);
|
|
246
247
|
writeMcpConfig(mergedConfig);
|
|
247
|
-
console.log(
|
|
248
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("mcp:mcpConfigSuccess")}`));
|
|
248
249
|
}
|
|
249
250
|
}
|
|
250
251
|
async function configureDefaultModelFeature() {
|
|
@@ -252,16 +253,16 @@ async function configureDefaultModelFeature() {
|
|
|
252
253
|
const existingModel = getExistingModelConfig();
|
|
253
254
|
if (existingModel) {
|
|
254
255
|
console.log(`
|
|
255
|
-
${
|
|
256
|
+
${ansis__default.green(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing model configuration"}`)}`);
|
|
256
257
|
const modelDisplay = existingModel === "default" ? i18n.t("configuration:defaultModelOption") || "Default (Let Claude Code choose)" : existingModel.charAt(0).toUpperCase() + existingModel.slice(1);
|
|
257
|
-
console.log(
|
|
258
|
+
console.log(ansis__default.gray(` ${i18n.t("configuration:currentModel") || "Current model"}: ${modelDisplay}
|
|
258
259
|
`));
|
|
259
260
|
const modify = await promptBoolean({
|
|
260
261
|
message: i18n.t("configuration:modifyModel") || "Modify model configuration?",
|
|
261
262
|
defaultValue: false
|
|
262
263
|
});
|
|
263
264
|
if (!modify) {
|
|
264
|
-
console.log(
|
|
265
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:keepModel") || "Keeping existing model configuration"}`));
|
|
265
266
|
return;
|
|
266
267
|
}
|
|
267
268
|
}
|
|
@@ -296,15 +297,15 @@ ${ansis.green(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing
|
|
|
296
297
|
if (model === "custom") {
|
|
297
298
|
const { primaryModel, haikuModel, sonnetModel, opusModel } = await promptCustomModels();
|
|
298
299
|
if (!primaryModel.trim() && !haikuModel.trim() && !sonnetModel.trim() && !opusModel.trim()) {
|
|
299
|
-
console.log(
|
|
300
|
+
console.log(ansis__default.yellow(`\u26A0 ${i18n.t("configuration:customModelSkipped") || "Custom model configuration skipped"}`));
|
|
300
301
|
return;
|
|
301
302
|
}
|
|
302
303
|
updateCustomModel(primaryModel, haikuModel, sonnetModel, opusModel);
|
|
303
|
-
console.log(
|
|
304
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:customModelConfigured") || "Custom model configuration completed"}`));
|
|
304
305
|
return;
|
|
305
306
|
}
|
|
306
307
|
updateDefaultModel(model);
|
|
307
|
-
console.log(
|
|
308
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:modelConfigured") || "Default model configured"}`));
|
|
308
309
|
}
|
|
309
310
|
async function promptCustomModels(defaultPrimaryModel, defaultHaikuModel, defaultSonnetModel, defaultOpusModel) {
|
|
310
311
|
const { primaryModel } = await inquirer.prompt({
|
|
@@ -382,17 +383,17 @@ async function configureAiMemoryFeature() {
|
|
|
382
383
|
switch (option) {
|
|
383
384
|
case "viewGlobalClaudeMd": {
|
|
384
385
|
if (existsSync(globalClaudeMdPath)) {
|
|
385
|
-
console.log(
|
|
386
|
+
console.log(ansis__default.green.bold(`
|
|
386
387
|
\u{1F4C4} ${isZh ? "\u5168\u5C40 CLAUDE.md \u5185\u5BB9" : "Global CLAUDE.md Content"}:`));
|
|
387
|
-
console.log(
|
|
388
|
+
console.log(ansis__default.dim("\u2500".repeat(60)));
|
|
388
389
|
const content = readFileSync(globalClaudeMdPath, "utf-8");
|
|
389
390
|
console.log(content);
|
|
390
|
-
console.log(
|
|
391
|
-
console.log(
|
|
391
|
+
console.log(ansis__default.dim("\u2500".repeat(60)));
|
|
392
|
+
console.log(ansis__default.gray(`${isZh ? "\u8DEF\u5F84" : "Path"}: ${globalClaudeMdPath}`));
|
|
392
393
|
} else {
|
|
393
|
-
console.log(
|
|
394
|
+
console.log(ansis__default.yellow(`
|
|
394
395
|
\u26A0\uFE0F ${isZh ? "\u5168\u5C40 CLAUDE.md \u4E0D\u5B58\u5728" : "Global CLAUDE.md does not exist"}`));
|
|
395
|
-
console.log(
|
|
396
|
+
console.log(ansis__default.gray(`${isZh ? "\u9884\u671F\u8DEF\u5F84" : "Expected path"}: ${globalClaudeMdPath}`));
|
|
396
397
|
}
|
|
397
398
|
break;
|
|
398
399
|
}
|
|
@@ -404,34 +405,34 @@ async function configureAiMemoryFeature() {
|
|
|
404
405
|
foundPath = localClaudeMdPath;
|
|
405
406
|
}
|
|
406
407
|
if (foundPath) {
|
|
407
|
-
console.log(
|
|
408
|
+
console.log(ansis__default.green.bold(`
|
|
408
409
|
\u{1F4C1} ${isZh ? "\u9879\u76EE CLAUDE.md \u5185\u5BB9" : "Project CLAUDE.md Content"}:`));
|
|
409
|
-
console.log(
|
|
410
|
+
console.log(ansis__default.dim("\u2500".repeat(60)));
|
|
410
411
|
const content = readFileSync(foundPath, "utf-8");
|
|
411
412
|
console.log(content);
|
|
412
|
-
console.log(
|
|
413
|
-
console.log(
|
|
413
|
+
console.log(ansis__default.dim("\u2500".repeat(60)));
|
|
414
|
+
console.log(ansis__default.gray(`${isZh ? "\u8DEF\u5F84" : "Path"}: ${foundPath}`));
|
|
414
415
|
} else {
|
|
415
|
-
console.log(
|
|
416
|
+
console.log(ansis__default.yellow(`
|
|
416
417
|
\u26A0\uFE0F ${isZh ? "\u9879\u76EE CLAUDE.md \u4E0D\u5B58\u5728" : "Project CLAUDE.md does not exist"}`));
|
|
417
|
-
console.log(
|
|
418
|
-
console.log(
|
|
419
|
-
console.log(
|
|
418
|
+
console.log(ansis__default.gray(`${isZh ? "\u5DF2\u68C0\u67E5\u8DEF\u5F84" : "Checked paths"}:`));
|
|
419
|
+
console.log(ansis__default.gray(` - ${projectClaudeMdPath}`));
|
|
420
|
+
console.log(ansis__default.gray(` - ${localClaudeMdPath}`));
|
|
420
421
|
}
|
|
421
422
|
break;
|
|
422
423
|
}
|
|
423
424
|
case "viewPostmortem": {
|
|
424
425
|
const postmortemDir = join(cwd, ".postmortem");
|
|
425
426
|
if (existsSync(postmortemDir)) {
|
|
426
|
-
console.log(
|
|
427
|
+
console.log(ansis__default.green.bold(`
|
|
427
428
|
\u{1F52C} ${isZh ? "Postmortem \u62A5\u544A" : "Postmortem Reports"}:`));
|
|
428
|
-
console.log(
|
|
429
|
+
console.log(ansis__default.dim("\u2500".repeat(60)));
|
|
429
430
|
const { readdirSync } = await import('node:fs');
|
|
430
431
|
const files = readdirSync(postmortemDir).filter((f) => f.endsWith(".md"));
|
|
431
432
|
if (files.length === 0) {
|
|
432
|
-
console.log(
|
|
433
|
+
console.log(ansis__default.yellow(isZh ? "\u6682\u65E0 Postmortem \u62A5\u544A" : "No postmortem reports yet"));
|
|
433
434
|
} else {
|
|
434
|
-
console.log(
|
|
435
|
+
console.log(ansis__default.green(`${isZh ? "\u627E\u5230" : "Found"} ${files.length} ${isZh ? "\u4E2A\u62A5\u544A" : "reports"}:
|
|
435
436
|
`));
|
|
436
437
|
const { selectedFile } = await inquirer.prompt({
|
|
437
438
|
type: "list",
|
|
@@ -445,18 +446,18 @@ async function configureAiMemoryFeature() {
|
|
|
445
446
|
if (selectedFile !== "back") {
|
|
446
447
|
const reportPath = join(postmortemDir, selectedFile);
|
|
447
448
|
const content = readFileSync(reportPath, "utf-8");
|
|
448
|
-
console.log(
|
|
449
|
+
console.log(ansis__default.dim("\u2500".repeat(60)));
|
|
449
450
|
console.log(content);
|
|
450
|
-
console.log(
|
|
451
|
+
console.log(ansis__default.dim("\u2500".repeat(60)));
|
|
451
452
|
}
|
|
452
453
|
}
|
|
453
|
-
console.log(
|
|
454
|
+
console.log(ansis__default.gray(`
|
|
454
455
|
${isZh ? "\u76EE\u5F55" : "Directory"}: ${postmortemDir}`));
|
|
455
|
-
console.log(
|
|
456
|
+
console.log(ansis__default.gray(`\u{1F4A1} ${isZh ? "\u8FD0\u884C `ccjk postmortem init` \u4ECE\u5386\u53F2 fix commits \u751F\u6210\u62A5\u544A" : "Run `ccjk postmortem init` to generate reports from fix commits"}`));
|
|
456
457
|
} else {
|
|
457
|
-
console.log(
|
|
458
|
+
console.log(ansis__default.yellow(`
|
|
458
459
|
\u26A0\uFE0F ${isZh ? "Postmortem \u76EE\u5F55\u4E0D\u5B58\u5728" : "Postmortem directory does not exist"}`));
|
|
459
|
-
console.log(
|
|
460
|
+
console.log(ansis__default.gray(`\u{1F4A1} ${isZh ? "\u8FD0\u884C `ccjk postmortem init` \u521D\u59CB\u5316 Postmortem \u7CFB\u7EDF" : "Run `ccjk postmortem init` to initialize the Postmortem system"}`));
|
|
460
461
|
}
|
|
461
462
|
break;
|
|
462
463
|
}
|
|
@@ -472,18 +473,18 @@ ${isZh ? "\u76EE\u5F55" : "Directory"}: ${postmortemDir}`));
|
|
|
472
473
|
|
|
473
474
|
<!-- Add your global instructions here -->
|
|
474
475
|
`);
|
|
475
|
-
console.log(
|
|
476
|
+
console.log(ansis__default.green(`\u2705 ${isZh ? "\u5DF2\u521B\u5EFA\u5168\u5C40 CLAUDE.md" : "Created global CLAUDE.md"}`));
|
|
476
477
|
}
|
|
477
|
-
console.log(
|
|
478
|
+
console.log(ansis__default.green(`
|
|
478
479
|
\u{1F4DD} ${isZh ? "\u6B63\u5728\u6253\u5F00\u7F16\u8F91\u5668..." : "Opening editor..."}`));
|
|
479
|
-
console.log(
|
|
480
|
-
console.log(
|
|
480
|
+
console.log(ansis__default.gray(`${isZh ? "\u7F16\u8F91\u5668" : "Editor"}: ${editor}`));
|
|
481
|
+
console.log(ansis__default.gray(`${isZh ? "\u6587\u4EF6" : "File"}: ${globalClaudeMdPath}`));
|
|
481
482
|
try {
|
|
482
483
|
execSync(`${editor} "${globalClaudeMdPath}"`, { stdio: "inherit" });
|
|
483
|
-
console.log(
|
|
484
|
+
console.log(ansis__default.green(`
|
|
484
485
|
\u2705 ${isZh ? "\u7F16\u8F91\u5B8C\u6210" : "Edit complete"}`));
|
|
485
486
|
} catch {
|
|
486
|
-
console.log(
|
|
487
|
+
console.log(ansis__default.yellow(`
|
|
487
488
|
\u26A0\uFE0F ${isZh ? "\u7F16\u8F91\u5668\u9000\u51FA" : "Editor exited"}`));
|
|
488
489
|
}
|
|
489
490
|
break;
|
|
@@ -494,16 +495,16 @@ ${isZh ? "\u76EE\u5F55" : "Directory"}: ${postmortemDir}`));
|
|
|
494
495
|
if (existingLang) {
|
|
495
496
|
console.log(
|
|
496
497
|
`
|
|
497
|
-
${
|
|
498
|
+
${ansis__default.green(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existing AI output language configuration"}`)}`
|
|
498
499
|
);
|
|
499
|
-
console.log(
|
|
500
|
+
console.log(ansis__default.gray(` ${i18n.t("configuration:currentLanguage") || "Current language"}: ${existingLang}
|
|
500
501
|
`));
|
|
501
502
|
const modify = await promptBoolean({
|
|
502
503
|
message: i18n.t("configuration:modifyLanguage") || "Modify AI output language?",
|
|
503
504
|
defaultValue: false
|
|
504
505
|
});
|
|
505
506
|
if (!modify) {
|
|
506
|
-
console.log(
|
|
507
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:keepLanguage") || "Keeping existing language configuration"}`));
|
|
507
508
|
return;
|
|
508
509
|
}
|
|
509
510
|
}
|
|
@@ -511,7 +512,7 @@ ${ansis.green(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Exist
|
|
|
511
512
|
const aiOutputLang = await selectAiOutputLanguage();
|
|
512
513
|
applyAiLanguageDirective(aiOutputLang);
|
|
513
514
|
updateZcfConfig({ aiOutputLang });
|
|
514
|
-
console.log(
|
|
515
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:aiLanguageConfigured") || "AI output language configured"}`));
|
|
515
516
|
break;
|
|
516
517
|
}
|
|
517
518
|
case "outputStyle": {
|
|
@@ -539,7 +540,7 @@ async function changeScriptLanguageFeature(currentLang) {
|
|
|
539
540
|
}
|
|
540
541
|
updateZcfConfig({ preferredLang: lang });
|
|
541
542
|
await changeLanguage(lang);
|
|
542
|
-
console.log(
|
|
543
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("language:languageChanged") || "Language changed"}`));
|
|
543
544
|
return lang;
|
|
544
545
|
}
|
|
545
546
|
async function configureCodexDefaultModelFeature() {
|
|
@@ -549,16 +550,16 @@ async function configureCodexDefaultModelFeature() {
|
|
|
549
550
|
const currentModel = existingConfig?.model;
|
|
550
551
|
if (currentModel) {
|
|
551
552
|
console.log(`
|
|
552
|
-
${
|
|
553
|
+
${ansis__default.green(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing model configuration"}`)}`);
|
|
553
554
|
const modelDisplay = currentModel === "gpt-5-codex" ? "GPT-5-Codex" : currentModel === "gpt-5" ? "GPT-5" : currentModel.charAt(0).toUpperCase() + currentModel.slice(1);
|
|
554
|
-
console.log(
|
|
555
|
+
console.log(ansis__default.gray(` ${i18n.t("configuration:currentModel") || "Current model"}: ${modelDisplay}
|
|
555
556
|
`));
|
|
556
557
|
const modify = await promptBoolean({
|
|
557
558
|
message: i18n.t("configuration:modifyModel") || "Modify model configuration?",
|
|
558
559
|
defaultValue: false
|
|
559
560
|
});
|
|
560
561
|
if (!modify) {
|
|
561
|
-
console.log(
|
|
562
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:keepModel") || "Keeping existing model configuration"}`));
|
|
562
563
|
return;
|
|
563
564
|
}
|
|
564
565
|
}
|
|
@@ -595,15 +596,15 @@ ${ansis.green(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing
|
|
|
595
596
|
default: ""
|
|
596
597
|
});
|
|
597
598
|
if (!customModel.trim()) {
|
|
598
|
-
console.log(
|
|
599
|
+
console.log(ansis__default.yellow(`\u26A0 ${i18n.t("configuration:customModelSkipped") || "Custom model configuration skipped"}`));
|
|
599
600
|
return;
|
|
600
601
|
}
|
|
601
602
|
await updateCodexModelProvider(customModel.trim());
|
|
602
|
-
console.log(
|
|
603
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:customModelConfigured") || "Custom model configuration completed"}`));
|
|
603
604
|
return;
|
|
604
605
|
}
|
|
605
606
|
await updateCodexModelProvider(model);
|
|
606
|
-
console.log(
|
|
607
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:modelConfigured") || "Default model configured"}`));
|
|
607
608
|
}
|
|
608
609
|
async function configureCodexAiMemoryFeature() {
|
|
609
610
|
ensureI18nInitialized();
|
|
@@ -631,16 +632,16 @@ async function configureCodexAiMemoryFeature() {
|
|
|
631
632
|
if (existingLang) {
|
|
632
633
|
console.log(
|
|
633
634
|
`
|
|
634
|
-
${
|
|
635
|
+
${ansis__default.green(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existing AI output language configuration"}`)}`
|
|
635
636
|
);
|
|
636
|
-
console.log(
|
|
637
|
+
console.log(ansis__default.gray(` ${i18n.t("configuration:currentLanguage") || "Current language"}: ${existingLang}
|
|
637
638
|
`));
|
|
638
639
|
const modify = await promptBoolean({
|
|
639
640
|
message: i18n.t("configuration:modifyLanguage") || "Modify AI output language?",
|
|
640
641
|
defaultValue: false
|
|
641
642
|
});
|
|
642
643
|
if (!modify) {
|
|
643
|
-
console.log(
|
|
644
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:keepLanguage") || "Keeping existing language configuration"}`));
|
|
644
645
|
await ensureLanguageDirectiveInAgents(existingLang);
|
|
645
646
|
return;
|
|
646
647
|
}
|
|
@@ -649,21 +650,21 @@ ${ansis.green(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Exist
|
|
|
649
650
|
const aiOutputLang = await selectAiOutputLanguage();
|
|
650
651
|
await updateCodexLanguageDirective(aiOutputLang);
|
|
651
652
|
updateZcfConfig({ aiOutputLang });
|
|
652
|
-
console.log(
|
|
653
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:aiLanguageConfigured") || "AI output language configured"}`));
|
|
653
654
|
} else if (option === "systemPrompt") {
|
|
654
655
|
const zcfConfig = readZcfConfig();
|
|
655
656
|
const currentLang = zcfConfig?.aiOutputLang || "English";
|
|
656
657
|
const { runCodexSystemPromptSelection } = await import('./codex.mjs').then(function (n) { return n.Q; });
|
|
657
658
|
await runCodexSystemPromptSelection();
|
|
658
659
|
await ensureLanguageDirectiveInAgents(currentLang);
|
|
659
|
-
console.log(
|
|
660
|
+
console.log(ansis__default.green(`\u2714 ${i18n.t("configuration:systemPromptConfigured")}`));
|
|
660
661
|
}
|
|
661
662
|
}
|
|
662
663
|
async function updateCodexModelProvider(modelProvider) {
|
|
663
664
|
const { readCodexConfig, writeCodexConfig, backupCodexConfig, getBackupMessage } = await import('./codex.mjs').then(function (n) { return n.Q; });
|
|
664
665
|
const backupPath = backupCodexConfig();
|
|
665
666
|
if (backupPath) {
|
|
666
|
-
console.log(
|
|
667
|
+
console.log(ansis__default.gray(getBackupMessage(backupPath)));
|
|
667
668
|
}
|
|
668
669
|
const existingConfig = readCodexConfig();
|
|
669
670
|
const updatedConfig = {
|
|
@@ -686,7 +687,7 @@ async function ensureLanguageDirectiveInAgents(aiOutputLang) {
|
|
|
686
687
|
const { join } = await import('pathe');
|
|
687
688
|
const CODEX_AGENTS_FILE = join(homedir(), ".codex", "AGENTS.md");
|
|
688
689
|
if (!exists(CODEX_AGENTS_FILE)) {
|
|
689
|
-
console.log(
|
|
690
|
+
console.log(ansis__default.yellow(i18n.t("codex:agentsFileNotFound")));
|
|
690
691
|
return;
|
|
691
692
|
}
|
|
692
693
|
const content = readFile(CODEX_AGENTS_FILE);
|
|
@@ -702,7 +703,7 @@ async function ensureLanguageDirectiveInAgents(aiOutputLang) {
|
|
|
702
703
|
const { backupCodexAgents, getBackupMessage } = await import('./codex.mjs').then(function (n) { return n.Q; });
|
|
703
704
|
const backupPath = backupCodexAgents();
|
|
704
705
|
if (backupPath) {
|
|
705
|
-
console.log(
|
|
706
|
+
console.log(ansis__default.gray(getBackupMessage(backupPath)));
|
|
706
707
|
}
|
|
707
708
|
let updatedContent = content;
|
|
708
709
|
if (!updatedContent.endsWith("\n")) {
|
|
@@ -712,7 +713,7 @@ async function ensureLanguageDirectiveInAgents(aiOutputLang) {
|
|
|
712
713
|
**Most Important:Always respond in ${langLabel}**
|
|
713
714
|
`;
|
|
714
715
|
writeFileAtomic(CODEX_AGENTS_FILE, updatedContent);
|
|
715
|
-
console.log(
|
|
716
|
+
console.log(ansis__default.gray(` ${i18n.t("configuration:addedLanguageDirective")}: ${langLabel}`));
|
|
716
717
|
}
|
|
717
718
|
}
|
|
718
719
|
async function updateCodexLanguageDirective(aiOutputLang) {
|
|
@@ -722,12 +723,12 @@ async function updateCodexLanguageDirective(aiOutputLang) {
|
|
|
722
723
|
const { join } = await import('pathe');
|
|
723
724
|
const CODEX_AGENTS_FILE = join(homedir(), ".codex", "AGENTS.md");
|
|
724
725
|
if (!exists(CODEX_AGENTS_FILE)) {
|
|
725
|
-
console.log(
|
|
726
|
+
console.log(ansis__default.yellow(i18n.t("codex:agentsFileNotFound")));
|
|
726
727
|
return;
|
|
727
728
|
}
|
|
728
729
|
const backupPath = backupCodexAgents();
|
|
729
730
|
if (backupPath) {
|
|
730
|
-
console.log(
|
|
731
|
+
console.log(ansis__default.gray(getBackupMessage(backupPath)));
|
|
731
732
|
}
|
|
732
733
|
let content = readFile(CODEX_AGENTS_FILE);
|
|
733
734
|
const languageLabels = {
|
|
@@ -754,19 +755,19 @@ async function configureEnvPermissionFeature() {
|
|
|
754
755
|
message: i18n.t("configuration:selectEnvPermissionOption") || "Select option",
|
|
755
756
|
choices: addNumbersToChoices([
|
|
756
757
|
{
|
|
757
|
-
name: `${i18n.t("configuration:importRecommendedEnv") || "Import environment"} ${
|
|
758
|
+
name: `${i18n.t("configuration:importRecommendedEnv") || "Import environment"} ${ansis__default.gray(
|
|
758
759
|
`- ${i18n.t("configuration:importRecommendedEnvDesc") || "Import env settings"}`
|
|
759
760
|
)}`,
|
|
760
761
|
value: "env"
|
|
761
762
|
},
|
|
762
763
|
{
|
|
763
|
-
name: `${i18n.t("configuration:importRecommendedPermissions") || "Import permissions"} ${
|
|
764
|
+
name: `${i18n.t("configuration:importRecommendedPermissions") || "Import permissions"} ${ansis__default.gray(
|
|
764
765
|
`- ${i18n.t("configuration:importRecommendedPermissionsDesc") || "Import permission settings"}`
|
|
765
766
|
)}`,
|
|
766
767
|
value: "permissions"
|
|
767
768
|
},
|
|
768
769
|
{
|
|
769
|
-
name: `${i18n.t("configuration:openSettingsJson") || "Open settings"} ${
|
|
770
|
+
name: `${i18n.t("configuration:openSettingsJson") || "Open settings"} ${ansis__default.gray(
|
|
770
771
|
`- ${i18n.t("configuration:openSettingsJsonDesc") || "View settings file"}`
|
|
771
772
|
)}`,
|
|
772
773
|
value: "open"
|
|
@@ -781,19 +782,19 @@ async function configureEnvPermissionFeature() {
|
|
|
781
782
|
switch (choice) {
|
|
782
783
|
case "env":
|
|
783
784
|
await importRecommendedEnv();
|
|
784
|
-
console.log(
|
|
785
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("configuration:envImportSuccess")}`));
|
|
785
786
|
break;
|
|
786
787
|
case "permissions":
|
|
787
788
|
await importRecommendedPermissions();
|
|
788
|
-
console.log(
|
|
789
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("configuration:permissionsImportSuccess") || "Permissions imported"}`));
|
|
789
790
|
break;
|
|
790
791
|
case "open":
|
|
791
|
-
console.log(
|
|
792
|
+
console.log(ansis__default.green(i18n.t("configuration:openingSettingsJson") || "Opening settings.json..."));
|
|
792
793
|
await openSettingsJson();
|
|
793
794
|
break;
|
|
794
795
|
}
|
|
795
796
|
} catch (error) {
|
|
796
|
-
console.error(
|
|
797
|
+
console.error(ansis__default.red(`${i18n.t("common:error")}: ${error.message}`));
|
|
797
798
|
}
|
|
798
799
|
}
|
|
799
800
|
|