ccjk 14.1.5 → 14.1.6

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.
@@ -23,6 +23,86 @@ function sanitizePreferredLang(lang) {
23
23
  function sanitizeCodeToolType(codeTool) {
24
24
  return isCodeToolType(codeTool) ? codeTool : DEFAULT_CODE_TOOL_TYPE;
25
25
  }
26
+ function normalizeTomlConfig(config) {
27
+ const legacyConfig = config;
28
+ const rawGeneral = config?.general || {};
29
+ const preferredLang = sanitizePreferredLang(rawGeneral.preferredLang ?? legacyConfig?.preferredLang);
30
+ const defaultConfig = createDefaultTomlConfig(preferredLang);
31
+ const codeToolType = sanitizeCodeToolType(rawGeneral.currentTool ?? legacyConfig?.codeToolType);
32
+ const rawClaudeCode = config?.claudeCode || {};
33
+ const rawCodex = config?.codex || {};
34
+ const rawStorage = config?.storage || {};
35
+ const rawAdaptation = config?.adaptation || {};
36
+ const defaultAdaptation = defaultConfig.adaptation;
37
+ const hasLegacyToolType = typeof legacyConfig?.codeToolType === "string";
38
+ const templateLang = rawGeneral.templateLang ?? legacyConfig?.templateLang;
39
+ return {
40
+ version: typeof config?.version === "string" ? config.version : defaultConfig.version,
41
+ lastUpdated: typeof config?.lastUpdated === "string" ? config.lastUpdated : (/* @__PURE__ */ new Date()).toISOString(),
42
+ general: {
43
+ preferredLang,
44
+ templateLang: templateLang ? sanitizePreferredLang(templateLang) : defaultConfig.general.templateLang,
45
+ aiOutputLang: rawGeneral.aiOutputLang ?? legacyConfig?.aiOutputLang ?? defaultConfig.general.aiOutputLang,
46
+ currentTool: codeToolType
47
+ },
48
+ claudeCode: {
49
+ enabled: typeof rawClaudeCode.enabled === "boolean" ? rawClaudeCode.enabled : hasLegacyToolType ? codeToolType === "claude-code" : defaultConfig.claudeCode.enabled,
50
+ outputStyles: Array.isArray(rawClaudeCode.outputStyles) ? rawClaudeCode.outputStyles : Array.isArray(legacyConfig?.outputStyles) ? legacyConfig.outputStyles : defaultConfig.claudeCode.outputStyles,
51
+ defaultOutputStyle: typeof rawClaudeCode.defaultOutputStyle === "string" ? rawClaudeCode.defaultOutputStyle : typeof legacyConfig?.defaultOutputStyle === "string" ? legacyConfig.defaultOutputStyle : defaultConfig.claudeCode.defaultOutputStyle,
52
+ installType: rawClaudeCode.installType === "local" || rawClaudeCode.installType === "global" ? rawClaudeCode.installType : defaultConfig.claudeCode.installType,
53
+ installMethod: rawClaudeCode.installMethod,
54
+ currentProfile: typeof rawClaudeCode.currentProfile === "string" ? rawClaudeCode.currentProfile : defaultConfig.claudeCode.currentProfile,
55
+ profiles: rawClaudeCode.profiles && typeof rawClaudeCode.profiles === "object" ? rawClaudeCode.profiles : defaultConfig.claudeCode.profiles,
56
+ version: rawClaudeCode.version
57
+ },
58
+ codex: {
59
+ enabled: typeof rawCodex.enabled === "boolean" ? rawCodex.enabled : hasLegacyToolType ? codeToolType === "codex" : defaultConfig.codex.enabled,
60
+ systemPromptStyle: typeof rawCodex.systemPromptStyle === "string" ? rawCodex.systemPromptStyle : typeof legacyConfig?.systemPromptStyle === "string" ? legacyConfig.systemPromptStyle : defaultConfig.codex.systemPromptStyle,
61
+ installMethod: rawCodex.installMethod,
62
+ envKeyMigrated: rawCodex.envKeyMigrated
63
+ },
64
+ storage: {
65
+ ...defaultConfig.storage,
66
+ ...rawStorage,
67
+ memory: {
68
+ ...defaultConfig.storage?.memory || {},
69
+ ...rawStorage.memory || {}
70
+ }
71
+ },
72
+ adaptation: {
73
+ ...defaultAdaptation,
74
+ ...rawAdaptation,
75
+ runtimeProfile: {
76
+ ...defaultAdaptation.runtimeProfile,
77
+ ...rawAdaptation.runtimeProfile
78
+ },
79
+ archetypeProfile: {
80
+ ...defaultAdaptation.archetypeProfile,
81
+ ...rawAdaptation.archetypeProfile
82
+ },
83
+ capabilityProfile: {
84
+ ...defaultAdaptation.capabilityProfile,
85
+ ...rawAdaptation.capabilityProfile
86
+ },
87
+ policyProfile: {
88
+ ...defaultAdaptation.policyProfile,
89
+ ...rawAdaptation.policyProfile
90
+ },
91
+ contextProfile: {
92
+ ...defaultAdaptation.contextProfile,
93
+ ...rawAdaptation.contextProfile
94
+ },
95
+ profileSelection: {
96
+ ...defaultAdaptation.profileSelection,
97
+ ...rawAdaptation.profileSelection
98
+ },
99
+ uiProfile: {
100
+ ...defaultAdaptation.uiProfile,
101
+ ...rawAdaptation.uiProfile
102
+ }
103
+ }
104
+ };
105
+ }
26
106
  function readTomlConfig(configPath) {
27
107
  try {
28
108
  if (!exists(configPath)) {
@@ -30,7 +110,7 @@ function readTomlConfig(configPath) {
30
110
  }
31
111
  const content = readFile(configPath);
32
112
  const parsed = parse(content);
33
- return parsed;
113
+ return normalizeTomlConfig(parsed);
34
114
  } catch {
35
115
  return null;
36
116
  }
@@ -210,15 +290,16 @@ function updateTomlConfig(configPath, updates) {
210
290
  return updatedConfig;
211
291
  }
212
292
  function convertTomlToLegacyConfig(tomlConfig) {
293
+ const normalizedConfig = normalizeTomlConfig(tomlConfig);
213
294
  return {
214
- version: tomlConfig.version,
215
- preferredLang: tomlConfig.general.preferredLang,
216
- templateLang: tomlConfig.general.templateLang,
217
- aiOutputLang: tomlConfig.general.aiOutputLang,
218
- outputStyles: tomlConfig.claudeCode.outputStyles,
219
- defaultOutputStyle: tomlConfig.claudeCode.defaultOutputStyle,
220
- codeToolType: tomlConfig.general.currentTool,
221
- lastUpdated: tomlConfig.lastUpdated
295
+ version: normalizedConfig.version,
296
+ preferredLang: normalizedConfig.general.preferredLang,
297
+ templateLang: normalizedConfig.general.templateLang,
298
+ aiOutputLang: normalizedConfig.general.aiOutputLang,
299
+ outputStyles: normalizedConfig.claudeCode.outputStyles,
300
+ defaultOutputStyle: normalizedConfig.claudeCode.defaultOutputStyle,
301
+ codeToolType: normalizedConfig.general.currentTool,
302
+ lastUpdated: normalizedConfig.lastUpdated
222
303
  };
223
304
  }
224
305
  function convertLegacyToTomlConfig(legacyConfig) {
@@ -1,3 +1,3 @@
1
- const version = "14.1.5";
1
+ const version = "14.1.6";
2
2
 
3
3
  export { version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccjk",
3
3
  "type": "module",
4
- "version": "14.1.5",
4
+ "version": "14.1.6",
5
5
  "packageManager": "pnpm@10.17.1",
6
6
  "description": "Production-ready AI dev environment for Claude Code, Codex, and modern coding workflows with 30-second onboarding, persistent memory, Agent Teams, remote control, and capability discovery.",
7
7
  "author": {