ccjk 13.3.21 → 13.3.23

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.
@@ -246,8 +246,11 @@ class ClaudeCodeConfigManager {
246
246
  profile.primaryModel || profile.defaultHaikuModel || profile.defaultSonnetModel || profile.defaultOpusModel
247
247
  );
248
248
  if (hasModelConfig) {
249
+ clearModelEnv(settings.env, "override");
249
250
  if (profile.primaryModel)
250
- settings.env.ANTHROPIC_MODEL = profile.primaryModel;
251
+ settings.model = profile.primaryModel;
252
+ else
253
+ delete settings.model;
251
254
  if (profile.defaultHaikuModel) {
252
255
  settings.env.ANTHROPIC_SMALL_FAST_MODEL = profile.defaultHaikuModel;
253
256
  settings.env.ANTHROPIC_DEFAULT_HAIKU_MODEL = profile.defaultHaikuModel;
@@ -256,9 +259,11 @@ class ClaudeCodeConfigManager {
256
259
  settings.env.ANTHROPIC_DEFAULT_SONNET_MODEL = profile.defaultSonnetModel;
257
260
  if (profile.defaultOpusModel)
258
261
  settings.env.ANTHROPIC_DEFAULT_OPUS_MODEL = profile.defaultOpusModel;
259
- delete settings.model;
262
+ if (!profile.primaryModel)
263
+ delete settings.model;
260
264
  } else {
261
265
  clearModelEnv(settings.env);
266
+ delete settings.model;
262
267
  }
263
268
  writeJsonConfig(SETTINGS_FILE, settings);
264
269
  const { setPrimaryApiKey, addCompletedOnboarding } = await import('./claude-config.mjs').then(function (n) { return n.h; });
@@ -124,13 +124,11 @@ ${i18n.t("multi-config:addingNewProfile")}`));
124
124
  }]);
125
125
  let prefilledBaseUrl;
126
126
  let prefilledAuthType;
127
- let prefilledDefaultModels;
128
127
  if (selectedProvider !== "custom") {
129
128
  const provider = providers.find((p) => p.id === selectedProvider);
130
129
  if (provider?.claudeCode) {
131
130
  prefilledBaseUrl = provider.claudeCode.baseUrl;
132
131
  prefilledAuthType = provider.claudeCode.authType;
133
- prefilledDefaultModels = provider.claudeCode.defaultModels;
134
132
  console.log(a.gray(i18n.t("api:providerSelected", { name: provider.name })));
135
133
  }
136
134
  }
@@ -230,15 +228,6 @@ ${i18n.t("multi-config:addingNewProfile")}`));
230
228
  profile.defaultSonnetModel = modelConfig.sonnetModel.trim();
231
229
  if (modelConfig.opusModel.trim())
232
230
  profile.defaultOpusModel = modelConfig.opusModel.trim();
233
- } else if (prefilledDefaultModels?.length) {
234
- if (prefilledDefaultModels[0]?.trim())
235
- profile.primaryModel = prefilledDefaultModels[0].trim();
236
- if (prefilledDefaultModels[1]?.trim())
237
- profile.defaultHaikuModel = prefilledDefaultModels[1].trim();
238
- if (prefilledDefaultModels[2]?.trim())
239
- profile.defaultSonnetModel = prefilledDefaultModels[2].trim();
240
- if (prefilledDefaultModels[3]?.trim())
241
- profile.defaultOpusModel = prefilledDefaultModels[3].trim();
242
231
  }
243
232
  const existingProfile = ClaudeCodeConfigManager.getProfileByName(profile.name);
