ccjk 9.4.2 → 9.4.3

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 (37) hide show
  1. package/dist/chunks/api.mjs +1 -1
  2. package/dist/chunks/ccjk-mcp.mjs +1 -1
  3. package/dist/chunks/ccr.mjs +19 -19
  4. package/dist/chunks/check-updates.mjs +1 -1
  5. package/dist/chunks/claude-code-config-manager.mjs +1 -1
  6. package/dist/chunks/claude-code-incremental-manager.mjs +1 -1
  7. package/dist/chunks/claude-config.mjs +1 -1
  8. package/dist/chunks/claude-wrapper.mjs +1 -1
  9. package/dist/chunks/codex-config-switch.mjs +1 -1
  10. package/dist/chunks/codex-provider-manager.mjs +1 -1
  11. package/dist/chunks/codex.mjs +3 -3
  12. package/dist/chunks/config-consolidator.mjs +1 -1
  13. package/dist/chunks/config.mjs +1 -1
  14. package/dist/chunks/doctor.mjs +3 -3
  15. package/dist/chunks/features.mjs +301 -4
  16. package/dist/chunks/hooks-sync.mjs +1 -1
  17. package/dist/chunks/init.mjs +119 -16
  18. package/dist/chunks/installer.mjs +1 -1
  19. package/dist/chunks/mcp-market.mjs +2 -2
  20. package/dist/chunks/menu.mjs +108 -232
  21. package/dist/chunks/monitor.mjs +1 -1
  22. package/dist/chunks/onboarding.mjs +1 -1
  23. package/dist/chunks/package.mjs +1 -1
  24. package/dist/chunks/permission-manager.mjs +1 -1
  25. package/dist/chunks/platform.mjs +1 -1
  26. package/dist/chunks/quick-setup.mjs +3 -3
  27. package/dist/chunks/simple-config.mjs +34 -3
  28. package/dist/chunks/tools.mjs +6 -180
  29. package/dist/chunks/update.mjs +4 -4
  30. package/dist/chunks/upgrade-manager.mjs +1 -1
  31. package/dist/chunks/version-checker.mjs +1 -1
  32. package/dist/index.mjs +1 -1
  33. package/dist/shared/{ccjk.BgRf-biH.mjs → ccjk.BCSUNwWl.mjs} +2 -2
  34. package/dist/shared/{ccjk.DKL7Ki99.mjs → ccjk.DHVCT7SF.mjs} +1 -1
  35. package/dist/shared/ccjk.zChMF_WZ.mjs +75 -0
  36. package/package.json +1 -1
  37. package/dist/shared/ccjk.DnFuTYdi.mjs +0 -181
@@ -1,6 +1,6 @@
1
1
  import ansis from 'ansis';
2
2
  import { i18n, format } from './index3.mjs';
3
- import { S as STATUS, t as theme } from '../shared/ccjk.DKL7Ki99.mjs';
3
+ import { S as STATUS, t as theme } from '../shared/ccjk.DHVCT7SF.mjs';
4
4
  import inquirer from 'inquirer';
5
5
  import { existsSync, readFileSync, mkdirSync } from 'node:fs';
6
6
  import { homedir } from 'node:os';
@@ -6,7 +6,7 @@ import ansis from 'ansis';
6
6
  import { ensureI18nInitialized, i18n } from './index3.mjs';
