ccjk 14.1.2 → 14.1.5

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 (75) 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 +78 -1
  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 +121 -53
  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/configuration.json +5 -3
  50. package/dist/i18n/locales/en/language.json +1 -1
  51. package/dist/i18n/locales/en/menu.json +8 -7
  52. package/dist/i18n/locales/en/multi-config.json +1 -1
  53. package/dist/i18n/locales/zh-CN/configuration.json +5 -3
  54. package/dist/i18n/locales/zh-CN/language.json +1 -1
  55. package/dist/i18n/locales/zh-CN/menu.json +8 -7
  56. package/dist/i18n/locales/zh-CN/multi-config.json +1 -1
  57. package/dist/index.d.mts +13 -11
  58. package/dist/index.d.ts +13 -11
  59. package/dist/index.mjs +7 -7
  60. package/dist/shared/{ccjk.B6VCKdyy.mjs → ccjk.BXTrU9TN.mjs} +31 -68
  61. package/dist/shared/{ccjk.DScm_NnL.mjs → ccjk.Ccrqt7u2.mjs} +30 -1
  62. package/dist/shared/{ccjk.CVjfbEIj.mjs → ccjk.DZtwozOG.mjs} +1 -1
  63. package/dist/shared/{ccjk.D6wx-rxT.mjs → ccjk.Dxgd2vjc.mjs} +3 -3
  64. package/dist/shared/{ccjk.BO45TPXJ.mjs → ccjk.K8c6VnM2.mjs} +2 -2
  65. package/dist/shared/{ccjk.BJENIVf7.mjs → ccjk.MpkxXQJL.mjs} +179 -19
  66. package/dist/shared/{ccjk.Dh6Be-ef.mjs → ccjk.ygJzcD-n.mjs} +28 -24
  67. package/package.json +1 -30
  68. package/dist/chunks/auto-fix.mjs +0 -253
  69. package/dist/chunks/auto-init.mjs +0 -311
  70. package/dist/chunks/auto-upgrade.mjs +0 -152
  71. package/dist/chunks/migrator.mjs +0 -178
  72. package/dist/shared/ccjk.DDq2hqA5.mjs +0 -158
  73. package/dist/shared/ccjk.KPLeMP-o.mjs +0 -79
  74. package/templates/common/workflow/essential/en/agents/planner.md +0 -116
  75. package/templates/common/workflow/essential/zh-CN/agents/planner.md +0 -116
@@ -6,10 +6,10 @@ import { promisify } from 'node:util';
6
6
  import a from './index5.mjs';
7
7
  import { d as dayjs } from '../shared/ccjk.RyizuzOI.mjs';
8
8
  import { i as inquirer } from './index6.mjs';
9
- import { SETTINGS_FILE } from './constants.mjs';
10
9
  import { ensureI18nInitialized, i18n } from './index2.mjs';
11
- import { l as setPrimaryApiKey, n as addCompletedOnboarding, b as backupExistingConfig } from './config.mjs';
10
+ import { n as clearLegacyTopLevelRuntimeSettings, o as setPrimaryApiKey, q as addCompletedOnboarding, b as backupExistingConfig } from './config.mjs';
12
11
  import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
12
+ import { r as resolveClaudeFamilySettingsTarget } from '../shared/ccjk.Ccrqt7u2.mjs';
13
13
  import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
14
14
  import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
15
15
  import '../shared/ccjk.BAGoDD49.mjs';
@@ -26,16 +26,16 @@ import 'node:crypto';
26
26
  import 'buffer';
27
27
  import 'string_decoder';
28
28
  import 'node:url';
29
+ import './constants.mjs';
30
+ import './ccjk-config.mjs';
31
+ import '../shared/ccjk.BBtCGd_g.mjs';
32
+ import './index3.mjs';
33
+ import './fs-operations.mjs';
34
+ import 'node:fs/promises';
29
35
  import './platform.mjs';
30
36
  import './main.mjs';
31
37
  import 'module';
32
38
  import 'node:stream';
33
- import './fs-operations.mjs';
34
- import 'node:fs/promises';
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
  import '../shared/ccjk.DeWpAShp.mjs';
40
40
 
41
41
  const PROVIDER_PRESETS_URL = "https://pub-0dc3e1677e894f07bbea11b17a29e032.r2.dev/providers.json";
