ccjk 14.1.6 → 14.1.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.
Files changed (95) hide show
  1. package/bin/ccjk.mjs +3 -2
  2. package/bin/ccjk.ts +104 -104
  3. package/dist/chunks/agent-teams.mjs +15 -8
  4. package/dist/chunks/agent.mjs +2 -2
  5. package/dist/chunks/api-cli.mjs +3 -3
  6. package/dist/chunks/api-config-selector.mjs +6 -6
  7. package/dist/chunks/auto-updater.mjs +4 -4
  8. package/dist/chunks/boost.mjs +1 -1
  9. package/dist/chunks/brain-config.mjs +1 -1
  10. package/dist/chunks/brain-status.mjs +13 -7
  11. package/dist/chunks/ccjk-all.mjs +4 -4
  12. package/dist/chunks/ccjk-config.mjs +15 -6
  13. package/dist/chunks/ccjk-mcp.mjs +4 -4
  14. package/dist/chunks/ccjk-setup.mjs +2 -2
  15. package/dist/chunks/ccjk-skills.mjs +1 -1
  16. package/dist/chunks/ccr.mjs +17 -13
  17. package/dist/chunks/check-updates.mjs +2 -3
  18. package/dist/chunks/claude-code-incremental-manager.mjs +13 -15
  19. package/dist/chunks/claude-config.mjs +10 -9
  20. package/dist/chunks/code-type-resolver.mjs +3 -5
  21. package/dist/chunks/codex-config-switch.mjs +4 -5
  22. package/dist/chunks/codex-provider-manager.mjs +3 -3
  23. package/dist/chunks/codex.mjs +102 -34
  24. package/dist/chunks/completion.mjs +4 -3
  25. package/dist/chunks/config-switch.mjs +9 -6
  26. package/dist/chunks/config.mjs +582 -27
  27. package/dist/chunks/config2.mjs +5 -4
  28. package/dist/chunks/config3.mjs +42 -30
  29. package/dist/chunks/constants.mjs +6 -2
  30. package/dist/chunks/context.mjs +2 -2
  31. package/dist/chunks/doctor.mjs +237 -71
  32. package/dist/chunks/evolution.mjs +10 -6
  33. package/dist/chunks/features.mjs +34 -19
  34. package/dist/chunks/index10.mjs +8 -7
  35. package/dist/chunks/init.mjs +491 -547
  36. package/dist/chunks/installer.mjs +3 -7
  37. package/dist/chunks/mcp-cli.mjs +9 -10
  38. package/dist/chunks/mcp.mjs +23 -19
  39. package/dist/chunks/memory-check.mjs +2 -2
  40. package/dist/chunks/memory-paths.mjs +1 -1
  41. package/dist/chunks/memory-sync.mjs +2 -2
  42. package/dist/chunks/memory.mjs +7 -7
  43. package/dist/chunks/notification.mjs +1 -1
  44. package/dist/chunks/package.mjs +1 -1
  45. package/dist/chunks/permission-manager.mjs +132 -14
  46. package/dist/chunks/permissions.mjs +1 -1
  47. package/dist/chunks/platform.mjs +1 -1
  48. package/dist/chunks/powershell.mjs +1 -1
  49. package/dist/chunks/providers.mjs +5 -2
  50. package/dist/chunks/quick-provider.mjs +82 -13
  51. package/dist/chunks/quick-setup.mjs +9 -6
  52. package/dist/chunks/remote.mjs +1 -1
  53. package/dist/chunks/research.mjs +118 -118
  54. package/dist/chunks/rollback.mjs +38 -0
  55. package/dist/chunks/simple-config.mjs +17 -3
  56. package/dist/chunks/skill2.mjs +129 -80
  57. package/dist/chunks/skills-sync.mjs +1 -1
  58. package/dist/chunks/slash-commands.mjs +1 -1
  59. package/dist/chunks/smart-guide.mjs +1 -1
  60. package/dist/chunks/snapshot.mjs +58 -0
  61. package/dist/chunks/status.mjs +1 -1
  62. package/dist/chunks/uninstall.mjs +1 -1
  63. package/dist/chunks/update.mjs +13 -12
  64. package/dist/chunks/zero-config.mjs +432 -44
  65. package/dist/cli.mjs +139 -37
  66. package/dist/index.d.mts +31 -7
  67. package/dist/index.d.ts +31 -7
  68. package/dist/index.mjs +10 -10
  69. package/dist/shared/ccjk.B2U7DsPy.mjs +31 -0
  70. package/dist/shared/{ccjk.MpkxXQJL.mjs → ccjk.B8oqkakg.mjs} +5 -160
  71. package/dist/shared/{ccjk.DZtwozOG.mjs → ccjk.B9OuS4xZ.mjs} +3 -3
  72. package/dist/shared/ccjk.BEiR3L4C.mjs +254 -0
  73. package/dist/shared/{ccjk.ygJzcD-n.mjs → ccjk.BJ3Zpjo5.mjs} +5 -220
  74. package/dist/shared/ccjk.BzPbSEP2.mjs +115 -0
  75. package/dist/shared/ccjk.BzxpiEPF.mjs +225 -0
  76. package/dist/shared/{ccjk.BI-hdI7P.mjs → ccjk.CbWVbtb9.mjs} +1 -1
  77. package/dist/shared/ccjk.DFRPtmK_.mjs +75 -0
  78. package/dist/shared/{ccjk.UhjQ1seV.mjs → ccjk.DMV3x5Sd.mjs} +1 -1
  79. package/dist/shared/ccjk.Di1IYU3u.mjs +63 -0
  80. package/dist/shared/{ccjk.SPoXMvZD.mjs → ccjk.DsZsc4LR.mjs} +52 -14
  81. package/dist/shared/{ccjk.DQXk596F.mjs → ccjk.DuzJZlgj.mjs} +107 -103
  82. package/dist/shared/ccjk.Hwoicrh8.mjs +170 -0
  83. package/dist/shared/{ccjk.DTdjs-qK.mjs → ccjk.MwtjAULc.mjs} +1 -1
  84. package/dist/shared/{ccjk.DsYaCCx4.mjs → ccjk.i_vn-9C3.mjs} +2 -2
  85. package/dist/shared/{ccjk.K8c6VnM2.mjs → ccjk.lG3ccFjm.mjs} +79 -1
  86. package/dist/shared/{ccjk.BXTrU9TN.mjs → ccjk.tI_s2uSh.mjs} +11 -7
  87. package/dist/templates/claude-code/common/settings.json +4 -1
  88. package/package.json +5 -5
  89. package/templates/claude-code/common/settings.json +4 -1
  90. package/templates/common/workflow/essential/en/goal.md +147 -0
  91. package/templates/common/workflow/essential/zh-CN/goal.md +146 -0
  92. package/dist/shared/ccjk.Ccrqt7u2.mjs +0 -99
  93. package/dist/shared/ccjk.DKXs7Fbm.mjs +0 -361
  94. package/dist/shared/{ccjk.BBizCO6_.mjs → ccjk.DcMvE7lf.mjs} +1 -1
  95. package/dist/shared/{ccjk.Dhu8ia5S.mjs → ccjk.zFGcZT7Y.mjs} +1 -1
