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,652 +0,0 @@
1
- import a from './index2.mjs';
2
- import { i as inquirer } from './index3.mjs';
3
- import { existsSync } from 'node:fs';
4
- import process__default from 'node:process';
5
- import { M as MCP_SERVICE_CONFIGS } from './codex.mjs';
6
- import { CODE_TOOL_BANNERS, CLAUDE_DIR, isCodeToolType, DEFAULT_CODE_TOOL_TYPE } from './constants.mjs';
7
- import { ensureI18nInitialized, i18n } from './index5.mjs';
8
- import { displayBannerWithInfo } from './banner.mjs';
9
- import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
10
- import { r as readMcpConfig } from './claude-config.mjs';
11
- import { r as resolveCodeType } from '../shared/ccjk.Cjj8SVrn.mjs';
12
- import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.BIxuVL3_.mjs';
13
- import { changeScriptLanguageFeature, mcpManagerFeature, configureMergedPermissionsFeature, configureAiMemoryFeature, configureDefaultModelFeature, configureMcpFeature, configureApiFeature } from './features.mjs';
14
- import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
15
- import { p as promptBoolean } from '../shared/ccjk.DOwtZMk8.mjs';
16
- import { homedir } from 'node:os';
17
- import { runCcrStop, runCcrStart, runCcrRestart, runCcrStatus, runCcrUi } from './commands.mjs';
18
- import { readCcrConfig, configureCcrFeature } from './config2.mjs';
19
- import { a as isCcrInstalled, b as installCcr, i as init } from './init.mjs';
20
- import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
21
- import { ccjkAgents } from './ccjk-agents.mjs';
22
- import { ccjkSkills } from './ccjk-skills.mjs';
23
- import { checkUpdates } from './check-updates.mjs';
24
- import { doctor } from './doctor.mjs';
25
- import { uninstall } from './uninstall.mjs';
26
- import { update } from './update.mjs';
27
-
28
- const FULLWIDTH_TO_HALFWIDTH = {
29
- // Full-width numbers (Japanese/Chinese IME)
30
- "\uFF10": "0",
31
- "\uFF11": "1",
32
- "\uFF12": "2",
33
- "\uFF13": "3",
34
- "\uFF14": "4",
35
- "\uFF15": "5",
36
- "\uFF16": "6",
37
- "\uFF17": "7",
38
- "\uFF18": "8",
39
- "\uFF19": "9",
40
- // Full-width uppercase letters
41
- "\uFF21": "A",
42
- "\uFF22": "B",
43
- "\uFF23": "C",
44
- "\uFF24": "D",
45
- "\uFF25": "E",
46
- "\uFF26": "F",
47
- "\uFF27": "G",
48
- "\uFF28": "H",
49
- "\uFF29": "I",
50
- "\uFF2A": "J",
51
- "\uFF2B": "K",
52
- "\uFF2C": "L",
53
- "\uFF2D": "M",
54
- "\uFF2E": "N",
55
- "\uFF2F": "O",
56
- "\uFF30": "P",
57
- "\uFF31": "Q",
58
- "\uFF32": "R",
59
- "\uFF33": "S",
60
- "\uFF34": "T",
61
- "\uFF35": "U",
62
- "\uFF36": "V",
63
- "\uFF37": "W",
64
- "\uFF38": "X",
65
- "\uFF39": "Y",
66
- "\uFF3A": "Z",
67
- // Full-width lowercase letters
68
- "\uFF41": "a",
69
- "\uFF42": "b",
70
- "\uFF43": "c",
71
- "\uFF44": "d",
72
- "\uFF45": "e",
73
- "\uFF46": "f",
74
- "\uFF47": "g",
75
- "\uFF48": "h",
76
- "\uFF49": "i",
77
- "\uFF4A": "j",
78
- "\uFF4B": "k",
79
- "\uFF4C": "l",
80
- "\uFF4D": "m",
81
- "\uFF4E": "n",
82
- "\uFF4F": "o",
83
- "\uFF50": "p",
84
- "\uFF51": "q",
85
- "\uFF52": "r",
86
- "\uFF53": "s",
87
- "\uFF54": "t",
88
- "\uFF55": "u",
89
- "\uFF56": "v",
90
- "\uFF57": "w",
91
- "\uFF58": "x",
92
- "\uFF59": "y",
93
- "\uFF5A": "z",
94
- // Common full-width symbols
95
- "\u3000": " ",
96
- // Full-width space
97
- "\uFF01": "!",
98
- "\uFF1F": "?",
99
- "\uFF0E": ".",
100
- "\uFF0C": ",",
101
- "\uFF1A": ":",
102
- "\uFF1B": ";",
103
- "\uFF08": "(",
104
- "\uFF09": ")",
105
- "\uFF3B": "[",
106
- "\uFF3D": "]",
107
- "\uFF5B": "{",
108
- "\uFF5D": "}",
109
- "\uFF0B": "+",
110
- "\uFF0D": "-",
111
- "\uFF0A": "*",
112
- "\uFF0F": "/",
113
- "\uFF1D": "=",
114
- "\uFF1C": "<",
115
- "\uFF1E": ">",
116
- "\uFF20": "@",
117
- "\uFF03": "#",
118
- "\uFF04": "$",
119
- "\uFF05": "%",
120
- "\uFF06": "&",
121
- "\uFF3F": "_"
122
- };
123
- function normalizeFullWidth(input) {
124
- if (!input)
125
- return input;
126
- let result = "";
127
- for (const char of input) {
128
- result += FULLWIDTH_TO_HALFWIDTH[char] ?? char;
129
- }
130
- return result;
131
- }
132
- function normalizeMenuInput(input) {
133
- if (!input)
134
- return input;
135
- return normalizeFullWidth(input.trim()).toLowerCase();
136
- }
137
-
138
- function isCcrConfigured() {
139
- const CCR_CONFIG_FILE = join(homedir(), ".claude-code-router", "config.json");
140
- if (!existsSync(CCR_CONFIG_FILE)) {
141
- return false;
142
- }
143
- const config = readCcrConfig();
144
- return config !== null;
145
- }
146
- async function showCcrMenu() {
147
- try {
148
- ensureI18nInitialized();
149
- console.log(`
150
- ${a.green("\u2550".repeat(50))}`);
151
- console.log(a.bold.cyan(` ${i18n.t("ccr:ccrMenuTitle")}`));
152
- console.log(`${a.green("\u2550".repeat(50))}
153
- `);
154
- console.log(` ${a.green("1.")} ${i18n.t("ccr:ccrMenuOptions.initCcr")} ${a.gray(`- ${i18n.t("ccr:ccrMenuDescriptions.initCcr")}`)}`);
155
- console.log(` ${a.green("2.")} ${i18n.t("ccr:ccrMenuOptions.startUi")} ${a.gray(`- ${i18n.t("ccr:ccrMenuDescriptions.startUi")}`)}`);
156
- console.log(` ${a.green("3.")} ${i18n.t("ccr:ccrMenuOptions.checkStatus")} ${a.gray(`- ${i18n.t("ccr:ccrMenuDescriptions.checkStatus")}`)}`);
157
- console.log(` ${a.green("4.")} ${i18n.t("ccr:ccrMenuOptions.restart")} ${a.gray(`- ${i18n.t("ccr:ccrMenuDescriptions.restart")}`)}`);
158
- console.log(` ${a.green("5.")} ${i18n.t("ccr:ccrMenuOptions.start")} ${a.gray(`- ${i18n.t("ccr:ccrMenuDescriptions.start")}`)}`);
159
- console.log(` ${a.green("6.")} ${i18n.t("ccr:ccrMenuOptions.stop")} ${a.gray(`- ${i18n.t("ccr:ccrMenuDescriptions.stop")}`)}`);
160
- console.log(` ${a.yellow("0.")} ${i18n.t("ccr:ccrMenuOptions.back")}`);
161
- console.log("");
162
- const { choice } = await inquirer.prompt({
163
- type: "input",
164
- name: "choice",
165
- message: i18n.t("common:enterChoice"),
166
- validate: (value) => {
167
- const valid = ["1", "2", "3", "4", "5", "6", "0"];
168
- return valid.includes(value) || i18n.t("common:invalidChoice");
169
- }
170
- });
171
- switch (choice) {
172
- case "1": {
173
- const ccrStatus = await isCcrInstalled();
174
- if (!ccrStatus.hasCorrectPackage) {
175
- await installCcr();
176
- } else {
177
- console.log(a.green(`\u2714 ${i18n.t("ccr:ccrAlreadyInstalled")}`));
178
- }
179
- await configureCcrFeature();
180
- console.log(a.green(`
181
- \u2714 ${i18n.t("ccr:ccrSetupComplete")}`));
182
- break;
183
- }
184
- case "2":
185
- if (!isCcrConfigured()) {
186
- console.log(a.yellow(`
187
- \u26A0\uFE0F ${i18n.t("ccr:ccrNotConfigured")}`));
188
- console.log(a.green(` ${i18n.t("ccr:pleaseInitFirst")}
189
- `));
190
- } else {
191
- const config = readCcrConfig();
192
- await runCcrUi(config?.APIKEY);
193
- }
194
- break;
195
- case "3":
196
- if (!isCcrConfigured()) {
197
- console.log(a.yellow(`
198
- \u26A0\uFE0F ${i18n.t("ccr:ccrNotConfigured")}`));
199
- console.log(a.green(` ${i18n.t("ccr:pleaseInitFirst")}
200
- `));
201
- } else {
202
- await runCcrStatus();
203
- }
204
- break;
205
- case "4":
206
- if (!isCcrConfigured()) {
207
- console.log(a.yellow(`
208
- \u26A0\uFE0F ${i18n.t("ccr:ccrNotConfigured")}`));
209
- console.log(a.green(` ${i18n.t("ccr:pleaseInitFirst")}
210
- `));
211
- } else {
212
- await runCcrRestart();
213
- }
214
- break;
215
- case "5":
216
- if (!isCcrConfigured()) {
217
- console.log(a.yellow(`
218
- \u26A0\uFE0F ${i18n.t("ccr:ccrNotConfigured")}`));
219
- console.log(a.green(` ${i18n.t("ccr:pleaseInitFirst")}
220
- `));
221
- } else {
222
- await runCcrStart();
223
- }
224
- break;
225
- case "6":
226
- if (!isCcrConfigured()) {
227
- console.log(a.yellow(`
228
- \u26A0\uFE0F ${i18n.t("ccr:ccrNotConfigured")}`));
229
- console.log(a.green(` ${i18n.t("ccr:pleaseInitFirst")}
230
- `));
231
- } else {
232
- await runCcrStop();
233
- }
234
- break;
235
- case "0":
236
- return false;
237
- }
238
- if (choice !== "0") {
239
- console.log(`
240
- ${a.dim("\u2500".repeat(50))}
241
- `);
242
- const continueInCcr = await promptBoolean({
243
- message: i18n.t("common:returnToMenu"),
244
- defaultValue: true
245
- });
246
- if (continueInCcr) {
247
- return await showCcrMenu();
248
- }
249
- }
250
- return false;
251
- } catch (error) {
252
- if (!handleExitPromptError(error)) {
253
- handleGeneralError(error);
254
- }
255
- return false;
256
- }
257
- }
258
-
259
- async function runCcrMenuFeature() {
260
- await showCcrMenu();
261
- }
262
-
263
- const CODE_TOOL_LABELS = {
264
- "claude-code": "Claude Code",
265
- "codex": "Codex",
266
- "aider": "Aider",
267
- "continue": "Continue",
268
- "cline": "Cline",
269
- "cursor": "Cursor"
270
- };
271
- function getCurrentCodeTool() {
272
- const config = readZcfConfig();
273
- if (config?.codeToolType && isCodeToolType(config.codeToolType)) {
274
- return config.codeToolType;
275
- }
276
- return DEFAULT_CODE_TOOL_TYPE;
277
- }
278
- function getCodeToolLabel(codeTool) {
279
- return CODE_TOOL_LABELS[codeTool] || codeTool;
280
- }
281
- function printSeparator() {
282
- console.log(`
283
- ${a.dim("\u2500".repeat(50))}
284
- `);
285
- }
286
- async function handleCodeToolSwitch(current) {
287
- const isZh = i18n.language === "zh-CN";
288
- const choices = [
289
- { name: CODE_TOOL_LABELS["claude-code"], value: "claude-code" },
290
- { name: CODE_TOOL_LABELS.codex, value: "codex" },
291
- { name: CODE_TOOL_LABELS.aider, value: "aider" },
292
- { name: CODE_TOOL_LABELS.continue, value: "continue" },
293
- { name: CODE_TOOL_LABELS.cline, value: "cline" },
294
- { name: CODE_TOOL_LABELS.cursor, value: "cursor" }
295
- ];
296
- const { tool } = await inquirer.prompt({
297
- type: "list",
298
- name: "tool",
299
- message: isZh ? "\u9009\u62E9\u4EE3\u7801\u5DE5\u5177:" : "Select code tool:",
300
- default: current,
301
- choices
302
- });
303
- if (!tool) {
304
- console.log(a.green(i18n.t("common:cancelled")));
305
- return false;
306
- }
307
- updateZcfConfig({ codeToolType: tool });
308
- console.log(a.green(`\u2714 ${isZh ? "\u5DF2\u5207\u6362\u5230" : "Switched to"} ${getCodeToolLabel(tool)}`));
309
- return true;
310
- }
311
- function showHelpDocumentation(isZh) {
312
- console.log("");
313
- console.log(a.bold.cyan(isZh ? "\u{1F4D6} CCJK \u4F7F\u7528\u6307\u5357" : "\u{1F4D6} CCJK User Guide"));
314
- console.log(a.dim("\u2500".repeat(50)));
315
- console.log("");
316
- console.log(a.bold(isZh ? "\u{1F517} \u76F8\u5173\u94FE\u63A5" : "\u{1F517} Links"));
317
- console.log(` ${a.green("GitHub:")} ${a.dim("https://github.com/anthropics/claude-code")}`);
318
- console.log(` ${a.green("NPM:")} ${a.dim("https://www.npmjs.com/package/ccjk")}`);
319
- console.log("");
320
- console.log(a.bold(isZh ? "\u{1F4AC} \u5E38\u7528\u547D\u4EE4" : "\u{1F4AC} Common Commands"));
321
- console.log(` ${a.green("npx ccjk")} ${a.dim(isZh ? "- \u6253\u5F00\u4E3B\u83DC\u5355" : "- Open main menu")}`);
322
- console.log(` ${a.green("npx ccjk init")} ${a.dim(isZh ? "- \u521D\u59CB\u5316\u914D\u7F6E" : "- Initialize config")}`);
323
- console.log(` ${a.green("npx ccjk update")} ${a.dim(isZh ? "- \u66F4\u65B0\u5DE5\u4F5C\u6D41" : "- Update workflows")}`);
324
- console.log(` ${a.green("npx ccjk doctor")} ${a.dim(isZh ? "- \u8BCA\u65AD\u95EE\u9898" : "- Diagnose issues")}`);
325
- console.log(` ${a.green("npx ccjk skills")} ${a.dim(isZh ? "- \u7BA1\u7406\u6280\u80FD" : "- Manage skills")}`);
326
- console.log(` ${a.green("npx ccjk mcp")} ${a.dim(isZh ? "- \u7BA1\u7406 MCP" : "- Manage MCP")}`);
327
- console.log(` ${a.green("npx ccjk agents")} ${a.dim(isZh ? "- \u7BA1\u7406\u667A\u80FD\u4F53" : "- Manage agents")}`);
328
- console.log("");
329
- console.log(a.bold(isZh ? "\u26A1 \u5FEB\u6377\u65B9\u5F0F" : "\u26A1 Shortcuts"));
330
- console.log(` ${a.green("npx ccjk qs")} ${a.dim(isZh ? "- \u5FEB\u901F\u914D\u7F6E (quick-setup)" : "- Quick setup")}`);
331
- console.log(` ${a.green("npx ccjk <code>")} ${a.dim(isZh ? "- \u5FEB\u901F\u542F\u52A8\u63D0\u4F9B\u5546 (\u5982: glm, kimi)" : "- Quick launch provider (e.g., glm, kimi)")}`);
332
- console.log("");
333
- console.log(a.bold(isZh ? "\u{1F4A1} \u63D0\u793A" : "\u{1F4A1} Tips"));
334
- console.log(a.dim(isZh ? ' \u2022 \u9996\u6B21\u4F7F\u7528\u5EFA\u8BAE\u8FD0\u884C "npx ccjk" \u8FDB\u884C\u4E00\u952E\u914D\u7F6E' : ' \u2022 First time? Run "npx ccjk" for quick setup'));
335
- console.log(a.dim(isZh ? ' \u2022 \u9047\u5230\u95EE\u9898\u53EF\u8FD0\u884C "npx ccjk doctor" \u81EA\u52A8\u8BCA\u65AD' : ' \u2022 Having issues? Run "npx ccjk doctor" to diagnose'));
336
- console.log(a.dim(isZh ? ' \u2022 \u4F7F\u7528 "npx ccjk --help" \u67E5\u770B\u6240\u6709\u547D\u4EE4' : ' \u2022 Use "npx ccjk --help" to see all commands'));
337
- console.log("");
338
- }
339
- function checkNewMcpServicesHint(isZh) {
340
- try {
341
- const mcpConfig = readMcpConfig();
342
- const installedIds = new Set(Object.keys(mcpConfig?.mcpServers || {}));
343
- const missing = MCP_SERVICE_CONFIGS.filter((c) => c.defaultSelected && !installedIds.has(c.id));
344
- if (missing.length > 0) {
345
- const names = missing.map((c) => c.id).join(", ");
346
- console.log(
347
- a.cyan(` \u2728 ${isZh ? "\u65B0\u63A8\u8350\u670D\u52A1\u672A\u5B89\u88C5" : "New recommended services available"}: ${a.bold(names)} ${a.dim(isZh ? "(\u9009\u9879 4 \u5B89\u88C5)" : "(install via option 4)")}`)
348
- );
349
- }
350
- } catch {
351
- }
352
- }
353
- async function showContextValueSummary(isZh) {
354
- try {
355
- const { getContextPersistence } = await import('./persistence.mjs');
356
- const persistence = getContextPersistence();
357
- const metrics = persistence.getCompressionMetricsStats();
358
- if (metrics.totalCompressions === 0) {
359
- return;
360
- }
361
- const saved = metrics.totalTokensSaved.toLocaleString();
362
- const sessionCompressions = metrics.sessionStats?.compressions || 0;
363
- const sessionSavings = metrics.sessionStats?.tokensSaved || 0;
364
- console.log(a.cyan(` \u{1F9E0} ${isZh ? "\u4E0A\u4E0B\u6587\u6536\u76CA\u6458\u8981" : "Context Value Summary"}:`));
365
- console.log(a.dim(` ${isZh ? "\u7D2F\u8BA1\u8282\u7701" : "Total saved"}: ${saved} ${isZh ? "tokens" : "tokens"}`));
366
- if (sessionCompressions > 0) {
367
- console.log(a.dim(` ${isZh ? "\u6700\u8FD124\u5C0F\u65F6" : "Last 24h"}: ${sessionCompressions} ${isZh ? "\u6B21\u538B\u7F29\uFF0C\u8282\u7701" : "compressions, saved"} ${sessionSavings.toLocaleString()} tokens`));
368
- }
369
- console.log(a.dim(` ${isZh ? "\u67E5\u770B\u8BE6\u60C5" : "Details"}: ${isZh ? "ccjk morning / ccjk review" : "ccjk morning / ccjk review"}`));
370
- } catch {
371
- }
372
- }
373
- async function showSimplifiedMenu() {
374
- const lang = i18n.language;
375
- const isZh = lang === "zh-CN";
376
- console.log("");
377
- console.log(a.bold.yellow(isZh ? "\u8BF7\u9009\u62E9\u529F\u80FD" : "Select Feature"));
378
- await showContextValueSummary(isZh);
379
- checkNewMcpServicesHint(isZh);
380
- console.log(a.dim(` -------- Claude Code --------`));
381
- console.log(` ${a.green("1.")} ${isZh ? "\u5B8C\u6574\u521D\u59CB\u5316" : "Full Init"} ${a.dim(isZh ? "- \u5B89\u88C5 Claude Code + \u5BFC\u5165\u5DE5\u4F5C\u6D41 + \u914D\u7F6E API \u6216 CCR \u4EE3\u7406 + \u914D\u7F6E MCP \u670D\u52A1" : "- Install Claude Code + Import workflows + Configure API or CCR proxy + Configure MCP")}`);
382
- console.log(` ${a.green("2.")} ${isZh ? "\u5BFC\u5165\u5DE5\u4F5C\u6D41" : "Import Workflows"} ${a.dim(isZh ? "- \u4EC5\u5BFC\u5165/\u66F4\u65B0\u5DE5\u4F5C\u6D41\u76F8\u5173\u6587\u4EF6" : "- Import/update workflow files only")}`);
383
- console.log(` ${a.green("3.")} ${isZh ? "\u914D\u7F6E API \u6216 CCR \u4EE3\u7406" : "Configure API or CCR Proxy"} ${a.dim(isZh ? "- \u914D\u7F6E API URL\u3001\u8BA4\u8BC1\u4FE1\u606F\u6216 CCR \u4EE3\u7406" : "- Configure API URL, auth info or CCR proxy")}`);
384
- console.log(` ${a.green("4.")} ${isZh ? "\u8FDC\u7A0B\u63A7\u5236\uFF08Web/Telegram\uFF09" : "Remote Control (Web/Telegram)"} ${a.dim(isZh ? "- \u4E00\u952E\u521D\u59CB\u5316 + \u5FEB\u901F\u7ED1\u5B9A + \u4E8C\u7EF4\u7801\u914D\u5BF9\uFF08\u6838\u5FC3\u529F\u80FD\uFF09" : "- One-command setup + quick binding + QR pairing (core feature)")}`);
385
- console.log(` ${a.green("5.")} ${isZh ? "\u5B89\u88C5/\u66F4\u65B0 MCP \u670D\u52A1" : "Install / Update MCP Services"} ${a.dim(isZh ? "- \u591A\u9009\u5B89\u88C5\u63A8\u8350\u670D\u52A1\uFF0C\u81EA\u52A8\u5408\u5E76/\u4FEE\u590D Windows \u914D\u7F6E" : "- Multi-select & install recommended services, auto-fix Windows config")}`);
386
- console.log(` ${a.green("6.")} ${isZh ? "\u914D\u7F6E\u9ED8\u8BA4\u6A21\u578B" : "Configure Default Model"} ${a.dim(isZh ? "- \u8BBE\u7F6E\u9ED8\u8BA4\u6A21\u578B\uFF08opus/sonnet/sonnet 1m/\u81EA\u5B9A\u4E49\uFF09" : "- Set default model (opus/sonnet/sonnet 1m/custom)")}`);
387
- console.log(` ${a.green("7.")} ${isZh ? "\u914D\u7F6E Claude \u5168\u5C40\u8BB0\u5FC6" : "Configure Claude Memory"} ${a.dim(isZh ? "- \u914D\u7F6E AI \u8F93\u51FA\u8BED\u8A00\u548C\u8F93\u51FA\u98CE\u683C" : "- Configure AI output language and style")}`);
388
- console.log(` ${a.green("8.")} ${isZh ? "\u6743\u9650 & \u73AF\u5883\u914D\u7F6E" : "Permissions & Env Setup"} ${a.dim(isZh ? "- \u5BFC\u5165\u73AF\u5883\u53D8\u91CF / \u5BFC\u5165\u63A8\u8350\u6743\u9650 / \u4E00\u952E\u6743\u9650\u9884\u8BBE\uFF08\u6700\u5927/\u5F00\u53D1\u8005/\u5B89\u5168\uFF09" : "- Import env vars / import permissions / one-click presets (max/dev/safe)")}`);
389
- console.log("");
390
- console.log(a.dim(` --------- ${isZh ? "\u5176\u4ED6\u5DE5\u5177" : "Other Tools"} ----------`));
391
- console.log(` ${a.green("K.")} ${isZh ? "Skills \u7BA1\u7406" : "Skills Manager"} ${a.dim(isZh ? "- \u5B89\u88C5/\u66F4\u65B0/\u5220\u9664\u5DE5\u4F5C\u6D41\u6280\u80FD" : "- Install/update/remove workflow skills")}`);
392
- console.log(` ${a.green("M.")} ${isZh ? "MCP \u7BA1\u7406" : "MCP Manager"} ${a.dim(isZh ? "- \u72B6\u6001/\u8BCA\u65AD/\u5DF2\u88C5\u5217\u8868/\u5207\u6362\u9884\u8BBE/\u91CA\u653E\u95F2\u7F6E\u670D\u52A1" : "- Status / doctor / list / switch profile / release idle services")}`);
393
- console.log(` ${a.green("A.")} ${isZh ? "Agents \u7BA1\u7406" : "Agents Manager"} ${a.dim(isZh ? "- \u521B\u5EFA/\u7BA1\u7406 AI \u667A\u80FD\u4F53" : "- Create/manage AI agents")}`);
394
- console.log(` ${a.green("P.")} ${isZh ? "\u6301\u4E45\u5316\u7BA1\u7406" : "Persistence Manager"} ${a.dim(isZh ? "- \u7BA1\u7406\u4E0A\u4E0B\u6587\u5B58\u50A8\u548C\u5C42\u7EA7" : "- Manage context storage and tiers")}`);
395
- console.log(` ${a.green("R.")} ${isZh ? "CCR" : "CCR"} ${a.dim(isZh ? "- \u914D\u7F6E Claude Code Router \u4EE5\u4F7F\u7528\u591A\u4E2A AI \u6A21\u578B" : "- Configure Claude Code Router for multiple AI models")}`);
396
- console.log("");
397
- console.log(a.dim(` ------------ CCJK ------------`));
398
- console.log(` ${a.green("0.")} ${isZh ? "\u66F4\u6539\u663E\u793A\u8BED\u8A00 / Select display language" : "Select display language"} ${a.dim(isZh ? "- \u66F4\u6539 CCJK \u754C\u9762\u8BED\u8A00" : "- Change CCJK interface language")}`);
399
- console.log(` ${a.green("S.")} ${isZh ? "\u5207\u6362\u4EE3\u7801\u5DE5\u5177" : "Switch Code Tool"} ${a.dim(isZh ? "- \u5728\u652F\u6301\u7684\u4EE3\u7801\u5DE5\u5177\u4E4B\u95F4\u5207\u6362 (Claude Code, Codex)" : "- Switch between supported code tools (Claude Code, Codex)")}`);
400
- console.log(` ${a.green("-.")} ${isZh ? "\u5378\u8F7D\u548C\u5220\u9664\u914D\u7F6E" : "Uninstall & Remove Config"} ${a.dim(isZh ? "- \u4ECE\u7CFB\u7EDF\u4E2D\u5220\u9664 Claude Code \u914D\u7F6E\u548C\u5DE5\u5177" : "- Remove Claude Code config and tools from system")}`);
401
- console.log(` ${a.green("+.")} ${isZh ? "\u68C0\u67E5\u66F4\u65B0" : "Check Updates"} ${a.dim(isZh ? "- \u68C0\u67E5\u5E76\u66F4\u65B0 Claude Code\u3001CCR \u7684\u7248\u672C" : "- Check and update Claude Code, CCR versions")}`);
402
- console.log(` ${a.green("D.")} ${isZh ? "\u{1F9E0} \u4F53\u68C0 & \u5065\u5EB7\u770B\u677F" : "\u{1F9E0} Health Check & Dashboard"} ${a.dim(isZh ? "- \u5065\u5EB7\u5206\u6570 + \u4F18\u5316\u5EFA\u8BAE + \u81EA\u52A8\u4FEE\u590D" : "- Health score + recommendations + auto-fix")}`);
403
- console.log(` ${a.green("H.")} ${isZh ? "\u5E2E\u52A9\u6587\u6863" : "Help"} ${a.dim(isZh ? "- \u67E5\u770B\u4F7F\u7528\u6307\u5357" : "- View user guide")}`);
404
- console.log(` ${a.green("Q.")} ${isZh ? "\u9000\u51FA" : "Exit"}`);
405
- console.log("");
406
- const { choice } = await inquirer.prompt({
407
- type: "input",
408
- name: "choice",
409
- message: isZh ? "\u8BF7\u8F93\u5165\u9009\u9879:" : "Enter option:",
410
- validate: (value) => {
411
- const normalized2 = normalizeMenuInput(value);
412
- const valid = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "k", "m", "a", "p", "r", "s", "-", "+", "d", "h", "q"];
413
- return valid.includes(normalized2) || (isZh ? "\u8BF7\u8F93\u5165\u6709\u6548\u9009\u9879" : "Please enter a valid option");
414
- }
415
- });
416
- if (!choice) {
417
- console.log(a.green(i18n.t("common:cancelled")));
418
- return "exit";
419
- }
420
- const normalized = normalizeMenuInput(choice);
421
- switch (normalized) {
422
- // -------- Claude Code --------
423
- case "1": {
424
- await init({ skipBanner: true, codeType: "claude-code" });
425
- break;
426
- }
427
- case "2": {
428
- await update({ skipBanner: true });
429
- break;
430
- }
431
- case "3": {
432
- await configureApiFeature();
433
- break;
434
- }
435
- case "4": {
436
- const {
437
- setupRemote,
438
- remoteStatus,
439
- showQRCode,
440
- doctorRemote
441
- } = await import('./remote.mjs');
442
- const { remoteAction } = await inquirer.prompt({
443
- type: "list",
444
- name: "remoteAction",
445
- message: isZh ? "\u8FDC\u7A0B\u63A7\u5236\uFF1A\u8BF7\u9009\u62E9\u64CD\u4F5C" : "Remote Control: Select action",
446
- choices: addNumbersToChoices([
447
- {
448
- name: isZh ? "\u4E00\u952E\u521D\u59CB\u5316\u5E76\u7ED1\u5B9A\uFF08\u63A8\u8350\uFF09" : "One-command setup & bind (recommended)",
449
- value: "setup"
450
- },
451
- {
452
- name: isZh ? "\u663E\u793A\u914D\u5BF9\u4E8C\u7EF4\u7801\uFF08App/Web\uFF09" : "Show pairing QR code (App/Web)",
453
- value: "qr"
454
- },
455
- {
456
- name: isZh ? "\u67E5\u770B\u8FDC\u7A0B\u72B6\u6001" : "Show remote status",
457
- value: "status"
458
- },
459
- {
460
- name: isZh ? "\u8FDC\u7A0B\u8BCA\u65AD\uFF08Doctor\uFF09" : "Remote doctor",
461
- value: "doctor"
462
- },
463
- {
464
- name: isZh ? "\u8FD4\u56DE" : "Back",
465
- value: "back"
466
- }
467
- ])
468
- });
469
- switch (remoteAction) {
470
- case "setup":
471
- await setupRemote();
472
- break;
473
- case "qr":
474
- await showQRCode();
475
- break;
476
- case "status":
477
- await remoteStatus();
478
- break;
479
- case "doctor":
480
- await doctorRemote();
481
- break;
482
- }
483
- break;
484
- }
485
- case "5": {
486
- await configureMcpFeature();
487
- break;
488
- }
489
- case "6": {
490
- await configureDefaultModelFeature();
491
- break;
492
- }
493
- case "7": {
494
- await configureAiMemoryFeature();
495
- break;
496
- }
497
- case "8": {
498
- await configureMergedPermissionsFeature();
499
- break;
500
- }
501
- // --------- 其他工具 ----------
502
- case "k": {
503
- await ccjkSkills({});
504
- break;
505
- }
506
- case "m": {
507
- await mcpManagerFeature();
508
- break;
509
- }
510
- case "a": {
511
- await ccjkAgents({});
512
- break;
513
- }
514
- case "p": {
515
- const { persistenceManager } = await import('./persistence-manager.mjs');
516
- await persistenceManager();
517
- printSeparator();
518
- return void 0;
519
- }
520
- case "r": {
521
- await runCcrMenuFeature();
522
- printSeparator();
523
- return void 0;
524
- }
525
- // ------------ CCJK ------------
526
- case "0": {
527
- const currentLang = i18n.language;
528
- await changeScriptLanguageFeature(currentLang);
529
- printSeparator();
530
- return void 0;
531
- }
532
- case "s": {
533
- const switched = await handleCodeToolSwitch(getCurrentCodeTool());
534
- if (switched) {
535
- return "switch";
536
- }
537
- printSeparator();
538
- return void 0;
539
- }
540
- case "-": {
541
- await uninstall();
542
- printSeparator();
543
- return void 0;
544
- }
545
- case "+": {
546
- await checkUpdates();
547
- printSeparator();
548
- return void 0;
549
- }
550
- case "d": {
551
- const { dashboardCommand } = await import('./dashboard.mjs');
552
- await dashboardCommand();
553
- const isZhD = i18n.language === "zh-CN";
554
- const { runDoctor } = await inquirer.prompt({
555
- type: "confirm",
556
- name: "runDoctor",
557
- message: isZhD ? "\u662F\u5426\u540C\u65F6\u8FD0\u884C\u81EA\u52A8\u4FEE\u590D\u8BCA\u65AD\uFF1F" : "Also run auto-fix diagnostics?",
558
- default: false
559
- });
560
- if (runDoctor) {
561
- await doctor();
562
- }
563
- printSeparator();
564
- return void 0;
565
- }
566
- case "h": {
567
- showHelpDocumentation(isZh);
568
- printSeparator();
569
- return void 0;
570
- }
571
- case "q": {
572
- console.log(a.cyan(i18n.t("common:goodbye")));
573
- return "exit";
574
- }
575
- default:
576
- return void 0;
577
- }
578
- printSeparator();
579
- const shouldContinue = await promptBoolean({
580
- message: i18n.t("common:returnToMenu"),
581
- defaultValue: true
582
- });
583
- if (!shouldContinue) {
584
- console.log(a.green(isZh ? "\u{1F44B} \u518D\u89C1\uFF01" : "\u{1F44B} Goodbye!"));
585
- return "exit";
586
- }
587
- return void 0;
588
- }
589
- async function isFirstTimeUser() {
590
- const config = readZcfConfig();
591
- if (!config || !config.version) {
592
- return true;
593
- }
594
- if (!existsSync(join(CLAUDE_DIR, "commands"))) {
595
- return true;
596
- }
597
- return false;
598
- }
599
- function showNewUserWelcome() {
600
- const isZh = i18n.language === "zh-CN";
601
- console.log("");
602
- console.log(a.bold.yellow(isZh ? "\u{1F389} \u6B22\u8FCE\u9996\u6B21\u4F7F\u7528 CCJK!" : "\u{1F389} Welcome to CCJK!"));
603
- console.log(a.dim(isZh ? " CCJK \u662F Claude Code \u7684\u667A\u80FD\u914D\u7F6E\u5DE5\u5177\uFF0C\u8BA9\u4F60\u7684 AI \u7F16\u7A0B\u4F53\u9A8C\u66F4\u52A0\u7B80\u5355\u9AD8\u6548" : " CCJK is the smart configuration tool for Claude Code"));
604
- console.log(a.dim(isZh ? ' \u5EFA\u8BAE\u9996\u6B21\u4F7F\u7528\u9009\u62E9 "1. \u5B8C\u6574\u521D\u59CB\u5316" \u8FDB\u884C\u4E00\u952E\u914D\u7F6E' : ' Recommended: Select "1. Full Init" for first-time setup'));
605
- console.log("");
606
- }
607
- async function showMainMenu(options = {}) {
608
- try {
609
- const isNewUser = await isFirstTimeUser();
610
- if (isNewUser) {
611
- showNewUserWelcome();
612
- }
613
- if (options.codeType) {
614
- try {
615
- const resolvedType = await resolveCodeType(options.codeType);
616
- const currentType = getCurrentCodeTool();
617
- if (resolvedType !== currentType) {
618
- updateZcfConfig({ codeToolType: resolvedType });
619
- const isZh = i18n.language === "zh-CN";
620
- console.log(a.green(`\u2714 ${isZh ? "\u5DF2\u5207\u6362\u5230" : "Switched to"} ${getCodeToolLabel(resolvedType)}`));
621
- }
622
- } catch (err) {
623
- const errorMessage = err instanceof Error ? err.message : String(err);
624
- console.error(a.red(errorMessage));
625
- }
626
- }
627
- let exitMenu = false;
628
- while (!exitMenu) {
629
- const codeTool = getCurrentCodeTool();
630
- displayBannerWithInfo(CODE_TOOL_BANNERS[codeTool] || "CCJK");
631
- const result = await showSimplifiedMenu();
632
- if (result === "exit") {
633
- exitMenu = true;
634
- } else if (result === "switch") {
635
- continue;
636
- }
637
- }
638
- } catch (error) {
639
- if (!handleExitPromptError(error)) {
640
- handleGeneralError(error);
641
- }
642
- } finally {
643
- process__default.exit(0);
644
- }
645
- }
646
-
647
- const menu = {
648
- __proto__: null,
649
- showMainMenu: showMainMenu
650
- };
651
-
652
- export { showMainMenu as a, menu as m, showCcrMenu as s };