@@ -223,20 +223,22 @@ function writeCcrConfig(config) {
223
223
  ensureCcrConfigDir();
224
224
  writeJsonConfig(CCR_CONFIG_FILE, config);
225
225
  }
226
- async function configureCcrProxy(ccrConfig) {
227
- const settings = readJsonConfig(SETTINGS_FILE) || {};
226
+ async function configureCcrProxy(ccrConfig, codeTool) {
227
+ const target = resolveClaudeFamilySettingsTarget(codeTool);
228
+ const settings = readJsonConfig(target.settingsFile) || {};
228
229
  const host = ccrConfig.HOST || "127.0.0.1";
229
230
  const port = ccrConfig.PORT || 3456;
230
231
  const apiKey = ccrConfig.APIKEY || "sk-ccjk-x-ccr";
231
232
  if (!settings.env) {
232
233
  settings.env = {};
233
234
  }
235
+ clearLegacyTopLevelRuntimeSettings(settings);
234
236
  delete settings.env.ANTHROPIC_AUTH_TOKEN;
235
237
  settings.env.ANTHROPIC_BASE_URL = `http://${host}:${port}`;
236
238
  settings.env.ANTHROPIC_API_KEY = apiKey;
237
- writeJsonConfig(SETTINGS_FILE, settings);
239
+ writeJsonConfig(target.settingsFile, settings);
238
240
  try {
239
- setPrimaryApiKey();
241
+ setPrimaryApiKey(target.codeTool);
240
242
  } catch (error) {
241
243
  ensureI18nInitialized();
242
244
  console.error(i18n.t("mcp:primaryApiKeySetFailed"), error);
@@ -394,7 +396,7 @@ function createDefaultCcrConfig() {
394
396
  // Empty router configuration - user configures in UI
395
397
  };
396
398
  }
397
- async function setupCcrConfiguration() {
399
+ async function setupCcrConfiguration(codeTool) {
398
400
  ensureI18nInitialized();
399
401
  try {
400
402
  const existingConfig = readCcrConfig();
@@ -415,11 +417,11 @@ async function setupCcrConfiguration() {
415
417
  }
416
418
  if (!shouldBackupAndReconfigure) {
417
419
  console.log(a.yellow(`${i18n.t("ccr:keepingExistingConfig")}`));
418
- await configureCcrProxy(existingConfig);
420
+ await configureCcrProxy(existingConfig, codeTool);
419
421
  try {
420
- const { manageApiKeyApproval } = await import('./config.mjs').then(function (n) { return n.F; });
422
+ const { manageApiKeyApproval } = await import('./config.mjs').then(function (n) { return n.H; });
421
423
  const apiKey = existingConfig.APIKEY || "sk-ccjk-x-ccr";
422
- manageApiKeyApproval(apiKey);
424
+ manageApiKeyApproval(apiKey, resolveClaudeFamilySettingsTarget(codeTool).codeTool);
423
425
  console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
424
426
  } catch (error) {
425
427
  console.error(a.red(`${i18n.t("ccr:apiKeyApprovalFailed")}:`), error);
@@ -441,19 +443,19 @@ async function setupCcrConfiguration() {
441
443
  }
442
444
  writeCcrConfig(config);
443
445
  console.log(a.green(`\u2714 ${i18n.t("ccr:ccrConfigSuccess")}`));
444
- await configureCcrProxy(config);
446
+ await configureCcrProxy(config, codeTool);
445
447
  console.log(a.green(`\u2714 ${i18n.t("ccr:proxyConfigSuccess")}`));
446
448
  await restartAndCheckCcrStatus();
447
449
  await showConfigurationTips(config.APIKEY);
448
450
  try {
449
- addCompletedOnboarding();
451
+ addCompletedOnboarding(resolveClaudeFamilySettingsTarget(codeTool).codeTool);
450
452
  } catch (error) {
451
453
  console.error(a.red(i18n.t("errors:failedToSetOnboarding")), error);
452
454
  }
453
455
  try {
454
- const { manageApiKeyApproval } = await import('./config.mjs').then(function (n) { return n.F; });
456
+ const { manageApiKeyApproval } = await import('./config.mjs').then(function (n) { return n.H; });
455
457
  const apiKey = config.APIKEY || "sk-ccjk-x-ccr";
456
- manageApiKeyApproval(apiKey);
458
+ manageApiKeyApproval(apiKey, resolveClaudeFamilySettingsTarget(codeTool).codeTool);
457
459
  console.log(a.green(`\u2714 ${i18n.t("ccr:apiKeyApprovalSuccess")}`));
458
460
  } catch (error) {
459
461
  console.error(a.red(`${i18n.t("ccr:apiKeyApprovalFailed")}:`), error);
@@ -21,21 +21,21 @@ import 'node:os';
21
21
  import 'node:crypto';
22
22
  import 'buffer';
23
23
  import 'string_decoder';
24
- import 'node:url';
25
24
  import '../shared/ccjk.bQ7Dh1g4.mjs';
25
+ import 'node:url';
26
26
  import '../shared/ccjk.RyizuzOI.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 getConfig(key, options = {}) {
41
41
  const isZh = i18n.language === "zh-CN";
@@ -11,6 +11,10 @@ join(CLAUDE_DIR, "CLAUDE.md");
11
11
  const CLAUDE_AGENTS_DIR = join(CLAUDE_DIR, "agents");
12
12
  const ClAUDE_CONFIG_FILE = join(homedir(), ".claude.json");
13
13
  const CLAUDE_VSC_CONFIG_FILE = join(CLAUDE_DIR, "config.json");
14
+ const CLAVUE_DIR = join(homedir(), ".clavue");
15
+ const CLAVUE_SETTINGS_FILE = join(CLAVUE_DIR, "settings.json");
16
+ const CLAVUE_CONFIG_FILE = join(CLAVUE_DIR, ".clavue.json");
17
+ const CLAVUE_CREDENTIALS_FILE = join(CLAVUE_DIR, ".credentials.json");
14
18
  const CODEX_DIR = join(homedir(), ".codex");
15
19
  const CODEX_CONFIG_FILE = join(CODEX_DIR, "config.toml");
16
20
  const CODEX_AUTH_FILE = join(CODEX_DIR, "auth.json");
@@ -79,12 +83,12 @@ const LEGACY_ZCF_CONFIG_FILES = [
79
83
  ];
80
84
  const ZCF_CONFIG_DIR = CCJK_CONFIG_DIR;
81
85
  const ZCF_CONFIG_FILE = CCJK_CONFIG_FILE;
82
- const CODE_TOOL_TYPES = ["claude-code", "myclaude", "codex", "aider", "continue", "cline", "cursor"];
83
- const DEFAULT_CODE_TOOL_TYPE = "myclaude";
84
- const CLAUDE_FAMILY_CODE_TOOL_TYPES = ["claude-code", "myclaude"];
86
+ const CODE_TOOL_TYPES = ["claude-code", "clavue", "codex", "aider", "continue", "cline", "cursor"];
87
+ const DEFAULT_CODE_TOOL_TYPE = "clavue";
88
+ const CLAUDE_FAMILY_CODE_TOOL_TYPES = ["claude-code", "clavue"];
85
89
  const CODE_TOOL_BANNERS = {
86
90
  "claude-code": "for Claude Code",
87
- "myclaude": "for myclaude",
91
+ "clavue": "for Clavue",
88
92
  "codex": "for Codex",
89
93
  "aider": "for Aider",
90
94
  "continue": "for Continue",
@@ -93,8 +97,11 @@ const CODE_TOOL_BANNERS = {
93
97
  };
94
98
  const CODE_TOOL_ALIASES = {
95
99
  cc: "claude-code",
96
- mc: "myclaude",
97
- mycode: "myclaude",
100
+ clavue: "clavue",
101
+ cv: "clavue",
102
+ mc: "clavue",
103
+ myclaude: "clavue",
104
+ mycode: "clavue",
98
105
  cx: "codex",
99
106
  ad: "aider",
100
107
  ct: "continue",
@@ -156,14 +163,14 @@ const CODE_TOOL_INFO = {
156
163
  ],
157
164
  managesProviderProfiles: false
158
165
  },
159
- "myclaude": {
160
- name: "myclaude",
161
- description: "Provider-first Claude-family coding CLI",
162
- website: "https://github.com/mycode699/myclaude-code",
163
- installCmd: "npm install -g myclaude-code && myclaude install --force",
166
+ "clavue": {
167
+ name: "Clavue",
168
+ description: "Execution-first AI coding CLI with provider profiles",
169
+ website: "https://www.clavue.com",
170
+ installCmd: "npm install -g clavue && clavue install --force",
164
171
  configFormat: "json",
165
172
  category: "cli",
166
- runtimeCommand: "myclaude",
173
+ runtimeCommand: "clavue",
167
174
  configBackend: "claude-family",
168
175
  nativeSlashCommands: [
169
176
  "/help",
@@ -309,4 +316,4 @@ function getAiOutputLanguageLabel(lang) {
309
316
  return lang;
310
317
  }
311
318
 
312
- export { AIDER_DIR, AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, CCJK_CLOUD_API_URL, CCJK_CLOUD_PLUGINS_CACHE_DIR, CCJK_CLOUD_PLUGINS_DIR, CCJK_CLOUD_PLUGINS_INSTALLED_DIR, CCJK_CONFIG_DIR, CCJK_CONFIG_FILE, CCJK_PLUGINS_DIR, CCJK_SKILLS_DIR, CLAUDE_AGENTS_DIR, CLAUDE_DIR, CLAUDE_FAMILY_CODE_TOOL_TYPES, CLAUDE_VSC_CONFIG_FILE, CLINE_DIR, CLOUD_ENDPOINTS, CODEX_AGENTS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_PROMPTS_DIR, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_INFO, CODE_TOOL_TYPES, CONTINUE_DIR, CURSOR_DIR, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_ZCF_CONFIG_DIR, LEGACY_ZCF_CONFIG_FILE, LEGACY_ZCF_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, ZCF_CONFIG_DIR, ZCF_CONFIG_FILE, getAiOutputLanguageLabel, getCloudApiUrl, getCloudBaseUrl, getCodeToolNativeSlashCommands, getCodeToolRuntimeCommand, isClaudeFamilyCodeTool, isCodeToolType, resolveCodeToolType };
319
+ export { AIDER_DIR, AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, CCJK_CLOUD_API_URL, CCJK_CLOUD_PLUGINS_CACHE_DIR, CCJK_CLOUD_PLUGINS_DIR, CCJK_CLOUD_PLUGINS_INSTALLED_DIR, CCJK_CONFIG_DIR, CCJK_CONFIG_FILE, CCJK_PLUGINS_DIR, CCJK_SKILLS_DIR, CLAUDE_AGENTS_DIR, CLAUDE_DIR, CLAUDE_FAMILY_CODE_TOOL_TYPES, CLAUDE_VSC_CONFIG_FILE, CLAVUE_CONFIG_FILE, CLAVUE_CREDENTIALS_FILE, CLAVUE_DIR, CLAVUE_SETTINGS_FILE, CLINE_DIR, CLOUD_ENDPOINTS, CODEX_AGENTS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_PROMPTS_DIR, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_INFO, CODE_TOOL_TYPES, CONTINUE_DIR, CURSOR_DIR, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_ZCF_CONFIG_DIR, LEGACY_ZCF_CONFIG_FILE, LEGACY_ZCF_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, ZCF_CONFIG_DIR, ZCF_CONFIG_FILE, getAiOutputLanguageLabel, getCloudApiUrl, getCloudBaseUrl, getCodeToolNativeSlashCommands, getCodeToolRuntimeCommand, isClaudeFamilyCodeTool, isCodeToolType, resolveCodeToolType };
@@ -814,7 +814,7 @@ async function checkPermissionRules() {
814
814
  }
815
815
  async function fixSettingsFile() {
816
816
  const isZh = i18n.language === "zh-CN";
817
- const { copyConfigFiles } = await import('./config.mjs').then(function (n) { return n.D; });
817
+ const { copyConfigFiles } = await import('./config.mjs').then(function (n) { return n.F; });
818
818
  console.log("");
819
819
  console.log(a.bold.cyan("\u{1F527} Fixing settings.json"));
820
820
  console.log(a.dim("\u2500".repeat(50)));
@@ -8,10 +8,11 @@ import { SUPPORTED_LANGS, LANG_LABELS } from './constants.mjs';
8
8
  import { ensureI18nInitialized, i18n, changeLanguage } from './index2.mjs';
9
9
  import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
10
10
  import { g as getExistingModelConfig, a as getExistingCustomModelConfig, u as updateCustomModel, c as updateDefaultModel, r as readMcpConfig, f as fixWindowsMcpConfig, w as writeMcpConfig, d as backupMcpConfig, e as buildMcpServerConfig, m as mergeMcpServers, h as getExistingApiConfig, p as promptApiConfigurationAction, i as configureApi } from './config.mjs';
11
- import { c as configureOutputStyle, m as modifyApiConfigPartially, v as validateApiKey, f as formatApiKeyDisplay } from '../shared/ccjk.Dh6Be-ef.mjs';
11
+ import { c as configureOutputStyle, m as modifyApiConfigPartially, v as validateApiKey, f as formatApiKeyDisplay } from '../shared/ccjk.ygJzcD-n.mjs';
12
12
  import { s as selectMcpServices } from '../shared/ccjk.BI-hdI7P.mjs';
13
13
  import { i as isWindows } from './platform.mjs';
14
14
  import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
15
+ import { openSettingsJson, importRecommendedPermissions, importRecommendedEnv } from './simple-config.mjs';
15
16
  import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
16
17
  import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
17
18
  import '../shared/ccjk.BAGoDD49.mjs';
@@ -36,7 +37,7 @@ import './fs-operations.mjs';
36
37
  import 'node:fs/promises';
37
38
  import './json-config.mjs';
38
39
  import '../shared/ccjk.RyizuzOI.mjs';
39
- import '../shared/ccjk.DScm_NnL.mjs';
40
+ import '../shared/ccjk.Ccrqt7u2.mjs';
40
41
  import './main.mjs';
41
42
  import 'module';
42
43
  import 'node:stream';
@@ -106,7 +107,7 @@ async function handleCustomApiMode() {
106
107
  ensureI18nInitialized();
107
108
  const zcfConfig = readZcfConfig();
108
109
  const codeToolType = zcfConfig?.codeToolType || "claude-code";
109
- if (codeToolType === "claude-code" || codeToolType === "myclaude") {
110
+ if (codeToolType === "claude-code" || codeToolType === "clavue") {
110
111
  const { configureIncrementalManagement } = await import('./claude-code-incremental-manager.mjs');
111
112
  await configureIncrementalManagement();
112
113
  return;
@@ -511,6 +512,60 @@ async function ensureLanguageDirectiveInAgents(aiOutputLang) {
511
512
  async function updateCodexLanguageDirective(aiOutputLang) {
512
513
  return setCodexLanguageDirective(aiOutputLang, "update");
513
514
  }
515
+ async function configureMergedPermissionsFeature() {
516
+ ensureI18nInitialized();
517
+ const isZh = i18n.language === "zh-CN";
518
+ const { choice } = await inquirer.prompt({
519
+ type: "list",
520
+ name: "choice",
521
+ message: isZh ? "\u6743\u9650 & \u73AF\u5883\u914D\u7F6E \u2014 \u9009\u62E9\u64CD\u4F5C:" : "Permissions & Env Setup \u2014 Select action:",
522
+ choices: addNumbersToChoices([
523
+ {
524
+ name: isZh ? `\u5BFC\u5165\u63A8\u8350\u73AF\u5883\u53D8\u91CF ${a.gray("- \u5199\u5165\u9690\u79C1\u4FDD\u62A4 env \u5230 settings.json")}` : `Import recommended env vars ${a.gray("- Write privacy env to settings.json")}`,
525
+ value: "env"
526
+ },
527
+ {
528
+ name: isZh ? `\u5BFC\u5165\u63A8\u8350\u6743\u9650\u914D\u7F6E ${a.gray("- \u8FFD\u52A0\u63A8\u8350 allow \u89C4\u5219\u5230 settings.json")}` : `Import recommended permissions ${a.gray("- Append recommended allow rules")}`,
529
+ value: "permissions"
530
+ },
531
+ {
532
+ name: isZh ? `\u4E00\u952E\u6743\u9650\u9884\u8BBE ${a.gray("- \u6700\u5927(max) / \u5F00\u53D1\u8005(dev) / \u5B89\u5168(safe) \u9884\u8BBE")}` : `Zero-config permission preset ${a.gray("- max / dev / safe preset")}`,
533
+ value: "preset"
534
+ },
535
+ {
536
+ name: isZh ? `\u6253\u5F00 settings.json ${a.gray("- \u5728\u7F16\u8F91\u5668\u4E2D\u67E5\u770B\u5F53\u524D\u914D\u7F6E")}` : `Open settings.json ${a.gray("- View current config in editor")}`,
537
+ value: "open"
538
+ }
539
+ ])
540
+ });
541
+ if (!choice) {
542
+ await handleCancellation();
543
+ return;
544
+ }
545
+ try {
546
+ switch (choice) {
547
+ case "env":
548
+ await importRecommendedEnv();
549
+ console.log(a.green(`\u2705 ${i18n.t("configuration:envImportSuccess")}`));
550
+ break;
551
+ case "permissions":
552
+ await importRecommendedPermissions();
553
+ console.log(a.green(`\u2705 ${i18n.t("configuration:permissionsImportSuccess") || "Permissions imported"}`));
554
+ break;
555
+ case "preset": {
556
+ const { zeroConfig } = await import('./zero-config.mjs');
557
+ await zeroConfig();
558
+ break;
559
+ }
560
+ case "open":
561
+ console.log(a.green(i18n.t("configuration:openingSettingsJson") || "Opening settings.json..."));
562
+ await openSettingsJson();
563
+ break;
564
+ }
565
+ } catch (error) {
566
+ console.error(a.red(`${i18n.t("common:error")}: ${error.message}`));
567
+ }
568
+ }
514
569
  async function configureMemoryFeature() {
515
570
  ensureI18nInitialized();
516
571
  const isZh = i18n.language === "zh-CN";
@@ -640,4 +695,4 @@ ${ansis2.bold(i18n.t("memory:memoryContent"))}`);
640
695
  }
641
696
  }
642
697
 
643
- export { CODEX_MODEL_CHOICES, DEFAULT_MODEL_CHOICES, changeScriptLanguageFeature, configureCodexAiMemoryFeature, configureCodexDefaultModelFeature, configureDefaultModelFeature, configureMcpFeature, configureMemoryFeature, formatCodexModelLabel, handleCustomApiMode, promptCustomModels };
698
+ export { CODEX_MODEL_CHOICES, DEFAULT_MODEL_CHOICES, changeScriptLanguageFeature, configureCodexAiMemoryFeature, configureCodexDefaultModelFeature, configureDefaultModelFeature, configureMcpFeature, configureMemoryFeature, configureMergedPermissionsFeature, formatCodexModelLabel, handleCustomApiMode, promptCustomModels };
@@ -1,5 +1,5 @@
1
1
  import { randomBytes } from 'node:crypto';
2
- import { existsSync, mkdirSync, readFileSync, writeFileSync, renameSync, unlinkSync, copyFileSync, readdirSync, statSync } from 'node:fs';
2
+ import { existsSync, mkdirSync, writeFileSync, renameSync, unlinkSync, readdirSync, statSync, copyFileSync, readFileSync } from 'node:fs';
3
3
  import { mkdir, writeFile as writeFile$1, rename, unlink } from 'node:fs/promises';
4
4
  import { d as dirname, j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
5
5
 
@@ -106,18 +106,6 @@ function readJsonFile(path) {
106
106
  );
107
107
  }
108
108
  }
109
- function writeJsonFile(path, data, pretty = true) {
110
- try {
111
- const content = pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data);
112
- writeFile(path, content, "utf-8");
113
- } catch (error) {
114
- throw new FileSystemError(
115
- `Failed to write JSON file: ${path}`,
116
- path,
117
- error
118
- );
119
- }
120
- }
121
109
  function copyFile(src, dest) {
122
110
  try {
123
111
  ensureFileDir(dest);
@@ -189,4 +177,4 @@ function copyDir(src, dest, options = {}) {
189
177
  }
190
178
  }
191
179
 
192
- export { FileSystemError, copyDir, copyFile, ensureDir, ensureFileDir, exists, getStatsSafe, readDir, readFile, readJsonFile, removeFile, writeFile, writeFileAtomic, writeFileAtomicAsync, writeJsonFile };
180
+ export { FileSystemError, copyDir, copyFile, ensureDir, ensureFileDir, exists, getStatsSafe, readDir, readFile, readJsonFile, removeFile, writeFile, writeFileAtomic, writeFileAtomicAsync };
@@ -1,4 +1,4 @@
1
- export { r as runHealthCheck } from '../shared/ccjk.D6wx-rxT.mjs';
1
+ export { r as runHealthCheck } from '../shared/ccjk.Dxgd2vjc.mjs';
2
2
  import 'node:fs';
3
3
  import './constants.mjs';
4
4
  import 'node:os';