ccjk 14.2.2 → 15.0.0

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 (528) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +58 -341
  3. package/dist/cli.js +59 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/detect.js +15 -0
  6. package/dist/commands/detect.js.map +1 -0
  7. package/dist/commands/doctor.js +68 -0
  8. package/dist/commands/doctor.js.map +1 -0
  9. package/dist/commands/git-install.js +50 -0
  10. package/dist/commands/git-install.js.map +1 -0
  11. package/dist/commands/init.js +102 -0
  12. package/dist/commands/init.js.map +1 -0
  13. package/dist/commands/mcp.js +66 -0
  14. package/dist/commands/mcp.js.map +1 -0
  15. package/dist/commands/menu.js +33 -0
  16. package/dist/commands/menu.js.map +1 -0
  17. package/dist/core/detect.js +24 -0
  18. package/dist/core/detect.js.map +1 -0
  19. package/dist/core/lint.js +49 -0
  20. package/dist/core/lint.js.map +1 -0
  21. package/dist/core/mcp.js +41 -0
  22. package/dist/core/mcp.js.map +1 -0
  23. package/dist/core/paths.js +9 -0
  24. package/dist/core/paths.js.map +1 -0
  25. package/dist/core/providers.js +53 -0
  26. package/dist/core/providers.js.map +1 -0
  27. package/dist/core/settings.js +31 -0
  28. package/dist/core/settings.js.map +1 -0
  29. package/dist/core/slash-templates.js +56 -0
  30. package/dist/core/slash-templates.js.map +1 -0
  31. package/dist/core/tools.js +27 -0
  32. package/dist/core/tools.js.map +1 -0
  33. package/package.json +43 -164
  34. package/README.HONEST.md +0 -176
  35. package/README.en.md +0 -67
  36. package/README.ja.md +0 -67
  37. package/README.ko.md +0 -67
  38. package/README.zh-CN.md +0 -86
  39. package/bin/ccjk.mjs +0 -5
  40. package/bin/ccjk.ts +0 -222
  41. package/dist/chunks/agent-teams.mjs +0 -145
  42. package/dist/chunks/agent.mjs +0 -1439
  43. package/dist/chunks/agents.mjs +0 -3783
  44. package/dist/chunks/api-cli.mjs +0 -135
  45. package/dist/chunks/api-config-selector.mjs +0 -159
  46. package/dist/chunks/api-providers.mjs +0 -144
  47. package/dist/chunks/api.mjs +0 -115
  48. package/dist/chunks/auto-bootstrap.mjs +0 -358
  49. package/dist/chunks/auto-fixer.mjs +0 -95
  50. package/dist/chunks/auto-updater.mjs +0 -507
  51. package/dist/chunks/banner.mjs +0 -173
  52. package/dist/chunks/bash.mjs +0 -187
  53. package/dist/chunks/boost.mjs +0 -474
  54. package/dist/chunks/brain-config.mjs +0 -75
  55. package/dist/chunks/brain-status.mjs +0 -89
  56. package/dist/chunks/ccjk-agents.mjs +0 -416
  57. package/dist/chunks/ccjk-all.mjs +0 -1046
  58. package/dist/chunks/ccjk-config.mjs +0 -445
  59. package/dist/chunks/ccjk-hooks.mjs +0 -1074
  60. package/dist/chunks/ccjk-mcp.mjs +0 -763
  61. package/dist/chunks/ccjk-setup.mjs +0 -765
  62. package/dist/chunks/ccjk-skills.mjs +0 -518
  63. package/dist/chunks/ccr.mjs +0 -109
  64. package/dist/chunks/ccu.mjs +0 -40
  65. package/dist/chunks/check-updates.mjs +0 -117
  66. package/dist/chunks/claude-code-incremental-manager.mjs +0 -761
  67. package/dist/chunks/claude-config.mjs +0 -606
  68. package/dist/chunks/claude-config2.mjs +0 -62
  69. package/dist/chunks/claude-wrapper.mjs +0 -85
  70. package/dist/chunks/clavue-config.mjs +0 -1454
  71. package/dist/chunks/cleanup-migration.mjs +0 -20
  72. package/dist/chunks/cli-hook.mjs +0 -4096
  73. package/dist/chunks/cloud-sync.mjs +0 -29
  74. package/dist/chunks/code-type-resolver.mjs +0 -880
  75. package/dist/chunks/codex-config-switch.mjs +0 -452
  76. package/dist/chunks/codex-provider-manager.mjs +0 -238
  77. package/dist/chunks/codex-uninstaller.mjs +0 -404
  78. package/dist/chunks/codex.mjs +0 -2141
  79. package/dist/chunks/commands.mjs +0 -108
  80. package/dist/chunks/commands2.mjs +0 -421
  81. package/dist/chunks/commit.mjs +0 -140
  82. package/dist/chunks/completion.mjs +0 -517
  83. package/dist/chunks/config-consolidator.mjs +0 -172
  84. package/dist/chunks/config-switch.mjs +0 -334
  85. package/dist/chunks/config.mjs +0 -558
  86. package/dist/chunks/config2.mjs +0 -484
  87. package/dist/chunks/config3.mjs +0 -486
  88. package/dist/chunks/constants.mjs +0 -323
  89. package/dist/chunks/context-opt.mjs +0 -444
  90. package/dist/chunks/context.mjs +0 -974
  91. package/dist/chunks/dashboard.mjs +0 -481
  92. package/dist/chunks/doctor.mjs +0 -1301
  93. package/dist/chunks/eval.mjs +0 -502
  94. package/dist/chunks/evolution.mjs +0 -322
  95. package/dist/chunks/features.mjs +0 -715
  96. package/dist/chunks/fish.mjs +0 -181
  97. package/dist/chunks/fs-operations.mjs +0 -180
  98. package/dist/chunks/health-alerts.mjs +0 -830
  99. package/dist/chunks/help.mjs +0 -341
  100. package/dist/chunks/hook-installer.mjs +0 -48
  101. package/dist/chunks/impact.mjs +0 -651
  102. package/dist/chunks/index.mjs +0 -23
  103. package/dist/chunks/index10.mjs +0 -19
  104. package/dist/chunks/index11.mjs +0 -1171
  105. package/dist/chunks/index12.mjs +0 -218
  106. package/dist/chunks/index13.mjs +0 -679
  107. package/dist/chunks/index14.mjs +0 -1009
  108. package/dist/chunks/index15.mjs +0 -194
  109. package/dist/chunks/index2.mjs +0 -7637
  110. package/dist/chunks/index3.mjs +0 -171
  111. package/dist/chunks/index4.mjs +0 -26
  112. package/dist/chunks/index5.mjs +0 -19
  113. package/dist/chunks/index6.mjs +0 -19092
  114. package/dist/chunks/index7.mjs +0 -616
  115. package/dist/chunks/index8.mjs +0 -1602
  116. package/dist/chunks/index9.mjs +0 -5384
  117. package/dist/chunks/init.mjs +0 -1911
  118. package/dist/chunks/installer.mjs +0 -757
  119. package/dist/chunks/installer2.mjs +0 -103
  120. package/dist/chunks/interview.mjs +0 -2927
  121. package/dist/chunks/json-config.mjs +0 -60
  122. package/dist/chunks/linux.mjs +0 -3863
  123. package/dist/chunks/macos.mjs +0 -69
  124. package/dist/chunks/main.mjs +0 -635
  125. package/dist/chunks/manager.mjs +0 -1048
  126. package/dist/chunks/marketplace.mjs +0 -265
  127. package/dist/chunks/mcp-cli.mjs +0 -205
  128. package/dist/chunks/mcp-performance.mjs +0 -187
  129. package/dist/chunks/mcp.mjs +0 -667
  130. package/dist/chunks/memory-check.mjs +0 -2973
  131. package/dist/chunks/memory-paths.mjs +0 -259
  132. package/dist/chunks/memory-sync.mjs +0 -209
  133. package/dist/chunks/memory.mjs +0 -354
  134. package/dist/chunks/metrics-display.mjs +0 -153
  135. package/dist/chunks/monitor.mjs +0 -1856
  136. package/dist/chunks/notification.mjs +0 -1864
  137. package/dist/chunks/onboarding.mjs +0 -386
  138. package/dist/chunks/package.mjs +0 -3
  139. package/dist/chunks/paradigm.mjs +0 -74
  140. package/dist/chunks/permission-manager.mjs +0 -250
  141. package/dist/chunks/permissions.mjs +0 -265
  142. package/dist/chunks/persistence-manager.mjs +0 -801
  143. package/dist/chunks/persistence.mjs +0 -707
  144. package/dist/chunks/platform.mjs +0 -395
  145. package/dist/chunks/plugin.mjs +0 -1936
  146. package/dist/chunks/powershell.mjs +0 -213
  147. package/dist/chunks/prompts.mjs +0 -244
  148. package/dist/chunks/providers.mjs +0 -263
  149. package/dist/chunks/quick-actions.mjs +0 -335
  150. package/dist/chunks/quick-provider.mjs +0 -755
  151. package/dist/chunks/quick-setup.mjs +0 -421
  152. package/dist/chunks/remote.mjs +0 -497
  153. package/dist/chunks/research.mjs +0 -1904
  154. package/dist/chunks/rollback.mjs +0 -38
  155. package/dist/chunks/session-manager.mjs +0 -1371
  156. package/dist/chunks/session.mjs +0 -878
  157. package/dist/chunks/sessions.mjs +0 -106
  158. package/dist/chunks/silent-updater.mjs +0 -396
  159. package/dist/chunks/simple-config.mjs +0 -122
  160. package/dist/chunks/skill.mjs +0 -117
  161. package/dist/chunks/skill2.mjs +0 -9052
  162. package/dist/chunks/skills-sync.mjs +0 -1343
  163. package/dist/chunks/skills.mjs +0 -577
  164. package/dist/chunks/slash-commands.mjs +0 -208
  165. package/dist/chunks/smart-guide.mjs +0 -247
  166. package/dist/chunks/snapshot.mjs +0 -58
  167. package/dist/chunks/startup.mjs +0 -487
  168. package/dist/chunks/stats.mjs +0 -191
  169. package/dist/chunks/status.mjs +0 -471
  170. package/dist/chunks/team.mjs +0 -63
  171. package/dist/chunks/thinking.mjs +0 -626
  172. package/dist/chunks/trace.mjs +0 -57
  173. package/dist/chunks/uninstall.mjs +0 -852
  174. package/dist/chunks/update.mjs +0 -174
  175. package/dist/chunks/upgrade-manager.mjs +0 -204
  176. package/dist/chunks/upgrade.mjs +0 -133
  177. package/dist/chunks/version-checker.mjs +0 -891
  178. package/dist/chunks/vim.mjs +0 -903
  179. package/dist/chunks/windows.mjs +0 -14
  180. package/dist/chunks/workflows.mjs +0 -633
  181. package/dist/chunks/wsl.mjs +0 -129
  182. package/dist/chunks/zero-config.mjs +0 -871
  183. package/dist/chunks/zsh.mjs +0 -182
  184. package/dist/cli.d.mts +0 -1
  185. package/dist/cli.d.ts +0 -1
  186. package/dist/cli.mjs +0 -2684
  187. package/dist/i18n/locales/en/agent-teams.json +0 -18
  188. package/dist/i18n/locales/en/agentBrowser.json +0 -80
  189. package/dist/i18n/locales/en/agents.json +0 -135
  190. package/dist/i18n/locales/en/api.json +0 -63
  191. package/dist/i18n/locales/en/ccjk-agents.json +0 -33
  192. package/dist/i18n/locales/en/ccjk-all.json +0 -23
  193. package/dist/i18n/locales/en/ccjk-skills.json +0 -22
  194. package/dist/i18n/locales/en/ccjk.json +0 -276
  195. package/dist/i18n/locales/en/ccr.json +0 -65
  196. package/dist/i18n/locales/en/claude-md.json +0 -73
  197. package/dist/i18n/locales/en/cli.json +0 -148
  198. package/dist/i18n/locales/en/cloud-setup.json +0 -31
  199. package/dist/i18n/locales/en/cloud-sync.json +0 -147
  200. package/dist/i18n/locales/en/cloud.json +0 -40
  201. package/dist/i18n/locales/en/cloudPlugins.json +0 -118
  202. package/dist/i18n/locales/en/codex.json +0 -184
  203. package/dist/i18n/locales/en/cometix.json +0 -29
  204. package/dist/i18n/locales/en/common.json +0 -68
  205. package/dist/i18n/locales/en/config.json +0 -108
  206. package/dist/i18n/locales/en/configuration.json +0 -236
  207. package/dist/i18n/locales/en/context.json +0 -85
  208. package/dist/i18n/locales/en/dashboard.json +0 -78
  209. package/dist/i18n/locales/en/errors.json +0 -26
  210. package/dist/i18n/locales/en/evolution.json +0 -54
  211. package/dist/i18n/locales/en/hooks.json +0 -74
  212. package/dist/i18n/locales/en/hooksSync.json +0 -133
  213. package/dist/i18n/locales/en/installation.json +0 -83
  214. package/dist/i18n/locales/en/interview.json +0 -104
  215. package/dist/i18n/locales/en/language.json +0 -19
  216. package/dist/i18n/locales/en/lsp.json +0 -78
  217. package/dist/i18n/locales/en/marketplace.json +0 -116
  218. package/dist/i18n/locales/en/mcp.json +0 -180
  219. package/dist/i18n/locales/en/memory.json +0 -23
  220. package/dist/i18n/locales/en/menu.json +0 -299
  221. package/dist/i18n/locales/en/multi-config.json +0 -79
  222. package/dist/i18n/locales/en/notification.json +0 -307
  223. package/dist/i18n/locales/en/permissions.json +0 -95
  224. package/dist/i18n/locales/en/persistence.json +0 -127
  225. package/dist/i18n/locales/en/plugins.json +0 -146
  226. package/dist/i18n/locales/en/quick-actions.json +0 -78
  227. package/dist/i18n/locales/en/registry.json +0 -54
  228. package/dist/i18n/locales/en/remote.json +0 -93
  229. package/dist/i18n/locales/en/sandbox.json +0 -44
  230. package/dist/i18n/locales/en/setup.json +0 -44
  231. package/dist/i18n/locales/en/shencha.json +0 -14
  232. package/dist/i18n/locales/en/skills.json +0 -100
  233. package/dist/i18n/locales/en/skillsSync.json +0 -74
  234. package/dist/i18n/locales/en/smartGuide.json +0 -49
  235. package/dist/i18n/locales/en/stats.json +0 -20
  236. package/dist/i18n/locales/en/subagent.json +0 -69
  237. package/dist/i18n/locales/en/superpowers.json +0 -117
  238. package/dist/i18n/locales/en/team.json +0 -7
  239. package/dist/i18n/locales/en/thinking.json +0 -65
  240. package/dist/i18n/locales/en/tools.json +0 -42
  241. package/dist/i18n/locales/en/uninstall.json +0 -56
  242. package/dist/i18n/locales/en/updater.json +0 -29
  243. package/dist/i18n/locales/en/vim.json +0 -169
  244. package/dist/i18n/locales/en/workflow.json +0 -55
  245. package/dist/i18n/locales/en/workspace.json +0 -108
  246. package/dist/i18n/locales/zh-CN/agent-teams.json +0 -18
  247. package/dist/i18n/locales/zh-CN/agentBrowser.json +0 -80
  248. package/dist/i18n/locales/zh-CN/agents.json +0 -135
  249. package/dist/i18n/locales/zh-CN/api.json +0 -63
  250. package/dist/i18n/locales/zh-CN/ccjk-agents.json +0 -33
  251. package/dist/i18n/locales/zh-CN/ccjk-all.json +0 -23
  252. package/dist/i18n/locales/zh-CN/ccjk-skills.json +0 -22
  253. package/dist/i18n/locales/zh-CN/ccjk.json +0 -276
  254. package/dist/i18n/locales/zh-CN/ccr.json +0 -65
  255. package/dist/i18n/locales/zh-CN/claude-md.json +0 -73
  256. package/dist/i18n/locales/zh-CN/cli.json +0 -148
  257. package/dist/i18n/locales/zh-CN/cloud-setup.json +0 -31
  258. package/dist/i18n/locales/zh-CN/cloud-sync.json +0 -147
  259. package/dist/i18n/locales/zh-CN/cloud.json +0 -40
  260. package/dist/i18n/locales/zh-CN/cloudPlugins.json +0 -118
  261. package/dist/i18n/locales/zh-CN/codex.json +0 -184
  262. package/dist/i18n/locales/zh-CN/cometix.json +0 -29
  263. package/dist/i18n/locales/zh-CN/common.json +0 -68
  264. package/dist/i18n/locales/zh-CN/config.json +0 -108
  265. package/dist/i18n/locales/zh-CN/configuration.json +0 -234
  266. package/dist/i18n/locales/zh-CN/context.json +0 -85
  267. package/dist/i18n/locales/zh-CN/dashboard.json +0 -78
  268. package/dist/i18n/locales/zh-CN/errors.json +0 -26
  269. package/dist/i18n/locales/zh-CN/evolution.json +0 -54
  270. package/dist/i18n/locales/zh-CN/hooks.json +0 -74
  271. package/dist/i18n/locales/zh-CN/hooksSync.json +0 -133
  272. package/dist/i18n/locales/zh-CN/installation.json +0 -83
  273. package/dist/i18n/locales/zh-CN/interview.json +0 -104
  274. package/dist/i18n/locales/zh-CN/language.json +0 -19
  275. package/dist/i18n/locales/zh-CN/lsp.json +0 -78
  276. package/dist/i18n/locales/zh-CN/marketplace.json +0 -116
  277. package/dist/i18n/locales/zh-CN/mcp.json +0 -180
  278. package/dist/i18n/locales/zh-CN/memory.json +0 -23
  279. package/dist/i18n/locales/zh-CN/menu.json +0 -299
  280. package/dist/i18n/locales/zh-CN/multi-config.json +0 -79
  281. package/dist/i18n/locales/zh-CN/notification.json +0 -307
  282. package/dist/i18n/locales/zh-CN/permissions.json +0 -95
  283. package/dist/i18n/locales/zh-CN/persistence.json +0 -127
  284. package/dist/i18n/locales/zh-CN/plugins.json +0 -146
  285. package/dist/i18n/locales/zh-CN/quick-actions.json +0 -78
  286. package/dist/i18n/locales/zh-CN/registry.json +0 -54
  287. package/dist/i18n/locales/zh-CN/remote.json +0 -93
  288. package/dist/i18n/locales/zh-CN/sandbox.json +0 -44
  289. package/dist/i18n/locales/zh-CN/setup.json +0 -44
  290. package/dist/i18n/locales/zh-CN/shencha.json +0 -14
  291. package/dist/i18n/locales/zh-CN/skills.json +0 -100
  292. package/dist/i18n/locales/zh-CN/skillsSync.json +0 -74
  293. package/dist/i18n/locales/zh-CN/smartGuide.json +0 -49
  294. package/dist/i18n/locales/zh-CN/stats.json +0 -20
  295. package/dist/i18n/locales/zh-CN/subagent.json +0 -69
  296. package/dist/i18n/locales/zh-CN/superpowers.json +0 -117
  297. package/dist/i18n/locales/zh-CN/team.json +0 -7
  298. package/dist/i18n/locales/zh-CN/thinking.json +0 -65
  299. package/dist/i18n/locales/zh-CN/tools.json +0 -42
  300. package/dist/i18n/locales/zh-CN/uninstall.json +0 -56
  301. package/dist/i18n/locales/zh-CN/updater.json +0 -29
  302. package/dist/i18n/locales/zh-CN/vim.json +0 -169
  303. package/dist/i18n/locales/zh-CN/workflow.json +0 -55
  304. package/dist/i18n/locales/zh-CN/workspace.json +0 -108
  305. package/dist/index.d.mts +0 -5658
  306. package/dist/index.d.ts +0 -5658
  307. package/dist/index.mjs +0 -3732
  308. package/dist/shared/ccjk.5bEolFrk.mjs +0 -254
  309. package/dist/shared/ccjk.8oaxX4iR.mjs +0 -90
  310. package/dist/shared/ccjk.B2U7DsPy.mjs +0 -31
  311. package/dist/shared/ccjk.B2f-cwUP.mjs +0 -468
  312. package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
  313. package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
  314. package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
  315. package/dist/shared/ccjk.BLsIiTqO.mjs +0 -449
  316. package/dist/shared/ccjk.BXv8aYs1.mjs +0 -170
  317. package/dist/shared/ccjk.BnsY5WxD.mjs +0 -171
  318. package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
  319. package/dist/shared/ccjk.Bq8TqZG_.mjs +0 -189
  320. package/dist/shared/ccjk.BtrioX1Z.mjs +0 -25
  321. package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
  322. package/dist/shared/ccjk.BzPbSEP2.mjs +0 -115
  323. package/dist/shared/ccjk.C0WLUnFV.mjs +0 -293
  324. package/dist/shared/ccjk.C1hANZTu.mjs +0 -19
  325. package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
  326. package/dist/shared/ccjk.CNhnT6uQ.mjs +0 -636
  327. package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
  328. package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
  329. package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
  330. package/dist/shared/ccjk.CoCHVXl3.mjs +0 -3951
  331. package/dist/shared/ccjk.CwGZSTAK.mjs +0 -319
  332. package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
  333. package/dist/shared/ccjk.D-magaEx.mjs +0 -763
  334. package/dist/shared/ccjk.D0g2ABGg.mjs +0 -171
  335. package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
  336. package/dist/shared/ccjk.D75wivnp.mjs +0 -142
  337. package/dist/shared/ccjk.DDL-4C-k.mjs +0 -100
  338. package/dist/shared/ccjk.DFRPtmK_.mjs +0 -75
  339. package/dist/shared/ccjk.DMV3x5Sd.mjs +0 -299
  340. package/dist/shared/ccjk.DZ2LLOa-.mjs +0 -2195
  341. package/dist/shared/ccjk.DbigonEQ.mjs +0 -698
  342. package/dist/shared/ccjk.DcMvE7lf.mjs +0 -618
  343. package/dist/shared/ccjk.DeWpAShp.mjs +0 -1828
  344. package/dist/shared/ccjk.DhJ1kyDR.mjs +0 -30
  345. package/dist/shared/ccjk.DlTXS9rP.mjs +0 -224
  346. package/dist/shared/ccjk.DopKzo3z.mjs +0 -305
  347. package/dist/shared/ccjk.DsZsc4LR.mjs +0 -1280
  348. package/dist/shared/ccjk.DuzJZlgj.mjs +0 -418
  349. package/dist/shared/ccjk.Dxgd2vjc.mjs +0 -444
  350. package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
  351. package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
  352. package/dist/shared/ccjk.L7yC58_i.mjs +0 -225
  353. package/dist/shared/ccjk.MwtjAULc.mjs +0 -1447
  354. package/dist/shared/ccjk.OJKHVSOb.mjs +0 -2005
  355. package/dist/shared/ccjk.OTnevPNE.mjs +0 -225
  356. package/dist/shared/ccjk.RyizuzOI.mjs +0 -21
  357. package/dist/shared/ccjk.T_cX87dY.mjs +0 -15
  358. package/dist/shared/ccjk.bQ7Dh1g4.mjs +0 -249
  359. package/dist/shared/ccjk.gDEDGD_t.mjs +0 -38
  360. package/dist/shared/ccjk.hoqrwWdN.mjs +0 -333
  361. package/dist/shared/ccjk.i_vn-9C3.mjs +0 -317
  362. package/dist/shared/ccjk.lG3ccFjm.mjs +0 -885
  363. package/dist/shared/ccjk.wLJHO0Af.mjs +0 -244
  364. package/dist/shared/ccjk.y-a_1vK4.mjs +0 -5127
  365. package/dist/templates/agents/README.md +0 -78
  366. package/dist/templates/agents/fullstack-developer.json +0 -70
  367. package/dist/templates/agents/go-expert.json +0 -69
  368. package/dist/templates/agents/index.json +0 -64
  369. package/dist/templates/agents/python-expert.json +0 -69
  370. package/dist/templates/agents/react-specialist.json +0 -69
  371. package/dist/templates/agents/testing-automation-expert.json +0 -70
  372. package/dist/templates/agents/typescript-architect.json +0 -69
  373. package/dist/templates/claude-code/common/settings.json +0 -109
  374. package/dist/templates/common/error-prevention.md +0 -267
  375. package/dist/templates/common/karpathy-baseline.md +0 -83
  376. package/dist/templates/common/output-styles/zh-CN/carmack-mode.md +0 -381
  377. package/dist/templates/common/output-styles/zh-CN/codex-rigor-mode.md +0 -114
  378. package/dist/templates/common/output-styles/zh-CN/dhh-mode.md +0 -265
  379. package/dist/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
  380. package/dist/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
  381. package/dist/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
  382. package/dist/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
  383. package/dist/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
  384. package/dist/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
  385. package/dist/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
  386. package/dist/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
  387. package/dist/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
  388. package/dist/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
  389. package/dist/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
  390. package/dist/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
  391. package/dist/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
  392. package/dist/templates/common/workflow/essential/en/feat.md +0 -92
  393. package/dist/templates/common/workflow/essential/en/goal.md +0 -147
  394. package/dist/templates/common/workflow/essential/en/init-project.md +0 -53
  395. package/dist/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
  396. package/dist/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
  397. package/dist/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
  398. package/dist/templates/common/workflow/essential/zh-CN/feat.md +0 -315
  399. package/dist/templates/common/workflow/essential/zh-CN/goal.md +0 -146
  400. package/dist/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
  401. package/dist/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  402. package/dist/templates/common/workflow/git/en/git-commit.md +0 -205
  403. package/dist/templates/common/workflow/git/en/git-rollback.md +0 -90
  404. package/dist/templates/common/workflow/git/en/git-worktree.md +0 -276
  405. package/dist/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  406. package/dist/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  407. package/dist/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  408. package/dist/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  409. package/dist/templates/common/workflow/interview/en/interview.md +0 -67
  410. package/dist/templates/common/workflow/interview/zh-CN/interview.md +0 -67
  411. package/dist/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
  412. package/dist/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
  413. package/dist/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
  414. package/dist/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
  415. package/dist/templates/common/workflow/sixStep/en/workflow.md +0 -83
  416. package/dist/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
  417. package/dist/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
  418. package/dist/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
  419. package/dist/templates/hooks/README.md +0 -212
  420. package/dist/templates/hooks/git-workflow-hooks.md +0 -551
  421. package/dist/templates/hooks/post-test/coverage.json +0 -21
  422. package/dist/templates/hooks/post-test/summary.json +0 -21
  423. package/dist/templates/hooks/post-test-coverage.md +0 -434
  424. package/dist/templates/hooks/pre-commit/eslint.json +0 -22
  425. package/dist/templates/hooks/pre-commit/prettier.json +0 -22
  426. package/dist/templates/hooks/pre-commit-black.md +0 -274
  427. package/dist/templates/hooks/pre-commit-eslint.md +0 -153
  428. package/dist/templates/hooks/pre-commit-gofmt.md +0 -284
  429. package/dist/templates/hooks/pre-commit-prettier.md +0 -212
  430. package/dist/templates/hooks/pre-commit-type-check.md +0 -377
  431. package/dist/templates/skills/ccjk-init.md +0 -154
  432. package/dist/templates/skills/ccjk-mcp-setup.md +0 -205
  433. package/dist/templates/skills/ccjk-troubleshoot.md +0 -228
  434. package/dist/templates/skills/django-patterns.md +0 -1016
  435. package/dist/templates/skills/git-workflow.md +0 -748
  436. package/dist/templates/skills/go-idioms.md +0 -963
  437. package/dist/templates/skills/index.json +0 -132
  438. package/dist/templates/skills/nextjs-optimization.md +0 -694
  439. package/dist/templates/skills/python-pep8.md +0 -852
  440. package/dist/templates/skills/react-patterns.md +0 -686
  441. package/dist/templates/skills/rust-patterns.md +0 -1057
  442. package/dist/templates/skills/security-best-practices.md +0 -1413
  443. package/dist/templates/skills/testing-best-practices.md +0 -1315
  444. package/dist/templates/skills/ts-best-practices.md +0 -354
  445. package/templates/agents/README.md +0 -78
  446. package/templates/agents/fullstack-developer.json +0 -70
  447. package/templates/agents/go-expert.json +0 -69
  448. package/templates/agents/index.json +0 -64
  449. package/templates/agents/python-expert.json +0 -69
  450. package/templates/agents/react-specialist.json +0 -69
  451. package/templates/agents/testing-automation-expert.json +0 -70
  452. package/templates/agents/typescript-architect.json +0 -69
  453. package/templates/claude-code/common/settings.json +0 -109
  454. package/templates/common/error-prevention.md +0 -267
  455. package/templates/common/karpathy-baseline.md +0 -83
  456. package/templates/common/output-styles/zh-CN/carmack-mode.md +0 -381
  457. package/templates/common/output-styles/zh-CN/codex-rigor-mode.md +0 -114
  458. package/templates/common/output-styles/zh-CN/dhh-mode.md +0 -265
  459. package/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
  460. package/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
  461. package/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
  462. package/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
  463. package/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
  464. package/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
  465. package/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
  466. package/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
  467. package/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
  468. package/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
  469. package/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
  470. package/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
  471. package/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
  472. package/templates/common/workflow/essential/en/feat.md +0 -92
  473. package/templates/common/workflow/essential/en/goal.md +0 -147
  474. package/templates/common/workflow/essential/en/init-project.md +0 -53
  475. package/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
  476. package/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
  477. package/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
  478. package/templates/common/workflow/essential/zh-CN/feat.md +0 -315
  479. package/templates/common/workflow/essential/zh-CN/goal.md +0 -146
  480. package/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
  481. package/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  482. package/templates/common/workflow/git/en/git-commit.md +0 -205
  483. package/templates/common/workflow/git/en/git-rollback.md +0 -90
  484. package/templates/common/workflow/git/en/git-worktree.md +0 -276
  485. package/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  486. package/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  487. package/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  488. package/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  489. package/templates/common/workflow/interview/en/interview.md +0 -67
  490. package/templates/common/workflow/interview/zh-CN/interview.md +0 -67
  491. package/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
  492. package/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
  493. package/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
  494. package/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
  495. package/templates/common/workflow/sixStep/en/workflow.md +0 -83
  496. package/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
  497. package/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
  498. package/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
  499. package/templates/hooks/README.md +0 -212
  500. package/templates/hooks/git-workflow-hooks.md +0 -551
  501. package/templates/hooks/post-test/coverage.json +0 -21
  502. package/templates/hooks/post-test/summary.json +0 -21
  503. package/templates/hooks/post-test-coverage.md +0 -434
  504. package/templates/hooks/pre-commit/eslint.json +0 -22
  505. package/templates/hooks/pre-commit/prettier.json +0 -22
  506. package/templates/hooks/pre-commit-black.md +0 -274
  507. package/templates/hooks/pre-commit-eslint.md +0 -153
  508. package/templates/hooks/pre-commit-gofmt.md +0 -284
  509. package/templates/hooks/pre-commit-prettier.md +0 -212
  510. package/templates/hooks/pre-commit-type-check.md +0 -377
  511. package/templates/skills/basic.hbs +0 -72
  512. package/templates/skills/ccjk-init.md +0 -154
  513. package/templates/skills/ccjk-mcp-setup.md +0 -205
  514. package/templates/skills/ccjk-troubleshoot.md +0 -228
  515. package/templates/skills/code-refactor.hbs +0 -133
  516. package/templates/skills/code-review.hbs +0 -141
  517. package/templates/skills/django-patterns.md +0 -1016
  518. package/templates/skills/git-workflow.md +0 -748
  519. package/templates/skills/go-idioms.md +0 -963
  520. package/templates/skills/index.json +0 -132
  521. package/templates/skills/nextjs-optimization.md +0 -694
  522. package/templates/skills/python-pep8.md +0 -852
  523. package/templates/skills/react-patterns.md +0 -686
  524. package/templates/skills/rust-patterns.md +0 -1057
  525. package/templates/skills/security-best-practices.md +0 -1413
  526. package/templates/skills/testing-best-practices.md +0 -1315
  527. package/templates/skills/ts-best-practices.md +0 -354
  528. package/templates/skills/type-fix.hbs +0 -132
