ccjk 14.1.3 → 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.
Files changed (73) hide show
  1. package/dist/chunks/api-cli.mjs +5 -5
  2. package/dist/chunks/api-config-selector.mjs +18 -5
  3. package/dist/chunks/api-providers.mjs +24 -9
  4. package/dist/chunks/auto-updater.mjs +13 -13
  5. package/dist/chunks/boost.mjs +1 -1
  6. package/dist/chunks/ccjk-all.mjs +4 -4
  7. package/dist/chunks/ccjk-config.mjs +168 -10
  8. package/dist/chunks/ccjk-mcp.mjs +4 -4
  9. package/dist/chunks/ccjk-setup.mjs +4 -4
  10. package/dist/chunks/ccr.mjs +11 -11
  11. package/dist/chunks/check-updates.mjs +3 -3
  12. package/dist/chunks/claude-code-incremental-manager.mjs +8 -6
  13. package/dist/chunks/claude-config.mjs +73 -0
  14. package/dist/chunks/claude-wrapper.mjs +1 -1
  15. package/dist/chunks/cli-hook.mjs +76 -1
  16. package/dist/chunks/code-type-resolver.mjs +14 -13
  17. package/dist/chunks/codex-config-switch.mjs +2 -2
  18. package/dist/chunks/codex-provider-manager.mjs +2 -2
  19. package/dist/chunks/codex.mjs +3 -3
  20. package/dist/chunks/config-switch.mjs +5 -5
  21. package/dist/chunks/config.mjs +531 -158
  22. package/dist/chunks/config2.mjs +22 -20
  23. package/dist/chunks/config3.mjs +6 -6
  24. package/dist/chunks/constants.mjs +20 -13
  25. package/dist/chunks/doctor.mjs +1 -1
  26. package/dist/chunks/features.mjs +59 -4
  27. package/dist/chunks/fs-operations.mjs +2 -14
  28. package/dist/chunks/index.mjs +1 -1
  29. package/dist/chunks/index10.mjs +115 -100
  30. package/dist/chunks/init.mjs +112 -51
  31. package/dist/chunks/installer.mjs +28 -21
  32. package/dist/chunks/mcp-cli.mjs +6 -6
  33. package/dist/chunks/mcp.mjs +6 -6
  34. package/dist/chunks/package.mjs +1 -1
  35. package/dist/chunks/platform.mjs +3 -3
  36. package/dist/chunks/prompts.mjs +9 -7
  37. package/dist/chunks/quick-actions.mjs +1 -1
  38. package/dist/chunks/quick-provider.mjs +23 -31
  39. package/dist/chunks/quick-setup.mjs +3 -4
  40. package/dist/chunks/simple-config.mjs +57 -16
  41. package/dist/chunks/slash-commands.mjs +1 -1
  42. package/dist/chunks/smart-guide.mjs +23 -10
  43. package/dist/chunks/status.mjs +28 -24
  44. package/dist/chunks/update.mjs +19 -18
  45. package/dist/chunks/upgrade.mjs +88 -5
  46. package/dist/chunks/version-checker.mjs +2 -2
  47. package/dist/chunks/zero-config.mjs +121 -16
  48. package/dist/cli.mjs +50 -27
  49. package/dist/i18n/locales/en/language.json +1 -1
  50. package/dist/i18n/locales/en/menu.json +8 -7
  51. package/dist/i18n/locales/en/multi-config.json +1 -1
  52. package/dist/i18n/locales/zh-CN/language.json +1 -1
  53. package/dist/i18n/locales/zh-CN/menu.json +8 -7
  54. package/dist/i18n/locales/zh-CN/multi-config.json +1 -1
  55. package/dist/index.d.mts +13 -11
  56. package/dist/index.d.ts +13 -11
  57. package/dist/index.mjs +7 -7
  58. package/dist/shared/{ccjk.B6VCKdyy.mjs → ccjk.BXTrU9TN.mjs} +31 -68
  59. package/dist/shared/{ccjk.DScm_NnL.mjs → ccjk.Ccrqt7u2.mjs} +30 -1
  60. package/dist/shared/{ccjk.CVjfbEIj.mjs → ccjk.DZtwozOG.mjs} +1 -1
  61. package/dist/shared/{ccjk.D6wx-rxT.mjs → ccjk.Dxgd2vjc.mjs} +3 -3
  62. package/dist/shared/{ccjk.BO45TPXJ.mjs → ccjk.K8c6VnM2.mjs} +2 -2
  63. package/dist/shared/{ccjk.BJENIVf7.mjs → ccjk.MpkxXQJL.mjs} +179 -19
  64. package/dist/shared/{ccjk.Dh6Be-ef.mjs → ccjk.ygJzcD-n.mjs} +28 -24
  65. package/package.json +1 -30
  66. package/dist/chunks/auto-fix.mjs +0 -253
  67. package/dist/chunks/auto-init.mjs +0 -311
  68. package/dist/chunks/auto-upgrade.mjs +0 -152
  69. package/dist/chunks/migrator.mjs +0 -178
  70. package/dist/shared/ccjk.DDq2hqA5.mjs +0 -158
  71. package/dist/shared/ccjk.KPLeMP-o.mjs +0 -79
  72. package/templates/common/workflow/essential/en/agents/planner.md +0 -116
  73. package/templates/common/workflow/essential/zh-CN/agents/planner.md +0 -116
