claudekit-cli 3.39.3-dev.7 → 3.39.3-dev.8

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/index.js CHANGED
@@ -42305,6 +42305,13 @@ function normalizeMigrateProviderToken(token) {
42305
42305
  const unwrapped = trimmed.startsWith('"') && trimmed.endsWith('"') || trimmed.startsWith("'") && trimmed.endsWith("'") ? trimmed.slice(1, -1) : trimmed;
42306
42306
  return unwrapped.trim().toLowerCase();
42307
42307
  }
42308
+ function normalizeGeminiModelValue(value) {
42309
+ if (typeof value !== "string") {
42310
+ return value;
42311
+ }
42312
+ const normalized = value.trim().toLowerCase();
42313
+ return LEGACY_GEMINI_MODEL_ALIASES[normalized] ?? normalized;
42314
+ }
42308
42315
  function parseMigrateProvidersString(value) {
42309
42316
  const trimmed = value.trim();
42310
42317
  if (!trimmed)
@@ -42353,7 +42360,14 @@ function normalizeCkConfigInput(value) {
42353
42360
  return value;
42354
42361
  }
42355
42362
  const normalized = structuredClone(value);
42363
+ const gemini = normalized.gemini;
42356
42364
  const updatePipeline = normalized.updatePipeline;
42365
+ if (gemini && typeof gemini === "object" && !Array.isArray(gemini)) {
42366
+ const geminiConfig = gemini;
42367
+ if ("model" in geminiConfig) {
42368
+ geminiConfig.model = normalizeGeminiModelValue(geminiConfig.model);
42369
+ }
42370
+ }
42357
42371
  if (updatePipeline && typeof updatePipeline === "object" && !Array.isArray(updatePipeline)) {
42358
42372
  const pipeline = updatePipeline;
42359
42373
  if ("migrateProviders" in pipeline) {
@@ -42362,7 +42376,7 @@ function normalizeCkConfigInput(value) {
42362
42376
  }
42363
42377
  return normalized;
42364
42378
  }
42365
- var PlanValidationModeSchema, PlanFocusAreaSchema, PlanResolutionOrderSchema, ProjectTypeSchema, PackageManagerSchema, FrameworkSchema, GeminiModelSchema, StatuslineModeSchema, CodingLevelSchema, PlanResolutionSchema, PlanValidationSchema, CkPlanConfigSchema, CkDocsConfigSchema, CkPathsConfigSchema, CkLocaleConfigSchema, CkTrustConfigSchema, CkProjectConfigSchema, CkGeminiConfigSchema, CkSkillsConfigSchema, UpdatePipelineSchema, ResolvedModelConfigSchema, ModelTierMapSchema, CkModelTaxonomySchema, CkAssertionSchema, CkHooksConfigSchema, CkConfigSchema, DEFAULT_CK_CONFIG, CK_HOOK_NAMES;
42379
+ var PlanValidationModeSchema, PlanFocusAreaSchema, PlanResolutionOrderSchema, ProjectTypeSchema, PackageManagerSchema, FrameworkSchema, GEMINI_MODEL_VALUES, LEGACY_GEMINI_MODEL_ALIASES, GeminiModelSchema, StatuslineModeSchema, CodingLevelSchema, PlanResolutionSchema, PlanValidationSchema, CkPlanConfigSchema, CkDocsConfigSchema, CkPathsConfigSchema, CkLocaleConfigSchema, CkTrustConfigSchema, CkProjectConfigSchema, CkGeminiConfigSchema, CkSkillsConfigSchema, UpdatePipelineSchema, ResolvedModelConfigSchema, ModelTierMapSchema, CkModelTaxonomySchema, CkAssertionSchema, CkHooksConfigSchema, CkConfigSchema, DEFAULT_CK_CONFIG, CK_HOOK_NAMES;
42366
42380
  var init_ck_config = __esm(() => {
42367
42381
  init_zod();
42368
42382
  PlanValidationModeSchema = exports_external.enum(["prompt", "auto", "strict", "none"]);
@@ -42401,12 +42415,19 @@ var init_ck_config = __esm(() => {
42401
42415
  "fastify",
42402
42416
  "none"
42403
42417
  ]);
42404
- GeminiModelSchema = exports_external.enum([
42418
+ GEMINI_MODEL_VALUES = [
42405
42419
  "gemini-2.5-flash",
42406
42420
  "gemini-2.5-pro",
42407
42421
  "gemini-3-pro-preview",
42408
42422
  "gemini-3-flash-preview"
42409
- ]);
42423
+ ];
42424
+ LEGACY_GEMINI_MODEL_ALIASES = {
42425
+ "gemini-3.0-flash": "gemini-3-flash-preview",
42426
+ "gemini-3.0-pro": "gemini-3-pro-preview",
42427
+ "gemini-3-flash": "gemini-3-flash-preview",
42428
+ "gemini-3-pro": "gemini-3-pro-preview"
42429
+ };
42430
+ GeminiModelSchema = exports_external.enum(GEMINI_MODEL_VALUES);
42410
42431
  StatuslineModeSchema = exports_external.enum(["full", "compact", "minimal", "none"]);
42411
42432
  CodingLevelSchema = exports_external.number().int().min(-1).max(5);
42412
42433
  PlanResolutionSchema = exports_external.object({
@@ -43017,14 +43038,17 @@ class CkConfigManager {
43017
43038
  if (!existsSync12(configDir)) {
43018
43039
  await mkdir5(configDir, { recursive: true });
43019
43040
  }
43020
- let existingConfig = {};
43021
- if (existsSync12(configPath)) {
43041
+ let existingConfig = await CkConfigManager.loadScope(scope, projectDir);
43042
+ if (!existingConfig && existsSync12(configPath)) {
43022
43043
  try {
43023
43044
  const content = await readFile8(configPath, "utf-8");
43024
- existingConfig = JSON.parse(content);
43045
+ const parsed = JSON.parse(content);
43046
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
43047
+ existingConfig = normalizeCkConfigInput(parsed);
43048
+ }
43025
43049
  } catch {}
43026
43050
  }
43027
- const mergedConfig = deepMerge(existingConfig, validConfig);
43051
+ const mergedConfig = deepMerge(existingConfig || {}, validConfig);
43028
43052
  await writeFile6(configPath, JSON.stringify(mergedConfig, null, 2), "utf-8");
43029
43053
  logger.debug(`Config saved to ${configPath}`);
43030
43054
  return configPath;
@@ -48466,7 +48490,7 @@ var init_ck_config_schema = __esm(() => {
48466
48490
  "gemini-3-flash-preview"
48467
48491
  ],
48468
48492
  default: "gemini-3-flash-preview",
48469
- description: "Gemini model to use for CLI commands"
48493
+ description: "Gemini model to use for CLI commands. Legacy gemini-3.0-* ids are auto-mapped to the current preview aliases when loading config."
48470
48494
  }
48471
48495
  },
48472
48496
  additionalProperties: false
@@ -48737,10 +48761,23 @@ function registerCkConfigRoutes(app) {
48737
48761
  }
48738
48762
  }
48739
48763
  const savedPath = await CkConfigManager.saveFull(parseResult.data, scope, projectDir);
48764
+ let savedConfig = await CkConfigManager.loadScope(scope, projectDir);
48765
+ if (!savedConfig) {
48766
+ try {
48767
+ const rawContent = await readFile11(savedPath, "utf-8");
48768
+ const rawConfig = JSON.parse(rawContent);
48769
+ if (rawConfig && typeof rawConfig === "object" && !Array.isArray(rawConfig)) {
48770
+ savedConfig = normalizeCkConfigInput(rawConfig);
48771
+ }
48772
+ } catch {
48773
+ savedConfig = null;
48774
+ }
48775
+ }
48740
48776
  res.json({
48741
48777
  success: true,
48742
48778
  path: savedPath,
48743
- scope
48779
+ scope,
48780
+ config: savedConfig || {}
48744
48781
  });
48745
48782
  } catch (error) {
48746
48783
  logger.error(`Failed to save ck-config: ${error}`);
@@ -57291,7 +57328,7 @@ var package_default;
57291
57328
  var init_package = __esm(() => {
57292
57329
  package_default = {
57293
57330
  name: "claudekit-cli",
57294
- version: "3.39.3-dev.7",
57331
+ version: "3.39.3-dev.8",
57295
57332
  description: "CLI tool for bootstrapping and updating ClaudeKit projects",
57296
57333
  type: "module",
57297
57334
  repository: {
@@ -75530,9 +75567,11 @@ async function handleSet(key, value, options2) {
75530
75567
  scope = selectedScope;
75531
75568
  }
75532
75569
  const projectDir = process.cwd();
75570
+ const lookupProjectDir = scope === "project" ? projectDir : null;
75533
75571
  try {
75534
75572
  await CkConfigManager.updateField(key, parsedValue, scope, projectDir);
75535
- logger.success(`Set ${key} = ${JSON.stringify(parsedValue)} (${scope === "project" ? "local" : "global"})`);
75573
+ const { value: savedValue } = await CkConfigManager.getFieldWithSource(key, lookupProjectDir);
75574
+ logger.success(`Set ${key} = ${JSON.stringify(savedValue)} (${scope === "project" ? "local" : "global"})`);
75536
75575
  } catch (error) {
75537
75576
  logger.error(`Invalid value for ${key}: ${error instanceof Error ? error.message : "Unknown"}`);
75538
75577
  process.exitCode = 1;