@@ -1,1911 +0,0 @@
1
- import { existsSync } from 'node:fs';
2
- import process__default from 'node:process';
3
- import a from './index5.mjs';
4
- import { i as inquirer } from './index6.mjs';
5
- import { M as MCP_SERVICE_CONFIGS, i as addCompletedOnboarding, h as setPrimaryApiKey, c as backupMcpConfig, g as getMcpServices, b as buildMcpServerConfig, r as readMcpConfig, l as replaceMcpServers, f as fixWindowsMcpConfig, w as writeMcpConfig, s as syncMcpPermissions } from './claude-config.mjs';
6
- import { SETTINGS_FILE, API_DEFAULT_URL, DEFAULT_CODE_TOOL_TYPE, CODE_TOOL_BANNERS, isClaudeFamilyCodeTool, CODE_TOOL_INFO, ZCF_CONFIG_FILE } from './constants.mjs';
7
- import { ensureI18nInitialized, i18n } from './index2.mjs';
8
- import { displayBannerWithInfo, padToDisplayWidth } from './banner.mjs';
9
- import { readZcfConfig, updateZcfConfig, updateTomlConfig } from './ccjk-config.mjs';
10
- import { readCcrConfig, backupCcrConfig, createDefaultCcrConfig, writeCcrConfig, configureCcrProxy, setupCcrConfiguration } from './config2.mjs';
11
- import { i as isCcrInstalled, a as installCcr } from '../shared/ccjk.DFRPtmK_.mjs';
12
- import { c as setMyclaudeProviderProfiles, d as clearMyclaudeProviderProfiles } from './clavue-config.mjs';
13
- import { i as runCodexFullInit } from './codex.mjs';
14
- import { p as parseOrchestrationLevel, a as resolveStartupCodeType, r as resolveCodeType, w as writeOrchestrationPolicy } from './code-type-resolver.mjs';
15
- import { exec } from 'node:child_process';
16
- import { promisify } from 'node:util';
17
- import { n as normalizeClaudeFamilySettings, r as resolveClaudeFamilySettingsTarget } from '../shared/ccjk.DDL-4C-k.mjs';
18
- import { exists } from './fs-operations.mjs';
19
- import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
20
- import { i as isWindows, w as wrapCommandWithSudo, d as isTermux } from './platform.mjs';
21
- import { p as promptApiConfigurationAction, j as ensureClaudeDir, e as getExistingApiConfig, s as switchToOfficialLogin, b as backupExistingConfig, c as copyConfigFiles, i as applyAiLanguageDirective, f as configureApi } from './config.mjs';
22
- import { n as needsMigration, m as migrateSettingsForTokenRetrieval, d as displayMigrationResult, p as promptMigration } from '../shared/ccjk.BXv8aYs1.mjs';
23
- import { m as modifyApiConfigPartially, c as configureApiCompletely, f as formatApiKeyDisplay } from '../shared/ccjk.L7yC58_i.mjs';
24
- import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.BtrioX1Z.mjs';
25
- import { getInstallationStatus, installMyclaude, installClaudeCode } from './installer.mjs';
26
- import { s as selectMcpServices } from '../shared/ccjk.DhJ1kyDR.mjs';
27
- import { a as configureOutputStyle } from '../shared/ccjk.C0WLUnFV.mjs';
28
- import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
29
- import { resolveAiOutputLanguage } from './prompts.mjs';
30
- import { g as getRuntimeVersion } from '../shared/ccjk.gDEDGD_t.mjs';
31
- import { p as promptBoolean } from '../shared/ccjk.DZ2LLOa-.mjs';
32
- import { checkClaudeCodeVersionAndPrompt } from './version-checker.mjs';
33
- import { W as WORKFLOW_CONFIG_BASE, s as selectAndInstallWorkflows } from '../shared/ccjk.BLsIiTqO.mjs';
34
- import { r as resolveClaudeFamilyModelSlots } from '../shared/ccjk.B2U7DsPy.mjs';
35
- import { c as checkSuperpowersInstalled, i as installSuperpowers } from '../shared/ccjk.Bq8TqZG_.mjs';
36
-
37
- const COMETIX_PACKAGE_NAME = "@cometix/ccline";
38
- const COMETIX_COMMAND_NAME = "ccline";
39
- const COMETIX_COMMANDS = {
40
- CHECK_INSTALL: `npm list -g ${COMETIX_PACKAGE_NAME}`,
41
- INSTALL: `npm install -g ${COMETIX_PACKAGE_NAME}`,
42
- UPDATE: `npm update -g ${COMETIX_PACKAGE_NAME}`,
43
- PRINT_CONFIG: `${COMETIX_COMMAND_NAME} --print`,
44
- TUI_CONFIG: `${COMETIX_COMMAND_NAME} -c`
45
- };
46
-
47
- function getPlatformStatusLineConfig() {
48
- return {
49
- type: "command",
50
- command: isWindows() ? "%USERPROFILE%\\.claude\\ccline\\ccline.exe" : "~/.claude/ccline/ccline",
51
- padding: 0
52
- };
53
- }
54
-
55
- function addCCometixLineConfig() {
56
- try {
57
- const statusLineConfig = getPlatformStatusLineConfig();
58
- let settings = {};
59
- if (exists(SETTINGS_FILE)) {
60
- settings = readJsonConfig(SETTINGS_FILE) || {};
61
- }
62
- settings.statusLine = statusLineConfig;
63
- normalizeClaudeFamilySettings(settings);
64
- writeJsonConfig(SETTINGS_FILE, settings);
65
- return true;
66
- } catch (error) {
67
- console.error("Failed to add CCometixLine configuration:", error);
68
- return false;
69
- }
70
- }
71
- function hasCCometixLineConfig() {
72
- try {
73
- if (!exists(SETTINGS_FILE)) {
74
- return false;
75
- }
76
- const settings = readJsonConfig(SETTINGS_FILE);
77
- return !!settings?.statusLine?.command?.includes("ccline");
78
- } catch {
79
- return false;
80
- }
81
- }
82
-
83
- const execAsync = promisify(exec);
84
- async function isCometixLineInstalled() {
85
- try {
86
- await execAsync(COMETIX_COMMANDS.CHECK_INSTALL);
87
- return true;
88
- } catch {
89
- return false;
90
- }
91
- }
92
- async function installCometixLine() {
93
- ensureI18nInitialized();
94
- const runInstallCommand = async () => {
95
- const installArgs = ["install", "-g", COMETIX_PACKAGE_NAME];
96
- const { command, args, usedSudo } = wrapCommandWithSudo("npm", installArgs);
97
- if (usedSudo) {
98
- console.log(a.yellow(`\u2139 ${i18n.t("installation:usingSudo")}`));
99
- }
100
- await execAsync([command, ...args].join(" "));
101
- };
102
- const isInstalled = await isCometixLineInstalled();
103
- if (isInstalled) {
104
- console.log(a.green(`\u2714 ${i18n.t("cometix:cometixAlreadyInstalled")}`));
105
- try {
106
- console.log(a.green(`${i18n.t("cometix:installingOrUpdating")}`));
107
- await runInstallCommand();
108
- console.log(a.green(`\u2714 ${i18n.t("cometix:installUpdateSuccess")}`));
109
- } catch (error) {
110
- console.log(a.yellow(`\u26A0 ${i18n.t("cometix:installUpdateFailed")}: ${error}`));
111
- }
112
- if (!hasCCometixLineConfig()) {
113
- try {
114
- addCCometixLineConfig();
115
- console.log(a.green(`\u2714 ${i18n.t("cometix:statusLineConfigured") || "Claude Code statusLine configured"}`));
116
- } catch (error) {
117
- console.log(a.yellow(`\u26A0 ${i18n.t("cometix:statusLineConfigFailed") || "Failed to configure statusLine"}: ${error}`));
118
- }
119
- } else {
120
- console.log(a.green(`\u2139 ${i18n.t("cometix:statusLineAlreadyConfigured") || "Claude Code statusLine already configured"}`));
121
- }
122
- return;
123
- }
124
- try {
125
- console.log(a.green(`${i18n.t("cometix:installingCometix")}`));
126
- await runInstallCommand();
127
- console.log(a.green(`\u2714 ${i18n.t("cometix:cometixInstallSuccess")}`));
128
- try {
129
- addCCometixLineConfig();
130
- console.log(a.green(`\u2714 ${i18n.t("cometix:statusLineConfigured") || "Claude Code statusLine configured"}`));
131
- } catch (configError) {
132
- console.log(a.yellow(`\u26A0 ${i18n.t("cometix:statusLineConfigFailed") || "Failed to configure statusLine"}: ${configError}`));
133
- console.log(a.green(`\u{1F4A1} ${i18n.t("cometix:statusLineManualConfig") || "Please manually add statusLine configuration to Claude Code settings"}`));
134
- }
135
- } catch (error) {
136
- console.error(a.red(`\u2717 ${i18n.t("cometix:cometixInstallFailed")}: ${error}`));
137
- throw error;
138
- }
139
- }
140
-
141
- function formatError(error, context) {
142
- const errorMsg = typeof error === "string" ? error : error.message;
143
- const patterns = [
144
- {
145
- pattern: /not initialized|Call initialize/i,
146
- formatter: () => ({
147
- title: "\u26A0\uFE0F Configuration Not Ready",
148
- message: "CCJK needs to be initialized first.",
149
- suggestion: "Run the initialization command to set up your environment.",
150
- command: "ccjk init"
151
- })
152
- },
153
- {
154
- pattern: /Failed to (start|connect|fetch)/i,
155
- formatter: (match) => ({
156
- title: "\u274C Connection Failed",
157
- message: `Unable to ${match[1]} the service.`,
158
- suggestion: "Check your internet connection and try again.",
159
- command: "ccjk doctor"
160
- })
161
- },
162
- {
163
- pattern: /does not exist|not found/i,
164
- formatter: () => ({
165
- title: "\u{1F50D} File Not Found",
166
- message: "The requested file or directory does not exist.",
167
- suggestion: "Verify the path and try again."
168
- })
169
- },
170
- {
171
- pattern: /permission denied|EACCES/i,
172
- formatter: () => ({
173
- title: "\u{1F512} Permission Denied",
174
- message: "You do not have permission to access this resource.",
175
- suggestion: "Check file permissions or run with appropriate privileges.",
176
- command: "sudo ccjk <command>"
177
- })
178
- },
179
- {
180
- pattern: /network|timeout|ETIMEDOUT|ECONNREFUSED/i,
181
- formatter: () => ({
182
- title: "\u{1F310} Network Error",
183
- message: "Unable to connect to the server.",
184
- suggestion: "Check your internet connection and firewall settings."
185
- })
186
- }
187
- ];
188
- for (const { pattern, formatter } of patterns) {
189
- const match = errorMsg.match(pattern);
190
- if (match) {
191
- return formatter(match);
192
- }
193
- }
194
- return {
195
- title: "\u274C Error",
196
- message: errorMsg,
197
- suggestion: context ? `Context: ${context}` : "Run ccjk doctor for diagnostics.",
198
- command: "ccjk doctor"
199
- };
200
- }
201
- function displayError(error, context) {
202
- const formatted = formatError(error, context);
203
- console.error();
204
- console.error(a.red(formatted.title));
205
- console.error(formatted.message);
206
- if (formatted.suggestion) {
207
- console.error();
208
- console.error(a.yellow("\u{1F4A1} Suggestion:"), formatted.suggestion);
209
- }
210
- if (formatted.command) {
211
- console.error(a.cyan(" Run:"), a.green(formatted.command));
212
- }
213
- if (formatted.docsUrl) {
214
- console.error(a.cyan(" Docs:"), a.blue(formatted.docsUrl));
215
- }
216
- console.error();
217
- }
218
-
219
- class ProgressTracker {
220
- currentStep = 0;
221
- totalSteps;
222
- steps;
223
- startTime;
224
- constructor(steps) {
225
- this.steps = steps;
226
- this.totalSteps = steps.length;
227
- this.startTime = Date.now();
228
- }
229
- start() {
230
- console.log();
231
- console.log(a.cyan("\u{1F680} Starting setup..."));
232
- console.log(a.gray(` ${this.totalSteps} steps to complete`));
233
- console.log();
234
- }
235
- nextStep(message) {
236
- this.currentStep++;
237
- const stepName = message || this.steps[this.currentStep - 1];
238
- const progress = Math.round(this.currentStep / this.totalSteps * 100);
239
- const bar = this.renderProgressBar(progress);
240
- console.log();
241
- console.log(a.cyan(`[${this.currentStep}/${this.totalSteps}]`), stepName);
242
- console.log(a.gray(` ${bar} ${progress}%`));
243
- }
244
- complete() {
245
- const duration = ((Date.now() - this.startTime) / 1e3).toFixed(1);
246
- console.log();
247
- console.log(a.green("\u2705 Setup complete!"));
248
- console.log(a.gray(` Completed in ${duration}s`));
249
- console.log();
250
- }
251
- error(message) {
252
- console.log();
253
- console.log(a.red("\u274C Setup failed"));
254
- console.log(a.white(` ${message}`));
255
- console.log();
256
- }
257
- renderProgressBar(percent) {
258
- const width = 20;
259
- const filled = Math.round(percent / 100 * width);
260
- const empty = width - filled;
261
- return a.green("\u2588".repeat(filled)) + a.gray("\u2591".repeat(empty));
262
- }
263
- }
264
-
265
- async function handleMultiConfigurations(options, codeToolType) {
266
- const { ensureI18nInitialized } = await import('./index2.mjs');
267
- ensureI18nInitialized();
268
- try {
269
- let configs = [];
270
- if (options.apiConfigs) {
271
- try {
272
- configs = JSON.parse(options.apiConfigs);
273
- } catch (error) {
274
- throw new Error(
275
- i18n.t("multi-config:invalidJson", {
276
- error: error instanceof Error ? error.message : String(error)
277
- })
278
- );
279
- }
280
- }
281
- if (options.apiConfigsFile) {
282
- try {
283
- const { readFile } = await import('./fs-operations.mjs');
284
- const fileContent = readFile(options.apiConfigsFile);
285
- configs = JSON.parse(fileContent);
286
- } catch (error) {
287
- throw new Error(
288
- i18n.t("multi-config:fileReadFailed", {
289
- error: error instanceof Error ? error.message : String(error)
290
- })
291
- );
292
- }
293
- }
294
- await validateApiConfigs(configs);
295
- if (codeToolType === "claude-code") {
296
- await handleClaudeCodeConfigs(configs);
297
- } else if (codeToolType === "clavue") {
298
- await handleMyclaudeConfigs(configs);
299
- } else if (codeToolType === "codex") {
300
- await handleCodexConfigs(configs);
301
- }
302
- console.log(a.green(`\u2714 ${i18n.t("multi-config:configsAddedSuccessfully")}`));
303
- } catch (error) {
304
- displayError(error, "Multi-config setup");
305
- throw error;
306
- }
307
- }
308
- async function validateApiConfigs(configs) {
309
- if (!Array.isArray(configs)) {
310
- throw new TypeError(i18n.t("multi-config:mustBeArray"));
311
- }
312
- const { getValidProviderIds } = await import('./api-providers.mjs');
313
- const validProviders = [...getValidProviderIds(), "custom"];
314
- const names = /* @__PURE__ */ new Set();
315
- for (const config of configs) {
316
- if (config.provider && !config.type) {
317
- config.type = "api_key";
318
- }
319
- if (config.provider && !config.name) {
320
- config.name = config.provider.toUpperCase();
321
- }
322
- if (!config.provider && !config.type) {
323
- throw new Error(i18n.t("multi-config:providerOrTypeRequired"));
324
- }
325
- if (config.provider && !validProviders.includes(config.provider)) {
326
- throw new Error(
327
- i18n.t("errors:invalidProvider", {
328
- provider: config.provider,
329
- validProviders: validProviders.join(", ")
330
- })
331
- );
332
- }
333
- if (!config.name || typeof config.name !== "string" || config.name.trim() === "") {
334
- throw new Error(i18n.t("multi-config:mustHaveValidName"));
335
- }
336
- if (!["api_key", "auth_token", "ccr_proxy"].includes(config.type)) {
337
- throw new Error(i18n.t("multi-config:invalidAuthType", { type: config.type }));
338
- }
339
- if (names.has(config.name)) {
340
- throw new Error(i18n.t("multi-config:duplicateName", { name: config.name }));
341
- }
342
- names.add(config.name);
343
- if (config.type !== "ccr_proxy" && !config.key) {
344
- throw new Error(i18n.t("multi-config:configApiKeyRequired", { name: config.name }));
345
- }
346
- }
347
- }
348
- async function handleClaudeCodeConfigs(configs) {
349
- const { ClaudeCodeConfigManager } = await import('./clavue-config.mjs').then(function (n) { return n.f; });
350
- const addedProfiles = [];
351
- for (const config of configs) {
352
- if (config.type === "ccr_proxy") {
353
- throw new Error(i18n.t("multi-config:ccrProxyReserved", { name: config.name }));
354
- }
355
- const profile = await convertToClaudeCodeProfile(config);
356
- const result = await ClaudeCodeConfigManager.addProfile(profile);
357
- if (!result.success) {
358
- throw new Error(
359
- i18n.t("multi-config:configProfileAddFailed", { name: config.name, error: result.error })
360
- );
361
- }
362
- const storedProfile = result.addedProfile || ClaudeCodeConfigManager.getProfileByName(config.name) || profile;
363
- addedProfiles.push(storedProfile);
364
- console.log(a.green(`\u2714 ${i18n.t("multi-config:profileAdded", { name: config.name })}`));
365
- }
366
- if (addedProfiles.length > 0) {
367
- const summary = addedProfiles.map((profile) => `${profile.name} [${profile.authType}]`).join(", ");
368
- console.log(a.gray(` \u2022 ${ClaudeCodeConfigManager.CONFIG_FILE}: ${summary}`));
369
- }
370
- const defaultConfig = configs.find((c) => c.default);
371
- if (defaultConfig) {
372
- const profile = addedProfiles.find((p) => p.name === defaultConfig.name) || ClaudeCodeConfigManager.getProfileByName(defaultConfig.name);
373
- if (profile && profile.id) {
374
- await ClaudeCodeConfigManager.switchProfile(profile.id);
375
- await ClaudeCodeConfigManager.applyProfileSettings(profile);
376
- console.log(
377
- a.green(`\u2714 ${i18n.t("multi-config:defaultProfileSet", { name: defaultConfig.name })}`)
378
- );
379
- }
380
- }
381
- await ClaudeCodeConfigManager.syncCcrProfile();
382
- }
383
- async function handleMyclaudeConfigs(configs) {
384
- const profiles = await Promise.all(configs.map((config) => convertToMyclaudeProviderProfile(config)));
385
- const activeProfile = profiles.find((_, index) => configs[index]?.default) || profiles[0];
386
- setMyclaudeProviderProfiles(profiles, activeProfile?.id);
387
- const summary = profiles.map((profile) => `${profile.name} [${profile.provider}]`).join(", ");
388
- console.log(a.gray(` \u2022 ~/.clavue/.clavue.json: ${summary}`));
389
- }
390
- async function handleCodexConfigs(configs) {
391
- const { addProviderToExisting } = await import('./codex-provider-manager.mjs');
392
- const addedProviderIds = [];
393
- for (const config of configs) {
394
- try {
395
- const provider = await convertToCodexProvider(config);
396
- const result = await addProviderToExisting(provider, config.key || "");
397
- if (!result.success) {
398
- throw new Error(
399
- i18n.t("multi-config:providerAddFailed", { name: config.name, error: result.error })
400
- );
401
- }
402
- addedProviderIds.push(provider.id);
403
- console.log(a.green(`\u2714 ${i18n.t("multi-config:providerAdded", { name: config.name })}`));
404
- } catch (error) {
405
- console.error(
406
- a.red(
407
- i18n.t("multi-config:providerAddFailed", {
408
- name: config.name,
409
- error: error instanceof Error ? error.message : String(error)
410
- })
411
- )
412
- );
413
- throw error;
414
- }
415
- }
416
- const defaultConfig = configs.find((c) => c.default);
417
- if (defaultConfig) {
418
- const { switchToProvider } = await import('./codex.mjs').then(function (n) { return n.t; });
419
- const displayName = defaultConfig.name || defaultConfig.provider || "custom";
420
- const providerId = displayName.toLowerCase().replace(/[^a-z0-9]/g, "-");
421
- if (addedProviderIds.includes(providerId)) {
422
- await switchToProvider(providerId);
423
- console.log(
424
- a.green(`\u2714 ${i18n.t("multi-config:defaultProviderSet", { name: displayName })}`)
425
- );
426
- } else {
427
- console.log(
428
- a.red(
429
- i18n.t("multi-config:providerAddFailed", {
430
- name: displayName,
431
- error: "provider not added"
432
- })
433
- )
434
- );
435
- }
436
- }
437
- }
438
- async function saveSingleConfigToToml(apiConfig, provider, options) {
439
- try {
440
- const { ClaudeCodeConfigManager } = await import('./clavue-config.mjs').then(function (n) { return n.f; });
441
- const profile = await convertSingleConfigToProfile(apiConfig, provider, options);
442
- const result = await ClaudeCodeConfigManager.addProfile(profile);
443
- if (result.success) {
444
- const savedProfile = result.addedProfile || ClaudeCodeConfigManager.getProfileByName(profile.name) || profile;
445
- if (savedProfile.id) {
446
- await ClaudeCodeConfigManager.switchProfile(savedProfile.id);
447
- await ClaudeCodeConfigManager.applyProfileSettings(savedProfile);
448
- }
449
- console.log(
450
- a.green(`\u2714 ${i18n.t("configuration:singleConfigSaved", { name: profile.name })}`)
451
- );
452
- } else {
453
- console.warn(
454
- a.yellow(`${i18n.t("configuration:singleConfigSaveFailed")}: ${result.error}`)
455
- );
456
- }
457
- } catch (error) {
458
- console.warn(
459
- a.yellow(
460
- `${i18n.t("configuration:singleConfigSaveFailed")}: ${error instanceof Error ? error.message : String(error)}`
461
- )
462
- );
463
- }
464
- }
465
- async function buildClaudeCodeProfile(params) {
466
- const { ClaudeCodeConfigManager } = await import('./clavue-config.mjs').then(function (n) { return n.f; });
467
- let {
468
- url: baseUrl,
469
- authType,
470
- primaryModel,
471
- defaultHaikuModel,
472
- defaultSonnetModel,
473
- defaultOpusModel
474
- } = params;
475
- baseUrl = baseUrl || API_DEFAULT_URL;
476
- if (params.provider && params.provider !== "custom") {
477
- const { getProviderPreset } = await import('./api-providers.mjs');
478
- const preset = getProviderPreset(params.provider);
479
- if (preset?.claudeCode) {
480
- baseUrl = params.url || preset.claudeCode.baseUrl;
481
- authType = preset.claudeCode.authType;
482
- const modelSlots = resolveClaudeFamilyModelSlots({
483
- defaultModels: preset.claudeCode.defaultModels,
484
- selectedModel: primaryModel
485
- });
486
- primaryModel = modelSlots.primaryModel;
487
- defaultHaikuModel = defaultHaikuModel || modelSlots.haikuModel;
488
- defaultSonnetModel = defaultSonnetModel || modelSlots.sonnetModel;
489
- defaultOpusModel = defaultOpusModel || modelSlots.opusModel;
490
- }
491
- }
492
- return {
493
- name: params.name,
494
- authType,
495
- provider: params.provider || "custom",
496
- apiKey: params.key,
497
- baseUrl,
498
- primaryModel,
499
- defaultHaikuModel,
500
- defaultSonnetModel,
501
- defaultOpusModel,
502
- id: ClaudeCodeConfigManager.generateProfileId(params.name)
503
- };
504
- }
505
- async function convertSingleConfigToProfile(apiConfig, provider, options) {
506
- return buildClaudeCodeProfile({
507
- name: provider && provider !== "custom" ? provider : "custom-config",
508
- key: apiConfig.key,
509
- authType: apiConfig.authType,
510
- url: apiConfig.url,
511
- provider,
512
- primaryModel: options?.apiModel,
513
- defaultHaikuModel: options?.apiHaikuModel,
514
- defaultSonnetModel: options?.apiSonnetModel,
515
- defaultOpusModel: options?.apiOpusModel
516
- });
517
- }
518
- async function convertToClaudeCodeProfile(config) {
519
- return buildClaudeCodeProfile({
520
- name: config.name,
521
- key: config.key,
522
- authType: (config.type === "ccr_proxy" ? "api_key" : config.type) || "api_key",
523
- url: config.url,
524
- provider: config.provider,
525
- primaryModel: config.primaryModel,
526
- defaultHaikuModel: config.defaultHaikuModel,
527
- defaultSonnetModel: config.defaultSonnetModel,
528
- defaultOpusModel: config.defaultOpusModel
529
- });
530
- }
531
- async function convertToMyclaudeProviderProfile(config) {
532
- const claudeProfile = await convertToClaudeCodeProfile(config);
533
- return {
534
- id: claudeProfile.id || claudeProfile.name,
535
- name: claudeProfile.name,
536
- provider: config.provider || "custom",
537
- apiKey: claudeProfile.apiKey,
538
- baseUrl: claudeProfile.baseUrl,
539
- model: claudeProfile.primaryModel,
540
- fastModel: claudeProfile.defaultHaikuModel,
541
- authType: claudeProfile.authType,
542
- primaryModel: claudeProfile.primaryModel,
543
- defaultHaikuModel: claudeProfile.defaultHaikuModel,
544
- defaultSonnetModel: claudeProfile.defaultSonnetModel,
545
- defaultOpusModel: claudeProfile.defaultOpusModel
546
- };
547
- }
548
- async function convertToCodexProvider(config) {
549
- const displayName = config.name || config.provider || "custom";
550
- const providerId = displayName.toLowerCase().replace(/[^a-z0-9]/g, "-");
551
- let baseUrl = config.url || API_DEFAULT_URL;
552
- let model = config.primaryModel || "gpt-5-codex";
553
- let wireApi = "responses";
554
- if (config.provider && config.provider !== "custom") {
555
- const { getProviderPreset } = await import('./api-providers.mjs');
556
- const preset = getProviderPreset(config.provider);
557
- if (preset?.codex) {
558
- baseUrl = config.url || preset.codex.baseUrl;
559
- model = config.primaryModel || preset.codex.defaultModel || model;
560
- wireApi = preset.codex.wireApi;
561
- }
562
- }
563
- return {
564
- id: providerId,
565
- name: displayName,
566
- baseUrl,
567
- wireApi,
568
- tempEnvKey: `${displayName}_API_KEY`.replace(/\W/g, "_").toUpperCase(),
569
- requiresOpenaiAuth: false,
570
- model
571
- };
572
- }
573
-
574
- async function validateSkipPromptOptions(options) {
575
- if (options.allLang) {
576
- if (options.allLang === "zh-CN" || options.allLang === "en") {
577
- options.configLang = options.allLang;
578
- options.aiOutputLang = options.allLang;
579
- } else {
580
- options.configLang = "en";
581
- options.aiOutputLang = options.allLang;
582
- }
583
- }
584
- if (options.provider) {
585
- const { getValidProviderIds, getProviderPreset } = await import('./api-providers.mjs');
586
- const validProviders = [...getValidProviderIds(), "custom"];
587
- if (!validProviders.includes(options.provider)) {
588
- throw new Error(
589
- i18n.t("errors:invalidProvider", {
590
- provider: options.provider,
591
- validProviders: validProviders.join(", ")
592
- })
593
- );
594
- }
595
- if (!options.apiType) {
596
- const preset = options.provider !== "custom" ? getProviderPreset(options.provider) : null;
597
- options.apiType = preset?.claudeCode?.authType || "api_key";
598
- }
599
- }
600
- if (!options.configAction) {
601
- options.configAction = "backup";
602
- }
603
- if (typeof options.outputStyles === "string") {
604
- if (options.outputStyles === "skip") {
605
- options.outputStyles = false;
606
- } else if (options.outputStyles === "all") {
607
- options.outputStyles = ["speed-coder", "senior-architect", "pair-programmer"];
608
- } else {
609
- options.outputStyles = options.outputStyles.split(",").map((s) => s.trim());
610
- }
611
- }
612
- if (options.outputStyles === void 0) {
613
- options.outputStyles = ["speed-coder", "senior-architect", "pair-programmer"];
614
- }
615
- if (!options.defaultOutputStyle) {
616
- options.defaultOutputStyle = "senior-architect";
617
- }
618
- if (typeof options.installCometixLine === "string") {
619
- options.installCometixLine = options.installCometixLine.toLowerCase() === "true";
620
- }
621
- if (options.installCometixLine === void 0) {
622
- options.installCometixLine = true;
623
- }
624
- if (typeof options.installSuperpowers === "string") {
625
- options.installSuperpowers = options.installSuperpowers.toLowerCase() === "true";
626
- }
627
- if (options.installSuperpowers === void 0) {
628
- options.installSuperpowers = false;
629
- }
630
- if (typeof options.installAgentBrowser === "string") {
631
- options.installAgentBrowser = options.installAgentBrowser.toLowerCase() === "true";
632
- }
633
- if (options.installAgentBrowser === void 0) {
634
- options.installAgentBrowser = true;
635
- }
636
- if (options.configAction && !["new", "backup", "merge", "docs-only", "skip"].includes(options.configAction)) {
637
- throw new Error(i18n.t("errors:invalidConfigAction", { value: options.configAction }));
638
- }
639
- if (options.apiType && !["auth_token", "api_key", "ccr_proxy", "skip"].includes(options.apiType)) {
640
- throw new Error(i18n.t("errors:invalidApiType", { value: options.apiType }));
641
- }
642
- if (options.apiConfigs && options.apiConfigsFile) {
643
- throw new Error(i18n.t("multi-config:conflictingParams"));
644
- }
645
- const modelParams = [
646
- ["apiModel", options.apiModel],
647
- ["apiHaikuModel", options.apiHaikuModel],
648
- ["apiSonnetModel", options.apiSonnetModel],
649
- ["apiOpusModel", options.apiOpusModel]
650
- ];
651
- for (const [key, value] of modelParams) {
652
- if (value !== void 0 && typeof value !== "string") {
653
- if (key === "apiModel")
654
- throw new Error(i18n.t("errors:invalidApiModel", { value }));
655
- throw new Error(i18n.t("errors:invalidModelParam", { key, value }));
656
- }
657
- }
658
- if (options.apiType === "api_key" && !options.apiKey) {
659
- throw new Error(i18n.t("errors:apiKeyRequiredForApiKey"));
660
- }
661
- if (options.apiType === "auth_token" && !options.apiKey) {
662
- throw new Error(i18n.t("errors:apiKeyRequiredForAuthToken"));
663
- }
664
- if (typeof options.mcpServices === "string") {
665
- if (options.mcpServices === "skip") {
666
- options.mcpServices = false;
667
- } else if (options.mcpServices === "all") {
668
- options.mcpServices = MCP_SERVICE_CONFIGS.filter((s) => !s.requiresApiKey).map((s) => s.id);
669
- } else {
670
- options.mcpServices = options.mcpServices.split(",").map((s) => s.trim());
671
- }
672
- }
673
- if (Array.isArray(options.mcpServices)) {
674
- const validServices = MCP_SERVICE_CONFIGS.map((s) => s.id);
675
- for (const service of options.mcpServices) {
676
- if (!validServices.includes(service)) {
677
- throw new Error(
678
- i18n.t("errors:invalidMcpService", { service, validServices: validServices.join(", ") })
679
- );
680
- }
681
- }
682
- }
683
- if (Array.isArray(options.outputStyles)) {
684
- const validStyles = [
685
- "speed-coder",
686
- "senior-architect",
687
- "pair-programmer",
688
- "default",
689
- "explanatory",
690
- "learning"
691
- ];
692
- for (const style of options.outputStyles) {
693
- if (!validStyles.includes(style)) {
694
- throw new Error(
695
- i18n.t("errors:invalidOutputStyle", { style, validStyles: validStyles.join(", ") })
696
- );
697
- }
698
- }
699
- }
700
- if (options.defaultOutputStyle) {
701
- const validStyles = [
702
- "speed-coder",
703
- "senior-architect",
704
- "pair-programmer",
705
- "default",
706
- "explanatory",
707
- "learning"
708
- ];
709
- if (!validStyles.includes(options.defaultOutputStyle)) {
710
- throw new Error(
711
- i18n.t("errors:invalidDefaultOutputStyle", {
712
- style: options.defaultOutputStyle,
713
- validStyles: validStyles.join(", ")
714
- })
715
- );
716
- }
717
- }
718
- if (options.orchestration !== void 0) {
719
- parseOrchestrationLevel(options.orchestration);
720
- }
721
- if (typeof options.workflows === "string") {
722
- if (options.workflows === "skip") {
723
- options.workflows = false;
724
- } else if (options.workflows === "all") {
725
- options.workflows = WORKFLOW_CONFIG_BASE.map((w) => w.id);
726
- } else {
727
- options.workflows = options.workflows.split(",").map((s) => s.trim());
728
- }
729
- }
730
- if (Array.isArray(options.workflows)) {
731
- const validWorkflows = WORKFLOW_CONFIG_BASE.map((w) => w.id);
732
- for (const workflow of options.workflows) {
733
- if (!validWorkflows.includes(workflow)) {
734
- throw new Error(
735
- i18n.t("errors:invalidWorkflow", { workflow, validWorkflows: validWorkflows.join(", ") })
736
- );
737
- }
738
- }
739
- }
740
- if (options.mcpServices === void 0) {
741
- options.mcpServices = "all";
742
- options.mcpServices = MCP_SERVICE_CONFIGS.filter((s) => !s.requiresApiKey).map((s) => s.id);
743
- }
744
- if (options.workflows === void 0) {
745
- options.workflows = "all";
746
- options.workflows = WORKFLOW_CONFIG_BASE.map((w) => w.id);
747
- }
748
- if (options.orchestration === void 0) {
749
- options.orchestration = "max";
750
- }
751
- }
752
- async function silentInit(options = {}) {
753
- try {
754
- try {
755
- const { cleanupZcfNamespace } = await import('./cleanup-migration.mjs');
756
- cleanupZcfNamespace();
757
- } catch {
758
- }
759
- const { detectSmartDefaults } = await import('./code-type-resolver.mjs').then(function (n) { return n.b; });
760
- const defaults = await detectSmartDefaults();
761
- if (!defaults.apiKey) {
762
- throw new Error("Silent mode requires ANTHROPIC_API_KEY environment variable");
763
- }
764
- options.skipPrompt = true;
765
- options.skipBanner = true;
766
- options.initSource = "silent-init";
767
- options.yes = true;
768
- options.silent = false;
769
- options.apiType = "api_key";
770
- options.apiKey = defaults.apiKey;
771
- if (defaults.apiProvider && defaults.apiProvider !== "anthropic") {
772
- options.provider = defaults.apiProvider;
773
- }
774
- const topMcpServices = defaults.mcpServices.slice(0, 3);
775
- options.mcpServices = topMcpServices;
776
- options.codeType = defaults.codeToolType || "claude-code";
777
- options.configAction = "backup";
778
- options.installCometixLine = false;
779
- options.installSuperpowers = false;
780
- options.installAgentBrowser = options.installAgentBrowser ?? true;
781
- options.workflows = false;
782
- options.orchestration = options.orchestration || defaults.workflows.orchestrationLevel || "minimal";
783
- console.log(`Initializing CCJK (silent mode)...`);
784
- console.log(` Code Tool: ${defaults.codeToolType}`);
785
- console.log(` API Provider: ${defaults.apiProvider || "anthropic"}`);
786
- console.log(` MCP Services: ${topMcpServices.join(", ")}`);
787
- const { init } = await Promise.resolve().then(function () { return init$1; });
788
- await init(options);
789
- console.log("\u2713 CCJK initialized successfully");
790
- } catch (error) {
791
- displayError(error, "Silent initialization");
792
- throw error;
793
- }
794
- }
795
- async function handleSuperpowersInstallation(options) {
796
- try {
797
- const status = await checkSuperpowersInstalled();
798
- if (status.installed) {
799
- console.log(a.green(`\u2714 ${i18n.t("superpowers:alreadyInstalled")}`));
800
- if (status.version) {
801
- console.log(
802
- a.gray(` ${i18n.t("superpowers:status.version", { version: status.version })}`)
803
- );
804
- }
805
- if (status.skillCount) {
806
- console.log(
807
- a.gray(` ${i18n.t("superpowers:status.skillCount", { count: status.skillCount })}`)
808
- );
809
- }
810
- return;
811
- }
812
- let shouldInstall = false;
813
- if (options.skipPrompt) {
814
- shouldInstall = options.installSuperpowers === true;
815
- } else {
816
- console.log(a.green(`
817
- ${i18n.t("superpowers:title")}`));
818
- console.log(a.gray(i18n.t("superpowers:description")));
819
- console.log(a.gray(i18n.t("superpowers:installPromptDescription")));
820
- shouldInstall = await promptBoolean({
821
- message: i18n.t("superpowers:installPrompt"),
822
- defaultValue: false
823
- });
824
- }
825
- if (!shouldInstall) {
826
- console.log(a.yellow(i18n.t("common:skip")));
827
- return;
828
- }
829
- const result = await installSuperpowers({
830
- lang: i18n.language,
831
- skipPrompt: options.skipPrompt
832
- });
833
- if (result.success) {
834
- console.log(a.green(`\u2714 ${result.message}`));
835
- } else {
836
- console.error(a.red(`\u2716 ${result.message}`));
837
- if (result.error) {
838
- console.error(a.gray(` ${result.error}`));
839
- }
840
- }
841
- } catch (error) {
842
- const errorMessage = error instanceof Error ? error.message : String(error);
843
- console.error(a.red(`${i18n.t("superpowers:installFailed")}: ${errorMessage}`));
844
- }
845
- }
846
- async function smartInit(options = {}) {
847
- try {
848
- console.log(a.bold.green("\n\u{1F9E0} Smart Initialization Mode\n"));
849
- console.log(a.gray("Analyzing your project to generate optimal configuration...\n"));
850
- const { analyzeProject } = await import('./index13.mjs');
851
- const analysis = await analyzeProject();
852
- console.log(a.cyan("\u{1F4CA} Project Analysis:"));
853
- console.log(a.gray(` \u2022 Type: ${analysis.projectType}`));
854
- console.log(a.gray(` \u2022 Languages: ${analysis.techStack.languages.join(", ")}`));
855
- console.log(a.gray(` \u2022 Runtime: ${analysis.techStack.runtime}`));
856
- if (analysis.frameworks.length > 0) {
857
- console.log(a.gray(` \u2022 Frameworks: ${analysis.frameworks.join(", ")}`));
858
- }
859
- if (analysis.buildTool) {
860
- console.log(a.gray(` \u2022 Build Tool: ${analysis.buildTool}`));
861
- }
862
- console.log(a.gray(` \u2022 Has Tests: ${analysis.hasTests ? "Yes" : "No"}`));
863
- console.log(a.gray(` \u2022 Has Database: ${analysis.hasDatabase ? "Yes" : "No"}`));
864
- console.log(a.gray(` \u2022 Has API: ${analysis.hasApi ? "Yes" : "No"}`));
865
- if (analysis.cicd.length > 0) {
866
- console.log(a.gray(` \u2022 CI/CD: ${analysis.cicd.join(", ")}`));
867
- }
868
- console.log("");
869
- const { selectTemplates } = await import('./index13.mjs');
870
- const selection = await selectTemplates(analysis);
871
- console.log(a.cyan("\u{1F3AF} Template Selection:"));
872
- console.log(a.gray(` \u2022 Agents: ${selection.agents.length} selected`));
873
- for (const agent of selection.agents) {
874
- console.log(a.gray(` - ${agent.name} (${agent.category})`));
875
- }
876
- console.log(a.gray(` \u2022 Skills: ${selection.skills.length} selected`));
877
- for (const skill of selection.skills) {
878
- console.log(a.gray(` - ${skill.name} (${skill.category})`));
879
- }
880
- console.log("");
881
- console.log(a.cyan("\u{1F4A1} Reasoning:"));
882
- console.log(
883
- a.gray(
884
- selection.reasoning.split("\n").map((line) => ` ${line}`).join("\n")
885
- )
886
- );
887
- console.log("");
888
- if (!options.skipPrompt && !options.yes) {
889
- const shouldContinue = await promptBoolean({
890
- message: "Proceed with this configuration?",
891
- defaultValue: true
892
- });
893
- if (!shouldContinue) {
894
- console.log(a.yellow("Smart initialization cancelled."));
895
- return;
896
- }
897
- }
898
- console.log(a.gray("\n\u{1F527} Generating configurations...\n"));
899
- const { generateConfigs, writeConfigs } = await import('./index13.mjs');
900
- const config = await generateConfigs(selection);
901
- await writeConfigs(config);
902
- console.log(a.green("\u2714 Configurations generated successfully!"));
903
- console.log(a.gray(` \u2022 ${config.agents.length} agents installed`));
904
- console.log(a.gray(` \u2022 ${config.skills.length} skills installed`));
905
- console.log("");
906
- console.log(a.gray("Running standard initialization...\n"));
907
- options.smart = false;
908
- options.skipPrompt = options.skipPrompt ?? false;
909
- const { init } = await Promise.resolve().then(function () { return init$1; });
910
- await init(options);
911
- console.log("");
912
- console.log(a.bold.green("\u2705 Smart Initialization Complete!"));
913
- console.log("");
914
- console.log(a.cyan("\u{1F3AF} What was configured:"));
915
- console.log(a.gray(" \u2022 Project-specific agents and skills"));
916
- console.log(a.gray(" \u2022 Claude Code base configuration"));
917
- console.log(a.gray(" \u2022 MCP services"));
918
- console.log(a.gray(" \u2022 Workflows and output styles"));
919
- console.log("");
920
- console.log(a.cyan("\u{1F680} Next Steps:"));
921
- console.log(a.gray(" 1. Run: claude"));
922
- console.log(a.gray(" 2. Start coding with AI assistance!"));
923
- console.log(a.gray(" 3. Use generated skills with their triggers"));
924
- console.log("");
925
- } catch (error) {
926
- console.error(
927
- a.red("\u274C Smart initialization failed:"),
928
- error instanceof Error ? error.message : error
929
- );
930
- throw error;
931
- }
932
- }
933
-
934
- const ccjkVersion = getRuntimeVersion();
935
- function getDefaultArchetypeProfile(codeToolType) {
936
- if (codeToolType === "clavue") {
937
- return {
938
- id: "pc-dev",
939
- name: "PC Software Development",
940
- goal: "Use Clavue as the primary execution runtime for coding, debugging, testing, and shipping"
941
- };
942
- }
943
- return {
944
- id: "pc-dev",
945
- name: "PC Software Development",
946
- goal: "Build, debug, test, and ship software efficiently"
947
- };
948
- }
949
- function getSetupCompletionGuidance(codeToolType) {
950
- if (codeToolType === "clavue") {
951
- return {
952
- step1: i18n.t("configuration:guidanceStep1", { runtime: "clavue" }),
953
- step1Detail: i18n.t("configuration:guidanceStep1MyclaudeDetail"),
954
- step1Detail2: i18n.t("configuration:guidanceStep1MyclaudeDetail2"),
955
- step2: i18n.t("configuration:guidanceStep2"),
956
- step2Example: i18n.t("configuration:guidanceStep2Example"),
957
- step3: i18n.t("configuration:guidanceStep3Myclaude"),
958
- step3Command: i18n.t("configuration:guidanceStep3MyclaudeCommand"),
959
- step4: i18n.t("configuration:guidanceStep4"),
960
- step4Command: i18n.t("configuration:guidanceStep4Command"),
961
- step5: i18n.t("configuration:guidanceStep5"),
962
- step5Command: i18n.t("configuration:guidanceStep5Command")
963
- };
964
- }
965
- const runtimeLabel = CODE_TOOL_INFO[codeToolType]?.name || "Claude Code";
966
- return {
967
- step1: i18n.t("configuration:guidanceStep1", { runtime: runtimeLabel }),
968
- step1Detail: i18n.t("configuration:guidanceStep1Detail"),
969
- step1Detail2: i18n.t("configuration:guidanceStep1Detail2"),
970
- step2: i18n.t("configuration:guidanceStep2"),
971
- step2Example: i18n.t("configuration:guidanceStep2Example"),
972
- step3: i18n.t("configuration:guidanceStep3"),
973
- step3Command: i18n.t("configuration:guidanceStep3Command"),
974
- step4: i18n.t("configuration:guidanceStep4"),
975
- step4Command: i18n.t("configuration:guidanceStep4Command"),
976
- step5: i18n.t("configuration:guidanceStep5"),
977
- step5Command: i18n.t("configuration:guidanceStep5Command")
978
- };
979
- }
980
- async function init(options = {}) {
981
- options.initSource = options.initSource || "init";
982
- options.orchestration = parseOrchestrationLevel(options.orchestration);
983
- try {
984
- const { cleanupZcfNamespace } = await import('./cleanup-migration.mjs');
985
- const { removed } = cleanupZcfNamespace();
986
- if (removed.length > 0) {
987
- console.log(a.dim(`Cleaned up legacy zcf namespace: ${removed.join(", ")}`));
988
- }
989
- } catch {
990
- }
991
- if (options.silent) {
992
- return await silentInit(options);
993
- }
994
- if (options.smart) {
995
- return await smartInit(options);
996
- }
997
- if (options.skipPrompt) {
998
- await validateSkipPromptOptions(options);
999
- }
1000
- try {
1001
- const tracker = new ProgressTracker([
1002
- "Reading configuration",
1003
- "Selecting code tool",
1004
- "Configuring API",
1005
- "Installing MCP services",
1006
- "Setting up workflows",
1007
- "Finalizing setup"
1008
- ]);
1009
- if (!options.skipPrompt && !options.skipBanner) {
1010
- tracker.start();
1011
- }
1012
- if (!options.skipPrompt && !options.skipBanner)
1013
- tracker.nextStep();
1014
- const zcfConfig = readZcfConfig();
1015
- if (!options.skipPrompt && !options.skipBanner)
1016
- tracker.nextStep();
1017
- let codeToolType;
1018
- try {
1019
- codeToolType = await resolveStartupCodeType({
1020
- codeTypeParam: options.codeType,
1021
- interactive: !options.skipPrompt
1022
- });
1023
- } catch (error) {
1024
- const errorMessage = error instanceof Error ? error.message : String(error);
1025
- console.error(a.red(`${i18n.t("errors:generalError")} ${errorMessage}`));
1026
- codeToolType = await resolveCodeType(options.codeType).catch(() => DEFAULT_CODE_TOOL_TYPE);
1027
- }
1028
- options.codeType = codeToolType;
1029
- async function selectApiConfigurationMode() {
1030
- const { apiMode } = await inquirer.prompt({
1031
- type: "list",
1032
- name: "apiMode",
1033
- message: i18n.t("api:selectApiMode"),
1034
- choices: [
1035
- {
1036
- name: i18n.t("api:useOfficialLogin"),
1037
- value: "official"
1038
- },
1039
- {
1040
- name: i18n.t("api:customApiConfig"),
1041
- value: "custom"
1042
- },
1043
- {
1044
- name: i18n.t("api:useCcrProxy"),
1045
- value: "ccr"
1046
- },
1047
- {
1048
- name: i18n.t("api:skipApi"),
1049
- value: "skip"
1050
- }
1051
- ]
1052
- });
1053
- return apiMode;
1054
- }
1055
- async function handleCustomApiConfiguration(existingConfig) {
1056
- if (codeToolType === "claude-code" || codeToolType === "clavue") {
1057
- const { configureIncrementalManagement } = await import('./claude-code-incremental-manager.mjs');
1058
- await configureIncrementalManagement();
1059
- return null;
1060
- }
1061
- if (existingConfig) {
1062
- const customConfigAction = await promptApiConfigurationAction();
1063
- if (customConfigAction === "modify-partial") {
1064
- await modifyApiConfigPartially(existingConfig);
1065
- return null;
1066
- } else if (customConfigAction === "modify-all") {
1067
- return await configureApiCompletely();
1068
- } else if (customConfigAction === "keep-existing") {
1069
- try {
1070
- addCompletedOnboarding(codeToolType);
1071
- } catch (error) {
1072
- console.error(a.red(i18n.t("errors:failedToSetOnboarding")), error);
1073
- }
1074
- try {
1075
- setPrimaryApiKey(codeToolType);
1076
- } catch (error) {
1077
- const { ensureI18nInitialized, i18n: i18nModule } = await import('./index2.mjs');
1078
- ensureI18nInitialized();
1079
- console.error(i18nModule.t("mcp:primaryApiKeySetFailed"), error);
1080
- }
1081
- return null;
1082
- }
1083
- } else {
1084
- const { apiChoice } = await inquirer.prompt({
1085
- type: "list",
1086
- name: "apiChoice",
1087
- message: i18n.t("api:configureApi"),
1088
- choices: [
1089
- {
1090
- name: `${i18n.t("api:useAuthToken")} - ${a.gray(i18n.t("api:authTokenDesc"))}`,
1091
- value: "auth_token",
1092
- short: i18n.t("api:useAuthToken")
1093
- },
1094
- {
1095
- name: `${i18n.t("api:useApiKey")} - ${a.gray(i18n.t("api:apiKeyDesc"))}`,
1096
- value: "api_key",
1097
- short: i18n.t("api:useApiKey")
1098
- }
1099
- ]
1100
- });
1101
- if (!apiChoice) {
1102
- console.log(a.yellow(i18n.t("common:cancelled")));
1103
- process__default.exit(0);
1104
- }
1105
- return await configureApiCompletely(apiChoice);
1106
- }
1107
- }
1108
- if (!options.skipBanner) {
1109
- displayBannerWithInfo(CODE_TOOL_BANNERS[codeToolType] || "CCJK");
1110
- }
1111
- if (isTermux()) {
1112
- console.log(a.yellow(`
1113
- \u2139 ${i18n.t("installation:termuxDetected")}`));
1114
- console.log(a.gray(i18n.t("installation:termuxEnvironmentInfo")));
1115
- }
1116
- let configLang = options.configLang;
1117
- if (codeToolType === "codex") {
1118
- if (!configLang) {
1119
- if (options.skipPrompt) {
1120
- configLang = zcfConfig?.templateLang || "en";
1121
- } else {
1122
- configLang = zcfConfig?.templateLang || i18n.language || "en";
1123
- }
1124
- }
1125
- } else {
1126
- if (!configLang) {
1127
- const { resolveTemplateLanguage } = await import('./prompts.mjs');
1128
- configLang = await resolveTemplateLanguage(
1129
- options.configLang,
1130
- zcfConfig,
1131
- options.skipPrompt,
1132
- codeToolType
1133
- );
1134
- }
1135
- }
1136
- if (!configLang) {
1137
- configLang = "en";
1138
- }
1139
- if (codeToolType === "codex") {
1140
- if (options.skipPrompt)
1141
- process__default.env.CCJK_CODEX_SKIP_PROMPT_SINGLE_BACKUP = "true";
1142
- const hasApiConfigs = Boolean(options.apiConfigs || options.apiConfigsFile);
1143
- const apiMode = hasApiConfigs ? "skip" : options.apiType === "auth_token" ? "official" : options.apiType === "api_key" ? "custom" : options.apiType === "skip" ? "skip" : options.skipPrompt ? "skip" : void 0;
1144
- const customApiConfig = !hasApiConfigs && options.apiType === "api_key" && options.apiKey ? {
1145
- type: "api_key",
1146
- token: options.apiKey,
1147
- baseUrl: options.apiUrl,
1148
- model: options.apiModel
1149
- // Add model parameter for Codex
1150
- } : void 0;
1151
- let selectedWorkflows;
1152
- if (Array.isArray(options.workflows)) {
1153
- selectedWorkflows = options.workflows;
1154
- } else if (typeof options.workflows === "string") {
1155
- selectedWorkflows = [options.workflows];
1156
- } else if (options.workflows === true) {
1157
- selectedWorkflows = [];
1158
- }
1159
- if (hasApiConfigs) {
1160
- await handleMultiConfigurations(options, "codex");
1161
- }
1162
- const resolvedAiOutputLang = await runCodexFullInit({
1163
- aiOutputLang: options.aiOutputLang,
1164
- skipPrompt: options.skipPrompt,
1165
- apiMode,
1166
- customApiConfig,
1167
- workflows: selectedWorkflows
1168
- });
1169
- updateZcfConfig({
1170
- version: ccjkVersion,
1171
- preferredLang: i18n.language,
1172
- // CCJK界面语言
1173
- templateLang: configLang,
1174
- // 模板语言
1175
- aiOutputLang: resolvedAiOutputLang ?? options.aiOutputLang ?? zcfConfig?.aiOutputLang ?? "en",
1176
- codeToolType
1177
- });
1178
- console.log(a.green(i18n.t("codex:setupComplete")));
1179
- return;
1180
- }
1181
- const aiOutputLang = await resolveAiOutputLanguage(
1182
- i18n.language,
1183
- options.aiOutputLang,
1184
- zcfConfig,
1185
- options.skipPrompt
1186
- );
1187
- const installerCodeType = isClaudeFamilyCodeTool(codeToolType) ? codeToolType : "claude-code";
1188
- const installationStatus = await getInstallationStatus(installerCodeType);
1189
- const codeToolName = CODE_TOOL_INFO[codeToolType].name;
1190
- if (isClaudeFamilyCodeTool(codeToolType)) {
1191
- if (installationStatus.hasGlobal) {
1192
- const { verifyInstallation, displayVerificationResult } = await import('./installer.mjs');
1193
- const verification = await verifyInstallation(installerCodeType);
1194
- if (verification.symlinkCreated) {
1195
- console.log(a.green(`\u2714 ${codeToolName} ${i18n.t("installation:alreadyInstalled")}`));
1196
- displayVerificationResult(verification, installerCodeType);
1197
- } else if (!verification.success) {
1198
- console.log(a.yellow(`\u26A0 ${i18n.t("installation:verificationFailed")}`));
1199
- if (verification.error) {
1200
- console.log(a.gray(` ${verification.error}`));
1201
- }
1202
- }
1203
- } else {
1204
- if (options.skipPrompt) {
1205
- if (codeToolType === "clavue") {
1206
- await installMyclaude(true);
1207
- } else {
1208
- await installClaudeCode(true);
1209
- }
1210
- } else {
1211
- const shouldInstall = await promptBoolean({
1212
- message: i18n.t("installation:installPrompt"),
1213
- defaultValue: true
1214
- });
1215
- if (shouldInstall) {
1216
- if (codeToolType === "clavue") {
1217
- await installMyclaude(false);
1218
- } else {
1219
- await installClaudeCode(false);
1220
- }
1221
- } else {
1222
- console.log(a.yellow(i18n.t("common:skip")));
1223
- }
1224
- }
1225
- }
1226
- if (installationStatus.hasGlobal && codeToolType === "claude-code") {
1227
- await checkClaudeCodeVersionAndPrompt(options.skipPrompt);
1228
- }
1229
- }
1230
- ensureClaudeDir(codeToolType);
1231
- if (needsMigration(codeToolType)) {
1232
- if (options.skipPrompt) {
1233
- console.log(a.yellow("\n\u26A0\uFE0F Problematic configuration detected. Auto-fixing...\n"));
1234
- const result = migrateSettingsForTokenRetrieval(codeToolType);
1235
- displayMigrationResult(result);
1236
- } else {
1237
- const shouldMigrate = await promptMigration();
1238
- if (shouldMigrate) {
1239
- const result = migrateSettingsForTokenRetrieval(codeToolType);
1240
- displayMigrationResult(result);
1241
- }
1242
- }
1243
- }
1244
- let action = "new";
1245
- const runtimeTarget = resolveClaudeFamilySettingsTarget(codeToolType);
1246
- if (existsSync(runtimeTarget.settingsFile) && !options.force) {
1247
- if (options.skipPrompt) {
1248
- action = options.configAction || "backup";
1249
- if (action === "skip") {
1250
- console.log(a.yellow(i18n.t("common:skip")));
1251
- return;
1252
- }
1253
- } else {
1254
- const { action: userAction } = await inquirer.prompt({
1255
- type: "list",
1256
- name: "action",
1257
- message: i18n.t("configuration:existingConfig"),
1258
- choices: addNumbersToChoices([
1259
- { name: i18n.t("configuration:backupAndOverwrite"), value: "backup" },
1260
- { name: i18n.t("configuration:updateDocsOnly"), value: "docs-only" },
1261
- { name: i18n.t("configuration:mergeConfig"), value: "merge" },
1262
- { name: i18n.t("common:skip"), value: "skip" }
1263
- ])
1264
- });
1265
- if (!userAction) {
1266
- console.log(a.yellow(i18n.t("common:cancelled")));
1267
- process__default.exit(0);
1268
- }
1269
- action = userAction;
1270
- if (action === "skip") {
1271
- console.log(a.yellow(i18n.t("common:skip")));
1272
- return;
1273
- }
1274
- }
1275
- } else if (options.skipPrompt && options.configAction) {
1276
- action = options.configAction;
1277
- }
1278
- const isNewInstall = !existsSync(runtimeTarget.settingsFile);
1279
- if (!options.skipPrompt && (isNewInstall || ["backup", "merge", "new"].includes(action))) {
1280
- const isZh = i18n.language === "zh-CN";
1281
- console.log("");
1282
- console.log(
1283
- a.bold.cyan(
1284
- isZh ? "\u{1F48E} \u9876\u7EA7\u5927\u795E\u7F16\u6392\u7406\u5FF5\uFF08\u9ED8\u8BA4\u9996\u9009\uFF09" : "\u{1F48E} Expert Workflow Orchestration (Default First Choice)"
1285
- )
1286
- );
1287
- console.log(
1288
- a.dim(
1289
- isZh ? "\u53EF\u540C\u6B65\u4F18\u5316\u89C4\u5212\u3001\u9A8C\u8BC1\u3001\u5B50\u4EE3\u7406\u4E0E\u89C4\u5219\u6267\u884C\u8D28\u91CF\uFF0C\u5EFA\u8BAE\u9996\u6B21\u5B89\u88C5\u7ACB\u5373\u542F\u7528\u3002" : "Improves planning, verification, subagent strategy, and rule execution quality. Recommended on first install."
1290
- )
1291
- );
1292
- const { orchestrationChoice } = await inquirer.prompt({
1293
- type: "list",
1294
- name: "orchestrationChoice",
1295
- message: isZh ? "\u8BF7\u9009\u62E9\u9ED8\u8BA4\u7F16\u6392\u7EA7\u522B\uFF1A" : "Select default orchestration level:",
1296
- default: "max",
1297
- choices: addNumbersToChoices([
1298
- {
1299
- name: isZh ? "\u9876\u7EA7\u6A21\u5F0F\uFF08\u63A8\u8350\uFF09- \u6700\u5927\u5316\u8D28\u91CF\u4E0E\u6D41\u7A0B\u7EA6\u675F" : "Expert Mode (Recommended) - Maximum quality and workflow enforcement",
1300
- value: "max"
1301
- },
1302
- {
1303
- name: isZh ? "\u6807\u51C6\u6A21\u5F0F - \u5E73\u8861\u8D28\u91CF\u4E0E\u901F\u5EA6" : "Standard Mode - Balanced quality and speed",
1304
- value: "standard"
1305
- },
1306
- {
1307
- name: isZh ? "\u8F7B\u91CF\u6A21\u5F0F - \u66F4\u5C11\u6D41\u7A0B\uFF0C\u66F4\u5FEB\u6267\u884C" : "Minimal Mode - Lighter process, faster execution",
1308
- value: "minimal"
1309
- },
1310
- {
1311
- name: isZh ? "\u5173\u95ED - \u4E0D\u542F\u7528\u7F16\u6392\u7B56\u7565" : "Off - Disable orchestration policy",
1312
- value: "off"
1313
- }
1314
- ])
1315
- });
1316
- options.orchestration = orchestrationChoice;
1317
- console.log(
1318
- a.green(
1319
- `\u2714 ${isZh ? "\u5DF2\u8BBE\u4E3A\u9ED8\u8BA4\u9996\u9009" : "Set as default first choice"}: ${orchestrationChoice}`
1320
- )
1321
- );
1322
- }
1323
- if (!options.skipPrompt && !options.skipBanner)
1324
- tracker.nextStep("Configuring API");
1325
- let apiConfig = null;
1326
- if (action !== "docs-only" && (isNewInstall || ["backup", "merge", "new"].includes(action))) {
1327
- if (options.skipPrompt) {
1328
- if (options.apiConfigs || options.apiConfigsFile) {
1329
- await handleMultiConfigurations(options, codeToolType);
1330
- apiConfig = null;
1331
- if (codeToolType === "claude-code") {
1332
- clearMyclaudeProviderProfiles();
1333
- }
1334
- } else if (options.provider && options.apiKey) {
1335
- const { getProviderPreset } = await import('./api-providers.mjs');
1336
- const preset = options.provider !== "custom" ? getProviderPreset(options.provider) : null;
1337
- apiConfig = {
1338
- authType: preset?.claudeCode?.authType || "api_key",
1339
- key: options.apiKey,
1340
- url: preset?.claudeCode?.baseUrl || options.apiUrl || API_DEFAULT_URL
1341
- };
1342
- await saveSingleConfigToToml(apiConfig, options.provider, options);
1343
- } else if (options.apiType === "auth_token" && options.apiKey) {
1344
- apiConfig = {
1345
- authType: "auth_token",
1346
- key: options.apiKey,
1347
- url: options.apiUrl || API_DEFAULT_URL
1348
- };
1349
- await saveSingleConfigToToml(apiConfig, void 0, options);
1350
- } else if (options.apiType === "api_key" && options.apiKey) {
1351
- apiConfig = {
1352
- authType: "api_key",
1353
- key: options.apiKey,
1354
- url: options.apiUrl || API_DEFAULT_URL
1355
- };
1356
- await saveSingleConfigToToml(apiConfig, void 0, options);
1357
- } else if (options.apiType === "ccr_proxy") {
1358
- const ccrStatus = await isCcrInstalled();
1359
- if (!ccrStatus.hasCorrectPackage) {
1360
- await installCcr();
1361
- } else {
1362
- console.log(a.green(`\u2714 ${i18n.t("ccr:ccrAlreadyInstalled")}`));
1363
- }
1364
- const existingCcrConfig = readCcrConfig();
1365
- if (existingCcrConfig) {
1366
- const backupPath = await backupCcrConfig();
1367
- if (backupPath) {
1368
- console.log(a.gray(`\u2714 ${i18n.t("ccr:ccrBackupSuccess")}: ${backupPath}`));
1369
- }
1370
- }
1371
- const defaultCcrConfig = createDefaultCcrConfig();
1372
- writeCcrConfig(defaultCcrConfig);
1373
- console.log(a.green(`\u2714 ${i18n.t("ccr:ccrConfigSuccess")}`));
1374
- await configureCcrProxy(defaultCcrConfig, codeToolType);
1375
- console.log(a.green(`\u2714 ${i18n.t("ccr:proxyConfigSuccess")}`));
1376
- try {
1377
- addCompletedOnboarding(codeToolType);
1378
- } catch (error) {
1379
- console.error(a.red(i18n.t("errors:failedToSetOnboarding")), error);
1380
- }
1381
- apiConfig = null;
1382
- }
1383
- } else {
1384
- const existingApiConfig = getExistingApiConfig(codeToolType);
1385
- const apiMode = await selectApiConfigurationMode();
1386
- switch (apiMode) {
1387
- case "official": {
1388
- const success = switchToOfficialLogin(codeToolType);
1389
- if (success) {
1390
- console.log(a.green(`\u2714 ${i18n.t("api:officialLoginConfigured")}`));
1391
- apiConfig = null;
1392
- } else {
1393
- console.log(a.red(i18n.t("api:officialLoginFailed")));
1394
- }
1395
- break;
1396
- }
1397
- case "custom":
1398
- apiConfig = await handleCustomApiConfiguration(existingApiConfig);
1399
- break;
1400
- case "ccr": {
1401
- const ccrStatus = await isCcrInstalled();
1402
- if (!ccrStatus.hasCorrectPackage) {
1403
- await installCcr();
1404
- } else {
1405
- console.log(a.green(`\u2714 ${i18n.t("ccr:ccrAlreadyInstalled")}`));
1406
- }
1407
- const ccrConfigured = await setupCcrConfiguration(codeToolType);
1408
- if (ccrConfigured) {
1409
- console.log(a.green(`\u2714 ${i18n.t("ccr:ccrSetupComplete")}`));
1410
- apiConfig = null;
1411
- }
1412
- break;
1413
- }
1414
- case "skip":
1415
- apiConfig = null;
1416
- break;
1417
- default:
1418
- console.log(a.yellow(i18n.t("common:cancelled")));
1419
- process__default.exit(0);
1420
- }
1421
- }
1422
- }
1423
- if (["backup", "docs-only", "merge"].includes(action)) {
1424
- const backupDir = backupExistingConfig(codeToolType);
1425
- if (backupDir) {
1426
- console.log(a.gray(`\u2714 ${i18n.t("configuration:backupSuccess")}: ${backupDir}`));
1427
- }
1428
- }
1429
- if (action === "docs-only") {
1430
- copyConfigFiles(true, codeToolType);
1431
- if (options.skipPrompt) {
1432
- if (options.workflows !== false) {
1433
- await selectAndInstallWorkflows(configLang, options.workflows, { codeToolType });
1434
- }
1435
- } else {
1436
- await selectAndInstallWorkflows(configLang, void 0, { codeToolType });
1437
- }
1438
- } else if (["backup", "merge", "new"].includes(action)) {
1439
- copyConfigFiles(false, codeToolType);
1440
- if (options.skipPrompt) {
1441
- if (options.workflows !== false) {
1442
- await selectAndInstallWorkflows(configLang, options.workflows, { codeToolType });
1443
- }
1444
- } else {
1445
- await selectAndInstallWorkflows(configLang, void 0, { codeToolType });
1446
- }
1447
- }
1448
- applyAiLanguageDirective(aiOutputLang, codeToolType);
1449
- if (options.skipPrompt) {
1450
- if (options.outputStyles !== false) {
1451
- await configureOutputStyle(options.outputStyles, options.defaultOutputStyle, codeToolType);
1452
- }
1453
- } else {
1454
- await configureOutputStyle(void 0, void 0, codeToolType);
1455
- }
1456
- if (apiConfig && action !== "docs-only") {
1457
- const configuredApi = configureApi(apiConfig, codeToolType);
1458
- if (configuredApi) {
1459
- console.log(a.green(`\u2714 ${i18n.t("api:apiConfigSuccess")}`));
1460
- console.log(a.gray(` URL: ${configuredApi.url}`));
1461
- console.log(a.gray(` Key: ${formatApiKeyDisplay(configuredApi.key)}`));
1462
- if (codeToolType === "clavue") {
1463
- try {
1464
- if (!configuredApi.authType) {
1465
- throw new Error("Configured API is missing authType");
1466
- }
1467
- const profile = await convertSingleConfigToProfile(
1468
- {
1469
- authType: configuredApi.authType,
1470
- key: configuredApi.key,
1471
- url: configuredApi.url
1472
- },
1473
- options.provider,
1474
- {
1475
- apiModel: options.apiModel,
1476
- apiHaikuModel: options.apiHaikuModel,
1477
- apiSonnetModel: options.apiSonnetModel,
1478
- apiOpusModel: options.apiOpusModel
1479
- }
1480
- );
1481
- setMyclaudeProviderProfiles([
1482
- {
1483
- id: profile.id || profile.name,
1484
- name: profile.name,
1485
- provider: options.provider || "custom",
1486
- apiKey: profile.apiKey,
1487
- baseUrl: profile.baseUrl,
1488
- model: profile.primaryModel,
1489
- fastModel: profile.defaultHaikuModel,
1490
- authType: profile.authType,
1491
- primaryModel: profile.primaryModel,
1492
- defaultHaikuModel: profile.defaultHaikuModel,
1493
- defaultSonnetModel: profile.defaultSonnetModel,
1494
- defaultOpusModel: profile.defaultOpusModel
1495
- }
1496
- ], profile.id || profile.name);
1497
- } catch (error) {
1498
- console.log(a.yellow(`\u26A0 Failed to write Clavue provider profile: ${error}`));
1499
- }
1500
- } else if (codeToolType === "claude-code") {
1501
- clearMyclaudeProviderProfiles();
1502
- }
1503
- }
1504
- }
1505
- const hasModelParams = options.apiModel || options.apiHaikuModel || options.apiSonnetModel || options.apiOpusModel;
1506
- if (hasModelParams && action !== "docs-only" && (codeToolType === "claude-code" || codeToolType === "clavue")) {
1507
- if (options.skipPrompt) {
1508
- const { updateCustomModel } = await import('./config.mjs').then(function (n) { return n.k; });
1509
- updateCustomModel(
1510
- options.apiModel || void 0,
1511
- options.apiHaikuModel || void 0,
1512
- options.apiSonnetModel || void 0,
1513
- options.apiOpusModel || void 0,
1514
- codeToolType
1515
- );
1516
- console.log(a.green(`\u2714 ${i18n.t("api:modelConfigSuccess")}`));
1517
- if (options.apiModel) {
1518
- console.log(a.gray(` ${i18n.t("api:primaryModel")}: ${options.apiModel}`));
1519
- }
1520
- if (options.apiHaikuModel)
1521
- console.log(a.gray(` Haiku: ${options.apiHaikuModel}`));
1522
- if (options.apiSonnetModel)
1523
- console.log(a.gray(` Sonnet: ${options.apiSonnetModel}`));
1524
- if (options.apiOpusModel)
1525
- console.log(a.gray(` Opus: ${options.apiOpusModel}`));
1526
- }
1527
- }
1528
- if (!options.skipPrompt && !options.skipBanner)
1529
- tracker.nextStep("Installing MCP services");
1530
- if (action !== "docs-only") {
1531
- let shouldConfigureMcp = false;
1532
- if (options.skipPrompt) {
1533
- shouldConfigureMcp = options.mcpServices !== false;
1534
- } else {
1535
- const userChoice = await promptBoolean({
1536
- message: i18n.t("mcp:configureMcp"),
1537
- defaultValue: true
1538
- });
1539
- shouldConfigureMcp = userChoice;
1540
- }
1541
- if (shouldConfigureMcp) {
1542
- if (isWindows()) {
1543
- console.log(a.green(`\u2139 ${i18n.t("installation:windowsDetected")}`));
1544
- }
1545
- let selectedServices;
1546
- if (options.skipPrompt) {
1547
- selectedServices = options.mcpServices;
1548
- } else {
1549
- selectedServices = await selectMcpServices();
1550
- if (selectedServices === void 0) {
1551
- process__default.exit(0);
1552
- }
1553
- }
1554
- if (selectedServices.length > 0) {
1555
- const mcpBackupPath = backupMcpConfig(codeToolType);
1556
- if (mcpBackupPath) {
1557
- console.log(a.gray(`\u2714 ${i18n.t("mcp:mcpBackupSuccess")}: ${mcpBackupPath}`));
1558
- }
1559
- const newServers = {};
1560
- for (const serviceId of selectedServices) {
1561
- const services = await getMcpServices();
1562
- const service = services.find((s) => s.id === serviceId);
1563
- if (!service)
1564
- continue;
1565
- let config = service.config;
1566
- if (service.id === "serena" && Array.isArray(config.args)) {
1567
- const adjusted = { ...config, args: [...config.args || []] };
1568
- const idx = adjusted.args.indexOf("--context");
1569
- if (idx >= 0 && idx + 1 < adjusted.args.length) {
1570
- adjusted.args[idx + 1] = codeToolType === "codex" ? "codex" : "ide-assistant";
1571
- } else {
1572
- adjusted.args.push(
1573
- "--context",
1574
- codeToolType === "codex" ? "codex" : "ide-assistant"
1575
- );
1576
- }
1577
- config = adjusted;
1578
- }
1579
- if (service.requiresApiKey) {
1580
- if (options.skipPrompt) {
1581
- console.log(
1582
- a.yellow(`${i18n.t("common:skip")}: ${service.name} (requires API key)`)
1583
- );
1584
- continue;
1585
- } else {
1586
- const response = await inquirer.prompt({
1587
- type: "input",
1588
- name: "apiKey",
1589
- message: service.apiKeyPrompt,
1590
- validate: (value) => !!value || i18n.t("api:keyRequired")
1591
- });
1592
- if (!response.apiKey) {
1593
- console.log(a.yellow(`${i18n.t("common:skip")}: ${service.name}`));
1594
- continue;
1595
- }
1596
- config = buildMcpServerConfig(
1597
- service.config,
1598
- response.apiKey,
1599
- service.apiKeyPlaceholder,
1600
- service.apiKeyEnvVar
1601
- );
1602
- }
1603
- }
1604
- newServers[service.id] = config;
1605
- }
1606
- const existingConfig = readMcpConfig(codeToolType);
1607
- let mergedConfig = replaceMcpServers(existingConfig, newServers);
1608
- mergedConfig = fixWindowsMcpConfig(mergedConfig);
1609
- try {
1610
- writeMcpConfig(mergedConfig, codeToolType);
1611
- syncMcpPermissions(codeToolType);
1612
- console.log(a.green(`\u2714 ${i18n.t("mcp:mcpConfigSuccess")}`));
1613
- const { checkMcpPerformance, formatPerformanceWarning } = await import('./mcp-performance.mjs').then(function (n) { return n.e; });
1614
- const serviceCount = Object.keys(newServers).length;
1615
- const perfWarning = checkMcpPerformance(serviceCount);
1616
- if (perfWarning) {
1617
- console.log("");
1618
- console.log(formatPerformanceWarning(perfWarning, i18n.language));
1619
- }
1620
- } catch (error) {
1621
- displayError(error, "MCP configuration");
1622
- }
1623
- }
1624
- }
1625
- }
1626
- const cometixInstalled = await isCometixLineInstalled();
1627
- if (!cometixInstalled) {
1628
- let shouldInstallCometix = false;
1629
- if (options.skipPrompt) {
1630
- shouldInstallCometix = options.installCometixLine !== false;
1631
- } else {
1632
- const userChoice = await promptBoolean({
1633
- message: i18n.t("cometix:installCometixPrompt"),
1634
- defaultValue: true
1635
- });
1636
- shouldInstallCometix = userChoice;
1637
- }
1638
- if (shouldInstallCometix) {
1639
- await installCometixLine();
1640
- } else {
1641
- console.log(a.yellow(i18n.t("cometix:cometixSkipped")));
1642
- }
1643
- } else {
1644
- console.log(a.green(`\u2714 ${i18n.t("cometix:cometixAlreadyInstalled")}`));
1645
- }
1646
- if (!options.skipPrompt || options.installSuperpowers) {
1647
- await handleSuperpowersInstallation(options);
1648
- }
1649
- let agentBrowserReady = false;
1650
- try {
1651
- const isZh = i18n.language === "zh-CN";
1652
- let shouldInstallAgentBrowser = false;
1653
- if (options.skipPrompt) {
1654
- shouldInstallAgentBrowser = options.installAgentBrowser !== false;
1655
- } else {
1656
- shouldInstallAgentBrowser = await promptBoolean({
1657
- message: isZh ? "\u5B89\u88C5 Agent Browser \u6D4F\u89C8\u5668\u81EA\u52A8\u5316\u6A21\u5757\uFF1F\uFF08\u63A8\u8350\uFF0C\u6D4F\u89C8\u5668\u4EFB\u52A1\u53EF\u65E0\u7F1D\u4F7F\u7528\uFF09" : "Install Agent Browser module? (recommended for seamless browser automation)",
1658
- defaultValue: true
1659
- });
1660
- }
1661
- if (shouldInstallAgentBrowser) {
1662
- const { checkAgentBrowserInstalled, installAgentBrowser } = await import('./installer2.mjs');
1663
- const installed = await checkAgentBrowserInstalled();
1664
- const success = installed ? true : await installAgentBrowser();
1665
- if (success) {
1666
- const { addSkill } = await import('./manager.mjs');
1667
- const { browserSkill } = await import('./skill.mjs');
1668
- addSkill(browserSkill);
1669
- agentBrowserReady = true;
1670
- console.log(
1671
- a.green(
1672
- `\u2714 ${isZh ? "Agent Browser \u5DF2\u5C31\u7EEA\uFF0C\u6D4F\u89C8\u5668 Skill \u5DF2\u542F\u7528" : "Agent Browser ready, browser skill enabled"}`
1673
- )
1674
- );
1675
- console.log(
1676
- a.gray(
1677
- ` ${isZh ? "\u53EF\u76F4\u63A5\u4F7F\u7528:" : "Use directly:"} ccjk browser start https://example.com`
1678
- )
1679
- );
1680
- }
1681
- } else {
1682
- console.log(
1683
- a.yellow(
1684
- isZh ? "\u26A0 \u5DF2\u8DF3\u8FC7 Agent Browser \u5B89\u88C5" : "\u26A0 Agent Browser installation skipped"
1685
- )
1686
- );
1687
- }
1688
- } catch (error) {
1689
- const msg = error instanceof Error ? error.message : String(error);
1690
- console.log(a.gray(`\u2139 Agent Browser setup skipped: ${msg}`));
1691
- }
1692
- try {
1693
- const { injectSmartGuide } = await import('./smart-guide.mjs');
1694
- const smartGuideSuccess = await injectSmartGuide(configLang, codeToolType);
1695
- if (smartGuideSuccess) {
1696
- console.log(a.green(`\u2714 ${i18n.t("smartGuide:enabled")}`));
1697
- }
1698
- } catch {
1699
- console.log(a.gray(`\u2139 ${i18n.t("smartGuide:skipped")}`));
1700
- }
1701
- try {
1702
- const finalOrchestrationLevel = parseOrchestrationLevel(options.orchestration);
1703
- const policyPath = writeOrchestrationPolicy({
1704
- level: finalOrchestrationLevel,
1705
- language: configLang,
1706
- source: options.initSource
1707
- });
1708
- console.log(
1709
- a.green(`\u2714 Workflow orchestration: ${finalOrchestrationLevel} (${policyPath})`)
1710
- );
1711
- } catch (error) {
1712
- const msg = error instanceof Error ? error.message : String(error);
1713
- console.log(a.gray(`\u2139 Workflow orchestration skipped: ${msg}`));
1714
- }
1715
- if (!options.skipPrompt && !options.skipBanner)
1716
- tracker.nextStep("Finalizing setup");
1717
- updateZcfConfig({
1718
- version: ccjkVersion,
1719
- preferredLang: i18n.language,
1720
- // CCJK界面语言
1721
- templateLang: configLang,
1722
- // 模板语言
1723
- aiOutputLang,
1724
- codeToolType
1725
- });
1726
- const defaultArchetype = getDefaultArchetypeProfile(codeToolType);
1727
- const runtimeDistribution = codeToolType === "clavue" ? "clavue" : codeToolType === "claude-code" ? "claude-code" : "generic";
1728
- updateTomlConfig(ZCF_CONFIG_FILE, {
1729
- adaptation: {
1730
- runtimeProfile: {
1731
- target: codeToolType,
1732
- distribution: runtimeDistribution,
1733
- compatMode: codeToolType === "clavue" ? "native" : "compatible",
1734
- providerStrategy: codeToolType === "clavue" ? "profile-based" : "env-based"
1735
- },
1736
- archetypeProfile: defaultArchetype,
1737
- capabilityProfile: {
1738
- coding: true,
1739
- planning: true,
1740
- taskTracking: true,
1741
- memory: true,
1742
- browserAutomation: false,
1743
- research: true,
1744
- documentAuthoring: false,
1745
- serviceOps: false,
1746
- multiAgent: codeToolType === "clavue"
1747
- },
1748
- policyProfile: {
1749
- permissionPreset: "dev",
1750
- verificationMode: "required",
1751
- destructiveActionPolicy: "confirm",
1752
- workflowFallbackMode: "graceful"
1753
- },
1754
- contextProfile: {
1755
- memoryMode: "project-aware",
1756
- compressionMode: "runtime-native",
1757
- instructionLayering: "runtime-first"
1758
- },
1759
- profileSelection: {
1760
- workflowPack: "desktop-engineering",
1761
- toolPack: "typescript-node-react"
1762
- },
1763
- uiProfile: {
1764
- language: configLang,
1765
- outputStyle: "concise",
1766
- operatorMode: "execution-first"
1767
- }
1768
- }
1769
- });
1770
- if (!options.skipPrompt) {
1771
- const { importRecommendedEnv, importRecommendedPermissions } = await import('./simple-config.mjs');
1772
- const confirmImport = await promptBoolean({
1773
- message: i18n.t("configuration:recommendImportEnvPerm") || "\u5BFC\u5165 CCJK \u63A8\u8350\u7684\u73AF\u5883\u53D8\u91CF\u548C\u6743\u9650\u914D\u7F6E\uFF1F\uFF08\u63A8\u8350\uFF0C\u53EF\u51CF\u5C11\u6743\u9650\u5F39\u7A97\uFF09",
1774
- defaultValue: true
1775
- });
1776
- if (confirmImport) {
1777
- try {
1778
- await importRecommendedEnv();
1779
- console.log(a.green(`\u2714 ${i18n.t("configuration:envImportSuccess")}`));
1780
- } catch (error) {
1781
- console.error(a.yellow(`\u26A0 ${i18n.t("configuration:envImportFailed")}: ${error}`));
1782
- }
1783
- try {
1784
- await importRecommendedPermissions();
1785
- console.log(
1786
- a.green(`\u2714 ${i18n.t("configuration:permissionsImportSuccess") || "\u6743\u9650\u914D\u7F6E\u5DF2\u5BFC\u5165"}`)
1787
- );
1788
- } catch (error) {
1789
- console.error(
1790
- a.yellow(`\u26A0 ${i18n.t("configuration:permissionsImportFailed")}: ${error}`)
1791
- );
1792
- }
1793
- console.log();
1794
- }
1795
- }
1796
- if (!options.skipPrompt && !options.skipBanner)
1797
- tracker.complete();
1798
- const completionGuidance = getSetupCompletionGuidance(codeToolType);
1799
- console.log("");
1800
- console.log(
1801
- a.bold.green("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")
1802
- );
1803
- console.log(
1804
- a.bold.green("\u2551") + a.bold.white(padToDisplayWidth(` ${i18n.t("configuration:setupCompleteTitle")}`, 62)) + a.bold.green("\u2551")
1805
- );
1806
- console.log(
1807
- a.bold.green("\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563")
1808
- );
1809
- console.log(
1810
- `${a.bold.green("\u2551")} ${a.bold.green("\u2551")}`
1811
- );
1812
- console.log(
1813
- a.bold.green("\u2551") + a.green(padToDisplayWidth(` ${i18n.t("configuration:nextSteps")}`, 62)) + a.bold.green("\u2551")
1814
- );
1815
- console.log(
1816
- `${a.bold.green("\u2551")} ${a.bold.green("\u2551")}`
1817
- );
1818
- console.log(
1819
- a.bold.green("\u2551") + padToDisplayWidth(` ${completionGuidance.step1}`, 62) + a.bold.green("\u2551")
1820
- );
1821
- console.log(
1822
- a.bold.green("\u2551") + a.dim(padToDisplayWidth(` ${completionGuidance.step1Detail}`, 62)) + a.bold.green("\u2551")
1823
- );
1824
- console.log(
1825
- a.bold.green("\u2551") + a.dim(padToDisplayWidth(` ${completionGuidance.step1Detail2}`, 62)) + a.bold.green("\u2551")
1826
- );
1827
- console.log(
1828
- `${a.bold.green("\u2551")} ${a.bold.green("\u2551")}`
1829
- );
1830
- console.log(
1831
- a.bold.green("\u2551") + padToDisplayWidth(` ${completionGuidance.step2}`, 62) + a.bold.green("\u2551")
1832
- );
1833
- console.log(
1834
- a.bold.green("\u2551") + a.green(padToDisplayWidth(` ${completionGuidance.step2Example}`, 62)) + a.bold.green("\u2551")
1835
- );
1836
- console.log(
1837
- `${a.bold.green("\u2551")} ${a.bold.green("\u2551")}`
1838
- );
1839
- console.log(
1840
- a.bold.green("\u2551") + padToDisplayWidth(` ${completionGuidance.step3} `, 44) + a.yellow(padToDisplayWidth(completionGuidance.step3Command, 18)) + a.bold.green("\u2551")
1841
- );
1842
- console.log(
1843
- a.bold.green("\u2551") + padToDisplayWidth(` ${completionGuidance.step4} `, 44) + a.yellow(padToDisplayWidth(completionGuidance.step4Command, 18)) + a.bold.green("\u2551")
1844
- );
1845
- console.log(
1846
- a.bold.green("\u2551") + padToDisplayWidth(` ${completionGuidance.step5} `, 44) + a.yellow(padToDisplayWidth(completionGuidance.step5Command, 18)) + a.bold.green("\u2551")
1847
- );
1848
- console.log(
1849
- `${a.bold.green("\u2551")} ${a.bold.green("\u2551")}`
1850
- );
1851
- console.log(
1852
- a.bold.green("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")
1853
- );
1854
- if (isNewInstall || ["backup", "merge", "new"].includes(action)) {
1855
- const isZh = i18n.language === "zh-CN";
1856
- console.log(
1857
- a.cyan(
1858
- isZh ? "\u{1F9E0} \u4E0A\u4E0B\u6587\u4F18\u5316\u5DF2\u542F\u7528\uFF08\u9ED8\u8BA4\uFF09" : "\u{1F9E0} Context optimization is enabled (default)"
1859
- )
1860
- );
1861
- console.log(
1862
- a.dim(
1863
- isZh ? " \u5EFA\u8BAE\u7ACB\u5373\u8FD0\u884C: ccjk morning \u67E5\u770B\u5065\u5EB7\u5206\u4E0E\u6536\u76CA\u6458\u8981" : " Recommended now: ccjk morning to view health score and value summary"
1864
- )
1865
- );
1866
- console.log(
1867
- a.dim(
1868
- isZh ? " \u6DF1\u5EA6\u590D\u76D8: ccjk review | \u4E0A\u4E0B\u6587\u8BE6\u60C5: ccjk context --show" : " Deep review: ccjk review | Context details: ccjk context --show"
1869
- )
1870
- );
1871
- if (agentBrowserReady) {
1872
- console.log(
1873
- a.cyan(
1874
- isZh ? "\u{1F310} \u6D4F\u89C8\u5668\u81EA\u52A8\u5316\u5DF2\u5C31\u7EEA\uFF08\u65E0\u7F1D\uFF09" : "\u{1F310} Browser automation is ready (seamless)"
1875
- )
1876
- );
1877
- console.log(
1878
- a.dim(
1879
- isZh ? " \u76F4\u63A5\u5F00\u59CB: ccjk browser start https://example.com" : " Start directly: ccjk browser start https://example.com"
1880
- )
1881
- );
1882
- console.log(
1883
- a.dim(
1884
- isZh ? " \u5E38\u7528\u64CD\u4F5C: ccjk browser status | ccjk browser stop" : " Common actions: ccjk browser status | ccjk browser stop"
1885
- )
1886
- );
1887
- }
1888
- }
1889
- console.log("");
1890
- } catch (error) {
1891
- if (!handleExitPromptError(error)) {
1892
- displayError(error, "Initialization");
1893
- handleGeneralError(error);
1894
- }
1895
- }
1896
- }
1897
-
1898
- const init$1 = {
1899
- __proto__: null,
1900
- convertSingleConfigToProfile: convertSingleConfigToProfile,
1901
- getSetupCompletionGuidance: getSetupCompletionGuidance,
1902
- handleMultiConfigurations: handleMultiConfigurations,
1903
- init: init,
1904
- saveSingleConfigToToml: saveSingleConfigToToml,
1905
- silentInit: silentInit,
1906
- smartInit: smartInit,
1907
- validateApiConfigs: validateApiConfigs,
1908
- validateSkipPromptOptions: validateSkipPromptOptions
1909
- };
1910
-
1911
- export { COMETIX_COMMAND_NAME as C, COMETIX_COMMANDS as a, installCometixLine as b, init$1 as c, init as i };