@@ -24,18 +24,18 @@ import 'node:crypto';
24
24
  import 'buffer';
25
25
  import 'string_decoder';
26
26
  import './constants.mjs';
27
- import './json-config.mjs';
27
+ import './ccjk-config.mjs';
28
+ import '../shared/ccjk.BBtCGd_g.mjs';
29
+ import './index3.mjs';
28
30
  import './fs-operations.mjs';
29
31
  import 'node:fs/promises';
32
+ import './json-config.mjs';
33
+ import '../shared/ccjk.Ccrqt7u2.mjs';
30
34
  import './platform.mjs';
31
35
  import './main.mjs';
32
36
  import 'module';
33
37
  import 'node:child_process';
34
38
  import 'node:stream';
35
- import '../shared/ccjk.DScm_NnL.mjs';
36
- import './ccjk-config.mjs';
37
- import '../shared/ccjk.BBtCGd_g.mjs';
38
- import './index3.mjs';
39
39
 
40
40
  async function apiConfigure(options = {}) {
41
41
  const lang = options.lang || i18n.language || "en";
@@ -30,19 +30,30 @@ import './fs-operations.mjs';
30
30
  import 'node:fs/promises';
31
31
  import './json-config.mjs';
32
32
  import '../shared/ccjk.RyizuzOI.mjs';
33
+ import '../shared/ccjk.Ccrqt7u2.mjs';
33
34
  import './platform.mjs';
34
35
  import './main.mjs';
35
36
  import 'module';
36
37
  import 'node:child_process';
37
38
  import 'node:stream';
38
- import '../shared/ccjk.DScm_NnL.mjs';
39
39
  import '../shared/ccjk.DKXs7Fbm.mjs';
40
- import '../shared/ccjk.Dh6Be-ef.mjs';
40
+ import '../shared/ccjk.ygJzcD-n.mjs';
41
41
  import '../shared/ccjk.BFQ7yr5S.mjs';
42
42
  import '../shared/ccjk.DZ2LLOa-.mjs';
43
43
  import '../shared/ccjk.DeWpAShp.mjs';
44
44
  import '../shared/ccjk.BI-hdI7P.mjs';
45
+ import './simple-config.mjs';
45
46
 
47
+ async function syncClavueProviderStateIfNeeded(codeTool, activeProfileId) {
48
+ if (codeTool !== "clavue") {
49
+ return;
50
+ }
51
+ const { syncMyclaudeProviderProfilesFromClaudeConfig } = await import('./config.mjs').then(function (n) { return n.H; });
52
+ const config = ClaudeCodeConfigManager.readConfig();
53
+ syncMyclaudeProviderProfilesFromClaudeConfig(
54
+ activeProfileId === void 0 || !config ? config : { ...config, currentProfileId: activeProfileId }
55
+ );
56
+ }
46
57
  function getCurrentCodeTool() {
47
58
  const config = readZcfConfig();
48
59
  if (config?.codeToolType && isCodeToolType(config.codeToolType)) {
@@ -85,9 +96,10 @@ async function showApiConfigMenu(title, options) {
85
96
  }
86
97
  }
87
98
  async function handleOfficialLogin(codeTool, isZh) {
88
- if (codeTool === "claude-code" || codeTool === "myclaude") {
99
+ if (codeTool === "claude-code" || codeTool === "clavue") {
89
100
  const result = await ClaudeCodeConfigManager.switchToOfficial();
90
101
  if (result.success) {
102
+ await syncClavueProviderStateIfNeeded(codeTool, "");
91
103
  console.log("");
92
104
  console.log(a.green(isZh ? "\u2705 \u5DF2\u5207\u6362\u5230\u5B98\u65B9\u767B\u5F55" : "\u2705 Switched to official login"));
93
105
  console.log("");
@@ -108,7 +120,7 @@ async function handleOfficialLogin(codeTool, isZh) {
108
120
  async function handleCustomConfig(_isZh, context) {
109
121
  try {
110
122
  const codeTool = getCurrentCodeTool();
111
- if ((codeTool === "claude-code" || codeTool === "myclaude") && context === "init") {
123
+ if ((codeTool === "claude-code" || codeTool === "clavue") && context === "init") {
112
124
  const { addProfileDirect } = await import('./claude-code-incremental-manager.mjs');
113
125
  await addProfileDirect();
114
126
  } else {
@@ -120,9 +132,10 @@ async function handleCustomConfig(_isZh, context) {
120
132
  }
121
133
  }
122
134
  async function handleCcrProxy(codeTool, isZh) {
123
- if (codeTool === "claude-code" || codeTool === "myclaude") {
135
+ if (codeTool === "claude-code" || codeTool === "clavue") {
124
136
  const result = await ClaudeCodeConfigManager.switchToCcr();
125
137
  if (result.success) {
138
+ await syncClavueProviderStateIfNeeded(codeTool, "ccr-proxy");
126
139
  console.log("");
127
140
  console.log(a.green(isZh ? "\u2705 \u5DF2\u5207\u6362\u5230 CCR \u4EE3\u7406" : "\u2705 Switched to CCR proxy"));
128
141
  console.log("");
@@ -6,11 +6,26 @@ import 'node:process';
6
6
  import 'node:url';
7
7
  import '../shared/ccjk.bQ7Dh1g4.mjs';
8
8
 
9
+ function normalizeProviderPreset(provider) {
10
+ if (provider.claudeCode && provider.supportedCodeTools.includes("claude-code") && !provider.supportedCodeTools.includes("clavue")) {
11
+ return {
12
+ ...provider,
13
+ supportedCodeTools: [...provider.supportedCodeTools, "clavue"]
14
+ };
15
+ }
16
+ return provider;
17
+ }
18
+ function supportsCodeTool(provider, codeToolType) {
19
+ if (provider.supportedCodeTools.includes(codeToolType)) {
20
+ return true;
21
+ }
22
+ return codeToolType === "clavue" && Boolean(provider.claudeCode) && provider.supportedCodeTools.includes("claude-code");
23
+ }
9
24
  const LOCAL_PROVIDER_PRESETS = [
10
25
  {
11
26
  id: "glm",
12
27
  name: "GLM",
13
- supportedCodeTools: ["claude-code", "codex"],
28
+ supportedCodeTools: ["claude-code", "clavue", "codex"],
14
29
  claudeCode: {
15
30
  baseUrl: "https://open.bigmodel.cn/api/anthropic",
16
31
  authType: "auth_token"
@@ -25,7 +40,7 @@ const LOCAL_PROVIDER_PRESETS = [
25
40
  {
26
41
  id: "minimax",
27
42
  name: "MiniMax",
28
- supportedCodeTools: ["claude-code", "codex"],
43
+ supportedCodeTools: ["claude-code", "clavue", "codex"],
29
44
  claudeCode: {
30
45
  baseUrl: "https://api.minimaxi.com/anthropic",
31
46
  authType: "auth_token",
@@ -41,7 +56,7 @@ const LOCAL_PROVIDER_PRESETS = [
41
56
  {
42
57
  id: "kimi",
43
58
  name: "Kimi",
44
- supportedCodeTools: ["claude-code", "codex"],
59
+ supportedCodeTools: ["claude-code", "clavue", "codex"],
45
60
  claudeCode: {
46
61
  baseUrl: "https://api.kimi.com/coding/",
47
62
  authType: "auth_token"
@@ -61,7 +76,7 @@ async function fetchCloudProviders(codeType) {
61
76
  try {
62
77
  const url = new URL(`${CCJK_CLOUD_API_URL}/providers`);
63
78
  if (codeType) {
64
- url.searchParams.set("codeType", codeType);
79
+ url.searchParams.set("codeType", codeType === "clavue" ? "claude-code" : codeType);
65
80
  }
66
81
  const response = await fetch(url.toString(), {
67
82
  method: "GET",
@@ -76,7 +91,7 @@ async function fetchCloudProviders(codeType) {
76
91
  }
77
92
  const result = await response.json();
78
93
  if (result.success && Array.isArray(result.data)) {
79
- return result.data.map((p) => ({ ...p, isCloud: true }));
94
+ return result.data.map((p) => normalizeProviderPreset({ ...p, isCloud: true }));
80
95
  }
81
96
  return [];
82
97
  } catch {
@@ -88,7 +103,7 @@ async function getApiProvidersAsync(codeToolType) {
88
103
  if (cloudProvidersCache && now - cloudProvidersCacheTime < CACHE_TTL) {
89
104
  const providers = cloudProvidersCache;
90
105
  if (codeToolType) {
91
- return providers.filter((p) => p.supportedCodeTools.includes(codeToolType));
106
+ return providers.filter((p) => supportsCodeTool(p, codeToolType));
92
107
  }
93
108
  return providers;
94
109
  }
@@ -99,15 +114,15 @@ async function getApiProvidersAsync(codeToolType) {
99
114
  return cloudProviders;
100
115
  }
101
116
  if (codeToolType) {
102
- return LOCAL_PROVIDER_PRESETS.filter((p) => p.supportedCodeTools.includes(codeToolType));
117
+ return LOCAL_PROVIDER_PRESETS.filter((p) => supportsCodeTool(p, codeToolType));
103
118
  }
104
119
  return LOCAL_PROVIDER_PRESETS;
105
120
  }
106
121
  function getApiProviders(codeToolType) {
107
122
  if (cloudProvidersCache) {
108
- return cloudProvidersCache.filter((p) => p.supportedCodeTools.includes(codeToolType));
123
+ return cloudProvidersCache.filter((p) => supportsCodeTool(p, codeToolType));
109
124
  }
110
- return LOCAL_PROVIDER_PRESETS.filter((p) => p.supportedCodeTools.includes(codeToolType));
125
+ return LOCAL_PROVIDER_PRESETS.filter((p) => supportsCodeTool(p, codeToolType));
111
126
  }
112
127
  function getProviderPreset(providerId) {
113
128
  if (cloudProvidersCache) {
@@ -297,11 +297,11 @@ async function updateMyclaude(force = false, skipPrompt = false) {
297
297
  const { installed, currentVersion, latestVersion, needsUpdate } = await checkMyclaudeVersion();
298
298
  spinner.stop();
299
299
  if (!installed) {
300
- console.log(a.yellow("myclaude is not installed"));
300
+ console.log(a.yellow("Clavue is not installed"));
301
301
  return false;
302
302
  }
303
303
  if (!needsUpdate && !force) {
304
- console.log(a.green(`myclaude is up to date (v${currentVersion || ""})`));
304
+ console.log(a.green(`Clavue is up to date (v${currentVersion || ""})`));
305
305
  return true;
306
306
  }
307
307
  if (!latestVersion) {
@@ -312,7 +312,7 @@ async function updateMyclaude(force = false, skipPrompt = false) {
312
312
  console.log(a.green(format(i18n.t("updater:latestVersion"), { version: latestVersion })));
313
313
  if (!skipPrompt) {
314
314
  const confirm = await promptBoolean({
315
- message: format(i18n.t("updater:confirmUpdate"), { tool: "myclaude" }),
315
+ message: format(i18n.t("updater:confirmUpdate"), { tool: "clavue" }),
316
316
  defaultValue: true
317
317
  });
318
318
  if (!confirm) {
@@ -320,19 +320,19 @@ async function updateMyclaude(force = false, skipPrompt = false) {
320
320
  return true;
321
321
  }
322
322
  } else {
323
- console.log(a.green(format(i18n.t("updater:autoUpdating"), { tool: "myclaude" })));
323
+ console.log(a.green(format(i18n.t("updater:autoUpdating"), { tool: "clavue" })));
324
324
  }
325
- const updateSpinner = ora(format(i18n.t("updater:updating"), { tool: "myclaude" })).start();
325
+ const updateSpinner = ora(format(i18n.t("updater:updating"), { tool: "clavue" })).start();
326
326
  try {
327
- await execWithSudoIfNeeded("npm", ["update", "-g", "myclaude-code"]);
328
- const installResult = await q("myclaude", ["install", "--force"]);
327
+ await execWithSudoIfNeeded("npm", ["update", "-g", "clavue"]);
328
+ const installResult = await q("clavue", ["install", "--force"]);
329
329
  if (installResult.exitCode !== 0) {
330
330
  throw new Error(installResult.stderr || `Command failed with exit code ${installResult.exitCode}`);
331
331
  }
332
- updateSpinner.succeed(format(i18n.t("updater:updateSuccess"), { tool: "myclaude" }));
332
+ updateSpinner.succeed(format(i18n.t("updater:updateSuccess"), { tool: "clavue" }));
333
333
  return true;
334
334
  } catch (error) {
335
- updateSpinner.fail(format(i18n.t("updater:updateFailed"), { tool: "myclaude" }));
335
+ updateSpinner.fail(format(i18n.t("updater:updateFailed"), { tool: "clavue" }));
336
336
  console.error(a.red(error instanceof Error ? error.message : String(error)));
337
337
  return false;
338
338
  }
@@ -423,14 +423,14 @@ async function checkAndUpdateMyclaudeTools(skipPrompt = false) {
423
423
  const results = [];
424
424
  let ccjkUpdated = false;
425
425
  let ccjkResult = null;
426
- console.log(a.bold("\u2728 myclaude"));
426
+ console.log(a.bold("\u2728 Clavue"));
427
427
  try {
428
428
  const success = await updateMyclaude(false, skipPrompt);
429
- results.push({ tool: "myclaude", success });
429
+ results.push({ tool: "clavue", success });
430
430
  } catch (error) {
431
431
  const errorMessage = error instanceof Error ? error.message : String(error);
432
- console.error(a.red(`\u274C ${format(i18n.t("updater:updateFailed"), { tool: "myclaude" })}: ${errorMessage}`));
433
- results.push({ tool: "myclaude", success: false, error: errorMessage });
432
+ console.error(a.red(`\u274C ${format(i18n.t("updater:updateFailed"), { tool: "clavue" })}: ${errorMessage}`));
433
+ results.push({ tool: "clavue", success: false, error: errorMessage });
434
434
  }
435
435
  console.log();
436
436
  console.log(a.bold("\u{1F4E6} CCJK"));
@@ -3,7 +3,7 @@ import { existsSync, readFileSync } from 'node:fs';
3
3
  import process__default from 'node:process';
4
4
  import { SETTINGS_FILE } from './constants.mjs';
5
5
  import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
6
- import { r as runHealthCheck } from '../shared/ccjk.D6wx-rxT.mjs';
6
+ import { r as runHealthCheck } from '../shared/ccjk.Dxgd2vjc.mjs';
7
7
  import '../shared/ccjk.BAGoDD49.mjs';
8
8
  import 'node:os';
9
9
  import './index2.mjs';
@@ -38,16 +38,16 @@ import 'string_decoder';
38
38
  import 'node:child_process';
39
39
  import './config.mjs';
40
40
  import '../shared/ccjk.RyizuzOI.mjs';
41
- import './json-config.mjs';
41
+ import './ccjk-config.mjs';
42
+ import './index3.mjs';
42
43
  import './fs-operations.mjs';
43
44
  import 'node:fs/promises';
45
+ import './json-config.mjs';
46
+ import '../shared/ccjk.Ccrqt7u2.mjs';
44
47
  import './platform.mjs';
45
48
  import './main.mjs';
46
49
  import 'module';
47
50
  import 'node:stream';
48
- import '../shared/ccjk.DScm_NnL.mjs';
49
- import './ccjk-config.mjs';
50
- import './index3.mjs';
51
51
  import '../shared/ccjk.DsYaCCx4.mjs';
52
52
 
53
53
  const packageJson = JSON.parse(readFileSync(join(process.cwd(), "package.json"), "utf-8"));
@@ -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
  }
@@ -69,6 +149,50 @@ function createDefaultTomlConfig(preferredLang = "en", claudeCodeInstallType = "
69
149
  },
70
150
  storage: {
71
151
  memory: {}
152
+ },
153
+ adaptation: {
154
+ runtimeProfile: {
155
+ target: DEFAULT_CODE_TOOL_TYPE,
156
+ distribution: "clavue",
157
+ compatMode: "native" ,
158
+ providerStrategy: "profile-based"
159
+ },
160
+ archetypeProfile: {
161
+ id: "pc-dev",
162
+ name: "PC Software Development",
163
+ goal: "Build, debug, test, and ship software efficiently"
164
+ },
165
+ capabilityProfile: {
166
+ coding: true,
167
+ planning: true,
168
+ taskTracking: true,
169
+ memory: true,
170
+ browserAutomation: false,
171
+ research: true,
172
+ documentAuthoring: false,
173
+ serviceOps: false,
174
+ multiAgent: true
175
+ },
176
+ policyProfile: {
177
+ permissionPreset: "dev",
178
+ verificationMode: "required",
179
+ destructiveActionPolicy: "confirm",
180
+ workflowFallbackMode: "graceful"
181
+ },
182
+ contextProfile: {
183
+ memoryMode: "project-aware",
184
+ compressionMode: "runtime-native",
185
+ instructionLayering: "runtime-first"
186
+ },
187
+ profileSelection: {
188
+ workflowPack: "desktop-engineering",
189
+ toolPack: "typescript-node-react"
190
+ },
191
+ uiProfile: {
192
+ language: preferredLang,
193
+ outputStyle: "concise",
194
+ operatorMode: "execution-first"
195
+ }
72
196
  }
73
197
  };
74
198
  }
@@ -99,7 +223,8 @@ function migrateFromJsonConfig(jsonConfig) {
99
223
  },
100
224
  storage: {
101
225
  memory: {}
102
- }
226
+ },
227
+ adaptation: defaultConfig.adaptation
103
228
  };
104
229
  return tomlConfig;
105
230
  }
@@ -127,21 +252,54 @@ function updateTomlConfig(configPath, updates) {
127
252
  ...existingConfig.storage?.memory || {},
128
253
  ...updates.storage?.memory || {}
129
254
  }
255
+ },
256
+ adaptation: {
257
+ ...existingConfig.adaptation,
258
+ ...updates.adaptation,
259
+ runtimeProfile: updates.adaptation?.runtimeProfile ? {
260
+ ...existingConfig.adaptation?.runtimeProfile,
261
+ ...updates.adaptation.runtimeProfile
262
+ } : existingConfig.adaptation?.runtimeProfile,
263
+ archetypeProfile: updates.adaptation?.archetypeProfile ? {
264
+ ...existingConfig.adaptation?.archetypeProfile,
265
+ ...updates.adaptation.archetypeProfile
266
+ } : existingConfig.adaptation?.archetypeProfile,
267
+ capabilityProfile: updates.adaptation?.capabilityProfile ? {
268
+ ...existingConfig.adaptation?.capabilityProfile,
269
+ ...updates.adaptation.capabilityProfile
270
+ } : existingConfig.adaptation?.capabilityProfile,
271
+ policyProfile: updates.adaptation?.policyProfile ? {
272
+ ...existingConfig.adaptation?.policyProfile,
273
+ ...updates.adaptation.policyProfile
274
+ } : existingConfig.adaptation?.policyProfile,
275
+ contextProfile: updates.adaptation?.contextProfile ? {
276
+ ...existingConfig.adaptation?.contextProfile,
277
+ ...updates.adaptation.contextProfile
278
+ } : existingConfig.adaptation?.contextProfile,
279
+ profileSelection: updates.adaptation?.profileSelection ? {
280
+ ...existingConfig.adaptation?.profileSelection,
281
+ ...updates.adaptation.profileSelection
282
+ } : existingConfig.adaptation?.profileSelection,
283
+ uiProfile: updates.adaptation?.uiProfile ? {
284
+ ...existingConfig.adaptation?.uiProfile,
285
+ ...updates.adaptation.uiProfile
286
+ } : existingConfig.adaptation?.uiProfile
130
287
  }
131
288
  };
132
289
  writeTomlConfig(configPath, updatedConfig);
133
290
  return updatedConfig;
134
291
  }
135
292
  function convertTomlToLegacyConfig(tomlConfig) {
293
+ const normalizedConfig = normalizeTomlConfig(tomlConfig);
136
294
  return {
137
- version: tomlConfig.version,
138
- preferredLang: tomlConfig.general.preferredLang,
139
- templateLang: tomlConfig.general.templateLang,
140
- aiOutputLang: tomlConfig.general.aiOutputLang,
141
- outputStyles: tomlConfig.claudeCode.outputStyles,
142
- defaultOutputStyle: tomlConfig.claudeCode.defaultOutputStyle,
143
- codeToolType: tomlConfig.general.currentTool,
144
- 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
145
303
  };
146
304
  }
147
305
  function convertLegacyToTomlConfig(legacyConfig) {
@@ -28,12 +28,12 @@ import 'buffer';
28
28
  import 'string_decoder';
29
29
  import 'node:url';
30
30
  import '../shared/ccjk.RyizuzOI.mjs';
31
- import './json-config.mjs';
32
- import './fs-operations.mjs';
33
- import 'node:fs/promises';
34
- import '../shared/ccjk.DScm_NnL.mjs';
35
31
  import './ccjk-config.mjs';
36
32
  import './index3.mjs';
33
+ import './fs-operations.mjs';
34
+ import 'node:fs/promises';
35
+ import './json-config.mjs';
36
+ import '../shared/ccjk.Ccrqt7u2.mjs';
37
37
  import './main.mjs';
38
38
  import 'module';
39
39
  import 'node:child_process';
@@ -35,16 +35,16 @@ import 'buffer';
35
35
  import 'string_decoder';
36
36
  import 'node:child_process';
37
37
  import './config.mjs';
38
- import './json-config.mjs';
38
+ import './ccjk-config.mjs';
39
+ import './index3.mjs';
39
40
  import './fs-operations.mjs';
40
41
  import 'node:fs/promises';
42
+ import './json-config.mjs';
43
+ import '../shared/ccjk.Ccrqt7u2.mjs';
41
44
  import './platform.mjs';
42
45
  import './main.mjs';
43
46
  import 'module';
44
47
  import 'node:stream';
45
- import '../shared/ccjk.DScm_NnL.mjs';
46
- import './ccjk-config.mjs';
47
- import './index3.mjs';
48
48
  import '../shared/ccjk.DsYaCCx4.mjs';
49
49
 
50
50
  async function createBackup(operation, options = {}) {
@@ -27,18 +27,18 @@ import 'node:crypto';
27
27
  import 'buffer';
28
28
  import 'string_decoder';
29
29
  import './constants.mjs';
30
- import './json-config.mjs';
30
+ import './ccjk-config.mjs';
31
+ import '../shared/ccjk.BBtCGd_g.mjs';
32
+ import './index3.mjs';
31
33
  import './fs-operations.mjs';
32
34
  import 'node:fs/promises';
35
+ import './json-config.mjs';
36
+ import '../shared/ccjk.Ccrqt7u2.mjs';
33
37
  import './platform.mjs';
34
38
  import './main.mjs';
35
39
  import 'module';
36
40
  import 'node:child_process';
37
41
  import 'node:stream';
38
- import '../shared/ccjk.DScm_NnL.mjs';
39
- import './ccjk-config.mjs';
40
- import '../shared/ccjk.BBtCGd_g.mjs';
41
- import './index3.mjs';
42
42
  import './codex.mjs';
43
43
  import './index8.mjs';
44
44
  import '../shared/ccjk.DeWpAShp.mjs';
@@ -49,8 +49,9 @@ import '../shared/ccjk.DZ2LLOa-.mjs';
49
49
  import '../shared/ccjk.DKXs7Fbm.mjs';
50
50
  import './code-type-resolver.mjs';
51
51
  import './features.mjs';
52
- import '../shared/ccjk.Dh6Be-ef.mjs';
52
+ import '../shared/ccjk.ygJzcD-n.mjs';
53
53
  import '../shared/ccjk.BI-hdI7P.mjs';
54
+ import './simple-config.mjs';
54
55
  import '../shared/ccjk.DbigonEQ.mjs';
55
56
  import 'node:stream/promises';
56
57
  import 'tar';
@@ -60,9 +61,8 @@ import './init.mjs';
60
61
  import './config2.mjs';
61
62
  import './auto-updater.mjs';
62
63
  import './version-checker.mjs';
63
- import '../shared/ccjk.DDq2hqA5.mjs';
64
+ import '../shared/ccjk.MpkxXQJL.mjs';
64
65
  import './installer.mjs';
65
- import '../shared/ccjk.BJENIVf7.mjs';
66
66
  import '../shared/ccjk.Bq8TqZG_.mjs';
67
67
  import './commands.mjs';
68
68
  import './check-updates.mjs';
@@ -71,8 +71,8 @@ import './doctor.mjs';
71
71
  import './api-providers.mjs';
72
72
  import '../shared/ccjk.SPoXMvZD.mjs';
73
73
  import '../shared/ccjk.J8YiPsOw.mjs';
74
- import '../shared/ccjk.CVjfbEIj.mjs';
75
- import '../shared/ccjk.B6VCKdyy.mjs';
74
+ import '../shared/ccjk.DZtwozOG.mjs';
75
+ import '../shared/ccjk.BXTrU9TN.mjs';
76
76
  import './notification.mjs';
77
77
  import '../shared/ccjk.BBizCO6_.mjs';
78
78
  import '../shared/ccjk.D0g2ABGg.mjs';
@@ -82,7 +82,7 @@ import './uninstall.mjs';
82
82
  import '../shared/ccjk.D75wivnp.mjs';
83
83
  import 'globby';
84
84
  import './update.mjs';
85
- import '../shared/ccjk.BO45TPXJ.mjs';
85
+ import '../shared/ccjk.K8c6VnM2.mjs';
86
86
 
87
87
  async function ccr(options = {}) {
88
88
  try {
@@ -42,7 +42,7 @@ import '../shared/ccjk.DZ2LLOa-.mjs';
42
42
  import './version-checker.mjs';
43
43
  import '../shared/ccjk.CxpGa6MC.mjs';
44
44
  import './config.mjs';
45
- import '../shared/ccjk.DScm_NnL.mjs';
45
+ import '../shared/ccjk.Ccrqt7u2.mjs';
46
46
  import '../shared/ccjk.BFQ7yr5S.mjs';
47
47
  import './prompts.mjs';
48
48
  import '../shared/ccjk.gDEDGD_t.mjs';
@@ -60,7 +60,7 @@ class ToolUpdateScheduler {
60
60
  case "claude-code":
61
61
  await this.updateClaudeCodeTools(skipPrompt);
62
62
  break;
63
- case "myclaude":
63
+ case "clavue":
64
64
  await this.updateMyclaudeTools(skipPrompt);
65
65
  break;
66
66
  case "codex":
@@ -78,7 +78,7 @@ class ToolUpdateScheduler {
78
78
  await checkAndUpdateTools(skipPrompt);
79
79
  }
80
80
  /**
81
- * Update myclaude related tools
81
+ * Update Clavue related tools
82
82
  * @param skipPrompt - Whether to skip interactive prompts
83
83
  */
84
84
  async updateMyclaudeTools(skipPrompt) {