ccjk 12.3.4 → 12.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -206,7 +206,7 @@ class ClaudeCodeConfigManager {
206
206
  ensureI18nInitialized();
207
207
  try {
208
208
  if (!profile) {
209
- const { switchToOfficialLogin } = await import('./config.mjs').then(function (n) { return n.j; });
209
+ const { switchToOfficialLogin } = await import('./config.mjs').then(function (n) { return n.k; });
210
210
  switchToOfficialLogin();
211
211
  return;
212
212
  }
@@ -157,6 +157,9 @@ function updateCustomModel(primaryModel, haikuModel, sonnetModel, opusModel) {
157
157
  delete settings.model;
158
158
  settings.env = settings.env || {};
159
159
  clearModelEnv(settings.env);
160
+ if (primaryModel?.trim()) {
161
+ settings.env.ANTHROPIC_MODEL = primaryModel.trim();
162
+ }
160
163
  if (haikuModel?.trim())
161
164
  settings.env.ANTHROPIC_DEFAULT_HAIKU_MODEL = haikuModel.trim();
162
165
  if (sonnetModel?.trim())
@@ -259,6 +262,27 @@ function getExistingModelConfig() {
259
262
  }
260
263
  return "default";
261
264
  }
265
+ function getExistingCustomModelConfig() {
266
+ const settings = readJsonConfig(SETTINGS_FILE);
267
+ if (!settings || !settings.env) {
268
+ return null;
269
+ }
270
+ const {
271
+ ANTHROPIC_MODEL,
272
+ ANTHROPIC_DEFAULT_HAIKU_MODEL,
273
+ ANTHROPIC_DEFAULT_SONNET_MODEL,
274
+ ANTHROPIC_DEFAULT_OPUS_MODEL
275
+ } = settings.env;
276
+ if (!ANTHROPIC_MODEL && !ANTHROPIC_DEFAULT_HAIKU_MODEL && !ANTHROPIC_DEFAULT_SONNET_MODEL && !ANTHROPIC_DEFAULT_OPUS_MODEL) {
277
+ return null;
278
+ }
279
+ return {
280
+ primaryModel: ANTHROPIC_MODEL,
281
+ haikuModel: ANTHROPIC_DEFAULT_HAIKU_MODEL,
282
+ sonnetModel: ANTHROPIC_DEFAULT_SONNET_MODEL,
283
+ opusModel: ANTHROPIC_DEFAULT_OPUS_MODEL
284
+ };
285
+ }
262
286
  function getExistingApiConfig() {
263
287
  const settings = readJsonConfig(SETTINGS_FILE);
264
288
  if (!settings || !settings.env) {
@@ -364,6 +388,7 @@ const config = {
364
388
  copyConfigFiles: copyConfigFiles,
365
389
  ensureClaudeDir: ensureClaudeDir,
366
390
  getExistingApiConfig: getExistingApiConfig,
391
+ getExistingCustomModelConfig: getExistingCustomModelConfig,
367
392
  getExistingModelConfig: getExistingModelConfig,
368
393
  mergeConfigs: mergeConfigs,
369
394
  mergeSettingsFile: mergeSettingsFile,
@@ -373,4 +398,4 @@ const config = {
373
398
  updateDefaultModel: updateDefaultModel
374
399
  };
375
400
 
376
- export { clearModelEnv as a, backupExistingConfig as b, copyConfigFiles as c, configureApi as d, applyAiLanguageDirective as e, getExistingModelConfig as f, getExistingApiConfig as g, updateDefaultModel as h, ensureClaudeDir as i, config as j, promptApiConfigurationAction as p, switchToOfficialLogin as s, updateCustomModel as u };
401
+ export { clearModelEnv as a, backupExistingConfig as b, copyConfigFiles as c, configureApi as d, applyAiLanguageDirective as e, getExistingModelConfig as f, getExistingApiConfig as g, getExistingCustomModelConfig as h, updateDefaultModel as i, ensureClaudeDir as j, config as k, promptApiConfigurationAction as p, switchToOfficialLogin as s, updateCustomModel as u };
@@ -814,7 +814,7 @@ async function checkPermissionRules() {
814
814
  }
815
815
  async function fixSettingsFile() {
816
816
  const isZh = i18n.language === "zh-CN";
817
- const { copyConfigFiles } = await import('./config.mjs').then(function (n) { return n.j; });
817
+ const { copyConfigFiles } = await import('./config.mjs').then(function (n) { return n.k; });
818
818
  console.log("");
819
819
  console.log(a.bold.cyan("\u{1F527} Fixing settings.json"));
820
820
  console.log(a.dim("\u2500".repeat(50)));
@@ -17,7 +17,7 @@ import { a as addCompletedOnboarding, s as setPrimaryApiKey, c as backupMcpConfi
17
17
  import { r as resolveCodeType } from '../shared/ccjk.Cot9p9_n.mjs';
18
18
  import { exists } from './fs-operations.mjs';
19
19
  import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
20
- import { p as promptApiConfigurationAction, i as ensureClaudeDir, g as getExistingApiConfig, s as switchToOfficialLogin, b as backupExistingConfig, c as copyConfigFiles, e as applyAiLanguageDirective, d as configureApi } from './config.mjs';
20
+ import { p as promptApiConfigurationAction, j as ensureClaudeDir, g as getExistingApiConfig, s as switchToOfficialLogin, b as backupExistingConfig, c as copyConfigFiles, e as applyAiLanguageDirective, d as configureApi } from './config.mjs';
21
21
  import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DcKLglJQ.mjs';
22
22
  import { getInstallationStatus, installClaudeCode } from './installer.mjs';
23
23
  import { p as parseOrchestrationLevel, w as writeOrchestrationPolicy } from './smart-defaults.mjs';
@@ -1026,7 +1026,7 @@ async function init(options = {}) {
1026
1026
  const hasModelParams = options.apiModel || options.apiHaikuModel || options.apiSonnetModel || options.apiOpusModel;
1027
1027
  if (hasModelParams && action !== "docs-only" && codeToolType === "claude-code") {
1028
1028
  if (options.skipPrompt) {
1029
- const { updateCustomModel } = await import('./config.mjs').then(function (n) { return n.j; });
1029
+ const { updateCustomModel } = await import('./config.mjs').then(function (n) { return n.k; });
1030
1030
  updateCustomModel(
1031
1031
  options.apiModel || void 0,
1032
1032
  options.apiHaikuModel || void 0,
@@ -13,7 +13,7 @@ import { h as handleExitPromptError, a as handleGeneralError } from '../shared/c
13
13
  import { homedir } from 'node:os';
14
14
  import { setupCcrConfiguration, readCcrConfig, configureCcrFeature } from './config2.mjs';
15
15
  import { a as isCcrInstalled, b as installCcr, i as init } from './init.mjs';
16
- import { e as applyAiLanguageDirective, f as getExistingModelConfig, u as updateCustomModel, h as updateDefaultModel, g as getExistingApiConfig, p as promptApiConfigurationAction, d as configureApi, s as switchToOfficialLogin } from './config.mjs';
16
+ import { e as applyAiLanguageDirective, f as getExistingModelConfig, h as getExistingCustomModelConfig, u as updateCustomModel, i as updateDefaultModel, g as getExistingApiConfig, p as promptApiConfigurationAction, d as configureApi, s as switchToOfficialLogin } from './config.mjs';
17
17
  import { c as configureOutputStyle, a as modifyApiConfigPartially, v as validateApiKey, f as formatApiKeyDisplay } from '../shared/ccjk.XsJWJuQP.mjs';
18
18
  import { k as isWindows } from './platform.mjs';
19
19
  import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
@@ -283,7 +283,13 @@ ${a.green(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing mod
283
283
  return;
284
284
  }
285
285
  if (model === "custom") {
286
- const { primaryModel, haikuModel, sonnetModel, opusModel } = await promptCustomModels();
286
+ const existingCustomConfig = getExistingCustomModelConfig();
287
+ const { primaryModel, haikuModel, sonnetModel, opusModel } = await promptCustomModels(
288
+ existingCustomConfig?.primaryModel,
289
+ existingCustomConfig?.haikuModel,
290
+ existingCustomConfig?.sonnetModel,
291
+ existingCustomConfig?.opusModel
292
+ );
287
293
  if (!primaryModel.trim() && !haikuModel.trim() && !sonnetModel.trim() && !opusModel.trim()) {
288
294
  console.log(a.yellow(`\u26A0 ${i18n.t("configuration:customModelSkipped") || "Custom model configuration skipped"}`));
289
295
  return;
@@ -78,7 +78,7 @@ async function runOnboardingWizard(options = {}) {
78
78
  console.log(a.bold(`${isZh ? "\u6B65\u9AA4 2/3" : "Step 2/3"}: ${isZh ? "API \u914D\u7F6E" : "API Configuration"}${step2Done ? a.green(" \u2714") : ""}`));
79
79
  if (!step2Done) {
80
80
  try {
81
- const { getExistingApiConfig } = await import('./config.mjs').then(function (n) { return n.j; });
81
+ const { getExistingApiConfig } = await import('./config.mjs').then(function (n) { return n.k; });
82
82
  const existing = getExistingApiConfig();
83
83
  if (existing?.key || existing?.url) {
84
84
  console.log(a.green(` \u2714 ${isZh ? "\u5DF2\u914D\u7F6E" : "Already configured"}`));
@@ -1,3 +1,3 @@
1
- const version = "12.3.4";
1
+ const version = "12.3.5";
2
2
 
3
3
  export { version };
@@ -122,7 +122,7 @@ function getSlashCommands() {
122
122
  descriptionZh: "\u521B\u5EFA\u914D\u7F6E\u5907\u4EFD",
123
123
  category: "system",
124
124
  handler: async () => {
125
- const { backupExistingConfig } = await import('./config.mjs').then(function (n) { return n.j; });
125
+ const { backupExistingConfig } = await import('./config.mjs').then(function (n) { return n.k; });
126
126
  const backupPath = backupExistingConfig();
127
127
  if (backupPath) {
128
128
  console.log(a.green(`\u2705 Backup created: ${backupPath}`));
package/dist/cli.mjs CHANGED
@@ -1212,11 +1212,13 @@ ${ansis.yellow("By Status:")}`);
1212
1212
  const { configCommand } = await import('./chunks/config3.mjs');
1213
1213
  return async (options, action, key, value) => {
1214
1214
  const args = [];
1215
+ if (action !== void 0)
1216
+ args.push(action);
1215
1217
  if (key !== void 0)
1216
1218
  args.push(key);
1217
1219
  if (value !== void 0)
1218
1220
  args.push(value);
1219
- await configCommand(action || "list", args, {
1221
+ await configCommand(args, {
1220
1222
  lang: options.lang,
1221
1223
  codeType: options.codeType,
1222
1224
  global: options.global,
package/dist/index.d.mts CHANGED
@@ -1175,6 +1175,15 @@ declare function mergeSettingsFile(templatePath: string, targetPath: string): vo
1175
1175
  * Get existing model configuration from settings.json
1176
1176
  */
1177
1177
  declare function getExistingModelConfig(): 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom' | null;
1178
+ /**
1179
+ * Get existing custom model configuration from settings.json
1180
+ */
1181
+ declare function getExistingCustomModelConfig(): {
1182
+ primaryModel?: string;
1183
+ haikuModel?: string;
1184
+ sonnetModel?: string;
1185
+ opusModel?: string;
1186
+ } | null;
1178
1187
  /**
1179
1188
  * Get existing API configuration from settings.json
1180
1189
  */
@@ -1200,6 +1209,7 @@ declare const config_configureHooks: typeof configureHooks;
1200
1209
  declare const config_copyConfigFiles: typeof copyConfigFiles;
1201
1210
  declare const config_ensureClaudeDir: typeof ensureClaudeDir;
1202
1211
  declare const config_getExistingApiConfig: typeof getExistingApiConfig;
1212
+ declare const config_getExistingCustomModelConfig: typeof getExistingCustomModelConfig;
1203
1213
  declare const config_getExistingModelConfig: typeof getExistingModelConfig;
1204
1214
  declare const config_mergeConfigs: typeof mergeConfigs;
1205
1215
  declare const config_mergeSettingsFile: typeof mergeSettingsFile;
@@ -1208,7 +1218,7 @@ declare const config_switchToOfficialLogin: typeof switchToOfficialLogin;
1208
1218
  declare const config_updateCustomModel: typeof updateCustomModel;
1209
1219
  declare const config_updateDefaultModel: typeof updateDefaultModel;
1210
1220
  declare namespace config {
1211
- export { config_applyAiLanguageDirective as applyAiLanguageDirective, config_backupExistingConfig as backupExistingConfig, config_configureApi as configureApi, config_configureHooks as configureHooks, config_copyConfigFiles as copyConfigFiles, config_ensureClaudeDir as ensureClaudeDir, config_getExistingApiConfig as getExistingApiConfig, config_getExistingModelConfig as getExistingModelConfig, config_mergeConfigs as mergeConfigs, config_mergeSettingsFile as mergeSettingsFile, config_promptApiConfigurationAction as promptApiConfigurationAction, config_switchToOfficialLogin as switchToOfficialLogin, config_updateCustomModel as updateCustomModel, config_updateDefaultModel as updateDefaultModel };
1221
+ export { config_applyAiLanguageDirective as applyAiLanguageDirective, config_backupExistingConfig as backupExistingConfig, config_configureApi as configureApi, config_configureHooks as configureHooks, config_copyConfigFiles as copyConfigFiles, config_ensureClaudeDir as ensureClaudeDir, config_getExistingApiConfig as getExistingApiConfig, config_getExistingCustomModelConfig as getExistingCustomModelConfig, config_getExistingModelConfig as getExistingModelConfig, config_mergeConfigs as mergeConfigs, config_mergeSettingsFile as mergeSettingsFile, config_promptApiConfigurationAction as promptApiConfigurationAction, config_switchToOfficialLogin as switchToOfficialLogin, config_updateCustomModel as updateCustomModel, config_updateDefaultModel as updateDefaultModel };
1212
1222
  export type { config_ApiConfig as ApiConfig };
1213
1223
  }
1214
1224
 
package/dist/index.d.ts CHANGED
@@ -1175,6 +1175,15 @@ declare function mergeSettingsFile(templatePath: string, targetPath: string): vo
1175
1175
  * Get existing model configuration from settings.json
1176
1176
  */
1177
1177
  declare function getExistingModelConfig(): 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom' | null;
1178
+ /**
1179
+ * Get existing custom model configuration from settings.json
1180
+ */
1181
+ declare function getExistingCustomModelConfig(): {
1182
+ primaryModel?: string;
1183
+ haikuModel?: string;
1184
+ sonnetModel?: string;
1185
+ opusModel?: string;
1186
+ } | null;
1178
1187
  /**
1179
1188
  * Get existing API configuration from settings.json
1180
1189
  */
@@ -1200,6 +1209,7 @@ declare const config_configureHooks: typeof configureHooks;
1200
1209
  declare const config_copyConfigFiles: typeof copyConfigFiles;
1201
1210
  declare const config_ensureClaudeDir: typeof ensureClaudeDir;
1202
1211
  declare const config_getExistingApiConfig: typeof getExistingApiConfig;
1212
+ declare const config_getExistingCustomModelConfig: typeof getExistingCustomModelConfig;
1203
1213
  declare const config_getExistingModelConfig: typeof getExistingModelConfig;
1204
1214
  declare const config_mergeConfigs: typeof mergeConfigs;
1205
1215
  declare const config_mergeSettingsFile: typeof mergeSettingsFile;
@@ -1208,7 +1218,7 @@ declare const config_switchToOfficialLogin: typeof switchToOfficialLogin;
1208
1218
  declare const config_updateCustomModel: typeof updateCustomModel;
1209
1219
  declare const config_updateDefaultModel: typeof updateDefaultModel;
1210
1220
  declare namespace config {
1211
- export { config_applyAiLanguageDirective as applyAiLanguageDirective, config_backupExistingConfig as backupExistingConfig, config_configureApi as configureApi, config_configureHooks as configureHooks, config_copyConfigFiles as copyConfigFiles, config_ensureClaudeDir as ensureClaudeDir, config_getExistingApiConfig as getExistingApiConfig, config_getExistingModelConfig as getExistingModelConfig, config_mergeConfigs as mergeConfigs, config_mergeSettingsFile as mergeSettingsFile, config_promptApiConfigurationAction as promptApiConfigurationAction, config_switchToOfficialLogin as switchToOfficialLogin, config_updateCustomModel as updateCustomModel, config_updateDefaultModel as updateDefaultModel };
1221
+ export { config_applyAiLanguageDirective as applyAiLanguageDirective, config_backupExistingConfig as backupExistingConfig, config_configureApi as configureApi, config_configureHooks as configureHooks, config_copyConfigFiles as copyConfigFiles, config_ensureClaudeDir as ensureClaudeDir, config_getExistingApiConfig as getExistingApiConfig, config_getExistingCustomModelConfig as getExistingCustomModelConfig, config_getExistingModelConfig as getExistingModelConfig, config_mergeConfigs as mergeConfigs, config_mergeSettingsFile as mergeSettingsFile, config_promptApiConfigurationAction as promptApiConfigurationAction, config_switchToOfficialLogin as switchToOfficialLogin, config_updateCustomModel as updateCustomModel, config_updateDefaultModel as updateDefaultModel };
1212
1222
  export type { config_ApiConfig as ApiConfig };
1213
1223
  }
1214
1224
 
package/dist/index.mjs CHANGED
@@ -13,7 +13,7 @@ import { promisify } from 'node:util';
13
13
  import a from './chunks/index3.mjs';
14
14
  import { g as getRuntimeVersion } from './shared/ccjk.gDEDGD_t.mjs';
15
15
  import { j as join$1 } from './shared/ccjk.bQ7Dh1g4.mjs';
16
- export { j as config } from './chunks/config.mjs';
16
+ export { k as config } from './chunks/config.mjs';
17
17
  export { a as loggerUtils } from './shared/ccjk.DJdmgr2d.mjs';
18
18
  export { p as platform } from './chunks/platform.mjs';
19
19
  import { Transform } from 'node:stream';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccjk",
3
3
  "type": "module",
4
- "version": "12.3.4",
4
+ "version": "12.3.5",
5
5
  "packageManager": "pnpm@10.17.1",
6
6
  "description": "CLI toolkit for Claude Code and Codex setup. Simplifies MCP service installation, API configuration, workflow management, and multi-provider support with guided interactive setup.",
7
7
  "author": {