ccjk 12.0.7 → 12.0.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 (299) hide show
  1. package/package.json +1 -1
  2. package/dist/chunks/agent-teams.mjs +0 -136
  3. package/dist/chunks/agent.mjs +0 -1439
  4. package/dist/chunks/agents.mjs +0 -3778
  5. package/dist/chunks/api-cli.mjs +0 -132
  6. package/dist/chunks/api-providers.mjs +0 -129
  7. package/dist/chunks/api.mjs +0 -112
  8. package/dist/chunks/auto-bootstrap.mjs +0 -358
  9. package/dist/chunks/auto-init.mjs +0 -7584
  10. package/dist/chunks/auto-updater.mjs +0 -410
  11. package/dist/chunks/banner.mjs +0 -188
  12. package/dist/chunks/bash.mjs +0 -187
  13. package/dist/chunks/boost.mjs +0 -397
  14. package/dist/chunks/ccjk-agents.mjs +0 -414
  15. package/dist/chunks/ccjk-all.mjs +0 -1028
  16. package/dist/chunks/ccjk-config.mjs +0 -261
  17. package/dist/chunks/ccjk-hooks.mjs +0 -1074
  18. package/dist/chunks/ccjk-mcp.mjs +0 -761
  19. package/dist/chunks/ccjk-setup.mjs +0 -763
  20. package/dist/chunks/ccjk-skills.mjs +0 -514
  21. package/dist/chunks/ccr.mjs +0 -98
  22. package/dist/chunks/ccu.mjs +0 -40
  23. package/dist/chunks/check-updates.mjs +0 -108
  24. package/dist/chunks/claude-code-config-manager.mjs +0 -750
  25. package/dist/chunks/claude-code-incremental-manager.mjs +0 -623
  26. package/dist/chunks/claude-config.mjs +0 -236
  27. package/dist/chunks/claude-wrapper.mjs +0 -85
  28. package/dist/chunks/cleanup-migration.mjs +0 -20
  29. package/dist/chunks/cli-hook.mjs +0 -2285
  30. package/dist/chunks/cloud-sync.mjs +0 -29
  31. package/dist/chunks/codex-config-switch.mjs +0 -451
  32. package/dist/chunks/codex-provider-manager.mjs +0 -236
  33. package/dist/chunks/codex-uninstaller.mjs +0 -404
  34. package/dist/chunks/codex.mjs +0 -2077
  35. package/dist/chunks/commands.mjs +0 -108
  36. package/dist/chunks/commands2.mjs +0 -413
  37. package/dist/chunks/commit.mjs +0 -138
  38. package/dist/chunks/completion.mjs +0 -515
  39. package/dist/chunks/config-consolidator.mjs +0 -172
  40. package/dist/chunks/config-switch.mjs +0 -317
  41. package/dist/chunks/config.mjs +0 -379
  42. package/dist/chunks/config2.mjs +0 -477
  43. package/dist/chunks/config3.mjs +0 -470
  44. package/dist/chunks/constants.mjs +0 -133
  45. package/dist/chunks/context-loader.mjs +0 -343
  46. package/dist/chunks/context.mjs +0 -372
  47. package/dist/chunks/convoy-manager.mjs +0 -880
  48. package/dist/chunks/dashboard.mjs +0 -476
  49. package/dist/chunks/doctor.mjs +0 -964
  50. package/dist/chunks/evolution.mjs +0 -382
  51. package/dist/chunks/features.mjs +0 -698
  52. package/dist/chunks/fish.mjs +0 -181
  53. package/dist/chunks/fs-operations.mjs +0 -192
  54. package/dist/chunks/health-alerts.mjs +0 -304
  55. package/dist/chunks/health-check.mjs +0 -532
  56. package/dist/chunks/help.mjs +0 -340
  57. package/dist/chunks/hook-installer.mjs +0 -45
  58. package/dist/chunks/index.mjs +0 -24
  59. package/dist/chunks/index10.mjs +0 -1171
  60. package/dist/chunks/index11.mjs +0 -1008
  61. package/dist/chunks/index12.mjs +0 -193
  62. package/dist/chunks/index13.mjs +0 -218
  63. package/dist/chunks/index14.mjs +0 -663
  64. package/dist/chunks/index2.mjs +0 -19
  65. package/dist/chunks/index3.mjs +0 -19092
  66. package/dist/chunks/index4.mjs +0 -8
  67. package/dist/chunks/index5.mjs +0 -7600
  68. package/dist/chunks/index6.mjs +0 -171
  69. package/dist/chunks/index7.mjs +0 -3583
  70. package/dist/chunks/index8.mjs +0 -19
  71. package/dist/chunks/index9.mjs +0 -616
  72. package/dist/chunks/init.mjs +0 -1606
  73. package/dist/chunks/installer.mjs +0 -690
  74. package/dist/chunks/installer2.mjs +0 -179
  75. package/dist/chunks/interview.mjs +0 -2927
  76. package/dist/chunks/json-config.mjs +0 -60
  77. package/dist/chunks/linux.mjs +0 -3863
  78. package/dist/chunks/macos.mjs +0 -69
  79. package/dist/chunks/main.mjs +0 -635
  80. package/dist/chunks/manager.mjs +0 -1048
  81. package/dist/chunks/marketplace.mjs +0 -949
  82. package/dist/chunks/mcp-cli.mjs +0 -204
  83. package/dist/chunks/mcp-performance.mjs +0 -187
  84. package/dist/chunks/mcp.mjs +0 -1231
  85. package/dist/chunks/menu.mjs +0 -652
  86. package/dist/chunks/metrics-display.mjs +0 -153
  87. package/dist/chunks/migrator.mjs +0 -178
  88. package/dist/chunks/monitor.mjs +0 -1856
  89. package/dist/chunks/notification.mjs +0 -1864
  90. package/dist/chunks/onboarding.mjs +0 -385
  91. package/dist/chunks/package.mjs +0 -3
  92. package/dist/chunks/paradigm.mjs +0 -74
  93. package/dist/chunks/permission-manager.mjs +0 -132
  94. package/dist/chunks/permissions.mjs +0 -265
  95. package/dist/chunks/persistence-manager.mjs +0 -794
  96. package/dist/chunks/persistence.mjs +0 -667
  97. package/dist/chunks/platform.mjs +0 -391
  98. package/dist/chunks/plugin.mjs +0 -1936
  99. package/dist/chunks/powershell.mjs +0 -213
  100. package/dist/chunks/prompts.mjs +0 -241
  101. package/dist/chunks/providers.mjs +0 -260
  102. package/dist/chunks/quick-actions.mjs +0 -320
  103. package/dist/chunks/quick-provider.mjs +0 -682
  104. package/dist/chunks/quick-setup.mjs +0 -412
  105. package/dist/chunks/remote.mjs +0 -497
  106. package/dist/chunks/session.mjs +0 -878
  107. package/dist/chunks/sessions.mjs +0 -106
  108. package/dist/chunks/silent-updater.mjs +0 -396
  109. package/dist/chunks/simple-config.mjs +0 -98
  110. package/dist/chunks/skill.mjs +0 -117
  111. package/dist/chunks/skill2.mjs +0 -9003
  112. package/dist/chunks/skills-sync.mjs +0 -6460
  113. package/dist/chunks/skills.mjs +0 -567
  114. package/dist/chunks/slash-commands.mjs +0 -207
  115. package/dist/chunks/smart-defaults.mjs +0 -412
  116. package/dist/chunks/smart-guide.mjs +0 -194
  117. package/dist/chunks/startup.mjs +0 -487
  118. package/dist/chunks/stats.mjs +0 -410
  119. package/dist/chunks/status.mjs +0 -289
  120. package/dist/chunks/team.mjs +0 -63
  121. package/dist/chunks/thinking.mjs +0 -626
  122. package/dist/chunks/trace.mjs +0 -57
  123. package/dist/chunks/uninstall.mjs +0 -849
  124. package/dist/chunks/update.mjs +0 -167
  125. package/dist/chunks/upgrade-manager.mjs +0 -204
  126. package/dist/chunks/version-checker.mjs +0 -881
  127. package/dist/chunks/vim.mjs +0 -903
  128. package/dist/chunks/windows.mjs +0 -14
  129. package/dist/chunks/workflows.mjs +0 -633
  130. package/dist/chunks/wsl.mjs +0 -129
  131. package/dist/chunks/zero-config.mjs +0 -374
  132. package/dist/chunks/zsh.mjs +0 -182
  133. package/dist/cli.d.mts +0 -1
  134. package/dist/cli.d.ts +0 -1
  135. package/dist/cli.mjs +0 -2199
  136. package/dist/i18n/locales/en/agent-teams.json +0 -18
  137. package/dist/i18n/locales/en/agentBrowser.json +0 -79
  138. package/dist/i18n/locales/en/agents.json +0 -135
  139. package/dist/i18n/locales/en/api.json +0 -63
  140. package/dist/i18n/locales/en/ccjk-agents.json +0 -33
  141. package/dist/i18n/locales/en/ccjk-all.json +0 -23
  142. package/dist/i18n/locales/en/ccjk-skills.json +0 -22
  143. package/dist/i18n/locales/en/ccjk.json +0 -276
  144. package/dist/i18n/locales/en/ccr.json +0 -65
  145. package/dist/i18n/locales/en/claude-md.json +0 -73
  146. package/dist/i18n/locales/en/cli.json +0 -152
  147. package/dist/i18n/locales/en/cloud-setup.json +0 -31
  148. package/dist/i18n/locales/en/cloud-sync.json +0 -147
  149. package/dist/i18n/locales/en/cloud.json +0 -40
  150. package/dist/i18n/locales/en/cloudPlugins.json +0 -118
  151. package/dist/i18n/locales/en/codex.json +0 -127
  152. package/dist/i18n/locales/en/cometix.json +0 -29
  153. package/dist/i18n/locales/en/common.json +0 -68
  154. package/dist/i18n/locales/en/config.json +0 -108
  155. package/dist/i18n/locales/en/configuration.json +0 -226
  156. package/dist/i18n/locales/en/context.json +0 -85
  157. package/dist/i18n/locales/en/dashboard.json +0 -78
  158. package/dist/i18n/locales/en/errors.json +0 -26
  159. package/dist/i18n/locales/en/evolution.json +0 -54
  160. package/dist/i18n/locales/en/hooks.json +0 -74
  161. package/dist/i18n/locales/en/hooksSync.json +0 -133
  162. package/dist/i18n/locales/en/installation.json +0 -83
  163. package/dist/i18n/locales/en/interview.json +0 -104
  164. package/dist/i18n/locales/en/language.json +0 -19
  165. package/dist/i18n/locales/en/lsp.json +0 -78
  166. package/dist/i18n/locales/en/marketplace.json +0 -116
  167. package/dist/i18n/locales/en/mcp.json +0 -178
  168. package/dist/i18n/locales/en/memory.json +0 -92
  169. package/dist/i18n/locales/en/menu.json +0 -143
  170. package/dist/i18n/locales/en/multi-config.json +0 -79
  171. package/dist/i18n/locales/en/notification.json +0 -307
  172. package/dist/i18n/locales/en/permissions.json +0 -95
  173. package/dist/i18n/locales/en/persistence.json +0 -127
  174. package/dist/i18n/locales/en/plugins.json +0 -146
  175. package/dist/i18n/locales/en/quick-actions.json +0 -78
  176. package/dist/i18n/locales/en/registry.json +0 -54
  177. package/dist/i18n/locales/en/remote.json +0 -93
  178. package/dist/i18n/locales/en/sandbox.json +0 -44
  179. package/dist/i18n/locales/en/setup.json +0 -44
  180. package/dist/i18n/locales/en/shencha.json +0 -14
  181. package/dist/i18n/locales/en/skills.json +0 -100
  182. package/dist/i18n/locales/en/skillsSync.json +0 -74
  183. package/dist/i18n/locales/en/smartGuide.json +0 -49
  184. package/dist/i18n/locales/en/stats.json +0 -20
  185. package/dist/i18n/locales/en/subagent.json +0 -69
  186. package/dist/i18n/locales/en/superpowers.json +0 -117
  187. package/dist/i18n/locales/en/team.json +0 -7
  188. package/dist/i18n/locales/en/thinking.json +0 -65
  189. package/dist/i18n/locales/en/tools.json +0 -42
  190. package/dist/i18n/locales/en/uninstall.json +0 -56
  191. package/dist/i18n/locales/en/updater.json +0 -29
  192. package/dist/i18n/locales/en/vim.json +0 -169
  193. package/dist/i18n/locales/en/workflow.json +0 -55
  194. package/dist/i18n/locales/en/workspace.json +0 -108
  195. package/dist/i18n/locales/zh-CN/agent-teams.json +0 -18
  196. package/dist/i18n/locales/zh-CN/agentBrowser.json +0 -79
  197. package/dist/i18n/locales/zh-CN/agents.json +0 -135
  198. package/dist/i18n/locales/zh-CN/api.json +0 -63
  199. package/dist/i18n/locales/zh-CN/ccjk-agents.json +0 -33
  200. package/dist/i18n/locales/zh-CN/ccjk-all.json +0 -23
  201. package/dist/i18n/locales/zh-CN/ccjk-skills.json +0 -22
  202. package/dist/i18n/locales/zh-CN/ccjk.json +0 -276
  203. package/dist/i18n/locales/zh-CN/ccr.json +0 -65
  204. package/dist/i18n/locales/zh-CN/claude-md.json +0 -73
  205. package/dist/i18n/locales/zh-CN/cli.json +0 -152
  206. package/dist/i18n/locales/zh-CN/cloud-setup.json +0 -31
  207. package/dist/i18n/locales/zh-CN/cloud-sync.json +0 -147
  208. package/dist/i18n/locales/zh-CN/cloud.json +0 -40
  209. package/dist/i18n/locales/zh-CN/cloudPlugins.json +0 -118
  210. package/dist/i18n/locales/zh-CN/codex.json +0 -127
  211. package/dist/i18n/locales/zh-CN/cometix.json +0 -29
  212. package/dist/i18n/locales/zh-CN/common.json +0 -68
  213. package/dist/i18n/locales/zh-CN/config.json +0 -108
  214. package/dist/i18n/locales/zh-CN/configuration.json +0 -224
  215. package/dist/i18n/locales/zh-CN/context.json +0 -85
  216. package/dist/i18n/locales/zh-CN/dashboard.json +0 -78
  217. package/dist/i18n/locales/zh-CN/errors.json +0 -26
  218. package/dist/i18n/locales/zh-CN/evolution.json +0 -54
  219. package/dist/i18n/locales/zh-CN/hooks.json +0 -74
  220. package/dist/i18n/locales/zh-CN/hooksSync.json +0 -133
  221. package/dist/i18n/locales/zh-CN/installation.json +0 -83
  222. package/dist/i18n/locales/zh-CN/interview.json +0 -104
  223. package/dist/i18n/locales/zh-CN/language.json +0 -19
  224. package/dist/i18n/locales/zh-CN/lsp.json +0 -78
  225. package/dist/i18n/locales/zh-CN/marketplace.json +0 -116
  226. package/dist/i18n/locales/zh-CN/mcp.json +0 -178
  227. package/dist/i18n/locales/zh-CN/memory.json +0 -92
  228. package/dist/i18n/locales/zh-CN/menu.json +0 -143
  229. package/dist/i18n/locales/zh-CN/multi-config.json +0 -79
  230. package/dist/i18n/locales/zh-CN/notification.json +0 -307
  231. package/dist/i18n/locales/zh-CN/permissions.json +0 -95
  232. package/dist/i18n/locales/zh-CN/persistence.json +0 -127
  233. package/dist/i18n/locales/zh-CN/plugins.json +0 -146
  234. package/dist/i18n/locales/zh-CN/quick-actions.json +0 -78
  235. package/dist/i18n/locales/zh-CN/registry.json +0 -54
  236. package/dist/i18n/locales/zh-CN/remote.json +0 -93
  237. package/dist/i18n/locales/zh-CN/sandbox.json +0 -44
  238. package/dist/i18n/locales/zh-CN/setup.json +0 -44
  239. package/dist/i18n/locales/zh-CN/shencha.json +0 -14
  240. package/dist/i18n/locales/zh-CN/skills.json +0 -100
  241. package/dist/i18n/locales/zh-CN/skillsSync.json +0 -74
  242. package/dist/i18n/locales/zh-CN/smartGuide.json +0 -49
  243. package/dist/i18n/locales/zh-CN/stats.json +0 -20
  244. package/dist/i18n/locales/zh-CN/subagent.json +0 -69
  245. package/dist/i18n/locales/zh-CN/superpowers.json +0 -117
  246. package/dist/i18n/locales/zh-CN/team.json +0 -7
  247. package/dist/i18n/locales/zh-CN/thinking.json +0 -65
  248. package/dist/i18n/locales/zh-CN/tools.json +0 -42
  249. package/dist/i18n/locales/zh-CN/uninstall.json +0 -56
  250. package/dist/i18n/locales/zh-CN/updater.json +0 -29
  251. package/dist/i18n/locales/zh-CN/vim.json +0 -169
  252. package/dist/i18n/locales/zh-CN/workflow.json +0 -55
  253. package/dist/i18n/locales/zh-CN/workspace.json +0 -108
  254. package/dist/index.d.mts +0 -5295
  255. package/dist/index.d.ts +0 -5295
  256. package/dist/index.mjs +0 -4941
  257. package/dist/shared/ccjk.B364Fu0N.mjs +0 -1819
  258. package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
  259. package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
  260. package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
  261. package/dist/shared/ccjk.BFxsJM0k.mjs +0 -599
  262. package/dist/shared/ccjk.BIxuVL3_.mjs +0 -25
  263. package/dist/shared/ccjk.BRZ9ww8S.mjs +0 -142
  264. package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
  265. package/dist/shared/ccjk.BrPUmTqm.mjs +0 -266
  266. package/dist/shared/ccjk.BtB1e5jm.mjs +0 -171
  267. package/dist/shared/ccjk.BwfbSKN2.mjs +0 -1051
  268. package/dist/shared/ccjk.BxSmJ8B7.mjs +0 -243
  269. package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
  270. package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
  271. package/dist/shared/ccjk.CL4Yat0G.mjs +0 -303
  272. package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
  273. package/dist/shared/ccjk.CePkJq2S.mjs +0 -223
  274. package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
  275. package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
  276. package/dist/shared/ccjk.Cjj8SVrn.mjs +0 -54
  277. package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
  278. package/dist/shared/ccjk.D5MFQT7w.mjs +0 -400
  279. package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
  280. package/dist/shared/ccjk.D8ZLYSZZ.mjs +0 -299
  281. package/dist/shared/ccjk.DG_o24cZ.mjs +0 -88
  282. package/dist/shared/ccjk.DLLw-h4Y.mjs +0 -460
  283. package/dist/shared/ccjk.DOwtZMk8.mjs +0 -4019
  284. package/dist/shared/ccjk.DS7UESmF.mjs +0 -2451
  285. package/dist/shared/ccjk.DTdjs-qK.mjs +0 -1447
  286. package/dist/shared/ccjk.DXRAZcix.mjs +0 -66
  287. package/dist/shared/ccjk.DsYaCCx4.mjs +0 -317
  288. package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
  289. package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
  290. package/dist/shared/ccjk.RyizuzOI.mjs +0 -21
  291. package/dist/shared/ccjk.SPoXMvZD.mjs +0 -1242
  292. package/dist/shared/ccjk.T_cX87dY.mjs +0 -15
  293. package/dist/shared/ccjk.UIvifqNE.mjs +0 -1486
  294. package/dist/shared/ccjk._dESH4Rk.mjs +0 -111
  295. package/dist/shared/ccjk.bQ7Dh1g4.mjs +0 -249
  296. package/dist/shared/ccjk.c-ETfBZ_.mjs +0 -617
  297. package/dist/shared/ccjk.gDEDGD_t.mjs +0 -38
  298. package/dist/shared/ccjk.hoqrwWdN.mjs +0 -333
  299. package/dist/shared/ccjk.waa2ikKJ.mjs +0 -351