@@ -40,12 +40,12 @@ import './index3.mjs';
40
40
  import './fs-operations.mjs';
41
41
  import 'node:fs/promises';
42
42
  import './json-config.mjs';
43
- import '../shared/ccjk.Ccrqt7u2.mjs';
43
+ import '../shared/ccjk.Di1IYU3u.mjs';
44
44
  import './platform.mjs';
45
45
  import './main.mjs';
46
46
  import 'module';
47
47
  import 'node:stream';
48
- import '../shared/ccjk.DsYaCCx4.mjs';
48
+ import '../shared/ccjk.i_vn-9C3.mjs';
49
49
 
50
50
  async function createBackup(operation, options = {}) {
51
51
  const timestamp = dayjs().format("YYYYMMDD-HHmmss");
@@ -6,7 +6,7 @@ import a from './index5.mjs';
6
6
  import { c as consola, a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.Cv13QsGp.mjs';
7
7
  import { i as inquirer } from './index6.mjs';
8
8
  import { resolveSupportedLanguage, i18n } from './index2.mjs';
9
- import { g as getSkillParser } from '../shared/ccjk.DsYaCCx4.mjs';
9
+ import { g as getSkillParser } from '../shared/ccjk.i_vn-9C3.mjs';
10
10
  import '../shared/ccjk.BAGoDD49.mjs';
11
11
  import './index9.mjs';
12
12
  import '../shared/ccjk.bQ7Dh1g4.mjs';
@@ -9,8 +9,6 @@ import 'node:process';
9
9
  import 'node:url';
10
10
  import '../shared/ccjk.bQ7Dh1g4.mjs';
11
11
  import '../shared/ccjk.gDEDGD_t.mjs';
12
- import './config.mjs';
13
- import '../shared/ccjk.RyizuzOI.mjs';
14
12
  import './index6.mjs';
15
13
  import 'node:readline';
16
14
  import 'stream';
@@ -33,11 +31,13 @@ import './index3.mjs';
33
31
  import './fs-operations.mjs';
34
32
  import 'node:fs/promises';
35
33
  import './json-config.mjs';
36
- import '../shared/ccjk.Ccrqt7u2.mjs';
34
+ import '../shared/ccjk.RyizuzOI.mjs';
35
+ import './config.mjs';
36
+ import 'node:child_process';
37
+ import '../shared/ccjk.Di1IYU3u.mjs';
37
38
  import './platform.mjs';
38
39
  import './main.mjs';
39
40
  import 'module';
40
- import 'node:child_process';
41
41
  import 'node:stream';
42
42
  import './codex.mjs';
43
43
  import './index8.mjs';
@@ -46,11 +46,11 @@ import '../shared/ccjk.CxpGa6MC.mjs';
46
46
  import '../shared/ccjk.BFQ7yr5S.mjs';
47
47
  import './prompts.mjs';
48
48
  import '../shared/ccjk.DZ2LLOa-.mjs';
49
- import '../shared/ccjk.DKXs7Fbm.mjs';
50
49
  import './code-type-resolver.mjs';
51
50
  import './features.mjs';
52
- import '../shared/ccjk.ygJzcD-n.mjs';
53
- import '../shared/ccjk.BI-hdI7P.mjs';
51
+ import '../shared/ccjk.BzxpiEPF.mjs';
52
+ import '../shared/ccjk.BJ3Zpjo5.mjs';
53
+ import '../shared/ccjk.CbWVbtb9.mjs';
54
54
  import './simple-config.mjs';
55
55
  import '../shared/ccjk.DbigonEQ.mjs';
56
56
  import 'node:stream/promises';
@@ -59,22 +59,26 @@ import './smart-guide.mjs';
59
59
  import './ccu.mjs';
60
60
  import './init.mjs';
61
61
  import './config2.mjs';
62
+ import '../shared/ccjk.DFRPtmK_.mjs';
62
63
  import './auto-updater.mjs';
63
64
  import './version-checker.mjs';
64
- import '../shared/ccjk.MpkxXQJL.mjs';
65
+ import '../shared/ccjk.Hwoicrh8.mjs';
65
66
  import './installer.mjs';
67
+ import '../shared/ccjk.B8oqkakg.mjs';
68
+ import '../shared/ccjk.B2U7DsPy.mjs';
66
69
  import '../shared/ccjk.Bq8TqZG_.mjs';
67
70
  import './commands.mjs';
68
71
  import './check-updates.mjs';
69
72
  import './config-switch.mjs';
70
73
  import './doctor.mjs';
71
74
  import './api-providers.mjs';
72
- import '../shared/ccjk.SPoXMvZD.mjs';
75
+ import '../shared/ccjk.DsZsc4LR.mjs';
76
+ import '../shared/ccjk.BEiR3L4C.mjs';
73
77
  import '../shared/ccjk.J8YiPsOw.mjs';
74
- import '../shared/ccjk.DZtwozOG.mjs';
75
- import '../shared/ccjk.BXTrU9TN.mjs';
78
+ import '../shared/ccjk.B9OuS4xZ.mjs';
79
+ import '../shared/ccjk.tI_s2uSh.mjs';
76
80
  import './notification.mjs';
77
- import '../shared/ccjk.BBizCO6_.mjs';
81
+ import '../shared/ccjk.DcMvE7lf.mjs';
78
82
  import '../shared/ccjk.D0g2ABGg.mjs';
79
83
  import '../shared/ccjk.D6ycHbak.mjs';
80
84
  import 'node:buffer';
@@ -82,7 +86,7 @@ import './uninstall.mjs';
82
86
  import '../shared/ccjk.D75wivnp.mjs';
83
87
  import 'globby';
84
88
  import './update.mjs';
85
- import '../shared/ccjk.K8c6VnM2.mjs';
89
+ import '../shared/ccjk.lG3ccFjm.mjs';
86
90
 
87
91
  async function ccr(options = {}) {
88
92
  try {
@@ -3,7 +3,7 @@ import a from './index5.mjs';
3
3
  import { ensureI18nInitialized, i18n } from './index2.mjs';
4
4
  import { r as resolveCodeType } from './code-type-resolver.mjs';
5
5
  import { checkAndUpdateTools, checkAndUpdateMyclaudeTools } from './auto-updater.mjs';
6
- import { c as runCodexUpdate } from './codex.mjs';
6
+ import { b as runCodexUpdate } from './codex.mjs';
7
7
  import '../shared/ccjk.BAGoDD49.mjs';
8
8
  import 'node:fs';
9
9
  import 'node:url';
@@ -42,11 +42,10 @@ 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.Ccrqt7u2.mjs';
45
+ import '../shared/ccjk.Di1IYU3u.mjs';
46
46
  import '../shared/ccjk.BFQ7yr5S.mjs';
47
47
  import './prompts.mjs';
48
48
  import '../shared/ccjk.gDEDGD_t.mjs';
49
- import '../shared/ccjk.DKXs7Fbm.mjs';
50
49
 
51
50
  class ToolUpdateScheduler {
52
51
  /**
@@ -1,11 +1,12 @@
1
1
  import a from './index5.mjs';
2
2
  import { i as inquirer } from './index6.mjs';
3
3
  import { ensureI18nInitialized, i18n } from './index2.mjs';
4
+ import { readZcfConfig } from './ccjk-config.mjs';
4
5
  import { C as ClaudeCodeConfigManager } from './config.mjs';
6
+ import { r as resolveClaudeFamilyModelSlots } from '../shared/ccjk.B2U7DsPy.mjs';
5
7
  import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
6
- import { readZcfConfig } from './ccjk-config.mjs';
7
8
  import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
8
- import { v as validateApiKey } from '../shared/ccjk.ygJzcD-n.mjs';
9
+ import { v as validateApiKey } from '../shared/ccjk.BzxpiEPF.mjs';
9
10
  import '../shared/ccjk.BAGoDD49.mjs';
10
11
  import 'node:readline';
11
12
  import 'stream';
@@ -25,20 +26,21 @@ import 'string_decoder';
25
26
  import 'node:fs';
26
27
  import 'node:url';
27
28
  import '../shared/ccjk.bQ7Dh1g4.mjs';
28
- import '../shared/ccjk.RyizuzOI.mjs';
29
+ import '../shared/ccjk.BBtCGd_g.mjs';
30
+ import './index3.mjs';
29
31
  import './constants.mjs';
30
32
  import './fs-operations.mjs';
31
33
  import 'node:fs/promises';
32
34
  import './json-config.mjs';
33
- import '../shared/ccjk.Ccrqt7u2.mjs';
35
+ import '../shared/ccjk.RyizuzOI.mjs';
36
+ import 'node:child_process';
37
+ import '../shared/ccjk.Di1IYU3u.mjs';
34
38
  import './platform.mjs';
35
39
  import './main.mjs';
36
40
  import 'module';
37
- import 'node:child_process';
38
41
  import 'node:stream';
39
- import '../shared/ccjk.BBtCGd_g.mjs';
40
- import './index3.mjs';
41
42
  import '../shared/ccjk.DeWpAShp.mjs';
43
+ import '../shared/ccjk.BJ3Zpjo5.mjs';
42
44
 
43
45
  function getAuthTypeLabel(authType) {
44
46
  ensureI18nInitialized();
@@ -58,7 +60,7 @@ async function syncMyclaudeProfilesIfNeeded() {
58
60
  if (zcfConfig?.codeToolType !== "clavue") {
59
61
  return;
60
62
  }
61
- const { syncMyclaudeProviderProfilesFromCurrentClaudeConfig } = await import('./config.mjs').then(function (n) { return n.H; });
63
+ const { syncMyclaudeProviderProfilesFromCurrentClaudeConfig } = await import('./config.mjs').then(function (n) { return n.P; });
62
64
  syncMyclaudeProviderProfilesFromCurrentClaudeConfig();
63
65
  }
64
66
  async function configureIncrementalManagement() {
@@ -123,13 +125,9 @@ async function addProfileDirect() {
123
125
  await syncMyclaudeProfilesIfNeeded();
124
126
  }
125
127
  function getProviderDefaultModels(provider) {
126
- const defaults = provider?.claudeCode?.defaultModels || [];
127
- return {
128
- primaryModel: defaults[0],
129
- haikuModel: defaults[1] || defaults[0],
130
- sonnetModel: defaults[2] || defaults[0],
131
- opusModel: defaults[3]
132
- };
128
+ return resolveClaudeFamilyModelSlots({
129
+ defaultModels: provider?.claudeCode?.defaultModels
130
+ });
133
131
  }
134
132
  async function handleAddProfile() {
135
133
  console.log(a.green(`
@@ -1,13 +1,17 @@
1
- import { SETTINGS_FILE, CLAUDE_DIR } from './constants.mjs';
1
+ import { SETTINGS_FILE } from './constants.mjs';
2
+ import { n as normalizeClaudeFamilySettings } from '../shared/ccjk.Di1IYU3u.mjs';
2
3
  import { exists, ensureDir } from './fs-operations.mjs';
3
4
  import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
4
- import { l as deepMerge } from './config.mjs';
5
+ import { x as deepMerge } from './config.mjs';
6
+ import { d as dirname } from '../shared/ccjk.bQ7Dh1g4.mjs';
5
7
  import 'node:os';
6
8
  import './index2.mjs';
7
9
  import 'node:fs';
8
10
  import 'node:process';
9
11
  import 'node:url';
10
- import '../shared/ccjk.bQ7Dh1g4.mjs';
12
+ import './ccjk-config.mjs';
13
+ import '../shared/ccjk.BBtCGd_g.mjs';
14
+ import './index3.mjs';
11
15
  import 'node:crypto';
12
16
  import 'node:fs/promises';
13
17
  import '../shared/ccjk.RyizuzOI.mjs';
@@ -26,14 +30,10 @@ import 'child_process';
26
30
  import 'node:path';
27
31
  import 'buffer';
28
32
  import 'string_decoder';
29
- import './ccjk-config.mjs';
30
- import '../shared/ccjk.BBtCGd_g.mjs';
31
- import './index3.mjs';
32
- import '../shared/ccjk.Ccrqt7u2.mjs';
33
+ import 'node:child_process';
33
34
  import './platform.mjs';
34
35
  import './main.mjs';
35
36
  import 'module';
36
- import 'node:child_process';
37
37
  import 'node:stream';
38
38
 
39
39
  function readClaudeConfig(configPath = SETTINGS_FILE) {
@@ -49,7 +49,8 @@ function readClaudeConfig(configPath = SETTINGS_FILE) {
49
49
  }
50
50
  function writeClaudeConfig(config, options = {}, configPath = SETTINGS_FILE) {
51
51
  try {
52
- ensureDir(CLAUDE_DIR);
52
+ ensureDir(dirname(configPath));
53
+ normalizeClaudeFamilySettings(config);
53
54
  writeJsonConfig(configPath, config, {
54
55
  atomic: options.atomic !== false,
55
56
  pretty: true,
@@ -5,7 +5,7 @@ import { homedir } from 'node:os';
5
5
  import { CCJK_CONFIG_DIR, CODE_TOOL_INFO, CODE_TOOL_ALIASES, DEFAULT_CODE_TOOL_TYPE, isCodeToolType } from './constants.mjs';
6
6
  import { writeJsonConfig } from './json-config.mjs';
7
7
  import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
8
- import { g as getPlatform, h as commandExists } from './platform.mjs';
8
+ import { g as getPlatform, c as commandExists } from './platform.mjs';
9
9
  import process__default from 'node:process';
10
10
  import { i18n } from './index2.mjs';
11
11
  import { readZcfConfigAsync, updateZcfConfig } from './ccjk-config.mjs';
@@ -350,10 +350,8 @@ function detectDatabase(root) {
350
350
  if (content.includes("mongodb"))
351
351
  return "mongodb";
352
352
  }
353
- for (const f of ["*.db", "*.sqlite", "*.sqlite3"]) {
354
- if (existsSync(join(root, "db.sqlite")) || existsSync(join(root, "database.sqlite")) || existsSync(join(root, "dev.db"))) {
355
- return "sqlite";
356
- }
353
+ if (existsSync(join(root, "db.sqlite")) || existsSync(join(root, "database.sqlite")) || existsSync(join(root, "dev.db"))) {
354
+ return "sqlite";
357
355
  }
358
356
  return "none";
359
357
  }
@@ -5,7 +5,7 @@ import { ensureI18nInitialized, i18n } from './index2.mjs';
5
5
  import { readJsonConfig } from './json-config.mjs';
6
6
  import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
7
7
  import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
8
- import { e as detectConfigManagementMode } from './codex.mjs';
8
+ import { f as detectConfigManagementMode } from './codex.mjs';
9
9
  import { deleteProviders, addProviderToExisting, editExistingProvider } from './codex-provider-manager.mjs';
10
10
  import '../shared/ccjk.BAGoDD49.mjs';
11
11
  import 'node:readline';
@@ -40,11 +40,10 @@ import 'node:stream';
40
40
  import './ccjk-config.mjs';
41
41
  import './index3.mjs';
42
42
  import './config.mjs';
43
- import '../shared/ccjk.Ccrqt7u2.mjs';
43
+ import '../shared/ccjk.Di1IYU3u.mjs';
44
44
  import './platform.mjs';
45
45
  import './prompts.mjs';
46
46
  import '../shared/ccjk.gDEDGD_t.mjs';
47
- import '../shared/ccjk.DKXs7Fbm.mjs';
48
47
 
49
48
  async function configureIncrementalManagement() {
50
49
  ensureI18nInitialized();
@@ -193,7 +192,7 @@ async function handleAddProvider() {
193
192
  defaultValue: true
194
193
  });
195
194
  if (setAsDefault) {
196
- const { switchToProvider } = await import('./codex.mjs').then(function (n) { return n.q; });
195
+ const { switchToProvider } = await import('./codex.mjs').then(function (n) { return n.t; });
197
196
  const switched = await switchToProvider(provider.id);
198
197
  if (switched) {
199
198
  console.log(a.green(i18n.t("multi-config:profileSetAsDefault", { name: provider.name })));
@@ -388,7 +387,7 @@ ${i18n.t("codex:copyingProvider", { name: provider.name })}`));
388
387
  defaultValue: false
389
388
  });
390
389
  if (setAsDefault) {
391
- const { switchToProvider } = await import('./codex.mjs').then(function (n) { return n.q; });
390
+ const { switchToProvider } = await import('./codex.mjs').then(function (n) { return n.t; });
392
391
  const switched = await switchToProvider(copiedProvider.id);
393
392
  if (switched) {
394
393
  console.log(a.green(i18n.t("multi-config:profileSetAsDefault", { name: copiedProvider.name })));
@@ -1,5 +1,5 @@
1
1
  import { ensureI18nInitialized, i18n } from './index2.mjs';
2
- import { r as readCodexConfig, f as backupCodexComplete, w as writeCodexConfig, g as writeAuthFile } from './codex.mjs';
2
+ import { r as readCodexConfig, d as backupCodexComplete, w as writeCodexConfig, e as writeAuthFile } from './codex.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:process';
5
5
  import 'node:url';
@@ -37,13 +37,12 @@ import './fs-operations.mjs';
37
37
  import 'node:fs/promises';
38
38
  import './json-config.mjs';
39
39
  import './config.mjs';
40
- import '../shared/ccjk.Ccrqt7u2.mjs';
40
+ import '../shared/ccjk.Di1IYU3u.mjs';
41
41
  import './platform.mjs';
42
42
  import '../shared/ccjk.BFQ7yr5S.mjs';
43
43
  import './prompts.mjs';
44
44
  import '../shared/ccjk.gDEDGD_t.mjs';
45
45
  import '../shared/ccjk.DZ2LLOa-.mjs';
46
- import '../shared/ccjk.DKXs7Fbm.mjs';
47
46
 
48
47
  async function addProviderToExisting(provider, apiKey, allowOverwrite = false) {
49
48
  ensureI18nInitialized();
@@ -64,6 +63,7 @@ async function addProviderToExisting(provider, apiKey, allowOverwrite = false) {
64
63
  providers: [provider],
65
64
  mcpServices: [],
66
65
  managed: true,
66
+ features: { goals: true },
67
67
  otherConfig: []
68
68
  };
69
69
  } else if (existingProviderIndex !== -1) {
@@ -1,5 +1,5 @@
1
- import process__default from 'node:process';
2
1
  import { readdirSync } from 'node:fs';
2
+ import process__default from 'node:process';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import a from './index5.mjs';
5
5
  import { d as dayjs } from '../shared/ccjk.RyizuzOI.mjs';
@@ -11,14 +11,13 @@ import { x as K } from './main.mjs';
11
11
  import { CODEX_CONFIG_FILE, CODEX_AUTH_FILE, CODEX_DIR, SUPPORTED_LANGS, CODEX_AGENTS_FILE, CODEX_PROMPTS_DIR, ZCF_CONFIG_FILE, AI_OUTPUT_LANGUAGES } from './constants.mjs';
12
12
  import { ensureI18nInitialized, i18n, format } from './index2.mjs';
13
13
  import { updateZcfConfig, readZcfConfig, readDefaultTomlConfig, updateTomlConfig } from './ccjk-config.mjs';
14
- import { v as applyAiLanguageDirective } from './config.mjs';
14
+ import { M as MCP_SERVICE_CONFIGS, G as isMcpServiceCompatible, g as getMcpServices, H as getMcpServicesWithCompatibility, D as applyAiLanguageDirective } from './config.mjs';
15
15
  import { exists, readFile, ensureDir, writeFileAtomic, writeFile, copyDir, copyFile } from './fs-operations.mjs';
16
16
  import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
17
17
  import { i as isWindows, m as getMcpCommand, k as getSystemRoot, w as wrapCommandWithSudo, n as normalizeTomlPath } from './platform.mjs';
18
18
  import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
19
19
  import { resolveAiOutputLanguage } from './prompts.mjs';
20
20
  import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
21
- import { M as MCP_SERVICE_CONFIGS, i as isMcpServiceCompatible, g as getMcpServices, b as getMcpServicesWithCompatibility } from '../shared/ccjk.DKXs7Fbm.mjs';
22
21
  import { j as join, d as dirname } from '../shared/ccjk.bQ7Dh1g4.mjs';
23
22
 
24
23
  function detectConfigManagementMode() {
@@ -173,6 +172,7 @@ async function configureCodexMcp(options) {
173
172
  modelProvider: existingConfig?.modelProvider || null,
174
173
  providers: baseProviders2,
175
174
  mcpServices: finalServices2,
175
+ features: existingConfig?.features,
176
176
  otherConfig: existingConfig?.otherConfig || []
177
177
  });
178
178
  updateZcfConfig({ codeToolType: "codex" });
@@ -194,6 +194,7 @@ async function configureCodexMcp(options) {
194
194
  modelProvider: existingConfig?.modelProvider || null,
195
195
  providers: baseProviders,
196
196
  mcpServices: preserved,
197
+ features: existingConfig?.features,
197
198
  otherConfig: existingConfig?.otherConfig || []
198
199
  });
199
200
  updateZcfConfig({ codeToolType: "codex" });
@@ -250,6 +251,7 @@ async function configureCodexMcp(options) {
250
251
  modelProvider: existingConfig?.modelProvider || null,
251
252
  providers: baseProviders,
252
253
  mcpServices: finalServices,
254
+ features: existingConfig?.features,
253
255
  otherConfig: existingConfig?.otherConfig || []
254
256
  });
255
257
  updateZcfConfig({ codeToolType: "codex" });
@@ -483,6 +485,87 @@ function migrateEnvKeyInContent(content) {
483
485
  }
484
486
  return result.join("\n");
485
487
  }
488
+ function isCodexGoalsFeatureEnabled(content) {
489
+ try {
490
+ const parsed = parse(content);
491
+ return parsed.features?.goals === true;
492
+ } catch {
493
+ return false;
494
+ }
495
+ }
496
+ function escapeRegExp(input) {
497
+ return input.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
498
+ }
499
+ function setCodexFeatureFlagInContent(content, key, enabled) {
500
+ const normalized = content.trimEnd();
501
+ const lines = normalized ? normalized.split("\n") : [];
502
+ const featuresHeaderIndex = lines.findIndex((line) => line.trim() === "[features]");
503
+ if (featuresHeaderIndex === -1) {
504
+ const prefix = normalized ? `${normalized}
505
+
506
+ ` : "";
507
+ return `${prefix}[features]
508
+ ${key} = ${enabled}
509
+ `;
510
+ }
511
+ let insertIndex = lines.length;
512
+ let featureIndex = -1;
513
+ const keyPattern = new RegExp(`^${escapeRegExp(key)}\\s*=`);
514
+ for (let index = featuresHeaderIndex + 1; index < lines.length; index += 1) {
515
+ const trimmed = lines[index].trim();
516
+ if (/^\[[^\]]+\]\s*$/.test(trimmed)) {
517
+ insertIndex = index;
518
+ break;
519
+ }
520
+ if (keyPattern.test(trimmed)) {
521
+ featureIndex = index;
522
+ break;
523
+ }
524
+ }
525
+ if (featureIndex !== -1) {
526
+ const replacePattern = new RegExp(`^(\\s*)${escapeRegExp(key)}\\s*=.*$`);
527
+ lines[featureIndex] = lines[featureIndex].replace(replacePattern, `$1${key} = ${enabled}`);
528
+ } else {
529
+ lines.splice(insertIndex, 0, `${key} = ${enabled}`);
530
+ }
531
+ return `${lines.join("\n")}
532
+ `;
533
+ }
534
+ function normalizeCodexFeatureFlags(input) {
535
+ if (!input || typeof input !== "object" || Array.isArray(input)) {
536
+ return void 0;
537
+ }
538
+ const flags = {};
539
+ for (const [key, value] of Object.entries(input)) {
540
+ if (/^\w+$/.test(key) && typeof value === "boolean") {
541
+ flags[key] = value;
542
+ }
543
+ }
544
+ return Object.keys(flags).length > 0 ? flags : void 0;
545
+ }
546
+ function applyCodexFeatureFlagsToContent(content, features) {
547
+ let nextContent = content;
548
+ for (const [key, enabled] of Object.entries(features).sort(([a], [b]) => a.localeCompare(b))) {
549
+ nextContent = setCodexFeatureFlagInContent(nextContent, key, enabled);
550
+ }
551
+ return nextContent;
552
+ }
553
+ function setCodexGoalsFeatureInContent(content, enabled = true) {
554
+ return setCodexFeatureFlagInContent(content, "goals", enabled);
555
+ }
556
+ function readCodexGoalsFeatureEnabled() {
557
+ if (!exists(CODEX_CONFIG_FILE)) {
558
+ return false;
559
+ }
560
+ try {
561
+ return isCodexGoalsFeatureEnabled(readFile(CODEX_CONFIG_FILE));
562
+ } catch {
563
+ return false;
564
+ }
565
+ }
566
+ function buildCodexGoalsFeatureConfigContent(existingContent = "") {
567
+ return setCodexGoalsFeatureInContent(existingContent, true);
568
+ }
486
569
  function ensureEnvKeyMigration() {
487
570
  const tomlConfig = readDefaultTomlConfig();
488
571
  if (tomlConfig?.codex?.envKeyMigrated)
@@ -505,6 +588,7 @@ function parseCodexConfig(content) {
505
588
  providers: [],
506
589
  mcpServices: [],
507
590
  managed: false,
591
+ features: void 0,
508
592
  otherConfig: [],
509
593
  modelProviderCommented: void 0
510
594
  };
@@ -514,6 +598,7 @@ function parseCodexConfig(content) {
514
598
  return match.replace(/\\\\/g, "/").replace(/\\/g, "/").replace('C:/Windows"?', 'C:/Windows"');
515
599
  });
516
600
  const tomlData = parse(normalizedContent);
601
+ const features = normalizeCodexFeatureFlags(tomlData.features);
517
602
  const providers = [];
518
603
  if (tomlData.model_providers) {
519
604
  for (const [id, providerData] of Object.entries(tomlData.model_providers)) {
@@ -627,6 +712,7 @@ function parseCodexConfig(content) {
627
712
  providers,
628
713
  mcpServices,
629
714
  managed,
715
+ features,
630
716
  otherConfig,
631
717
  modelProviderCommented
632
718
  };
@@ -642,6 +728,7 @@ function parseCodexConfig(content) {
642
728
  providers: [],
643
729
  mcpServices: [],
644
730
  managed: false,
731
+ features: void 0,
645
732
  otherConfig,
646
733
  modelProviderCommented: void 0
647
734
  };
@@ -809,6 +896,9 @@ function renderCodexConfig(data) {
809
896
  if (result && !result.endsWith("\n")) {
810
897
  result += "\n";
811
898
  }
899
+ if (data.features && Object.keys(data.features).length > 0) {
900
+ result = applyCodexFeatureFlagsToContent(result, data.features);
901
+ }
812
902
  return result;
813
903
  }
814
904
  function writeCodexConfig(data) {
@@ -1166,6 +1256,7 @@ function getEssentialPromptFiles(workflowSrc, preferredLang) {
1166
1256
  const essentialDir = join(workflowSrc, "essential", preferredLang);
1167
1257
  const files = [
1168
1258
  "feat.md",
1259
+ "goal.md",
1169
1260
  "init-project.md"
1170
1261
  ];
1171
1262
  const resolved = [];
@@ -1253,6 +1344,7 @@ async function applyCustomApiConfig(customApiConfig) {
1253
1344
  modelProviderCommented: false,
1254
1345
  providers,
1255
1346
  mcpServices: existingConfig?.mcpServices || [],
1347
+ features: existingConfig?.features,
1256
1348
  otherConfig: existingConfig?.otherConfig || []
1257
1349
  };
1258
1350
  writeCodexConfig(configData);
@@ -1501,6 +1593,7 @@ async function configureCodexApi(options) {
1501
1593
  modelProvider: defaultProvider,
1502
1594
  providers,
1503
1595
  mcpServices: existingConfig?.mcpServices || [],
1596
+ features: existingConfig?.features,
1504
1597
  otherConfig: existingConfig?.otherConfig || []
1505
1598
  });
1506
1599
  writeAuthFile(authEntries, "apikey");
@@ -1682,6 +1775,7 @@ function ensureCodexRecommendedModel(defaultModel = "gpt-5-codex") {
1682
1775
  modelProvider: existingConfig?.modelProvider || null,
1683
1776
  providers: existingConfig?.providers || [],
1684
1777
  mcpServices: existingConfig?.mcpServices || [],
1778
+ features: existingConfig?.features,
1685
1779
  otherConfig: existingConfig?.otherConfig || [],
1686
1780
  modelProviderCommented: existingConfig?.modelProviderCommented
1687
1781
  });
@@ -1901,35 +1995,6 @@ async function listCodexProviders() {
1901
1995
  const config = readCodexConfig();
1902
1996
  return config?.providers || [];
1903
1997
  }
1904
- async function switchCodexProvider(providerId) {
1905
- ensureI18nInitialized();
1906
- const existingConfig = readCodexConfig();
1907
- if (!existingConfig) {
1908
- console.log(a.red(i18n.t("codex:configNotFound")));
1909
- return false;
1910
- }
1911
- const providerExists = existingConfig.providers.some((provider) => provider.id === providerId);
1912
- if (!providerExists) {
1913
- console.log(a.red(i18n.t("codex:providerNotFound", { provider: providerId })));
1914
- return false;
1915
- }
1916
- const backupPath = backupCodexComplete();
1917
- if (backupPath) {
1918
- console.log(a.gray(getBackupMessage(backupPath)));
1919
- }
1920
- const updatedConfig = {
1921
- ...existingConfig,
1922
- modelProvider: providerId
1923
- };
1924
- try {
1925
- writeCodexConfig(updatedConfig);
1926
- console.log(a.green(i18n.t("codex:providerSwitchSuccess", { provider: providerId })));
1927
- return true;
1928
- } catch (error) {
1929
- console.error(a.red(i18n.t("codex:errorSwitchingProvider", { error: error.message })));
1930
- return false;
1931
- }
1932
- }
1933
1998
  async function switchToOfficialLogin() {
1934
1999
  ensureI18nInitialized();
1935
2000
  const existingConfig = readCodexConfig();
@@ -2036,6 +2101,7 @@ const codex = {
2036
2101
  backupCodexConfig: backupCodexConfig,
2037
2102
  backupCodexFiles: backupCodexFiles,
2038
2103
  backupCodexPrompts: backupCodexPrompts,
2104
+ buildCodexGoalsFeatureConfigContent: buildCodexGoalsFeatureConfigContent,
2039
2105
  checkCodexUpdate: checkCodexUpdate,
2040
2106
  configureCodexAiMemoryFeature: configureCodexAiMemoryFeature,
2041
2107
  configureCodexApi: configureCodexApi,
@@ -2048,6 +2114,7 @@ const codex = {
2048
2114
  getCodexPresetDefinitions: getCodexPresetDefinitions,
2049
2115
  getCodexVersion: getCodexVersion,
2050
2116
  installCodexCli: installCodexCli,
2117
+ isCodexGoalsFeatureEnabled: isCodexGoalsFeatureEnabled,
2051
2118
  isCodexInstalled: isCodexInstalled,
2052
2119
  listCodexProviders: listCodexProviders,
2053
2120
  migrateEnvKeyInContent: migrateEnvKeyInContent,
@@ -2055,6 +2122,7 @@ const codex = {
2055
2122
  needsEnvKeyMigration: needsEnvKeyMigration,
2056
2123
  parseCodexConfig: parseCodexConfig,
2057
2124
  readCodexConfig: readCodexConfig,
2125
+ readCodexGoalsFeatureEnabled: readCodexGoalsFeatureEnabled,
2058
2126
  renderCodexConfig: renderCodexConfig,
2059
2127
  runCodexFullInit: runCodexFullInit,
2060
2128
  runCodexSystemPromptSelection: runCodexSystemPromptSelection,
@@ -2062,11 +2130,11 @@ const codex = {
2062
2130
  runCodexUpdate: runCodexUpdate,
2063
2131
  runCodexWorkflowImportWithLanguageSelection: runCodexWorkflowImportWithLanguageSelection,
2064
2132
  runCodexWorkflowSelection: runCodexWorkflowSelection,
2065
- switchCodexProvider: switchCodexProvider,
2133
+ setCodexGoalsFeatureInContent: setCodexGoalsFeatureInContent,
2066
2134
  switchToOfficialLogin: switchToOfficialLogin,
2067
2135
  switchToProvider: switchToProvider,
2068
2136
  writeAuthFile: writeAuthFile,
2069
2137
  writeCodexConfig: writeCodexConfig
2070
2138
  };
2071
2139
 
2072
- export { switchToOfficialLogin as a, switchToProvider as b, runCodexUpdate as c, applyCodexPlatformCommand as d, detectConfigManagementMode as e, backupCodexComplete as f, writeAuthFile as g, runCodexFullInit as h, runCodexUninstall as i, configureCodexAiMemoryFeature as j, configureCodexDefaultModelFeature as k, listCodexProviders as l, configureCodexMcp as m, configureCodexApi as n, configureCodexPresetFeature as o, runCodexWorkflowImportWithLanguageSelection as p, codex as q, readCodexConfig as r, switchCodexProvider as s, writeCodexConfig as w };
2140
+ export { switchToProvider as a, runCodexUpdate as b, applyCodexPlatformCommand as c, backupCodexComplete as d, writeAuthFile as e, detectConfigManagementMode as f, readCodexGoalsFeatureEnabled as g, buildCodexGoalsFeatureConfigContent as h, runCodexFullInit as i, runCodexUninstall as j, configureCodexAiMemoryFeature as k, listCodexProviders as l, configureCodexDefaultModelFeature as m, configureCodexMcp as n, configureCodexApi as o, configureCodexPresetFeature as p, runCodexWorkflowImportWithLanguageSelection as q, readCodexConfig as r, switchToOfficialLogin as s, codex as t, writeCodexConfig as w };
@@ -2,11 +2,12 @@ import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
2
2
  import { homedir } from 'node:os';
3
3
  import { join } from 'node:path';
4
4
  import a from './index5.mjs';
5
+ import { CODE_TOOL_TYPES } from './constants.mjs';
5
6
  import { i18n } from './index2.mjs';
6
7
  import '../shared/ccjk.BAGoDD49.mjs';
8
+ import '../shared/ccjk.bQ7Dh1g4.mjs';
7
9
  import 'node:process';
8
10
  import 'node:url';
9
- import '../shared/ccjk.bQ7Dh1g4.mjs';
10
11
 
11
12
  const COMPLETION_COMMANDS = [
12
13
  // Core Commands
@@ -19,7 +20,7 @@ const COMPLETION_COMMANDS = [
19
20
  { flags: "--config-lang, -c", description: "Configuration language", values: ["zh-CN", "en"] },
20
21
  { flags: "--force, -f", description: "Force overwrite" },
21
22
  { flags: "--skip-prompt, -s", description: "Skip prompts" },
22
- { flags: "--code-type, -T", description: "Code tool type", values: ["claude-code", "codex", "aider", "continue", "cline", "cursor"] }
23
+ { flags: "--code-type, -T", description: "Code tool type", values: [...CODE_TOOL_TYPES] }
23
24
  ]
24
25
  },
25
26
  {
@@ -36,7 +37,7 @@ const COMPLETION_COMMANDS = [
36
37
  description: "Run environment health check",
37
38
  options: [
38
39
  { flags: "--check-providers", description: "Check API provider health" },
39
- { flags: "--code-type, -T", description: "Code tool type", values: ["claude-code", "codex"] },
40
+ { flags: "--code-type, -T", description: "Code tool type", values: ["claude-code", "clavue", "codex"] },
40
41
  { flags: "--fix-settings", description: "Fix settings.json validation issues" }
41
42
  ]
42
43
  },