244
233
  if (existingProfile) {
@@ -159,11 +159,12 @@ function updateCustomModel(primaryModel, haikuModel, sonnetModel, opusModel) {
159
159
  if (existingSettings) {
160
160
  settings = existingSettings;
161
161
  }
162
- delete settings.model;
163
162
  settings.env = settings.env || {};
164
163
  clearModelEnv(settings.env, "override");
165
164
  if (primaryModel?.trim()) {
166
- settings.env.ANTHROPIC_MODEL = primaryModel.trim();
165
+ settings.model = primaryModel.trim();
166
+ } else {
167
+ delete settings.model;
167
168
  }
168
169
  if (haikuModel?.trim()) {
169
170
  settings.env.ANTHROPIC_SMALL_FAST_MODEL = haikuModel.trim();
@@ -256,7 +257,7 @@ function getExistingModelConfig() {
256
257
  if (!settings) {
257
258
  return null;
258
259
  }
259
- const hasModelEnv = MODEL_ENV_KEYS.some((key) => {
260
+ const hasModelEnv = MODEL_ENV_KEYS.filter((key) => key !== "ANTHROPIC_MODEL").some((key) => {
260
261
  const value = settings.env?.[key];
261
262
  return value !== void 0 && value !== null && value !== "";
262
263
  });
@@ -270,25 +271,25 @@ function getExistingModelConfig() {
270
271
  if (validModels.includes(settings.model)) {
271
272
  return settings.model;
272
273
  }
273
- return "default";
274
+ return "custom";
274
275
  }
275
276
  function getExistingCustomModelConfig() {
276
277
  const settings = readJsonConfig(SETTINGS_FILE);
277
- if (!settings || !settings.env) {
278
+ if (!settings) {
278
279
  return null;
279
280
  }
280
281
  const {
281
- ANTHROPIC_MODEL,
282
282
  ANTHROPIC_SMALL_FAST_MODEL,
283
283
  ANTHROPIC_DEFAULT_HAIKU_MODEL,
284
284
  ANTHROPIC_DEFAULT_SONNET_MODEL,
285
285
  ANTHROPIC_DEFAULT_OPUS_MODEL
286
- } = settings.env;
287
- if (!ANTHROPIC_MODEL && !ANTHROPIC_DEFAULT_HAIKU_MODEL && !ANTHROPIC_DEFAULT_SONNET_MODEL && !ANTHROPIC_DEFAULT_OPUS_MODEL) {
286
+ } = settings.env || {};
287
+ const primaryModel = settings.model && !["opus", "sonnet", "sonnet[1m]"].includes(settings.model) ? settings.model : settings.env?.ANTHROPIC_MODEL;
288
+ if (!primaryModel && !ANTHROPIC_DEFAULT_HAIKU_MODEL && !ANTHROPIC_DEFAULT_SONNET_MODEL && !ANTHROPIC_DEFAULT_OPUS_MODEL) {
288
289
  return null;
289
290
  }
290
291
  return {
291
- primaryModel: ANTHROPIC_MODEL,
292
+ primaryModel,
292
293
  haikuModel: ANTHROPIC_DEFAULT_HAIKU_MODEL || ANTHROPIC_SMALL_FAST_MODEL,
293
294
  sonnetModel: ANTHROPIC_DEFAULT_SONNET_MODEL,
294
295
  opusModel: ANTHROPIC_DEFAULT_OPUS_MODEL
@@ -222,12 +222,8 @@ async function setProvider(providerId, options = {}) {
222
222
  }
223
223
  if (codeType === "claude-code" && provider.claudeCode) {
224
224
  config.baseUrl = provider.claudeCode.baseUrl;
225
- if (provider.claudeCode.defaultModels && provider.claudeCode.defaultModels.length > 0) {
226
- config.model = provider.claudeCode.defaultModels[0];
227
- if (provider.claudeCode.defaultModels.length > 1) {
228
- config.fastModel = provider.claudeCode.defaultModels[1];
229
- }
230
- }
225
+ delete config.model;
226
+ delete config.fastModel;
231
227
  }
232
228
  writeClaudeConfig(config);
233
229
  console.log("");
@@ -859,13 +859,6 @@ async function init(options = {}) {
859
859
  key: options.apiKey,
860
860
  url: preset?.claudeCode?.baseUrl || options.apiUrl || API_DEFAULT_URL
861
861
  };
862
- if (preset?.claudeCode?.defaultModels && preset.claudeCode.defaultModels.length > 0) {
863
- const [primary, haiku, sonnet, opus] = preset.claudeCode.defaultModels;
864
- options.apiModel = options.apiModel || primary;
865
- options.apiHaikuModel = options.apiHaikuModel || haiku;
866
- options.apiSonnetModel = options.apiSonnetModel || sonnet;
867
- options.apiOpusModel = options.apiOpusModel || opus;
868
- }
869
862
  await saveSingleConfigToToml(apiConfig, options.provider, options);
870
863
  } else if (options.apiType === "auth_token" && options.apiKey) {
871
864
  apiConfig = {
@@ -1412,13 +1405,6 @@ async function buildClaudeCodeProfile(params) {
1412
1405
  if (preset?.claudeCode) {
1413
1406
  baseUrl = params.url || preset.claudeCode.baseUrl;
1414
1407
  authType = preset.claudeCode.authType;
1415
- if (preset.claudeCode.defaultModels && preset.claudeCode.defaultModels.length > 0) {
1416
- const [p, h, s, o] = preset.claudeCode.defaultModels;
1417
- primaryModel = primaryModel || p;
1418
- defaultHaikuModel = defaultHaikuModel || h;
1419
- defaultSonnetModel = defaultSonnetModel || s;
1420
- defaultOpusModel = defaultOpusModel || o;
1421
- }
1422
1408
  }
1423
1409
  }
1424
1410
  return {
@@ -52,7 +52,7 @@ const DEFAULT_SETTINGS_V2 = {
52
52
  };
53
53
  function validateConfig(config) {
54
54
  const errors = [];
55
- if (config.model && !["opus", "sonnet", "sonnet[1m]", "custom", "default"].includes(config.model)) {
55
+ if (config.model !== void 0 && (typeof config.model !== "string" || !config.model.trim())) {
56
56
  errors.push(`Invalid model: ${config.model}`);
57
57
  }
58
58
  if (config.thinking?.budgetTokens !== void 0) {
@@ -1,3 +1,3 @@
1
- const version = "13.3.21";
1
+ const version = "13.3.23";
2
2
 
3
3
  export { version };
package/dist/cli.mjs CHANGED
File without changes
package/dist/index.d.mts CHANGED
@@ -3832,7 +3832,7 @@ declare function configureApi(apiConfig: ApiConfig | null): ApiConfig | null;
3832
3832
  declare function configureHooks(hooks: Record<string, unknown[]>): void;
3833
3833
  declare function mergeConfigs(sourceFile: string, targetFile: string): void;
3834
3834
  /**
3835
- * Update custom model configuration using environment variables
3835
+ * Update custom model configuration using settings.model plus family-specific env overrides
3836
3836
  * @param primaryModel - Primary model name for general tasks
3837
3837
  * @param haikuModel - Default Haiku model (optional)
3838
3838
  * @param sonnetModel - Default Sonnet model (optional)
@@ -3842,7 +3842,7 @@ declare function updateCustomModel(primaryModel?: string, haikuModel?: string, s
3842
3842
  /**
3843
3843
  * Update the default model configuration in settings.json
3844
3844
  * @param model - The model type to set: opus, sonnet, sonnet[1m], default, or custom
3845
- * Note: 'custom' model type is handled differently - it should use environment variables instead
3845
+ * Note: 'custom' is configured by updateCustomModel().
3846
3846
  */
3847
3847
  declare function updateDefaultModel(model: 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom'): void;
3848
3848
  /**
package/dist/index.d.ts CHANGED
@@ -3832,7 +3832,7 @@ declare function configureApi(apiConfig: ApiConfig | null): ApiConfig | null;
3832
3832
  declare function configureHooks(hooks: Record<string, unknown[]>): void;
3833
3833
  declare function mergeConfigs(sourceFile: string, targetFile: string): void;
3834
3834
  /**
3835
- * Update custom model configuration using environment variables
3835
+ * Update custom model configuration using settings.model plus family-specific env overrides
3836
3836
  * @param primaryModel - Primary model name for general tasks
3837
3837
  * @param haikuModel - Default Haiku model (optional)
3838
3838
  * @param sonnetModel - Default Sonnet model (optional)
@@ -3842,7 +3842,7 @@ declare function updateCustomModel(primaryModel?: string, haikuModel?: string, s
3842
3842
  /**
3843
3843
  * Update the default model configuration in settings.json
3844
3844
  * @param model - The model type to set: opus, sonnet, sonnet[1m], default, or custom
3845
- * Note: 'custom' model type is handled differently - it should use environment variables instead
3845
+ * Note: 'custom' is configured by updateCustomModel().
3846
3846
  */
3847
3847
  declare function updateDefaultModel(model: 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom'): void;
3848
3848
  /**
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "ccjk",
3
3
  "type": "module",
4
- "version": "13.3.21",
4
+ "version": "13.3.23",
5
+ "packageManager": "pnpm@10.17.1",
5
6
  "description": "Turn Claude Code into a production-ready AI dev environment with one-command setup, persistent memory, MCP automation, cloud sync, and zero-config browser workflows.",
6
7
  "author": {
7
8
  "name": "CCJK Team",
@@ -80,69 +81,6 @@
80
81
  "engines": {
81
82
  "node": ">=20"
82
83
  },
83
- "dependencies": {
84
- "better-sqlite3": "^12.6.2",
85
- "fdir": "^6.5.0",
86
- "globby": "^14.1.0",
87
- "ioredis": "^5.9.3",
88
- "node-cron": "^4.2.1",
89
- "sql.js": "^1.14.0",
90
- "tar": "^7.5.9",
91
- "tinyglobby": "^0.2.15",
92
- "web-tree-sitter": "^0.26.5"
93
- },
94
- "devDependencies": {
95
- "@antfu/eslint-config": "^5.4.1",
96
- "@anthropic-ai/sdk": "^0.52.0",
97
- "@types/better-sqlite3": "^7.6.13",
98
- "@types/fs-extra": "^11.0.4",
99
- "@types/inquirer": "^9.0.9",
100
- "@types/node": "^22.18.6",
101
- "@types/node-cron": "^3.0.11",
102
- "@types/semver": "^7.7.1",
103
- "@types/uuid": "^11.0.0",
104
- "@typescript-eslint/eslint-plugin": "^6.0.0",
105
- "@typescript-eslint/parser": "^6.0.0",
106
- "@vitest/coverage-v8": "^3.2.4",
107
- "@vitest/ui": "^3.2.4",
108
- "ansis": "^4.2.0",
109
- "cac": "^6.7.14",
110
- "chokidar": "^4.0.3",
111
- "concurrently": "^9.2.1",
112
- "consola": "^3.4.2",
113
- "dayjs": "^1.11.19",
114
- "eslint": "^9.36.0",
115
- "eslint-plugin-format": "^1.4.0",
116
- "find-up-simple": "^1.0.1",
117
- "fs-extra": "^11.3.3",
118
- "gray-matter": "^4.0.3",
119
- "handlebars": "^4.7.8",
120
- "husky": "^9.1.7",
121
- "i18next": "^25.8.13",
122
- "i18next-fs-backend": "^2.6.1",
123
- "inquirer": "^12.9.6",
124
- "inquirer-toggle": "^1.0.1",
125
- "lint-staged": "^16.2.7",
126
- "lowdb": "^7.0.1",
127
- "nanoid": "^5.1.6",
128
- "ofetch": "^1.5.1",
129
- "ohash": "^1.1.4",
130
- "ora": "^8.2.0",
131
- "pathe": "^2.0.3",
132
- "pkgroll": "^2.26.3",
133
- "prettier": "^3.8.1",
134
- "semver": "^7.7.4",
135
- "shx": "^0.4.0",
136
- "smol-toml": "^1.6.0",
137
- "tinyexec": "^1.0.2",
138
- "trash": "^10.1.0",
139
- "tsx": "^4.21.0",
140
- "tweetnacl": "^1.0.3",
141
- "typescript": "^5.9.3",
142
- "unbuild": "^3.6.1",
143
- "uuid": "^11.1.0",
144
- "vitest": "^3.2.4"
145
- },
146
84
  "scripts": {
147
85
  "dev": "tsx ./src/cli.ts",
148
86
  "build": "unbuild",
@@ -150,6 +88,7 @@
150
88
  "typecheck": "tsc --noEmit",
151
89
  "release:verify": "node scripts/release-verify.mjs",
152
90
  "release:verify:full": "node scripts/release-verify.mjs --with-tests",
91
+ "prepublishOnly": "node scripts/validate-prepublish.mjs && pnpm contract:check && pnpm build",
153
92
  "lint": "eslint",
154
93
  "lint:fix": "eslint --fix",
155
94
  "test": "vitest",
@@ -171,6 +110,7 @@
171
110
  "test:integration:run": "NODE_ENV=test vitest run --config vitest.integration.config.ts",
172
111
  "test:integration:ui": "NODE_ENV=test vitest --config vitest.integration.config.ts --ui",
173
112
  "test:integration:coverage": "NODE_ENV=test vitest run --config vitest.integration.config.ts --coverage",
113
+ "prepare": "husky",
174
114
  "format": "prettier --write src/**/*.ts",
175
115
  "prepublish:fix": "node scripts/fix-package-catalog.mjs",
176
116
  "cleanup": "node scripts/cleanup.js",
@@ -205,5 +145,68 @@
205
145
  "i18n:check": "tsx scripts/check-i18n.ts",
206
146
  "i18n:report": "tsx scripts/check-i18n.ts --report",
207
147
  "contract:check": "node scripts/check-remote-contract.mjs"
148
+ },
149
+ "dependencies": {
150
+ "better-sqlite3": "^12.6.2",
151
+ "fdir": "^6.5.0",
152
+ "globby": "^14.1.0",
153
+ "ioredis": "^5.9.3",
154
+ "node-cron": "^4.2.1",
155
+ "sql.js": "^1.14.0",
156
+ "tar": "^7.5.9",
157
+ "tinyglobby": "^0.2.15",
158
+ "web-tree-sitter": "^0.26.5"
159
+ },
160
+ "devDependencies": {
161
+ "@antfu/eslint-config": "^5.4.1",
162
+ "@anthropic-ai/sdk": "^0.52.0",
163
+ "@types/better-sqlite3": "^7.6.13",
164
+ "@types/fs-extra": "^11.0.4",
165
+ "@types/inquirer": "^9.0.9",
166
+ "@types/node": "^22.18.6",
167
+ "@types/node-cron": "^3.0.11",
168
+ "@types/semver": "^7.7.1",
169
+ "@types/uuid": "^11.0.0",
170
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
171
+ "@typescript-eslint/parser": "^6.0.0",
172
+ "@vitest/coverage-v8": "^3.2.4",
173
+ "@vitest/ui": "^3.2.4",
174
+ "ansis": "^4.2.0",
175
+ "cac": "^6.7.14",
176
+ "chokidar": "^4.0.3",
177
+ "concurrently": "^9.2.1",
178
+ "consola": "^3.4.2",
179
+ "dayjs": "^1.11.19",
180
+ "eslint": "^9.36.0",
181
+ "eslint-plugin-format": "^1.4.0",
182
+ "find-up-simple": "^1.0.1",
183
+ "fs-extra": "^11.3.3",
184
+ "gray-matter": "^4.0.3",
185
+ "handlebars": "^4.7.8",
186
+ "husky": "^9.1.7",
187
+ "i18next": "^25.8.13",
188
+ "i18next-fs-backend": "^2.6.1",
189
+ "inquirer": "^12.9.6",
190
+ "inquirer-toggle": "^1.0.1",
191
+ "lint-staged": "^16.2.7",
192
+ "lowdb": "^7.0.1",
193
+ "nanoid": "^5.1.6",
194
+ "ofetch": "^1.5.1",
195
+ "ohash": "^1.1.4",
196
+ "ora": "^8.2.0",
197
+ "pathe": "^2.0.3",
198
+ "pkgroll": "^2.26.3",
199
+ "prettier": "^3.8.1",
200
+ "semver": "^7.7.4",
201
+ "shx": "^0.4.0",
202
+ "smol-toml": "^1.6.0",
203
+ "tinyexec": "^1.0.2",
204
+ "trash": "^10.1.0",
205
+ "tsx": "^4.21.0",
206
+ "tweetnacl": "^1.0.3",
207
+ "typescript": "^5.9.3",
208
+ "unbuild": "^3.6.1",
209
+ "uuid": "^11.1.0",
210
+ "vitest": "^3.2.4"
208
211
  }
209
- }
212
+ }