@@ -1,698 +0,0 @@
1
- import a from './index2.mjs';
2
- import { i as inquirer } from './index3.mjs';
3
- import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'node:fs';
4
- import { homedir } from 'node:os';
5
- import process__default from 'node:process';
6
- import { d as selectMcpServices, g as getMcpServices } from './codex.mjs';
7
- import { SUPPORTED_LANGS, LANG_LABELS } from './constants.mjs';
8
- import { ensureI18nInitialized, i18n, changeLanguage } from './index5.mjs';
9
- import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
10
- import { setupCcrConfiguration } from './config2.mjs';
11
- import { a as isCcrInstalled, b as installCcr } from './init.mjs';
12
- import { r as readMcpConfig, f as fixWindowsMcpConfig, w as writeMcpConfig, b as backupMcpConfig, a as buildMcpServerConfig, m as mergeMcpServers } from './claude-config.mjs';
13
- import { a as applyAiLanguageDirective, g as getExistingModelConfig, u as updateCustomModel, d as updateDefaultModel, e as getExistingApiConfig, p as promptApiConfigurationAction, f as configureApi, s as switchToOfficialLogin } from './config.mjs';
14
- import { c as configureOutputStyle, a as modifyApiConfigPartially, v as validateApiKey, f as formatApiKeyDisplay } from '../shared/ccjk.BwfbSKN2.mjs';
15
- import { i as isWindows } from './platform.mjs';
16
- import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
17
- import { openSettingsJson, importRecommendedPermissions, importRecommendedEnv } from './simple-config.mjs';
18
- import { p as promptBoolean } from '../shared/ccjk.DOwtZMk8.mjs';
19
- import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
20
- import '../shared/ccjk.BAGoDD49.mjs';
21
- import 'node:readline';
22
- import 'stream';
23
- import 'node:tty';
24
- import 'node:async_hooks';
25
- import '../shared/ccjk.Cjgrln_h.mjs';
26
- import 'node:util';
27
- import 'tty';
28
- import 'fs';
29
- import 'child_process';
30
- import 'node:path';
31
- import 'node:crypto';
32
- import 'buffer';
33
- import 'string_decoder';
34
- import 'node:url';
35
- import '../shared/ccjk.RyizuzOI.mjs';
36
- import './index7.mjs';
37
- import '../shared/ccjk.CxpGa6MC.mjs';
38
- import '../shared/ccjk.BBtCGd_g.mjs';
39
- import './main.mjs';
40
- import 'module';
41
- import 'node:child_process';
42
- import 'node:stream';
43
- import './fs-operations.mjs';
44
- import 'node:fs/promises';
45
- import './json-config.mjs';
46
- import './prompts.mjs';
47
- import '../shared/ccjk.gDEDGD_t.mjs';
48
- import './index6.mjs';
49
- import './banner.mjs';
50
- import './auto-updater.mjs';
51
- import './version-checker.mjs';
52
- import '../shared/ccjk.Cjj8SVrn.mjs';
53
- import './smart-defaults.mjs';
54
- import '../shared/ccjk.BrPUmTqm.mjs';
55
- import '../shared/ccjk.BIxuVL3_.mjs';
56
- import './installer.mjs';
57
- import '../shared/ccjk._dESH4Rk.mjs';
58
- import '../shared/ccjk.DXRAZcix.mjs';
59
-
60
- async function handleCancellation() {
61
- ensureI18nInitialized();
62
- console.log(a.yellow(i18n.t("common:cancelled")));
63
- }
64
- async function handleOfficialLoginMode() {
65
- ensureI18nInitialized();
66
- const success = switchToOfficialLogin();
67
- if (success) {
68
- console.log(a.green(`\u2714 ${i18n.t("api:officialLoginConfigured")}`));
69
- } else {
70
- console.log(a.red(i18n.t("api:officialLoginFailed")));
71
- }
72
- }
73
- async function handleCustomApiMode() {
74
- ensureI18nInitialized();
75
- const zcfConfig = readZcfConfig();
76
- const codeToolType = zcfConfig?.codeToolType || "claude-code";
77
- if (codeToolType === "claude-code") {
78
- const { configureIncrementalManagement } = await import('./claude-code-incremental-manager.mjs');
79
- await configureIncrementalManagement();
80
- return;
81
- }
82
- const existingConfig = getExistingApiConfig();
83
- if (existingConfig) {
84
- const configAction = await promptApiConfigurationAction();
85
- if (configAction === "keep-existing") {
86
- console.log(a.green(`\u2714 ${i18n.t("api:keepExistingConfig")}`));
87
- return;
88
- } else if (configAction === "modify-partial") {
89
- await modifyApiConfigPartially(existingConfig);
90
- return;
91
- }
92
- }
93
- const { apiChoice } = await inquirer.prompt({
94
- type: "list",
95
- name: "apiChoice",
96
- message: i18n.t("api:configureApi"),
97
- choices: addNumbersToChoices([
98
- {
99
- name: `${i18n.t("api:useAuthToken")} - ${a.gray(i18n.t("api:authTokenDesc"))}`,
100
- value: "auth_token",
101
- short: i18n.t("api:useAuthToken")
102
- },
103
- {
104
- name: `${i18n.t("api:useApiKey")} - ${a.gray(i18n.t("api:apiKeyDesc"))}`,
105
- value: "api_key",
106
- short: i18n.t("api:useApiKey")
107
- },
108
- { name: i18n.t("api:skipApi"), value: "skip" }
109
- ])
110
- });
111
- if (!apiChoice || apiChoice === "skip") {
112
- await handleCancellation();
113
- return;
114
- }
115
- const { url } = await inquirer.prompt({
116
- type: "input",
117
- name: "url",
118
- message: `${i18n.t("api:enterApiUrl")}${i18n.t("common:emptyToSkip")}`,
119
- validate: (value) => {
120
- if (!value) {
121
- return true;
122
- }
123
- try {
124
- void new URL(value);
125
- return true;
126
- } catch {
127
- return i18n.t("api:invalidUrl");
128
- }
129
- }
130
- });
131
- if (url === void 0 || !url) {
132
- await handleCancellation();
133
- return;
134
- }
135
- const keyMessage = apiChoice === "auth_token" ? `${i18n.t("api:enterAuthToken")}${i18n.t("common:emptyToSkip")}` : `${i18n.t("api:enterApiKey")}${i18n.t("common:emptyToSkip")}`;
136
- const { key } = await inquirer.prompt({
137
- type: "input",
138
- name: "key",
139
- message: keyMessage,
140
- validate: (value) => {
141
- if (!value) {
142
- return true;
143
- }
144
- const validation = validateApiKey(value);
145
- if (!validation.isValid) {
146
- return validation.error || i18n.t("api:invalidKeyFormat");
147
- }
148
- return true;
149
- }
150
- });
151
- if (key === void 0 || !key) {
152
- await handleCancellation();
153
- return;
154
- }
155
- const apiConfig = { url, key, authType: apiChoice };
156
- const configuredApi = configureApi(apiConfig);
157
- if (configuredApi) {
158
- console.log(a.green(`\u2714 ${i18n.t("api:apiConfigSuccess")}`));
159
- console.log(a.gray(` URL: ${configuredApi.url}`));
160
- console.log(a.gray(` Key: ${formatApiKeyDisplay(configuredApi.key)}`));
161
- }
162
- }
163
- async function handleCcrProxyMode() {
164
- ensureI18nInitialized();
165
- const ccrStatus = await isCcrInstalled();
166
- if (!ccrStatus.hasCorrectPackage) {
167
- await installCcr();
168
- } else {
169
- console.log(a.green(`\u2714 ${i18n.t("ccr:ccrAlreadyInstalled")}`));
170
- }
171
- const ccrConfigured = await setupCcrConfiguration();
172
- if (ccrConfigured) {
173
- console.log(a.green(`\u2714 ${i18n.t("ccr:ccrSetupComplete")}`));
174
- }
175
- }
176
- async function handleSwitchConfigMode() {
177
- ensureI18nInitialized();
178
- const { configSwitchCommand } = await import('./config-switch.mjs');
179
- await configSwitchCommand({ codeType: "claude-code" });
180
- }
181
- async function configureApiFeature() {
182
- ensureI18nInitialized();
183
- const { mode } = await inquirer.prompt({
184
- type: "list",
185
- name: "mode",
186
- message: i18n.t("api:apiModePrompt"),
187
- choices: addNumbersToChoices([
188
- { name: i18n.t("api:apiModeOfficial"), value: "official" },
189
- { name: i18n.t("api:apiModeCustom"), value: "custom" },
190
- { name: i18n.t("api:apiModeCcr"), value: "ccr" },
191
- { name: i18n.t("api:apiModeSwitch"), value: "switch" },
192
- { name: i18n.t("api:apiModeSkip"), value: "skip" }
193
- ])
194
- });
195
- if (!mode || mode === "skip") {
196
- await handleCancellation();
197
- return;
198
- }
199
- switch (mode) {
200
- case "official":
201
- await handleOfficialLoginMode();
202
- break;
203
- case "custom":
204
- await handleCustomApiMode();
205
- break;
206
- case "ccr":
207
- await handleCcrProxyMode();
208
- break;
209
- case "switch":
210
- await handleSwitchConfigMode();
211
- break;
212
- default:
213
- await handleCancellation();
214
- break;
215
- }
216
- }
217
- async function configureMcpFeature() {
218
- ensureI18nInitialized();
219
- if (isWindows()) {
220
- const fixWindows = await promptBoolean({
221
- message: i18n.t("configuration:fixWindowsMcp") || "Fix Windows MCP configuration?",
222
- defaultValue: true
223
- });
224
- if (fixWindows) {
225
- const existingConfig = readMcpConfig() || { mcpServers: {} };
226
- const fixedConfig = fixWindowsMcpConfig(existingConfig);
227
- writeMcpConfig(fixedConfig);
228
- console.log(a.green(`\u2714 ${i18n.t("configuration:windowsMcpConfigFixed")}`));
229
- }
230
- }
231
- const selectedServices = await selectMcpServices();
232
- if (!selectedServices) {
233
- return;
234
- }
235
- if (selectedServices.length > 0) {
236
- const mcpBackupPath = backupMcpConfig();
237
- if (mcpBackupPath) {
238
- console.log(a.gray(`\u2714 ${i18n.t("mcp:mcpBackupSuccess")}: ${mcpBackupPath}`));
239
- }
240
- const newServers = {};
241
- for (const serviceId of selectedServices) {
242
- const service = (await getMcpServices()).find((s) => s.id === serviceId);
243
- if (!service)
244
- continue;
245
- let config = service.config;
246
- if (service.requiresApiKey) {
247
- const { apiKey } = await inquirer.prompt({
248
- type: "input",
249
- name: "apiKey",
250
- message: service.apiKeyPrompt,
251
- validate: async (value) => !!value || i18n.t("api:keyRequired")
252
- });
253
- if (apiKey) {
254
- config = buildMcpServerConfig(service.config, apiKey, service.apiKeyPlaceholder, service.apiKeyEnvVar);
255
- } else {
256
- continue;
257
- }
258
- }
259
- newServers[service.id] = config;
260
- }
261
- const existingConfig = readMcpConfig();
262
- let mergedConfig = mergeMcpServers(existingConfig, newServers);
263
- mergedConfig = fixWindowsMcpConfig(mergedConfig);
264
- writeMcpConfig(mergedConfig);
265
- console.log(a.green(`\u2714 ${i18n.t("mcp:mcpConfigSuccess")}`));
266
- }
267
- }
268
- async function configureDefaultModelFeature() {
269
- ensureI18nInitialized();
270
- const existingModel = getExistingModelConfig();
271
- if (existingModel) {
272
- console.log(`
273
- ${a.green(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing model configuration"}`)}`);
274
- const modelDisplay = existingModel === "default" ? i18n.t("configuration:defaultModelOption") || "Default (Let Claude Code choose)" : existingModel.charAt(0).toUpperCase() + existingModel.slice(1);
275
- console.log(a.gray(` ${i18n.t("configuration:currentModel") || "Current model"}: ${modelDisplay}
276
- `));
277
- const modify = await promptBoolean({
278
- message: i18n.t("configuration:modifyModel") || "Modify model configuration?",
279
- defaultValue: false
280
- });
281
- if (!modify) {
282
- console.log(a.green(`\u2714 ${i18n.t("configuration:keepModel") || "Keeping existing model configuration"}`));
283
- return;
284
- }
285
- }
286
- const { model } = await inquirer.prompt({
287
- type: "list",
288
- name: "model",
289
- message: i18n.t("configuration:selectDefaultModel") || "Select default model",
290
- choices: addNumbersToChoices([
291
- {
292
- name: i18n.t("configuration:defaultModelOption") || "Default - Let Claude Code choose",
293
- value: "default"
294
- },
295
- {
296
- name: i18n.t("configuration:opusModelOption") || "Opus - Only use opus, high token consumption, use with caution",
297
- value: "opus"
298
- },
299
- {
300
- name: i18n.t("configuration:sonnet1mModelOption") || "Sonnet 1M - 1M context version",
301
- value: "sonnet[1m]"
302
- },
303
- {
304
- name: i18n.t("configuration:customModelOption") || "Custom - Specify custom model names",
305
- value: "custom"
306
- }
307
- ]),
308
- default: existingModel ? ["default", "opus", "sonnet[1m]", "custom"].indexOf(existingModel) : 0
309
- });
310
- if (!model) {
311
- await handleCancellation();
312
- return;
313
- }
314
- if (model === "custom") {
315
- const { primaryModel, haikuModel, sonnetModel, opusModel } = await promptCustomModels();
316
- if (!primaryModel.trim() && !haikuModel.trim() && !sonnetModel.trim() && !opusModel.trim()) {
317
- console.log(a.yellow(`\u26A0 ${i18n.t("configuration:customModelSkipped") || "Custom model configuration skipped"}`));
318
- return;
319
- }
320
- updateCustomModel(primaryModel, haikuModel, sonnetModel, opusModel);
321
- console.log(a.green(`\u2714 ${i18n.t("configuration:customModelConfigured") || "Custom model configuration completed"}`));
322
- return;
323
- }
324
- updateDefaultModel(model);
325
- console.log(a.green(`\u2714 ${i18n.t("configuration:modelConfigured") || "Default model configured"}`));
326
- }
327
- async function promptCustomModels(defaultPrimaryModel, defaultHaikuModel, defaultSonnetModel, defaultOpusModel) {
328
- const { primaryModel } = await inquirer.prompt({
329
- type: "input",
330
- name: "primaryModel",
331
- message: `${i18n.t("configuration:enterPrimaryModel")}${i18n.t("common:emptyToSkip")}`,
332
- default: defaultPrimaryModel || ""
333
- });
334
- const { haikuModel } = await inquirer.prompt({
335
- type: "input",
336
- name: "haikuModel",
337
- message: `${i18n.t("configuration:enterHaikuModel")}${i18n.t("common:emptyToSkip")}`,
338
- default: defaultHaikuModel || ""
339
- });
340
- const { sonnetModel } = await inquirer.prompt({
341
- type: "input",
342
- name: "sonnetModel",
343
- message: `${i18n.t("configuration:enterSonnetModel")}${i18n.t("common:emptyToSkip")}`,
344
- default: defaultSonnetModel || ""
345
- });
346
- const { opusModel } = await inquirer.prompt({
347
- type: "input",
348
- name: "opusModel",
349
- message: `${i18n.t("configuration:enterOpusModel")}${i18n.t("common:emptyToSkip")}`,
350
- default: defaultOpusModel || ""
351
- });
352
- return { primaryModel, haikuModel, sonnetModel, opusModel };
353
- }
354
- async function configureAiMemoryFeature() {
355
- ensureI18nInitialized();
356
- const isZh = i18n.language === "zh-CN";
357
- const { option } = await inquirer.prompt({
358
- type: "list",
359
- name: "option",
360
- message: isZh ? "\u9009\u62E9 AI \u8BB0\u5FC6\u7BA1\u7406\u9009\u9879" : "Select AI memory management option",
361
- choices: addNumbersToChoices([
362
- {
363
- name: isZh ? "\u{1F4C4} \u67E5\u770B\u5168\u5C40 CLAUDE.md\uFF08\u7CFB\u7EDF\u63D0\u793A\uFF09" : "\u{1F4C4} View global CLAUDE.md (system prompt)",
364
- value: "viewGlobalClaudeMd"
365
- },
366
- {
367
- name: isZh ? "\u{1F4C1} \u67E5\u770B\u9879\u76EE CLAUDE.md" : "\u{1F4C1} View project CLAUDE.md",
368
- value: "viewProjectClaudeMd"
369
- },
370
- {
371
- name: isZh ? "\u{1F52C} \u67E5\u770B Postmortem\uFF08\u5386\u53F2 Bug \u7ECF\u9A8C\uFF09" : "\u{1F52C} View Postmortem (bug lessons learned)",
372
- value: "viewPostmortem"
373
- },
374
- {
375
- name: isZh ? "\u270F\uFE0F \u7F16\u8F91\u5168\u5C40 CLAUDE.md" : "\u270F\uFE0F Edit global CLAUDE.md",
376
- value: "editGlobalClaudeMd"
377
- },
378
- {
379
- name: isZh ? "\u{1F310} \u914D\u7F6E AI \u8F93\u51FA\u8BED\u8A00" : "\u{1F310} Configure AI output language",
380
- value: "language"
381
- },
382
- {
383
- name: isZh ? "\u{1F3A8} \u914D\u7F6E\u8F93\u51FA\u98CE\u683C" : "\u{1F3A8} Configure output style",
384
- value: "outputStyle"
385
- }
386
- ])
387
- });
388
- if (!option) {
389
- return;
390
- }
391
- const cwd = process__default.cwd();
392
- const globalClaudeMdPath = join(homedir(), ".claude", "CLAUDE.md");
393
- const projectClaudeMdPath = join(cwd, "CLAUDE.md");
394
- const localClaudeMdPath = join(cwd, ".claude", "CLAUDE.md");
395
- switch (option) {
396
- case "viewGlobalClaudeMd": {
397
- if (existsSync(globalClaudeMdPath)) {
398
- console.log(a.green.bold(`
399
- \u{1F4C4} ${isZh ? "\u5168\u5C40 CLAUDE.md \u5185\u5BB9" : "Global CLAUDE.md Content"}:`));
400
- console.log(a.dim("\u2500".repeat(60)));
401
- const content = readFileSync(globalClaudeMdPath, "utf-8");
402
- console.log(content);
403
- console.log(a.dim("\u2500".repeat(60)));
404
- console.log(a.gray(`${isZh ? "\u8DEF\u5F84" : "Path"}: ${globalClaudeMdPath}`));
405
- } else {
406
- console.log(a.yellow(`
407
- \u26A0\uFE0F ${isZh ? "\u5168\u5C40 CLAUDE.md \u4E0D\u5B58\u5728" : "Global CLAUDE.md does not exist"}`));
408
- console.log(a.gray(`${isZh ? "\u9884\u671F\u8DEF\u5F84" : "Expected path"}: ${globalClaudeMdPath}`));
409
- }
410
- break;
411
- }
412
- case "viewProjectClaudeMd": {
413
- let foundPath = null;
414
- if (existsSync(projectClaudeMdPath)) {
415
- foundPath = projectClaudeMdPath;
416
- } else if (existsSync(localClaudeMdPath)) {
417
- foundPath = localClaudeMdPath;
418
- }
419
- if (foundPath) {
420
- console.log(a.green.bold(`
421
- \u{1F4C1} ${isZh ? "\u9879\u76EE CLAUDE.md \u5185\u5BB9" : "Project CLAUDE.md Content"}:`));
422
- console.log(a.dim("\u2500".repeat(60)));
423
- const content = readFileSync(foundPath, "utf-8");
424
- console.log(content);
425
- console.log(a.dim("\u2500".repeat(60)));
426
- console.log(a.gray(`${isZh ? "\u8DEF\u5F84" : "Path"}: ${foundPath}`));
427
- } else {
428
- console.log(a.yellow(`
429
- \u26A0\uFE0F ${isZh ? "\u9879\u76EE CLAUDE.md \u4E0D\u5B58\u5728" : "Project CLAUDE.md does not exist"}`));
430
- console.log(a.gray(`${isZh ? "\u5DF2\u68C0\u67E5\u8DEF\u5F84" : "Checked paths"}:`));
431
- console.log(a.gray(` - ${projectClaudeMdPath}`));
432
- console.log(a.gray(` - ${localClaudeMdPath}`));
433
- }
434
- break;
435
- }
436
- case "viewPostmortem": {
437
- const postmortemDir = join(cwd, ".postmortem");
438
- if (existsSync(postmortemDir)) {
439
- console.log(a.green.bold(`
440
- \u{1F52C} ${isZh ? "Postmortem \u62A5\u544A" : "Postmortem Reports"}:`));
441
- console.log(a.dim("\u2500".repeat(60)));
442
- const { readdirSync } = await import('node:fs');
443
- const files = readdirSync(postmortemDir).filter((f) => f.endsWith(".md"));
444
- if (files.length === 0) {
445
- console.log(a.yellow(isZh ? "\u6682\u65E0 Postmortem \u62A5\u544A" : "No postmortem reports yet"));
446
- } else {
447
- console.log(a.green(`${isZh ? "\u627E\u5230" : "Found"} ${files.length} ${isZh ? "\u4E2A\u62A5\u544A" : "reports"}:
448
- `));
449
- const { selectedFile } = await inquirer.prompt({
450
- type: "list",
451
- name: "selectedFile",
452
- message: isZh ? "\u9009\u62E9\u8981\u67E5\u770B\u7684\u62A5\u544A" : "Select a report to view",
453
- choices: [
454
- ...files.map((f) => ({ name: f, value: f })),
455
- { name: isZh ? "\u8FD4\u56DE" : "Back", value: "back" }
456
- ]
457
- });
458
- if (selectedFile !== "back") {
459
- const reportPath = join(postmortemDir, selectedFile);
460
- const content = readFileSync(reportPath, "utf-8");
461
- console.log(a.dim("\u2500".repeat(60)));
462
- console.log(content);
463
- console.log(a.dim("\u2500".repeat(60)));
464
- }
465
- }
466
- console.log(a.gray(`
467
- ${isZh ? "\u76EE\u5F55" : "Directory"}: ${postmortemDir}`));
468
- console.log(a.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"}`));
469
- } else {
470
- console.log(a.yellow(`
471
- \u26A0\uFE0F ${isZh ? "Postmortem \u76EE\u5F55\u4E0D\u5B58\u5728" : "Postmortem directory does not exist"}`));
472
- console.log(a.gray(`\u{1F4A1} ${isZh ? "\u8FD0\u884C `ccjk postmortem init` \u521D\u59CB\u5316 Postmortem \u7CFB\u7EDF" : "Run `ccjk postmortem init` to initialize the Postmortem system"}`));
473
- }
474
- break;
475
- }
476
- case "editGlobalClaudeMd": {
477
- const editor = process__default.env.EDITOR || process__default.env.VISUAL || "vi";
478
- if (!existsSync(globalClaudeMdPath)) {
479
- const claudeDir = join(homedir(), ".claude");
480
- if (!existsSync(claudeDir)) {
481
- mkdirSync(claudeDir, { recursive: true });
482
- }
483
- writeFileSync(globalClaudeMdPath, `# Claude Global Memory
484
-
485
- <!-- Add your global instructions here -->
486
- `);
487
- console.log(a.green(`\u2705 ${isZh ? "\u5DF2\u521B\u5EFA\u5168\u5C40 CLAUDE.md" : "Created global CLAUDE.md"}`));
488
- }
489
- console.log(a.green(`
490
- \u{1F4DD} ${isZh ? "\u6B63\u5728\u6253\u5F00\u7F16\u8F91\u5668..." : "Opening editor..."}`));
491
- console.log(a.gray(`${isZh ? "\u7F16\u8F91\u5668" : "Editor"}: ${editor}`));
492
- console.log(a.gray(`${isZh ? "\u6587\u4EF6" : "File"}: ${globalClaudeMdPath}`));
493
- try {
494
- const { execSync } = await import('node:child_process');
495
- execSync(`${editor} "${globalClaudeMdPath}"`, { stdio: "inherit" });
496
- console.log(a.green(`
497
- \u2705 ${isZh ? "\u7F16\u8F91\u5B8C\u6210" : "Edit complete"}`));
498
- } catch {
499
- console.log(a.yellow(`
500
- \u26A0\uFE0F ${isZh ? "\u7F16\u8F91\u5668\u9000\u51FA" : "Editor exited"}`));
501
- }
502
- break;
503
- }
504
- case "language": {
505
- const zcfConfig = readZcfConfig();
506
- const existingLang = zcfConfig?.aiOutputLang;
507
- if (existingLang) {
508
- console.log(
509
- `
510
- ${a.green(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existing AI output language configuration"}`)}`
511
- );
512
- console.log(a.gray(` ${i18n.t("configuration:currentLanguage") || "Current language"}: ${existingLang}
513
- `));
514
- const modify = await promptBoolean({
515
- message: i18n.t("configuration:modifyLanguage") || "Modify AI output language?",
516
- defaultValue: false
517
- });
518
- if (!modify) {
519
- console.log(a.green(`\u2714 ${i18n.t("configuration:keepLanguage") || "Keeping existing language configuration"}`));
520
- return;
521
- }
522
- }
523
- const { selectAiOutputLanguage } = await import('./prompts.mjs');
524
- const aiOutputLang = await selectAiOutputLanguage();
525
- applyAiLanguageDirective(aiOutputLang);
526
- updateZcfConfig({ aiOutputLang });
527
- console.log(a.green(`\u2714 ${i18n.t("configuration:aiLanguageConfigured") || "AI output language configured"}`));
528
- break;
529
- }
530
- case "outputStyle": {
531
- await configureOutputStyle();
532
- break;
533
- }
534
- }
535
- }
536
- async function changeScriptLanguageFeature(currentLang) {
537
- ensureI18nInitialized();
538
- const { lang } = await inquirer.prompt({
539
- type: "list",
540
- name: "lang",
541
- message: i18n.t("language:selectScriptLang"),
542
- choices: addNumbersToChoices(
543
- SUPPORTED_LANGS.map((l) => ({
544
- name: LANG_LABELS[l],
545
- value: l
546
- }))
547
- ),
548
- default: SUPPORTED_LANGS.indexOf(currentLang)
549
- });
550
- if (!lang) {
551
- return currentLang;
552
- }
553
- updateZcfConfig({ preferredLang: lang });
554
- await changeLanguage(lang);
555
- console.log(a.green(`\u2714 ${i18n.t("language:languageChanged") || "Language changed"}`));
556
- return lang;
557
- }
558
- async function mcpManagerFeature() {
559
- ensureI18nInitialized();
560
- const isZh = i18n.language === "zh-CN";
561
- const { choice } = await inquirer.prompt({
562
- type: "list",
563
- name: "choice",
564
- message: isZh ? "\u{1F527} MCP \u7BA1\u7406 \u2014 \u9009\u62E9\u64CD\u4F5C:" : "\u{1F527} MCP Manager \u2014 Select action:",
565
- choices: addNumbersToChoices([
566
- {
567
- name: isZh ? `\u{1F4CA} \u67E5\u770B MCP \u72B6\u6001 ${a.gray("- \u5DF2\u5B89\u88C5\u670D\u52A1\u603B\u89C8 + \u6027\u80FD\u9884\u8B66")}` : `\u{1F4CA} MCP Status ${a.gray("- Installed services overview + performance warning")}`,
568
- value: "status"
569
- },
570
- {
571
- name: isZh ? `\u{1FA7A} MCP \u8BCA\u65AD ${a.gray("- \u5065\u5EB7\u68C0\u67E5\u3001\u51B2\u7A81\u68C0\u6D4B\u3001\u4F18\u5316\u5EFA\u8BAE")}` : `\u{1FA7A} MCP Doctor ${a.gray("- Health check, conflict detection, optimization tips")}`,
572
- value: "doctor"
573
- },
574
- {
575
- name: isZh ? `\u{1F4CB} \u5217\u51FA\u5DF2\u5B89\u88C5\u670D\u52A1 ${a.gray("- \u67E5\u770B\u5DF2\u914D\u7F6E\u7684 MCP \u670D\u52A1\u8BE6\u60C5")}` : `\u{1F4CB} List installed services ${a.gray("- View details of configured MCP services")}`,
576
- value: "list"
577
- },
578
- {
579
- name: isZh ? `\u{1F504} \u5207\u6362\u914D\u7F6E\u9884\u8BBE ${a.gray("- minimal\uFF08\u8F7B\u91CF\uFF09/ dev\uFF08\u5F00\u53D1\uFF09/ full\uFF08\u5B8C\u6574\uFF09")}` : `\u{1F504} Switch profile ${a.gray("- minimal / dev / full preset")}`,
580
- value: "profile"
581
- },
582
- {
583
- name: isZh ? `\u{1F5D1}\uFE0F \u91CA\u653E\u95F2\u7F6E\u670D\u52A1 ${a.gray("- \u505C\u7528\u957F\u671F\u672A\u4F7F\u7528\u7684\u670D\u52A1\u4EE5\u8282\u7701\u8D44\u6E90")}` : `\u{1F5D1}\uFE0F Release idle services ${a.gray("- Disable unused services to free resources")}`,
584
- value: "release"
585
- },
586
- {
587
- name: isZh ? `\u{1F4E6} \u5B89\u88C5/\u66F4\u65B0 MCP \u670D\u52A1 ${a.gray("- \u8FDB\u5165\u670D\u52A1\u9009\u62E9\u5411\u5BFC\uFF08\u540C\u83DC\u5355\u9009\u9879 4\uFF09")}` : `\u{1F4E6} Install / Update services ${a.gray("- Open install wizard (same as menu option 4)")}`,
588
- value: "install"
589
- }
590
- ])
591
- });
592
- if (!choice) {
593
- await handleCancellation();
594
- return;
595
- }
596
- try {
597
- switch (choice) {
598
- case "status": {
599
- const { mcpStatus } = await import('./mcp.mjs');
600
- await mcpStatus();
601
- break;
602
- }
603
- case "doctor": {
604
- const { mcpDoctor } = await import('./mcp.mjs');
605
- await mcpDoctor();
606
- break;
607
- }
608
- case "list": {
609
- const { mcpList } = await import('./mcp.mjs');
610
- await mcpList();
611
- break;
612
- }
613
- case "profile": {
614
- const { listProfiles, useProfile } = await import('./mcp.mjs');
615
- await listProfiles();
616
- const { profileId } = await inquirer.prompt({
617
- type: "list",
618
- name: "profileId",
619
- message: isZh ? "\u9009\u62E9\u8981\u5207\u6362\u7684\u9884\u8BBE:" : "Select profile to switch:",
620
- choices: [
621
- { name: isZh ? "minimal \u2014 \u4EC5\u6838\u5FC3\u670D\u52A1\uFF08\u6700\u4F4E\u8D44\u6E90\u5360\u7528\uFF09" : "minimal \u2014 Core services only (least resources)", value: "minimal" },
622
- { name: isZh ? "dev \u2014 \u5F00\u53D1\u5E38\u7528\u670D\u52A1\u5957\u88C5" : "dev \u2014 Dev-oriented service bundle", value: "dev" },
623
- { name: isZh ? "full \u2014 \u5B8C\u6574\u670D\u52A1\uFF08\u9AD8\u6027\u80FD\u673A\u5668\u63A8\u8350\uFF09" : "full \u2014 Full services (high-end machines)", value: "full" }
624
- ]
625
- });
626
- await useProfile(profileId);
627
- break;
628
- }
629
- case "release": {
630
- const { mcpRelease } = await import('./mcp.mjs');
631
- await mcpRelease();
632
- break;
633
- }
634
- case "install": {
635
- await configureMcpFeature();
636
- break;
637
- }
638
- }
639
- } catch (error) {
640
- console.error(a.red(`${i18n.t("common:error")}: ${error.message}`));
641
- }
642
- }
643
- async function configureMergedPermissionsFeature() {
644
- ensureI18nInitialized();
645
- const isZh = i18n.language === "zh-CN";
646
- const { choice } = await inquirer.prompt({
647
- type: "list",
648
- name: "choice",
649
- message: isZh ? "\u6743\u9650 & \u73AF\u5883\u914D\u7F6E \u2014 \u9009\u62E9\u64CD\u4F5C:" : "Permissions & Env Setup \u2014 Select action:",
650
- choices: addNumbersToChoices([
651
- {
652
- 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")}`,
653
- value: "env"
654
- },
655
- {
656
- 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")}`,
657
- value: "permissions"
658
- },
659
- {
660
- 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")}`,
661
- value: "preset"
662
- },
663
- {
664
- 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")}`,
665
- value: "open"
666
- }
667
- ])
668
- });
669
- if (!choice) {
670
- await handleCancellation();
671
- return;
672
- }
673
- try {
674
- switch (choice) {
675
- case "env":
676
- await importRecommendedEnv();
677
- console.log(a.green(`\u2705 ${i18n.t("configuration:envImportSuccess")}`));
678
- break;
679
- case "permissions":
680
- await importRecommendedPermissions();
681
- console.log(a.green(`\u2705 ${i18n.t("configuration:permissionsImportSuccess") || "Permissions imported"}`));
682
- break;
683
- case "preset": {
684
- const { zeroConfig } = await import('./zero-config.mjs');
685
- await zeroConfig();
686
- break;
687
- }
688
- case "open":
689
- console.log(a.green(i18n.t("configuration:openingSettingsJson") || "Opening settings.json..."));
690
- await openSettingsJson();
691
- break;
692
- }
693
- } catch (error) {
694
- console.error(a.red(`${i18n.t("common:error")}: ${error.message}`));
695
- }
696
- }
697
-
698
- export { changeScriptLanguageFeature, configureAiMemoryFeature, configureApiFeature, configureDefaultModelFeature, configureMcpFeature, configureMergedPermissionsFeature, handleCustomApiMode, mcpManagerFeature, promptCustomModels };