ccjk 16.0.1 → 16.0.3
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/claude-code-config-manager.mjs +18 -14
- package/dist/chunks/claude-code-incremental-manager.mjs +5 -3
- package/dist/chunks/codex-config-switch.mjs +4 -4
- package/dist/chunks/codex-provider-manager.mjs +5 -5
- package/dist/chunks/codex-uninstaller.mjs +3 -3
- package/dist/chunks/commands.mjs +2 -2
- package/dist/chunks/features.mjs +43 -31
- package/dist/chunks/simple-config.mjs +818 -582
- package/dist/cli.mjs +426 -20
- package/dist/i18n/locales/en/cli.json +1 -1
- package/dist/i18n/locales/en/common.json +1 -1
- package/dist/i18n/locales/en/configuration.json +17 -17
- package/dist/i18n/locales/en/installation.json +4 -0
- package/dist/i18n/locales/en/menu.json +26 -1
- package/dist/i18n/locales/en/multi-config.json +1 -1
- package/dist/i18n/locales/zh-CN/cli.json +1 -1
- package/dist/i18n/locales/zh-CN/common.json +1 -1
- package/dist/i18n/locales/zh-CN/configuration.json +17 -17
- package/dist/i18n/locales/zh-CN/installation.json +4 -0
- package/dist/i18n/locales/zh-CN/menu.json +26 -1
- package/dist/i18n/locales/zh-CN/multi-config.json +1 -1
- package/dist/index.d.mts +27 -23
- package/dist/index.d.ts +27 -23
- package/dist/index.mjs +2 -2
- package/dist/shared/ccjk.BSLlI-JL.mjs +7 -0
- package/package.json +3 -1
- package/templates/common/output-styles/en/carmack-mode.md +367 -0
- package/templates/common/output-styles/en/dhh-mode.md +251 -0
- package/templates/common/output-styles/en/evan-you-mode.md +525 -0
- package/templates/common/output-styles/en/jobs-mode.md +355 -0
- package/templates/common/output-styles/en/linus-mode.md +121 -0
- package/templates/common/output-styles/en/uncle-bob-mode.md +207 -0
- package/templates/common/output-styles/zh-CN/carmack-mode.md +367 -0
- package/templates/common/output-styles/zh-CN/dhh-mode.md +251 -0
- package/templates/common/output-styles/zh-CN/evan-you-mode.md +525 -0
- package/templates/common/output-styles/zh-CN/jobs-mode.md +355 -0
- package/templates/common/output-styles/zh-CN/linus-mode.md +121 -0
- package/templates/common/output-styles/zh-CN/uncle-bob-mode.md +207 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
2
|
import { join } from 'pathe';
|
|
3
|
-
import { c as CCJK_CONFIG_FILE, C as CCJK_CONFIG_DIR,
|
|
3
|
+
import { c as CCJK_CONFIG_FILE, C as CCJK_CONFIG_DIR, ax as ensureDir, ay as readDefaultTomlConfig, az as createDefaultTomlConfig, aA as exists, aB as readJsonConfig, aC as writeTomlConfig, ar as getActiveCodeTool, v as activeSettingsFile, aD as clearModelEnv, aE as normalizeClaudeFamilySettings, aF as copyFile } from './simple-config.mjs';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'node:process';
|
|
6
6
|
import 'ansis';
|
|
@@ -9,7 +9,6 @@ import 'node:child_process';
|
|
|
9
9
|
import 'node:os';
|
|
10
10
|
import 'node:util';
|
|
11
11
|
import 'node:url';
|
|
12
|
-
import '@rainbowatcher/toml-edit-js';
|
|
13
12
|
import 'inquirer-toggle';
|
|
14
13
|
import 'ora';
|
|
15
14
|
import 'tinyexec';
|
|
@@ -17,6 +16,7 @@ import 'semver';
|
|
|
17
16
|
import 'node:fs/promises';
|
|
18
17
|
import 'i18next';
|
|
19
18
|
import 'i18next-fs-backend';
|
|
19
|
+
import '@rainbowatcher/toml-edit-js';
|
|
20
20
|
|
|
21
21
|
class ClaudeCodeConfigManager {
|
|
22
22
|
static CONFIG_FILE = CCJK_CONFIG_FILE;
|
|
@@ -182,17 +182,19 @@ class ClaudeCodeConfigManager {
|
|
|
182
182
|
/**
|
|
183
183
|
* Apply profile settings to Claude Code runtime
|
|
184
184
|
*/
|
|
185
|
-
static async applyProfileSettings(profile) {
|
|
186
|
-
const { ensureI18nInitialized, i18n } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
185
|
+
static async applyProfileSettings(profile, codeTool) {
|
|
186
|
+
const { ensureI18nInitialized, i18n } = await import('./simple-config.mjs').then(function (n) { return n.bq; });
|
|
187
187
|
ensureI18nInitialized();
|
|
188
|
+
const targetTool = codeTool ?? getActiveCodeTool();
|
|
189
|
+
const settingsFile = activeSettingsFile(targetTool === "codex" || targetTool === "grok" ? "claude-code" : targetTool);
|
|
188
190
|
try {
|
|
189
191
|
if (!profile) {
|
|
190
|
-
const { switchToOfficialLogin } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
191
|
-
switchToOfficialLogin();
|
|
192
|
+
const { switchToOfficialLogin } = await import('./simple-config.mjs').then(function (n) { return n.bu; });
|
|
193
|
+
switchToOfficialLogin(targetTool === "clavue" ? "clavue" : "claude-code");
|
|
192
194
|
return;
|
|
193
195
|
}
|
|
194
|
-
const { readJsonConfig: readJsonConfig2, writeJsonConfig } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
195
|
-
const settings = readJsonConfig2(
|
|
196
|
+
const { readJsonConfig: readJsonConfig2, writeJsonConfig } = await import('./simple-config.mjs').then(function (n) { return n.bs; });
|
|
197
|
+
const settings = readJsonConfig2(settingsFile) || {};
|
|
196
198
|
if (!settings.env)
|
|
197
199
|
settings.env = {};
|
|
198
200
|
clearModelEnv(settings.env);
|
|
@@ -204,7 +206,7 @@ class ClaudeCodeConfigManager {
|
|
|
204
206
|
settings.env.ANTHROPIC_AUTH_TOKEN = profile.apiKey;
|
|
205
207
|
delete settings.env.ANTHROPIC_API_KEY;
|
|
206
208
|
} else if (profile.authType === "ccr_proxy") {
|
|
207
|
-
const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
209
|
+
const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.bv; });
|
|
208
210
|
const ccrConfig = readCcrConfig();
|
|
209
211
|
if (!ccrConfig) {
|
|
210
212
|
throw new Error(i18n.t("ccr:ccrNotConfigured") || "CCR proxy configuration not found");
|
|
@@ -238,10 +240,12 @@ class ClaudeCodeConfigManager {
|
|
|
238
240
|
} else {
|
|
239
241
|
clearModelEnv(settings.env);
|
|
240
242
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
addCompletedOnboarding();
|
|
243
|
+
const normalizedTool = targetTool === "clavue" ? "clavue" : "claude-code";
|
|
244
|
+
normalizeClaudeFamilySettings(settings, { codeTool: normalizedTool });
|
|
245
|
+
writeJsonConfig(settingsFile, settings);
|
|
246
|
+
const { setPrimaryApiKey, addCompletedOnboarding } = await import('./simple-config.mjs').then(function (n) { return n.bt; });
|
|
247
|
+
setPrimaryApiKey(normalizedTool);
|
|
248
|
+
addCompletedOnboarding(normalizedTool);
|
|
245
249
|
if (shouldRestartCcr) {
|
|
246
250
|
const { runCcrRestart } = await import('./commands.mjs');
|
|
247
251
|
await runCcrRestart();
|
|
@@ -600,7 +604,7 @@ class ClaudeCodeConfigManager {
|
|
|
600
604
|
*/
|
|
601
605
|
static async syncCcrProfile() {
|
|
602
606
|
try {
|
|
603
|
-
const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
607
|
+
const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.bv; });
|
|
604
608
|
const ccrConfig = readCcrConfig();
|
|
605
609
|
if (!ccrConfig) {
|
|
606
610
|
await this.ensureCcrProfileExists(ccrConfig);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import ansis from 'ansis';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
|
-
import {
|
|
3
|
+
import { aq as ensureI18nInitialized, ar as getActiveCodeTool, as as i18n, at as addNumbersToChoices, au as validateApiKey, av as promptBoolean } from './simple-config.mjs';
|
|
4
4
|
import { ClaudeCodeConfigManager } from './claude-code-config-manager.mjs';
|
|
5
|
+
import { g as getClaudeFamilyRuntimeLabel } from '../shared/ccjk.BSLlI-JL.mjs';
|
|
5
6
|
import 'node:fs';
|
|
6
7
|
import 'node:process';
|
|
7
8
|
import 'node:child_process';
|
|
@@ -10,7 +11,6 @@ import 'node:util';
|
|
|
10
11
|
import 'dayjs';
|
|
11
12
|
import 'pathe';
|
|
12
13
|
import 'node:url';
|
|
13
|
-
import '@rainbowatcher/toml-edit-js';
|
|
14
14
|
import 'inquirer-toggle';
|
|
15
15
|
import 'ora';
|
|
16
16
|
import 'tinyexec';
|
|
@@ -18,6 +18,7 @@ import 'semver';
|
|
|
18
18
|
import 'node:fs/promises';
|
|
19
19
|
import 'i18next';
|
|
20
20
|
import 'i18next-fs-backend';
|
|
21
|
+
import '@rainbowatcher/toml-edit-js';
|
|
21
22
|
|
|
22
23
|
function getAuthTypeLabel(authType) {
|
|
23
24
|
ensureI18nInitialized();
|
|
@@ -41,7 +42,8 @@ async function configureIncrementalManagement() {
|
|
|
41
42
|
}
|
|
42
43
|
const profiles = Object.values(config.profiles);
|
|
43
44
|
const currentProfile = config.currentProfileId ? config.profiles[config.currentProfileId] : null;
|
|
44
|
-
|
|
45
|
+
const runtimeLabel = getClaudeFamilyRuntimeLabel(getActiveCodeTool());
|
|
46
|
+
console.log(ansis.cyan(i18n.t("multi-config:incrementalManagementTitle", { runtime: runtimeLabel })));
|
|
45
47
|
console.log(ansis.gray(i18n.t("multi-config:currentProfileCount", { count: profiles.length })));
|
|
46
48
|
if (currentProfile) {
|
|
47
49
|
console.log(ansis.gray(i18n.t("multi-config:currentDefaultProfile", { profile: currentProfile.name })));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ansis from 'ansis';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
|
-
import {
|
|
3
|
+
import { aq as ensureI18nInitialized, aG as detectConfigManagementMode, as as i18n, at as addNumbersToChoices, av as promptBoolean, aB as readJsonConfig, l as CODEX_AUTH_FILE } from './simple-config.mjs';
|
|
4
4
|
import { deleteProviders, addProviderToExisting, editExistingProvider } from './codex-provider-manager.mjs';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:process';
|
|
@@ -10,7 +10,6 @@ import 'node:util';
|
|
|
10
10
|
import 'dayjs';
|
|
11
11
|
import 'pathe';
|
|
12
12
|
import 'node:url';
|
|
13
|
-
import '@rainbowatcher/toml-edit-js';
|
|
14
13
|
import 'inquirer-toggle';
|
|
15
14
|
import 'ora';
|
|
16
15
|
import 'tinyexec';
|
|
@@ -18,6 +17,7 @@ import 'semver';
|
|
|
18
17
|
import 'node:fs/promises';
|
|
19
18
|
import 'i18next';
|
|
20
19
|
import 'i18next-fs-backend';
|
|
20
|
+
import '@rainbowatcher/toml-edit-js';
|
|
21
21
|
|
|
22
22
|
async function configureIncrementalManagement() {
|
|
23
23
|
ensureI18nInitialized();
|
|
@@ -155,7 +155,7 @@ async function handleAddProvider() {
|
|
|
155
155
|
defaultValue: true
|
|
156
156
|
});
|
|
157
157
|
if (setAsDefault) {
|
|
158
|
-
const { switchToProvider } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
158
|
+
const { switchToProvider } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
|
|
159
159
|
const switched = await switchToProvider(provider.id);
|
|
160
160
|
if (switched) {
|
|
161
161
|
console.log(ansis.green(i18n.t("multi-config:profileSetAsDefault", { name: provider.name })));
|
|
@@ -330,7 +330,7 @@ ${i18n.t("codex:copyingProvider", { name: provider.name })}`));
|
|
|
330
330
|
defaultValue: false
|
|
331
331
|
});
|
|
332
332
|
if (setAsDefault) {
|
|
333
|
-
const { switchToProvider } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
333
|
+
const { switchToProvider } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
|
|
334
334
|
const switched = await switchToProvider(copiedProvider.id);
|
|
335
335
|
if (switched) {
|
|
336
336
|
console.log(ansis.green(i18n.t("multi-config:profileSetAsDefault", { name: copiedProvider.name })));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aq as ensureI18nInitialized, aH as readCodexConfig, as as i18n, aI as backupCodexComplete, aJ as writeAuthFile } from './simple-config.mjs';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'node:process';
|
|
4
4
|
import 'ansis';
|
|
@@ -9,7 +9,6 @@ import 'node:util';
|
|
|
9
9
|
import 'dayjs';
|
|
10
10
|
import 'pathe';
|
|
11
11
|
import 'node:url';
|
|
12
|
-
import '@rainbowatcher/toml-edit-js';
|
|
13
12
|
import 'inquirer-toggle';
|
|
14
13
|
import 'ora';
|
|
15
14
|
import 'tinyexec';
|
|
@@ -17,6 +16,7 @@ import 'semver';
|
|
|
17
16
|
import 'node:fs/promises';
|
|
18
17
|
import 'i18next';
|
|
19
18
|
import 'i18next-fs-backend';
|
|
19
|
+
import '@rainbowatcher/toml-edit-js';
|
|
20
20
|
|
|
21
21
|
async function addProviderToExisting(provider, apiKey, allowOverwrite = false) {
|
|
22
22
|
ensureI18nInitialized();
|
|
@@ -40,7 +40,7 @@ async function addProviderToExisting(provider, apiKey, allowOverwrite = false) {
|
|
|
40
40
|
}
|
|
41
41
|
backupPath = backup || void 0;
|
|
42
42
|
}
|
|
43
|
-
const { updateCodexApiFields, upsertCodexProvider } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
43
|
+
const { updateCodexApiFields, upsertCodexProvider } = await import('./simple-config.mjs').then(function (n) { return n.by; });
|
|
44
44
|
if (!existingConfig) {
|
|
45
45
|
updateCodexApiFields({
|
|
46
46
|
model: provider.model,
|
|
@@ -100,7 +100,7 @@ async function editExistingProvider(providerId, updates) {
|
|
|
100
100
|
...updates.wireApi && { wireApi: updates.wireApi },
|
|
101
101
|
...updates.model && { model: updates.model }
|
|
102
102
|
};
|
|
103
|
-
const { upsertCodexProvider } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
103
|
+
const { upsertCodexProvider } = await import('./simple-config.mjs').then(function (n) { return n.by; });
|
|
104
104
|
upsertCodexProvider(providerId, updatedProvider);
|
|
105
105
|
if (updates.apiKey) {
|
|
106
106
|
const authEntries = {};
|
|
@@ -166,7 +166,7 @@ async function deleteProviders(providerIds) {
|
|
|
166
166
|
if (providerIds.includes(existingConfig.modelProvider || "")) {
|
|
167
167
|
newDefaultProvider = remainingProviders[0].id;
|
|
168
168
|
}
|
|
169
|
-
const { deleteCodexProvider, updateCodexApiFields } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
169
|
+
const { deleteCodexProvider, updateCodexApiFields } = await import('./simple-config.mjs').then(function (n) { return n.by; });
|
|
170
170
|
if (newDefaultProvider !== existingConfig.modelProvider) {
|
|
171
171
|
updateCodexApiFields({
|
|
172
172
|
modelProvider: newDefaultProvider,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pathExists } from 'fs-extra';
|
|
2
2
|
import { join } from 'pathe';
|
|
3
|
-
import {
|
|
3
|
+
import { n as CODEX_DIR, m as CODEX_CONFIG_FILE, as as i18n, l as CODEX_AUTH_FILE, k as CODEX_AGENTS_FILE, o as CODEX_PROMPTS_DIR } from './simple-config.mjs';
|
|
4
4
|
import { m as moveToTrash } from '../shared/ccjk.DGjQxTq_.mjs';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:process';
|
|
@@ -11,7 +11,6 @@ import 'node:os';
|
|
|
11
11
|
import 'node:util';
|
|
12
12
|
import 'dayjs';
|
|
13
13
|
import 'node:url';
|
|
14
|
-
import '@rainbowatcher/toml-edit-js';
|
|
15
14
|
import 'inquirer-toggle';
|
|
16
15
|
import 'ora';
|
|
17
16
|
import 'tinyexec';
|
|
@@ -19,6 +18,7 @@ import 'semver';
|
|
|
19
18
|
import 'node:fs/promises';
|
|
20
19
|
import 'i18next';
|
|
21
20
|
import 'i18next-fs-backend';
|
|
21
|
+
import '@rainbowatcher/toml-edit-js';
|
|
22
22
|
import 'trash';
|
|
23
23
|
|
|
24
24
|
class CodexUninstaller {
|
|
@@ -155,7 +155,7 @@ class CodexUninstaller {
|
|
|
155
155
|
warnings: []
|
|
156
156
|
};
|
|
157
157
|
try {
|
|
158
|
-
const { uninstallCodeTool } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
158
|
+
const { uninstallCodeTool } = await import('./simple-config.mjs').then(function (n) { return n.bA; });
|
|
159
159
|
const success = await uninstallCodeTool("codex");
|
|
160
160
|
if (success) {
|
|
161
161
|
result.removed.push("@openai/codex");
|
package/dist/chunks/commands.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { exec } from 'node:child_process';
|
|
2
2
|
import { promisify } from 'node:util';
|
|
3
3
|
import ansis from 'ansis';
|
|
4
|
-
import {
|
|
4
|
+
import { aq as ensureI18nInitialized, as as i18n } from './simple-config.mjs';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:process';
|
|
7
7
|
import 'inquirer';
|
|
@@ -9,7 +9,6 @@ import 'node:os';
|
|
|
9
9
|
import 'dayjs';
|
|
10
10
|
import 'pathe';
|
|
11
11
|
import 'node:url';
|
|
12
|
-
import '@rainbowatcher/toml-edit-js';
|
|
13
12
|
import 'inquirer-toggle';
|
|
14
13
|
import 'ora';
|
|
15
14
|
import 'tinyexec';
|
|
@@ -17,6 +16,7 @@ import 'semver';
|
|
|
17
16
|
import 'node:fs/promises';
|
|
18
17
|
import 'i18next';
|
|
19
18
|
import 'i18next-fs-backend';
|
|
19
|
+
import '@rainbowatcher/toml-edit-js';
|
|
20
20
|
|
|
21
21
|
const execAsync = promisify(exec);
|
|
22
22
|
async function runCcrUi(apiKey) {
|
package/dist/chunks/features.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ansis from 'ansis';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
|
-
import {
|
|
3
|
+
import { as as i18n, aq as ensureI18nInitialized, u as SUPPORTED_LANGS, at as addNumbersToChoices, L as LANG_LABELS, aK as updateCcjkConfig, aL as changeLanguage, ar as getActiveCodeTool, aa as openSettingsJson, Z as importRecommendedPermissions, Y as importRecommendedEnv, aM as readCcjkConfig, av as promptBoolean, x as applyAiLanguageDirective, aN as configureOutputStyle, aO as isClaudeFamilyCodeTool, T as getExistingModelConfig, am as updateCustomModel, an as updateDefaultModel, aP as isWindows, ac as readMcpConfig, P as fixWindowsMcpConfig, ap as writeMcpConfig, aQ as selectMcpServices, z as backupMcpConfig, aR as getMcpServices, B as buildMcpServerConfig, a8 as mergeMcpServers, aS as isCcrInstalled, aT as installCcr, aU as setupCcrConfiguration, R as getExistingApiConfig, ab as promptApiConfigurationAction, aV as modifyApiConfigPartially, au as validateApiKey, G as configureApi, aW as formatApiKeyDisplay, ak as switchToOfficialLogin } from './simple-config.mjs';
|
|
4
|
+
import { g as getClaudeFamilyRuntimeLabel } from '../shared/ccjk.BSLlI-JL.mjs';
|
|
4
5
|
import 'node:fs';
|
|
5
6
|
import 'node:process';
|
|
6
7
|
import 'node:child_process';
|
|
@@ -9,7 +10,6 @@ import 'node:util';
|
|
|
9
10
|
import 'dayjs';
|
|
10
11
|
import 'pathe';
|
|
11
12
|
import 'node:url';
|
|
12
|
-
import '@rainbowatcher/toml-edit-js';
|
|
13
13
|
import 'inquirer-toggle';
|
|
14
14
|
import 'ora';
|
|
15
15
|
import 'tinyexec';
|
|
@@ -17,6 +17,7 @@ import 'semver';
|
|
|
17
17
|
import 'node:fs/promises';
|
|
18
18
|
import 'i18next';
|
|
19
19
|
import 'i18next-fs-backend';
|
|
20
|
+
import '@rainbowatcher/toml-edit-js';
|
|
20
21
|
|
|
21
22
|
async function handleCancellation() {
|
|
22
23
|
ensureI18nInitialized();
|
|
@@ -33,9 +34,8 @@ async function handleOfficialLoginMode() {
|
|
|
33
34
|
}
|
|
34
35
|
async function handleCustomApiMode() {
|
|
35
36
|
ensureI18nInitialized();
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
if (codeToolType === "claude-code") {
|
|
37
|
+
const codeToolType = getActiveCodeTool();
|
|
38
|
+
if (isClaudeFamilyCodeTool(codeToolType)) {
|
|
39
39
|
const { configureIncrementalManagement } = await import('./claude-code-incremental-manager.mjs');
|
|
40
40
|
await configureIncrementalManagement();
|
|
41
41
|
return;
|
|
@@ -137,7 +137,10 @@ async function handleCcrProxyMode() {
|
|
|
137
137
|
async function handleSwitchConfigMode() {
|
|
138
138
|
ensureI18nInitialized();
|
|
139
139
|
const { configSwitchCommand } = await import('../cli.mjs').then(function (n) { return n.c; });
|
|
140
|
-
|
|
140
|
+
const activeTool = getActiveCodeTool();
|
|
141
|
+
await configSwitchCommand({
|
|
142
|
+
codeType: isClaudeFamilyCodeTool(activeTool) ? activeTool : "claude-code"
|
|
143
|
+
});
|
|
141
144
|
}
|
|
142
145
|
async function configureApiFeature() {
|
|
143
146
|
ensureI18nInitialized();
|
|
@@ -177,15 +180,17 @@ async function configureApiFeature() {
|
|
|
177
180
|
}
|
|
178
181
|
async function configureMcpFeature() {
|
|
179
182
|
ensureI18nInitialized();
|
|
183
|
+
const codeToolType = getActiveCodeTool();
|
|
184
|
+
const mcpTool = isClaudeFamilyCodeTool(codeToolType) ? codeToolType : "claude-code";
|
|
180
185
|
if (isWindows()) {
|
|
181
186
|
const fixWindows = await promptBoolean({
|
|
182
187
|
message: i18n.t("configuration:fixWindowsMcp") || "Fix Windows MCP configuration?",
|
|
183
188
|
defaultValue: true
|
|
184
189
|
});
|
|
185
190
|
if (fixWindows) {
|
|
186
|
-
const existingConfig = readMcpConfig() || { mcpServers: {} };
|
|
191
|
+
const existingConfig = readMcpConfig(mcpTool) || { mcpServers: {} };
|
|
187
192
|
const fixedConfig = fixWindowsMcpConfig(existingConfig);
|
|
188
|
-
writeMcpConfig(fixedConfig);
|
|
193
|
+
writeMcpConfig(fixedConfig, mcpTool);
|
|
189
194
|
console.log(ansis.green(`\u2714 ${i18n.t("configuration:windowsMcpConfigFixed")}`));
|
|
190
195
|
}
|
|
191
196
|
}
|
|
@@ -194,7 +199,7 @@ async function configureMcpFeature() {
|
|
|
194
199
|
return;
|
|
195
200
|
}
|
|
196
201
|
if (selectedServices.length > 0) {
|
|
197
|
-
const mcpBackupPath = backupMcpConfig();
|
|
202
|
+
const mcpBackupPath = backupMcpConfig(mcpTool);
|
|
198
203
|
if (mcpBackupPath) {
|
|
199
204
|
console.log(ansis.gray(`\u2714 ${i18n.t("mcp:mcpBackupSuccess")}: ${mcpBackupPath}`));
|
|
200
205
|
}
|
|
@@ -219,20 +224,22 @@ async function configureMcpFeature() {
|
|
|
219
224
|
}
|
|
220
225
|
newServers[service.id] = config;
|
|
221
226
|
}
|
|
222
|
-
const existingConfig = readMcpConfig();
|
|
227
|
+
const existingConfig = readMcpConfig(mcpTool);
|
|
223
228
|
let mergedConfig = mergeMcpServers(existingConfig, newServers);
|
|
224
229
|
mergedConfig = fixWindowsMcpConfig(mergedConfig);
|
|
225
|
-
writeMcpConfig(mergedConfig);
|
|
230
|
+
writeMcpConfig(mergedConfig, mcpTool);
|
|
226
231
|
console.log(ansis.green(`\u2714 ${i18n.t("mcp:mcpConfigSuccess")}`));
|
|
227
232
|
}
|
|
228
233
|
}
|
|
229
234
|
async function configureDefaultModelFeature() {
|
|
230
235
|
ensureI18nInitialized();
|
|
231
|
-
const
|
|
236
|
+
const codeToolType = getActiveCodeTool();
|
|
237
|
+
const runtimeLabel = getClaudeFamilyRuntimeLabel(isClaudeFamilyCodeTool(codeToolType) ? codeToolType : "claude-code");
|
|
238
|
+
const existingModel = getExistingModelConfig(isClaudeFamilyCodeTool(codeToolType) ? codeToolType : "claude-code");
|
|
232
239
|
if (existingModel) {
|
|
233
240
|
console.log(`
|
|
234
241
|
${ansis.blue(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing model configuration"}`)}`);
|
|
235
|
-
const modelDisplay = existingModel === "default" ? i18n.t("configuration:defaultModelOption"
|
|
242
|
+
const modelDisplay = existingModel === "default" ? i18n.t("configuration:defaultModelOption", { runtime: runtimeLabel }) : existingModel.charAt(0).toUpperCase() + existingModel.slice(1);
|
|
236
243
|
console.log(ansis.gray(` ${i18n.t("configuration:currentModel") || "Current model"}: ${modelDisplay}
|
|
237
244
|
`));
|
|
238
245
|
const modify = await promptBoolean({
|
|
@@ -250,7 +257,7 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing
|
|
|
250
257
|
message: i18n.t("configuration:selectDefaultModel") || "Select default model",
|
|
251
258
|
choices: addNumbersToChoices([
|
|
252
259
|
{
|
|
253
|
-
name: i18n.t("configuration:defaultModelOption"
|
|
260
|
+
name: i18n.t("configuration:defaultModelOption", { runtime: runtimeLabel }),
|
|
254
261
|
value: "default"
|
|
255
262
|
},
|
|
256
263
|
{
|
|
@@ -278,11 +285,12 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing
|
|
|
278
285
|
console.log(ansis.yellow(`\u26A0 ${i18n.t("configuration:customModelSkipped") || "Custom model configuration skipped"}`));
|
|
279
286
|
return;
|
|
280
287
|
}
|
|
281
|
-
|
|
288
|
+
const modelTool = isClaudeFamilyCodeTool(codeToolType) ? codeToolType : "claude-code";
|
|
289
|
+
updateCustomModel(primaryModel, haikuModel, sonnetModel, opusModel, modelTool);
|
|
282
290
|
console.log(ansis.green(`\u2714 ${i18n.t("configuration:customModelConfigured") || "Custom model configuration completed"}`));
|
|
283
291
|
return;
|
|
284
292
|
}
|
|
285
|
-
updateDefaultModel(model);
|
|
293
|
+
updateDefaultModel(model, isClaudeFamilyCodeTool(codeToolType) ? codeToolType : "claude-code");
|
|
286
294
|
console.log(ansis.green(`\u2714 ${i18n.t("configuration:modelConfigured") || "Default model configured"}`));
|
|
287
295
|
}
|
|
288
296
|
async function promptCustomModels(defaultPrimaryModel, defaultHaikuModel, defaultSonnetModel, defaultOpusModel) {
|
|
@@ -314,6 +322,8 @@ async function promptCustomModels(defaultPrimaryModel, defaultHaikuModel, defaul
|
|
|
314
322
|
}
|
|
315
323
|
async function configureAiMemoryFeature() {
|
|
316
324
|
ensureI18nInitialized();
|
|
325
|
+
const codeToolType = getActiveCodeTool();
|
|
326
|
+
const memoryTool = isClaudeFamilyCodeTool(codeToolType) ? codeToolType : "claude-code";
|
|
317
327
|
const { option } = await inquirer.prompt({
|
|
318
328
|
type: "list",
|
|
319
329
|
name: "option",
|
|
@@ -351,13 +361,13 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existi
|
|
|
351
361
|
return;
|
|
352
362
|
}
|
|
353
363
|
}
|
|
354
|
-
const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
364
|
+
const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.bw; });
|
|
355
365
|
const aiOutputLang = await selectAiOutputLanguage();
|
|
356
|
-
applyAiLanguageDirective(aiOutputLang);
|
|
366
|
+
applyAiLanguageDirective(aiOutputLang, memoryTool);
|
|
357
367
|
updateCcjkConfig({ aiOutputLang });
|
|
358
368
|
console.log(ansis.green(`\u2714 ${i18n.t("configuration:aiLanguageConfigured") || "AI output language configured"}`));
|
|
359
369
|
} else if (option === "outputStyle") {
|
|
360
|
-
await configureOutputStyle();
|
|
370
|
+
await configureOutputStyle(void 0, void 0, memoryTool);
|
|
361
371
|
}
|
|
362
372
|
}
|
|
363
373
|
async function changeScriptLanguageFeature(currentLang) {
|
|
@@ -384,7 +394,7 @@ async function changeScriptLanguageFeature(currentLang) {
|
|
|
384
394
|
}
|
|
385
395
|
async function configureCodexDefaultModelFeature() {
|
|
386
396
|
ensureI18nInitialized();
|
|
387
|
-
const { readCodexConfig } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
397
|
+
const { readCodexConfig } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
|
|
388
398
|
const existingConfig = readCodexConfig();
|
|
389
399
|
const currentModel = existingConfig?.model;
|
|
390
400
|
if (currentModel) {
|
|
@@ -489,7 +499,7 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existi
|
|
|
489
499
|
return;
|
|
490
500
|
}
|
|
491
501
|
}
|
|
492
|
-
const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
502
|
+
const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.bw; });
|
|
493
503
|
const aiOutputLang = await selectAiOutputLanguage();
|
|
494
504
|
await updateCodexLanguageDirective(aiOutputLang);
|
|
495
505
|
updateCcjkConfig({ aiOutputLang });
|
|
@@ -497,15 +507,15 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existi
|
|
|
497
507
|
} else if (option === "systemPrompt") {
|
|
498
508
|
const ccjkConfig = readCcjkConfig();
|
|
499
509
|
const currentLang = ccjkConfig?.aiOutputLang || "English";
|
|
500
|
-
const { runCodexSystemPromptSelection } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
510
|
+
const { runCodexSystemPromptSelection } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
|
|
501
511
|
await runCodexSystemPromptSelection();
|
|
502
512
|
await ensureLanguageDirectiveInAgents(currentLang);
|
|
503
513
|
console.log(ansis.green(`\u2714 ${i18n.t("configuration:systemPromptConfigured")}`));
|
|
504
514
|
}
|
|
505
515
|
}
|
|
506
516
|
async function updateCodexModelProvider(modelProvider) {
|
|
507
|
-
const { backupCodexConfig, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
508
|
-
const { updateCodexApiFields } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
517
|
+
const { backupCodexConfig, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
|
|
518
|
+
const { updateCodexApiFields } = await import('./simple-config.mjs').then(function (n) { return n.by; });
|
|
509
519
|
const backupPath = backupCodexConfig();
|
|
510
520
|
if (backupPath) {
|
|
511
521
|
console.log(ansis.gray(getBackupMessage(backupPath)));
|
|
@@ -513,7 +523,7 @@ async function updateCodexModelProvider(modelProvider) {
|
|
|
513
523
|
updateCodexApiFields({ model: modelProvider });
|
|
514
524
|
}
|
|
515
525
|
async function ensureLanguageDirectiveInAgents(aiOutputLang) {
|
|
516
|
-
const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
526
|
+
const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.br; });
|
|
517
527
|
const { homedir } = await import('node:os');
|
|
518
528
|
const { join } = await import('pathe');
|
|
519
529
|
const CODEX_AGENTS_FILE = join(homedir(), ".codex", "AGENTS.md");
|
|
@@ -531,7 +541,7 @@ async function ensureLanguageDirectiveInAgents(aiOutputLang) {
|
|
|
531
541
|
const langLabel = languageLabels[aiOutputLang] || aiOutputLang;
|
|
532
542
|
const hasLanguageDirective = /\*\*Most Important:\s*Always respond in [^*]+\*\*/i.test(content);
|
|
533
543
|
if (!hasLanguageDirective) {
|
|
534
|
-
const { backupCodexAgents, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
544
|
+
const { backupCodexAgents, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
|
|
535
545
|
const backupPath = backupCodexAgents();
|
|
536
546
|
if (backupPath) {
|
|
537
547
|
console.log(ansis.gray(getBackupMessage(backupPath)));
|
|
@@ -548,8 +558,8 @@ async function ensureLanguageDirectiveInAgents(aiOutputLang) {
|
|
|
548
558
|
}
|
|
549
559
|
}
|
|
550
560
|
async function updateCodexLanguageDirective(aiOutputLang) {
|
|
551
|
-
const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
552
|
-
const { backupCodexAgents, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.
|
|
561
|
+
const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.br; });
|
|
562
|
+
const { backupCodexAgents, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
|
|
553
563
|
const { homedir } = await import('node:os');
|
|
554
564
|
const { join } = await import('pathe');
|
|
555
565
|
const CODEX_AGENTS_FILE = join(homedir(), ".codex", "AGENTS.md");
|
|
@@ -580,6 +590,8 @@ async function updateCodexLanguageDirective(aiOutputLang) {
|
|
|
580
590
|
}
|
|
581
591
|
async function configureEnvPermissionFeature() {
|
|
582
592
|
ensureI18nInitialized();
|
|
593
|
+
const codeToolType = getActiveCodeTool();
|
|
594
|
+
const settingsTool = isClaudeFamilyCodeTool(codeToolType) ? codeToolType : "claude-code";
|
|
583
595
|
const { choice } = await inquirer.prompt({
|
|
584
596
|
type: "list",
|
|
585
597
|
name: "choice",
|
|
@@ -612,16 +624,16 @@ async function configureEnvPermissionFeature() {
|
|
|
612
624
|
try {
|
|
613
625
|
switch (choice) {
|
|
614
626
|
case "env":
|
|
615
|
-
await importRecommendedEnv();
|
|
627
|
+
await importRecommendedEnv(settingsTool);
|
|
616
628
|
console.log(ansis.green(`\u2705 ${i18n.t("configuration:envImportSuccess")}`));
|
|
617
629
|
break;
|
|
618
630
|
case "permissions":
|
|
619
|
-
await importRecommendedPermissions();
|
|
631
|
+
await importRecommendedPermissions(settingsTool);
|
|
620
632
|
console.log(ansis.green(`\u2705 ${i18n.t("configuration:permissionsImportSuccess") || "Permissions imported"}`));
|
|
621
633
|
break;
|
|
622
634
|
case "open":
|
|
623
635
|
console.log(ansis.cyan(i18n.t("configuration:openingSettingsJson") || "Opening settings.json..."));
|
|
624
|
-
await openSettingsJson();
|
|
636
|
+
await openSettingsJson(settingsTool);
|
|
625
637
|
break;
|
|
626
638
|
}
|
|
627
639
|
} catch (error) {
|