7
7
  import { a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.CcFAyU1D.mjs';
8
8
  import { b as backupMcpConfig, r as readMcpConfig, m as mergeMcpServers, w as writeMcpConfig } from './claude-config.mjs';
9
- import { h as commandExists } from './platform.mjs';
9
+ import { e as commandExists } from './platform.mjs';
10
10
  import { CLAUDE_DIR } from './constants.mjs';
11
11
  import 'node:fs';
12
12
  import 'node:url';
@@ -1,4 +1,4 @@
1
- import { d as displayBannerWithInfo } from '../shared/ccjk.DKL7Ki99.mjs';
1
+ import { a as displayBannerWithInfo } from '../shared/ccjk.DHVCT7SF.mjs';
2
2
  import { a as handleExitPromptError, h as handleGeneralError } from '../shared/ccjk.CiPa6kZ5.mjs';
3
3
  import { s as showCcrMenu } from './tools.mjs';
4
4
  import { showMainMenu } from './menu.mjs';
@@ -12,36 +12,36 @@ import 'i18next';
12
12
  import 'i18next-fs-backend';
13
13
  import 'pathe';
14
14
  import 'inquirer';
15
- import './ccu.mjs';
15
+ import 'node:os';
16
+ import './commands.mjs';
17
+ import 'node:child_process';
18
+ import 'node:util';
19
+ import './config2.mjs';
20
+ import 'dayjs';
21
+ import './constants.mjs';
22
+ import './claude-config.mjs';
23
+ import './json-config.mjs';
24
+ import './fs-operations.mjs';
25
+ import 'node:crypto';
26
+ import 'node:fs/promises';
27
+ import './platform.mjs';
16
28
  import 'tinyexec';
29
+ import './config.mjs';
17
30
  import '../shared/ccjk.DHbrGcgg.mjs';
18
31
  import 'inquirer-toggle';
19
- import 'node:child_process';
20
- import 'node:util';
21
- import '../shared/ccjk.DnFuTYdi.mjs';
32
+ import '../shared/ccjk.zChMF_WZ.mjs';
22
33
  import './auto-updater.mjs';
23
34
  import 'ora';
24
- import './platform.mjs';
25
- import 'node:os';
26
35
  import './version-checker.mjs';
27
36
  import 'node:path';
28
37
  import 'semver';
29
- import './constants.mjs';
30
- import './fs-operations.mjs';
31
- import 'node:crypto';
32
- import 'node:fs/promises';
33
- import './json-config.mjs';
34
- import 'dayjs';
35
- import '../shared/ccjk.BFQ7yr5S.mjs';
36
- import './commands.mjs';
37
- import './config2.mjs';
38
- import './claude-config.mjs';
39
- import './config.mjs';
40
38
  import './ccjk-config.mjs';
41
39
  import 'smol-toml';
42
40
  import '../shared/ccjk.D1zFzlNS.mjs';
43
41
  import './features.mjs';
44
- import '../shared/ccjk.BgRf-biH.mjs';
42
+ import '../shared/ccjk.BCSUNwWl.mjs';
43
+ import '../shared/ccjk.BFQ7yr5S.mjs';
44
+ import './simple-config.mjs';
45
45
  import './claude-code-config-manager.mjs';
46
46
  import './config-switch.mjs';
47
47
  import './codex.mjs';
@@ -3,7 +3,7 @@ import ansis from 'ansis';
3
3
  import { ensureI18nInitialized, i18n } from './index3.mjs';
4
4
  import { r as resolveCodeType } from '../shared/ccjk.D1zFzlNS.mjs';
5
5
  import { checkAndUpdateTools } from './auto-updater.mjs';
6
- import { e as runCodexUpdate } from './codex.mjs';
6
+ import { c as runCodexUpdate } from './codex.mjs';
7
7
  import 'node:fs';
8
8
  import 'node:url';
9
9
  import 'i18next';
@@ -190,7 +190,7 @@ class ClaudeCodeConfigManager {
190
190
  ensureI18nInitialized();
191
191
  try {
192
192
  if (!profile) {
193
- const { switchToOfficialLogin } = await import('./config.mjs').then(function (n) { return n.h; });
193
+ const { switchToOfficialLogin } = await import('./config.mjs').then(function (n) { return n.j; });
194
194
  switchToOfficialLogin();
195
195
  return;
196
196
  }
@@ -4,7 +4,7 @@ import { ensureI18nInitialized, i18n } from './index3.mjs';
4
4
  import { ClaudeCodeConfigManager } from './claude-code-config-manager.mjs';
5
5
  import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
6
6
  import { p as promptBoolean } from '../shared/ccjk.DHbrGcgg.mjs';
7
- import { v as validateApiKey } from '../shared/ccjk.BgRf-biH.mjs';
7
+ import { v as validateApiKey } from '../shared/ccjk.BCSUNwWl.mjs';
8
8
  import 'node:fs';
9
9
  import 'node:process';
10
10
  import 'node:url';
@@ -2,7 +2,7 @@ import { join } from 'pathe';
2
2
  import { CLAUDE_VSC_CONFIG_FILE, CLAUDE_DIR, ClAUDE_CONFIG_FILE } from './constants.mjs';
3
3
  import { ensureI18nInitialized, i18n } from './index3.mjs';
4
4
  import { readJsonConfig, writeJsonConfig, backupJsonConfig } from './json-config.mjs';
5
- import { a as isWindows, l as getMcpCommand } from './platform.mjs';
5
+ import { k as isWindows, l as getMcpCommand } from './platform.mjs';
6
6
 
7
7
  function mergeArraysUnique(arr1, arr2) {
8
8
  const combined = [...arr1 || [], ...arr2 || []];
@@ -1,7 +1,7 @@
1
1
  import process__default from 'node:process';
2
2
  import { exec } from 'tinyexec';
3
3
  import { i18n, initI18n } from './index3.mjs';
4
- import { k as findRealCommandPath } from './platform.mjs';
4
+ import { j as findRealCommandPath } from './platform.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:url';
7
7
  import 'i18next';
@@ -5,7 +5,7 @@ import { ensureI18nInitialized, i18n } from './index3.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.DHbrGcgg.mjs';
8
- import { f as detectConfigManagementMode } from './codex.mjs';
8
+ import { d as detectConfigManagementMode } from './codex.mjs';
9
9
  import { deleteProviders, addProviderToExisting, editExistingProvider } from './codex-provider-manager.mjs';
10
10
  import 'node:os';
11
11
  import 'pathe';
@@ -1,5 +1,5 @@
1
1
  import { ensureI18nInitialized, i18n } from './index3.mjs';
2
- import { r as readCodexConfig, h as backupCodexComplete, w as writeCodexConfig, i as writeAuthFile } from './codex.mjs';
2
+ import { r as readCodexConfig, e as backupCodexComplete, w as writeCodexConfig, f as writeAuthFile } from './codex.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:process';
5
5
  import 'node:url';
@@ -11,10 +11,10 @@ import { x } from 'tinyexec';
11
11
  import { CODEX_AUTH_FILE, SUPPORTED_LANGS, CODEX_DIR, CODEX_AGENTS_FILE, CODEX_PROMPTS_DIR, CODEX_CONFIG_FILE, AI_OUTPUT_LANGUAGES, ZCF_CONFIG_FILE } from './constants.mjs';
12
12
  import { ensureI18nInitialized, i18n, format } from './index3.mjs';
13
13
  import { updateZcfConfig, readZcfConfig, readDefaultTomlConfig, updateTomlConfig } from './ccjk-config.mjs';
14
- import { d as applyAiLanguageDirective } from './config.mjs';
14
+ import { a as applyAiLanguageDirective } from './config.mjs';
15
15
  import { exists, readFile, ensureDir, writeFileAtomic, writeFile, copyFile, copyDir } from './fs-operations.mjs';
16
16
  import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
17
- import { a as isWindows, l as getMcpCommand, m as getSystemRoot, w as wrapCommandWithSudo, n as normalizeTomlPath } from './platform.mjs';
17
+ import { k as isWindows, l as getMcpCommand, m 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.DHbrGcgg.mjs';
@@ -1947,4 +1947,4 @@ const codex = {
1947
1947
  writeCodexConfig: writeCodexConfig
1948
1948
  };
1949
1949
 
1950
- export { MCP_SERVICE_CONFIGS as M, switchToOfficialLogin as a, switchToProvider as b, runCodexFullInit as c, selectMcpServices as d, runCodexUpdate as e, detectConfigManagementMode as f, getMcpServices as g, backupCodexComplete as h, writeAuthFile as i, getMcpService as j, applyCodexPlatformCommand as k, listCodexProviders as l, codex as m, readCodexConfig as r, switchCodexProvider as s, writeCodexConfig as w };
1950
+ export { MCP_SERVICE_CONFIGS as M, switchToOfficialLogin as a, switchToProvider as b, runCodexUpdate as c, detectConfigManagementMode as d, backupCodexComplete as e, writeAuthFile as f, getMcpService as g, applyCodexPlatformCommand as h, runCodexFullInit as i, selectMcpServices as j, getMcpServices as k, listCodexProviders as l, codex as m, readCodexConfig as r, switchCodexProvider as s, writeCodexConfig as w };
@@ -5,7 +5,7 @@ import ansis from 'ansis';
5
5
  import dayjs from 'dayjs';
6
6
  import { join } from 'pathe';
7
7
  import { SETTINGS_FILE, ClAUDE_CONFIG_FILE, CLAUDE_VSC_CONFIG_FILE } from './constants.mjs';
8
- import { S as STATUS } from '../shared/ccjk.DKL7Ki99.mjs';
8
+ import { S as STATUS } from '../shared/ccjk.DHVCT7SF.mjs';
9
9
  import './index3.mjs';
10
10
  import 'node:url';
11
11
  import 'i18next';
@@ -365,4 +365,4 @@ const config = {
365
365
  updateDefaultModel: updateDefaultModel
366
366
  };
367
367
 
368
- export { copyConfigFiles as a, backupExistingConfig as b, clearModelEnv as c, applyAiLanguageDirective as d, ensureClaudeDir as e, configureApi as f, getExistingApiConfig as g, config as h, mergeAndCleanPermissions as m, promptApiConfigurationAction as p, switchToOfficialLogin as s };
368
+ export { applyAiLanguageDirective as a, backupExistingConfig as b, clearModelEnv as c, updateDefaultModel as d, getExistingApiConfig as e, configureApi as f, getExistingModelConfig as g, copyConfigFiles as h, ensureClaudeDir as i, config as j, mergeAndCleanPermissions as m, promptApiConfigurationAction as p, switchToOfficialLogin as s, updateCustomModel as u };
@@ -7,12 +7,12 @@ import { getApiProviderPresets } from './api-providers.mjs';
7
7
  import { SETTINGS_FILE, CLAUDE_DIR } from './constants.mjs';
8
8
  import { i18n } from './index3.mjs';
9
9
  import { g as getPermissionManager } from '../shared/ccjk.pi0nsyn3.mjs';
10
- import { h as commandExists } from './platform.mjs';
10
+ import { e as commandExists } from './platform.mjs';
11
11
  import { P as ProviderHealthMonitor } from '../shared/ccjk.J8YiPsOw.mjs';
12
12
  import { platform, userInfo, homedir } from 'node:os';
13
13
  import ora from 'ora';
14
14
  import { exec } from 'tinyexec';
15
- import { S as STATUS } from '../shared/ccjk.DKL7Ki99.mjs';
15
+ import { S as STATUS } from '../shared/ccjk.DHVCT7SF.mjs';
16
16
  import { writeFileAtomic } from './fs-operations.mjs';
17
17
  import 'node:url';
18
18
  import 'i18next';
@@ -799,7 +799,7 @@ async function checkPermissionRules() {
799
799
  }
800
800
  async function fixSettingsFile() {
801
801
  const isZh = i18n.language === "zh-CN";
802
- const { copyConfigFiles } = await import('./config.mjs').then(function (n) { return n.h; });
802
+ const { copyConfigFiles } = await import('./config.mjs').then(function (n) { return n.j; });
803
803
  console.log("");
804
804
  console.log(ansis.bold.cyan("\u{1F527} Fixing settings.json"));
805
805
  console.log(ansis.dim("\u2500".repeat(50)));
@@ -3,9 +3,11 @@ import inquirer from 'inquirer';
3
3
  import { SUPPORTED_LANGS, LANG_LABELS } from './constants.mjs';
4
4
  import { ensureI18nInitialized, i18n, changeLanguage } from './index3.mjs';
5
5
  import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
6
- import { g as getExistingApiConfig, p as promptApiConfigurationAction, f as configureApi } from './config.mjs';
7
- import { m as modifyApiConfigPartially, v as validateApiKey, f as formatApiKeyDisplay } from '../shared/ccjk.BgRf-biH.mjs';
6
+ import { a as applyAiLanguageDirective, g as getExistingModelConfig, u as updateCustomModel, d as updateDefaultModel, e as getExistingApiConfig, p as promptApiConfigurationAction, f as configureApi } from './config.mjs';
7
+ import { c as configureOutputStyle, m as modifyApiConfigPartially, v as validateApiKey, f as formatApiKeyDisplay } from '../shared/ccjk.BCSUNwWl.mjs';
8
8
  import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
9
+ import { openSettingsJson, importRecommendedPermissions, importRecommendedEnv } from './simple-config.mjs';
10
+ import { p as promptBoolean } from '../shared/ccjk.DHbrGcgg.mjs';
9
11
  import 'node:os';
10
12
  import 'pathe';
11
13
  import 'node:fs';
@@ -22,7 +24,6 @@ import 'dayjs';
22
24
  import './claude-config.mjs';
23
25
  import './platform.mjs';
24
26
  import 'tinyexec';
25
- import '../shared/ccjk.DHbrGcgg.mjs';
26
27
  import 'inquirer-toggle';
27
28
 
28
29
  async function handleCancellation() {
@@ -119,6 +120,65 @@ async function handleCustomApiMode() {
119
120
  console.log(ansis.gray(` Key: ${formatApiKeyDisplay(configuredApi.key)}`));
120
121
  }
121
122
  }
123
+ async function configureDefaultModelFeature() {
124
+ ensureI18nInitialized();
125
+ const existingModel = getExistingModelConfig();
126
+ if (existingModel) {
127
+ console.log(`
128
+ ${ansis.green(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing model configuration"}`)}`);
129
+ const modelDisplay = existingModel === "default" ? i18n.t("configuration:defaultModelOption") || "Default (Let Claude Code choose)" : existingModel.charAt(0).toUpperCase() + existingModel.slice(1);
130
+ console.log(ansis.gray(` ${i18n.t("configuration:currentModel") || "Current model"}: ${modelDisplay}
131
+ `));
132
+ const modify = await promptBoolean({
133
+ message: i18n.t("configuration:modifyModel") || "Modify model configuration?",
134
+ defaultValue: false
135
+ });
136
+ if (!modify) {
137
+ console.log(ansis.green(`\u2714 ${i18n.t("configuration:keepModel") || "Keeping existing model configuration"}`));
138
+ return;
139
+ }
140
+ }
141
+ const { model } = await inquirer.prompt({
142
+ type: "list",
143
+ name: "model",
144
+ message: i18n.t("configuration:selectDefaultModel") || "Select default model",
145
+ choices: addNumbersToChoices([
146
+ {
147
+ name: i18n.t("configuration:defaultModelOption") || "Default - Let Claude Code choose",
148
+ value: "default"
149
+ },
150
+ {
151
+ name: i18n.t("configuration:opusModelOption") || "Opus - Only use opus, high token consumption, use with caution",
152
+ value: "opus"
153
+ },
154
+ {
155
+ name: i18n.t("configuration:sonnet1mModelOption") || "Sonnet 1M - 1M context version",
156
+ value: "sonnet[1m]"
157
+ },
158
+ {
159
+ name: i18n.t("configuration:customModelOption") || "Custom - Specify custom model names",
160
+ value: "custom"
161
+ }
162
+ ]),
163
+ default: existingModel ? ["default", "opus", "sonnet[1m]", "custom"].indexOf(existingModel) : 0
164
+ });
165
+ if (!model) {
166
+ await handleCancellation();
167
+ return;
168
+ }
169
+ if (model === "custom") {
170
+ const { primaryModel, haikuModel, sonnetModel, opusModel } = await promptCustomModels();
171
+ if (!primaryModel.trim() && !haikuModel.trim() && !sonnetModel.trim() && !opusModel.trim()) {
172
+ console.log(ansis.yellow(`\u26A0 ${i18n.t("configuration:customModelSkipped") || "Custom model configuration skipped"}`));
173
+ return;
174
+ }
175
+ updateCustomModel(primaryModel, haikuModel, sonnetModel, opusModel);
176
+ console.log(ansis.green(`\u2714 ${i18n.t("configuration:customModelConfigured") || "Custom model configuration completed"}`));
177
+ return;
178
+ }
179
+ updateDefaultModel(model);
180
+ console.log(ansis.green(`\u2714 ${i18n.t("configuration:modelConfigured") || "Default model configured"}`));
181
+ }
122
182
  async function promptCustomModels(defaultPrimaryModel, defaultHaikuModel, defaultSonnetModel, defaultOpusModel) {
123
183
  const { primaryModel } = await inquirer.prompt({
124
184
  type: "input",
@@ -146,6 +206,193 @@ async function promptCustomModels(defaultPrimaryModel, defaultHaikuModel, defaul
146
206
  });
147
207
  return { primaryModel, haikuModel, sonnetModel, opusModel };
148
208
  }
209
+ async function configureAiMemoryFeature() {
210
+ ensureI18nInitialized();
211
+ const isZh = i18n.language === "zh-CN";
212
+ const { option } = await inquirer.prompt({
213
+ type: "list",
214
+ name: "option",
215
+ message: isZh ? "\u9009\u62E9 AI \u8BB0\u5FC6\u7BA1\u7406\u9009\u9879" : "Select AI memory management option",
216
+ choices: addNumbersToChoices([
217
+ {
218
+ name: isZh ? "\u{1F4C4} \u67E5\u770B\u5168\u5C40 CLAUDE.md\uFF08\u7CFB\u7EDF\u63D0\u793A\uFF09" : "\u{1F4C4} View global CLAUDE.md (system prompt)",
219
+ value: "viewGlobalClaudeMd"
220
+ },
221
+ {
222
+ name: isZh ? "\u{1F4C1} \u67E5\u770B\u9879\u76EE CLAUDE.md" : "\u{1F4C1} View project CLAUDE.md",
223
+ value: "viewProjectClaudeMd"
224
+ },
225
+ {
226
+ name: isZh ? "\u{1F52C} \u67E5\u770B Postmortem\uFF08\u5386\u53F2 Bug \u7ECF\u9A8C\uFF09" : "\u{1F52C} View Postmortem (bug lessons learned)",
227
+ value: "viewPostmortem"
228
+ },
229
+ {
230
+ name: isZh ? "\u270F\uFE0F \u7F16\u8F91\u5168\u5C40 CLAUDE.md" : "\u270F\uFE0F Edit global CLAUDE.md",
231
+ value: "editGlobalClaudeMd"
232
+ },
233
+ {
234
+ name: isZh ? "\u{1F310} \u914D\u7F6E AI \u8F93\u51FA\u8BED\u8A00" : "\u{1F310} Configure AI output language",
235
+ value: "language"
236
+ },
237
+ {
238
+ name: isZh ? "\u{1F3A8} \u914D\u7F6E\u8F93\u51FA\u98CE\u683C" : "\u{1F3A8} Configure output style",
239
+ value: "outputStyle"
240
+ }
241
+ ])
242
+ });
243
+ if (!option) {
244
+ return;
245
+ }
246
+ const { readFileSync, existsSync, writeFileSync } = await import('node:fs');
247
+ const { homedir } = await import('node:os');
248
+ const { join } = await import('pathe');
249
+ const { execSync } = await import('node:child_process');
250
+ const nodeProcess = await import('node:process');
251
+ const cwd = nodeProcess.default.cwd();
252
+ const globalClaudeMdPath = join(homedir(), ".claude", "CLAUDE.md");
253
+ const projectClaudeMdPath = join(cwd, "CLAUDE.md");
254
+ const localClaudeMdPath = join(cwd, ".claude", "CLAUDE.md");
255
+ switch (option) {
256
+ case "viewGlobalClaudeMd": {
257
+ if (existsSync(globalClaudeMdPath)) {
258
+ console.log(ansis.green.bold(`
259
+ \u{1F4C4} ${isZh ? "\u5168\u5C40 CLAUDE.md \u5185\u5BB9" : "Global CLAUDE.md Content"}:`));
260
+ console.log(ansis.dim("\u2500".repeat(60)));
261
+ const content = readFileSync(globalClaudeMdPath, "utf-8");
262
+ console.log(content);
263
+ console.log(ansis.dim("\u2500".repeat(60)));
264
+ console.log(ansis.gray(`${isZh ? "\u8DEF\u5F84" : "Path"}: ${globalClaudeMdPath}`));
265
+ } else {
266
+ console.log(ansis.yellow(`
267
+ \u26A0\uFE0F ${isZh ? "\u5168\u5C40 CLAUDE.md \u4E0D\u5B58\u5728" : "Global CLAUDE.md does not exist"}`));
268
+ console.log(ansis.gray(`${isZh ? "\u9884\u671F\u8DEF\u5F84" : "Expected path"}: ${globalClaudeMdPath}`));
269
+ }
270
+ break;
271
+ }
272
+ case "viewProjectClaudeMd": {
273
+ let foundPath = null;
274
+ if (existsSync(projectClaudeMdPath)) {
275
+ foundPath = projectClaudeMdPath;
276
+ } else if (existsSync(localClaudeMdPath)) {
277
+ foundPath = localClaudeMdPath;
278
+ }
279
+ if (foundPath) {
280
+ console.log(ansis.green.bold(`
281
+ \u{1F4C1} ${isZh ? "\u9879\u76EE CLAUDE.md \u5185\u5BB9" : "Project CLAUDE.md Content"}:`));
282
+ console.log(ansis.dim("\u2500".repeat(60)));
283
+ const content = readFileSync(foundPath, "utf-8");
284
+ console.log(content);
285
+ console.log(ansis.dim("\u2500".repeat(60)));
286
+ console.log(ansis.gray(`${isZh ? "\u8DEF\u5F84" : "Path"}: ${foundPath}`));
287
+ } else {
288
+ console.log(ansis.yellow(`
289
+ \u26A0\uFE0F ${isZh ? "\u9879\u76EE CLAUDE.md \u4E0D\u5B58\u5728" : "Project CLAUDE.md does not exist"}`));
290
+ console.log(ansis.gray(`${isZh ? "\u5DF2\u68C0\u67E5\u8DEF\u5F84" : "Checked paths"}:`));
291
+ console.log(ansis.gray(` - ${projectClaudeMdPath}`));
292
+ console.log(ansis.gray(` - ${localClaudeMdPath}`));
293
+ }
294
+ break;
295
+ }
296
+ case "viewPostmortem": {
297
+ const postmortemDir = join(cwd, ".postmortem");
298
+ if (existsSync(postmortemDir)) {
299
+ console.log(ansis.green.bold(`
300
+ \u{1F52C} ${isZh ? "Postmortem \u62A5\u544A" : "Postmortem Reports"}:`));
301
+ console.log(ansis.dim("\u2500".repeat(60)));
302
+ const { readdirSync } = await import('node:fs');
303
+ const files = readdirSync(postmortemDir).filter((f) => f.endsWith(".md"));
304
+ if (files.length === 0) {
305
+ console.log(ansis.yellow(isZh ? "\u6682\u65E0 Postmortem \u62A5\u544A" : "No postmortem reports yet"));
306
+ } else {
307
+ console.log(ansis.green(`${isZh ? "\u627E\u5230" : "Found"} ${files.length} ${isZh ? "\u4E2A\u62A5\u544A" : "reports"}:
308
+ `));
309
+ const { selectedFile } = await inquirer.prompt({
310
+ type: "list",
311
+ name: "selectedFile",
312
+ message: isZh ? "\u9009\u62E9\u8981\u67E5\u770B\u7684\u62A5\u544A" : "Select a report to view",
313
+ choices: [
314
+ ...files.map((f) => ({ name: f, value: f })),
315
+ { name: isZh ? "\u8FD4\u56DE" : "Back", value: "back" }
316
+ ]
317
+ });
318
+ if (selectedFile !== "back") {
319
+ const reportPath = join(postmortemDir, selectedFile);
320
+ const content = readFileSync(reportPath, "utf-8");
321
+ console.log(ansis.dim("\u2500".repeat(60)));
322
+ console.log(content);
323
+ console.log(ansis.dim("\u2500".repeat(60)));
324
+ }
325
+ }
326
+ console.log(ansis.gray(`
327
+ ${isZh ? "\u76EE\u5F55" : "Directory"}: ${postmortemDir}`));
328
+ console.log(ansis.gray(`\u{1F4A1} ${isZh ? "\u8FD0\u884C `ccjk postmortem init` \u4ECE\u5386\u53F2 fix commits \u751F\u6210\u62A5\u544A" : "Run `ccjk postmortem init` to generate reports from fix commits"}`));
329
+ } else {
330
+ console.log(ansis.yellow(`
331
+ \u26A0\uFE0F ${isZh ? "Postmortem \u76EE\u5F55\u4E0D\u5B58\u5728" : "Postmortem directory does not exist"}`));
332
+ console.log(ansis.gray(`\u{1F4A1} ${isZh ? "\u8FD0\u884C `ccjk postmortem init` \u521D\u59CB\u5316 Postmortem \u7CFB\u7EDF" : "Run `ccjk postmortem init` to initialize the Postmortem system"}`));
333
+ }
334
+ break;
335
+ }
336
+ case "editGlobalClaudeMd": {
337
+ const editor = nodeProcess.default.env.EDITOR || nodeProcess.default.env.VISUAL || "vi";
338
+ if (!existsSync(globalClaudeMdPath)) {
339
+ const claudeDir = join(homedir(), ".claude");
340
+ const { mkdirSync } = await import('node:fs');
341
+ if (!existsSync(claudeDir)) {
342
+ mkdirSync(claudeDir, { recursive: true });
343
+ }
344
+ writeFileSync(globalClaudeMdPath, `# Claude Global Memory
345
+
346
+ <!-- Add your global instructions here -->
347
+ `);
348
+ console.log(ansis.green(`\u2705 ${isZh ? "\u5DF2\u521B\u5EFA\u5168\u5C40 CLAUDE.md" : "Created global CLAUDE.md"}`));
349
+ }
350
+ console.log(ansis.green(`
351
+ \u{1F4DD} ${isZh ? "\u6B63\u5728\u6253\u5F00\u7F16\u8F91\u5668..." : "Opening editor..."}`));
352
+ console.log(ansis.gray(`${isZh ? "\u7F16\u8F91\u5668" : "Editor"}: ${editor}`));
353
+ console.log(ansis.gray(`${isZh ? "\u6587\u4EF6" : "File"}: ${globalClaudeMdPath}`));
354
+ try {
355
+ execSync(`${editor} "${globalClaudeMdPath}"`, { stdio: "inherit" });
356
+ console.log(ansis.green(`
357
+ \u2705 ${isZh ? "\u7F16\u8F91\u5B8C\u6210" : "Edit complete"}`));
358
+ } catch {
359
+ console.log(ansis.yellow(`
360
+ \u26A0\uFE0F ${isZh ? "\u7F16\u8F91\u5668\u9000\u51FA" : "Editor exited"}`));
361
+ }
362
+ break;
363
+ }
364
+ case "language": {
365
+ const zcfConfig = readZcfConfig();
366
+ const existingLang = zcfConfig?.aiOutputLang;
367
+ if (existingLang) {
368
+ console.log(
369
+ `
370
+ ${ansis.green(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existing AI output language configuration"}`)}`
371
+ );
372
+ console.log(ansis.gray(` ${i18n.t("configuration:currentLanguage") || "Current language"}: ${existingLang}
373
+ `));
374
+ const modify = await promptBoolean({
375
+ message: i18n.t("configuration:modifyLanguage") || "Modify AI output language?",
376
+ defaultValue: false
377
+ });
378
+ if (!modify) {
379
+ console.log(ansis.green(`\u2714 ${i18n.t("configuration:keepLanguage") || "Keeping existing language configuration"}`));
380
+ return;
381
+ }
382
+ }
383
+ const { selectAiOutputLanguage } = await import('./prompts.mjs');
384
+ const aiOutputLang = await selectAiOutputLanguage();
385
+ applyAiLanguageDirective(aiOutputLang);
386
+ updateZcfConfig({ aiOutputLang });
387
+ console.log(ansis.green(`\u2714 ${i18n.t("configuration:aiLanguageConfigured") || "AI output language configured"}`));
388
+ break;
389
+ }
390
+ case "outputStyle": {
391
+ await configureOutputStyle();
392
+ break;
393
+ }
394
+ }
395
+ }
149
396
  async function changeScriptLanguageFeature(currentLang) {
150
397
  ensureI18nInitialized();
151
398
  const { lang } = await inquirer.prompt({
@@ -168,5 +415,55 @@ async function changeScriptLanguageFeature(currentLang) {
168
415
  console.log(ansis.green(`\u2714 ${i18n.t("language:languageChanged") || "Language changed"}`));
169
416
  return lang;
170
417
  }
418
+ async function configureEnvPermissionFeature() {
419
+ ensureI18nInitialized();
420
+ const { choice } = await inquirer.prompt({
421
+ type: "list",
422
+ name: "choice",
423
+ message: i18n.t("configuration:selectEnvPermissionOption") || "Select option",
424
+ choices: addNumbersToChoices([
425
+ {
426
+ name: `${i18n.t("configuration:importRecommendedEnv") || "Import environment"} ${ansis.gray(
427
+ `- ${i18n.t("configuration:importRecommendedEnvDesc") || "Import env settings"}`
428
+ )}`,
429
+ value: "env"
430
+ },
431
+ {
432
+ name: `${i18n.t("configuration:importRecommendedPermissions") || "Import permissions"} ${ansis.gray(
433
+ `- ${i18n.t("configuration:importRecommendedPermissionsDesc") || "Import permission settings"}`
434
+ )}`,
435
+ value: "permissions"
436
+ },
437
+ {
438
+ name: `${i18n.t("configuration:openSettingsJson") || "Open settings"} ${ansis.gray(
439
+ `- ${i18n.t("configuration:openSettingsJsonDesc") || "View settings file"}`
440
+ )}`,
441
+ value: "open"
442
+ }
443
+ ])
444
+ });
445
+ if (!choice) {
446
+ await handleCancellation();
447
+ return;
448
+ }
449
+ try {
450
+ switch (choice) {
451
+ case "env":
452
+ await importRecommendedEnv();
453
+ console.log(ansis.green(`\u2705 ${i18n.t("configuration:envImportSuccess")}`));
454
+ break;
455
+ case "permissions":
456
+ await importRecommendedPermissions();
457
+ console.log(ansis.green(`\u2705 ${i18n.t("configuration:permissionsImportSuccess") || "Permissions imported"}`));
458
+ break;
459
+ case "open":
460
+ console.log(ansis.green(i18n.t("configuration:openingSettingsJson") || "Opening settings.json..."));
461
+ await openSettingsJson();
462
+ break;
463
+ }
464
+ } catch (error) {
465
+ console.error(ansis.red(`${i18n.t("common:error")}: ${error.message}`));
466
+ }
467
+ }
171
468
 
172
- export { changeScriptLanguageFeature, handleCustomApiMode, promptCustomModels };
469
+ export { changeScriptLanguageFeature, configureAiMemoryFeature, configureDefaultModelFeature, configureEnvPermissionFeature, handleCustomApiMode, promptCustomModels };
@@ -3,7 +3,7 @@ import ansis from 'ansis';
3
3
  import inquirer from 'inquirer';
4
4
  import { join } from 'pathe';
5
5
  import { i18n } from './index3.mjs';
6
- import { d as displayBannerWithInfo } from '../shared/ccjk.DKL7Ki99.mjs';
6
+ import { a as displayBannerWithInfo } from '../shared/ccjk.DHVCT7SF.mjs';
7
7
  import { a as handleExitPromptError, h as handleGeneralError } from '../shared/ccjk.CiPa6kZ5.mjs';
8
8
  import { ensureDir, writeFileAtomic, exists, readJsonFile } from './fs-operations.mjs';
9
9
  import 'node:fs';